mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewimp.cpp
branchRCL_3
changeset 21 cb96c29156b2
parent 15 a1247965635c
equal deleted inserted replaced
19:a12246c97fcc 21:cb96c29156b2
   123 const TInt KMPXLastDirectoryLevel( 2 );
   123 const TInt KMPXLastDirectoryLevel( 2 );
   124 //#endif //__UPNP_FRAMEWORK_2_0_
   124 //#endif //__UPNP_FRAMEWORK_2_0_
   125 // MACROS
   125 // MACROS
   126 _LIT(KMPXCollDetailsItemsFormat, "%S\t%S");
   126 _LIT(KMPXCollDetailsItemsFormat, "%S\t%S");
   127 
   127 
       
   128 _LIT(KEmptyTitle, " ");
       
   129 
   128 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
   130 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
   129 #define KMusicCollectionUid 0x101FFC3A
   131 #define KMusicCollectionUid 0x101FFC3A
   130 #endif
   132 #endif
   131 
   133 
   132 // ======== MEMBER FUNCTIONS ========
   134 // ======== MEMBER FUNCTIONS ========
   174         iPlaybackUtility->Close();
   176         iPlaybackUtility->Close();
   175         }
   177         }
   176 
   178 
   177     if (iViewUtility)
   179     if (iViewUtility)
   178         {
   180         {
       
   181         iViewUtility->RemoveObserver( this );
   179         iViewUtility->Close();
   182         iViewUtility->Close();
   180         }
   183         }
   181 
   184 
   182     if (iCollectionUiHelper)
   185     if (iCollectionUiHelper)
   183         {
   186         {
   487 
   490 
   488     // used to know if HandleOpen was called -> we cannot update the playback
   491     // used to know if HandleOpen was called -> we cannot update the playback
   489     // status of listbox items before the list box is updated in HandleOpen
   492     // status of listbox items before the list box is updated in HandleOpen
   490     iHandleOpenProcessed = EFalse;
   493     iHandleOpenProcessed = EFalse;
   491     iSelectedItem = KMPXInvalidItemId;
   494     iSelectedItem = KMPXInvalidItemId;
       
   495     iGoToNowPlaying = EFalse;
   492     }
   496     }
   493 
   497 
   494 // ---------------------------------------------------------------------------
   498 // ---------------------------------------------------------------------------
   495 // Updates list box
   499 // Updates list box
   496 // ---------------------------------------------------------------------------
   500 // ---------------------------------------------------------------------------
   660             if (iTitle)
   664             if (iTitle)
   661                 {
   665                 {
   662                 MPX_DEBUG2("CMPXPodcastCollectionViewImp::UpdateTitlePaneL Title is %S", iTitle);
   666                 MPX_DEBUG2("CMPXPodcastCollectionViewImp::UpdateTitlePaneL Title is %S", iTitle);
   663                 if (iTitle->Length() == 0)
   667                 if (iTitle->Length() == 0)
   664                     {
   668                     {
   665                     HBufC* titleText = StringLoader::LoadLC(R_MPX_QTN_NMP_UNKNOWN_TITLE);
   669                     HBufC* titleText = StringLoader::LoadLC(R_MPX_TITLE_UNKNOWN_PODCAST);
   666                     title->SetTextL(*titleText);
   670                     title->SetTextL(*titleText);
   667                     CleanupStack::PopAndDestroy(titleText);
   671                     CleanupStack::PopAndDestroy(titleText);
   668                     }
   672                     }
   669                 else
   673                 else
   670                     {
   674                     {
  3087 #endif // __ENABLE_MSK
  3091 #endif // __ENABLE_MSK
  3088             break;
  3092             break;
  3089             }
  3093             }
  3090         case EMPXCmdGoToNowPlaying:
  3094         case EMPXCmdGoToNowPlaying:
  3091             {
  3095             {
       
  3096             iGoToNowPlaying = ETrue;
  3092             AppUi()->HandleCommandL( aCommand );
  3097             AppUi()->HandleCommandL( aCommand );
  3093             break;
  3098             break;
  3094             }
  3099             }
  3095         case EMPXCmdAddSongs:
  3100         case EMPXCmdAddSongs:
  3096             {
  3101             {
  3552         {
  3557         {
  3553         delete iNumEpisode;
  3558         delete iNumEpisode;
  3554         iNumEpisode = NULL;
  3559         iNumEpisode = NULL;
  3555         TRAP_IGNORE(UpdateNaviPaneL());
  3560         TRAP_IGNORE(UpdateNaviPaneL());
  3556         }
  3561         }
       
  3562 	// for Avkon calling Deactivate, not manually hiding controls, reset iGoToNowPlaying
       
  3563     iGoToNowPlaying = EFalse;
  3557     }
  3564     }
  3558 
  3565 
  3559 // ---------------------------------------------------------------------------
  3566 // ---------------------------------------------------------------------------
  3560 // From CAknView
  3567 // From CAknView
  3561 // Foreground event handling function.
  3568 // Foreground event handling function.
  3936 
  3943 
  3937                 CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
  3944                 CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
  3938                 CleanupStack::PushL(cpath);
  3945                 CleanupStack::PushL(cpath);
  3939 
  3946 
  3940                 MPX_DEBUG_PATH(*cpath);
  3947                 MPX_DEBUG_PATH(*cpath);
       
  3948                 
       
  3949 				// It is in episode list view and opens now playing view
       
  3950                 if ( cpath->Levels() == 3 )
       
  3951                     iGoToNowPlaying = ETrue;
       
  3952                 
  3941                 if (cpath->Levels() == (iLastDepth + 1))
  3953                 if (cpath->Levels() == (iLastDepth + 1))
  3942                     {
  3954                     {
  3943                     // navigated in one level
  3955                     // navigated in one level
  3944                     iLastDepth++;
  3956                     iLastDepth++;
  3945                     iBottomIndex->AppendL(
  3957                     iBottomIndex->AppendL(
  4237     {
  4249     {
  4238     MPX_FUNC( "CMPXPodcastCollectionViewImp::HandleViewActivation" );
  4250     MPX_FUNC( "CMPXPodcastCollectionViewImp::HandleViewActivation" );
  4239     if ( aCurrentViewType.iUid == KMPXPluginTypeCollectionUid )
  4251     if ( aCurrentViewType.iUid == KMPXPluginTypeCollectionUid )
  4240         {
  4252         {
  4241         TRAP_IGNORE( UpdateNaviPaneL() );
  4253         TRAP_IGNORE( UpdateNaviPaneL() );
  4242         }
  4254         } 
       
  4255     else if ( ( aCurrentViewType.iUid == KMPXPluginTypePlaybackUid ) && ( iGoToNowPlaying == EFalse ) ) 
       
  4256         {
       
  4257         if ( iContainer )
       
  4258             {
       
  4259             iContainer->HideContainerWindow();
       
  4260                     
       
  4261             // set title to blank to avoid title flickering
       
  4262             CAknTitlePane* title( static_cast<CAknTitlePane*>
       
  4263                 ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ))));
       
  4264             if ( title )
       
  4265                 {
       
  4266                 title->SetTextL(KEmptyTitle); 
       
  4267                 title->DrawNow();
       
  4268                 }
       
  4269             }
       
  4270      	}   
  4243     }
  4271     }
  4244 
  4272 
  4245 // -----------------------------------------------------------------------------
  4273 // -----------------------------------------------------------------------------
  4246 // CMPXPodcastCollectionViewImp::HandleViewActivation
  4274 // CMPXPodcastCollectionViewImp::HandleViewActivation
  4247 // -----------------------------------------------------------------------------
  4275 // -----------------------------------------------------------------------------