00001
00032 #ifndef LL_LLNAMELISTCTRL_H
00033 #define LL_LLNAMELISTCTRL_H
00034
00035 #include <set>
00036
00037 #include "llscrolllistctrl.h"
00038
00039
00040 class LLNameListCtrl
00041 : public LLScrollListCtrl
00042 {
00043 public:
00044 LLNameListCtrl(const LLString& name,
00045 const LLRect& rect,
00046 LLUICtrlCallback callback,
00047 void* userdata,
00048 BOOL allow_multiple_selection,
00049 BOOL draw_border = TRUE,
00050 S32 name_column_index = 0,
00051 const LLString& tooltip = LLString::null);
00052 virtual ~LLNameListCtrl();
00053 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_NAME_LIST; }
00054 virtual LLString getWidgetTag() const { return LL_NAME_LIST_CTRL_TAG; }
00055 virtual LLXMLNodePtr getXML(bool save_children = true) const;
00056 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
00057
00058
00059
00060 BOOL addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM,
00061 BOOL enabled = TRUE, LLString& suffix = LLString::null);
00062 BOOL addNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM);
00063
00064 virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL);
00065
00066
00067
00068 void addGroupNameItem(const LLUUID& group_id, EAddPosition pos = ADD_BOTTOM,
00069 BOOL enabled = TRUE);
00070 void addGroupNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM);
00071
00072
00073 void removeNameItem(const LLUUID& agent_id);
00074
00075 void refresh(const LLUUID& id, const char* first, const char* last,
00076 BOOL is_group);
00077
00078 static void refreshAll(const LLUUID& id, const char* firstname,
00079 const char* lastname, BOOL is_group);
00080
00081 virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
00082 BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
00083 EAcceptance *accept,
00084 LLString& tooltip_msg);
00085
00086 void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; }
00087
00088 private:
00089 static std::set<LLNameListCtrl*> sInstances;
00090 S32 mNameColumnIndex;
00091 BOOL mAllowCallingCardDrop;
00092 };
00093
00094 #endif