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 : std::uint8_t { 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  std::chrono::milliseconds m_hideDelay {0ms};
53  int m_timerId {0};
54 };
55 
56 #endif
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythUIScrollBar::LayoutVertical
@ LayoutVertical
Definition: mythuiscrollbar.h:26
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
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:1228
kDefaultPageStep
const int kDefaultPageStep
Definition: mythuiscrollbar.h:7
MythUIScrollBar::MythUIScrollBar
MythUIScrollBar(MythUIType *parent, const QString &name)
Definition: mythuiscrollbar.h:20
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1171
MythUIScrollBar
Scroll bar widget.
Definition: mythuiscrollbar.h:15
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:73
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
MythUIScrollBar::LayoutType
LayoutType
Definition: mythuiscrollbar.h:26
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:1237
build_compdb.filename
filename
Definition: build_compdb.py:21
kDefaultMaxValue
const int kDefaultMaxValue
Definition: mythuiscrollbar.h:6
MythUIType::Finalize
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
Definition: mythuitype.cpp:1312
mythuitype.h