MythTV  master
envInfo.h
Go to the documentation of this file.
1 // Program Name: envInfo.h
3 // Created : Dec. 15, 2015
4 //
5 // Copyright (c) 2015 Bill Meek, from: 2010 David Blain <dblain@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see LICENSE for details
8 //
10 
11 #ifndef ENVINFO_H_
12 #define ENVINFO_H_
13 
14 #include <QString>
15 
18 
19 namespace DTC
20 {
21 
22 class SERVICE_PUBLIC EnvInfo : public QObject
23 {
24  Q_OBJECT
25 
26  Q_CLASSINFO( "version" , "1.0" );
27 
28  Q_PROPERTY( QString LANG READ LANG WRITE setLANG )
29  Q_PROPERTY( QString LCALL READ LCALL WRITE setLCALL )
30  Q_PROPERTY( QString LCCTYPE READ LCCTYPE WRITE setLCCTYPE )
31  Q_PROPERTY( QString HOME READ HOME WRITE setHOME )
32  Q_PROPERTY( QString MYTHCONFDIR READ MYTHCONFDIR WRITE setMYTHCONFDIR )
33 
34  PROPERTYIMP_REF( QString, LANG )
35  PROPERTYIMP_REF( QString, LCALL )
36  PROPERTYIMP_REF( QString, LCCTYPE )
37  PROPERTYIMP_REF( QString, HOME )
38  PROPERTYIMP_REF( QString, MYTHCONFDIR );
39 
40  public:
41 
42  static inline void InitializeCustomTypes();
43 
44  Q_INVOKABLE EnvInfo(QObject *parent = nullptr)
45  : QObject ( parent ),
46  m_LANG ( "" ),
47  m_LCALL ( "" ),
48  m_LCCTYPE ( "" ),
49  m_HOME ( "" ),
50  m_MYTHCONFDIR ( "" )
51  {
52  }
53 
54  void Copy( const EnvInfo *src )
55  {
56  m_LANG = src->m_LANG;
57  m_LCALL = src->m_LCALL;
58  m_LCCTYPE = src->m_LCCTYPE;
59  m_HOME = src->m_HOME;
60  m_MYTHCONFDIR = src->m_MYTHCONFDIR;
61  }
62 
63  private:
64  Q_DISABLE_COPY(EnvInfo);
65 };
66 
68 
70 {
71  qRegisterMetaType< EnvInfo* >();
72 }
73 
74 } // namespace DTC
75 
76 #endif
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
DTC::EnvInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: envInfo.h:69
datacontracthelper.h
serviceexp.h
DTC::EnvInfo
Definition: envInfo.h:22
DTC
Definition: datacontracthelper.h:123
DTC::EnvInfo::Copy
void Copy(const EnvInfo *src)
Definition: envInfo.h:54
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70