MythTV  master
v2captureCardList.h
Go to the documentation of this file.
1 // Program Name: captureCardList.h
3 // Created : Sep. 21, 2011
4 //
5 // Copyright (c) 2011 Robert McNamara <rmcnamara@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef V2CAPTURECARDLIST_H_
12 #define V2CAPTURECARDLIST_H_
13 
14 #include <QString>
15 #include <QVariantList>
16 
18 
19 #include "v2captureCard.h"
20 
21 class V2CaptureCardList : public QObject
22 {
23  Q_OBJECT
24  Q_CLASSINFO( "Version", "1.0" );
25  Q_CLASSINFO( "CaptureCards", "type=V2CaptureCard");
26 
27  SERVICE_PROPERTY2( QVariantList, CaptureCards );
28 
29  public:
30 
31  Q_INVOKABLE V2CaptureCardList(QObject *parent = nullptr)
32  : QObject( parent )
33  {
34  }
35 
36  void Copy( const V2CaptureCardList *src )
37  {
38  CopyListContents< V2CaptureCard >( this, m_CaptureCards, src->m_CaptureCards );
39  }
40 
42  {
43  // We must make sure the object added to the QVariantList has
44  // a parent of 'this'
45 
46  auto *pObject = new V2CaptureCard( this );
47  m_CaptureCards.append( QVariant::fromValue<QObject *>( pObject ));
48 
49  return pObject;
50  }
51 
52  private:
54 };
55 
57 
58 class V2CardTypeList : public QObject
59 {
60  Q_OBJECT
61  Q_CLASSINFO( "Version", "1.0" );
62  Q_CLASSINFO( "CardTypes", "type=V2CardType");
63 
64  SERVICE_PROPERTY2( QVariantList, CardTypes );
65 
66  public:
67 
68  Q_INVOKABLE V2CardTypeList(QObject *parent = nullptr)
69  : QObject( parent )
70  {
71  }
72 
73  void Copy( const V2CardTypeList *src )
74  {
75  CopyListContents< V2CardTypeList >( this, m_CardTypes, src->m_CardTypes );
76  }
77 
78  V2CardType *AddCardType(const QString &description, const QString &cardType)
79  {
80  // We must make sure the object added to the QVariantList has
81  // a parent of 'this'
82 
83  auto *pObject = new V2CardType( this );
84  pObject->setCardType(cardType);
85  pObject->setDescription(description);
86  m_CardTypes.append( QVariant::fromValue<QObject *>( pObject ));
87 
88  return pObject;
89  }
90 
91  private:
92  Q_DISABLE_COPY(V2CardTypeList);
93 };
94 
96 
97 class V2CaptureDeviceList : public QObject
98 {
99  Q_OBJECT
100  Q_CLASSINFO( "Version", "1.0" );
101  Q_CLASSINFO( "CaptureDevices", "type=V2CaptureDevice");
102 
103  SERVICE_PROPERTY2( QVariantList, CaptureDevices );
104 
105  public:
106 
107  Q_INVOKABLE V2CaptureDeviceList(QObject *parent = nullptr)
108  : QObject( parent )
109  {
110  }
111 
112  void Copy( const V2CaptureDeviceList *src )
113  {
114  CopyListContents< V2CaptureDeviceList >( this, m_CaptureDevices, src->m_CaptureDevices );
115  }
116 
118  {
119  // We must make sure the object added to the QVariantList has
120  // a parent of 'this'
121 
122  auto *pObject = new V2CaptureDevice( this );
123  m_CaptureDevices.append( QVariant::fromValue<QObject *>( pObject ));
124  return pObject;
125  }
126 
127  private:
128  Q_DISABLE_COPY(V2CaptureDeviceList);
129 };
130 
132 
133 
134 class V2InputGroupList : public QObject
135 {
136  Q_OBJECT
137  Q_CLASSINFO( "Version", "1.0" );
138  Q_CLASSINFO( "InputGroups", "type=V2InputGroup");
139 
140  SERVICE_PROPERTY2( QVariantList, InputGroups );
141 
142  public:
143 
144  Q_INVOKABLE V2InputGroupList(QObject *parent = nullptr)
145  : QObject( parent )
146  {
147  }
148 
149  void Copy( const V2InputGroupList *src )
150  {
151  CopyListContents< V2InputGroupList >( this, m_InputGroups,
152  src->m_InputGroups );
153  }
154 
155  V2InputGroup *AddInputGroup(uint cardInputId, uint inputGroupId,
156  const QString &inputGroupName)
157  {
158  // We must make sure the object added to the QVariantList has
159  // a parent of 'this'
160 
161  auto *pObject = new V2InputGroup( this );
162  pObject->setCardInputId(cardInputId);
163  pObject->setInputGroupId(inputGroupId);
164  pObject->setInputGroupName(inputGroupName);
165  m_InputGroups.append( QVariant::fromValue<QObject *>( pObject ));
166 
167  return pObject;
168  }
169 
170  private:
171  Q_DISABLE_COPY(V2InputGroupList);
172 };
173 
175 
176 
177 class V2DiseqcTreeList : public QObject
178 {
179  Q_OBJECT
180  Q_CLASSINFO( "Version", "1.0" );
181  Q_CLASSINFO( "DiseqcTrees", "type=V2DiseqcTree");
182 
183  SERVICE_PROPERTY2( QVariantList, DiseqcTrees );
184 
185  public:
186 
187  Q_INVOKABLE V2DiseqcTreeList(QObject *parent = nullptr)
188  : QObject( parent )
189  {
190  }
191 
192  void Copy( const V2DiseqcTreeList *src )
193  {
194  CopyListContents< V2DiseqcTreeList >( this, m_DiseqcTrees, src->m_DiseqcTrees );
195  }
196 
198  {
199  // We must make sure the object added to the QVariantList has
200  // a parent of 'this'
201 
202  auto *pObject = new V2DiseqcTree( this );
203  m_DiseqcTrees.append( QVariant::fromValue<QObject *>( pObject ));
204  return pObject;
205  }
206 
207  private:
208  Q_DISABLE_COPY(V2DiseqcTreeList);
209 };
210 
212 
213 class V2DiseqcConfigList : public QObject
214 {
215  Q_OBJECT
216  Q_CLASSINFO( "Version", "1.0" );
217  Q_CLASSINFO( "DiseqcConfigs", "type=V2DiseqcConfig");
218 
219  SERVICE_PROPERTY2( QVariantList, DiseqcConfigs );
220 
221  public:
222 
223  Q_INVOKABLE V2DiseqcConfigList(QObject *parent = nullptr)
224  : QObject( parent )
225  {
226  }
227 
228  void Copy( const V2DiseqcConfigList *src )
229  {
230  CopyListContents< V2DiseqcConfigList >( this, m_DiseqcConfigs, src->m_DiseqcConfigs );
231  }
232 
234  {
235  // We must make sure the object added to the QVariantList has
236  // a parent of 'this'
237 
238  auto *pObject = new V2DiseqcConfig( this );
239  m_DiseqcConfigs.append( QVariant::fromValue<QObject *>( pObject ));
240  return pObject;
241  }
242 
243  private:
244  Q_DISABLE_COPY(V2DiseqcConfigList);
245 };
246 
248 
249 
250 
251 #endif
V2DiseqcTreeList::V2DiseqcTreeList
Q_INVOKABLE V2DiseqcTreeList(QObject *parent=nullptr)
Definition: v2captureCardList.h:187
V2CaptureDeviceList::AddCaptureDevice
V2CaptureDevice * AddCaptureDevice()
Definition: v2captureCardList.h:117
V2CardTypeList::AddCardType
V2CardType * AddCardType(const QString &description, const QString &cardType)
Definition: v2captureCardList.h:78
V2CardTypeList
Definition: v2captureCardList.h:58
V2CaptureCardList::Copy
void Copy(const V2CaptureCardList *src)
Definition: v2captureCardList.h:36
V2CaptureCardList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2CaptureCardList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2CaptureCardList)
V2InputGroup
Definition: v2captureCard.h:207
V2DiseqcConfigList
Definition: v2captureCardList.h:213
V2CaptureCardList::V2CaptureCardList
Q_INVOKABLE V2CaptureCardList(QObject *parent=nullptr)
Definition: v2captureCardList.h:31
V2CardType
Definition: v2captureCard.h:131
V2CaptureCardList
Definition: v2captureCardList.h:21
V2InputGroupList::AddInputGroup
V2InputGroup * AddInputGroup(uint cardInputId, uint inputGroupId, const QString &inputGroupName)
Definition: v2captureCardList.h:155
V2CaptureDevice
Definition: v2captureCard.h:158
V2CaptureDeviceList
Definition: v2captureCardList.h:97
v2captureCard.h
V2CardTypeList::V2CardTypeList
Q_INVOKABLE V2CardTypeList(QObject *parent=nullptr)
Definition: v2captureCardList.h:68
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2CaptureCardList::AddNewCaptureCard
V2CaptureCard * AddNewCaptureCard()
Definition: v2captureCardList.h:41
V2InputGroupList
Definition: v2captureCardList.h:134
V2DiseqcTreeList::AddDiseqcTree
V2DiseqcTree * AddDiseqcTree()
Definition: v2captureCardList.h:197
V2DiseqcTreeList::Copy
void Copy(const V2DiseqcTreeList *src)
Definition: v2captureCardList.h:192
V2DiseqcConfigList::AddDiseqcConfig
V2DiseqcConfig * AddDiseqcConfig()
Definition: v2captureCardList.h:233
SERVICE_PROPERTY2
#define SERVICE_PROPERTY2(Type, Name)
Definition: mythhttpservice.h:72
V2InputGroupList::V2InputGroupList
Q_INVOKABLE V2InputGroupList(QObject *parent=nullptr)
Definition: v2captureCardList.h:144
V2CaptureCard
Definition: v2captureCard.h:21
V2DiseqcConfigList::Copy
void Copy(const V2DiseqcConfigList *src)
Definition: v2captureCardList.h:228
V2DiseqcConfig
Definition: v2captureCard.h:284
uint
unsigned int uint
Definition: compat.h:81
mythhttpservice.h
V2InputGroupList::Copy
void Copy(const V2InputGroupList *src)
Definition: v2captureCardList.h:149
V2CaptureCardList::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QVariantList, CaptureCards)
V2DiseqcTree
Definition: v2captureCard.h:241
V2DiseqcTreeList
Definition: v2captureCardList.h:177
V2CaptureDeviceList::V2CaptureDeviceList
Q_INVOKABLE V2CaptureDeviceList(QObject *parent=nullptr)
Definition: v2captureCardList.h:107
V2CardTypeList::Copy
void Copy(const V2CardTypeList *src)
Definition: v2captureCardList.h:73
V2DiseqcConfigList::V2DiseqcConfigList
Q_INVOKABLE V2DiseqcConfigList(QObject *parent=nullptr)
Definition: v2captureCardList.h:223
V2CaptureDeviceList::Copy
void Copy(const V2CaptureDeviceList *src)
Definition: v2captureCardList.h:112