36 #include <AknsUtils.h> |
36 #include <AknsUtils.h> |
37 #include <AknUtils.h> |
37 #include <AknUtils.h> |
38 #include <aknlayoutscalable_avkon.cdl.h> |
38 #include <aknlayoutscalable_avkon.cdl.h> |
39 #include <coemain.h> |
39 #include <coemain.h> |
40 #include <aknappui.h> |
40 #include <aknappui.h> |
|
41 #include <bautils.h> |
41 |
42 |
42 #include <vcxhgmyvideosicons.mbg> |
43 #include <vcxhgmyvideosicons.mbg> |
43 #include <myvideosindicator.h> |
44 #include <myvideosindicator.h> |
44 #include <vcxhgmyvideos.rsg> |
45 #include <vcxhgmyvideos.rsg> |
45 #include <vcxmyvideosdefs.h> |
46 #include <vcxmyvideosdefs.h> |
183 break; |
184 break; |
184 case KVcxMvcCategoryIdOther: |
185 case KVcxMvcCategoryIdOther: |
185 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_STORAGE_OTHER_LIST ); |
186 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_STORAGE_OTHER_LIST ); |
186 break; |
187 break; |
187 case KCategoryIdLastWatched: |
188 case KCategoryIdLastWatched: |
188 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_LAST_WATCHED ); |
189 if ( LastWatchedSetL() ) |
|
190 { |
|
191 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_LAST_WATCHED ); |
|
192 } |
|
193 else |
|
194 { |
|
195 if ( PreloadedExistsL() ) |
|
196 { |
|
197 TBuf<KMyVideosTitleStringMaxLength> string; |
|
198 TInt error = iModel.GetMyVideosCustomizationString( |
|
199 KCRVideoPlayerPreloadedVideoName, string ); |
|
200 name = error ? KNullDesC().AllocLC() : string.AllocLC(); |
|
201 } |
|
202 else |
|
203 { |
|
204 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_LAST_WATCHED ); |
|
205 } |
|
206 } |
189 break; |
207 break; |
190 case KCategoryIdExtraItem1: |
208 case KCategoryIdExtraItem1: |
191 // ExtraItem1 is always interpreted as Ovi Store |
209 // ExtraItem1 is always interpreted as Ovi Store |
192 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_OVI_STORE ); |
210 name = StringLoader::LoadLC( R_VCXHGMYVIDEOS_OVI_STORE ); |
193 break; |
211 break; |
259 iconFile = KVcxHgMyVideosMifFile; |
277 iconFile = KVcxHgMyVideosMifFile; |
260 bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_captured_thumbnail_video; |
278 bitmapId = EMbmVcxhgmyvideosiconsQgn_prop_captured_thumbnail_video; |
261 maskId = EMbmVcxhgmyvideosiconsQgn_prop_captured_thumbnail_video_mask; |
279 maskId = EMbmVcxhgmyvideosiconsQgn_prop_captured_thumbnail_video_mask; |
262 break; |
280 break; |
263 case KCategoryIdLastWatched: |
281 case KCategoryIdLastWatched: |
264 // Dont set default lw icon here, it'd just blink. |
282 if ( !LastWatchedSetL() ) |
|
283 { |
|
284 LoadLastWatchedIconL(); |
|
285 } |
265 break; |
286 break; |
266 case KCategoryIdExtraItem1: |
287 case KCategoryIdExtraItem1: |
267 // ExtraItem1 is always interpreted as Ovi Store |
288 // ExtraItem1 is always interpreted as Ovi Store |
268 skinId.Set( KAknsIIDQgnPropOviThumbnailVideo ); |
289 skinId.Set( KAknsIIDQgnPropOviThumbnailVideo ); |
269 iconFile = KVcxHgMyVideosMifFile; |
290 iconFile = KVcxHgMyVideosMifFile; |
409 case KVcxMvcCategoryIdAll: |
430 case KVcxMvcCategoryIdAll: |
410 case KVcxMvcCategoryIdDownloads: |
431 case KVcxMvcCategoryIdDownloads: |
411 case KVcxMvcCategoryIdTvRecordings: |
432 case KVcxMvcCategoryIdTvRecordings: |
412 case KVcxMvcCategoryIdCaptured: |
433 case KVcxMvcCategoryIdCaptured: |
413 case KVcxMvcCategoryIdOther: |
434 case KVcxMvcCategoryIdOther: |
414 case KCategoryIdLastWatched: |
|
415 { |
435 { |
416 CMPXMedia* media = GetCategoryDataL( aCategoryId ); |
436 CMPXMedia* media = GetCategoryDataL( aCategoryId ); |
417 if ( media ) |
437 if ( media ) |
418 { |
438 { |
419 secondRow = FormatCategorySecondRowLC( *media ); |
439 secondRow = FormatCategorySecondRowLC( *media ); |
422 { |
442 { |
423 secondRow = KNullDesC().AllocLC(); |
443 secondRow = KNullDesC().AllocLC(); |
424 } |
444 } |
425 } |
445 } |
426 break; |
446 break; |
|
447 case KCategoryIdLastWatched: |
|
448 { |
|
449 if ( LastWatchedSetL() ) |
|
450 { |
|
451 CMPXMedia* media = GetCategoryDataL( aCategoryId ); |
|
452 if ( media ) |
|
453 { |
|
454 secondRow = FormatCategorySecondRowLC( *media ); |
|
455 } |
|
456 else |
|
457 { |
|
458 secondRow = KNullDesC().AllocLC(); |
|
459 } |
|
460 } |
|
461 else |
|
462 { |
|
463 if ( PreloadedExistsL() ) |
|
464 { |
|
465 TBuf<KMyVideosTitleStringMaxLength> string; |
|
466 TInt error = iModel.GetMyVideosCustomizationString( |
|
467 KCRVideoPlayerPreloadedVideoDescription, string ); |
|
468 secondRow = error ? KNullDesC().AllocLC() : string.AllocLC(); |
|
469 } |
|
470 else |
|
471 { |
|
472 secondRow = KNullDesC().AllocLC(); |
|
473 } |
|
474 } |
|
475 } |
|
476 break; |
|
477 |
427 case KCategoryIdExtraItem1: |
478 case KCategoryIdExtraItem1: |
428 // ExtraItem1 is always interpreted as Ovi Store |
479 // ExtraItem1 is always interpreted as Ovi Store |
429 secondRow = StringLoader::LoadLC( R_VCXHGMYVIDEOS_OVI_STORE_VIDEOS ); |
480 secondRow = StringLoader::LoadLC( R_VCXHGMYVIDEOS_OVI_STORE_VIDEOS ); |
430 break; |
481 break; |
431 |
482 |
934 // |
985 // |
935 // ----------------------------------------------------------------------------- |
986 // ----------------------------------------------------------------------------- |
936 // |
987 // |
937 void CVcxHgMyVideosCategoryModelHandler::PlayLastWatchedVidedoL() |
988 void CVcxHgMyVideosCategoryModelHandler::PlayLastWatchedVidedoL() |
938 { |
989 { |
939 if ( iLastWatched && iLastWatched->IsSupported( KMPXMediaGeneralId ) ) |
990 if ( LastWatchedSetL() ) |
940 { |
991 { |
941 iModel.CollectionClient().PlayVideoL( |
992 if ( iLastWatched && iLastWatched->IsSupported( KMPXMediaGeneralId ) ) |
942 *iLastWatched->Value<TMPXItemId>( KMPXMediaGeneralId ) ); |
993 { |
943 |
994 iModel.CollectionClient().PlayVideoL( |
944 iModel.SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStatePlayer ); |
995 *iLastWatched->Value<TMPXItemId>( KMPXMediaGeneralId ) ); |
|
996 |
|
997 iModel.SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStatePlayer ); |
|
998 } |
945 } |
999 } |
946 else |
1000 else |
947 { |
1001 { |
948 // Refresh the list to remove the highlight. |
1002 if ( PreloadedExistsL() ) |
949 iScroller.DrawDeferred(); |
1003 { |
|
1004 CAknAppUi* appui = static_cast<CAknAppUi*>( CCoeEnv::Static()->AppUi() ); |
|
1005 |
|
1006 if ( appui ) |
|
1007 { |
|
1008 TBuf<KMaxPath> path; |
|
1009 TInt error = iModel.GetMyVideosCustomizationString( |
|
1010 KCRVideoPlayerPreloadedVideoPath, path ); |
|
1011 appui->OpenFileL( path ); |
|
1012 iModel.SetAppState( CVcxHgMyVideosModel::EVcxMyVideosAppStatePlayer ); |
|
1013 } |
|
1014 } |
950 } |
1015 } |
951 } |
1016 } |
952 |
1017 |
953 // ----------------------------------------------------------------------------- |
1018 // ----------------------------------------------------------------------------- |
954 // CVcxHgMyVideosVideoModelHandler::LoadLastWatchedIconL() |
1019 // CVcxHgMyVideosVideoModelHandler::LoadLastWatchedIconL() |
955 // |
1020 // |
956 // ----------------------------------------------------------------------------- |
1021 // ----------------------------------------------------------------------------- |
957 // |
1022 // |
958 void CVcxHgMyVideosCategoryModelHandler::LoadLastWatchedIconL() |
1023 void CVcxHgMyVideosCategoryModelHandler::LoadLastWatchedIconL() |
959 { |
1024 { |
960 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( |
1025 if ( LastWatchedSetL() ) |
961 iLastWatched->ValueText( KMPXMediaGeneralUri ), |
1026 { |
962 KNullDesC ); |
1027 if ( iLastWatched ) |
963 |
1028 { |
964 iTnRequestId = iTnManager.GetL( *source ); |
1029 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( |
965 CleanupStack::PopAndDestroy( source ); |
1030 iLastWatched->ValueText( KMPXMediaGeneralUri ), |
|
1031 KNullDesC ); |
|
1032 |
|
1033 iTnRequestId = iTnManager.GetL( *source ); |
|
1034 CleanupStack::PopAndDestroy( source ); |
|
1035 } |
|
1036 } |
|
1037 else |
|
1038 { |
|
1039 if ( PreloadedExistsL() ) |
|
1040 { |
|
1041 TBuf<KMaxPath> path; |
|
1042 TInt error = iModel.GetMyVideosCustomizationString( |
|
1043 KCRVideoPlayerPreloadedVideoPath, path ); |
|
1044 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( |
|
1045 path, |
|
1046 KNullDesC ); |
|
1047 |
|
1048 iTnRequestId = iTnManager.GetL( *source ); |
|
1049 CleanupStack::PopAndDestroy( source ); |
|
1050 } |
|
1051 } |
966 } |
1052 } |
967 |
1053 |
968 // ----------------------------------------------------------------------------- |
1054 // ----------------------------------------------------------------------------- |
969 // CVcxHgMyVideosVideoModelHandler::SetLastWatchedIndicatorL() |
1055 // CVcxHgMyVideosVideoModelHandler::SetLastWatchedIndicatorL() |
970 // |
1056 // |
1200 icon = CGulIcon::NewL( bitmap ); |
1286 icon = CGulIcon::NewL( bitmap ); |
1201 CleanupStack::Pop( bitmap ); |
1287 CleanupStack::Pop( bitmap ); |
1202 |
1288 |
1203 return icon; |
1289 return icon; |
1204 } |
1290 } |
|
1291 |
|
1292 // ----------------------------------------------------------------------------- |
|
1293 // CVcxHgMyVideosVideoModelHandler::LastWatchedSetL() |
|
1294 // ----------------------------------------------------------------------------- |
|
1295 // |
|
1296 TBool CVcxHgMyVideosCategoryModelHandler::LastWatchedSetL() |
|
1297 { |
|
1298 TInt id; |
|
1299 if ( !iModel.GetLastWatchedIdL( id ) && id ) |
|
1300 { |
|
1301 return ETrue; |
|
1302 } |
|
1303 else |
|
1304 { |
|
1305 return EFalse; |
|
1306 } |
|
1307 } |
|
1308 // ----------------------------------------------------------------------------- |
|
1309 // CVcxHgMyVideosVideoModelHandler::PreloadedExistsL() |
|
1310 // ----------------------------------------------------------------------------- |
|
1311 // |
|
1312 TBool CVcxHgMyVideosCategoryModelHandler::PreloadedExistsL() |
|
1313 { |
|
1314 TBuf<KMaxPath> path; |
|
1315 TInt error = iModel.GetMyVideosCustomizationString( KCRVideoPlayerPreloadedVideoPath, path ); |
|
1316 if ( !error && path.Length() && BaflUtils::FileExists( iModel.FileServerSessionL(), path ) ) |
|
1317 { |
|
1318 return ETrue; |
|
1319 } |
|
1320 else |
|
1321 { |
|
1322 return EFalse; |
|
1323 } |
|
1324 } |