PageRenderTime 110ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/llscrollingpanellist.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 85 lines | 37 code | 15 blank | 33 comment | 0 complexity | 5e5427c21be36a8e4f8ce11093a5ddbc MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llscrollingpanellist.h
  3. *
  4. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #ifndef LL_LLSCROLLINGPANELLIST_H
  26. #define LL_LLSCROLLINGPANELLIST_H
  27. #include <vector>
  28. #include "llui.h"
  29. #include "lluictrlfactory.h"
  30. #include "llview.h"
  31. #include "llpanel.h"
  32. /*
  33. * Pure virtual class represents a scrolling panel.
  34. */
  35. class LLScrollingPanel : public LLPanel
  36. {
  37. public:
  38. LLScrollingPanel(const LLPanel::Params& params) : LLPanel(params) {}
  39. virtual void updatePanel(BOOL allow_modify) = 0;
  40. };
  41. /*
  42. * A set of panels that are displayed in a vertical sequence inside a scroll container.
  43. */
  44. class LLScrollingPanelList : public LLUICtrl
  45. {
  46. public:
  47. struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
  48. {};
  49. LLScrollingPanelList(const Params& p)
  50. : LLUICtrl(p)
  51. {}
  52. static const S32 GAP_BETWEEN_PANELS = 6;
  53. typedef std::deque<LLScrollingPanel*> panel_list_t;
  54. virtual void setValue(const LLSD& value) {};
  55. virtual void draw();
  56. void clearPanels();
  57. S32 addPanel( LLScrollingPanel* panel );
  58. void removePanel( LLScrollingPanel* panel );
  59. void removePanel( U32 panel_index );
  60. void updatePanels(BOOL allow_modify);
  61. const panel_list_t& getPanelList() { return mPanelList; }
  62. private:
  63. void updatePanelVisiblilty();
  64. /**
  65. * Notify parent about size change, makes sense when used inside accordion
  66. */
  67. void notifySizeChanged(S32 height);
  68. panel_list_t mPanelList;
  69. };
  70. #endif //LL_LLSCROLLINGPANELLIST_H