summaryrefslogtreecommitdiff
path: root/indra/newview/llparticipantlist.h
diff options
context:
space:
mode:
authorEugene Mutavchi <emutavchi@productengine.com>2009-11-03 17:47:20 +0200
committerEugene Mutavchi <emutavchi@productengine.com>2009-11-03 17:47:20 +0200
commit5ea6474aebb7f81ce797de1449863bac1543fb03 (patch)
tree73db816b9836c29d152373720293f654276f2336 /indra/newview/llparticipantlist.h
parent3483f9e0d04f7a956921b9ac60e85b4371f97322 (diff)
Implemented low task EXT-1787 (Implement sorting of participant list)
--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..04d9e29256 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;
+
+ SpeakerAddListener mSpeakerAddListener;
+ SpeakerRemoveListener mSpeakerRemoveListener;
+ SpeakerClearListener mSpeakerClearListener;
- SpeakerAddListener* mSpeakerAddListener;
- SpeakerRemoveListener* mSpeakerRemoveListener;
- SpeakerClearListener* mSpeakerClearListener;
+ EParticipantSortOrder mSortOrder;
};