diff options
Diffstat (limited to 'indra/newview/llchiclet.h')
-rw-r--r-- | indra/newview/llchiclet.h | 103 |
1 files changed, 82 insertions, 21 deletions
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index b3341f78a8..2ab6abfb5b 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -52,10 +52,19 @@ class LLChicletNotificationCounterCtrl : public LLTextBox { public: + static const S32 MAX_DISPLAYED_COUNT; + struct Params : public LLInitParam::Block<Params, LLTextBox::Params> { - Params() - {}; + /** + * Contains maximum displayed count of unread messages. Default value is 9. + * + * If count is less than "max_unread_count" will be displayed as is. + * Otherwise 9+ will be shown (for default value). + */ + Optional<S32> max_displayed_count; + + Params(); }; /** @@ -93,6 +102,7 @@ private: S32 mCounter; S32 mInitialWidth; + S32 mMaxDisplayedCount; }; /** @@ -359,6 +369,32 @@ public: virtual void toggleSpeakerControl(); /** + * Sets number of unread messages. Will update chiclet's width if number text + * exceeds size of counter and notify it's parent about size change. + */ + virtual void setCounter(S32); + + /** + * Enables/disables the counter control for a chiclet. + */ + virtual void enableCounterControl(bool enable); + + /** + * Sets show counter state. + */ + virtual void setShowCounter(bool show); + + /** + * Shows/Hides for counter control for a chiclet. + */ + virtual void toggleCounterControl(); + + /** + * Sets required width for a chiclet according to visible controls. + */ + virtual void setRequiredWidth(); + + /** * Shows/hides overlay icon concerning new unread messages. */ virtual void setShowNewMessagesIcon(bool show); @@ -400,6 +436,7 @@ protected: protected: bool mShowSpeaker; + bool mCounterEnabled; LLIconCtrl* mNewMessagesIcon; LLChicletNotificationCounterCtrl* mCounterCtrl; @@ -453,12 +490,6 @@ public: /* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id); /** - * Sets number of unread messages. Will update chiclet's width if number text - * exceeds size of counter and notify it's parent about size change. - */ - /*virtual*/ void setCounter(S32); - - /** * Init Speaker Control with speaker's ID */ /*virtual*/ void initSpeakerControl(); @@ -527,12 +558,6 @@ public: /*virtual*/ void setSessionId(const LLUUID& session_id); /** - * Sets number of unread messages. Will update chiclet's width if number text - * exceeds size of counter and notify it's parent about size change. - */ - /*virtual*/ void setCounter(S32); - - /** * Keep Speaker Control with actual speaker's ID */ /*virtual*/ void draw(); @@ -695,12 +720,6 @@ public: /*virtual*/ void changed(LLGroupChange gc); /** - * Sets number of unread messages. Will update chiclet's width if number text - * exceeds size of counter and notify it's parent about size change. - */ - /*virtual*/ void setCounter(S32); - - /** * Init Speaker Control with speaker's ID */ /*virtual*/ void initSpeakerControl(); @@ -806,6 +825,13 @@ protected: */ void changeLitState(); + /** + * Displays menu. + */ + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + + virtual void createMenu() = 0; + protected: class FlashToLitTimer; LLButton* mButton; @@ -814,7 +840,7 @@ protected: bool mIsNewMessagesState; FlashToLitTimer* mFlashToLitTimer; - + LLContextMenu* mContextMenu; }; /** @@ -835,6 +861,21 @@ protected: LLIMWellChiclet(const Params& p); /** + * Processes clicks on chiclet popup menu. + */ + virtual void onMenuItemClicked(const LLSD& user_data); + + /** + * Enables chiclet menu items. + */ + bool enableMenuItem(const LLSD& user_data); + + /** + * Creates menu. + */ + /*virtual*/ void createMenu(); + + /** * Handles changes in a session (message was added, messages were read, etc.) * * It get total count of unread messages from a LLIMMgr in all opened sessions and display it. @@ -854,6 +895,21 @@ class LLNotificationChiclet : public LLSysWellChiclet protected: LLNotificationChiclet(const Params& p); + /** + * Processes clicks on chiclet menu. + */ + void onMenuItemClicked(const LLSD& user_data); + + /** + * Enables chiclet menu items. + */ + bool enableMenuItem(const LLSD& user_data); + + /** + * Creates menu. + */ + /*virtual*/ void createMenu(); + // connect counter updaters to the corresponding signals void connectCounterUpdatersToSignal(const std::string& notification_type); @@ -994,6 +1050,11 @@ protected: bool canScrollRight(); /** + * Returns true if we need to show scroll buttons + */ + bool needShowScroll(); + + /** * Returns true if chiclets can be scrolled left. */ bool canScrollLeft(); |