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() override = default;
22
23 enum StateType : std::uint8_t
24 { None = 0, Normal, Disabled, Active, Selected,
25 SelectedInactive };
26
27 bool gestureEvent(MythGestureEvent *event) override; // MythUIType
28 bool keyPressEvent(QKeyEvent *event) override; // MythUIType
29
30 void toggleCheckState(void);
31
32 void SetCheckState(MythUIStateType::StateType state);
33 void SetCheckState(bool onoff);
34
35 MythUIStateType::StateType GetCheckState() const;
36 bool GetBooleanCheckState(void) const;
37
38 protected slots:
39 void Select();
40 void Deselect();
41 void Enable();
42 void Disable();
43
44 signals:
46 void toggled(bool);
47
48 protected:
49 void CopyFrom(MythUIType *base) override; // MythUIType
50 void CreateCopy(MythUIType *parent) override; // MythUIType
51 void Finalize(void) override; // MythUIType
52
53 void SetInitialStates(void);
54
55 MythUIStateType *m_backgroundState {nullptr};
56 MythUIStateType *m_checkState {nullptr};
57
59 QString m_state {"active"};
60};
61
62#endif
A custom event that represents a mouse gesture.
Definition: mythgesture.h:40
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
void toggled(bool)
~MythUICheckBox() override=default
void valueChanged()
This widget is used for grouping other widgets for display when a particular named state is called.
The base class on which all widgets and screens are based.
Definition: mythuitype.h:86
virtual bool gestureEvent(MythGestureEvent *event)
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
virtual bool keyPressEvent(QKeyEvent *event)
Key event handler.
Definition: mythuitype.cpp:989
#define MUI_PUBLIC
Definition: mythuiexp.h:9