llfloatertopobjects.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. * @file llfloatertopobjects.h
  3. * @brief Shows top colliders or top scripts
  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_LLFLOATERTOPOBJECTS_H
  33. #define LL_LLFLOATERTOPOBJECTS_H
  34. #include "llfloater.h"
  35. class LLMessageSystem;
  36. class LLScrollListCtrl;
  37. // Bits for simulator performance query flags
  38. enum LAND_STAT_FLAGS
  39. {
  40. STAT_FILTER_BY_PARCEL = 0x00000001,
  41. STAT_FILTER_BY_OWNER = 0x00000002,
  42. STAT_FILTER_BY_OBJECT = 0x00000004,
  43. STAT_REQUEST_LAST_ENTRY = 0x80000000,
  44. };
  45. enum LAND_STAT_REPORT_TYPE
  46. {
  47. STAT_REPORT_TOP_SCRIPTS = 0,
  48. STAT_REPORT_TOP_COLLIDERS
  49. };
  50. class LLFloaterTopObjects final
  51. : public LLFloater,
  52. public LLFloaterSingleton<LLFloaterTopObjects>
  53. {
  54. friend class LLUISingleton<LLFloaterTopObjects,
  55. VisibilityPolicy<LLFloater> >;
  56. public:
  57. bool postBuild() override;
  58. // Opens the floater if it's not on-screen.
  59. // Juggles the UI based on method = "scripts" or "colliders"
  60. static void handleLandReply(LLMessageSystem* msg, void** data);
  61. static void clearList();
  62. static void sendRefreshRequest();
  63. static void setMode(U32 mode);
  64. private:
  65. enum
  66. {
  67. ACTION_RETURN = 0,
  68. ACTION_DISABLE
  69. };
  70. // Open only via LLFloaterSingleton interface, i.e. showInstance() or
  71. // toggleInstance().
  72. LLFloaterTopObjects(const LLSD&);
  73. void updateSelectionInfo();
  74. void handleReply(LLMessageSystem* msg, void** data);
  75. void doToObjects(S32 action, bool all);
  76. static void onCommitObjectsList(LLUICtrl* ctrl, void* data);
  77. static void onGetByOwnerName(LLUICtrl*, void* data);
  78. static void onGetByObjectName(LLUICtrl*, void* data);
  79. static void onRefresh(void* data);
  80. static void onClickShowBeacon(void* data);
  81. static void onReturnSelected(void* data);
  82. static void onDisableSelected(void* data);
  83. static void onReturnAll(void*);
  84. static void onDisableAll(void*);
  85. static void onGetByOwnerNameClicked(void* data);
  86. static void onGetByObjectNameClicked(void* data);
  87. static bool callbackReturnAll(const LLSD& notification,
  88. const LLSD& response);
  89. static bool callbackDisableAll(const LLSD& notification,
  90. const LLSD& response);
  91. void showBeacon();
  92. private:
  93. LLScrollListCtrl* mObjectsList;
  94. U32 mCurrentMode;
  95. U32 mFlags;
  96. F32 mTotalScore;
  97. bool mInitialized;
  98. std::string mMethod;
  99. std::string mFilter;
  100. LLSD mObjectListData;
  101. uuid_vec_t mObjectListIDs;
  102. };
  103. #endif