MythTV  master
versionInfo.h
Go to the documentation of this file.
1 // Program Name: versionInfo.h
3 // Created : Jul. 26, 2011
4 //
5 // Copyright (c) 2011 Raymond Wagner <rwagner@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see LICENSE for details
8 //
10 
11 #ifndef VERSIONINFO_H_
12 #define VERSIONINFO_H_
13 
14 #include <QString>
15 
18 
19 namespace DTC
20 {
21 
22 class SERVICE_PUBLIC VersionInfo : public QObject
23 {
24  Q_OBJECT
25 
26  Q_CLASSINFO( "version" , "1.0" );
27  Q_CLASSINFO( "defaultProp", "Command" );
28 
29  Q_PROPERTY( QString Version READ Version WRITE setVersion )
30  Q_PROPERTY( QString Branch READ Branch WRITE setBranch )
31  Q_PROPERTY( QString Protocol READ Protocol WRITE setProtocol )
32  Q_PROPERTY( QString Binary READ Binary WRITE setBinary )
33  Q_PROPERTY( QString Schema READ Schema WRITE setSchema )
34 
35  PROPERTYIMP_REF( QString, Version )
36  PROPERTYIMP_REF( QString, Branch )
37  PROPERTYIMP_REF( QString, Protocol )
38  PROPERTYIMP_REF( QString, Binary )
39  PROPERTYIMP_REF( QString, Schema );
40 
41  public:
42 
43  static inline void InitializeCustomTypes();
44 
45  Q_INVOKABLE VersionInfo(QObject *parent = nullptr)
46  : QObject ( parent ),
47  m_Version ( "" ),
48  m_Branch ( "" ),
49  m_Protocol( "" ),
50  m_Binary ( "" ),
51  m_Schema ( "" )
52  {
53  }
54 
55  void Copy( const VersionInfo *src )
56  {
57  m_Version = src->m_Version;
58  m_Branch = src->m_Branch;
59  m_Protocol = src->m_Protocol;
60  m_Binary = src->m_Binary;
61  m_Schema = src->m_Schema;
62  }
63 
64  private:
65  Q_DISABLE_COPY(VersionInfo);
66 };
67 
69 
71 {
72  qRegisterMetaType< VersionInfo* >();
73 }
74 
75 } // namespace DTC
76 
77 #endif
DTC::VersionInfo
Definition: versionInfo.h:22
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
datacontracthelper.h
serviceexp.h
DTC
Definition: datacontracthelper.h:123
DTC::VersionInfo::Copy
void Copy(const VersionInfo *src)
Definition: versionInfo.h:55
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70
DTC::VersionInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: versionInfo.h:70