9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Contains cached MDS media items* |
14 * Description: Contains cached MDS media items* |
15 */ |
15 */ |
16 |
|
17 |
16 |
18 |
17 |
19 |
18 |
20 #ifndef VCXMYVIDEOSVIDEOCACHE_H |
19 #ifndef VCXMYVIDEOSVIDEOCACHE_H |
21 #define VCXMYVIDEOSVIDEOCACHE_H |
20 #define VCXMYVIDEOSVIDEOCACHE_H |
223 * Pointer ownership is not moved to the caller. |
220 * Pointer ownership is not moved to the caller. |
224 */ |
221 */ |
225 CMPXMedia* FindVideoByMdsIdL( TUint32 aMdsId, TInt& aPos ); |
222 CMPXMedia* FindVideoByMdsIdL( TUint32 aMdsId, TInt& aPos ); |
226 |
223 |
227 /** |
224 /** |
228 * Tries to find media with matching download ID from iVideoList and iPartialVideoList. |
|
229 * If aDownloadId is 0, then NULL is returned. |
|
230 * |
|
231 * @param aDownloadId ID to compare |
|
232 * @return Contains pointer to media if match found, NULL otherwise. |
|
233 * Pointer ownership is not moved to the caller. |
|
234 */ |
|
235 CMPXMedia* FindVideoByDownloadIdL( TUint aDownloadId ); |
|
236 |
|
237 /** |
|
238 * Gets medias from iVideoList and iPartialVideoList. |
225 * Gets medias from iVideoList and iPartialVideoList. |
239 * |
226 * |
240 * @param aMdsIds IDs of the items to fetch. |
227 * @param aMdsIds IDs of the items to fetch. |
241 * @return Pointer to fetched items, KMPXMediaArrayContents |
228 * @return Pointer to fetched items, KMPXMediaArrayContents |
242 * attribute contains the media items. Ownership |
229 * attribute contains the media items. Ownership |
243 * moves to caller. |
230 * moves to caller. |
244 */ |
231 */ |
245 CMPXMedia* GetVideosL( RArray<TUint32> aMdsIds ); |
232 CMPXMedia* GetVideosL( RArray<TUint32>& aMdsIds ); |
246 |
233 |
247 /** |
234 /** |
248 * Removes video from iVideoList (or from iPartialVideoList). |
235 * Removes video from iVideoList (or from iPartialVideoList). |
249 * |
236 * |
250 * @param aMdsId MDS ID of the video to be removed. |
237 * @param aMdsId MDS ID of the video to be removed. |
266 * will contain only those items which were actually added to cache. |
253 * will contain only those items which were actually added to cache. |
267 * |
254 * |
268 * @param aMdsIds Array containing MDS IDs of the videos to be added. |
255 * @param aMdsIds Array containing MDS IDs of the videos to be added. |
269 * @param aListFetchingWasCanceled This is set to EFalse if video list fetching from mds |
256 * @param aListFetchingWasCanceled This is set to EFalse if video list fetching from mds |
270 * had to be cancelled. EFalse otherwise. |
257 * had to be cancelled. EFalse otherwise. |
271 */ |
258 * @param aNonVideoIds If argument given then Ids which were detected to not be |
272 void AddVideosFromMdsL( RArray<TUint32>& aMdsIds, TBool& aListFetchingWasCanceled ); |
259 * videos are written here. Caller owns the array, ownership |
|
260 * does not move. |
|
261 */ |
|
262 void AddVideosFromMdsL( RArray<TUint32>& aMdsIds, TBool& aListFetchingWasCanceled, |
|
263 RArray<TUint32>* aNonVideoIds = NULL ); |
273 |
264 |
274 /** |
265 /** |
275 * Deletes old and creates new iVideoList. After the function call iVideoList exists, |
266 * Deletes old and creates new iVideoList. After the function call iVideoList exists, |
276 * but it might not contain any media items yet, only empty array. |
267 * but it might not contain any media items yet, only empty array. |
277 * Media items are added to the list asynchronoysly in |
268 * Media items are added to the list asynchronoysly in |
278 * VcxMyVideosColletionPlugin::HandleCreateVideoListResp(), called by |
269 * VcxMyVideosColletionPlugin::HandleCreateVideoListResp(), called by |
279 * VcxMyVideosMdsDb. When new items are added, they are synchronized with |
270 * VcxMyVideosMdsDb. Once iVideoList is complete, iVideoListIsPartial |
280 * Download Manager. Once iVideoList is complete, iVideoListIsPartial |
|
281 * is set to EFalse. During the video list fetching |
271 * is set to EFalse. During the video list fetching |
282 * VcxMyVideosMdsDb::iVideoListFetchingIsOngoing is ETrue. |
272 * VcxMyVideosMdsDb::iVideoListFetchingIsOngoing is ETrue. |
283 * If there is video list creation already ongoing |
273 * If there is video list creation already ongoing |
284 * and the aSortingOrder is the same, nothing is done. |
274 * and the aSortingOrder is the same, nothing is done. |
285 * During the video list fetching iPartialVideoList items are moved to |
275 * During the video list fetching iPartialVideoList items are moved to |
346 /** |
336 /** |
347 * Sorting order which was used last time when list was queryed from MDS. |
337 * Sorting order which was used last time when list was queryed from MDS. |
348 */ |
338 */ |
349 TVcxMyVideosSortingOrder iLastSortingOrder; |
339 TVcxMyVideosSortingOrder iLastSortingOrder; |
350 |
340 |
|
341 /** |
|
342 * Set to ETrue when doing videolist fetching. |
|
343 */ |
|
344 TBool IsFetchingVideoList; |
351 private: |
345 private: |
352 |
346 |
353 /** |
347 /** |
354 * Circular buffer containing download id and media object pointer pairs. |
|
355 * Media object pointers are owned by iVideoList. |
|
356 * Used to speed up access to media objects which are used regularly during the |
|
357 * download. |
|
358 */ |
|
359 CVcxMyVideosDownloadCache* iDownloadCache; |
|
360 |
|
361 /** |
|
362 * My Videos collection plugin, owner of this object. |
348 * My Videos collection plugin, owner of this object. |
363 */ |
349 */ |
364 CVcxMyVideosCollectionPlugin& iCollection; |
350 CVcxMyVideosCollectionPlugin& iCollection; |
365 |
|
366 /** |
|
367 * Provides access to the sorting order key in cenrep. Own. |
|
368 */ |
|
369 CRepository* iCenRep; |
|
370 |
|
371 }; |
351 }; |
372 |
352 |
373 #endif // VCXMYVIDEOSVIDEOCACHE_H |
353 #endif // VCXMYVIDEOSVIDEOCACHE_H |
374 |
354 |
375 |
355 |