summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.h
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-06 21:04:36 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-06 21:04:36 +0200
commit22a1f909b46a415bab02c5fb49d5297e3899b7f3 (patch)
tree713ebafb25730bb79f8502bdcbc7c18301898bbf /indra/newview/llchiclet.h
parenta9653b37ec29a1bd4c23efdd1d83df15c8bcccdd (diff)
parentf716bb1e3afd4c950c379dfa702246979de467e6 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchiclet.h')
-rw-r--r--indra/newview/llchiclet.h76
1 files changed, 32 insertions, 44 deletions
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 21909d2577..a830240b7d 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -149,11 +149,11 @@ protected:
/*
* Class for displaying status of Voice Chat
*/
-class LLChicletSpeakerCtrl : public LLOutputMonitorCtrl
+class LLChicletSpeakerCtrl : public LLIconCtrl
{
public:
- struct Params : public LLInitParam::Block<Params, LLOutputMonitorCtrl::Params>
+ struct Params : public LLInitParam::Block<Params, LLIconCtrl::Params>
{
Params(){};
};
@@ -266,6 +266,8 @@ private:
* Base class for Instant Message chiclets.
* IMChiclet displays icon, number of unread messages(optional)
* and voice chat status(optional).
+* Every chiclet should override LLUICtrl::getRequiredRect and return
+* desired width.
*/
class LLIMChiclet : public LLChiclet
{
@@ -304,14 +306,9 @@ public:
virtual LLUUID getOtherParticipantId() { return mOtherParticipantId; }
/*
- * Init Speaker Control with speaker's ID
+ * Shows/hides voice chat status control.
*/
- virtual void initSpeakerControl();
-
- /*
- * set status (Shows/Hide) for voice control.
- */
- virtual void setShowSpeaker(bool show);
+ virtual void setShowSpeaker(bool show) { mShowSpeaker = show; }
/*
* Returns voice chat status control visibility.
@@ -319,11 +316,6 @@ public:
virtual bool getShowSpeaker() {return mShowSpeaker;};
/*
- * Shows/Hides for voice control for a chiclet.
- */
- virtual void toggleSpeakerControl();
-
- /*
* Shows/hides overlay icon concerning new unread messages.
*/
virtual void setShowNewMessagesIcon(bool show);
@@ -333,7 +325,10 @@ public:
*/
virtual bool getShowNewMessagesIcon();
- virtual void draw();
+ /*
+ * Draws border around chiclet.
+ */
+ /*virtual*/ void draw();
/**
* Determine whether given ID refers to a group or an IM chat session.
@@ -368,8 +363,6 @@ protected:
LLIconCtrl* mNewMessagesIcon;
LLChicletNotificationCounterCtrl* mCounterCtrl;
- LLChicletSpeakerCtrl* mSpeakerCtrl;
-
/** the id of another participant, either an avatar id or a group id*/
LLUUID mOtherParticipantId;
@@ -417,6 +410,8 @@ public:
/* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id);
+ /*virtual*/ void setShowSpeaker(bool show);
+
/*
* 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.
@@ -424,14 +419,15 @@ public:
/*virtual*/ void setCounter(S32);
/*
- * Init Speaker Control with speaker's ID
+ * Returns number of unread messages.
*/
- /*virtual*/ void initSpeakerControl();
+ /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
/*
- * Returns number of unread messages.
+ * Returns rect, required to display chiclet.
+ * Width is the only valid value.
*/
- /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
+ /*virtual*/ LLRect getRequiredRect();
protected:
LLIMP2PChiclet(const Params& p);
@@ -461,6 +457,7 @@ protected:
private:
LLChicletAvatarIconCtrl* mChicletIconCtrl;
+ LLChicletSpeakerCtrl* mSpeakerCtrl;
LLMenuGL* mPopupMenu;
};
@@ -498,19 +495,15 @@ public:
/*virtual*/ void setCounter(S32);
/*
- * Keep Speaker Control with actual speaker's ID
- */
- /*virtual*/ void draw();
-
- /*
- * Init Speaker Control with speaker's ID
+ * Returns number of unread messages.
*/
- /*virtual*/ void initSpeakerControl();
+ /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
/*
- * Returns number of unread messages.
+ * Returns rect, required to display chiclet.
+ * Width is the only valid value.
*/
- /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
+ /*virtual*/ LLRect getRequiredRect();
protected:
LLAdHocChiclet(const Params& p);
@@ -524,6 +517,7 @@ protected:
private:
LLChicletAvatarIconCtrl* mChicletIconCtrl;
+ LLChicletSpeakerCtrl* mSpeakerCtrl;
LLMenuGL* mPopupMenu;
};
@@ -553,17 +547,14 @@ public:
*/
/*virtual*/ void setSessionId(const LLUUID& session_id);
- /*
- * Keep Speaker Control with actual speaker's ID
- */
- /*virtual*/ void draw();
-
/**
* Callback for LLGroupMgrObserver, we get this when group data is available or changed.
* Sets group icon.
*/
/*virtual*/ void changed(LLGroupChange gc);
+ /*virtual*/ void setShowSpeaker(bool show);
+
/*
* 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.
@@ -571,14 +562,15 @@ public:
/*virtual*/ void setCounter(S32);
/*
- * Init Speaker Control with speaker's ID
+ * Returns number of unread messages.
*/
- /*virtual*/ void initSpeakerControl();
+ /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
/*
- * Returns number of unread messages.
+ * Returns rect, required to display chiclet.
+ * Width is the only valid value.
*/
- /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
+ /*virtual*/ LLRect getRequiredRect();
~LLIMGroupChiclet();
@@ -605,6 +597,7 @@ protected:
private:
LLChicletGroupIconCtrl* mChicletIconCtrl;
+ LLChicletSpeakerCtrl* mSpeakerCtrl;
LLMenuGL* mPopupMenu;
};
@@ -743,11 +736,6 @@ public:
/*virtual*/ BOOL postBuild();
/*
- * Handler for the Voice Client's signal. Finds a corresponding chiclet and toggles its SpeakerControl
- */
- void onCurrentVoiceChannelChanged(const LLUUID& session_id);
-
- /*
* Reshapes controls and rearranges chiclets if needed.
*/
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE );