MythTV  master
libs/libmythservicecontracts/datacontracts/frontend.h
Go to the documentation of this file.
1 // Program Name: input.h
3 // Created : May. 30, 2014
4 //
5 // Copyright (c) 2014 Stuart Morgan <smorgan@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef FRONTEND_H_
12 #define FRONTEND_H_
13 
14 #include <QString>
15 
16 #include "serviceexp.h"
17 #include "datacontracthelper.h"
18 
19 namespace DTC
20 {
21 
23 
24 class SERVICE_PUBLIC Frontend : public QObject
25 {
26  Q_OBJECT
27  Q_CLASSINFO( "version" , "1.0" );
28 
29  Q_PROPERTY( QString Name READ Name WRITE setName )
30  Q_PROPERTY( QString IP READ IP WRITE setIP )
31  Q_PROPERTY( int Port READ Port WRITE setPort )
32  Q_PROPERTY( int OnLine READ OnLine WRITE setOnLine )
33 
34  PROPERTYIMP ( QString , Name )
35  PROPERTYIMP ( QString , IP )
36  PROPERTYIMP ( int , Port )
37  PROPERTYIMP ( bool , OnLine )
38 
39  public:
40 
41  static inline void InitializeCustomTypes();
42 
43  Q_INVOKABLE Frontend(QObject *parent = nullptr)
44  : QObject ( parent ),
45  m_Port(0), m_OnLine(false)
46  {
47  }
48 
49  void Copy( const Frontend *src )
50  {
51  m_Name = src->m_Name;
52  m_IP = src->m_IP;
53  m_Port = src->m_Port;
54  m_OnLine = src->m_OnLine;
55  }
56 
57  private:
58  Q_DISABLE_COPY(Frontend);
59 };
60 
62 {
63  qRegisterMetaType< Frontend* >();
64 }
65 
66 } // namespace DTC
67 
68 #endif
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85