llfloaterinspect.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /**
  2. * @file llfloaterinspect.h
  3. * @brief Declaration of floaters for object and avatar inspection tool
  4. *
  5. * $LicenseInfo:firstyear=2006&license=viewergpl$
  6. *
  7. * Copyright (c) 2006-2009, Linden Research, Inc, 2009-2023 Henri Beauchamp.
  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_LLFLOATERINSPECT_H
  33. #define LL_LLFLOATERINSPECT_H
  34. #include "llfloater.h"
  35. #include "llsafehandle.h"
  36. #include "llvoinventorylistener.h"
  37. class LLButton;
  38. class LLIconCtrl;
  39. class LLObjectSelection;
  40. class LLScrollListCtrl;
  41. class LLFloaterInspect final : public LLFloater,
  42. public LLFloaterSingleton<LLFloaterInspect>,
  43. public LLVOInventoryListener
  44. {
  45. friend class LLUISingleton<LLFloaterInspect, VisibilityPolicy<LLFloater> >;
  46. public:
  47. ~LLFloaterInspect() override;
  48. bool postBuild() override;
  49. void draw() override;
  50. void refresh() override;
  51. void onFocusReceived() override;
  52. // LLVOInventoryListener interface
  53. void inventoryChanged(LLViewerObject* obj,
  54. LLInventoryObject::object_list_t* inv,
  55. S32, void*) override;
  56. // Can be passed a LLViewerObject* as "data"
  57. static void show(void* data = NULL);
  58. static void dirty();
  59. static LLUUID getSelectedUUID();
  60. private:
  61. // Show only via show()
  62. LLFloaterInspect(const LLSD&);
  63. void requestInventory(LLViewerObject* vobj);
  64. static void onClickCreatorProfile(void* data);
  65. static void onClickOwnerProfile(void* data);
  66. static void onClickWeights(void* data);
  67. static void onClickRefresh(void* data);
  68. static void onClickClose(void* data);
  69. static void onSelectObject(LLUICtrl*, void* data);
  70. private:
  71. LLScrollListCtrl* mObjectList;
  72. LLButton* mButtonOwner;
  73. LLButton* mButtonCreator;
  74. LLButton* mButtonWeights;
  75. LLIconCtrl* mIconNavMeshInfo;
  76. LLSafeHandle<LLObjectSelection> mObjectSelection;
  77. // Map holding LLUUID, <scripts, total>
  78. typedef fast_hmap<LLUUID, std::pair<S32, S32> > invcounts_map_t;
  79. invcounts_map_t mInventoryNums;
  80. std::string mNavMeshToolTip;
  81. bool mDirty;
  82. };
  83. class HBFloaterInspectAvatar final
  84. : public LLFloater,
  85. public LLFloaterSingleton<HBFloaterInspectAvatar>,
  86. public LLVOInventoryListener
  87. {
  88. friend class LLUISingleton<HBFloaterInspectAvatar,
  89. VisibilityPolicy<LLFloater> >;
  90. public:
  91. ~HBFloaterInspectAvatar() override = default;
  92. bool postBuild() override;
  93. void draw() override;
  94. void refresh() override;
  95. // LLVOInventoryListener interface
  96. void inventoryChanged(LLViewerObject* obj,
  97. LLInventoryObject::object_list_t* inv,
  98. S32, void*) override;
  99. static void show(const LLUUID& av_id);
  100. private:
  101. // Show only via show()
  102. HBFloaterInspectAvatar(const LLSD&);
  103. void requestInventory(LLViewerObject* vobj);
  104. static void onClickProfile(void* data);
  105. static void onClickRefresh(void* data);
  106. static void onClickClose(void* data);
  107. static void onDoubleClickObject(void* data);
  108. private:
  109. LLUUID mAvatarID;
  110. LLScrollListCtrl* mObjectList;
  111. std::string mTitle;
  112. // Map holding attachments UUIDs and script counts
  113. typedef fast_hmap<LLUUID, S32> scriptcounts_map_t;
  114. scriptcounts_map_t mScriptCounts;
  115. bool mDirty;
  116. };
  117. #endif //LL_LLFLOATERINSPECT_H