104 isHiddenFromFS = ETrue; |
104 isHiddenFromFS = ETrue; |
105 FeatureManager::InitializeLibL(); |
105 FeatureManager::InitializeLibL(); |
106 iIsKastorEffectStarted = EFalse; |
106 iIsKastorEffectStarted = EFalse; |
107 StartLayoutSwitchFullScreen( AknTransEffect::EApplicationStart ); |
107 StartLayoutSwitchFullScreen( AknTransEffect::EApplicationStart ); |
108 |
108 |
109 RefreshUiPanesL( ETrue ); |
|
110 Cba()->MakeVisible( EFalse ); |
109 Cba()->MakeVisible( EFalse ); |
|
110 StatusPane()->MakeVisible( EFalse ); |
111 StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); |
111 StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); |
112 |
112 |
113 iDummyTemplateLib = CMmTemplateLibrary::NewL(); |
113 iDummyTemplateLib = CMmTemplateLibrary::NewL(); |
114 iDummyContainer = CMmWidgetContainer::NewGridContainerL( ClientRect(), |
114 iDummyContainer = CMmWidgetContainer::NewGridContainerL( ClientRect(), |
115 this, iDummyTemplateLib ); |
115 this, iDummyTemplateLib ); |
338 iDummyContainer->MakeVisible( ETrue ); |
338 iDummyContainer->MakeVisible( ETrue ); |
339 RefreshUiPanesL( ETrue ); |
339 RefreshUiPanesL( ETrue ); |
340 iCurrentContainer->MakeVisible( EFalse ); |
340 iCurrentContainer->MakeVisible( EFalse ); |
341 iDummyContainer->DrawNow(); |
341 iDummyContainer->DrawNow(); |
342 } |
342 } |
343 CleanupForExitL( EExitKeyApplication ); |
343 CleanupForExitL( ECommingFromBackground ); |
344 User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( |
344 User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( |
345 CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); |
345 CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); |
346 iAppkeyHandler->StartL(); |
346 iAppkeyHandler->StartL(); |
347 } |
347 } |
348 } |
348 } |
492 { |
492 { |
493 DEBUG(("_Mm_:CMmAppUi::HandleBackCommandL IN")); |
493 DEBUG(("_Mm_:CMmAppUi::HandleBackCommandL IN")); |
494 MMPERF(("CMmAppUi::HandleBackCommandL - START")); |
494 MMPERF(("CMmAppUi::HandleBackCommandL - START")); |
495 DEBUG16(("\t_Mm_:current genre: %S",&iCurrentSuiteModel->SuiteName())); |
495 DEBUG16(("\t_Mm_:current genre: %S",&iCurrentSuiteModel->SuiteName())); |
496 |
496 |
497 iDummyContainer->MakeVisible( ETrue ); |
|
498 RefreshUiPanesL( ETrue ); |
|
499 iCurrentContainer->MakeVisible( EFalse ); |
|
500 iDummyContainer->DrawNow(); |
|
501 |
|
502 iHNInterface->HandleBackEventL( iCurrentSuiteModel->SuiteName() ); |
497 iHNInterface->HandleBackEventL( iCurrentSuiteModel->SuiteName() ); |
503 |
498 |
504 MMPERF(("CMmAppUi::HandleBackCommandL - DONE")); |
499 MMPERF(("CMmAppUi::HandleBackCommandL - DONE")); |
505 DEBUG(("_Mm_:CMmAppUi::HandleBackCommandL OUT")); |
500 DEBUG(("_Mm_:CMmAppUi::HandleBackCommandL OUT")); |
506 } |
501 } |
1021 { |
1016 { |
1022 MMPERF(("CMmAppUi::HandleDragStartL - START")); |
1017 MMPERF(("CMmAppUi::HandleDragStartL - START")); |
1023 |
1018 |
1024 if ( IsEditMode() ) |
1019 if ( IsEditMode() ) |
1025 { |
1020 { |
1026 |
|
1027 TInt modelId = iCurrentSuiteModel->IdByIndex( aModelItemIndex ); |
1021 TInt modelId = iCurrentSuiteModel->IdByIndex( aModelItemIndex ); |
1028 if (modelId != KErrNotFound) |
1022 if (modelId != KErrNotFound) |
1029 { |
1023 { |
1030 CHnItemModel *itModel = iCurrentSuiteModel->GetItemModel( modelId ); |
1024 CHnItemModel *itModel = iCurrentSuiteModel->GetItemModel( modelId ); |
1031 if (itModel->GetItemType() == EItemTypeParentFolder) |
1025 if (itModel->GetItemType() == EItemTypeParentFolder) |
1821 TBool highlightVisibleBefore = |
1815 TBool highlightVisibleBefore = |
1822 iCurrentContainer && |
1816 iCurrentContainer && |
1823 aWidgetContainer && |
1817 aWidgetContainer && |
1824 iCurrentContainer->IsHighlightVisible() && |
1818 iCurrentContainer->IsHighlightVisible() && |
1825 iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType(); |
1819 iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType(); |
|
1820 |
|
1821 if( iCurrentContainer && !highlightVisibleBefore ) |
|
1822 { |
|
1823 iCurrentContainer->SetHighlightVisibilityL( EFalse ); |
|
1824 } |
1826 |
1825 |
1827 HandleWidgetChangeRefreshL( aWidgetContainer ); |
1826 HandleWidgetChangeRefreshL( aWidgetContainer ); |
1828 |
1827 |
1829 if ( highlightVisibleBefore ) |
1828 if ( highlightVisibleBefore ) |
1830 { |
1829 { |
2375 // |
2374 // |
2376 // --------------------------------------------------------------------------- |
2375 // --------------------------------------------------------------------------- |
2377 // |
2376 // |
2378 void CMmAppUi::HandleSuiteModelInitializedL( CHnSuiteModel* aModel ) |
2377 void CMmAppUi::HandleSuiteModelInitializedL( CHnSuiteModel* aModel ) |
2379 { |
2378 { |
2380 |
|
2381 StatusPane()->MakeVisible( ETrue ); |
2379 StatusPane()->MakeVisible( ETrue ); |
2382 Cba()->MakeVisible( ETrue ); |
2380 Cba()->MakeVisible( ETrue ); |
2383 if ( aModel == iHNInterface->GetLastSuiteModelL() ) |
2381 if ( aModel == iHNInterface->GetLastSuiteModelL() ) |
2384 { |
2382 { |
2385 TBool showOpenFolderEffect(iCurrentSuiteModel |
2383 TBool showOpenFolderEffect(iCurrentSuiteModel |
2494 { |
2492 { |
2495 DEBUG(("\t_Mm_:Edit Mode turned off")); |
2493 DEBUG(("\t_Mm_:Edit Mode turned off")); |
2496 iCurrentContainer->CancelDragL( EFalse ); |
2494 iCurrentContainer->CancelDragL( EFalse ); |
2497 SetEditModeL( EFalse ); |
2495 SetEditModeL( EFalse ); |
2498 } |
2496 } |
2499 |
2497 |
|
2498 THnSuiteWidgetType widgetType = iCurrentContainer |
|
2499 ? iCurrentContainer->WidgetType() : EUnspecified; |
|
2500 |
2500 // reset model - revert to root if current view is not a suite view |
2501 // reset model - revert to root if current view is not a suite view |
2501 CHnSuiteModel* model = iHNInterface->GetLastSuiteModelL(); |
2502 CHnSuiteModel* model = iHNInterface->GetLastSuiteModelL(); |
2502 if ( model && aExitKey == EExitKeyApplication ) |
2503 |
|
2504 TBool commingFromBackground( aExitKey == ECommingFromBackground ); |
|
2505 |
|
2506 if( model && ( aExitKey == EExitKeyApplication || commingFromBackground ) ) |
2503 { |
2507 { |
2504 TBool topSuiteIsBeingEvaluated = |
2508 TBool topSuiteIsBeingEvaluated = |
2505 !model->GetItemsOrder()->IsSuiteReadyToShow(); |
2509 !model->GetItemsOrder()->IsSuiteReadyToShow(); |
2506 TBool topSuiteChanged = ResetToRootL(); |
2510 TBool topSuiteChanged = ResetToRootL(); |
2507 model = NULL; // ResetToRootL might have deleted the model |
2511 model = NULL; // ResetToRootL might have deleted the model |
2508 TBool presentationChangeExpected = topSuiteChanged || topSuiteIsBeingEvaluated; |
2512 TBool presentationChangeExpected = topSuiteChanged || topSuiteIsBeingEvaluated; |
2509 |
2513 |
2510 TBool mustDrawImmediately = |
2514 |
2511 !presentationChangeExpected || !iDummyContainer->IsVisible(); |
2515 TBool mustDrawImmediately = !presentationChangeExpected |
2512 |
2516 || !iDummyContainer->IsVisible() || commingFromBackground; |
2513 if ( iCurrentContainer && mustDrawImmediately ) |
2517 |
2514 { |
2518 if( iCurrentContainer ) |
2515 DEBUG(("\t_Mm_:Top item index reset")); |
2519 { |
2516 iCurrentContainer->ResetWidgetPosition(); |
2520 if( commingFromBackground ) |
2517 iCurrentContainer->Widget()->UpdateScrollBarsL(); |
2521 { |
2518 iCurrentContainer->MakeVisible( ETrue ); |
2522 //do not draw the widget if the previous widget type is diffenernt than the current one |
2519 iCurrentContainer->DrawNow(); |
2523 mustDrawImmediately &= ( widgetType |
|
2524 == iCurrentContainer->WidgetType() ); |
|
2525 |
|
2526 iCurrentContainer->SetWidgetCommingFromBackground( ETrue ); |
|
2527 } |
|
2528 |
|
2529 if( mustDrawImmediately ) |
|
2530 { |
|
2531 DEBUG(("\t_Mm_:Top item index reset")); |
|
2532 iCurrentContainer->ResetWidgetPosition(); |
|
2533 iCurrentContainer->Widget()->UpdateScrollBarsL(); |
|
2534 iCurrentContainer->MakeVisible( ETrue ); |
|
2535 iCurrentContainer->DrawNow(); |
|
2536 iCurrentContainer->SetWidgetCommingFromBackground( EFalse ); |
|
2537 } |
2520 } |
2538 } |
2521 } |
2539 } |
2522 |
2540 |
2523 DEBUG(("_Mm_:CMmAppUi::CleanupForExitL - OUT")); |
2541 DEBUG(("_Mm_:CMmAppUi::CleanupForExitL - OUT")); |
2524 } |
2542 } |
2802 iCurrentSuiteModel->SuiteName(), |
2821 iCurrentSuiteModel->SuiteName(), |
2803 iHNInterface->GetSuiteModelsCountL() - 1 ); |
2822 iHNInterface->GetSuiteModelsCountL() - 1 ); |
2804 ResetContainerMapToRootL(); |
2823 ResetContainerMapToRootL(); |
2805 if( iCurrentContainer ) |
2824 if( iCurrentContainer ) |
2806 { |
2825 { |
|
2826 const TInt FirstItemIndex = 0; |
|
2827 iCurrentContainer->GetSuiteModelL()->SetSuiteHighlightL( FirstItemIndex ); |
|
2828 iMakeHightlightedItemFullyVisible = ETrue; |
2807 iCurrentContainer->ResetWidgetPosition(); |
2829 iCurrentContainer->ResetWidgetPosition(); |
|
2830 iCurrentContainer->SetEditModeL( EFalse ); |
2808 AddToStackL( iCurrentContainer ); |
2831 AddToStackL( iCurrentContainer ); |
2809 } |
2832 } |
2810 RefreshUiPanesL( ETrue ); |
2833 RefreshUiPanesL( ETrue ); |
2811 resetConsumed = ETrue; |
2834 resetConsumed = ETrue; |
2812 } |
2835 } |
3033 { |
3056 { |
3034 HideApplicationFromFSW( EFalse ); |
3057 HideApplicationFromFSW( EFalse ); |
3035 isHiddenFromFS = EFalse; |
3058 isHiddenFromFS = EFalse; |
3036 } |
3059 } |
3037 |
3060 |
3038 if (iCurrentContainer && iCurrentSuiteModel ) |
3061 if( iCurrentContainer && iCurrentSuiteModel ) |
3039 { |
3062 { |
3040 iCurrentContainer->HandleForegroundGainedL(); |
3063 iCurrentContainer->HandleForegroundGainedL(); |
3041 iDummyContainer->MakeVisible( EFalse ); |
3064 iDummyContainer->MakeVisible( EFalse ); |
3042 iCurrentContainer->MakeVisible( ETrue ); |
3065 iCurrentContainer->MakeVisible( ETrue ); |
3043 RefreshUiPanesL(); |
3066 RefreshUiPanesL(); |
3044 } |
3067 } |
3045 if (iSkinChangeNeeded && !iSkinChangeInProgress) |
3068 if( iSkinChangeNeeded && !iSkinChangeInProgress ) |
3046 { |
3069 { |
3047 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
3070 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
3048 if (skinInstance && !skinInstance->IsUpdateInProgress()) |
3071 if( skinInstance && !skinInstance->IsUpdateInProgress() ) |
3049 { |
3072 { |
3050 RefreshIconsL(); |
3073 RefreshIconsL(); |
3051 |
3074 } |
3052 } |
3075 } |
3053 } |
3076 } |
3054 } |
|
3055 |
3077 |
3056 // --------------------------------------------------------------------------- |
3078 // --------------------------------------------------------------------------- |
3057 // |
3079 // |
3058 // --------------------------------------------------------------------------- |
3080 // --------------------------------------------------------------------------- |
3059 // |
3081 // |