mpxplugins/viewplugins/views/addtracksdialog/src/mpxaddtracksdialog.cpp
branchRCL_3
changeset 18 c54d95799c80
parent 5 2a40e88564c8
equal deleted inserted replaced
17:c8156a91d13c 18:c54d95799c80
    20 #include <eikclb.h>
    20 #include <eikclb.h>
    21 #include <eikclbd.h>
    21 #include <eikclbd.h>
    22 #include <eikimage.h>
    22 #include <eikimage.h>
    23 #include <eiktxlbx.h>
    23 #include <eiktxlbx.h>
    24 #include <aknappui.h>
    24 #include <aknappui.h>
    25 #include <aknnavi.h>
       
    26 #include <aknnavide.h>
       
    27 #include <akntitle.h>
    25 #include <akntitle.h>
    28 #include <akncontext.h>
    26 #include <akncontext.h>
    29 #include <aknlists.h>
    27 #include <aknlists.h>
    30 #include <aknsfld.h>
    28 #include <aknsfld.h>
    31 #include <gulicon.h>
    29 #include <gulicon.h>
    34 #include <StringLoader.h>
    32 #include <StringLoader.h>
    35 #include <aknnotewrappers.h>
    33 #include <aknnotewrappers.h>
    36 #include <e32base.h>
    34 #include <e32base.h>
    37 #include <barsread.h>
    35 #include <barsread.h>
    38 #include <bautils.h>
    36 #include <bautils.h>
    39 #include <aknnavilabel.h>
       
    40 #include <data_caging_path_literals.hrh>
    37 #include <data_caging_path_literals.hrh>
    41 #include <textresolver.h>
    38 #include <textresolver.h>
    42 
    39 
    43 #include <mpxlog.h>
    40 #include <mpxlog.h>
    44 #include <mpxcollectionutility.h>
    41 #include <mpxcollectionutility.h>
   142         delete iLastFindTxt;
   139         delete iLastFindTxt;
   143         }
   140         }
   144     iMatchedSongArray.Reset();
   141     iMatchedSongArray.Reset();
   145     iMatchedGroupArray.Reset();
   142     iMatchedGroupArray.Reset();
   146 
   143 
   147     delete iNaviDecorator;
       
   148     delete iOrigTitle;
   144     delete iOrigTitle;
   149     delete iNaviLabelPane;
       
   150     delete iListModel;
   145     delete iListModel;
   151     delete iNoSongText;
   146     delete iNoSongText;
   152     delete iNoMatchText;
   147     delete iNoMatchText;
   153 
   148 
   154     if( iPeriodic )
   149     if( iPeriodic )
   216 void CMPXAddTracksDialog::BackupPreviousStatusPaneL()
   211 void CMPXAddTracksDialog::BackupPreviousStatusPaneL()
   217     {
   212     {
   218     MPX_FUNC( "CMPXAddTracksDialog::BackupPreviousStatusPaneL" );
   213     MPX_FUNC( "CMPXAddTracksDialog::BackupPreviousStatusPaneL" );
   219     CEikStatusPane* sp = iAvkonAppUi->StatusPane();
   214     CEikStatusPane* sp = iAvkonAppUi->StatusPane();
   220 
   215 
   221     // Backup navi pane
       
   222     iNaviPane = static_cast<CAknNavigationControlContainer*>
       
   223         ( sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
       
   224     iOrigNaviPane = iNaviPane->Top();
       
   225 
       
   226     iNaviPane->PushDefaultL();
       
   227 
       
   228     // Backup title pane
   216     // Backup title pane
   229     iTitlePane = static_cast<CAknTitlePane*>
   217     iTitlePane = static_cast<CAknTitlePane*>
   230         ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
   218         ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
   231     iOrigTitle = iTitlePane->Text()->AllocL();
   219     iOrigTitle = iTitlePane->Text()->AllocL();
   232 
   220 
   251     MPX_FUNC( "CMPXAddTracksDialog::RestorePreviousStatusPaneL" );
   239     MPX_FUNC( "CMPXAddTracksDialog::RestorePreviousStatusPaneL" );
   252     if ( iOrigTitle )
   240     if ( iOrigTitle )
   253         {
   241         {
   254         // Set original title pane
   242         // Set original title pane
   255         iTitlePane->SetTextL( *iOrigTitle );
   243         iTitlePane->SetTextL( *iOrigTitle );
   256         }
       
   257 
       
   258     // Set original navi pane
       
   259     iNaviPane->Pop( iNaviLabelPane );
       
   260     if ( iOrigNaviPane )
       
   261         {
       
   262         iNaviPane->PushL( *iOrigNaviPane );
       
   263         }
       
   264     else
       
   265         {
       
   266         iNaviPane->PushDefaultL();
       
   267         }
   244         }
   268 
   245 
   269     // Restore original context icon
   246     // Restore original context icon
   270     if ( iOrigIcon )
   247     if ( iOrigIcon )
   271         {
   248         {
  1094 // -----------------------------------------------------------------------------
  1071 // -----------------------------------------------------------------------------
  1095 // CMPXAddTracksDialog::StopAnimL
  1072 // CMPXAddTracksDialog::StopAnimL
  1096 // Stop animation.
  1073 // Stop animation.
  1097 // -----------------------------------------------------------------------------
  1074 // -----------------------------------------------------------------------------
  1098 //
  1075 //
  1099 void CMPXAddTracksDialog::StopAnimL()
  1076 void CMPXAddTracksDialog::StopAnimL( TBool aHighlightCurrent )
  1100     {
  1077     {
       
  1078     MPX_FUNC( "CMPXAddTracksDialog::StopAnimL" );
  1101     if( ( iPeriodic->IsActive() ||
  1079     if( ( iPeriodic->IsActive() ||
  1102         iAnimIconIndex ==
  1080         iAnimIconIndex ==
  1103             CMPXAddTracksLbxArray::EMPXATLbxIconSongAddedAnim4 ) )
  1081             CMPXAddTracksLbxArray::EMPXATLbxIconSongAddedAnim4 ) )
  1104         {
  1082         {
  1105         iAnimIconIndex = 0;
  1083         iAnimIconIndex = 0;
  1106         iPeriodic->Cancel();
  1084         iPeriodic->Cancel();
  1107         iListModel->SetAnimationIconNum( iSelectIndex, 0 );
  1085         iListModel->SetAnimationIconNum( iSelectIndex, 0 );
  1108         TInt bottomIdx = iListBox->BottomItemIndex();
  1086         
  1109         TInt topIdx = iListBox->TopItemIndex();
  1087         // highlights the item pointed by iSelectIndex. 
  1110         if ( topIdx <= iSelectIndex && iSelectIndex <= bottomIdx )
  1088         // if Efalse, then iSelectIndex does not match to the tapped item but it is updated later when AddCurrentTractToPlaylistL is called.
  1111             {
  1089         if ( aHighlightCurrent )
  1112             HighlightListItem( iSelectIndex );
  1090             {
  1113             }
  1091             TInt bottomIdx = iListBox->BottomItemIndex();
  1114         // restore origional navi pane text
  1092             TInt topIdx = iListBox->TopItemIndex();
  1115         iNaviPane->Pop( iNaviLabelPane );
  1093             if ( topIdx <= iSelectIndex && iSelectIndex <= bottomIdx )
  1116         iNaviPane->PushDefaultL();
  1094                 {
       
  1095                 HighlightListItem( iSelectIndex );
       
  1096                 }
       
  1097             }
  1117         }
  1098         }
  1118     }
  1099     }
  1119 
  1100 
  1120 // ---------------------------------------------------------------------------
  1101 // ---------------------------------------------------------------------------
  1121 // load resources
  1102 // load resources
  1365         if (aError != KErrNotReady && aError != KErrArgument )
  1346         if (aError != KErrNotReady && aError != KErrArgument )
  1366             {
  1347             {
  1367             iCommonUiHelper->HandleErrorL( aError );
  1348             iCommonUiHelper->HandleErrorL( aError );
  1368             }
  1349             }
  1369         }
  1350         }
  1370     else
  1351     
  1371         {
       
  1372         // Song added text display in navi pane
       
  1373         iNaviPane->PushL( *iNaviDecorator );
       
  1374         }
       
  1375     CMPXMedia* media = (CMPXMedia*) aArgument;
  1352     CMPXMedia* media = (CMPXMedia*) aArgument;
  1376     delete media;
  1353     delete media;
  1377     MPX_DEBUG1("<--CMPXAddTracksDialog::HandleOperationCompleteL");
  1354     MPX_DEBUG1("<--CMPXAddTracksDialog::HandleOperationCompleteL");
  1378     }
  1355     }
  1379 
  1356 
  1435     // Enable speed scrolling
  1412     // Enable speed scrolling
  1436     iLbxExtFeat = CMPXLbxExtendedFeatures::NewL( iListBox, EFalse );
  1413     iLbxExtFeat = CMPXLbxExtendedFeatures::NewL( iListBox, EFalse );
  1437     iLbxExtFeat->EnableSpeedScrollL( ETrue );
  1414     iLbxExtFeat->EnableSpeedScrollL( ETrue );
  1438 
  1415 
  1439     CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
  1416     CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
  1440     iNaviPane = static_cast<CAknNavigationControlContainer*>
       
  1441                 ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
       
  1442     // read the navigation pane text resource
       
  1443     HBufC* text = StringLoader::LoadLC( R_MPX_CUI_ADDSONGS_SONG_ADDED );
       
  1444     iNaviDecorator = iNaviPane->CreateNavigationLabelL( *text );
       
  1445     CleanupStack::PopAndDestroy( text );
       
  1446 
  1417 
  1447     // Animation icon timer
  1418     // Animation icon timer
  1448     iPeriodic = CPeriodic::NewL( CActive::EPriorityIdle );
  1419     iPeriodic = CPeriodic::NewL( CActive::EPriorityIdle );
  1449 
  1420 
  1450     // Set empty text
  1421     // Set empty text
  1735 void CMPXAddTracksDialog::HandleListBoxEventL(
  1706 void CMPXAddTracksDialog::HandleListBoxEventL(
  1736     CEikListBox* /*aListBox*/,
  1707     CEikListBox* /*aListBox*/,
  1737     TListBoxEvent aEventType)
  1708     TListBoxEvent aEventType)
  1738     {
  1709     {
  1739     MPX_FUNC( "CMPXAddTracksDialog::HandleListBoxEventL" );
  1710     MPX_FUNC( "CMPXAddTracksDialog::HandleListBoxEventL" );
  1740     StopAnimL();
  1711     StopAnimL( EFalse );
  1741     if ( aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked
  1712     if ( aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked
  1742 #ifdef SINGLE_CLICK_INCLUDED
  1713 #ifdef SINGLE_CLICK_INCLUDED
  1743          || aEventType == EEventItemSingleClicked
  1714          || aEventType == EEventItemSingleClicked
  1744 #endif
  1715 #endif
  1745         )
  1716         )
  1765 				}
  1736 				}
  1766 			}
  1737 			}
  1767         }
  1738         }
  1768     else
  1739     else
  1769 	    {
  1740 	    {
  1770 	    iNaviPane->PushDefaultL();
       
  1771         UpdateSoftkeyL();
  1741         UpdateSoftkeyL();
  1772 	    }
  1742 	    }
  1773     }
  1743     }
  1774 
  1744 
  1775 // ---------------------------------------------------------------------------
  1745 // ---------------------------------------------------------------------------