94 |
94 |
95 TInt appUiFlags = AknLayoutUtils::PenEnabled() ? |
95 TInt appUiFlags = AknLayoutUtils::PenEnabled() ? |
96 EAknEnableSkin | EAknSingleClickCompatible : |
96 EAknEnableSkin | EAknSingleClickCompatible : |
97 EAknEnableSkin | EAknEnableMSK; |
97 EAknEnableSkin | EAknEnableMSK; |
98 BaseConstructL( appUiFlags ); |
98 BaseConstructL( appUiFlags ); |
99 iAppUiFactory = CEikonEnv::Static()->AppUiFactory( *this ); |
|
100 ASSERT( iAppUiFactory ); |
|
101 |
99 |
102 FeatureManager::InitializeLibL(); |
100 FeatureManager::InitializeLibL(); |
103 iIsKastorEffectStarted = EFalse; |
101 iIsKastorEffectStarted = EFalse; |
104 StartLayoutSwitchFullScreen( AknTransEffect::EApplicationStart ); |
102 StartLayoutSwitchFullScreen( AknTransEffect::EApplicationStart ); |
105 |
103 |
127 iSkinChangeInProgress = EFalse; |
125 iSkinChangeInProgress = EFalse; |
128 iHasFocus = ETrue; |
126 iHasFocus = ETrue; |
129 |
127 |
130 iSkinSrvSession.Connect(this); |
128 iSkinSrvSession.Connect(this); |
131 iAppkeyHandler = CMmAppkeyHandler::NewL(); |
129 iAppkeyHandler = CMmAppkeyHandler::NewL(); |
132 iOptionsMenuIsOpen = EFalse; |
|
133 |
130 |
134 RProperty::Define( KMMenuPSCat, KMMenuLastViewKey, RProperty::EText ); |
131 RProperty::Define( KMMenuPSCat, KMMenuLastViewKey, RProperty::EText ); |
135 |
132 |
136 MMPERF(("CMmAppUi::ConstructL - HN ready")); |
133 MMPERF(("CMmAppUi::ConstructL - HN ready")); |
137 DEBUG(("_Mm_:CMmAppUi::ConstructL OUT")); |
134 DEBUG(("_Mm_:CMmAppUi::ConstructL OUT")); |
212 // Do not call StartLayoutSwitchFullScreen(), |
209 // Do not call StartLayoutSwitchFullScreen(), |
213 // layout switch effect is started automatically |
210 // layout switch effect is started automatically |
214 iIsKastorEffectStarted = ETrue; |
211 iIsKastorEffectStarted = ETrue; |
215 TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; |
212 TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; |
216 |
213 |
217 if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && |
214 if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && |
218 !iCurrentContainer->IsHighlightVisible() ) |
215 !iCurrentContainer->IsHighlightVisible() ) |
219 { |
216 { |
220 iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); |
217 iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); |
221 } |
218 } |
222 |
219 |
223 iCurrentContainer->SetRect( ClientRect() ); |
220 iCurrentContainer->SetRect( ClientRect() ); |
224 iDummyContainer->SetRect( ClientRect() ); |
221 iDummyContainer->SetRect( ClientRect() ); |
225 |
222 |
226 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
223 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
227 while( iterator.NextKey() ) |
224 while( iterator.NextKey() ) |
322 // to Menu via task swapper. |
319 // to Menu via task swapper. |
323 if( !aParams.Compare( KNullDesC8 ) ) |
320 if( !aParams.Compare( KNullDesC8 ) ) |
324 { |
321 { |
325 if ( !iAppkeyHandler->IsActive() ) |
322 if ( !iAppkeyHandler->IsActive() ) |
326 { |
323 { |
|
324 //make dummy container visible when returning |
|
325 //to menu by AppKey |
|
326 iDummyContainer->MakeVisible( ETrue ); |
|
327 RefreshUiPanesL( ETrue ); |
|
328 iCurrentContainer->MakeVisible( EFalse ); |
|
329 iDummyContainer->DrawNow(); |
327 CleanupForExitL( EExitKeyApplication ); |
330 CleanupForExitL( EExitKeyApplication ); |
328 User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( |
331 User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( |
329 CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); |
332 CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); |
330 iAppkeyHandler->StartL(); |
333 iAppkeyHandler->StartL(); |
331 } |
334 } |
794 } |
797 } |
795 if (iCurrentSuiteModel) |
798 if (iCurrentSuiteModel) |
796 { |
799 { |
797 iCurrentSuiteModel->SetVisibleL(EFalse); |
800 iCurrentSuiteModel->SetVisibleL(EFalse); |
798 } |
801 } |
799 if( iMmExtManager ) |
802 |
800 { |
|
801 iMmExtManager->ExecuteActionL(TUid::Null(), KCommandDeleteDialog, NULL ); |
|
802 } |
|
803 } |
803 } |
804 break; |
804 break; |
805 case ERemoveLiwObjects: |
805 case ERemoveLiwObjects: |
806 { |
806 { |
807 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
807 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
1311 MMPERF(("CMmAppUi::DynInitMenuPaneL - STOP")); |
1311 MMPERF(("CMmAppUi::DynInitMenuPaneL - STOP")); |
1312 } |
1312 } |
1313 |
1313 |
1314 if ( !popupMenuDisplayed && iCurrentContainer ) |
1314 if ( !popupMenuDisplayed && iCurrentContainer ) |
1315 { |
1315 { |
1316 iCurrentContainer->EndLongTapL( EFalse ); |
1316 iCurrentContainer->EndLongTapL( ETrue ); |
1317 HandleHighlightItemSingleClickedL( |
1317 HandleHighlightItemSingleClickedL( |
1318 iCurrentContainer->Widget()->CurrentItemIndex() ); |
1318 iCurrentContainer->Widget()->CurrentItemIndex() ); |
1319 } |
1319 } |
1320 } |
1320 } |
1321 |
1321 |
1428 // |
1428 // |
1429 // --------------------------------------------------------------------------- |
1429 // --------------------------------------------------------------------------- |
1430 // |
1430 // |
1431 void CMmAppUi::HandleMessageL( const TDesC8& aMessage ) |
1431 void CMmAppUi::HandleMessageL( const TDesC8& aMessage ) |
1432 { |
1432 { |
|
1433 if( iMmExtManager ) |
|
1434 { |
|
1435 iMmExtManager->ExecuteActionL(TUid::Null(), KCommandDeleteDialog, NULL ); |
|
1436 } |
1433 if ( IsEditMode() ) |
1437 if ( IsEditMode() ) |
1434 { |
1438 { |
1435 SetEditModeL( EFalse ); |
1439 SetEditModeL( EFalse ); |
1436 } |
1440 } |
1437 |
|
1438 if ( aMessage.Find( KRootWithPref ) != KErrNotFound ) |
1441 if ( aMessage.Find( KRootWithPref ) != KErrNotFound ) |
1439 { |
1442 { |
1440 RemoveFromStack( iCurrentContainer ); |
1443 RemoveFromStack( iCurrentContainer ); |
1441 iDummyContainer->MakeVisible( ETrue ); |
1444 iDummyContainer->MakeVisible( ETrue ); |
1442 RefreshCbaL(); |
1445 RefreshCbaL(); |
1518 //store items, position as the key |
1521 //store items, position as the key |
1519 menuItemMap.InsertL( ( i + 1 ) * KMenuPosMultiplier, |
1522 menuItemMap.InsertL( ( i + 1 ) * KMenuPosMultiplier, |
1520 aMenuPane-> |
1523 aMenuPane-> |
1521 ItemData( aMenuPane->MenuItemCommandId( i ) ) ); |
1524 ItemData( aMenuPane->MenuItemCommandId( i ) ) ); |
1522 } |
1525 } |
1523 |
1526 |
1524 TInt itemSpecificMenuItemsCount = 0; |
|
1525 |
1527 |
1526 //get custom menu items and their positions |
1528 //get custom menu items and their positions |
1527 while ( menuIterator->HasNext() ) |
1529 while ( menuIterator->HasNext() ) |
1528 { |
1530 { |
1529 CHnMenuItemModel* menuItem = menuIterator->GetNext(); |
1531 CHnMenuItemModel* menuItem = menuIterator->GetNext(); |
1530 TBool isItemSpecific = menuItem->IsItemSpecific(); |
1532 if ( (menuItem->MenuItemType() == CHnMenuItemModel::EItemApplication) || !ignoreItemSpecific ) |
1531 if ( isItemSpecific ) |
|
1532 { |
|
1533 ++itemSpecificMenuItemsCount; |
|
1534 } |
|
1535 if ( !isItemSpecific || !ignoreItemSpecific ) |
|
1536 { |
1533 { |
1537 CEikMenuPaneItem::SData menuData; |
1534 CEikMenuPaneItem::SData menuData; |
1538 menuData.iCommandId = menuItem->Command(); |
1535 menuData.iCommandId = menuItem->Command(); |
1539 menuData.iText = menuItem->NameL(). |
1536 menuData.iText = menuItem->NameL(). |
1540 Left( CEikMenuPaneItem::SData::ENominalTextLength ); |
1537 Left( CEikMenuPaneItem::SData::ENominalTextLength ); |
1568 } |
1565 } |
1569 positionArray.AppendL( menuItem->Position() ); |
1566 positionArray.AppendL( menuItem->Position() ); |
1570 menuItemMap.InsertL( menuItem->Position(), menuData ); |
1567 menuItemMap.InsertL( menuItem->Position(), menuData ); |
1571 } |
1568 } |
1572 } |
1569 } |
1573 |
|
1574 // DynInitMenuPaneL always gets called immediately after an item is touched and |
|
1575 // because of that it is possible to enable/disable settings that affect long |
|
1576 // tap behavior here. |
|
1577 iCurrentContainer->EnableLongTapAnimation( itemSpecificMenuItemsCount > 0 ); |
|
1578 |
1570 |
1579 aMenuPane->Reset(); |
1571 aMenuPane->Reset(); |
1580 positionArray.Sort(); |
1572 positionArray.Sort(); |
1581 |
1573 |
1582 //add items in correct order |
1574 //add items in correct order |
1816 if( iCurrentContainer && aWidgetContainer && |
1808 if( iCurrentContainer && aWidgetContainer && |
1817 iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType() ) |
1809 iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType() ) |
1818 { |
1810 { |
1819 StartLayoutSwitchFullScreen(); |
1811 StartLayoutSwitchFullScreen(); |
1820 } |
1812 } |
|
1813 |
|
1814 TBool highlightVisibleBefore = iCurrentContainer != NULL && |
|
1815 iCurrentContainer->IsHighlightVisible(); |
|
1816 |
1821 HandleWidgetChangeRefreshL( aWidgetContainer ); |
1817 HandleWidgetChangeRefreshL( aWidgetContainer ); |
|
1818 |
|
1819 if ( highlightVisibleBefore ) |
|
1820 { |
|
1821 iCurrentContainer->SetHighlightVisibilityL( ETrue ); |
|
1822 } |
1822 } |
1823 } |
1823 else |
1824 else |
1824 { |
1825 { |
1825 HandleNoWidgetChangeRefreshL(); |
1826 HandleNoWidgetChangeRefreshL(); |
1826 } |
1827 } |
2145 } |
2146 } |
2146 else if( type == KAknFullOrPartialForegroundLost ) |
2147 else if( type == KAknFullOrPartialForegroundLost ) |
2147 { |
2148 { |
2148 HandleFullOrPartialForegroundLostL(); |
2149 HandleFullOrPartialForegroundLostL(); |
2149 } |
2150 } |
2150 |
2151 } |
2151 DetectOptionsMenuOpenDisplayChangeL(); |
2152 |
2152 } |
|
2153 // --------------------------------------------------------------------------- |
2153 // --------------------------------------------------------------------------- |
2154 // |
2154 // |
2155 // --------------------------------------------------------------------------- |
2155 // --------------------------------------------------------------------------- |
2156 // |
2156 // |
2157 TErrorHandlerResponse CMmAppUi::HandleError(TInt aError, |
2157 TErrorHandlerResponse CMmAppUi::HandleError(TInt aError, |
3008 // |
3006 // |
3009 void CMmAppUi::HandleFullOrPartialForegroundLostL() |
3007 void CMmAppUi::HandleFullOrPartialForegroundLostL() |
3010 { |
3008 { |
3011 DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " |
3009 DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " |
3012 "- KAknFullOrPartialForegroundLost")); |
3010 "- KAknFullOrPartialForegroundLost")); |
3013 iMmExtManager->ExecuteActionL( |
|
3014 TUid::Null(), KCommandDeleteDialog, NULL ); |
|
3015 if ( iCurrentContainer ) |
3011 if ( iCurrentContainer ) |
3016 { |
3012 { |
3017 iCurrentContainer->HandleBackgroundGainedL(); |
3013 iCurrentContainer->HandleBackgroundGainedL(); |
3018 if ( !IsRootdisplayedL() || IsEditMode() || |
|
3019 iEditModeStatus == ETransitionFromEditMode ) |
|
3020 { |
|
3021 iDummyContainer->MakeVisible( ETrue ); |
|
3022 RefreshUiPanesL( ETrue ); |
|
3023 iCurrentContainer->MakeVisible( EFalse ); |
|
3024 iDummyContainer->DrawNow(); |
|
3025 } |
|
3026 if ( IsRootdisplayedL() ) |
3014 if ( IsRootdisplayedL() ) |
3027 { |
3015 { |
3028 iCurrentContainer->RestoreWidgetPosition(); |
3016 iCurrentContainer->RestoreWidgetPosition(); |
3029 iCurrentContainer->CacheWidgetPosition(); |
3017 iCurrentContainer->CacheWidgetPosition(); |
3030 } |
3018 } |
3031 } |
3019 } |
3032 } |
3020 } |
3033 |
3021 |
3034 // --------------------------------------------------------------------------- |
|
3035 // |
|
3036 // --------------------------------------------------------------------------- |
|
3037 // |
|
3038 void CMmAppUi::DetectOptionsMenuOpenDisplayChangeL() |
|
3039 { |
|
3040 CEikMenuBar* menuBar = iAppUiFactory->MenuBar(); |
|
3041 TBool optionsMenuIsOpen = menuBar && menuBar->IsDisplayed(); |
|
3042 if ( !!iOptionsMenuIsOpen != !!optionsMenuIsOpen ) |
|
3043 { |
|
3044 iOptionsMenuIsOpen = optionsMenuIsOpen; |
|
3045 if ( iCurrentContainer ) |
|
3046 { |
|
3047 iCurrentContainer->HandleOptionsMenuVisibilityChangeL( |
|
3048 iOptionsMenuIsOpen ); |
|
3049 } |
|
3050 } |
|
3051 } |
|
3052 |
|
3053 // End of File |
3022 // End of File |