MythTV  master
timeZoneInfo.h
Go to the documentation of this file.
1 // Program Name: timeZoneInfo.h
3 //
4 // Licensed under the GPL v2 or later, see COPYING for details
5 //
7 
8 #ifndef TIMEZONEINFO_H_
9 #define TIMEZONEINFO_H_
10 
11 #include <QString>
12 #include <QDateTime>
13 
14 #include "serviceexp.h"
15 #include "datacontracthelper.h"
16 
17 namespace DTC
18 {
19 
20 class SERVICE_PUBLIC TimeZoneInfo : public QObject
21 {
22  Q_OBJECT
23  Q_CLASSINFO( "version" , "1.0" );
24 
25  Q_PROPERTY( QString TimeZoneID READ TimeZoneID
26  WRITE setTimeZoneID )
27  Q_PROPERTY( int UTCOffset READ UTCOffset
28  WRITE setUTCOffset )
29  Q_PROPERTY( QDateTime CurrentDateTime READ CurrentDateTime
30  WRITE setCurrentDateTime )
31 
32  PROPERTYIMP( QString , TimeZoneID )
33  PROPERTYIMP( int , UTCOffset )
34  PROPERTYIMP( QDateTime, CurrentDateTime );
35 
36  public:
37 
38  static inline void InitializeCustomTypes();
39 
40  Q_INVOKABLE TimeZoneInfo(QObject *parent = nullptr)
41  : QObject ( parent ),
42  m_TimeZoneID ( ),
43  m_UTCOffset ( 0 ),
44  m_CurrentDateTime ( )
45  {
46  }
47 
48  void Copy( const TimeZoneInfo *src )
49  {
50  m_TimeZoneID = src->m_TimeZoneID ;
51  m_UTCOffset = src->m_UTCOffset ;
52  m_CurrentDateTime = src->m_CurrentDateTime;
53  }
54 
55  private:
56  Q_DISABLE_COPY(TimeZoneInfo);
57 };
58 
60 {
61  qRegisterMetaType< TimeZoneInfo* >();
62 }
63 
64 } // namespace DTC
65 
66 #endif
static void InitializeCustomTypes()
Definition: timeZoneInfo.h:59
#define PROPERTYIMP(type, name)
void Copy(const TimeZoneInfo *src)
Definition: timeZoneInfo.h:48
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
Q_INVOKABLE TimeZoneInfo(QObject *parent=nullptr)
Definition: timeZoneInfo.h:40