PageRenderTime 23ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloateravatarpicker.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 99 lines | 52 code | 20 blank | 27 comment | 0 complexity | 2b6e34049477c9b02a0416887d5e5bce MD5 | raw file
 1/** 
 2 * @file llfloateravatarpicker.h
 3 * @brief was llavatarpicker.h
 4 *
 5 * $LicenseInfo:firstyear=2003&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LLFLOATERAVATARPICKER_H
28#define LLFLOATERAVATARPICKER_H
29
30#include "llfloater.h"
31
32#include <vector>
33
34class LLAvatarName;
35class LLScrollListCtrl;
36
37class LLFloaterAvatarPicker : public LLFloater
38{
39public:
40	typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t;
41	typedef validate_signal_t::slot_type validate_callback_t;
42
43	// The callback function will be called with an avatar name and UUID.
44	typedef boost::function<void (const uuid_vec_t&, const std::vector<LLAvatarName>&)> select_callback_t;
45	// Call this to select an avatar.	
46	static LLFloaterAvatarPicker* show(select_callback_t callback, 
47									   BOOL allow_multiple = FALSE,
48									   BOOL closeOnSelect = FALSE);
49
50	LLFloaterAvatarPicker(const LLSD& key);
51	virtual ~LLFloaterAvatarPicker();
52	
53	virtual	BOOL postBuild();
54
55	void setOkBtnEnableCb(validate_callback_t cb);
56
57	static void processAvatarPickerReply(class LLMessageSystem* msg, void**);
58	void processResponse(const LLUUID& query_id, const LLSD& content);
59
60	BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
61						   BOOL drop, EDragAndDropType cargo_type,
62						   void *cargo_data, EAcceptance *accept,
63						   std::string& tooltip_msg);
64
65	void openFriendsTab();
66
67private:
68	void editKeystroke(class LLLineEditor* caller, void* user_data);
69
70	void onBtnFind();
71	void onBtnSelect();
72	void onBtnRefresh();
73	void onRangeAdjust();
74	void onBtnClose();
75	void onList();
76	void onTabChanged();
77	bool isSelectBtnEnabled();
78
79	void populateNearMe();
80	void populateFriend();
81	BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected.
82
83	void find();
84	void setAllowMultiple(BOOL allow_multiple);
85	LLScrollListCtrl* getActiveList();
86
87	virtual void draw();
88	virtual BOOL handleKeyHere(KEY key, MASK mask);
89
90	LLUUID				mQueryID;
91	int				mNumResultsReturned;
92	BOOL				mNearMeListComplete;
93	BOOL				mCloseOnSelect;
94
95	validate_signal_t mOkButtonValidateSignal;
96	select_callback_t mSelectionCallback;
97};
98
99#endif