aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llfloaterregioninfo.h
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llfloaterregioninfo.h')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.h406
1 files changed, 406 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.h b/linden/indra/newview/llfloaterregioninfo.h
new file mode 100644
index 0000000..fda23e8
--- /dev/null
+++ b/linden/indra/newview/llfloaterregioninfo.h
@@ -0,0 +1,406 @@
1/**
2 * @file llfloaterregioninfo.h
3 * @author Aaron Brashears
4 * @brief Declaration of the region info and controls floater and panels.
5 *
6 * Copyright (c) 2004-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLFLOATERREGIONINFO_H
30#define LL_LLFLOATERREGIONINFO_H
31
32#include <vector>
33#include "llfloater.h"
34#include "llpanel.h"
35
36class LLLineEditor;
37class LLMessageSystem;
38class LLPanelRegionInfo;
39class LLTabContainer;
40class LLViewerRegion;
41class LLViewerTextEditor;
42class LLInventoryItem;
43class LLCheckBoxCtrl;
44class LLComboBox;
45class LLNameListCtrl;
46class LLSliderCtrl;
47class LLSpinCtrl;
48class LLTextBox;
49
50class LLPanelRegionGeneralInfo;
51class LLPanelRegionDebugInfo;
52class LLPanelRegionTextureInfo;
53class LLPanelRegionTerrainInfo;
54class LLPanelEstateInfo;
55class LLPanelEstateCovenant;
56
57class LLFloaterRegionInfo : public LLFloater
58{
59public:
60 ~LLFloaterRegionInfo();
61
62 static void show(LLViewerRegion* region);
63 static void show(void*);
64 static LLFloaterRegionInfo* getInstance();
65 static void processEstateOwnerRequest(LLMessageSystem* msg, void**);
66
67 // get and process region info if necessary.
68 static void processRegionInfo(LLMessageSystem* msg);
69
70 static const LLUUID& getLastInvoice() { return sRequestInvoice; }
71 static void nextInvoice() { sRequestInvoice.generate(); }
72 //static S32 getSerial() { return sRequestSerial; }
73 //static void incrementSerial() { sRequestSerial++; }
74
75 static LLPanelEstateInfo* getPanelEstate();
76 static LLPanelEstateCovenant* getPanelCovenant();
77
78protected:
79 LLFloaterRegionInfo(const LLRect& rect);
80 void refreshFromRegion(LLViewerRegion* region);
81
82 // static data
83 static LLFloaterRegionInfo* sInstance;
84
85 // member data
86 LLTabContainer* mTab;
87 typedef std::vector<LLPanelRegionInfo*> info_panels_t;
88 info_panels_t mInfoPanels;
89 //static S32 sRequestSerial; // serial # of last EstateOwnerRequest
90 static LLUUID sRequestInvoice;
91};
92
93
94// Base class for all region information panels.
95class LLPanelRegionInfo : public LLPanel
96{
97public:
98 LLPanelRegionInfo() : LLPanel("Region Info Panel") {}
99 static void onBtnSet(void* user_data);
100 static void onChangeChildCtrl(LLUICtrl* ctrl, void* user_data);
101 static void onChangeAnything(LLUICtrl* ctrl, void* user_data);
102
103 virtual bool refreshFromRegion(LLViewerRegion* region);
104 virtual bool estateUpdate(LLMessageSystem* msg) { return true; }
105
106 virtual BOOL postBuild();
107 virtual void updateChild(LLUICtrl* child_ctrl);
108
109 void enableButton(const char* btn_name, BOOL enable = TRUE);
110 void disableButton(const char* btn_name);
111
112protected:
113 void initCtrl(const char* name);
114 void initHelpBtn(const char* name, const char* xml_alert);
115
116 // Callback for all help buttons, data is name of XML alert to show.
117 static void onClickHelp(void* data);
118
119 // Returns TRUE if update sent and apply button should be
120 // disabled.
121 virtual BOOL sendUpdate() { return TRUE; }
122
123 typedef std::vector<std::string> strings_t;
124 //typedef std::vector<U32> integers_t;
125 void sendEstateOwnerMessage(
126 LLMessageSystem* msg,
127 const char* request,
128 const LLUUID& invoice,
129 const strings_t& strings);
130
131 // member data
132 LLHost mHost;
133};
134
135/////////////////////////////////////////////////////////////////////////////
136// Actual panels start here
137/////////////////////////////////////////////////////////////////////////////
138
139class LLPanelRegionGeneralInfo : public LLPanelRegionInfo
140{
141public:
142 LLPanelRegionGeneralInfo()
143 : LLPanelRegionInfo() {}
144 ~LLPanelRegionGeneralInfo() {}
145
146 virtual bool refreshFromRegion(LLViewerRegion* region);
147
148 // LLPanel
149 virtual BOOL postBuild();
150protected:
151 virtual BOOL sendUpdate();
152
153 static void onClickKick(void* userdata);
154 static void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
155 static void onClickKickAll(void* userdata);
156 static void onKickAllCommit(S32 option, void* userdata);
157 static void onClickMessage(void* userdata);
158 static void onMessageCommit(S32 option, const LLString& text, void* userdata);
159 static void onClickManageTelehub(void* data);
160};
161
162/////////////////////////////////////////////////////////////////////////////
163
164class LLPanelRegionDebugInfo : public LLPanelRegionInfo
165{
166public:
167 LLPanelRegionDebugInfo()
168 : LLPanelRegionInfo(), mTargetAvatar() {}
169 ~LLPanelRegionDebugInfo() {}
170 // LLPanel
171 virtual BOOL postBuild();
172
173 virtual bool refreshFromRegion(LLViewerRegion* region);
174
175protected:
176 virtual BOOL sendUpdate();
177
178 static void onClickChooseAvatar(void*);
179 static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
180 static void onClickReturnScriptedOtherLand(void*);
181 static void callbackReturnScriptedOtherLand(S32 option, void*);
182 static void onClickReturnScriptedAll(void*);
183 static void callbackReturnScriptedAll(S32 option, void*);
184 static void onClickTopColliders(void*);
185 static void onClickTopScripts(void*);
186 static void onClickRestart(void* data);
187 static void callbackRestart(S32 option, void* data);
188 static void onClickCancelRestart(void* data);
189
190private:
191 LLUUID mTargetAvatar;
192};
193
194/////////////////////////////////////////////////////////////////////////////
195
196class LLPanelRegionTextureInfo : public LLPanelRegionInfo
197{
198public:
199 LLPanelRegionTextureInfo();
200 ~LLPanelRegionTextureInfo() {}
201
202 virtual bool refreshFromRegion(LLViewerRegion* region);
203
204 // LLPanel && LLView
205 virtual BOOL postBuild();
206 virtual void draw();
207
208protected:
209 virtual BOOL sendUpdate();
210
211 static void onClickDump(void* data);
212 BOOL validateTextureSizes();
213};
214
215/////////////////////////////////////////////////////////////////////////////
216
217class LLPanelRegionTerrainInfo : public LLPanelRegionInfo
218{
219public:
220 LLPanelRegionTerrainInfo()
221 : LLPanelRegionInfo() {}
222 ~LLPanelRegionTerrainInfo() {}
223 // LLPanel
224 virtual BOOL postBuild();
225
226 virtual bool refreshFromRegion(LLViewerRegion* region);
227
228protected:
229 virtual BOOL sendUpdate();
230
231 static void onChangeUseEstateTime(LLUICtrl* ctrl, void* user_data);
232 static void onChangeFixedSun(LLUICtrl* ctrl, void* user_data);
233 static void onChangeSunHour(LLUICtrl* ctrl, void*);
234
235 static void onClickDownloadRaw(void*);
236 static void onClickUploadRaw(void*);
237 static void onClickBakeTerrain(void*);
238 static void callbackBakeTerrain(S32 option, void* data);
239};
240
241/////////////////////////////////////////////////////////////////////////////
242
243class LLPanelEstateInfo : public LLPanelRegionInfo
244{
245public:
246 static void initDispatch(LLDispatcher& dispatch);
247
248 static void onChangeFixedSun(LLUICtrl* ctrl, void* user_data);
249 static void onChangeUseGlobalTime(LLUICtrl* ctrl, void* user_data);
250
251 static void onClickAddAllowedAgent(void* user_data);
252 static void onClickRemoveAllowedAgent(void* user_data);
253 static void onClickAddAllowedGroup(void* user_data);
254 static void onClickRemoveAllowedGroup(void* user_data);
255 static void onClickAddBannedAgent(void* user_data);
256 static void onClickRemoveBannedAgent(void* user_data);
257 static void onClickAddEstateManager(void* user_data);
258 static void onClickRemoveEstateManager(void* user_data);
259 static void onClickKickUser(void* userdata);
260
261 // Group picker callback is different, can't use core methods below
262 static void addAllowedGroup(S32 option, void* data);
263 static void addAllowedGroup2(LLUUID id, void* data);
264
265 // Core methods for all above add/remove button clicks
266 static void accessAddCore(U32 operation_flag, const char* dialog_name);
267 static void accessAddCore2(S32 option, void* data);
268 static void accessAddCore3(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
269
270 static void accessRemoveCore(U32 operation_flag, const char* dialog_name, const char* list_ctrl_name);
271 static void accessRemoveCore2(S32 option, void* data);
272
273 // used for both add and remove operations
274 static void accessCoreConfirm(S32 option, void* data);
275 static void kickUserConfirm(S32 option, void* userdata);
276
277 // Send the actual EstateOwnerRequest "estateaccessdelta" message
278 static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id);
279
280 static void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
281 static void onClickMessageEstate(void* data);
282 static void onMessageCommit(S32 option, const LLString& text, void* data);
283
284 LLPanelEstateInfo();
285 ~LLPanelEstateInfo() {}
286
287 virtual bool refreshFromRegion(LLViewerRegion* region);
288 virtual bool estateUpdate(LLMessageSystem* msg);
289
290 // LLPanel
291 virtual BOOL postBuild();
292 virtual void updateChild(LLUICtrl* child_ctrl);
293
294 U32 computeEstateFlags();
295 void setEstateFlags(U32 flags);
296
297 BOOL getGlobalTime();
298 void setGlobalTime(bool b);
299
300 BOOL getFixedSun();
301
302 F32 getSunHour();
303 void setSunHour(F32 sun_hour);
304
305 const std::string getEstateName() const;
306 void setEstateName(const std::string& name);
307
308 U32 getEstateID() const { return mEstateID; }
309 void setEstateID(U32 estate_id) { mEstateID = estate_id; }
310 static bool isLindenEstate();
311
312 const std::string getOwnerName() const;
313 void setOwnerName(const std::string& name);
314
315 // If visible from mainland, allowed agent and allowed groups
316 // are ignored, so must disable UI.
317 void setAccessAllowedEnabled(bool enable_agent, bool enable_group, bool enable_ban);
318
319 // this must have the same function signature as
320 // llmessage/llcachename.h:LLCacheNameCallback
321 static void callbackCacheName(
322 const LLUUID& id,
323 const char* first,
324 const char* last,
325 BOOL is_group,
326 void*);
327
328protected:
329 virtual BOOL sendUpdate();
330 // confirmation dialog callback
331 static void callbackChangeLindenEstate(S32 opt, void* data);
332
333 void commitEstateInfo();
334 void commitEstateAccess();
335 void commitEstateManagers();
336
337 void clearAccessLists();
338 BOOL checkRemovalButton(std::string name);
339 BOOL checkSunHourSlider(LLUICtrl* child_ctrl);
340
341 U32 mEstateID;
342};
343
344/////////////////////////////////////////////////////////////////////////////
345
346class LLPanelEstateCovenant : public LLPanelRegionInfo
347{
348public:
349 LLPanelEstateCovenant();
350 ~LLPanelEstateCovenant() {}
351
352 // LLPanel
353 virtual BOOL postBuild();
354 virtual void updateChild(LLUICtrl* child_ctrl);
355 virtual bool refreshFromRegion(LLViewerRegion* region);
356 virtual bool estateUpdate(LLMessageSystem* msg);
357
358 // LLView overrides
359 BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
360 BOOL drop, EDragAndDropType cargo_type,
361 void *cargo_data, EAcceptance *accept,
362 LLString& tooltip_msg);
363 static void confirmChangeCovenantCallback(S32 option, void* userdata);
364 static void resetCovenantID(void* userdata);
365 static void confirmResetCovenantCallback(S32 option, void* userdata);
366 void sendChangeCovenantID(const LLUUID &asset_id);
367 void loadInvItem(LLInventoryItem *itemp);
368 static void onLoadComplete(LLVFS *vfs,
369 const LLUUID& asset_uuid,
370 LLAssetType::EType type,
371 void* user_data, S32 status);
372
373 // Accessor functions
374 static void updateCovenantText(const std::string& string, const LLUUID& asset_id);
375 static void updateEstateName(const std::string& name);
376 static void updateLastModified(const std::string& text);
377 static void updateEstateOwnerName(const std::string& name);
378
379 const LLUUID& getCovenantID() const { return mCovenantID; }
380 void setCovenantID(const LLUUID& id) { mCovenantID = id; }
381 const std::string& getEstateName() const;
382 void setEstateName(const std::string& name);
383 const std::string& getOwnerName() const;
384 void setOwnerName(const std::string& name);
385 void setCovenantTextEditor(const std::string& text);
386
387 typedef enum e_asset_status
388 {
389 ASSET_ERROR,
390 ASSET_UNLOADED,
391 ASSET_LOADING,
392 ASSET_LOADED
393 } EAssetStatus;
394
395protected:
396 virtual BOOL sendUpdate();
397 LLTextBox* mEstateNameText;
398 LLTextBox* mEstateOwnerText;
399 LLTextBox* mLastModifiedText;
400 // CovenantID from sim
401 LLUUID mCovenantID;
402 LLViewerTextEditor* mEditor;
403 EAssetStatus mAssetStatus;
404};
405
406#endif