2020-05-17 16:49:54 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-05-17 16:49:54 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-09-07 16:50:45 -03:00
|
|
|
#include <AK/Optional.h>
|
|
|
|
|
#include <AK/OwnPtr.h>
|
2020-05-17 16:49:54 -03:00
|
|
|
#include <LibGUI/Dialog.h>
|
2022-09-07 14:42:15 -03:00
|
|
|
#include <LibUnicode/Emoji.h>
|
2020-05-17 16:49:54 -03:00
|
|
|
|
|
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
|
|
class EmojiInputDialog final : public Dialog {
|
|
|
|
|
C_OBJECT(EmojiInputDialog);
|
|
|
|
|
|
2022-09-06 11:30:37 -03:00
|
|
|
struct Emoji {
|
|
|
|
|
RefPtr<Button> button;
|
2022-09-09 12:37:44 -03:00
|
|
|
Unicode::Emoji emoji;
|
2022-09-06 11:30:37 -03:00
|
|
|
};
|
|
|
|
|
|
2020-05-17 16:49:54 -03:00
|
|
|
public:
|
2022-04-01 14:58:27 -03:00
|
|
|
String const& selected_emoji_text() const { return m_selected_emoji_text; }
|
2020-05-17 16:49:54 -03:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
virtual void event(Core::Event&) override;
|
|
|
|
|
explicit EmojiInputDialog(Window* parent_window);
|
|
|
|
|
|
2022-09-06 11:30:37 -03:00
|
|
|
Vector<Emoji> supported_emoji();
|
2022-09-06 09:25:02 -03:00
|
|
|
void update_displayed_emoji();
|
|
|
|
|
|
2022-09-07 16:50:45 -03:00
|
|
|
OwnPtr<ActionGroup> m_category_action_group;
|
|
|
|
|
Optional<Unicode::EmojiGroup> m_selected_category;
|
|
|
|
|
|
2022-09-06 11:59:44 -03:00
|
|
|
RefPtr<TextBox> m_search_box;
|
2022-09-07 16:50:45 -03:00
|
|
|
RefPtr<Toolbar> m_toolbar;
|
2022-09-06 09:25:02 -03:00
|
|
|
RefPtr<Widget> m_emojis_widget;
|
2022-09-06 11:30:37 -03:00
|
|
|
Vector<Emoji> m_emojis;
|
2020-05-17 16:49:54 -03:00
|
|
|
String m_selected_emoji_text;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|