/indra/newview/llchicletbar.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 105 lines · 37 code · 18 blank · 50 comment · 0 complexity · 7bb2f116473352a3dbb7575709139528 MD5 · raw file

  1. /**
  2. * @file llchicletbar.h
  3. * @brief LLChicletBar class header file
  4. *
  5. * $LicenseInfo:firstyear=2011&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2011, 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_LLCHICLETBAR_H
  27. #define LL_LLCHICLETBAR_H
  28. #include "llpanel.h"
  29. #include "llimview.h"
  30. class LLChicletPanel;
  31. class LLIMChiclet;
  32. class LLLayoutPanel;
  33. class LLLayoutStack;
  34. class LLChicletBar
  35. : public LLSingleton<LLChicletBar>
  36. , public LLPanel
  37. , public LLIMSessionObserver
  38. {
  39. LOG_CLASS(LLChicletBar);
  40. friend class LLSingleton<LLChicletBar>;
  41. public:
  42. ~LLChicletBar();
  43. BOOL postBuild();
  44. LLChicletPanel* getChicletPanel() { return mChicletPanel; }
  45. // LLIMSessionObserver observe triggers
  46. virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
  47. virtual void sessionRemoved(const LLUUID& session_id);
  48. void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
  49. S32 getTotalUnreadIMCount();
  50. /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
  51. /**
  52. * Creates IM Chiclet based on session type (IM chat or Group chat)
  53. */
  54. LLIMChiclet* createIMChiclet(const LLUUID& session_id);
  55. /**
  56. * Shows/hides panel with specified well button (IM or Notification)
  57. *
  58. * @param well_name - name of the well panel to be processed.
  59. * @param visible - a flag specifying whether a button should be shown or hidden.
  60. */
  61. void showWellButton(const std::string& well_name, bool visible);
  62. private:
  63. /**
  64. * Updates child controls size and visibility when it is necessary to reduce total width.
  65. *
  66. * @param delta_width - value by which chiclet bar should be shrunk. It is a negative value.
  67. * @returns positive value which chiclet bar can not process when it reaches its minimal width.
  68. * Zero if there was enough space to process delta_width.
  69. */
  70. S32 processWidthDecreased(S32 delta_width);
  71. /** helper function to log debug messages */
  72. void log(LLView* panel, const std::string& descr);
  73. /**
  74. * @return difference between current chiclet panel width and the minimum.
  75. */
  76. S32 getChicletPanelShrinkHeadroom() const;
  77. /**
  78. * function adjusts Chiclet bar width to prevent overlapping with Mini-Location bar
  79. * EXP-1463
  80. */
  81. void fitWithTopInfoBar();
  82. protected:
  83. LLChicletBar(const LLSD& key = LLSD());
  84. LLChicletPanel* mChicletPanel;
  85. LLLayoutStack* mToolbarStack;
  86. };
  87. #endif // LL_LLCHICLETBAR_H