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 LICENSE for details
5 //
7 
8 #ifndef LABELVALUE_H_
9 #define LABELVALUE_H_
10 
11 #include <QString>
12 
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_REF( QString , Label )
36  PROPERTYIMP_REF( QString , Value )
37  PROPERTYIMP_REF( 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
DTC::LabelValue::Copy
void Copy(const LabelValue *src)
Definition: labelValue.h:55
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:89
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
datacontracthelper.h
serviceexp.h
DTC::LabelValue::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: labelValue.h:68
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:123
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70
DTC::LabelValue::LabelValue
Q_INVOKABLE LabelValue(QObject *parent=nullptr)
Definition: labelValue.h:45
DTC::LabelValue
Definition: labelValue.h:19