MythTV  master
videoLookupInfo.h
Go to the documentation of this file.
1 // Program Name: VideoLookupInfo.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 VIDEOLOOKUPINFO_H_
12 #define VIDEOLOOKUPINFO_H_
13 
14 #include <QString>
15 #include <QDateTime>
16 
17 #include "serviceexp.h"
18 #include "datacontracthelper.h"
19 
20 namespace DTC
21 {
22 
24 
25 class SERVICE_PUBLIC ArtworkItem : public QObject
26 {
27  Q_OBJECT
28  Q_CLASSINFO( "version" , "1.02" );
29 
30  Q_PROPERTY( QString Type READ Type WRITE setType )
31  Q_PROPERTY( QString Url READ Url WRITE setUrl )
32  Q_PROPERTY( QString Thumbnail READ Thumbnail WRITE setThumbnail )
33  Q_PROPERTY( int Width READ Width WRITE setWidth )
34  Q_PROPERTY( int Height READ Height WRITE setHeight )
35 
36  PROPERTYIMP ( QString , Type )
37  PROPERTYIMP ( QString , Url )
38  PROPERTYIMP ( QString , Thumbnail )
39  PROPERTYIMP ( int , Width )
40  PROPERTYIMP ( int , Height );
41 
42  public:
43 
44  static inline void InitializeCustomTypes();
45 
46  Q_INVOKABLE ArtworkItem(QObject *parent = nullptr)
47  : QObject ( parent )
48  {
49  m_Width = 0 ;
50  m_Height = 0 ;
51  }
52 
53  void Copy( const ArtworkItem *src )
54  {
55  m_Type = src->m_Type ;
56  m_Url = src->m_Url ;
57  m_Thumbnail = src->m_Thumbnail ;
58  m_Width = src->m_Width ;
59  m_Height = src->m_Height ;
60  }
61 
62  private:
64 };
65 
67 
68 class SERVICE_PUBLIC VideoLookup : public QObject
69 {
70  Q_OBJECT
71  Q_CLASSINFO( "version" , "1.0" );
72 
73  Q_CLASSINFO( "Artwork", "type=DTC::ArtworkItem");
74 
75  Q_PROPERTY( QString Title READ Title WRITE setTitle )
76  Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle )
77  Q_PROPERTY( int Season READ Season WRITE setSeason )
78  Q_PROPERTY( int Episode READ Episode WRITE setEpisode )
79  Q_PROPERTY( int Year READ Year WRITE setYear )
80  Q_PROPERTY( QString Tagline READ Tagline WRITE setTagline )
81  Q_PROPERTY( QString Description READ Description WRITE setDescription )
82  Q_PROPERTY( QString Certification READ Certification WRITE setCertification )
83  Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref )
84  Q_PROPERTY( QString Collectionref READ Collectionref WRITE setCollectionref )
85  Q_PROPERTY( QString HomePage READ HomePage WRITE setHomePage )
86  Q_PROPERTY( QDateTime ReleaseDate READ ReleaseDate WRITE setReleaseDate )
87  Q_PROPERTY( float UserRating READ UserRating WRITE setUserRating )
88  Q_PROPERTY( int Length READ Length WRITE setLength )
89  Q_PROPERTY( QString Language READ Language WRITE setLanguage )
90  Q_PROPERTY( QStringList Countries READ Countries WRITE setCountries )
91  Q_PROPERTY( float Popularity READ Popularity WRITE setPopularity )
92  Q_PROPERTY( int Budget READ Budget WRITE setBudget )
93  Q_PROPERTY( int Revenue READ Revenue WRITE setRevenue )
94  Q_PROPERTY( QString IMDB READ IMDB WRITE setIMDB )
95  Q_PROPERTY( QString TMSRef READ TMSRef WRITE setTMSRef )
96 
97  Q_PROPERTY( QVariantList Artwork READ Artwork )
98 
99  PROPERTYIMP ( QString , Title )
100  PROPERTYIMP ( QString , SubTitle )
101  PROPERTYIMP ( int , Season )
102  PROPERTYIMP ( int , Episode )
103  PROPERTYIMP ( int , Year )
104  PROPERTYIMP ( QString , Tagline )
105  PROPERTYIMP ( QString , Description )
106  PROPERTYIMP ( QString , Certification )
107  PROPERTYIMP ( QString , Inetref )
108  PROPERTYIMP ( QString , Collectionref )
109  PROPERTYIMP ( QString , HomePage )
110  PROPERTYIMP ( QDateTime , ReleaseDate )
111  PROPERTYIMP ( float , UserRating )
112  PROPERTYIMP ( int , Length )
113  PROPERTYIMP ( QString , Language )
114  PROPERTYIMP ( QStringList, Countries )
115  PROPERTYIMP ( float , Popularity )
116  PROPERTYIMP ( int , Budget )
117  PROPERTYIMP ( int , Revenue )
118  PROPERTYIMP ( QString , IMDB )
119  PROPERTYIMP ( QString , TMSRef )
120 
121  PROPERTYIMP_RO_REF( QVariantList, Artwork)
122 
123  public:
124 
125  static inline void InitializeCustomTypes();
126 
127  Q_INVOKABLE VideoLookup(QObject *parent = nullptr)
128  : QObject ( parent )
129  {
130  m_Season = 0 ;
131  m_Episode = 0 ;
132  m_Year = 0 ;
133  m_UserRating = 0.0 ;
134  m_Length = 0.0 ;
135  m_Popularity = 0.0 ;
136  m_Budget = 0 ;
137  m_Revenue = 0 ;
138  }
139 
140  void Copy( const VideoLookup *src )
141  {
142  m_Title = src->m_Title ;
143  m_SubTitle = src->m_SubTitle ;
144  m_Season = src->m_Season ;
145  m_Episode = src->m_Episode ;
146  m_Year = src->m_Year ;
147  m_Tagline = src->m_Tagline ;
148  m_Description = src->m_Description ;
149  m_Certification = src->m_Certification ;
150  m_Inetref = src->m_Inetref ;
151  m_Collectionref = src->m_Collectionref ;
152  m_HomePage = src->m_HomePage ;
153  m_ReleaseDate = src->m_ReleaseDate ;
154  m_UserRating = src->m_UserRating ;
155  m_Length = src->m_Length ;
156  m_Popularity = src->m_Popularity ;
157  m_Budget = src->m_Budget ;
158  m_Revenue = src->m_Revenue ;
159  m_IMDB = src->m_IMDB ;
160  m_TMSRef = src->m_TMSRef ;
161 
162  CopyListContents< ArtworkItem >( this, m_Artwork, src->m_Artwork );
163  }
164 
166  {
167  auto *pObject = new ArtworkItem( this );
168  Artwork().append( QVariant::fromValue<QObject *>( pObject ));
169 
170  return pObject;
171  }
172 
173 };
174 
176 {
177  qRegisterMetaType< ArtworkItem* >();
178 }
179 
181 {
182  qRegisterMetaType< VideoLookup* >();
183 
185 }
186 
187 } // namespace DTC
188 
189 #endif
DTC::VideoLookup::AddNewArtwork
ArtworkItem * AddNewArtwork()
Definition: videoLookupInfo.h:165
DTC::ArtworkItem::Q_DISABLE_COPY
Q_DISABLE_COPY(ArtworkItem)
DTC::VideoLookup
Definition: videoLookupInfo.h:69
DTC::ArtworkItem::Copy
void Copy(const ArtworkItem *src)
Definition: videoLookupInfo.h:53
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
PROPERTYIMP_RO_REF
#define PROPERTYIMP_RO_REF(type, name)
Definition: datacontracthelper.h:100
datacontracthelper.h
DTC::ArtworkItem::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: videoLookupInfo.h:175
serviceexp.h
DTC::ArtworkItem
Definition: videoLookupInfo.h:26
DTC::VideoLookup::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: videoLookupInfo.h:180
DTC::VideoLookup::Copy
void Copy(const VideoLookup *src)
Definition: videoLookupInfo.h:140
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:110
DTC::VideoLookup::VideoLookup
Q_INVOKABLE VideoLookup(QObject *parent=nullptr)
Definition: videoLookupInfo.h:127
DTC::VideoLookup::Q_CLASSINFO
Q_CLASSINFO("version", "1.0")