llfloaterbuyland.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /**
  2. * @file llfloaterbuyland.h
  3. * @brief LLFloaterBuyLand class definition
  4. *
  5. * $LicenseInfo:firstyear=2005&license=viewergpl$
  6. *
  7. * Copyright (c) 2005-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLFLOATERBUYLAND_H
  33. #define LL_LLFLOATERBUYLAND_H
  34. #include "llfloater.h"
  35. #include "llsafehandle.h"
  36. #include "llcurrencyuimanager.h"
  37. #include "llviewerparcelmgr.h"
  38. class LLViewerRegion;
  39. class LLXMLRPCTransaction;
  40. class LLFloaterBuyLand final : public LLFloater,
  41. public LLFloaterSingleton<LLFloaterBuyLand>
  42. {
  43. friend class LLUISingleton<LLFloaterBuyLand, VisibilityPolicy<LLFloater> >;
  44. protected:
  45. LOG_CLASS(LLFloaterBuyLand);
  46. public:
  47. ~LLFloaterBuyLand() override;
  48. bool postBuild() override;
  49. void draw() override;
  50. void setMinimized(bool b) override;
  51. bool canClose() override;
  52. // Public interface methods:
  53. static void buyLand(LLViewerRegion* region,
  54. LLSafeHandle<LLParcelSelection> parcel,
  55. bool is_for_group);
  56. static void updateCovenantText(const std::string& string,
  57. const LLUUID& asset_id);
  58. static void updateEstateName(const std::string& name);
  59. static void updateLastModified(const std::string& text);
  60. static void updateEstateOwnerName(const std::string& name);
  61. private:
  62. // Open only via the buyLand() method defined above
  63. LLFloaterBuyLand(const LLSD&);
  64. void setForGroup(bool is_for_group);
  65. void setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel);
  66. void updateAgentInfo();
  67. void updateParcelInfo();
  68. void updateCovenantInfo();
  69. void setCovenantText(const std::string& string, const LLUUID& asset_id);
  70. void setEstateName(const std::string& name);
  71. void setLastModified(const std::string& text);
  72. void setEstateOwnerName(const std::string& name);
  73. void updateWebSiteInfo();
  74. void finishWebSiteInfo();
  75. void runWebSitePrep(const std::string& password);
  76. void finishWebSitePrep();
  77. void sendBuyLand();
  78. void updateNames();
  79. void refreshUI();
  80. enum TransactionType
  81. {
  82. TransactionPreflight,
  83. TransactionCurrency,
  84. TransactionBuy
  85. };
  86. void startTransaction(TransactionType type, const LLSD& params);
  87. bool checkTransaction();
  88. void tellUserError(const std::string& message, const std::string& uri);
  89. void startBuyPreConfirm();
  90. void startBuyPostConfirm(const std::string& password);
  91. static void onChangeAgreeCovenant(LLUICtrl*, void* data);
  92. static void onClickBuy(void* data);
  93. static void onClickCancel(void* data);
  94. static void onClickErrorWeb(void* data);
  95. class SelectionObserver final : public LLParcelSelectionObserver
  96. {
  97. public:
  98. void changed() override;
  99. };
  100. static void callbackCacheName(const LLUUID&, const std::string&, bool);
  101. private:
  102. LLXMLRPCTransaction* mTransaction;
  103. TransactionType mTransactionType;
  104. LLViewerParcelMgr::ParcelBuyInfo* mParcelBuyInfo;
  105. LLViewerRegion* mRegion;
  106. LLParcelSelectionHandle mParcelSelection;
  107. LLCurrencyUIManager mCurrency;
  108. // Values in current Preflight transaction... used to avoid extra
  109. // preflights when the parcel manager goes update crazy
  110. S32 mPreflightAskBillableArea;
  111. S32 mPreflightAskCurrencyBuy;
  112. // Information about the parcel
  113. LLUUID mParcelSnapshot;
  114. S32 mParcelGroupContribution;
  115. S32 mParcelPrice;
  116. S32 mParcelActualArea;
  117. S32 mParcelBillableArea;
  118. S32 mParcelSupportedObjects;
  119. // User's choices
  120. S32 mUserPlanChoice;
  121. // Information about the agent
  122. S32 mAgentCommittedTier;
  123. S32 mAgentCashBalance;
  124. bool mIsClaim;
  125. bool mIsForGroup;
  126. bool mBought;
  127. bool mCanBuy;
  128. bool mCannotBuyIsError;
  129. // Information about the agent
  130. bool mAgentHasNeverOwnedLand;
  131. // Information about the parcel
  132. bool mParcelValid;
  133. bool mParcelIsForSale;
  134. bool mParcelIsGroupLand;
  135. bool mParcelSoldWithObjects;
  136. // From website
  137. bool mSiteValid;
  138. bool mSiteMembershipUpgrade;
  139. bool mSiteLandUseUpgrade;
  140. std::string mCannotBuyReason;
  141. std::string mCannotBuyURI;
  142. // Information about the parcel
  143. std::string mParcelLocation;
  144. std::string mParcelSellerName;
  145. // From website
  146. std::string mSiteMembershipAction;
  147. std::string mSiteLandUseAction;
  148. std::string mSiteConfirm;
  149. std::vector<std::string> mSiteMembershipPlanIDs;
  150. std::vector<std::string> mSiteMembershipPlanNames;
  151. static LLParcelSelectionObserver* sParcelObserver;
  152. };
  153. #endif