MythTV  master
videoLookupInfoList.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 VIDEOLOOKUPINFOLIST_H_
12 #define VIDEOLOOKUPINFOLIST_H_
13 
14 #include <QVariantList>
15 
16 #include "serviceexp.h"
17 #include "datacontracthelper.h"
18 
19 #include "videoLookupInfo.h"
20 
21 namespace DTC
22 {
23 
24 class SERVICE_PUBLIC VideoLookupList : public QObject
25 {
26  Q_OBJECT
27  Q_CLASSINFO( "version", "1.0" );
28 
29  // Q_CLASSINFO Used to augment Metadata for properties.
30  // See datacontracthelper.h for details
31 
32  Q_CLASSINFO( "VideoLookups", "type=DTC::VideoLookup");
33  Q_CLASSINFO( "AsOf" , "transient=true" );
34 
35  Q_PROPERTY( int Count READ Count WRITE setCount )
36  Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf )
37  Q_PROPERTY( QString Version READ Version WRITE setVersion )
38  Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer )
39 
40  Q_PROPERTY( QVariantList VideoLookups READ VideoLookups DESIGNABLE true )
41 
42  PROPERTYIMP ( int , Count )
43  PROPERTYIMP ( QDateTime , AsOf )
44  PROPERTYIMP ( QString , Version )
45  PROPERTYIMP ( QString , ProtoVer )
46 
47  PROPERTYIMP_RO_REF( QVariantList, VideoLookups );
48 
49  public:
50 
51  static inline void InitializeCustomTypes();
52 
53  Q_INVOKABLE VideoLookupList(QObject *parent = nullptr)
54  : QObject( parent ),
55  m_Count ( 0 )
56  {
57  }
58 
59  void Copy( const VideoLookupList *src )
60  {
61  m_Count = src->m_Count ;
62  m_AsOf = src->m_AsOf ;
63  m_Version = src->m_Version ;
64  m_ProtoVer = src->m_ProtoVer ;
65 
66  CopyListContents< VideoLookup >( this, m_VideoLookups, src->m_VideoLookups );
67  }
68 
70  {
71  // We must make sure the object added to the QVariantList has
72  // a parent of 'this'
73 
74  VideoLookup *pObject = new VideoLookup( this );
75  m_VideoLookups.append( QVariant::fromValue<QObject *>( pObject ));
76 
77  return pObject;
78  }
79 
80  private:
81  Q_DISABLE_COPY(VideoLookupList);
82 };
83 
85 {
86  qRegisterMetaType< VideoLookupList* >();
87 
89 }
90 
91 } // namespace DTC
92 
93 #endif
static void InitializeCustomTypes()
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
#define PROPERTYIMP(type, name)
VideoLookup * AddNewVideoLookup()
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
#define PROPERTYIMP_RO_REF(type, name)
static void InitializeCustomTypes()
void Copy(const VideoLookupList *src)