MythTV  master
v2videoLookupInfoList.h
Go to the documentation of this file.
1 // Program Name: videoLookupInfoList.h
3 // Created : Jul. 19, 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 V2VIDEOLOOKUPINFOLIST_H_
12 #define V2VIDEOLOOKUPINFOLIST_H_
13 
14 #include <QVariantList>
15 
17 
18 #include "v2videoLookupInfo.h"
19 
20 
21 class V2VideoLookupList : public QObject
22 {
23  Q_OBJECT
24  Q_CLASSINFO( "Version", "1.0" );
25 
26  // Q_CLASSINFO Used to augment Metadata for properties.
27  // See datacontracthelper.h for details
28 
29  Q_CLASSINFO( "VideoLookups", "type=V2VideoLookup");
30  Q_CLASSINFO( "AsOf" , "transient=true" );
31 
32 
33  SERVICE_PROPERTY2 ( int , Count )
34  SERVICE_PROPERTY2 ( QDateTime , AsOf )
35  SERVICE_PROPERTY2 ( QString , Version )
36  SERVICE_PROPERTY2 ( QString , ProtoVer )
37  SERVICE_PROPERTY2 ( QVariantList, VideoLookups );
38 
39  public:
40 
41  Q_INVOKABLE V2VideoLookupList(QObject *parent = nullptr)
42  : QObject( parent )
43  {
44  }
45 
46  void Copy( const V2VideoLookupList *src )
47  {
48  m_Count = src->m_Count ;
49  m_AsOf = src->m_AsOf ;
50  m_Version = src->m_Version ;
51  m_ProtoVer = src->m_ProtoVer ;
52 
53  CopyListContents< V2VideoLookup >( this, m_VideoLookups, src->m_VideoLookups );
54  }
55 
57  {
58  // We must make sure the object added to the QVariantList has
59  // a parent of 'this'
60 
61  auto *pObject = new V2VideoLookup( this );
62  m_VideoLookups.append( QVariant::fromValue<QObject *>( pObject ));
63 
64  return pObject;
65  }
66 
67  private:
69 };
70 
72 
73 #endif
V2VideoLookupList
Definition: v2videoLookupInfoList.h:21
V2VideoLookupList::AddNewVideoLookup
V2VideoLookup * AddNewVideoLookup()
Definition: v2videoLookupInfoList.h:56
V2VideoLookupList::Copy
void Copy(const V2VideoLookupList *src)
Definition: v2videoLookupInfoList.h:46
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
V2VideoLookup
Definition: v2videoLookupInfo.h:58
v2videoLookupInfo.h
mythhttpservice.h
V2VideoLookupList::Q_CLASSINFO
Q_CLASSINFO("Version", "1.0")
V2VideoLookupList::SERVICE_PROPERTY2
SERVICE_PROPERTY2(QVariantList, VideoLookups)
V2VideoLookupList::Q_DISABLE_COPY
Q_DISABLE_COPY(V2VideoLookupList)
V2VideoLookupList::V2VideoLookupList
Q_INVOKABLE V2VideoLookupList(QObject *parent=nullptr)
Definition: v2videoLookupInfoList.h:41