[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / guilib / GUISettingsSliderControl.h
1 /*!
2 \file GUISliderControl.h
3 \brief
4 */
5
6 #ifndef GUILIB_GUISettingsSliderCONTROL_H
7 #define GUILIB_GUISettingsSliderCONTROL_H
8
9 #pragma once
10
11 /*
12  *      Copyright (C) 2005-2013 Team XBMC
13  *      http://www.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 "GUISliderControl.h"
32 #include "GUIButtonControl.h"
33
34 #define SPIN_CONTROL_TYPE_INT    1
35 #define SPIN_CONTROL_TYPE_FLOAT  2
36 #define SPIN_CONTROL_TYPE_TEXT   3
37
38 /*!
39  \ingroup controls
40  \brief
41  */
42 class CGUISettingsSliderControl :
43       public CGUISliderControl
44 {
45 public:
46   CGUISettingsSliderControl(int parentID, int controlID, float posX, float posY, float width, float height, float sliderWidth, float sliderHeight, const CTextureInfo &textureFocus, const CTextureInfo &textureNoFocus, const CTextureInfo& backGroundTexture, const CTextureInfo& nibTexture, const CTextureInfo& nibTextureFocus, const CLabelInfo &labelInfo, int iType);
47   virtual ~CGUISettingsSliderControl(void);
48   virtual CGUISettingsSliderControl *Clone() const { return new CGUISettingsSliderControl(*this); };
49
50   virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
51   virtual void Render();
52   virtual bool OnAction(const CAction &action);
53   virtual void AllocResources();
54   virtual void FreeResources(bool immediately = false);
55   virtual void DynamicResourceAlloc(bool bOnOff);
56   virtual void SetInvalid();
57   virtual void SetPosition(float posX, float posY);
58   virtual float GetWidth() const { return m_buttonControl.GetWidth();};
59   virtual void SetWidth(float width);
60   virtual float GetHeight() const { return m_buttonControl.GetHeight();};
61   virtual void SetHeight(float height);
62   virtual void SetEnabled(bool bEnable);
63
64   void SetText(const std::string &label) {m_buttonControl.SetLabel(label);};
65   virtual float GetXPosition() const { return m_buttonControl.GetXPosition();};
66   virtual float GetYPosition() const { return m_buttonControl.GetYPosition();};
67   virtual CStdString GetDescription() const;
68   virtual bool HitTest(const CPoint &point) const { return m_buttonControl.HitTest(point); };
69
70 protected:
71   virtual bool UpdateColors();
72   virtual void ProcessText();
73
74 private:
75   CGUIButtonControl m_buttonControl;
76   CGUILabel m_label;
77 };
78 #endif