MythTV  master
mythuicheckbox.h
Go to the documentation of this file.
1 #ifndef MYTHUI_CHECKBOX_H_
2 #define MYTHUI_CHECKBOX_H_
3 
4 // MythUI headers
5 #include "mythuitype.h"
6 #include "mythuistatetype.h"
7 
16 {
17  Q_OBJECT
18 
19  public:
20  MythUICheckBox(MythUIType *parent, const QString &name);
21  ~MythUICheckBox() = default;
22 
23  enum StateType { None = 0, Normal, Disabled, Active, Selected,
24  SelectedInactive };
25 
26  bool gestureEvent(MythGestureEvent *event) override; // MythUIType
27  bool keyPressEvent(QKeyEvent *) override; // MythUIType
28 
29  void toggleCheckState(void);
30 
31  void SetCheckState(MythUIStateType::StateType state);
32  void SetCheckState(bool onoff);
33 
34  MythUIStateType::StateType GetCheckState() const;
35  bool GetBooleanCheckState(void) const;
36 
37  protected slots:
38  void Select();
39  void Deselect();
40  void Enable();
41  void Disable();
42 
43  signals:
44  void valueChanged();
45  void toggled(bool);
46 
47  protected:
48  void CopyFrom(MythUIType *base) override; // MythUIType
49  void CreateCopy(MythUIType *parent) override; // MythUIType
50  void Finalize(void) override; // MythUIType
51 
52  void SetInitialStates(void);
53 
54  MythUIStateType *m_BackgroundState {nullptr};
55  MythUIStateType *m_CheckState {nullptr};
56 
58  QString m_state {"active"};
59 };
60 
61 #endif
This widget is used for grouping other widgets for display when a particular named state is called.
unsigned int slots[4]
Definition: element.c:38
virtual bool keyPressEvent(QKeyEvent *event)
Key event handler.
Definition: mythuitype.cpp:971
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
virtual bool gestureEvent(MythGestureEvent *event)
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
Definition: mythuitype.cpp:986
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.
A custom event that represents a mouse gesture.
Definition: mythgesture.h:39
const char * name
Definition: ParseText.cpp:328
#define MUI_PUBLIC
Definition: mythuiexp.h:9
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.