PageRenderTime 29ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/lltransientfloatermgr.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 91 lines | 43 code | 13 blank | 35 comment | 0 complexity | 37091159cb57cbc4f30a6f3c184d85d9 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltransientfloatermgr.h
  3. * @brief LLFocusMgr base class
  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. #ifndef LL_LLTRANSIENTFLOATERMGR_H
  27. #define LL_LLTRANSIENTFLOATERMGR_H
  28. #include "llui.h"
  29. #include "llsingleton.h"
  30. #include "llfloater.h"
  31. class LLTransientFloater;
  32. /**
  33. * Provides functionality to hide transient floaters.
  34. */
  35. class LLTransientFloaterMgr: public LLSingleton<LLTransientFloaterMgr>
  36. {
  37. protected:
  38. LLTransientFloaterMgr();
  39. friend class LLSingleton<LLTransientFloaterMgr>;
  40. public:
  41. enum ETransientGroup
  42. {
  43. GLOBAL, DOCKED, IM
  44. };
  45. void registerTransientFloater(LLTransientFloater* floater);
  46. void unregisterTransientFloater(LLTransientFloater* floater);
  47. void addControlView(ETransientGroup group, LLView* view);
  48. void removeControlView(ETransientGroup group, LLView* view);
  49. void addControlView(LLView* view);
  50. void removeControlView(LLView* view);
  51. private:
  52. typedef std::set<LLHandle<LLView> > controls_set_t;
  53. typedef std::map<ETransientGroup, controls_set_t > group_controls_t;
  54. void hideTransientFloaters(S32 x, S32 y);
  55. void leftMouseClickCallback(S32 x, S32 y, MASK mask);
  56. bool isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y);
  57. std::set<LLTransientFloater*> mTransSet;
  58. group_controls_t mGroupControls;
  59. };
  60. /**
  61. * An abstract class declares transient floater interfaces.
  62. */
  63. class LLTransientFloater
  64. {
  65. protected:
  66. /**
  67. * Class initialization method.
  68. * Should be called from descendant constructor.
  69. */
  70. void init(LLFloater* thiz);
  71. public:
  72. virtual LLTransientFloaterMgr::ETransientGroup getGroup() = 0;
  73. bool isTransientDocked() { return mFloater->isDocked(); };
  74. void setTransientVisible(BOOL visible) {mFloater->setVisible(visible); }
  75. private:
  76. LLFloater* mFloater;
  77. };
  78. #endif // LL_LLTRANSIENTFLOATERMGR_H