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  {
45  }
46 
47  void Copy( const TimeZoneInfo *src )
48  {
49  m_TimeZoneID = src->m_TimeZoneID ;
50  m_UTCOffset = src->m_UTCOffset ;
51  m_CurrentDateTime = src->m_CurrentDateTime;
52  }
53 
54  private:
56 };
57 
59 {
60  qRegisterMetaType< TimeZoneInfo* >();
61 }
62 
63 } // namespace DTC
64 
65 #endif
DTC::TimeZoneInfo
Definition: timeZoneInfo.h:21
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
datacontracthelper.h
DTC::TimeZoneInfo::Q_DISABLE_COPY
Q_DISABLE_COPY(TimeZoneInfo)
serviceexp.h
DTC::TimeZoneInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: timeZoneInfo.h:58
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:110
DTC::TimeZoneInfo::Copy
void Copy(const TimeZoneInfo *src)
Definition: timeZoneInfo.h:47