MythTV  master
labelValue.h
Go to the documentation of this file.
1 // Program Name: labelValue.h
3 //
4 // Licensed under the GPL v2 or later, see COPYING for details
5 //
7 
8 #ifndef LABELVALUE_H_
9 #define LABELVALUE_H_
10 
11 #include <QString>
12 
13 #include "serviceexp.h"
14 #include "datacontracthelper.h"
15 
16 namespace DTC
17 {
18 
19 class SERVICE_PUBLIC LabelValue : public QObject
20 {
21  Q_OBJECT
22  Q_CLASSINFO( "version" , "1.0" );
23 
24  Q_PROPERTY( QString Label READ Label
25  WRITE setLabel )
26  Q_PROPERTY( QString Value READ Value
27  WRITE setValue )
28  Q_PROPERTY( QString Description READ Description
29  WRITE setDescription )
30  Q_PROPERTY( bool Active READ Active
31  WRITE setActive )
32  Q_PROPERTY( bool Selected READ Selected
33  WRITE setSelected )
34 
35  PROPERTYIMP( QString , Label )
36  PROPERTYIMP( QString , Value )
37  PROPERTYIMP( QString , Description )
38  PROPERTYIMP( bool , Active )
39  PROPERTYIMP( bool , Selected );
40 
41  public:
42 
43  static inline void InitializeCustomTypes();
44 
45  Q_INVOKABLE LabelValue(QObject *parent = nullptr)
46  : QObject ( parent ),
47  m_Label ( ),
48  m_Value ( ),
49  m_Description ( ),
50  m_Active ( false ),
51  m_Selected ( false )
52  {
53  }
54 
55  void Copy( const LabelValue *src )
56  {
57  m_Label = src->m_Label ;
58  m_Value = src->m_Value ;
59  m_Description = src->m_Description ;
60  m_Active = src->m_Active ;
61  m_Selected = src->m_Selected ;
62  }
63 
64  private:
65  Q_DISABLE_COPY(LabelValue);
66 };
67 
69 {
70  qRegisterMetaType< LabelValue* >();
71 }
72 
73 } // namespace DTC
74 
75 #endif
void Copy(const LabelValue *src)
Definition: labelValue.h:55
Q_INVOKABLE LabelValue(QObject *parent=nullptr)
Definition: labelValue.h:45
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
static void InitializeCustomTypes()
Definition: labelValue.h:68