hbfloaterbump.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /**
  2. * @file hbfloaterbump.h
  3. * @brief Floater listing bumps, pushes and hits, and allowing to take actions.
  4. * @author Henri Beauchamp
  5. *
  6. * $LicenseInfo:firstyear=2020&license=viewergpl$
  7. *
  8. * Copyright (c) 2020, Henri Beauchamp
  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. #ifndef LL_HBFLOATERBUMP_H
  34. #define LL_HBFLOATERBUMP_H
  35. #include <list>
  36. #include "llfloater.h"
  37. class LLButton;
  38. class LLMeanCollisionData;
  39. class LLScrollListCtrl;
  40. typedef enum e_mean_collision_types
  41. {
  42. MEAN_INVALID,
  43. MEAN_BUMP,
  44. MEAN_LLPUSHOBJECT,
  45. MEAN_SELECTED_OBJECT_COLLIDE,
  46. MEAN_SCRIPTED_OBJECT_COLLIDE,
  47. MEAN_PHYSICAL_OBJECT_COLLIDE,
  48. MEAN_EOF
  49. } EMeanCollisionType;
  50. class HBFloaterBump final : public LLFloater,
  51. public LLFloaterSingleton<HBFloaterBump>
  52. {
  53. friend class LLUISingleton<HBFloaterBump, VisibilityPolicy<LLFloater> >;
  54. protected:
  55. LOG_CLASS(HBFloaterBump);
  56. public:
  57. void refresh() override;
  58. static void cleanup();
  59. static void addMeanCollision(const LLUUID& id, U32 time,
  60. EMeanCollisionType type, F32 mag);
  61. static std::string getMeanCollisionsStats(const LLUUID& perpetrator_id);
  62. private:
  63. // Open only via LLFloaterSingleton interface, i.e. showInstance() or
  64. // toggleInstance().
  65. HBFloaterBump(const LLSD&);
  66. bool postBuild() override;
  67. void draw() override;
  68. static void onButtonClear(void*);
  69. static void onButtonClose(void* data);
  70. static void onButtonFocus(void* data);
  71. static void onButtonProfile(void* data);
  72. static void onButtonReport(void* data);
  73. static void meanNameCallback(const LLUUID& id, const std::string& fullname,
  74. bool);
  75. private:
  76. LLScrollListCtrl* mBumpsList;
  77. LLButton* mClearButton;
  78. LLButton* mFocusButton;
  79. LLButton* mProfileButton;
  80. LLButton* mReportButton;
  81. typedef std::list<LLMeanCollisionData> collisions_list_t;
  82. static collisions_list_t sMeanCollisionsList;
  83. static bool sListUpdated;
  84. };
  85. #endif // LL_HBFLOATERBUMP_H