mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp
branchRCL_3
changeset 31 a12246c97fcc
parent 28 56b11cf8addb
child 40 cb96c29156b2
equal deleted inserted replaced
28:56b11cf8addb 31:a12246c97fcc
   504 //
   504 //
   505 TKeyResponse CMPXCollectionViewHgContainer::OfferKeyEventL(
   505 TKeyResponse CMPXCollectionViewHgContainer::OfferKeyEventL(
   506     const TKeyEvent& aKeyEvent,
   506     const TKeyEvent& aKeyEvent,
   507     TEventCode aType )
   507     TEventCode aType )
   508     {
   508     {
   509     MPX_DEBUG4( "CMPXCollectionViewHgContainer::HandleKeyEventL(iCode=%d, iScanCode=%d, aType=%d)",
   509     MPX_DEBUG4( "CMPXCollectionViewHgContainer::OfferKeyEventL(iCode=%d, iScanCode=%d, aType=%d)",
   510         aKeyEvent.iCode, aKeyEvent.iScanCode, aType );
   510         aKeyEvent.iCode, aKeyEvent.iScanCode, aType );
   511 
   511 
   512     if ( aKeyEvent.iCode == EKeyUpArrow ||
   512     if ( aKeyEvent.iCode == EKeyUpArrow ||
   513         aKeyEvent.iCode == EKeyPrevious )
   513         aKeyEvent.iCode == EKeyPrevious )
   514         {
   514         {
   574     {
   574     {
   575     MPX_DEBUG5( "CMPXCollectionViewHgContainer::HandleKeyEventL(iCode=%d, iScanCode=%d, iModifiers=0x%x, aType=%d)",
   575     MPX_DEBUG5( "CMPXCollectionViewHgContainer::HandleKeyEventL(iCode=%d, iScanCode=%d, iModifiers=0x%x, aType=%d)",
   576         aKeyEvent.iCode, aKeyEvent.iScanCode, aKeyEvent.iModifiers, aType );
   576         aKeyEvent.iCode, aKeyEvent.iScanCode, aKeyEvent.iModifiers, aType );
   577 
   577 
   578     TKeyResponse response( EKeyWasNotConsumed );
   578     TKeyResponse response( EKeyWasNotConsumed );
   579     if ( aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter )
   579 
   580         {
   580     CHgScroller* list = CurrentListWidget();
   581             SaveSelectedAlbumItemL(iAlbumIndex);
   581     if ( list )
       
   582         {
       
   583         response = list->OfferKeyEventL( aKeyEvent, aType );
       
   584         }
       
   585     if ( response == EKeyWasNotConsumed && iMediaWall )
       
   586         {
       
   587         response = iMediaWall->OfferKeyEventL( aKeyEvent, aType );
       
   588 		// Softkeys are hidden when left/right keys are used in mediawall.
       
   589         if ( response == EKeyWasConsumed && iCurrentViewType == EMPXViewMediawall )
       
   590         	{
       
   591 			if( iCbaHandler )
       
   592 				iCbaHandler->ChangeCbaVisibility( EFalse );
       
   593 			}
       
   594         }
       
   595 
       
   596 	// When LSK is pressed, make the softkeys visible.
       
   597 	if ( response == EKeyWasNotConsumed && aKeyEvent.iCode == EKeyDevice0 )
       
   598 		{
       
   599 		if( iCbaHandler )
       
   600 			iCbaHandler->ChangeCbaVisibility( ETrue );
       
   601 		}
       
   602 
       
   603     if ( response == EKeyWasNotConsumed &&
       
   604    		 (aKeyEvent.iCode == EKeyOK ||
       
   605    		  aKeyEvent.iCode == EKeyEnter ) )
       
   606         {
   582         // Handle enter key pressed
   607         // Handle enter key pressed
   583         iView->ProcessCommandL( EMPXCmdCommonEnterKey );
   608         iView->ProcessCommandL( EMPXCmdCommonEnterKey );
   584         }
       
   585     if ( iListWidget )
       
   586         {
       
   587         iListWidget->OfferKeyEventL( aKeyEvent, aType );
       
   588         }
       
   589     else if( iMediaWall )
       
   590         {
       
   591         iMediaWall->OfferKeyEventL( aKeyEvent, aType );
       
   592         }
   609         }
   593     if ( response == EKeyWasNotConsumed &&
   610     if ( response == EKeyWasNotConsumed &&
   594          aType == EEventKey &&
   611          aType == EEventKey &&
   595          aKeyEvent.iCode == EKeyBackspace && iView )
   612          aKeyEvent.iCode == EKeyBackspace && iView )
   596         {
   613         {
  2661 // avoid too many redraws. In some cases, multiple refresh is unavoidable.
  2678 // avoid too many redraws. In some cases, multiple refresh is unavoidable.
  2662 // ---------------------------------------------------------------------------
  2679 // ---------------------------------------------------------------------------
  2663 //
  2680 //
  2664 void CMPXCollectionViewHgContainer::RefreshL(TInt aDisplayIndex)
  2681 void CMPXCollectionViewHgContainer::RefreshL(TInt aDisplayIndex)
  2665     {
  2682     {
  2666     if( !iIsForeground )
       
  2667         {
       
  2668         return;
       
  2669         }
       
  2670 
       
  2671     MPX_FUNC( "CMPXCollectionViewHgContainer::Refresh" );
  2683     MPX_FUNC( "CMPXCollectionViewHgContainer::Refresh" );
  2672 
  2684 
  2673 	TInt mediaCount = iListBoxArray->MediaArray().Count();
  2685 	TInt mediaCount = iListBoxArray->MediaArray().Count();
  2674 	TInt displayCount = mediaCount + iShuffleItem;
  2686 	TInt displayCount = mediaCount + iShuffleItem;
  2675 
  2687 
  5156     CMpxPopupList* dialog = CMpxPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
  5168     CMpxPopupList* dialog = CMpxPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
  5157             AknPopupLayouts::EDynMenuWindow );
  5169             AknPopupLayouts::EDynMenuWindow );
  5158 
  5170 
  5159     CleanupStack::PushL( dialog );
  5171     CleanupStack::PushL( dialog );
  5160 
  5172 
  5161     listBox->ConstructL( dialog,
  5173     listBox->ConstructL( dialog, EAknListBoxViewerFlags );
  5162             EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded  );
  5174     
  5163 
       
  5164     // title can be hardcoded because it is not shown to user. Just for the calculations.
  5175     // title can be hardcoded because it is not shown to user. Just for the calculations.
  5165     dialog->SetTitleL(_L("Foo"));
  5176     dialog->SetTitleL(_L("Foo"));
  5166     iPopupListRect = dialog->LayoutRect();
  5177     iPopupListRect = dialog->LayoutRect();
  5167 
  5178 
  5168     CleanupStack::PopAndDestroy( dialog );
  5179     CleanupStack::PopAndDestroy( dialog );