diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelavatar.h | 356 |
1 files changed, 356 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelavatar.h b/linden/indra/newview/llpanelavatar.h new file mode 100644 index 0000000..ab08ffb --- /dev/null +++ b/linden/indra/newview/llpanelavatar.h | |||
@@ -0,0 +1,356 @@ | |||
1 | /** | ||
2 | * @file llpanelavatar.h | ||
3 | * @brief LLPanelAvatar and related class definitions | ||
4 | * | ||
5 | * Copyright (c) 2004-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLPANELAVATAR_H | ||
29 | #define LL_LLPANELAVATAR_H | ||
30 | |||
31 | #include "llpanel.h" | ||
32 | #include "v3dmath.h" | ||
33 | #include "lluuid.h" | ||
34 | #include "linked_lists.h" | ||
35 | #include "llwebbrowserctrl.h" | ||
36 | |||
37 | class LLButton; | ||
38 | class LLCheckBoxCtrl; | ||
39 | class LLDropTarget; | ||
40 | class LLInventoryItem; | ||
41 | class LLLineEditor; | ||
42 | class LLNameEditor; | ||
43 | class LLPanelAvatar; | ||
44 | class LLScrollListCtrl; | ||
45 | class LLTabContainerCommon; | ||
46 | class LLTextBox; | ||
47 | class LLTextEditor; | ||
48 | class LLTextureCtrl; | ||
49 | class LLUICtrl; | ||
50 | class LLViewerImage; | ||
51 | class LLViewerObject; | ||
52 | class LLMessageSystem; | ||
53 | class LLIconCtrl; | ||
54 | class LLWebBrowserCtrl; | ||
55 | |||
56 | enum EOnlineStatus | ||
57 | { | ||
58 | ONLINE_STATUS_UNKNOWN = -1, | ||
59 | ONLINE_STATUS_NO = 0, | ||
60 | ONLINE_STATUS_YES = 1 | ||
61 | }; | ||
62 | |||
63 | class LLPanelAvatarFirstLife | ||
64 | : public LLPanel | ||
65 | { | ||
66 | public: | ||
67 | LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar); | ||
68 | /*virtual*/ ~LLPanelAvatarFirstLife(); | ||
69 | /*virtual*/ BOOL postBuild(void); | ||
70 | |||
71 | void enableControls(BOOL own_avatar); | ||
72 | |||
73 | protected: | ||
74 | LLPanelAvatar* mPanelAvatar; | ||
75 | }; | ||
76 | |||
77 | |||
78 | class LLPanelAvatarSecondLife | ||
79 | : public LLPanel | ||
80 | { | ||
81 | public: | ||
82 | LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ); | ||
83 | /*virtual*/ ~LLPanelAvatarSecondLife(); | ||
84 | |||
85 | /*virtual*/ BOOL postBuild(void); | ||
86 | /*virtual*/ void draw(); | ||
87 | |||
88 | static void onClickImage( void *userdata); | ||
89 | static void onClickFriends( void *userdata); | ||
90 | static void onDoubleClickGroup(void* userdata); | ||
91 | static void onClickPublishHelp(void *userdata); | ||
92 | |||
93 | // Clear out the controls anticipating new network data. | ||
94 | void clearControls(); | ||
95 | void enableControls(BOOL own_avatar); | ||
96 | void updateOnlineText(BOOL online, BOOL have_calling_card); | ||
97 | void updatePartnerName(); | ||
98 | |||
99 | void setPartnerID(LLUUID id) { mPartnerID = id; } | ||
100 | |||
101 | protected: | ||
102 | LLPanelAvatar* mPanelAvatar; | ||
103 | |||
104 | LLUUID mPartnerID; | ||
105 | }; | ||
106 | |||
107 | // WARNING! The order of the inheritance here matters!! Do not change. - KLW | ||
108 | class LLPanelAvatarWeb : | ||
109 | public LLPanel | ||
110 | #if LL_LIBXUL_ENABLED | ||
111 | , public LLWebBrowserCtrlObserver | ||
112 | #endif | ||
113 | { | ||
114 | public: | ||
115 | LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); | ||
116 | /*virtual*/ ~LLPanelAvatarWeb(); | ||
117 | /*virtual*/ BOOL postBuild(void); | ||
118 | |||
119 | void enableControls(BOOL own_avatar); | ||
120 | |||
121 | void setWebURL(std::string url); | ||
122 | |||
123 | void load(); | ||
124 | void load(std::string url); | ||
125 | static void onClickLoad(void* data); | ||
126 | static void onClickOpen(void* data); | ||
127 | static void onCommitURL(LLUICtrl* ctrl, void* data); | ||
128 | static void onClickWebProfileHelp(void *); | ||
129 | |||
130 | #if LL_LIBXUL_ENABLED | ||
131 | // browser observer impls | ||
132 | virtual void onStatusTextChange( const EventType& eventIn ); | ||
133 | virtual void onLocationChange( const EventType& eventIn ); | ||
134 | #endif | ||
135 | |||
136 | protected: | ||
137 | LLPanelAvatar* mPanelAvatar; | ||
138 | std::string mURL; | ||
139 | LLWebBrowserCtrl* mWebBrowser; | ||
140 | }; | ||
141 | |||
142 | class LLPanelAvatarAdvanced : public LLPanel | ||
143 | { | ||
144 | public: | ||
145 | LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); | ||
146 | /*virtual*/ ~LLPanelAvatarAdvanced(); | ||
147 | /*virtual*/ BOOL postBuild(void); | ||
148 | |||
149 | void enableControls(BOOL own_avatar); | ||
150 | void setWantSkills(U32 want_to_mask, const std::string& want_to_text, | ||
151 | U32 skills_mask, const std::string& skills_text, | ||
152 | const std::string& languages_text); | ||
153 | void getWantSkills(U32* want_to_mask, std::string& want_to_text, | ||
154 | U32* skills_mask, std::string& skills_text, | ||
155 | std::string& languages_text); | ||
156 | |||
157 | protected: | ||
158 | LLPanelAvatar* mPanelAvatar; | ||
159 | S32 mWantToCount; | ||
160 | S32 mSkillsCount; | ||
161 | LLCheckBoxCtrl *mWantToCheck[8]; | ||
162 | LLLineEditor *mWantToEdit; | ||
163 | LLCheckBoxCtrl *mSkillsCheck[8]; | ||
164 | LLLineEditor *mSkillsEdit; | ||
165 | }; | ||
166 | |||
167 | |||
168 | class LLPanelAvatarNotes : public LLPanel | ||
169 | { | ||
170 | public: | ||
171 | LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); | ||
172 | /*virtual*/ ~LLPanelAvatarNotes(); | ||
173 | /*virtual*/ BOOL postBuild(void); | ||
174 | |||
175 | void enableControls(BOOL own_avatar); | ||
176 | |||
177 | static void onCommitNotes(LLUICtrl* field, void* userdata); | ||
178 | |||
179 | protected: | ||
180 | LLPanelAvatar* mPanelAvatar; | ||
181 | }; | ||
182 | |||
183 | |||
184 | class LLPanelAvatarClassified : public LLPanel | ||
185 | { | ||
186 | public: | ||
187 | LLPanelAvatarClassified(const LLString& name, const LLRect& rect, LLPanelAvatar* panel_avatar); | ||
188 | /*virtual*/ ~LLPanelAvatarClassified(); | ||
189 | |||
190 | /*virtual*/ BOOL postBuild(void); | ||
191 | /*virtual*/ void draw(); | ||
192 | |||
193 | void refresh(); | ||
194 | |||
195 | void apply(); | ||
196 | void enableControls(BOOL own_avatar); | ||
197 | |||
198 | BOOL titleIsValid(); | ||
199 | |||
200 | // Delete all the classified sub-panels from the tab container | ||
201 | void deleteClassifiedPanels(); | ||
202 | |||
203 | // Unpack the outline of classified for this avatar (count, names, but not | ||
204 | // actual data). | ||
205 | void processAvatarClassifiedReply(LLMessageSystem* msg, void**); | ||
206 | |||
207 | private: | ||
208 | static void onClickNew(void* data); | ||
209 | static void onClickDelete(void* data); | ||
210 | |||
211 | static void callbackDelete(S32 option, void* data); | ||
212 | static void callbackNew(S32 option, void* data); | ||
213 | |||
214 | private: | ||
215 | LLPanelAvatar* mPanelAvatar; | ||
216 | }; | ||
217 | |||
218 | class LLPanelAvatarPicks : public LLPanel | ||
219 | { | ||
220 | public: | ||
221 | LLPanelAvatarPicks(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); | ||
222 | /*virtual*/ ~LLPanelAvatarPicks(); | ||
223 | |||
224 | /*virtual*/ BOOL postBuild(void); | ||
225 | /*virtual*/ void draw(); | ||
226 | |||
227 | void refresh(); | ||
228 | |||
229 | void enableControls(BOOL own_avatar); | ||
230 | |||
231 | // Delete all the pick sub-panels from the tab container | ||
232 | void deletePickPanels(); | ||
233 | |||
234 | // Unpack the outline of picks for this avatar (count, names, but not | ||
235 | // actual data). | ||
236 | void processAvatarPicksReply(LLMessageSystem* msg, void**); | ||
237 | void processAvatarClassifiedReply(LLMessageSystem* msg, void**); | ||
238 | |||
239 | private: | ||
240 | static void onClickNew(void* data); | ||
241 | static void onClickDelete(void* data); | ||
242 | |||
243 | static void callbackDelete(S32 option, void* data); | ||
244 | |||
245 | private: | ||
246 | LLPanelAvatar* mPanelAvatar; | ||
247 | }; | ||
248 | |||
249 | |||
250 | class LLPanelAvatar : public LLPanel | ||
251 | { | ||
252 | public: | ||
253 | LLPanelAvatar(const std::string& name, const LLRect &rect, BOOL allow_edit); | ||
254 | /*virtual*/ ~LLPanelAvatar(); | ||
255 | |||
256 | /*virtual*/ BOOL postBuild(void); | ||
257 | |||
258 | void setAvatar(LLViewerObject *avatarp); | ||
259 | |||
260 | // Fill in the avatar ID and handle some field fill-in, as well as | ||
261 | // button enablement. | ||
262 | // Pass one of the ONLINE_STATUS_foo constants above. | ||
263 | void setAvatarID(const LLUUID &avatar_id, const LLString &name, EOnlineStatus online_status); | ||
264 | |||
265 | const LLUUID& getAvatarID() const { return mAvatarID; } | ||
266 | |||
267 | void disableRate(); | ||
268 | |||
269 | void resetGroupList(); | ||
270 | |||
271 | void sendAvatarStatisticsRequest(); | ||
272 | |||
273 | void sendAvatarPropertiesRequest(); | ||
274 | void sendAvatarPropertiesUpdate(); | ||
275 | |||
276 | void sendAvatarNotesRequest(); | ||
277 | void sendAvatarNotesUpdate(); | ||
278 | |||
279 | void sendAvatarPicksRequest(); | ||
280 | |||
281 | void selectTab(S32 tabnum); | ||
282 | void selectTabByName(std::string tab_name); | ||
283 | |||
284 | BOOL haveData() { return mHaveProperties && mHaveStatistics; } | ||
285 | |||
286 | static void processAvatarPropertiesReply(LLMessageSystem *msg, void **); | ||
287 | static void processAvatarInterestsReply(LLMessageSystem *msg, void **); | ||
288 | static void processAvatarGroupsReply(LLMessageSystem* msg, void**); | ||
289 | static void processAvatarStatisticsReply(LLMessageSystem *msg, void **); | ||
290 | static void processAvatarNotesReply(LLMessageSystem *msg, void **); | ||
291 | static void processAvatarPicksReply(LLMessageSystem *msg, void **); | ||
292 | static void processAvatarClassifiedReply(LLMessageSystem *msg, void **); | ||
293 | |||
294 | static void onClickTrack( void *userdata); | ||
295 | static void onClickIM( void *userdata); | ||
296 | static void onClickOfferTeleport( void *userdata); | ||
297 | static void onClickPay( void *userdata); | ||
298 | static void onClickRate( void *userdata); | ||
299 | static void onClickOK( void *userdata); | ||
300 | static void onClickCancel( void *userdata); | ||
301 | static void onClickKick( void *userdata); | ||
302 | static void onClickFreeze( void *userdata); | ||
303 | static void onClickUnfreeze(void *userdata); | ||
304 | static void onClickCSR( void *userdata); | ||
305 | static void onClickMute( void *userdata); | ||
306 | static void onClickAddFriend(void* data); | ||
307 | |||
308 | static void finishKick(S32 option, const LLString& text, void* userdata); | ||
309 | static void finishFreeze(S32 option, const LLString& text, void* userdata); | ||
310 | static void finishUnfreeze(S32 option, const LLString& text, void* userdata); | ||
311 | |||
312 | static void showProfileCallback(S32 option, void *userdata); | ||
313 | |||
314 | // Teen users are not allowed to see or enter data into the first life page, | ||
315 | // or their own about/interests text entry fields. | ||
316 | static BOOL sAllowFirstLife; | ||
317 | |||
318 | static void* createPanelAvatar(void* data); | ||
319 | static void* createFloaterAvatarInfo(void* data); | ||
320 | static void* createPanelAvatarSecondLife(void* data); | ||
321 | static void* createPanelAvatarWeb(void* data); | ||
322 | static void* createPanelAvatarInterests(void* data); | ||
323 | static void* createPanelAvatarPicks(void* data); | ||
324 | static void* createPanelAvatarClassified(void* data); | ||
325 | static void* createPanelAvatarFirstLife(void* data); | ||
326 | static void* createPanelAvatarNotes(void* data); | ||
327 | |||
328 | public: | ||
329 | LLPanelAvatarSecondLife* mPanelSecondLife; | ||
330 | LLPanelAvatarAdvanced* mPanelAdvanced; | ||
331 | LLPanelAvatarClassified* mPanelClassified; | ||
332 | LLPanelAvatarPicks* mPanelPicks; | ||
333 | LLPanelAvatarNotes* mPanelNotes; | ||
334 | LLPanelAvatarFirstLife* mPanelFirstLife; | ||
335 | LLPanelAvatarWeb* mPanelWeb; | ||
336 | |||
337 | LLDropTarget* mDropTarget; | ||
338 | |||
339 | protected: | ||
340 | void enableOKIfReady(); | ||
341 | LLUUID mAvatarID; // for which avatar is this window? | ||
342 | BOOL mIsFriend; // Are we friends? | ||
343 | BOOL mHaveProperties; | ||
344 | BOOL mHaveStatistics; | ||
345 | LLTabContainerCommon* mTab; | ||
346 | BOOL mAllowEdit; | ||
347 | BOOL mDisableRate; | ||
348 | |||
349 | static LLLinkedList<LLPanelAvatar> sAllPanels; | ||
350 | }; | ||
351 | |||
352 | // helper funcs | ||
353 | void add_left_label(LLPanel *panel, const LLString& name, S32 y); | ||
354 | |||
355 | |||
356 | #endif // LL_LLPANELAVATAR_H | ||