llscrollingpanellist.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * @file llscrollingpanellist.h
  3. *
  4. * $LicenseInfo:firstyear=2006&license=viewergpl$
  5. *
  6. * Copyright (c) 2006-2009, Linden Research, Inc.
  7. *
  8. * Second Life Viewer Source Code
  9. * The source code in this file ("Source Code") is provided by Linden Lab
  10. * to you under the terms of the GNU General Public License, version 2.0
  11. * ("GPL"), unless you have obtained a separate licensing agreement
  12. * ("Other License"), formally executed by you and Linden Lab. Terms of
  13. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  14. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  15. *
  16. * There are special exceptions to the terms and conditions of the GPL as
  17. * it is applied to this Source Code. View the full text of the exception
  18. * in the file doc/FLOSS-exception.txt in this software distribution, or
  19. * online at
  20. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  21. *
  22. * By copying, modifying or distributing this software, you acknowledge
  23. * that you have read and understood your obligations described above,
  24. * and agree to abide by those obligations.
  25. *
  26. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  27. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  28. * COMPLETENESS OR PERFORMANCE.
  29. * $/LicenseInfo$
  30. */
  31. #ifndef LL_LLSCROLLINGPANELLIST_H
  32. #define LL_LLSCROLLINGPANELLIST_H
  33. #include <deque>
  34. #include "llpanel.h"
  35. class LLUICtrlFactory;
  36. // Pure virtual class represents a scrolling panel.
  37. class LLScrollingPanel : public LLPanel
  38. {
  39. public:
  40. LLScrollingPanel(const std::string& name, const LLRect& rect)
  41. : LLPanel(name, rect)
  42. {
  43. }
  44. virtual void updatePanel(bool allow_modify) = 0;
  45. };
  46. // A set of panels that are displayed in a vertical sequence inside a scroll
  47. // container.
  48. class LLScrollingPanelList : public LLUICtrl
  49. {
  50. public:
  51. LLScrollingPanelList(const std::string& name, const LLRect& rect)
  52. : LLUICtrl(name, rect, true, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_BOTTOM)
  53. {
  54. }
  55. LL_INLINE void setValue(const LLSD&) override {}
  56. void draw() override;
  57. void clearPanels();
  58. void addPanel(LLScrollingPanel* panel);
  59. void updatePanels(bool allow_modify);
  60. const std::string& getTag() const override;
  61. LLXMLNodePtr getXML(bool save_children = true) const override;
  62. static LLView* fromXML(LLXMLNodePtr node, LLView* parent,
  63. LLUICtrlFactory* factory);
  64. private:
  65. void updatePanelVisiblilty();
  66. private:
  67. std::deque<LLScrollingPanel*> mPanelList;
  68. };
  69. #endif //LL_LLSCROLLINGPANELLIST_H