llfloaterland.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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-2009, 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 "llsafehandle.h"
  39. typedef std::set<LLUUID> owners_list_t;
  40. constexpr F32 CACHE_REFRESH_TIME = 2.5f;
  41. class LLButton;
  42. class LLCheckBoxCtrl;
  43. class LLComboBox;
  44. class LLFloaterLandParcelSelectObserver;
  45. class LLLineEditor;
  46. class LLMessageSystem;
  47. class LLNameListCtrl;
  48. class LLPanelExperienceListEditor;
  49. class LLPanelLandAccess;
  50. class LLPanelLandAudio;
  51. class LLPanelLandBan;
  52. class LLPanelLandCovenant;
  53. class HBPanelLandEnvironment;
  54. class LLPanelLandExperiences;
  55. class LLPanelLandGeneral;
  56. class LLPanelLandMedia;
  57. class LLPanelLandObjects;
  58. class LLPanelLandOptions;
  59. class LLPanelLandRenters;
  60. class LLParcelSelection;
  61. class LLRadioGroup;
  62. class LLSpinCtrl;
  63. class LLTabContainer;
  64. class LLTextBox;
  65. class LLTextEditor;
  66. class LLTextureCtrl;
  67. class LLUIImage;
  68. class LLViewerTextEditor;
  69. class LLFloaterLand final : public LLFloater,
  70. public LLFloaterSingleton<LLFloaterLand>
  71. {
  72. friend class LLUISingleton<LLFloaterLand, VisibilityPolicy<LLFloater> >;
  73. public:
  74. static LLPanelLandObjects* getCurrentPanelLandObjects();
  75. static LLPanelLandCovenant* getCurrentPanelLandCovenant();
  76. // Destroys itself on close.
  77. void onClose(bool app_quitting) override;
  78. void onOpen() override;
  79. bool postBuild() override;
  80. void refresh() override;
  81. protected:
  82. // Does its own instance management, so clients not allowed to allocate or
  83. // destroy.
  84. LLFloaterLand(const LLSD&);
  85. ~LLFloaterLand() override;
  86. static void* createPanelLandGeneral(void* data);
  87. static void* createPanelLandCovenant(void* data);
  88. static void* createPanelLandObjects(void* data);
  89. static void* createPanelLandOptions(void* data);
  90. static void* createPanelLandAudio(void* data);
  91. static void* createPanelLandMedia(void* data);
  92. static void* createPanelLandAccess(void* data);
  93. public:
  94. // When closing the dialog, we want to deselect the land. But when we
  95. // send an update to the simulator, it usually replies with the parcel
  96. // information, causing the land to be reselected. This allows us to
  97. // suppress that behavior.
  98. static bool sRequestReplyOnUpdate;
  99. protected:
  100. static LLFloaterLandParcelSelectObserver* sObserver;
  101. static S32 sLastTab;
  102. LLTabContainer* mTabLand;
  103. LLPanelLandGeneral* mPanelGeneral;
  104. LLPanelLandObjects* mPanelObjects;
  105. LLPanelLandOptions* mPanelOptions;
  106. LLPanelLandAudio* mPanelAudio;
  107. LLPanelLandMedia* mPanelMedia;
  108. LLPanelLandAccess* mPanelAccess;
  109. LLPanelLandCovenant* mPanelCovenant;
  110. LLPanelLandExperiences* mPanelExperiences;
  111. HBPanelLandEnvironment* mPanelEnvironment;
  112. LLSafeHandle<LLParcelSelection> mParcel;
  113. };
  114. class LLPanelLandGeneral final : public LLPanel
  115. {
  116. public:
  117. LLPanelLandGeneral(LLSafeHandle<LLParcelSelection>& parcelp);
  118. virtual ~LLPanelLandGeneral();
  119. bool postBuild() override;
  120. void refresh() override;
  121. void draw() override;
  122. void refreshNames();
  123. void setGroup(const LLUUID& group_id);
  124. // used in llviewermenu.cpp
  125. static bool enableBuyPass(void*);
  126. // also used in lltoolpie.cpp
  127. static void onClickBuyPass(void* deselect_when_done);
  128. private:
  129. static void onClickProfile(void*);
  130. static void onClickSetGroup(void*);
  131. static void cbGroupID(LLUUID group_id, void* userdata);
  132. #if 0 // unused
  133. static bool enableDeedToGroup(void*);
  134. #endif
  135. static void onClickDeed(void*);
  136. static void onClickBuyLand(void* data);
  137. static void onClickRelease(void*);
  138. static void onClickReclaim(void*);
  139. static void onCommitAny(LLUICtrl* ctrl, void* userdata);
  140. static bool cbBuyPass(const LLSD& notification, const LLSD& response);
  141. static void onClickSellLand(void* data);
  142. static void onClickStopSellLand(void* data);
  143. static void onClickSet(void* data);
  144. static void onClickClear(void* data);
  145. static void onClickShow(void* data);
  146. static void onClickStartAuction(void*);
  147. private:
  148. // true only when verifying land information when land is for sale on sale
  149. // info change:
  150. bool mUncheckedSell;
  151. LLTextBox* mLabelName;
  152. LLLineEditor* mEditName;
  153. LLTextBox* mLabelDesc;
  154. LLTextEditor* mEditDesc;
  155. LLTextBox* mTextSalePending;
  156. LLButton* mBtnDeedToGroup;
  157. LLButton* mBtnSetGroup;
  158. LLTextBox* mTextOwner;
  159. LLButton* mBtnProfile;
  160. LLTextBox* mContentRating;
  161. LLTextBox* mLandType;
  162. LLTextBox* mTextGroup;
  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* mBtnBuyGroupLand;
  179. // These buttons share the same location, but reclaim is in exactly the
  180. // same visual place, and is only shown for estate owners on their estate
  181. // since they cannot release land.
  182. LLButton* mBtnReleaseLand;
  183. LLButton* mBtnReclaimLand;
  184. LLButton* mBtnBuyPass;
  185. LLButton* mBtnStartAuction;
  186. std::string mAnyoneText;
  187. LLSafeHandle<LLParcelSelection>& mParcel;
  188. static LLHandle<LLFloater> sBuyPassDialogHandle;
  189. };
  190. class LLPanelLandObjects final : public LLPanel
  191. {
  192. protected:
  193. LOG_CLASS(LLPanelLandObjects);
  194. public:
  195. LLPanelLandObjects(LLSafeHandle<LLParcelSelection>& parcelp);
  196. ~LLPanelLandObjects() override;
  197. bool postBuild() override;
  198. void refresh() override;
  199. static void processParcelObjectOwnersReply(LLMessageSystem* msg, void**);
  200. private:
  201. bool callbackReturnOwnerObjects(const LLSD& notification,
  202. const LLSD& response);
  203. bool callbackReturnGroupObjects(const LLSD& notification,
  204. const LLSD& response);
  205. bool callbackReturnOtherObjects(const LLSD& notification,
  206. const LLSD& response);
  207. bool callbackReturnOwnerList(const LLSD& notification,
  208. const LLSD& response);
  209. static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type,
  210. owners_list_t* list = 0);
  211. static void onClickShowOwnerObjects(void*);
  212. static void onClickShowGroupObjects(void*);
  213. static void onClickShowOtherObjects(void*);
  214. static void onClickReturnOwnerObjects(void*);
  215. static void onClickReturnGroupObjects(void*);
  216. static void onClickReturnOtherObjects(void*);
  217. static void onClickReturnOwnerList(void*);
  218. static void onClickRefresh(void*);
  219. static void onDoubleClickOwner(void*);
  220. static void onCommitList(LLUICtrl* ctrl, void* data);
  221. static void onLostFocus(LLFocusableElement* caller, void* user_data);
  222. static void onCommitClean(LLUICtrl* caller, void* user_data);
  223. private:
  224. LLSafeHandle<LLParcelSelection>& mParcel;
  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. LLUIImagePtr mIconAvatarOnline;
  245. LLUIImagePtr mIconAvatarOffline;
  246. LLUIImagePtr mIconGroup;
  247. S32 mSelectedCount;
  248. owners_list_t mSelectedOwners;
  249. std::string mSelectedName;
  250. bool mSelectedIsGroup;
  251. bool mFirstReply;
  252. };
  253. class LLPanelLandOptions final : public LLPanel
  254. {
  255. public:
  256. LLPanelLandOptions(LLSafeHandle<LLParcelSelection>& parcelp);
  257. virtual ~LLPanelLandOptions();
  258. bool postBuild() override;
  259. void draw() override;
  260. void refresh() override;
  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. static void onClickPublishHelp(void*);
  268. private:
  269. LLCheckBoxCtrl* mCreateObjectsCheck;
  270. LLCheckBoxCtrl* mCreateGrpObjectsCheck;
  271. LLCheckBoxCtrl* mAllObjectEntryCheck;
  272. LLCheckBoxCtrl* mGroupObjectEntryCheck;
  273. LLCheckBoxCtrl* mEditLandCheck;
  274. LLCheckBoxCtrl* mNoDamageCheck;
  275. LLCheckBoxCtrl* mCanFlyCheck;
  276. LLCheckBoxCtrl* mGroupScriptsCheck;
  277. LLCheckBoxCtrl* mAllScriptsCheck;
  278. LLCheckBoxCtrl* mShowDirectoryCheck;
  279. LLCheckBoxCtrl* mMatureCheck;
  280. LLCheckBoxCtrl* mPushRestrictionCheck;
  281. LLCheckBoxCtrl* mPrivacyCheck;
  282. LLComboBox* mCategoryCombo;
  283. LLComboBox* mTeleportRoutingCombo;
  284. LLTextureCtrl* mSnapshotCtrl;
  285. LLTextBox* mLocationText;
  286. LLButton* mSetBtn;
  287. LLButton* mClearBtn;
  288. LLButton* mPublishHelpButton;
  289. LLSafeHandle<LLParcelSelection>& mParcel;
  290. };
  291. class LLPanelLandAccess final : public LLPanel
  292. {
  293. public:
  294. LLPanelLandAccess(LLSafeHandle<LLParcelSelection>& parcelp);
  295. ~LLPanelLandAccess() override;
  296. bool postBuild() override;
  297. void draw() override;
  298. void refresh() override;
  299. void refreshUI();
  300. void refreshNames();
  301. private:
  302. static void onCommitPublicAccess(LLUICtrl* ctrl, void* userdata);
  303. static void onCommitGroupCheck(LLUICtrl* ctrl, void* userdata);
  304. static void onCommitAny(LLUICtrl* ctrl, void* userdata);
  305. static void onClickAddAccess(void*);
  306. static void callbackAvatarCBAccess(const std::vector<std::string>& names,
  307. const uuid_vec_t& ids, void* userdata);
  308. static void onClickRemoveAccess(void* userdata);
  309. static void onClickAddBanned(void* userdata);
  310. static void callbackAvatarCBBanned(const std::vector<std::string>& names,
  311. const uuid_vec_t& ids, void* userdata);
  312. static void callbackAvatarCBBanned2(const uuid_vec_t& ids, S32 duration,
  313. void* userdata);
  314. static void onClickRemoveBanned(void*);
  315. private:
  316. LLTextBox* mOnlyAllowText;
  317. LLCheckBoxCtrl* mCheckPublicAccess;
  318. LLCheckBoxCtrl* mCheckLimitPayment;
  319. LLCheckBoxCtrl* mCheckLimitAge;
  320. LLCheckBoxCtrl* mCheckLimitGroup;
  321. LLCheckBoxCtrl* mCheckLimitPass;
  322. LLComboBox* mPassCombo;
  323. LLSpinCtrl* mPriceSpin;
  324. LLSpinCtrl* mHourSpin;
  325. LLNameListCtrl* mListAccess;
  326. LLNameListCtrl* mListBanned;
  327. LLButton* mAddAllowedButton;
  328. LLButton* mRemoveAllowedButton;
  329. LLButton* mAddBannedButton;
  330. LLButton* mRemoveBannedButton;
  331. LLSafeHandle<LLParcelSelection>& mParcel;
  332. };
  333. class LLPanelLandCovenant final : public LLPanel
  334. {
  335. public:
  336. LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp);
  337. ~LLPanelLandCovenant() override;
  338. bool postBuild() override;
  339. void refresh() override;
  340. static void updateCovenantText(const std::string& string);
  341. static void updateLastModified(const std::string& text);
  342. static void updateEstateName(const std::string& name);
  343. static void updateEstateOwnerName(const std::string& name);
  344. private:
  345. LLTextBox* mRegionNameText;
  346. LLTextBox* mRegionTypeText;
  347. LLTextBox* mRegionMaturityText;
  348. LLTextBox* mRegionResellClauseText;
  349. LLTextBox* mRegionChangeClauseText;
  350. LLTextBox* mEstateNameText;
  351. LLTextBox* mEstateOwnerText;
  352. LLTextBox* mCovenantDateText;
  353. LLViewerTextEditor* mCovenantEditor;
  354. LLSafeHandle<LLParcelSelection>& mParcel;
  355. };
  356. class LLPanelLandExperiences final : public LLPanel
  357. {
  358. protected:
  359. LOG_CLASS(LLPanelLandExperiences);
  360. public:
  361. LLPanelLandExperiences(LLSafeHandle<LLParcelSelection>& parcelp);
  362. ~LLPanelLandExperiences() override;
  363. bool postBuild() override;
  364. void refresh() override;
  365. void experienceAdded(const LLUUID& id, U32 xp_type, U32 access_type);
  366. void experienceRemoved(const LLUUID& id, U32 access_type);
  367. protected:
  368. static void* createAllowedExperiencesPanel(void* data);
  369. static void* createBlockedExperiencesPanel(void* data);
  370. void setupList(LLPanelExperienceListEditor* panel,
  371. const std::string& control_name,
  372. U32 xp_type, U32 access_type);
  373. void refreshPanel(LLPanelExperienceListEditor* panel, U32 xp_type);
  374. protected:
  375. LLPanelExperienceListEditor* mAllowed;
  376. LLPanelExperienceListEditor* mBlocked;
  377. LLSafeHandle<LLParcelSelection>& mParcel;
  378. };
  379. void send_parcel_select_objects(S32 parcel_local_id, U32 return_type,
  380. owners_list_t* return_ids = NULL);
  381. #endif