00001
00032 #ifndef LLFLOATERAVATARPICKER_H
00033 #define LLFLOATERAVATARPICKER_H
00034
00035 #include "llfloater.h"
00036
00037 #include <vector>
00038
00039 class LLUICtrl;
00040 class LLTextBox;
00041 class LLLineEditor;
00042 class LLButton;
00043 class LLScrollListCtrl;
00044 class LLMessageSystem;
00045 class LLInventoryPanel;
00046 class LLFolderViewItem;
00047
00048 class LLFloaterAvatarPicker : public LLFloater
00049 {
00050 public:
00051
00052
00053 typedef void(*callback_t)(const std::vector<std::string>&, const std::vector<LLUUID>&, void*);
00054 static LLFloaterAvatarPicker* show(callback_t callback,
00055 void* userdata,
00056 BOOL allow_multiple = FALSE,
00057 BOOL closeOnSelect = FALSE);
00058 virtual BOOL postBuild();
00059
00060 static void processAvatarPickerReply(LLMessageSystem* msg, void**);
00061 static void editKeystroke(LLLineEditor* caller, void* user_data);
00062
00063 protected:
00064 static void* createInventoryPanel(void* userdata);
00065
00066 static void onBtnFind(void* userdata);
00067 static void onBtnAdd(void* userdata);
00068 static void onBtnClose(void* userdata);
00069 static void onList(LLUICtrl* ctrl, void* userdata);
00070
00071 void doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data);
00072 static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data);
00073
00074 void find();
00075 void setAllowMultiple(BOOL allow_multiple);
00076
00077 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
00078
00079 protected:
00080 LLScrollListCtrl* mListNames;
00081 LLInventoryPanel* mInventoryPanel;
00082
00083 std::vector<LLUUID> mAvatarIDs;
00084 std::vector<std::string> mAvatarNames;
00085 BOOL mAllowMultiple;
00086 LLUUID mQueryID;
00087 BOOL mResultsReturned;
00088 BOOL mCloseOnSelect;
00089
00090 void (*mCallback)(const std::vector<std::string>& name, const std::vector<LLUUID>& id, void* userdata);
00091 void* mCallbackUserdata;
00092
00093 protected:
00094 static LLFloaterAvatarPicker* sInstance;
00095
00096 protected:
00097
00098 LLFloaterAvatarPicker();
00099 virtual ~LLFloaterAvatarPicker();
00100 };
00101
00102
00103 #endif