summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.h
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-08 13:33:21 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-08 13:33:21 -0500
commit37848d29d9030e00086c3a499d28237cdf943e1b (patch)
treed4af1d371cf94a1970f9449b1adc8ba29e86bb9d /indra/newview/llchiclet.h
parent51a196416d9bde106ae0cb3cfd77003a68a6265b (diff)
parente07ef0d0e0e8cbd58afd4c6ee970634bd2f783e7 (diff)
automated merge viewer2.0->avp
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llchiclet.h')
-rw-r--r--indra/newview/llchiclet.h61
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.
*/