llfloaterproperties.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * @file llfloaterproperties.h
  3. * @brief A floater which shows an inventory item's properties.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-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_LLFLOATERPROPERTIES_H
  33. #define LL_LLFLOATERPROPERTIES_H
  34. #include "llfloater.h"
  35. #include "llinventorymodel.h"
  36. class LLFloaterProperties final : public LLFloater, public LLInventoryObserver
  37. {
  38. protected:
  39. LOG_CLASS(LLFloaterProperties);
  40. public:
  41. // LLFloater override (public since used by
  42. // LLPanelInventory::inventoryChanged()).
  43. void refresh() override;
  44. // Note: when 'ownerp' is passed (and not NULL), and the properties floater
  45. // does not yet exist for this item, the credated floater is made dependent
  46. // to the parent floater of this owning view. HB
  47. static void show(const LLUUID& item_id,
  48. const LLUUID& object_id = LLUUID::null,
  49. LLView* ownerp = NULL);
  50. static void closeByID(const LLUUID& item_id, const LLUUID& object_id);
  51. static LLFloaterProperties* find(const LLUUID& item_id,
  52. const LLUUID& object_id);
  53. static void dirtyAll();
  54. protected:
  55. // Use show() and closeByID()
  56. LLFloaterProperties(const LLUUID& item_id, const LLUUID& object_id,
  57. LLView* ownerp);
  58. ~LLFloaterProperties() override;
  59. // LLFloater overrides
  60. bool postBuild() override;
  61. void draw() override;
  62. // LLInventoryObserver override
  63. void changed(U32 mask) override;
  64. LLInventoryItem* findItem() const;
  65. void refreshFromItem(LLInventoryItem* itemp);
  66. void updateSaleInfo();
  67. // UI callbacks
  68. static void onClickCreator(void* datap);
  69. static void onClickOwner(void* datap);
  70. static void onClickLastOwner(void* datap);
  71. static void onClickThumbnail(void* datap);
  72. static void onCommitName(LLUICtrl*, void* datap);
  73. static void onCommitDescription(LLUICtrl*, void* datap);
  74. static void onCommitPermissions(LLUICtrl*, void* datap);
  75. static void onCommitSale(LLUICtrl*, void* datap);
  76. protected:
  77. // The item Id of the inventory item in question.
  78. LLUUID mItemID;
  79. // mObjectID will have a value if it is associated with a rezzed in-world
  80. // object, and will be LLUUID::null if it is in the agent inventory.
  81. LLUUID mObjectID;
  82. bool mDirty;
  83. typedef fast_hmap<LLUUID, LLFloaterProperties*> instance_map_t;
  84. static instance_map_t sInstances;
  85. };
  86. class LLMultiProperties : public LLMultiFloater
  87. {
  88. public:
  89. LLMultiProperties(const LLRect& rect);
  90. };
  91. #endif // LL_LLFLOATERPROPERTIES_H