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() override = default;
23 
24  void Reset(void) override; // MythUIType
25 
26  enum LayoutType { LayoutVertical, LayoutHorizontal };
27 
28  void SetPageStep(int value);
29  void SetSliderPosition(int value);
30  void SetMaximum(int value);
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 *event) 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
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
slots
unsigned int slots[4]
Definition: element.cpp:38
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:18
MythUIType::CreateCopy
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
Definition: mythuitype.cpp:1209
kDefaultPageStep
const int kDefaultPageStep
Definition: mythuiscrollbar.h:7
MythUIScrollBar::LayoutVertical
@ LayoutVertical
Definition: mythuiscrollbar.h:26
MythUIScrollBar::LayoutType
LayoutType
Definition: mythuiscrollbar.h:26
MythUIScrollBar::MythUIScrollBar
MythUIScrollBar(MythUIType *parent, const QString &name)
Definition: mythuiscrollbar.h:20
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1152
MythUIScrollBar
Scroll bar widget.
Definition: mythuiscrollbar.h:16
MythUIType::Reset
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitype.cpp:69
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:64
MythUIScrollBar::m_sliderArea
MythRect m_sliderArea
Definition: mythuiscrollbar.h:47
MythUIType::ParseElement
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitype.cpp:1218
kDefaultMaxValue
const int kDefaultMaxValue
Definition: mythuiscrollbar.h:6
MythUIType::Finalize
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
Definition: mythuitype.cpp:1294
MythUIScrollBar::~MythUIScrollBar
~MythUIScrollBar() override=default
mythuitype.h