480 case EFMRadioMusicStoreAmg: |
481 case EFMRadioMusicStoreAmg: |
481 case EFMRadioMusicStoreMusicPortl: |
482 case EFMRadioMusicStoreMusicPortl: |
482 isHandled = EFalse; |
483 isHandled = EFalse; |
483 break; |
484 break; |
484 case EFMRadioMusicStoreNokiaMusicShop: |
485 case EFMRadioMusicStoreNokiaMusicShop: |
485 searchString = NokiaMusicShopSearchLC( aTitle, aArtist, aAlbum ); |
486 searchString.Assign( NokiaMusicShopSearchL( aTitle, aArtist, aAlbum ) ); |
486 break; |
487 break; |
487 case EFMRadioMusicStoreOperator: |
488 case EFMRadioMusicStoreOperator: |
488 if ( iOperatorStoreWebsite.Length() != 0 ) |
489 if ( iOperatorStoreWebsite.Length() != 0 ) |
489 { |
490 { |
490 searchString = iOperatorStoreWebsite.AllocLC(); |
491 searchString.CreateL( iOperatorStoreWebsite ); |
491 |
|
492 } |
492 } |
493 else if ( iOperatorStoreNativeUID ) |
493 else if ( iOperatorStoreNativeUID ) |
494 { |
494 { |
495 // It is assumed that both Nokia Music Shop and operator specific music store use |
495 // It is assumed that both Nokia Music Shop and operator specific music store use |
496 // same kind of interface to communicate |
496 // same kind of interface to communicate |
497 searchString = NokiaMusicShopSearchLC( aTitle, aArtist, aAlbum ); |
497 searchString.Assign( NokiaMusicShopSearchL( aTitle, aArtist, aAlbum ) ); |
498 } |
498 } |
499 else |
499 else |
500 { |
500 { |
501 isHandled = EFalse; |
501 isHandled = EFalse; |
502 } |
502 } |
512 switch( aCommandId ) |
512 switch( aCommandId ) |
513 { |
513 { |
514 case EFMRadioMusicStoreNokiaMusicShop: |
514 case EFMRadioMusicStoreNokiaMusicShop: |
515 { |
515 { |
516 TUid musicshopUid( TUid::Uid( iMusicStoreUID ) ); |
516 TUid musicshopUid( TUid::Uid( iMusicStoreUID ) ); |
517 LaunchMusicShopL( musicshopUid, *searchString ); |
517 LaunchMusicShopL( musicshopUid, searchString ); |
518 break; |
518 break; |
519 } |
519 } |
520 case EFMRadioMusicStoreOperator: |
520 case EFMRadioMusicStoreOperator: |
521 LaunchOperatorMusicStoreL( *searchString ); |
521 LaunchOperatorMusicStoreL( searchString ); |
522 break; |
522 break; |
523 default: |
523 default: |
524 LaunchWebPageL( *searchString ); |
524 LaunchWebPageL( searchString ); |
525 break; |
525 break; |
526 } |
526 } |
527 CleanupStack::PopAndDestroy( searchString ); |
527 CleanupStack::PopAndDestroy( &searchString ); |
528 } |
528 } |
529 } |
529 } |
530 |
530 |
531 // ----------------------------------------------------------------------------- |
531 // ----------------------------------------------------------------------------- |
532 // CFMRadioMusicStoreHandler::LaunchOperatorMusicStoreL |
532 // CFMRadioMusicStoreHandler::LaunchOperatorMusicStoreL |
553 |
553 |
554 // ----------------------------------------------------------------------------- |
554 // ----------------------------------------------------------------------------- |
555 // CFMRadioMusicStoreHandler::NokiaMusicShopSearchL |
555 // CFMRadioMusicStoreHandler::NokiaMusicShopSearchL |
556 // ----------------------------------------------------------------------------- |
556 // ----------------------------------------------------------------------------- |
557 // |
557 // |
558 HBufC* CFMRadioMusicStoreHandler::NokiaMusicShopSearchLC( |
558 HBufC* CFMRadioMusicStoreHandler::NokiaMusicShopSearchL( |
559 const TDesC& aSongName, |
559 const TDesC& aSongName, |
560 const TDesC& aArtistName, |
560 const TDesC& aArtistName, |
561 const TDesC& aAlbumName ) |
561 const TDesC& aAlbumName ) |
562 { |
562 { |
563 CMPXFindInMShop* finder = CMPXFindInMShop::NewL(); //ECom Plugin |
563 HBufC* url = NULL; |
564 CleanupStack::PushL( finder ); |
564 |
565 HBufC* url = finder->CreateSearchURLL( aSongName, |
565 if ( aSongName.Length() || aArtistName.Length() || aAlbumName.Length() ) |
566 aArtistName, |
566 { |
567 aAlbumName, |
567 CMPXFindInMShop* finder = CMPXFindInMShop::NewL(); //ECom Plugin |
568 KNullDesC, // Composer - Not used |
568 CleanupStack::PushL( finder ); |
569 KNullDesC ); // Genre - Not used |
569 url = finder->CreateSearchURLL( aSongName, |
570 |
570 aArtistName, |
571 CleanupStack::PopAndDestroy( finder ); // finder |
571 aAlbumName, |
572 REComSession::FinalClose(); |
572 KNullDesC, // Composer - Not used |
573 CleanupStack::PushL( url ); |
573 KNullDesC ); // Genre - Not used |
|
574 |
|
575 CleanupStack::PopAndDestroy( finder ); // finder |
|
576 REComSession::FinalClose(); |
|
577 } |
|
578 |
574 return url; |
579 return url; |
575 } |
580 } |
576 |
581 |
577 // ----------------------------------------------------------------------------- |
582 // ----------------------------------------------------------------------------- |
578 // CFMRadioMusicStoreHandler::LaunchMusicShopL |
583 // CFMRadioMusicStoreHandler::LaunchMusicShopL |
579 // Launch Nokia music shop application |
584 // Launch Nokia music shop application |
580 // ----------------------------------------------------------------------------- |
585 // ----------------------------------------------------------------------------- |
581 // |
586 // |
582 void CFMRadioMusicStoreHandler::LaunchMusicShopL( TUid aMusicshopUid, const TDesC& aSearchString ) |
587 void CFMRadioMusicStoreHandler::LaunchMusicShopL( TUid aMusicshopUid, const TDesC& aSearchString ) |
583 { |
588 { |
584 RProperty::Set( aMusicshopUid, |
589 if ( aSearchString.Length() ) |
585 KMShopCategoryName, |
590 { |
586 aSearchString ); |
591 RProperty::Set( aMusicshopUid, |
587 |
592 KMShopCategoryName, |
588 RProperty::Set( aMusicshopUid, |
593 aSearchString ); |
589 KMShopCategoryId, |
594 |
590 KFindInMShopKeyValid ); // Set Key to Valid |
595 RProperty::Set( aMusicshopUid, |
|
596 KMShopCategoryId, |
|
597 KFindInMShopKeyValid ); // Set Key to Valid |
|
598 } |
591 |
599 |
592 TApaTaskList taskList( iCoeEnv->WsSession() ); |
600 TApaTaskList taskList( iCoeEnv->WsSession() ); |
593 TApaTask task = taskList.FindApp( aMusicshopUid ); |
601 TApaTask task = taskList.FindApp( aMusicshopUid ); |
594 |
602 |
595 if ( task.Exists() ) |
603 if ( task.Exists() ) |