MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
dvrServices.h
Go to the documentation of this file.
1 
2 // Program Name: dvrServices.h
3 // Created : Mar. 7, 2011
4 //
5 // Purpose - DVR Services API Interface definition
6 //
7 // Copyright (c) 2010 David Blain <dblain@mythtv.org>
8 //
9 // Licensed under the GPL v2 or later, see COPYING for details
10 //
12 
13 #ifndef DVRSERVICES_H_
14 #define DVRSERVICES_H_
15 
16 #include "service.h"
17 
21 
24 //
25 // Notes -
26 //
27 // * This implementation can't handle declared default parameters
28 //
29 // * When called, any missing params are sent default values for its datatype
30 //
31 // * Q_CLASSINFO( "<methodName>_Method", ...) is used to determine HTTP method
32 // type. Defaults to "BOTH", available values:
33 // "GET", "POST" or "BOTH"
34 //
37 
38 class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
39 {
40  Q_OBJECT
41  Q_CLASSINFO( "version" , "1.7" );
42  Q_CLASSINFO( "RemoveRecordedItem_Method", "POST" )
43  Q_CLASSINFO( "AddRecordSchedule_Method", "POST" )
44  Q_CLASSINFO( "RemoveRecordSchedule_Method", "POST" )
45  Q_CLASSINFO( "EnableRecordSchedule_Method", "POST" )
46  Q_CLASSINFO( "DisableRecordSchedule_Method", "POST" )
47  Q_CLASSINFO( "UpdateRecordSchedule_Method", "POST" )
48 
49  public:
50 
51  // Must call InitializeCustomTypes for each unique Custom Type used
52  // in public slots below.
53 
54  DvrServices( QObject *parent = 0 ) : Service( parent )
55  {
56  DTC::ProgramList::InitializeCustomTypes();
57  DTC::EncoderList::InitializeCustomTypes();
58  DTC::RecRuleList::InitializeCustomTypes();
59  }
60 
61  public slots:
62 
63  virtual DTC::ProgramList* GetExpiringList ( int StartIndex,
64  int Count ) = 0;
65 
66  virtual DTC::ProgramList* GetRecordedList ( bool Descending,
67  int StartIndex,
68  int Count ) = 0;
69 
70  virtual DTC::ProgramList* GetFilteredRecordedList ( bool Descending,
71  int StartIndex,
72  int Count,
73  const QString &TitleRegEx,
74  const QString &RecGroup,
75  const QString &StorageGroup ) = 0;
76 
77  virtual DTC::Program* GetRecorded ( int ChanId,
78  const QDateTime &StartTime ) = 0;
79 
80  virtual bool RemoveRecorded ( int ChanId,
81  const QDateTime &StartTime ) = 0;
82 
83  virtual DTC::ProgramList* GetConflictList ( int StartIndex,
84  int Count ) = 0;
85 
86  virtual DTC::ProgramList* GetUpcomingList ( int StartIndex,
87  int Count,
88  bool ShowAll ) = 0;
89 
90  virtual DTC::EncoderList* GetEncoderList ( ) = 0;
91 
92  virtual QStringList GetRecGroupList ( ) = 0;
93 
94  virtual QStringList GetTitleList ( ) = 0;
95 
96  // Recording Rules
97 
98  virtual int AddRecordSchedule ( QString Title,
99  QString Subtitle,
100  QString Description,
101  QString Category,
102  QDateTime StartTime,
103  QDateTime EndTime,
104  QString SeriesId,
105  QString ProgramId,
106  int ChanId,
107  QString Station,
108  int FindDay,
109  QTime FindTime,
110  int ParentId,
111  bool Inactive,
112  uint Season,
113  uint Episode,
114  QString Inetref,
115  QString Type,
116  QString SearchType,
117  int RecPriority,
118  uint PreferredInput,
119  int StartOffset,
120  int EndOffset,
121  QString DupMethod,
122  QString DupIn,
123  uint Filter,
124  QString RecProfile,
125  QString RecGroup,
126  QString StorageGroup,
127  QString PlayGroup,
128  bool AutoExpire,
129  int MaxEpisodes,
130  bool MaxNewest,
131  bool AutoCommflag,
132  bool AutoTranscode,
133  bool AutoMetaLookup,
134  bool AutoUserJob1,
135  bool AutoUserJob2,
136  bool AutoUserJob3,
137  bool AutoUserJob4,
138  int Transcoder ) = 0;
139 
140  virtual bool UpdateRecordSchedule ( int RecordId,
141  QString Title,
142  QString Subtitle,
143  QString Description,
144  QString Category,
145  QDateTime StartTime,
146  QDateTime EndTime,
147  QString SeriesId,
148  QString ProgramId,
149  int ChanId,
150  QString Station,
151  int FindDay,
152  QTime FindTime,
153  bool Inactive,
154  uint Season,
155  uint Episode,
156  QString Inetref,
157  QString Type,
158  QString SearchType,
159  int RecPriority,
160  uint PreferredInput,
161  int StartOffset,
162  int EndOffset,
163  QString DupMethod,
164  QString DupIn,
165  uint Filter,
166  QString RecProfile,
167  QString RecGroup,
168  QString StorageGroup,
169  QString PlayGroup,
170  bool AutoExpire,
171  int MaxEpisodes,
172  bool MaxNewest,
173  bool AutoCommflag,
174  bool AutoTranscode,
175  bool AutoMetaLookup,
176  bool AutoUserJob1,
177  bool AutoUserJob2,
178  bool AutoUserJob3,
179  bool AutoUserJob4,
180  int Transcoder ) = 0;
181 
182  virtual bool RemoveRecordSchedule ( uint RecordId ) = 0;
183 
184  virtual DTC::RecRuleList* GetRecordScheduleList ( int StartIndex,
185  int Count ) = 0;
186 
187  virtual DTC::RecRule* GetRecordSchedule ( uint RecordId,
188  QString Template,
189  int ChanId,
190  QDateTime StartTime,
191  bool MakeOverride ) = 0;
192 
193  virtual bool EnableRecordSchedule ( uint RecordId ) = 0;
194 
195  virtual bool DisableRecordSchedule ( uint RecordId ) = 0;
196 
197 };
198 
199 #endif
200