diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-12-07 17:09:19 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-12-07 17:09:19 -0800 |
commit | 5c2686bc6323cb162d9b3e4effa6a8d34fb95836 (patch) | |
tree | 8162047cfafa9027dbcdc03597f8a0a2ad92c9ee /indra/newview/llchiclet.h | |
parent | b65334a4c133984fed9466db60df92756e8de05d (diff) | |
parent | 5245fb69721bf4b70de85211da6721b0e0137e07 (diff) |
Merge
Diffstat (limited to 'indra/newview/llchiclet.h')
-rw-r--r-- | indra/newview/llchiclet.h | 61 |
1 files changed, 51 insertions, 10 deletions
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index c75ad2b546..609ce16713 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -39,6 +39,7 @@ #include "lltextbox.h" #include "lloutputmonitorctrl.h" #include "llgroupmgr.h" +#include "llimview.h" class LLVoiceControlPanel; class LLMenuGL; @@ -746,7 +747,7 @@ private: * Implements notification chiclet. Used to display total amount of unread messages * across all IM sessions, total amount of system notifications. */ -class LLNotificationChiclet : public LLChiclet +class LLSysWellChiclet : public LLChiclet { public: @@ -768,28 +769,68 @@ public: boost::signals2::connection setClickCallback(const commit_callback_t& cb); - /*virtual*/ ~LLNotificationChiclet(); + /*virtual*/ ~LLSysWellChiclet(); - // methods for updating a number of unread System notifications - void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } - void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } void setToggleState(BOOL toggled); protected: - // connect counter updaters to the corresponding signals - void connectCounterUpdatersToSignal(std::string notification_type); - LLNotificationChiclet(const Params& p); + LLSysWellChiclet(const Params& p); friend class LLUICtrlFactory; - static S32 mUreadSystemNotifications; - protected: LLButton* mButton; S32 mCounter; }; /** + * Class represented a chiclet for IM Well Icon. + * + * It displays a count of unread messages from other participants in all IM sessions. + */ +class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver +{ + friend class LLUICtrlFactory; +public: + virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} + virtual void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); } + virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {} + + ~LLIMWellChiclet(); +protected: + LLIMWellChiclet(const Params& p); + + /** + * 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. + * + * @param[in] session_data contains session related data, is not used now + * ["session_id"] - id of an appropriate session + * ["participant_unread"] - count of unread messages from "real" participants. + * + * @see LLIMMgr::getNumberOfUnreadParticipantMessages() + */ + void messageCountChanged(const LLSD& session_data); +}; + +class LLNotificationChiclet : public LLSysWellChiclet +{ + friend class LLUICtrlFactory; +protected: + LLNotificationChiclet(const Params& p); + + // connect counter updaters to the corresponding signals + void connectCounterUpdatersToSignal(const std::string& notification_type); + + // methods for updating a number of unread System notifications + void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } + void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } + + S32 mUreadSystemNotifications; +}; + +/** * Storage class for all IM chiclets. Provides mechanism to display, * scroll, create, remove chiclets. */ |