2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2019-10-28 14:48:53 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
2021-02-27 04:50:02 -03:00
|
|
|
#include <AK/HashMap.h>
|
|
|
|
|
#include <LibGUI/AutocompleteProvider.h>
|
2020-02-06 16:33:02 -03:00
|
|
|
#include <LibGUI/Widget.h>
|
2019-10-28 14:48:53 -03:00
|
|
|
|
2020-08-17 10:22:30 -03:00
|
|
|
namespace HackStudio {
|
|
|
|
|
|
2020-02-02 11:07:41 -03:00
|
|
|
class Locator final : public GUI::Widget {
|
2019-10-28 14:48:53 -03:00
|
|
|
C_OBJECT(Locator)
|
|
|
|
|
public:
|
|
|
|
|
virtual ~Locator() override;
|
|
|
|
|
|
|
|
|
|
void open();
|
|
|
|
|
void close();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void update_suggestions();
|
2020-02-02 11:07:41 -03:00
|
|
|
void open_suggestion(const GUI::ModelIndex&);
|
2019-10-28 14:48:53 -03:00
|
|
|
|
2021-04-04 00:37:09 -03:00
|
|
|
Locator(Core::Object* parent = nullptr);
|
2019-10-28 14:48:53 -03:00
|
|
|
|
2020-05-26 23:17:06 -03:00
|
|
|
RefPtr<GUI::TextBox> m_textbox;
|
2020-02-02 11:07:41 -03:00
|
|
|
RefPtr<GUI::Window> m_popup_window;
|
|
|
|
|
RefPtr<GUI::TableView> m_suggestion_view;
|
2019-10-28 14:48:53 -03:00
|
|
|
};
|
2020-08-17 10:22:30 -03:00
|
|
|
|
|
|
|
|
}
|