MythTV master
mythuibutton.h
Go to the documentation of this file.
1#ifndef MYTHUI_BUTTON_H_
2#define MYTHUI_BUTTON_H_
3
4#include <QString>
5
6#include "mythuitype.h"
7
9class MythUIText;
11
22{
23 Q_OBJECT
24 public:
25 MythUIButton(MythUIType *parent, const QString &name);
26 ~MythUIButton() override;
27
28 void Reset(void) override; // MythUIType
29
30 bool gestureEvent(MythGestureEvent *event) override; // MythUIType
31 bool keyPressEvent(QKeyEvent *event) override; // MythUIType
32
33 void SetText(const QString &msg);
34 QString GetText(void) const;
35 QString GetDefaultText(void) const;
36
37 void Push(bool lock=false);
38
39 void SetLockable(bool lockable) { m_lockable = lockable; };
40 void SetLocked(bool locked);
41
42 protected slots:
43 void Select();
44 void Deselect();
45 void Enable();
46 void Disable();
47 void UnPush();
48
49 signals:
50 void Clicked();
51
52 protected:
53 bool ParseElement(const QString &filename, QDomElement &element,
54 bool showWarnings) override; // MythUIType
55 void CopyFrom(MythUIType *base) override; // MythUIType
56 void CreateCopy(MythUIType *parent) override; // MythUIType
57 void Finalize(void) override; // MythUIType
58
59 void SetInitialStates(void);
60 void SetState(const QString& state);
61
62 QString m_message;
63 QString m_valueText;
64
65 MythUIStateType *m_backgroundState {nullptr};
66 MythUIText *m_text {nullptr};
67
68 QString m_state;
69
70 bool m_pushed {false};
71 bool m_lockable {false};
72 class QTimer *m_clickTimer {nullptr};
73};
74
75#endif
A custom event that represents a mouse gesture.
Definition: mythgesture.h:40
A single button widget.
Definition: mythuibutton.h:22
QString m_message
Definition: mythuibutton.h:62
void Clicked()
QString m_state
Definition: mythuibutton.h:68
QString m_valueText
Definition: mythuibutton.h:63
void SetLockable(bool lockable)
Definition: mythuibutton.h:39
This widget is used for grouping other widgets for display when a particular named state is called.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
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 void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitype.cpp:73
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 bool keyPressEvent(QKeyEvent *event)
Key event handler.
Definition: mythuitype.cpp:989
#define MUI_PUBLIC
Definition: mythuiexp.h:9