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 COPYING for details
8 //
10 
11 #ifndef VERSIONINFO_H_
12 #define VERSIONINFO_H_
13 
14 #include <QString>
15 
16 #include "serviceexp.h"
17 #include "datacontracthelper.h"
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( QString, Version )
36  PROPERTYIMP( QString, Branch )
37  PROPERTYIMP( QString, Protocol )
38  PROPERTYIMP( QString, Binary )
39  PROPERTYIMP( 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:
66 };
67 
69 
71 {
72  qRegisterMetaType< VersionInfo* >();
73 }
74 
75 } // namespace DTC
76 
77 #endif
DTC::VersionInfo
Definition: versionInfo.h:23
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
DTC::VersionInfo::Q_CLASSINFO
Q_CLASSINFO("version", "1.0")
datacontracthelper.h
serviceexp.h
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:110
DTC::VersionInfo::Copy
void Copy(const VersionInfo *src)
Definition: versionInfo.h:55
DTC::VersionInfo::Q_DISABLE_COPY
Q_DISABLE_COPY(VersionInfo)
DTC::VersionInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: versionInfo.h:70