llnamelistctrl.h

Go to the documentation of this file.
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 
00054         virtual LLXMLNodePtr getXML(bool save_children = true) const;
00055         static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
00056 
00057         // Add a user to the list by name.  It will be added, the name 
00058         // requested from the cache, and updated as necessary.
00059         BOOL addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM,
00060                                          BOOL enabled = TRUE, LLString& suffix = LLString::null);
00061         BOOL addNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM);
00062 
00063         virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL);
00064 
00065         // Add a user to the list by name.  It will be added, the name 
00066         // requested from the cache, and updated as necessary.
00067         void addGroupNameItem(const LLUUID& group_id, EAddPosition pos = ADD_BOTTOM,
00068                                                   BOOL enabled = TRUE);
00069         void addGroupNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM);
00070 
00071 
00072         void removeNameItem(const LLUUID& agent_id);
00073 
00074         void refresh(const LLUUID& id, const char* first, const char* last,
00075                                  BOOL is_group);
00076 
00077         static void refreshAll(const LLUUID& id, const char* firstname,
00078                                                    const char* lastname, BOOL is_group);
00079 
00080         virtual BOOL    handleDragAndDrop(S32 x, S32 y, MASK mask,
00081                                                                           BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
00082                                                                           EAcceptance *accept,
00083                                                                           LLString& tooltip_msg);
00084 
00085         void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; }
00086 
00087 private:
00088         static std::set<LLNameListCtrl*> sInstances;
00089         S32      mNameColumnIndex;
00090         BOOL     mAllowCallingCardDrop;
00091 };
00092 
00093 #endif

Generated on Fri May 16 08:33:48 2008 for SecondLife by  doxygen 1.5.5