MythTV  master
videoMetadataInfo.h
Go to the documentation of this file.
1 // Program Name: videoMetadataInfo.h
3 // Created : Apr. 21, 2011
4 //
5 // Copyright (c) 2010 Robert McNamara <rmcnamara@mythtv.org>
6 // Copyright (c) 2013 Stuart Morgan <smorgan@mythtv.org>
7 //
8 // Licensed under the GPL v2 or later, see COPYING for details
9 //
11 
12 #ifndef VIDEOMETADATAINFO_H_
13 #define VIDEOMETADATAINFO_H_
14 
15 #include <QString>
16 #include <QDateTime>
17 
18 #include "serviceexp.h"
19 #include "datacontracthelper.h"
20 #include "artworkInfoList.h"
21 #include "castMemberList.h"
22 #include "genreList.h"
23 
24 namespace DTC
25 {
26 
28 
29 class SERVICE_PUBLIC VideoMetadataInfo : public QObject
30 {
31  Q_OBJECT
32  Q_CLASSINFO( "version" , "2.01" );
33 
34  Q_PROPERTY( int Id READ Id WRITE setId )
35  Q_PROPERTY( QString Title READ Title WRITE setTitle )
36  Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle )
37  Q_PROPERTY( QString Tagline READ Tagline WRITE setTagline )
38  Q_PROPERTY( QString Director READ Director WRITE setDirector )
39  Q_PROPERTY( QString Studio READ Studio WRITE setStudio )
40  Q_PROPERTY( QString Description READ Description WRITE setDescription )
41  Q_PROPERTY( QString Certification READ Certification WRITE setCertification )
42  Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref )
43  Q_PROPERTY( int Collectionref READ Collectionref WRITE setCollectionref )
44  Q_PROPERTY( QString HomePage READ HomePage WRITE setHomePage )
45  Q_PROPERTY( QDateTime ReleaseDate READ ReleaseDate WRITE setReleaseDate )
46  Q_PROPERTY( QDateTime AddDate READ AddDate WRITE setAddDate )
47  Q_PROPERTY( float UserRating READ UserRating WRITE setUserRating )
48  Q_PROPERTY( int ChildID READ ChildID WRITE setChildID )
49  Q_PROPERTY( int Length READ Length WRITE setLength )
50  Q_PROPERTY( int PlayCount READ PlayCount WRITE setPlayCount )
51  Q_PROPERTY( int Season READ Season WRITE setSeason )
52  Q_PROPERTY( int Episode READ Episode WRITE setEpisode )
53  Q_PROPERTY( int ParentalLevel READ ParentalLevel WRITE setParentalLevel )
54  Q_PROPERTY( bool Visible READ Visible WRITE setVisible )
55  Q_PROPERTY( bool Watched READ Watched WRITE setWatched )
56  Q_PROPERTY( bool Processed READ Processed WRITE setProcessed )
57  Q_PROPERTY( QString ContentType READ ContentType WRITE setContentType )
58  Q_PROPERTY( QString FileName READ FileName WRITE setFileName )
59  Q_PROPERTY( QString Hash READ Hash WRITE setHash )
60  Q_PROPERTY( QString HostName READ HostName WRITE setHostName )
61  Q_PROPERTY( QString Coverart READ Coverart WRITE setCoverart )
62  Q_PROPERTY( QString Fanart READ Fanart WRITE setFanart )
63  Q_PROPERTY( QString Banner READ Banner WRITE setBanner )
64  Q_PROPERTY( QString Screenshot READ Screenshot WRITE setScreenshot )
65  Q_PROPERTY( QString Trailer READ Trailer WRITE setTrailer )
66 
67  Q_PROPERTY( QObject* Artwork READ Artwork DESIGNABLE SerializeArtwork )
68  Q_PROPERTY( QObject* Cast READ Cast DESIGNABLE SerializeCast )
69  Q_PROPERTY( QObject* Genres READ Genres DESIGNABLE SerializeGenres )
70 
71  PROPERTYIMP ( int , Id )
72  PROPERTYIMP ( QString , Title )
73  PROPERTYIMP ( QString , SubTitle )
74  PROPERTYIMP ( QString , Tagline )
75  PROPERTYIMP ( QString , Director )
76  PROPERTYIMP ( QString , Studio )
77  PROPERTYIMP ( QString , Description )
78  PROPERTYIMP ( QString , Certification )
79  PROPERTYIMP ( QString , Inetref )
80  PROPERTYIMP ( int , Collectionref )
81  PROPERTYIMP ( QString , HomePage )
82  PROPERTYIMP ( QDateTime , ReleaseDate )
83  PROPERTYIMP ( QDateTime , AddDate )
84  PROPERTYIMP ( float , UserRating )
85  PROPERTYIMP ( int , ChildID )
86  PROPERTYIMP ( int , Length )
87  PROPERTYIMP ( int , PlayCount )
88  PROPERTYIMP ( int , Season )
89  PROPERTYIMP ( int , Episode )
90  PROPERTYIMP ( int , ParentalLevel )
91  PROPERTYIMP ( bool , Visible )
92  PROPERTYIMP ( bool , Watched )
93  PROPERTYIMP ( bool , Processed )
94  PROPERTYIMP ( QString , ContentType )
95  PROPERTYIMP ( QString , FileName )
96  PROPERTYIMP ( QString , Hash )
97  PROPERTYIMP ( QString , HostName )
98  PROPERTYIMP ( QString , Coverart )
99  PROPERTYIMP ( QString , Fanart )
100  PROPERTYIMP ( QString , Banner )
101  PROPERTYIMP ( QString , Screenshot )
102  PROPERTYIMP ( QString , Trailer )
103 
104  PROPERTYIMP_PTR( ArtworkInfoList , Artwork )
106  PROPERTYIMP_PTR( GenreList , Genres )
107 
108  PROPERTYIMP ( bool , SerializeArtwork)
109  PROPERTYIMP ( bool , SerializeCast )
110  PROPERTYIMP ( bool , SerializeGenres )
111 
112  public:
113 
114  static inline void InitializeCustomTypes();
115 
116  VideoMetadataInfo(QObject *parent = 0)
117  : QObject ( parent ),
118  m_Id ( 0 ),
119  m_Collectionref ( 0 ),
120  m_UserRating ( 0 ),
121  m_ChildID ( 0 ),
122  m_Length ( 0 ),
123  m_PlayCount ( 0 ),
124  m_Season ( 0 ),
125  m_Episode ( 0 ),
126  m_ParentalLevel ( 0 ),
127  m_Visible ( false ),
128  m_Watched ( false ),
129  m_Processed ( false ),
130  m_Artwork ( NULL ),
131  m_Cast ( NULL ),
132  m_Genres ( NULL ),
133  m_SerializeArtwork( true ),
134  m_SerializeCast ( true ),
135  m_SerializeGenres ( true )
136  {
137  }
138 
139  void Copy( const VideoMetadataInfo *src )
140  {
141  m_Id = src->m_Id;
142  m_SerializeArtwork = src->m_SerializeArtwork;
143  m_SerializeCast = src->m_SerializeCast;
144  m_SerializeGenres = src->m_SerializeGenres;
145 
146  if ( src->m_Artwork != NULL)
147  Artwork()->Copy( src->m_Artwork );
148 
149  if (src->m_Cast != NULL)
150  Cast()->Copy( src->m_Cast );
151 
152  if (src->m_Genres != NULL)
153  Genres()->Copy( src->m_Genres );
154 
155  }
156 
157  private:
158  Q_DISABLE_COPY(VideoMetadataInfo);
159 };
160 
162 {
163  qRegisterMetaType< VideoMetadataInfo* >();
164 
165  if (QMetaType::type( "DTC::ArtworkInfoList*" ) == 0)
167 
168  if (QMetaType::type( "DTC::CastMemberList*" ) == 0)
170 
171  if (QMetaType::type( "DTC::GenreMemberList*" ) == 0)
173 }
174 
175 } // namespace DTC
176 
177 #endif
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:89
static void InitializeCustomTypes()
#define PROPERTYIMP(type, name)
static void InitializeCustomTypes()
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:83
static void InitializeCustomTypes()
static void InitializeCustomTypes()
Definition: genreList.h:68
#define PROPERTYIMP_PTR(type, name)
ContentType
Definition: httprequest.h:61
void Copy(const VideoMetadataInfo *src)