lltoolbar.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * @file lltoolbar.h
  3. * @brief Large friendly buttons at bottom of screen.
  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_LLTOOLBAR_H
  33. #define LL_LLTOOLBAR_H
  34. #include "llpanel.h"
  35. #include "llframetimer.h"
  36. constexpr S32 TOOL_BAR_HEIGHT = 20;
  37. class LLButton;
  38. #if LL_DARWIN
  39. class LLFakeResizeHandle;
  40. #endif // LL_DARWIN
  41. class LLToolBar final : public LLPanel
  42. {
  43. public:
  44. LLToolBar(const LLRect& rect);
  45. ~LLToolBar() override;
  46. bool postBuild() override;
  47. bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
  48. EDragAndDropType cargo_type, void* cargo_data,
  49. EAcceptance* accept, std::string& tooltip) override;
  50. void reshape(S32 width, S32 height, bool call_from_parent = true) override;
  51. static void toggle();
  52. static bool isVisible();
  53. // Move buttons to appropriate locations based on rect.
  54. void layoutButtons();
  55. // Per-frame refresh call
  56. void refresh() override;
  57. // Callbacks
  58. static void onClickChat(void* data);
  59. static void onClickIM(void*);
  60. static void onClickFriends(void* data);
  61. static void onClickGroups(void* data);
  62. static void onClickFly(void*);
  63. static void onClickSnapshot(void* data);
  64. static void onClickSearch(void* data);
  65. static void onClickBuild(void* data);
  66. static void onClickRadar(void* data);
  67. static void onClickMiniMap(void* data);
  68. static void onClickMap(void* data);
  69. static void onClickInventory(void* data);
  70. static F32 sInventoryAutoOpenTime;
  71. private:
  72. LLButton* mChatButton;
  73. LLButton* mIMButton;
  74. LLButton* mFriendsButton;
  75. LLButton* mGroupsButton;
  76. LLButton* mFlyButton;
  77. LLButton* mSnapshotButton;
  78. LLButton* mSearchButton;
  79. LLButton* mBuildButton;
  80. LLButton* mRadarButton;
  81. LLButton* mMiniMapButton;
  82. LLButton* mMapButton;
  83. LLButton* mInventoryButton;
  84. LLFrameTimer mInventoryAutoOpenTimer;
  85. #if LL_DARWIN
  86. LLFakeResizeHandle* mResizeHandle;
  87. #endif // LL_DARWIN
  88. bool mInventoryAutoOpen;
  89. };
  90. extern LLToolBar* gToolBarp;
  91. #endif