PageRenderTime 36ms CodeModel.GetById 11ms app.highlight 21ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloaterland.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 403 lines | 284 code | 77 blank | 42 comment | 0 complexity | 9fb81fa5ea949faabd8da68228324cef MD5 | raw file
  1/** 
  2 * @file llfloaterland.h
  3 * @author James Cook
  4 * @brief "About Land" floater, allowing display and editing of land parcel properties.
  5 *
  6 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  7 * Second Life Viewer Source Code
  8 * Copyright (C) 2010, Linden Research, Inc.
  9 * 
 10 * This library is free software; you can redistribute it and/or
 11 * modify it under the terms of the GNU Lesser General Public
 12 * License as published by the Free Software Foundation;
 13 * version 2.1 of the License only.
 14 * 
 15 * This library is distributed in the hope that it will be useful,
 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 18 * Lesser General Public License for more details.
 19 * 
 20 * You should have received a copy of the GNU Lesser General Public
 21 * License along with this library; if not, write to the Free Software
 22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 23 * 
 24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 25 * $/LicenseInfo$
 26 */
 27
 28#ifndef LL_LLFLOATERLAND_H
 29#define LL_LLFLOATERLAND_H
 30
 31#include <set>
 32#include <vector>
 33
 34#include "llfloater.h"
 35#include "llpointer.h"	// LLPointer<>
 36//#include "llviewertexturelist.h"
 37#include "llsafehandle.h"
 38
 39typedef std::set<LLUUID, lluuid_less> uuid_list_t;
 40const F32 CACHE_REFRESH_TIME	= 2.5f;
 41
 42class LLButton;
 43class LLCheckBoxCtrl;
 44class LLRadioGroup;
 45class LLComboBox;
 46class LLLineEditor;
 47class LLMessageSystem;
 48class LLNameListCtrl;
 49class LLRadioGroup;
 50class LLParcelSelectionObserver;
 51class LLSpinCtrl;
 52class LLTabContainer;
 53class LLTextBox;
 54class LLTextEditor;
 55class LLTextureCtrl;
 56class LLUIImage;
 57class LLParcelSelection;
 58
 59class LLPanelLandGeneral;
 60class LLPanelLandObjects;
 61class LLPanelLandOptions;
 62class LLPanelLandAudio;
 63class LLPanelLandMedia;
 64class LLPanelLandAccess;
 65class LLPanelLandBan;
 66class LLPanelLandRenters;
 67class LLPanelLandCovenant;
 68class LLParcel;
 69
 70class LLFloaterLand
 71:	public LLFloater
 72{
 73	friend class LLFloaterReg;
 74public:
 75	static void refreshAll();
 76
 77	static LLPanelLandObjects* getCurrentPanelLandObjects();
 78	static LLPanelLandCovenant* getCurrentPanelLandCovenant();
 79	
 80	LLParcel* getCurrentSelectedParcel();
 81	
 82	virtual void onOpen(const LLSD& key);
 83	virtual BOOL postBuild();
 84
 85private:
 86	// Does its own instance management, so clients not allowed
 87	// to allocate or destroy.
 88	LLFloaterLand(const LLSD& seed);
 89	virtual ~LLFloaterLand();
 90		
 91	void onVisibilityChange(const LLSD& visible);
 92
 93protected:
 94
 95	/*virtual*/ void refresh();
 96
 97	static void* createPanelLandGeneral(void* data);
 98	static void* createPanelLandCovenant(void* data);
 99	static void* createPanelLandObjects(void* data);
100	static void* createPanelLandOptions(void* data);
101	static void* createPanelLandAudio(void* data);
102	static void* createPanelLandMedia(void* data);
103	static void* createPanelLandAccess(void* data);
104	static void* createPanelLandBan(void* data);
105
106
107protected:
108	static LLParcelSelectionObserver* sObserver;
109	static S32 sLastTab;
110
111	LLTabContainer*			mTabLand;
112	LLPanelLandGeneral*		mPanelGeneral;
113	LLPanelLandObjects*		mPanelObjects;
114	LLPanelLandOptions*		mPanelOptions;
115	LLPanelLandAudio*		mPanelAudio;
116	LLPanelLandMedia*		mPanelMedia;
117	LLPanelLandAccess*		mPanelAccess;
118	LLPanelLandCovenant*	mPanelCovenant;
119
120	LLSafeHandle<LLParcelSelection>	mParcel;
121
122public:
123	// When closing the dialog, we want to deselect the land.  But when
124	// we send an update to the simulator, it usually replies with the
125	// parcel information, causing the land to be reselected.  This allows
126	// us to suppress that behavior.
127	static BOOL sRequestReplyOnUpdate;
128};
129
130
131class LLPanelLandGeneral
132:	public LLPanel
133{
134public:
135	LLPanelLandGeneral(LLSafeHandle<LLParcelSelection>& parcelp);
136	virtual ~LLPanelLandGeneral();
137	/*virtual*/ void refresh();
138	void refreshNames();
139	virtual void draw();
140
141	void setGroup(const LLUUID& group_id);
142	void onClickProfile();
143	void onClickSetGroup();
144	static void onClickDeed(void*);
145	static void onClickBuyLand(void* data);
146	static void onClickScriptLimits(void* data);
147	static void onClickRelease(void*);
148	static void onClickReclaim(void*);
149	static void onClickBuyPass(void* deselect_when_done);
150	static BOOL enableBuyPass(void*);
151	static void onCommitAny(LLUICtrl* ctrl, void *userdata);
152	static void finalizeCommit(void * userdata);
153	static void onForSaleChange(LLUICtrl *ctrl, void * userdata);
154	static void finalizeSetSellChange(void * userdata);
155	static void onSalePriceChange(LLUICtrl *ctrl, void * userdata);
156
157	static bool cbBuyPass(const LLSD& notification, const LLSD& response);
158
159	static void onClickSellLand(void* data);
160	static void onClickStopSellLand(void* data);
161	static void onClickSet(void* data);
162	static void onClickClear(void* data);
163	static void onClickShow(void* data);
164	static void callbackAvatarPick(const std::vector<std::string>& names, const uuid_vec_t& ids, void* data);
165	static void finalizeAvatarPick(void* data);
166	static void callbackHighlightTransferable(S32 option, void* userdata);
167	static void onClickStartAuction(void*);
168	// sale change confirmed when "is for sale", "sale price", "sell to whom" fields are changed
169	static void confirmSaleChange(S32 landSize, S32 salePrice, std::string authorizedName, void(*callback)(void*), void* userdata);
170	static void callbackConfirmSaleChange(S32 option, void* userdata);
171
172	virtual BOOL postBuild();
173
174protected:
175	BOOL			mUncheckedSell; // True only when verifying land information when land is for sale on sale info change
176	
177	LLTextBox*		mLabelName;
178	LLLineEditor*	mEditName;
179	LLTextBox*		mLabelDesc;
180	LLTextEditor*	mEditDesc;
181
182	LLTextBox*		mTextSalePending;
183
184 	LLButton*		mBtnDeedToGroup;
185 	LLButton*		mBtnSetGroup;
186
187	LLTextBox*		mTextOwnerLabel;
188	LLTextBox*		mTextOwner;
189	LLButton*		mBtnProfile;
190	
191	LLTextBox*		mContentRating;
192	LLTextBox*		mLandType;
193
194	LLTextBox*		mTextGroup;
195	LLTextBox*		mTextGroupLabel;
196	LLTextBox*		mTextClaimDateLabel;
197	LLTextBox*		mTextClaimDate;
198
199	LLTextBox*		mTextPriceLabel;
200	LLTextBox*		mTextPrice;
201
202	LLCheckBoxCtrl* mCheckDeedToGroup;
203	LLCheckBoxCtrl* mCheckContributeWithDeed;
204
205	LLTextBox*		mSaleInfoForSale1;
206	LLTextBox*		mSaleInfoForSale2;
207	LLTextBox*		mSaleInfoForSaleObjects;
208	LLTextBox*		mSaleInfoForSaleNoObjects;
209	LLTextBox*		mSaleInfoNotForSale;
210	LLButton*		mBtnSellLand;
211	LLButton*		mBtnStopSellLand;
212
213	LLTextBox*		mTextDwell;
214
215	LLButton*		mBtnBuyLand;
216	LLButton*		mBtnScriptLimits;
217	LLButton*		mBtnBuyGroupLand;
218
219	// these buttons share the same location, but
220	// reclaim is in exactly the same visual place,
221	// ond is only shown for estate owners on their
222	// estate since they cannot release land.
223	LLButton*		mBtnReleaseLand;
224	LLButton*		mBtnReclaimLand;
225
226	LLButton*		mBtnBuyPass;
227	LLButton* mBtnStartAuction;
228
229	LLSafeHandle<LLParcelSelection>&	mParcel;
230
231	// This pointer is needed to avoid parcel deselection until buying pass is completed or canceled.
232	// Deselection happened because of zero references to parcel selection, which took place when 
233	// "Buy Pass" was called from popup menu(EXT-6464)
234	static LLPointer<LLParcelSelection>	sSelectionForBuyPass;
235
236	static LLHandle<LLFloater> sBuyPassDialogHandle;
237};
238
239class LLPanelLandObjects
240:	public LLPanel
241{
242public:
243	LLPanelLandObjects(LLSafeHandle<LLParcelSelection>& parcelp);
244	virtual ~LLPanelLandObjects();
245	/*virtual*/ void refresh();
246	virtual void draw();
247
248	bool callbackReturnOwnerObjects(const LLSD& notification, const LLSD& response);
249	bool callbackReturnGroupObjects(const LLSD& notification, const LLSD& response);
250	bool callbackReturnOtherObjects(const LLSD& notification, const LLSD& response);
251	bool callbackReturnOwnerList(const LLSD& notification, const LLSD& response);
252
253	static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type, uuid_list_t* list = 0);
254	static void onClickShowOwnerObjects(void*);
255	static void onClickShowGroupObjects(void*);
256	static void onClickShowOtherObjects(void*);
257
258	static void onClickReturnOwnerObjects(void*);
259	static void onClickReturnGroupObjects(void*);
260	static void onClickReturnOtherObjects(void*);
261	static void onClickReturnOwnerList(void*);
262	static void onClickRefresh(void*);
263
264	static void onDoubleClickOwner(void*);	
265
266	static void onCommitList(LLUICtrl* ctrl, void* data);
267	static void onLostFocus(LLFocusableElement* caller, void* user_data);
268	static void onCommitClean(LLUICtrl* caller, void* user_data);
269	static void processParcelObjectOwnersReply(LLMessageSystem *msg, void **);
270	
271	virtual BOOL postBuild();
272
273protected:
274
275	LLTextBox		*mParcelObjectBonus;
276	LLTextBox		*mSWTotalObjects;
277	LLTextBox		*mObjectContribution;
278	LLTextBox		*mTotalObjects;
279	LLTextBox		*mOwnerObjects;
280	LLButton		*mBtnShowOwnerObjects;
281	LLButton		*mBtnReturnOwnerObjects;
282	LLTextBox		*mGroupObjects;
283	LLButton		*mBtnShowGroupObjects;
284	LLButton		*mBtnReturnGroupObjects;
285	LLTextBox		*mOtherObjects;
286	LLButton		*mBtnShowOtherObjects;
287	LLButton		*mBtnReturnOtherObjects;
288	LLTextBox		*mSelectedObjects;
289	LLLineEditor	*mCleanOtherObjectsTime;
290	S32				mOtherTime;
291	LLButton		*mBtnRefresh;
292	LLButton		*mBtnReturnOwnerList;
293	LLNameListCtrl	*mOwnerList;
294
295	LLPointer<LLUIImage>	mIconAvatarOnline;
296	LLPointer<LLUIImage>	mIconAvatarOffline;
297	LLPointer<LLUIImage>	mIconGroup;
298
299	BOOL			mFirstReply;
300
301	uuid_list_t		mSelectedOwners;
302	std::string		mSelectedName;
303	S32				mSelectedCount;
304	BOOL			mSelectedIsGroup;
305
306	LLSafeHandle<LLParcelSelection>&	mParcel;
307};
308
309
310class LLPanelLandOptions
311:	public LLPanel
312{
313public:
314	LLPanelLandOptions(LLSafeHandle<LLParcelSelection>& parcelp);
315	virtual ~LLPanelLandOptions();
316	/*virtual*/ BOOL postBuild();
317	/*virtual*/ void draw();
318	/*virtual*/ void refresh();
319
320private:
321	// Refresh the "show in search" checkbox and category selector.
322	void refreshSearch();
323
324	static void onCommitAny(LLUICtrl* ctrl, void *userdata);
325	static void onClickSet(void* userdata);
326	static void onClickClear(void* userdata);
327
328private:
329	LLCheckBoxCtrl*	mCheckEditObjects;
330	LLCheckBoxCtrl*	mCheckEditGroupObjects;
331	LLCheckBoxCtrl*	mCheckAllObjectEntry;
332	LLCheckBoxCtrl*	mCheckGroupObjectEntry;
333	LLCheckBoxCtrl*	mCheckSafe;
334	LLCheckBoxCtrl*	mCheckFly;
335	LLCheckBoxCtrl*	mCheckGroupScripts;
336	LLCheckBoxCtrl*	mCheckOtherScripts;
337
338	LLCheckBoxCtrl*	mCheckShowDirectory;
339	LLComboBox*		mCategoryCombo;
340	LLComboBox*		mLandingTypeCombo;
341
342	LLTextureCtrl*	mSnapshotCtrl;
343
344	LLTextBox*		mLocationText;
345	LLButton*		mSetBtn;
346	LLButton*		mClearBtn;
347
348	LLCheckBoxCtrl		*mMatureCtrl;
349	LLCheckBoxCtrl		*mPushRestrictionCtrl;
350	LLCheckBoxCtrl		*mSeeAvatarsCtrl;
351
352	LLSafeHandle<LLParcelSelection>&	mParcel;
353};
354
355
356class LLPanelLandAccess
357:	public LLPanel
358{
359public:
360	LLPanelLandAccess(LLSafeHandle<LLParcelSelection>& parcelp);
361	virtual ~LLPanelLandAccess();
362	void refresh();
363	void refresh_ui();
364	void refreshNames();
365	virtual void draw();
366
367	static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
368	static void onCommitAny(LLUICtrl* ctrl, void *userdata);
369	static void onClickRemoveAccess(void*);
370	static void onClickRemoveBanned(void*);
371
372	virtual BOOL postBuild();
373	
374	void onClickAddAccess();
375	void onClickAddBanned();
376	void callbackAvatarCBBanned(const uuid_vec_t& ids);
377	void callbackAvatarCBAccess(const uuid_vec_t& ids);
378
379protected:
380	LLNameListCtrl*		mListAccess;
381	LLNameListCtrl*		mListBanned;
382
383	LLSafeHandle<LLParcelSelection>&	mParcel;
384};
385
386
387class LLPanelLandCovenant
388:	public LLPanel
389{
390public:
391	LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp);
392	virtual ~LLPanelLandCovenant();
393	void refresh();
394	static void updateCovenantText(const std::string& string);
395	static void updateEstateName(const std::string& name);
396	static void updateLastModified(const std::string& text);
397	static void updateEstateOwnerName(const std::string& name);
398
399protected:
400	LLSafeHandle<LLParcelSelection>&	mParcel;
401};
402
403#endif