hbfloaterrlv.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /**
  2. * @file hbfloaterrlv.h
  3. * @brief The HBFloaterRLV and HBFloaterBlacklistRLV classes declarations
  4. *
  5. * $LicenseInfo:firstyear=2011&license=viewergpl$
  6. *
  7. * Copyright (c) 2011-2020, 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_HBFLOATERRLV_H
  33. #define LL_HBFLOATERRLV_H
  34. #include "llfloater.h"
  35. class LLButton;
  36. class LLScrollListCtrl;
  37. class LLTabContainer;
  38. class HBFloaterRLV final : public LLFloater,
  39. public LLFloaterSingleton<HBFloaterRLV>
  40. {
  41. friend class LLUISingleton<HBFloaterRLV, VisibilityPolicy<LLFloater> >;
  42. protected:
  43. LOG_CLASS(HBFloaterRLV);
  44. bool postBuild() override;
  45. void draw() override;
  46. void onOpen() override;
  47. public:
  48. static void setDirty();
  49. // Command status
  50. enum { QUEUED = -1, FAILED = 0, EXECUTED = 1, IMPLICIT = 2, BLACKLISTED = 3 };
  51. class LoggedCommand
  52. {
  53. public:
  54. LoggedCommand(const LLUUID& id, const std::string& name,
  55. const std::string& command, S32 status);
  56. public:
  57. LLUUID mId;
  58. std::string mName;
  59. std::string mCommand;
  60. std::string mTimeStamp;
  61. S32 mStatus;
  62. bool mIsLua;
  63. bool mIsGone;
  64. bool mIsRoot;
  65. };
  66. static void logCommand(const LLUUID& obj_id, const std::string& obj_name,
  67. const std::string& command, S32 status = EXECUTED);
  68. private:
  69. // Open only via LLFloaterSingleton interface, i.e. showInstance() or
  70. // toggleInstance().
  71. HBFloaterRLV(const LLSD&);
  72. void setButtonsStatus();
  73. static void onTabChanged(void* data, bool);
  74. static void onButtonHelp(void*);
  75. static void onButtonRefresh(void* data);
  76. static void onButtonClear(void* data);
  77. static void onButtonClose(void* data);
  78. static void onDoubleClick(void* data);
  79. public:
  80. static std::string sQueued;
  81. static std::string sFailed;
  82. static std::string sExecuted;
  83. static std::string sBlacklisted;
  84. static std::string sImplicit;
  85. static std::string sUnrestrictedEmotes;
  86. private:
  87. LLButton* mRefreshButton;
  88. LLButton* mClearButton;
  89. LLTabContainer* mTabContainer;
  90. LLScrollListCtrl* mStatusByObject;
  91. LLScrollListCtrl* mRestrictions;
  92. LLScrollListCtrl* mExceptions;
  93. LLScrollListCtrl* mCommandsLog;
  94. U32 mLastCommandsLogSize;
  95. bool mFirstOpen;
  96. bool mIsDirty;
  97. static std::vector<LoggedCommand> sLoggedCommands;
  98. };
  99. class HBFloaterBlacklistRLV final
  100. : public LLFloater, public LLFloaterSingleton<HBFloaterBlacklistRLV>
  101. {
  102. friend class LLUISingleton<HBFloaterBlacklistRLV,
  103. VisibilityPolicy<LLFloater> >;
  104. protected:
  105. LOG_CLASS(HBFloaterBlacklistRLV);
  106. private:
  107. // Open only via LLFloaterSingleton interface, i.e. showInstance() or
  108. // toggleInstance().
  109. HBFloaterBlacklistRLV(const LLSD&);
  110. bool postBuild() override;
  111. static void onButtonApply(void* data);
  112. static void onButtonCancel(void* data);
  113. };
  114. #endif