MythTV  master
Go to the documentation of this file.
1 #ifndef MYTHUI_CLOCK_H_
2 #define MYTHUI_CLOCK_H_
4 #include <QString>
5 #include <QDateTime>
7 #include "mythuitype.h"
8 #include "mythuitext.h"
26 {
27  public:
28  MythUIClock(MythUIType *parent, const QString &name);
29  ~MythUIClock();
31  void Pulse(void) override; // MythUIText
32  void SetText(const QString &text) override; // MythUIText
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
40  QString GetTimeText(void);
42  QDateTime m_Time;
43  QDateTime m_nextUpdate;
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"};
50  bool m_Flash {false};
51 };
53 #endif
A simple text clock widget.
Definition: mythuiclock.h:25
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
QDateTime m_Time
Definition: mythuiclock.h:42
const char * name
Definition: ParseText.cpp:328
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
#define MUI_PUBLIC
Definition: mythuiexp.h:9
QString m_Format
Definition: mythuiclock.h:45
QDateTime m_nextUpdate
Definition: mythuiclock.h:43