MythTV master
v2recRuleList.h
Go to the documentation of this file.
1#ifndef V2RECRULELIST_H_
2#define V2RECRULELIST_H_
3
4#include <QVariantList>
5#include <QDateTime>
6
8
9#include "v2recRule.h"
10
11class V2RecRuleList : public QObject
12{
13 Q_OBJECT
14 Q_CLASSINFO( "Version", "1.0" );
15
16 Q_CLASSINFO( "RecRules", "type=V2RecRule");
17 Q_CLASSINFO( "AsOf" , "transient=true" );
18
19 SERVICE_PROPERTY2( int , StartIndex )
20 SERVICE_PROPERTY2( int , Count )
21 SERVICE_PROPERTY2( int , TotalAvailable )
22 SERVICE_PROPERTY2( QDateTime , AsOf )
23 SERVICE_PROPERTY2( QString , Version )
24 SERVICE_PROPERTY2( QString , ProtoVer )
25 SERVICE_PROPERTY2( QVariantList, RecRules );
26
27 public:
28
29 Q_INVOKABLE V2RecRuleList(QObject *parent = nullptr)
30 : QObject( parent )
31 {
32 }
33
34 void Copy( const V2RecRuleList *src )
35 {
36 m_AsOf = src->m_AsOf ;
37 m_Version = src->m_Version ;
38 m_ProtoVer = src->m_ProtoVer ;
39
40 CopyListContents< V2RecRule >( this, m_RecRules, src->m_RecRules );
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 V2RecRule( this );
49 m_RecRules.append( QVariant::fromValue<QObject *>( pObject ));
50
51 return pObject;
52 }
53
54 private:
56};
57
59
60#endif
Q_CLASSINFO("AsOf", "transient=true")
SERVICE_PROPERTY2(QVariantList, RecRules)
void Copy(const V2RecRuleList *src)
Definition: v2recRuleList.h:34
V2RecRule * AddNewRecRule()
Definition: v2recRuleList.h:43
Q_DISABLE_COPY(V2RecRuleList)
Q_CLASSINFO("RecRules", "type=V2RecRule")
Q_CLASSINFO("Version", "1.0")
Q_DECLARE_METATYPE(std::chrono::seconds)