summaryrefslogtreecommitdiff
path: root/indra/newview/llparticipantlist.h
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2009-11-04 14:26:45 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2009-11-04 14:26:45 +0200
commit6698c134b2c83b317df302f7b2f8f94124fc12e0 (patch)
tree28fb5e436f6cb183116f39c6d7fc9d0bff0365f6 /indra/newview/llparticipantlist.h
parent8bd0c9058d3d24218cf59dd01f152b41240853a4 (diff)
parent7ad64438430de9a26d2c7c790eb196db4817f259 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llparticipantlist.h')
-rw-r--r--indra/newview/llparticipantlist.h56
1 files changed, 41 insertions, 15 deletions
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index a3a55303c0..8c209c0b20 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -38,48 +38,74 @@ class LLAvatarList;
class LLParticipantList
{
+ LOG_CLASS(LLParticipantList);
public:
LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list);
~LLParticipantList();
+ typedef enum e_participant_sort_oder {
+ E_SORT_BY_NAME = 0,
+ } EParticipantSortOrder;
+
+ /**
+ * Set and sort Avatarlist by given order
+ */
+ void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME);
+
protected:
+ /**
+ * LLSpeakerMgr event handlers
+ */
+ bool onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
+ bool onRemoveItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
+ bool onClearListEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
+
+ /**
+ * Sorts the Avatarlist by stored order
+ */
+ void sort();
//List of listeners implementing LLOldEvents::LLSimpleListener.
//There is no way to handle all the events in one listener as LLSpeakerMgr registers listeners in such a way
//that one listener can handle only one type of event
- class SpeakerAddListener : public LLOldEvents::LLSimpleListener
+ class BaseSpeakerListner : public LLOldEvents::LLSimpleListener
{
public:
- SpeakerAddListener(LLAvatarList* avatar_list) : mAvatarList(avatar_list) {}
+ BaseSpeakerListner(LLParticipantList& parent) : mParent(parent) {}
+ protected:
+ LLParticipantList& mParent;
+ };
+ class SpeakerAddListener : public BaseSpeakerListner
+ {
+ public:
+ SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- LLAvatarList* mAvatarList;
};
- class SpeakerRemoveListener : public LLOldEvents::LLSimpleListener
+ class SpeakerRemoveListener : public BaseSpeakerListner
{
public:
- SpeakerRemoveListener(LLAvatarList* avatar_list) : mAvatarList(avatar_list) {}
-
+ SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- LLAvatarList* mAvatarList;
};
- class SpeakerClearListener : public LLOldEvents::LLSimpleListener
+ class SpeakerClearListener : public BaseSpeakerListner
{
public:
- SpeakerClearListener(LLAvatarList* avatar_list) : mAvatarList(avatar_list) {}
-
+ SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {}
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- LLAvatarList* mAvatarList;
};
+
private:
void onAvatarListDoubleClicked(LLAvatarList* list);
LLSpeakerMgr* mSpeakerMgr;
- LLAvatarList* mAvatarList;
+ LLAvatarList* mAvatarList;
+
+ LLPointer<SpeakerAddListener> mSpeakerAddListener;
+ LLPointer<SpeakerRemoveListener> mSpeakerRemoveListener;
+ LLPointer<SpeakerClearListener> mSpeakerClearListener;
- SpeakerAddListener* mSpeakerAddListener;
- SpeakerRemoveListener* mSpeakerRemoveListener;
- SpeakerClearListener* mSpeakerClearListener;
+ EParticipantSortOrder mSortOrder;
};