MythTV  master
v2commMethod.h
Go to the documentation of this file.
1 // Program Name: V2commMethod.h
3 // Created : Feb. 12, 2023
4 //
5 // Licensed under the GPL v2 or later, see COPYING for details
6 //
8 
9 #ifndef V2COMMMETHOD_H_
10 #define V2COMMMETHOD_H_
11 
12 #include <QObject>
13 #include <QString>
14 
16 
17 class V2CommMethod : public QObject
18 {
19  Q_OBJECT
20  Q_CLASSINFO( "Version", "1.0" );
21 
22 
24  SERVICE_PROPERTY2( QString , LocalizedName );
25 
26  public:
27 
28  Q_INVOKABLE V2CommMethod(QObject *parent = nullptr)
29  : QObject( parent )
30  {
31  }
32 
33  // void Copy( const V2CommMethod *src )
34  // {
35  // m_CommMethod = src->m_CommMethod ;
36  // m_Name = src->m_Name ;
37  // }
38 
39  private:
41 };
42 
44 
45 class V2CommMethodList : public QObject
46 {
47  Q_OBJECT
48  Q_CLASSINFO( "version", "1.0" );
49  Q_CLASSINFO( "CommMethods", "type=V2CommMethod");
50 
51  SERVICE_PROPERTY2( QVariantList, CommMethods );
52 
53  public:
54 
55  Q_INVOKABLE V2CommMethodList(QObject *parent = nullptr)
56  : QObject( parent )
57  {
58  }
59 
60  // void Copy( const V2CommMethodList *src )
61  // {
62  // CopyListContents< V2Country >( this, m_CommMethods, src->m_CommMethods );
63  // }
64 
66  {
67  // We must make sure the object added to the QVariantList has
68  // a parent of 'this'
69 
70  auto *pObject = new V2CommMethod( this );
71  m_CommMethods.append( QVariant::fromValue<QObject *>( pObject ));
72 
73  return pObject;
74  }
75 
76  private:
77  Q_DISABLE_COPY(V2CommMethodList);
78 };
79 
81 
82 
83 
84 #endif
V2CommMethodList
Definition: v2commMethod.h:45
V2CommMethod::Q_DISABLE_COPY
Q_DISABLE_COPY(V2CommMethod)
CommMethod
Definition: channelsettings.cpp:393
V2CommMethod::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2CommMethod::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QString, LocalizedName)
V2CommMethod
Definition: v2commMethod.h:17
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(std::chrono::seconds)
SERVICE_PROPERTY2
#define SERVICE_PROPERTY2(Type, Name)
Definition: mythhttpservice.h:72
V2CommMethod::V2CommMethod
Q_INVOKABLE V2CommMethod(QObject *parent=nullptr)
Definition: v2commMethod.h:28
mythhttpservice.h
V2CommMethodList::AddNewCommMethod
V2CommMethod * AddNewCommMethod()
Definition: v2commMethod.h:65
V2CommMethodList::V2CommMethodList
Q_INVOKABLE V2CommMethodList(QObject *parent=nullptr)
Definition: v2commMethod.h:55