llfloaterland.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:12k
源码类别:

游戏引擎

开发平台:

C++ Builder

  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=viewergpl$
  7.  * 
  8.  * Copyright (c) 2002-2010, Linden Research, Inc.
  9.  * 
  10.  * Second Life Viewer Source Code
  11.  * The source code in this file ("Source Code") is provided by Linden Lab
  12.  * to you under the terms of the GNU General Public License, version 2.0
  13.  * ("GPL"), unless you have obtained a separate licensing agreement
  14.  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  15.  * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16.  * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17.  * 
  18.  * There are special exceptions to the terms and conditions of the GPL as
  19.  * it is applied to this Source Code. View the full text of the exception
  20.  * in the file doc/FLOSS-exception.txt in this software distribution, or
  21.  * online at
  22.  * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23.  * 
  24.  * By copying, modifying or distributing this software, you acknowledge
  25.  * that you have read and understood your obligations described above,
  26.  * and agree to abide by those obligations.
  27.  * 
  28.  * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29.  * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30.  * COMPLETENESS OR PERFORMANCE.
  31.  * $/LicenseInfo$
  32.  */
  33. #ifndef LL_LLFLOATERLAND_H
  34. #define LL_LLFLOATERLAND_H
  35. #include <set>
  36. #include <vector>
  37. #include "llfloater.h"
  38. #include "llpointer.h" // LLPointer<>
  39. //#include "llviewertexturelist.h"
  40. #include "llsafehandle.h"
  41. typedef std::set<LLUUID, lluuid_less> uuid_list_t;
  42. const F32 CACHE_REFRESH_TIME = 2.5f;
  43. class LLButton;
  44. class LLCheckBoxCtrl;
  45. class LLRadioGroup;
  46. class LLComboBox;
  47. class LLNameListCtrl;
  48. class LLSpinCtrl;
  49. class LLLineEditor;
  50. class LLRadioGroup;
  51. class LLParcelSelectionObserver;
  52. class LLTabContainer;
  53. class LLTextBox;
  54. class LLTextEditor;
  55. class LLTextureCtrl;
  56. class LLUIImage;
  57. class LLParcelSelection;
  58. class LLPanelLandGeneral;
  59. class LLPanelLandObjects;
  60. class LLPanelLandOptions;
  61. class LLPanelLandAudio;
  62. class LLPanelLandMedia;
  63. class LLPanelLandAccess;
  64. class LLPanelLandBan;
  65. class LLPanelLandRenters;
  66. class LLPanelLandCovenant;
  67. class LLParcel;
  68. class LLFloaterLand
  69. : public LLFloater
  70. {
  71. friend class LLFloaterReg;
  72. public:
  73. static void refreshAll();
  74. static LLPanelLandObjects* getCurrentPanelLandObjects();
  75. static LLPanelLandCovenant* getCurrentPanelLandCovenant();
  76. LLParcel* getCurrentSelectedParcel();
  77. virtual void onOpen(const LLSD& key);
  78. virtual BOOL postBuild();
  79. private:
  80. // Does its own instance management, so clients not allowed
  81. // to allocate or destroy.
  82. LLFloaterLand(const LLSD& seed);
  83. virtual ~LLFloaterLand();
  84. void onVisibilityChange(const LLSD& visible);
  85. protected:
  86. /*virtual*/ void refresh();
  87. static void* createPanelLandGeneral(void* data);
  88. static void* createPanelLandCovenant(void* data);
  89. static void* createPanelLandObjects(void* data);
  90. static void* createPanelLandOptions(void* data);
  91. static void* createPanelLandAudio(void* data);
  92. static void* createPanelLandMedia(void* data);
  93. static void* createPanelLandAccess(void* data);
  94. static void* createPanelLandBan(void* data);
  95. protected:
  96. static LLParcelSelectionObserver* sObserver;
  97. static S32 sLastTab;
  98. LLTabContainer* mTabLand;
  99. LLPanelLandGeneral* mPanelGeneral;
  100. LLPanelLandObjects* mPanelObjects;
  101. LLPanelLandOptions* mPanelOptions;
  102. LLPanelLandAudio* mPanelAudio;
  103. LLPanelLandMedia* mPanelMedia;
  104. LLPanelLandAccess* mPanelAccess;
  105. LLPanelLandCovenant* mPanelCovenant;
  106. LLSafeHandle<LLParcelSelection> mParcel;
  107. public:
  108. // When closing the dialog, we want to deselect the land.  But when
  109. // we send an update to the simulator, it usually replies with the
  110. // parcel information, causing the land to be reselected.  This allows
  111. // us to suppress that behavior.
  112. static BOOL sRequestReplyOnUpdate;
  113. };
  114. class LLPanelLandGeneral
  115. : public LLPanel
  116. {
  117. public:
  118. LLPanelLandGeneral(LLSafeHandle<LLParcelSelection>& parcelp);
  119. virtual ~LLPanelLandGeneral();
  120. /*virtual*/ void refresh();
  121. void refreshNames();
  122. virtual void draw();
  123. void setGroup(const LLUUID& group_id);
  124. static void onClickProfile(void*);
  125.    void onClickSetGroup();
  126. static BOOL enableDeedToGroup(void*);
  127. static void onClickDeed(void*);
  128. static void onClickBuyLand(void* data);
  129. static void onClickScriptLimits(void* data);
  130. static void onClickRelease(void*);
  131. static void onClickReclaim(void*);
  132. static void onClickBuyPass(void* deselect_when_done);
  133. static BOOL enableBuyPass(void*);
  134. static void onCommitAny(LLUICtrl* ctrl, void *userdata);
  135. static void finalizeCommit(void * userdata);
  136. static void onForSaleChange(LLUICtrl *ctrl, void * userdata);
  137. static void finalizeSetSellChange(void * userdata);
  138. static void onSalePriceChange(LLUICtrl *ctrl, void * userdata);
  139. static bool cbBuyPass(const LLSD& notification, const LLSD& response);
  140. static void onClickSellLand(void* data);
  141. static void onClickStopSellLand(void* data);
  142. static void onClickSet(void* data);
  143. static void onClickClear(void* data);
  144. static void onClickShow(void* data);
  145. static void callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
  146. static void finalizeAvatarPick(void* data);
  147. static void callbackHighlightTransferable(S32 option, void* userdata);
  148. static void onClickStartAuction(void*);
  149. // sale change confirmed when "is for sale", "sale price", "sell to whom" fields are changed
  150. static void confirmSaleChange(S32 landSize, S32 salePrice, std::string authorizedName, void(*callback)(void*), void* userdata);
  151. static void callbackConfirmSaleChange(S32 option, void* userdata);
  152. virtual BOOL postBuild();
  153. protected:
  154. BOOL mUncheckedSell; // True only when verifying land information when land is for sale on sale info change
  155. LLTextBox* mLabelName;
  156. LLLineEditor* mEditName;
  157. LLTextBox* mLabelDesc;
  158. LLTextEditor* mEditDesc;
  159. LLTextBox* mTextSalePending;
  160.   LLButton* mBtnDeedToGroup;
  161.   LLButton* mBtnSetGroup;
  162. LLTextBox* mTextOwnerLabel;
  163. LLTextBox* mTextOwner;
  164. LLButton* mBtnProfile;
  165. LLTextBox* mContentRating;
  166. LLTextBox* mLandType;
  167. LLTextBox* mTextGroup;
  168. LLTextBox* mTextGroupLabel;
  169. LLTextBox* mTextClaimDateLabel;
  170. LLTextBox* mTextClaimDate;
  171. LLTextBox* mTextPriceLabel;
  172. LLTextBox* mTextPrice;
  173. LLCheckBoxCtrl* mCheckDeedToGroup;
  174. LLCheckBoxCtrl* mCheckContributeWithDeed;
  175. LLTextBox* mSaleInfoForSale1;
  176. LLTextBox* mSaleInfoForSale2;
  177. LLTextBox* mSaleInfoForSaleObjects;
  178. LLTextBox* mSaleInfoForSaleNoObjects;
  179. LLTextBox* mSaleInfoNotForSale;
  180. LLButton* mBtnSellLand;
  181. LLButton* mBtnStopSellLand;
  182. LLTextBox* mTextDwell;
  183. LLButton* mBtnBuyLand;
  184. LLButton* mBtnScriptLimits;
  185. LLButton* mBtnBuyGroupLand;
  186. // these buttons share the same location, but
  187. // reclaim is in exactly the same visual place,
  188. // ond is only shown for estate owners on their
  189. // estate since they cannot release land.
  190. LLButton* mBtnReleaseLand;
  191. LLButton* mBtnReclaimLand;
  192. LLButton* mBtnBuyPass;
  193. LLButton* mBtnStartAuction;
  194. LLSafeHandle<LLParcelSelection>& mParcel;
  195. static LLHandle<LLFloater> sBuyPassDialogHandle;
  196. };
  197. class LLPanelLandObjects
  198. : public LLPanel
  199. {
  200. public:
  201. LLPanelLandObjects(LLSafeHandle<LLParcelSelection>& parcelp);
  202. virtual ~LLPanelLandObjects();
  203. /*virtual*/ void refresh();
  204. virtual void draw();
  205. bool callbackReturnOwnerObjects(const LLSD& notification, const LLSD& response);
  206. bool callbackReturnGroupObjects(const LLSD& notification, const LLSD& response);
  207. bool callbackReturnOtherObjects(const LLSD& notification, const LLSD& response);
  208. bool callbackReturnOwnerList(const LLSD& notification, const LLSD& response);
  209. static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type, uuid_list_t* list = 0);
  210. static void onClickShowOwnerObjects(void*);
  211. static void onClickShowGroupObjects(void*);
  212. static void onClickShowOtherObjects(void*);
  213. static void onClickReturnOwnerObjects(void*);
  214. static void onClickReturnGroupObjects(void*);
  215. static void onClickReturnOtherObjects(void*);
  216. static void onClickReturnOwnerList(void*);
  217. static void onClickRefresh(void*);
  218. static void onDoubleClickOwner(void*);
  219. static void onCommitList(LLUICtrl* ctrl, void* data);
  220. static void onLostFocus(LLFocusableElement* caller, void* user_data);
  221. static void onCommitClean(LLUICtrl* caller, void* user_data);
  222. static void processParcelObjectOwnersReply(LLMessageSystem *msg, void **);
  223. virtual BOOL postBuild();
  224. protected:
  225. LLTextBox *mParcelObjectBonus;
  226. LLTextBox *mSWTotalObjects;
  227. LLTextBox *mObjectContribution;
  228. LLTextBox *mTotalObjects;
  229. LLTextBox *mOwnerObjects;
  230. LLButton *mBtnShowOwnerObjects;
  231. LLButton *mBtnReturnOwnerObjects;
  232. LLTextBox *mGroupObjects;
  233. LLButton *mBtnShowGroupObjects;
  234. LLButton *mBtnReturnGroupObjects;
  235. LLTextBox *mOtherObjects;
  236. LLButton *mBtnShowOtherObjects;
  237. LLButton *mBtnReturnOtherObjects;
  238. LLTextBox *mSelectedObjects;
  239. LLLineEditor *mCleanOtherObjectsTime;
  240. S32 mOtherTime;
  241. LLButton *mBtnRefresh;
  242. LLButton *mBtnReturnOwnerList;
  243. LLNameListCtrl *mOwnerList;
  244. LLPointer<LLUIImage> mIconAvatarOnline;
  245. LLPointer<LLUIImage> mIconAvatarOffline;
  246. LLPointer<LLUIImage> mIconGroup;
  247. BOOL mFirstReply;
  248. uuid_list_t mSelectedOwners;
  249. std::string mSelectedName;
  250. S32 mSelectedCount;
  251. BOOL mSelectedIsGroup;
  252. LLSafeHandle<LLParcelSelection>& mParcel;
  253. };
  254. class LLPanelLandOptions
  255. : public LLPanel
  256. {
  257. public:
  258. LLPanelLandOptions(LLSafeHandle<LLParcelSelection>& parcelp);
  259. virtual ~LLPanelLandOptions();
  260. /*virtual*/ BOOL postBuild();
  261. /*virtual*/ void draw();
  262. /*virtual*/ void refresh();
  263. private:
  264. // Refresh the "show in search" checkbox and category selector.
  265. void refreshSearch();
  266. static void onCommitAny(LLUICtrl* ctrl, void *userdata);
  267. static void onClickSet(void* userdata);
  268. static void onClickClear(void* userdata);
  269. private:
  270. LLCheckBoxCtrl* mCheckEditObjects;
  271. LLCheckBoxCtrl* mCheckEditGroupObjects;
  272. LLCheckBoxCtrl* mCheckAllObjectEntry;
  273. LLCheckBoxCtrl* mCheckGroupObjectEntry;
  274. LLCheckBoxCtrl* mCheckEditLand;
  275. LLCheckBoxCtrl* mCheckSafe;
  276. LLCheckBoxCtrl* mCheckFly;
  277. LLCheckBoxCtrl* mCheckGroupScripts;
  278. LLCheckBoxCtrl* mCheckOtherScripts;
  279. LLCheckBoxCtrl* mCheckShowDirectory;
  280. LLComboBox* mCategoryCombo;
  281. LLComboBox* mLandingTypeCombo;
  282. LLTextureCtrl* mSnapshotCtrl;
  283. LLTextBox* mLocationText;
  284. LLButton* mSetBtn;
  285. LLButton* mClearBtn;
  286. LLCheckBoxCtrl *mMatureCtrl;
  287. LLCheckBoxCtrl *mPushRestrictionCtrl;
  288. LLSafeHandle<LLParcelSelection>& mParcel;
  289. };
  290. class LLPanelLandAccess
  291. : public LLPanel
  292. {
  293. public:
  294. LLPanelLandAccess(LLSafeHandle<LLParcelSelection>& parcelp);
  295. virtual ~LLPanelLandAccess();
  296. void refresh();
  297. void refresh_ui();
  298. void refreshNames();
  299. virtual void draw();
  300. static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
  301. static void onCommitAny(LLUICtrl* ctrl, void *userdata);
  302. static void onClickRemoveAccess(void*);
  303. static void onClickRemoveBanned(void*);
  304. virtual BOOL postBuild();
  305. void onClickAddAccess();
  306. void onClickAddBanned();
  307. void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
  308. void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
  309. protected:
  310. LLNameListCtrl* mListAccess;
  311. LLNameListCtrl* mListBanned;
  312. LLSafeHandle<LLParcelSelection>& mParcel;
  313. };
  314. class LLPanelLandCovenant
  315. : public LLPanel
  316. {
  317. public:
  318. LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp);
  319. virtual ~LLPanelLandCovenant();
  320. void refresh();
  321. static void updateCovenantText(const std::string& string);
  322. static void updateEstateName(const std::string& name);
  323. static void updateLastModified(const std::string& text);
  324. static void updateEstateOwnerName(const std::string& name);
  325. protected:
  326. LLSafeHandle<LLParcelSelection>& mParcel;
  327. };
  328. #endif