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