MythTV  master
artworkInfoList.h
Go to the documentation of this file.
1 // Program Name: artworkInfoList.h
3 // Created : Nov. 12, 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 ARTWORKINFOLIST_H_
12 #define ARTWORKINFOLIST_H_
13 
14 #include <QString>
15 #include <QVariantList>
16 
17 #include "serviceexp.h"
18 #include "datacontracthelper.h"
19 
20 #include "artworkInfo.h"
21 
22 namespace DTC
23 {
24 
25 class SERVICE_PUBLIC ArtworkInfoList : public QObject
26 {
27  Q_OBJECT
28  Q_CLASSINFO( "version", "1.0" );
29 
30  // Q_CLASSINFO Used to augment Metadata for properties.
31  // See datacontracthelper.h for details
32 
33  Q_CLASSINFO( "ArtworkInfos", "type=DTC::ArtworkInfo");
34 
35  Q_PROPERTY( QVariantList ArtworkInfos READ ArtworkInfos DESIGNABLE true )
36 
37  PROPERTYIMP_RO_REF( QVariantList, ArtworkInfos );
38 
39  public:
40 
41  static inline void InitializeCustomTypes();
42 
43  Q_INVOKABLE ArtworkInfoList(QObject *parent = nullptr)
44  : QObject ( parent )
45  {
46  }
47 
48  void Copy( const ArtworkInfoList *src )
49  {
50  CopyListContents< ArtworkInfo >( this, m_ArtworkInfos, src->m_ArtworkInfos );
51  }
52 
54  {
55  // We must make sure the object added to the QVariantList has
56  // a parent of 'this'
57 
58  ArtworkInfo *pObject = new ArtworkInfo( this );
59  m_ArtworkInfos.append( QVariant::fromValue<QObject *>( pObject ));
60 
61  return pObject;
62  }
63 
64  private:
65  Q_DISABLE_COPY(ArtworkInfoList);
66 };
67 
69 {
70  qRegisterMetaType< ArtworkInfoList* >();
71 
73 }
74 
75 } // namespace DTC
76 
77 #endif
static void InitializeCustomTypes()
Definition: artworkInfo.h:60
ArtworkInfo * AddNewArtworkInfo()
static void InitializeCustomTypes()
void Copy(const ArtworkInfoList *src)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
#define PROPERTYIMP_RO_REF(type, name)
Q_INVOKABLE ArtworkInfoList(QObject *parent=nullptr)