MythTV  master
mythuiscrollbar.h
Go to the documentation of this file.
1 #ifndef MYTHUI_SCROLLBAR_H_
2 #define MYTHUI_SCROLLBAR_H_
3 
4 #include "mythuitype.h"
5 
6 const int kDefaultMaxValue = 99;
7 const int kDefaultPageStep = 10;
8 
16 {
17  Q_OBJECT
18 
19  public:
20  MythUIScrollBar(MythUIType *parent, const QString &name)
21  : MythUIType(parent, name) {}
22  ~MythUIScrollBar() = default;
23 
24  void Reset(void) override; // MythUIType
25 
26  enum LayoutType { LayoutVertical, LayoutHorizontal };
27 
28  void SetPageStep(int);
29  void SetSliderPosition(int);
30  void SetMaximum(int);
31 
32  protected slots:
33  void DoneFading(void);
34 
35  protected:
36  bool ParseElement(const QString &filename, QDomElement &element,
37  bool showWarnings) override; // MythUIType
38  void CopyFrom(MythUIType *base) override; // MythUIType
39  void CreateCopy(MythUIType *parent) override; // MythUIType
40  void Finalize(void) override; // MythUIType
41 
42  void CalculatePosition(void);
43  void timerEvent(QTimerEvent *) override; // QObject
44 
45  LayoutType m_layout {LayoutVertical};
46 
48  int m_pageStep {kDefaultPageStep};
49  int m_sliderPosition {0};
50  int m_maximum {0};
51 
52  int m_hideDelay {0};
53  int m_timerId {0};
54 };
55 
56 #endif
unsigned int slots[4]
Definition: element.c:38
MythUIScrollBar(MythUIType *parent, const QString &name)
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
MythRect m_sliderArea
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
const char * name
Definition: ParseText.cpp:328
const int kDefaultMaxValue
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitype.cpp:69
Scroll bar widget.
#define MUI_PUBLIC
Definition: mythuiexp.h:9
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
const int kDefaultPageStep
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.