MythUIClock Class Reference
[MythUI Widget and theme handling]

A simple text clock widget. More...

#include <mythuiclock.h>

Inheritance diagram for MythUIClock:
MythUIText MythUIType StorageUser XMLParseBase

List of all members.

Public Member Functions

 MythUIClock (MythUIType *parent, const QString &name)
 ~MythUIClock ()
virtual void Pulse (void)
 Looks up the time and sets the clock if the current time is greater than or equal to m_nextUpdate.
virtual void SetText (const QString &text)
 This sets the text, unless the string is blank, in that case the time is looked up and set as the text instead.

Protected Member Functions

virtual bool ParseElement (const QString &filename, QDomElement &element, bool showWarnings)
virtual void CopyFrom (MythUIType *base)
virtual void CreateCopy (MythUIType *parent)
QString GetTimeText (void)
 This creates a string based on m_Time, and sets m_nextUpdate to the second following m_Time.

Protected Attributes

QDateTime m_Time
QDateTime m_nextUpdate
QString m_Format
QString m_TimeFormat
QString m_DateFormat
QString m_ShortDateFormat
bool m_Flash

Detailed Description

A simple text clock widget.

Updates once a second and inherits from MythUIText, so it supports all the text styles and decorations offered by that class.

Basic manipulation of the clock format is supported using any of the following in the "format" element of the theme: TIME% - The time, in a format defined in the locale settings DATE% - Long date format, as defined in the locale settings SHORTDATE% - Short date format, as defined in the locale settings

Definition at line 25 of file mythuiclock.h.


Constructor & Destructor Documentation

MythUIClock::MythUIClock ( MythUIType parent,
const QString &  name 
)

Definition at line 15 of file mythuiclock.cpp.

Referenced by CreateCopy().

MythUIClock::~MythUIClock (  ) 

Definition at line 27 of file mythuiclock.cpp.


Member Function Documentation

void MythUIClock::Pulse ( void   )  [virtual]

Looks up the time and sets the clock if the current time is greater than or equal to m_nextUpdate.

Reimplemented from MythUIText.

Definition at line 36 of file mythuiclock.cpp.

void MythUIClock::SetText ( const QString &  text  )  [virtual]

This sets the text, unless the string is blank, in that case the time is looked up and set as the text instead.

Reimplemented from MythUIText.

Definition at line 67 of file mythuiclock.cpp.

Referenced by Pulse().

bool MythUIClock::ParseElement ( const QString &  filename,
QDomElement &  element,
bool  showWarnings 
) [protected, virtual]

Parse the xml definition of this widget setting the state of the object accordingly.

Reimplemented from MythUIText.

Definition at line 83 of file mythuiclock.cpp.

void MythUIClock::CopyFrom ( MythUIType base  )  [protected, virtual]

Copy this widgets state from another.

Reimplemented from MythUIText.

Definition at line 110 of file mythuiclock.cpp.

Referenced by CreateCopy().

void MythUIClock::CreateCopy ( MythUIType parent  )  [protected, virtual]

Copy the state of this widget to the one given, it must be of the same type.

Reimplemented from MythUIText.

Definition at line 136 of file mythuiclock.cpp.

QString MythUIClock::GetTimeText ( void   )  [protected]

This creates a string based on m_Time, and sets m_nextUpdate to the second following m_Time.

It's important to note that this function do not look up the wall clock time, but depends on m_Time being set ahead of time.

Definition at line 53 of file mythuiclock.cpp.

Referenced by Pulse(), and SetText().


Member Data Documentation

QDateTime MythUIClock::m_Time [protected]

Definition at line 42 of file mythuiclock.h.

Referenced by CopyFrom(), GetTimeText(), Pulse(), and SetText().

QDateTime MythUIClock::m_nextUpdate [protected]

Definition at line 43 of file mythuiclock.h.

Referenced by CopyFrom(), GetTimeText(), and Pulse().

QString MythUIClock::m_Format [protected]

Definition at line 45 of file mythuiclock.h.

Referenced by CopyFrom(), GetTimeText(), MythUIClock(), and ParseElement().

QString MythUIClock::m_TimeFormat [protected]

Definition at line 46 of file mythuiclock.h.

Referenced by CopyFrom(), MythUIClock(), and ParseElement().

QString MythUIClock::m_DateFormat [protected]

Definition at line 47 of file mythuiclock.h.

Referenced by CopyFrom(), MythUIClock(), and ParseElement().

QString MythUIClock::m_ShortDateFormat [protected]

Definition at line 48 of file mythuiclock.h.

Referenced by CopyFrom(), MythUIClock(), and ParseElement().

Definition at line 50 of file mythuiclock.h.

Referenced by CopyFrom(), and MythUIClock().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:42:18 2012 for MythTV by  doxygen 1.6.3