llfloatersellland.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * @file llfloatersellland.h
  3. *
  4. * $LicenseInfo:firstyear=2006&license=viewergpl$
  5. *
  6. * Copyright (c) 2006-2009, Linden Research, Inc.
  7. *
  8. * Second Life Viewer Source Code
  9. * The source code in this file ("Source Code") is provided by Linden Lab
  10. * to you under the terms of the GNU General Public License, version 2.0
  11. * ("GPL"), unless you have obtained a separate licensing agreement
  12. * ("Other License"), formally executed by you and Linden Lab. Terms of
  13. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  14. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  15. *
  16. * There are special exceptions to the terms and conditions of the GPL as
  17. * it is applied to this Source Code. View the full text of the exception
  18. * in the file doc/FLOSS-exception.txt in this software distribution, or
  19. * online at
  20. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  21. *
  22. * By copying, modifying or distributing this software, you acknowledge
  23. * that you have read and understood your obligations described above,
  24. * and agree to abide by those obligations.
  25. *
  26. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  27. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  28. * COMPLETENESS OR PERFORMANCE.
  29. * $/LicenseInfo$
  30. */
  31. #ifndef LL_LLFLOATERSELLLAND_H
  32. #define LL_LLFLOATERSELLLAND_H
  33. #include "llfloater.h"
  34. #include "llsafehandle.h"
  35. #include "llviewerparcelmgr.h"
  36. class LLViewerRegion;
  37. class LLFloaterSellLand final : public LLFloater,
  38. public LLFloaterSingleton<LLFloaterSellLand>
  39. {
  40. friend class LLUISingleton<LLFloaterSellLand,
  41. VisibilityPolicy<LLFloater> >;
  42. public:
  43. ~LLFloaterSellLand() override;
  44. bool postBuild() override;
  45. static void sellLand(LLViewerRegion* region,
  46. LLSafeHandle<LLParcelSelection> parcel);
  47. private:
  48. // Open only via the sellLand() method defined above
  49. LLFloaterSellLand(const LLSD&);
  50. enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR };
  51. void updateParcelInfo();
  52. void refreshUI();
  53. void setBadge(const char* id, Badge badge);
  54. bool setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel);
  55. static void onChangeValue(LLUICtrl*, void* userdata);
  56. static void doSelectAgent(void* userdata);
  57. static void doCancel(void* userdata);
  58. static void doSellLand(void* userdata);
  59. bool onConfirmSale(const LLSD& notification, const LLSD& response);
  60. static void doShowObjects(void* userdata);
  61. static bool callbackHighlightTransferable(const LLSD& notification,
  62. const LLSD& response);
  63. static void callbackAvatarPick(const std::vector<std::string>& names,
  64. const std::vector<LLUUID>& ids, void* data);
  65. class SelectionObserver final : public LLParcelSelectionObserver
  66. {
  67. public:
  68. void changed() override;
  69. };
  70. private:
  71. LLViewerRegion* mRegion;
  72. LLParcelSelectionHandle mParcelSelection;
  73. LLUUID mParcelSnapshot;
  74. LLUUID mAuthorizedBuyer;
  75. S32 mParcelPrice;
  76. S32 mParcelActualArea;
  77. bool mParcelIsForSale;
  78. bool mSellToBuyer;
  79. bool mChoseSellTo;
  80. bool mParcelSoldWithObjects;
  81. static LLParcelSelectionObserver* sParcelObserver;
  82. };
  83. #endif // LL_LLFLOATERSELLLAND_H