/indra/llui/llmultifloater.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 101 lines · 51 code · 22 blank · 28 comment · 1 complexity · dcd28734a254f834d23cd6b21af8ba5f MD5 · raw file

  1. /**
  2. * @file llmultifloater.h
  3. * @brief LLFloater that hosts other floaters
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. // Floating "windows" within the GL display, like the inventory floater,
  27. // mini-map floater, etc.
  28. #ifndef LL_MULTI_FLOATER_H
  29. #define LL_MULTI_FLOATER_H
  30. #include "llfloater.h"
  31. #include "lltabcontainer.h" // for LLTabContainer::eInsertionPoint
  32. // https://wiki.lindenlab.com/mediawiki/index.php?title=LLMultiFloater&oldid=81376
  33. class LLMultiFloater : public LLFloater
  34. {
  35. public:
  36. LLMultiFloater(const LLSD& key, const Params& params = getDefaultParams());
  37. virtual ~LLMultiFloater() {};
  38. void buildTabContainer();
  39. virtual BOOL postBuild();
  40. /*virtual*/ void onOpen(const LLSD& key);
  41. /*virtual*/ void draw();
  42. /*virtual*/ void setVisible(BOOL visible);
  43. /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
  44. /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
  45. virtual void setCanResize(BOOL can_resize);
  46. virtual void growToFit(S32 content_width, S32 content_height);
  47. virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
  48. virtual void showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
  49. virtual void removeFloater(LLFloater* floaterp);
  50. virtual void tabOpen(LLFloater* opened_floater, bool from_click);
  51. virtual void tabClose();
  52. virtual BOOL selectFloater(LLFloater* floaterp);
  53. virtual void selectNextFloater();
  54. virtual void selectPrevFloater();
  55. virtual LLFloater* getActiveFloater();
  56. virtual BOOL isFloaterFlashing(LLFloater* floaterp);
  57. virtual S32 getFloaterCount();
  58. virtual void setFloaterFlashing(LLFloater* floaterp, BOOL flashing);
  59. virtual BOOL closeAllFloaters(); //Returns FALSE if the floater could not be closed due to pending confirmation dialogs
  60. void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; }
  61. void onTabSelected();
  62. virtual void updateResizeLimits();
  63. virtual void updateFloaterTitle(LLFloater* floaterp);
  64. protected:
  65. struct LLFloaterData
  66. {
  67. S32 mWidth;
  68. S32 mHeight;
  69. BOOL mCanMinimize;
  70. BOOL mCanResize;
  71. };
  72. LLTabContainer* mTabContainer;
  73. typedef std::map<LLHandle<LLFloater>, LLFloaterData> floater_data_map_t;
  74. floater_data_map_t mFloaterDataMap;
  75. LLTabContainer::TabPosition mTabPos;
  76. BOOL mAutoResize;
  77. S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late
  78. };
  79. #endif // LL_MULTI_FLOATER_H