ladybird/Userland/Libraries/LibGUI/EmojiInputDialog.h
Timothy Flynn 4cb9472f97 LibGUI: Ensure unknown emoji have a set display order
Currently, we use code point values as a tie break when sorting emoji by
display order. When multiple code point emoji are supported, this will
become a bit awkward. Rather than dealing with varying code point length
while sorting, just set a maximum display order to ensure these are
placed at the end.
2022-09-11 20:33:57 +01:00

44 lines
964 B
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <AK/OwnPtr.h>
#include <LibGUI/Dialog.h>
#include <LibUnicode/Emoji.h>
namespace GUI {
class EmojiInputDialog final : public Dialog {
C_OBJECT(EmojiInputDialog);
struct Emoji {
RefPtr<Button> button;
Unicode::Emoji emoji;
};
public:
String const& selected_emoji_text() const { return m_selected_emoji_text; }
private:
virtual void event(Core::Event&) override;
explicit EmojiInputDialog(Window* parent_window);
Vector<Emoji> supported_emoji();
void update_displayed_emoji();
OwnPtr<ActionGroup> m_category_action_group;
Optional<Unicode::EmojiGroup> m_selected_category;
RefPtr<TextBox> m_search_box;
RefPtr<Toolbar> m_toolbar;
RefPtr<Widget> m_emojis_widget;
Vector<Emoji> m_emojis;
String m_selected_emoji_text;
};
}