MythTV master
v2frontendList.h
Go to the documentation of this file.
1
2// Program Name: frontendList.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 V2FRONTENDLIST_H_
12#define V2FRONTENDLIST_H_
13
15#include "v2frontend.h"
16
17
18class V2FrontendList : public QObject
19{
20 Q_OBJECT
21 Q_CLASSINFO( "version", "1.0" );
22
23 // Q_CLASSINFO Used to augment Metadata for properties.
24 // See datacontracthelper.h for details
25
26 Q_CLASSINFO( "Frontends", "type=V2Frontend");
27
28 SERVICE_PROPERTY2( QVariantList, Frontends );
29
30 public:
31
32 Q_INVOKABLE V2FrontendList(QObject *parent = nullptr)
33 : QObject( parent )
34 {
35 }
36
37 void Copy( const V2FrontendList *src )
38 {
39 CopyListContents< V2Frontend >( this, m_Frontends, src->m_Frontends );
40 }
41
42 // This is needed so that common routines can get a non-const m_Encoders
43 // reference
44 QVariantList& GetFrontends() {return m_Frontends;}
46 {
47 // We must make sure the object added to the QVariantList has
48 // a parent of 'this'
49
50 auto *pObject = new V2Frontend( this );
51 m_Frontends.append( QVariant::fromValue<QObject *>( pObject ));
52
53 return pObject;
54 }
55
56 private:
58};
59
61
62#endif
void Copy(const V2FrontendList *src)
V2Frontend * AddNewFrontend()
Q_DISABLE_COPY(V2FrontendList)
SERVICE_PROPERTY2(QVariantList, Frontends)
Q_CLASSINFO("Frontends", "type=V2Frontend")
QVariantList & GetFrontends()
Q_INVOKABLE V2FrontendList(QObject *parent=nullptr)
Q_CLASSINFO("version", "1.0")
Q_DECLARE_METATYPE(std::chrono::seconds)