21 #define VCXHGMYVIDEOSMODEL_H |
21 #define VCXHGMYVIDEOSMODEL_H |
22 |
22 |
23 // INCLUDE FILES |
23 // INCLUDE FILES |
24 #include <coemain.h> |
24 #include <coemain.h> |
25 #include <vcxmyvideosdefs.h> |
25 #include <vcxmyvideosdefs.h> |
26 #include <MediatorEventProvider.h> |
|
27 #include <thumbnailmanager.h> |
26 #include <thumbnailmanager.h> |
28 #include <thumbnailmanagerobserver.h> |
|
29 #include <videoplayercustommessage.h> |
|
30 |
27 |
31 #include "CIptvDriveMonitor.h" |
28 #include "CIptvDriveMonitor.h" |
32 |
29 |
33 // FORWARD DECLARATIONS |
30 // FORWARD DECLARATIONS |
34 |
31 |
35 class CVcxHgMyVideosCollectionClient; |
32 class CVcxHgMyVideosCollectionClient; |
36 class CVcxHgMyVideosDownloadClient; |
33 class CVcxHgMyVideosDownloadClient; |
37 class CRepository; |
34 class CRepository; |
38 class CIptvLastWatchedApi; |
35 class CVcxHgMyVideosThumbnailManager; |
39 class CIptvLastWatchedData; |
|
40 |
|
41 |
36 |
42 // CONSTANTS |
37 // CONSTANTS |
43 |
38 |
44 const TInt KVcxHgMyVideosCategoryControlGroupId(500); |
39 const TInt KVcxHgMyVideosCategoryControlGroupId(500); |
45 const TInt KVcxHgMyVideosVideoControlGroupId(600); |
40 const TInt KVcxHgMyVideosVideoControlGroupId(600); |
172 * Sets video list sort order (to CenRep). |
166 * Sets video list sort order (to CenRep). |
173 * |
167 * |
174 * @param aSortOrder New video list sort order. |
168 * @param aSortOrder New video list sort order. |
175 */ |
169 */ |
176 void SetVideolistSortOrderL( TVcxMyVideosSortingOrder aSortOrder ); |
170 void SetVideolistSortOrderL( TVcxMyVideosSortingOrder aSortOrder ); |
|
171 |
|
172 /** |
|
173 * Gets the last watched video id from CenRep. |
|
174 * |
|
175 * @param aId Video's mpx id (iId1). |
|
176 * @return System wide error code |
|
177 */ |
|
178 TInt GetLastWatchedIdL( TInt& aId ); |
177 |
179 |
178 /** |
180 /** |
179 * Gets video list sort order (from CenRep). |
181 * Gets video list sort order (from CenRep). |
180 * |
182 * |
181 * @return Video list sort order. |
183 * @return Video list sort order. |
182 */ |
184 */ |
183 TVcxMyVideosSortingOrder VideolistSortOrderL(); |
185 TVcxMyVideosSortingOrder VideolistSortOrderL(); |
184 |
186 |
185 /** |
187 /** |
186 * Should be called when playback of video is stopping. Updates last |
188 * Gets the My Videos customization integer from CenRep. |
187 * play point of video to 'Last Watched' dat-file. |
189 * |
188 */ |
190 * @param aKey CenRep key for the value to be fetched. |
189 void UpdateLastWatchedPlayPositionL( TUint32 aLastVideoPlayPoint ); |
191 * @param aValue On return, fetched value. |
190 |
192 * @return System wide error code |
191 /** |
193 */ |
192 * Cancels the download completed soft notification. |
194 TInt GetMyVideosCustomizationInt( const TInt& aKey, TInt& aValue ); |
193 */ |
195 |
194 void ResetDownloadNotification(); |
196 /** |
195 |
197 * Gets the My Videos customization string from CenRep. |
196 /** |
198 * |
197 * Should be called when playback of video is starting. Updates 'Last |
199 * @param aKey CenRep key for the value to be fetched. |
198 * Watched' information to Matrix and dat-file. |
200 * @param aValue On return, fetched value. |
199 * |
201 * @return System wide error code |
200 * @param aVideoInfo Information about played video. |
202 */ |
201 * @param aMpxId1 MPX ID 1 of the played video. |
203 TInt GetMyVideosCustomizationString( const TInt& aKey, TDes& aValue ); |
202 * @param aAgeProfile Age profile of the video for parental control. |
204 /** |
203 */ |
205 * Returns reference to Thumbnail Manager. |
204 void SetVideoAsLastWatchedL( TVideoPlayerCustomMessage& aVideoInfo, |
206 * |
205 TInt aMpxId1, |
207 * @return Reference to Thumbnail Manager. |
206 TUint32 aAgeProfile ); |
208 */ |
207 |
209 CVcxHgMyVideosThumbnailManager& ThumbnailManager() const; |
208 /** |
210 |
209 * Reads information about 'Last Watched' video clip from dat-file. |
|
210 * |
|
211 * @param aVideoInfo On return, information about last played video. |
|
212 * @param aMpxId1 On return, MPX Item Id 1. |
|
213 * @param aAgeProfile On return, the age profile of the video for |
|
214 * parental control |
|
215 */ |
|
216 void GetLastWatchedDataL( TVideoPlayerCustomMessage& aVideoInfo, |
|
217 TUint32& aMpxId1, |
|
218 TUint32& aAgeProfile ); |
|
219 |
|
220 public: // From MThumbnailManagerObserver |
|
221 |
|
222 /** |
|
223 * Preview thumbnail generation or loading is complete. |
|
224 * |
|
225 * @param aThumbnail An object representing the resulting thumbnail. |
|
226 * @param aId Request ID for the operation |
|
227 */ |
|
228 void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId ); |
|
229 |
|
230 /** |
|
231 * Final thumbnail bitmap generation or loading is complete. |
|
232 * |
|
233 * @param aError Error code. |
|
234 * @param aThumbnail An object representing the resulting thumbnail. |
|
235 * @param aId Request ID for the operation. |
|
236 */ |
|
237 void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId ); |
|
238 |
|
239 public: // from MIptvDriveMonitorObserver |
211 public: // from MIptvDriveMonitorObserver |
240 |
212 |
241 /** |
213 /** |
242 * Empty handler for drive monitor events. |
214 * Empty handler for drive monitor events. |
243 * |
215 * |
254 |
226 |
255 /** |
227 /** |
256 * Symbian 2nd phase constructor. |
228 * Symbian 2nd phase constructor. |
257 */ |
229 */ |
258 void ConstructL(); |
230 void ConstructL(); |
259 |
231 |
260 /** |
232 /** |
261 * If needed creates, and returns pointer to Last Watched API. |
233 * Initializes MyVideos customization CenRep session. |
262 * |
234 */ |
263 * @return Pointer to Last Watched API. |
235 TInt InitMyVideosCenRepL(); |
264 */ |
|
265 CIptvLastWatchedApi* LastWatchedApiL(); |
|
266 |
|
267 /** |
|
268 * If needed creates, and returns pointer to Last Watched Data. |
|
269 * |
|
270 * @return Pointer to Last Watched Data. |
|
271 */ |
|
272 CIptvLastWatchedData* LastWatchedDataL(); |
|
273 |
|
274 /** |
|
275 * Copies data from one Video Player Custom message to another. |
|
276 * |
|
277 * @param aSource Source object. |
|
278 * @param aTarget Target object. |
|
279 */ |
|
280 void CopyVideoPlayerCustomMessageL( TVideoPlayerCustomMessage& aSource, |
|
281 TVideoPlayerCustomMessage& aTarget ); |
|
282 |
|
283 /** |
|
284 * If needed creates, and returns pointer to Video Player Custom Message. |
|
285 * |
|
286 * @return Pointer to Video Player Custom Message. |
|
287 */ |
|
288 TVideoPlayerCustomMessage* VideoPlayerCustomMessageL(); |
|
289 |
|
290 /** |
|
291 * Handles ThumbnailReady() call. |
|
292 * |
|
293 * @param aError Error code. |
|
294 * @param aThumbnail An object representing the resulting thumbnail. |
|
295 * @param aId Request ID for the operation. |
|
296 */ |
|
297 void HandleThumbnailReadyL( TInt aError, |
|
298 MThumbnailData& aThumbnail, |
|
299 TThumbnailRequestId aId ); |
|
300 /** |
|
301 * If needed creates, and returns pointer to Thumbnail Manager. |
|
302 * |
|
303 * @return Pointer to Thumbnail Manager. |
|
304 */ |
|
305 CThumbnailManager* ThumbnailManagerL(); |
|
306 |
236 |
307 private: |
237 private: |
308 |
238 |
309 /** |
239 /** |
310 * Client class for My Videos MPX Collection. |
240 * Client class for My Videos MPX Collection. |
344 * Own. |
274 * Own. |
345 */ |
275 */ |
346 CRepository* iCollectionCenRep; |
276 CRepository* iCollectionCenRep; |
347 |
277 |
348 /** |
278 /** |
349 * Pointer to 'Last Watched' API. |
279 * Session to My Videos customization CenRep. |
350 * Own. |
280 * Own. |
351 */ |
281 */ |
352 CIptvLastWatchedApi* iLastWatchedApi; |
282 CRepository* iMyVideosCenRep; |
353 |
|
354 /** |
|
355 * Pointer to 'Last Watched' data object. |
|
356 * Own. |
|
357 */ |
|
358 CIptvLastWatchedData* iLastWatchedData; |
|
359 |
|
360 /** |
|
361 * Pointer to Video Player custom message. |
|
362 * Own. |
|
363 */ |
|
364 TVideoPlayerCustomMessage* iVideoPlayerCustomMessage; |
|
365 |
|
366 /** |
|
367 * S60 Thumbnail Manager. |
|
368 * Own. |
|
369 */ |
|
370 CThumbnailManager* iTnManager; |
|
371 |
|
372 /** |
|
373 * Request ID of ongoing thumbnail request, or KErrNotFound. |
|
374 */ |
|
375 TThumbnailRequestId iTnRequestId; |
|
376 |
|
377 /** |
|
378 * Pointer to Mediator Event class. |
|
379 * Own. |
|
380 */ |
|
381 CMediatorEventProvider* iMediatorEventProvider; |
|
382 |
283 |
383 /** |
284 /** |
384 * Video list sort order. |
285 * Video list sort order. |
385 */ |
286 */ |
386 TVcxMyVideosSortingOrder iSortOrder; |
287 TVcxMyVideosSortingOrder iSortOrder; |
|
288 |
|
289 /** |
|
290 * Thumbnail Manager. |
|
291 * Own. |
|
292 */ |
|
293 CVcxHgMyVideosThumbnailManager* iTnManager; |
387 }; |
294 }; |
388 |
295 |
389 #endif // VCXHGMYVIDEOSMODEL_H |
296 #endif // VCXHGMYVIDEOSMODEL_H |