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 COPYING for details
8 //
10 
11 #ifndef ENVINFO_H_
12 #define ENVINFO_H_
13 
14 #include <QString>
15 
16 #include "serviceexp.h"
17 #include "datacontracthelper.h"
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( QString, LANG )
35  PROPERTYIMP( QString, LCALL )
36  PROPERTYIMP( QString, LCCTYPE )
37  PROPERTYIMP( QString, HOME )
38  PROPERTYIMP( 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
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
void Copy(const EnvInfo *src)
Definition: envInfo.h:54
static void InitializeCustomTypes()
Definition: envInfo.h:69
EnvInfo * EnvInfoPtr
Definition: envInfo.h:67