From 97b0ba2a6d2596da867043077e32065653d44f6e Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 19 Apr 2023 01:39:42 +0200 Subject: SL-19575 LLFloaterEmojiPicker - Add filter by category --- indra/newview/llfloateremojipicker.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloateremojipicker.h') diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index 9b442064d0..01335bbb5b 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -29,31 +29,53 @@ #include "llfloater.h" +struct LLEmojiDescriptor; + class LLFloaterEmojiPicker : public LLFloater { public: // The callback function will be called with an emoji char. - typedef boost::function select_callback_t; + typedef boost::function pick_callback_t; + typedef boost::function close_callback_t; // Call this to select an emoji. static LLFloaterEmojiPicker* getInstance(); - static LLFloaterEmojiPicker* showInstance(select_callback_t callback); + static LLFloaterEmojiPicker* showInstance(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); LLFloaterEmojiPicker(const LLSD& key); virtual ~LLFloaterEmojiPicker(); virtual BOOL postBuild(); - void show(select_callback_t callback); + void show(pick_callback_t pick_callback = nullptr, close_callback_t close_callback = nullptr); + + virtual void closeFloater(bool app_quitting = false); private: - void onSelect(); + void fillEmojis(); + bool matchesCategory(const LLEmojiDescriptor* descr); + bool matchesPattern(const LLEmojiDescriptor* descr); + + void onCategoryCommit(); + void onSearchKeystroke(class LLLineEditor* caller, void* user_data); + void onPreviewEmojiClick(); + void onEmojiSelect(); + void onEmojiEmpty(); + void onEmojiPick(); virtual BOOL handleKeyHere(KEY key, MASK mask); - class LLScrollListCtrl* mEmojis; - select_callback_t mSelectCallback; - std::string mEmojiName; + class LLComboBox* mCategory { nullptr }; + class LLLineEditor* mSearch { nullptr }; + class LLScrollListCtrl* mEmojis { nullptr }; + class LLButton* mPreviewEmoji { nullptr }; + + pick_callback_t mEmojiPickCallback; + close_callback_t mFloaterCloseCallback; + + static std::string mSelectedCategory; + static std::string mSearchPattern; + static int mSelectedEmojiIndex; }; #endif -- cgit v1.2.3