MythTV  master
enumItem.h
Go to the documentation of this file.
1 // Program Name: enumItem.h
3 // Created : July 25, 2014
4 //
5 // Copyright (c) 2014 David Blain <dblain@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef ENUMS_H_
12 #define ENUMS_H_
13 
14 #include "serviceexp.h"
15 #include "datacontracthelper.h"
16 
17 namespace DTC
18 {
19 
20 class SERVICE_PUBLIC EnumItem : public QObject
21 {
22  Q_OBJECT
23  Q_CLASSINFO( "version", "1.02" );
24 
25  Q_PROPERTY( QString Key READ Key WRITE setKey )
26  Q_PROPERTY( int Value READ Value WRITE setValue )
27  Q_PROPERTY( QString Desc READ Desc WRITE setDesc )
28 
29  PROPERTYIMP ( QString , Key )
30  PROPERTYIMP ( int , Value )
31  PROPERTYIMP ( QString , Desc );
32 
33  public:
34 
35  static inline void InitializeCustomTypes();
36 
37  Q_INVOKABLE explicit EnumItem( QObject *parent = nullptr)
38  : QObject ( parent ),
39  m_Value ( 0 )
40  {
41  }
42 
43  void Copy( const EnumItem *src )
44  {
45  m_Key = src->m_Key ;
46  m_Value = src->m_Value;
47  m_Desc = src->m_Desc ;
48  }
49 
50  private:
51  Q_DISABLE_COPY(EnumItem);
52 };
53 
55 {
56  qRegisterMetaType< EnumItem* >();
57 }
58 
59 } // namespace
60 
61 #endif
#define PROPERTYIMP(type, name)
void Copy(const EnumItem *src)
Definition: enumItem.h:43
static void InitializeCustomTypes()
Definition: enumItem.h:54
#define SERVICE_PUBLIC
Definition: serviceexp.h:9