Merge pull request #4687 from ruuk/textboxgettext
[vuplus_xbmc] / xbmc / guilib / GUIScrollBarControl.h
1 /*!
2 \file GUIScrollBar.h
3 \brief
4 */
5
6 #ifndef GUILIB_GUISCROLLBAR_H
7 #define GUILIB_GUISCROLLBAR_H
8
9 #pragma once
10
11 /*
12  *      Copyright (C) 2005-2013 Team XBMC
13  *      http://xbmc.org
14  *
15  *  This Program is free software; you can redistribute it and/or modify
16  *  it under the terms of the GNU General Public License as published by
17  *  the Free Software Foundation; either version 2, or (at your option)
18  *  any later version.
19  *
20  *  This Program is distributed in the hope that it will be useful,
21  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  *  GNU General Public License for more details.
24  *
25  *  You should have received a copy of the GNU General Public License
26  *  along with XBMC; see the file COPYING.  If not, see
27  *  <http://www.gnu.org/licenses/>.
28  *
29  */
30
31 #include "GUITexture.h"
32 #include "GUIControl.h"
33
34 /*!
35  \ingroup controls
36  \brief
37  */
38 class CGUIScrollBar :
39       public CGUIControl
40 {
41 public:
42   CGUIScrollBar(int parentID, int controlID, float posX, float posY,
43                        float width, float height,
44                        const CTextureInfo& backGroundTexture,
45                        const CTextureInfo& barTexture, const CTextureInfo& barTextureFocus,
46                        const CTextureInfo& nibTexture, const CTextureInfo& nibTextureFocus,
47                        ORIENTATION orientation, bool showOnePage);
48   virtual ~CGUIScrollBar(void);
49   virtual CGUIScrollBar *Clone() const { return new CGUIScrollBar(*this); };
50
51   virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
52   virtual void Render();
53   virtual bool OnAction(const CAction &action);
54   virtual void AllocResources();
55   virtual void FreeResources(bool immediately = false);
56   virtual void DynamicResourceAlloc(bool bOnOff);
57   virtual void SetInvalid();
58   virtual void SetRange(int pageSize, int numItems);
59   virtual bool OnMessage(CGUIMessage& message);
60   void SetValue(int value);
61   int GetValue() const;
62   virtual CStdString GetDescription() const;
63   virtual bool IsVisible() const;
64 protected:
65   virtual bool HitTest(const CPoint &point) const;
66   virtual EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event);
67   virtual bool UpdateColors();
68   bool UpdateBarSize();
69   bool Move(int iNumSteps);
70   virtual void SetFromPosition(const CPoint &point);
71
72   CGUITexture m_guiBackground;
73   CGUITexture m_guiBarNoFocus;
74   CGUITexture m_guiBarFocus;
75   CGUITexture m_guiNibNoFocus;
76   CGUITexture m_guiNibFocus;
77
78   int m_numItems;
79   int m_pageSize;
80   int m_offset;
81
82   bool m_showOnePage;
83   ORIENTATION m_orientation;
84 };
85 #endif