MythTV  master
v2logMessageList.h
Go to the documentation of this file.
1 #ifndef V2LOGMESSAGELIST_H_
2 #define V2LOGMESSAGELIST_H_
3 
4 #include <QVariantList>
5 
7 #include "v2logMessage.h"
8 #include "v2labelValue.h"
9 
10 class V2LogMessageList : public QObject
11 {
12  Q_OBJECT
13  Q_CLASSINFO( "Version", "1.0" );
14 
15  // Q_CLASSINFO Used to augment Metadata for properties.
16  // See datacontracthelper.h for details
17 
18  Q_CLASSINFO( "HostNames", "type=V2LabelValue");
19  Q_CLASSINFO( "Applications", "type=V2LabelValue");
20  Q_CLASSINFO( "LogMessages", "type=V2LogMessage");
21 
22  SERVICE_PROPERTY2( QVariantList, HostNames )
23  SERVICE_PROPERTY2( QVariantList, Applications )
24  SERVICE_PROPERTY2( QVariantList, LogMessages );
25 
26  public:
27 
28  Q_INVOKABLE V2LogMessageList(QObject *parent = nullptr)
29  : QObject( parent )
30  {
31  }
32 
33  void Copy( const V2LogMessageList *src )
34  {
35  CopyListContents< V2LabelValue >( this, m_HostNames,
36  src->m_HostNames );
37  CopyListContents< V2LabelValue >( this, m_Applications,
38  src->m_Applications );
39  CopyListContents< V2LogMessage >( this, m_LogMessages,
40  src->m_LogMessages );
41  }
42 
44  {
45  // We must make sure the object added to the QVariantList has
46  // a parent of 'this'
47 
48  auto *pObject = new V2LabelValue( this );
49  m_HostNames.append( QVariant::fromValue<QObject *>( pObject ));
50 
51  return pObject;
52  }
53 
55  {
56  // We must make sure the object added to the QVariantList has
57  // a parent of 'this'
58 
59  auto *pObject = new V2LabelValue( this );
60  m_Applications.append( QVariant::fromValue<QObject *>( pObject ));
61 
62  return pObject;
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 V2LogMessage( this );
71  m_LogMessages.append( QVariant::fromValue<QObject *>( pObject ));
72 
73  return pObject;
74  }
75 
76  private:
78 };
79 
81 
82 #endif // V2LOGMESSAGELIST_H_
V2LogMessageList::Copy
void Copy(const V2LogMessageList *src)
Definition: v2logMessageList.h:33
V2LogMessageList
Definition: v2logMessageList.h:10
v2labelValue.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2LogMessageList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2LogMessageList)
V2LogMessageList::AddNewApplication
V2LabelValue * AddNewApplication()
Definition: v2logMessageList.h:54
v2logMessage.h
V2LogMessageList::AddNewLogMessage
V2LogMessage * AddNewLogMessage()
Definition: v2logMessageList.h:65
V2LabelValue
Definition: v2labelValue.h:13
V2LogMessageList::AddNewHostName
V2LabelValue * AddNewHostName()
Definition: v2logMessageList.h:43
mythhttpservice.h
V2LogMessage
Definition: v2logMessage.h:13
V2LogMessageList::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QVariantList, LogMessages)
V2LogMessageList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2LogMessageList::V2LogMessageList
Q_INVOKABLE V2LogMessageList(QObject *parent=nullptr)
Definition: v2logMessageList.h:28