MythTV master
v2powerPriority.h
Go to the documentation of this file.
1
2// Program Name: input.h
3// Created : Nov. 20, 2013
4//
5// Copyright (c) 2013 Stuart Morgan <smorgan@mythtv.org>
6//
7// Licensed under the GPL v2 or later, see COPYING for details
8//
10
11#ifndef V2POWERPRIORITY_H
12#define V2POWERPRIORITY_H
13
14#include <QString>
15
17
19
20class V2PowerPriority : public QObject
21{
22 Q_OBJECT
23 Q_CLASSINFO( "Version" , "1.0" );
24
25 SERVICE_PROPERTY2( QString , PriorityName )
26 SERVICE_PROPERTY2( int , RecPriority )
27 SERVICE_PROPERTY2( QString , SelectClause )
28
29 public:
30
31 Q_INVOKABLE V2PowerPriority(QObject *parent = nullptr)
32 : QObject( parent )
33 {
34 }
35
36 private:
38};
39
41
42class V2PowerPriorityList : public QObject
43{
44 Q_OBJECT
45 Q_CLASSINFO( "Version", "1.0" );
46
47 // Q_CLASSINFO Used to augment Metadata for properties.
48 // See datacontracthelper.h for details
49
50 Q_CLASSINFO( "PowerPriorities", "type=V2PowerPriority");
51
52 SERVICE_PROPERTY2( QVariantList, PowerPriorities );
53
54 public:
55
56 Q_INVOKABLE V2PowerPriorityList(QObject *parent = nullptr)
57 : QObject( parent )
58 {
59 }
60
61 // This is needed so that common routines can get a non-const m_PowerPriorities
62 // reference
63 QVariantList& GetPowerPriorities() {return m_PowerPriorities;}
65 {
66 // We must make sure the object added to the QVariantList has
67 // a parent of 'this'
68
69 auto *pObject = new V2PowerPriority( this );
70 m_PowerPriorities.append( QVariant::fromValue<QObject *>( pObject ));
71
72 return pObject;
73 }
74
75 private:
77};
78
80
81#endif
SERVICE_PROPERTY2(QVariantList, PowerPriorities)
Q_INVOKABLE V2PowerPriorityList(QObject *parent=nullptr)
Q_CLASSINFO("Version", "1.0")
Q_CLASSINFO("PowerPriorities", "type=V2PowerPriority")
Q_DISABLE_COPY(V2PowerPriorityList)
V2PowerPriority * AddNewPowerPriority()
QVariantList & GetPowerPriorities()
Q_CLASSINFO("Version", "1.0")
Q_INVOKABLE V2PowerPriority(QObject *parent=nullptr)
Q_DISABLE_COPY(V2PowerPriority)
Q_DECLARE_METATYPE(std::chrono::seconds)
#define SERVICE_PROPERTY2(Type, Name)