MythTV  master
mythuiclock.h
Go to the documentation of this file.
1 #ifndef MYTHUI_CLOCK_H_
2 #define MYTHUI_CLOCK_H_
3 
4 #include <QString>
5 #include <QDateTime>
6 
7 #include "mythuitype.h"
8 #include "mythuitext.h"
9 
26 {
27  public:
28  MythUIClock(MythUIType *parent, const QString &name);
29  ~MythUIClock() override;
30 
31  void Pulse(void) override; // MythUIText
32  void SetText(const QString &text) override; // MythUIText
33 
34  protected:
35  bool ParseElement(const QString &filename, QDomElement &element,
36  bool showWarnings) override; // MythUIText
37  void CopyFrom(MythUIType *base) override; // MythUIText
38  void CreateCopy(MythUIType *parent) override; // MythUIText
39 
40  QString GetTimeText(void);
41 
42  QDateTime m_time;
43  QDateTime m_nextUpdate;
44 
45  QString m_format;
46  QString m_timeFormat {"h:mm ap"};
47  QString m_dateFormat {"ddd d MMM yyyy"};
48  QString m_shortDateFormat {"ddd M/d"};
49 
50  bool m_flash {false};
51 };
52 
53 #endif
mythuitext.h
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythUIClock::m_format
QString m_format
Definition: mythuiclock.h:45
MythUIText::CopyFrom
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Definition: mythuitext.cpp:1600
MythUIClock::m_time
QDateTime m_time
Definition: mythuiclock.h:42
MythUIClock
A simple text clock widget.
Definition: mythuiclock.h:26
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
MythUIText::ParseElement
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitext.cpp:1381
MythUIText::CreateCopy
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
Definition: mythuitext.cpp:1667
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:64
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:134
MythUIClock::m_nextUpdate
QDateTime m_nextUpdate
Definition: mythuiclock.h:43
MythUIText::Pulse
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitext.cpp:1191
mythuitype.h