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
10class 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_
Q_CLASSINFO("Version", "1.0")
Q_DISABLE_COPY(V2LogMessageList)
Q_CLASSINFO("HostNames", "type=V2LabelValue")
V2LogMessage * AddNewLogMessage()
V2LabelValue * AddNewApplication()
Q_CLASSINFO("Applications", "type=V2LabelValue")
void Copy(const V2LogMessageList *src)
SERVICE_PROPERTY2(QVariantList, LogMessages)
Q_CLASSINFO("LogMessages", "type=V2LogMessage")
V2LabelValue * AddNewHostName()
Q_DECLARE_METATYPE(std::chrono::seconds)