llfloaterbuy.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**
  2. * @file llfloaterbuy.h
  3. * @author James Cook
  4. * @brief LLFloaterBuy class definition
  5. *
  6. * $LicenseInfo:firstyear=2004&license=viewergpl$
  7. *
  8. * Copyright (c) 2004-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. /**
  34. * Floater that appears when buying an object, giving a preview of its contents
  35. * and their permissions.
  36. */
  37. #ifndef LL_LLFLOATERBUY_H
  38. #define LL_LLFLOATERBUY_H
  39. #include "llfloater.h"
  40. #include "llsafehandle.h"
  41. #include "llvoinventorylistener.h"
  42. class LLObjectSelection;
  43. class LLSaleInfo;
  44. class LLScrollListCtrl;
  45. class LLViewerObject;
  46. class LLFloaterBuy final : public LLFloater,
  47. public LLFloaterSingleton<LLFloaterBuy>,
  48. public LLVOInventoryListener
  49. {
  50. friend class LLUISingleton<LLFloaterBuy, VisibilityPolicy<LLFloater> >;
  51. protected:
  52. LOG_CLASS(LLFloaterBuy);
  53. public:
  54. ~LLFloaterBuy() override;
  55. bool postBuild() override;
  56. static void show(const LLSaleInfo& sale_info);
  57. protected:
  58. void inventoryChanged(LLViewerObject* obj,
  59. LLInventoryObject::object_list_t* inv,
  60. S32 serial_num, void* data) override;
  61. private:
  62. // Open only via show().
  63. LLFloaterBuy(const LLSD&);
  64. void reset();
  65. void requestObjectInventories();
  66. static void onClickBuy(void* data);
  67. static void onClickCancel(void* data);
  68. private:
  69. LLScrollListCtrl* mObjectsList;
  70. LLScrollListCtrl* mItemsList;
  71. LLSafeHandle<LLObjectSelection> mObjectSelection;
  72. LLSaleInfo mSaleInfo;
  73. };
  74. #endif