MythTV  master
databaseInfo.h
Go to the documentation of this file.
1 // Program Name: databaseInfo.h
3 // Created : Jan. 15, 2010
4 //
5 // Copyright (c) 2010 David Blain <dblain@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef DATABASEINFO_H_
12 #define DATABASEINFO_H_
13 
14 #include <QString>
15 
16 #include "serviceexp.h"
17 #include "datacontracthelper.h"
18 
19 namespace DTC
20 {
21 
22 class SERVICE_PUBLIC DatabaseInfo : public QObject
23 {
24  Q_OBJECT
25  Q_CLASSINFO( "version", "1.0" );
26 
27  Q_PROPERTY( QString Host READ Host WRITE setHost )
28  Q_PROPERTY( bool Ping READ Ping WRITE setPing )
29  Q_PROPERTY( int Port READ Port WRITE setPort )
30  Q_PROPERTY( QString UserName READ UserName WRITE setUserName )
31  Q_PROPERTY( QString Password READ Password WRITE setPassword )
32  Q_PROPERTY( QString Name READ Name WRITE setName )
33  Q_PROPERTY( QString Type READ Type WRITE setType )
34  Q_PROPERTY( bool LocalEnabled READ LocalEnabled WRITE setLocalEnabled )
35  Q_PROPERTY( QString LocalHostName READ LocalHostName WRITE setLocalHostName )
36 
37  PROPERTYIMP( QString, Host )
38  PROPERTYIMP( bool , Ping )
39  PROPERTYIMP( int , Port )
40  PROPERTYIMP( QString, UserName )
41  PROPERTYIMP( QString, Password )
42  PROPERTYIMP( QString, Name )
43  PROPERTYIMP( QString, Type )
44  PROPERTYIMP( bool , LocalEnabled )
45  PROPERTYIMP( QString, LocalHostName );
46 
47  public:
48 
49  static inline void InitializeCustomTypes();
50 
51  Q_INVOKABLE DatabaseInfo(QObject *parent = nullptr)
52  : QObject ( parent ),
53  m_Ping ( false ),
54  m_Port ( 0 ),
55  m_LocalEnabled( false )
56  {
57  }
58 
59  void Copy( const DatabaseInfo *src )
60  {
61  m_Host = src->m_Host ;
62  m_Ping = src->m_Ping ;
63  m_Port = src->m_Port ;
64  m_UserName = src->m_UserName ;
65  m_Password = src->m_Password ;
66  m_Name = src->m_Name ;
67  m_Type = src->m_Type ;
68  m_LocalEnabled = src->m_LocalEnabled ;
69  m_LocalHostName= src->m_LocalHostName;
70  }
71 
72  private:
73  Q_DISABLE_COPY(DatabaseInfo);
74 };
75 
77 
79 {
80  qRegisterMetaType< DatabaseInfo* >();
81 }
82 
83 } // namespace DTC
84 
85 #endif
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
static void InitializeCustomTypes()
Definition: databaseInfo.h:78
void Copy(const DatabaseInfo *src)
Definition: databaseInfo.h:59
static StandardSetting * Password(bool enabled)
Setting for changing password.