75 { |
75 { |
76 EMenuOpenFolderEffect = 1001, |
76 EMenuOpenFolderEffect = 1001, |
77 EMenuCloseFolderEffect = 1002 |
77 EMenuCloseFolderEffect = 1002 |
78 }; |
78 }; |
79 |
79 |
|
80 #define AI_UID3_AIFW_COMMON 0x102750F0 |
|
81 |
80 // ============================ MEMBER FUNCTIONS ============================= |
82 // ============================ MEMBER FUNCTIONS ============================= |
81 |
83 |
82 // --------------------------------------------------------------------------- |
84 // --------------------------------------------------------------------------- |
83 // |
85 // |
84 // --------------------------------------------------------------------------- |
86 // --------------------------------------------------------------------------- |
110 |
112 |
111 iDummyTemplateLib = CMmTemplateLibrary::NewL(); |
113 iDummyTemplateLib = CMmTemplateLibrary::NewL(); |
112 iDummyContainer = CMmWidgetContainer::NewGridContainerL( ClientRect(), |
114 iDummyContainer = CMmWidgetContainer::NewGridContainerL( ClientRect(), |
113 this, iDummyTemplateLib ); |
115 this, iDummyTemplateLib ); |
114 iDummyContainer->SetEmptyTextL( KNullDesC ); |
116 iDummyContainer->SetEmptyTextL( KNullDesC ); |
|
117 iDummyContainer->MakeVisible( EFalse ); |
115 AddToStackL( iDummyContainer, ECoeStackPriorityDefault, |
118 AddToStackL( iDummyContainer, ECoeStackPriorityDefault, |
116 ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys ); |
119 ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys ); |
117 iDummyContainer->MakeVisible( ETrue ); |
|
118 iDummyContainer->DrawNow(); |
|
119 |
120 |
120 iHNInterface = CHnEngine::NewL( *this ); |
121 iHNInterface = CHnEngine::NewL( *this ); |
121 iTemplateLibrary = CMmTemplateLibrary::NewL(); |
122 iTemplateLibrary = CMmTemplateLibrary::NewL(); |
122 InitializeL(); |
123 InitializeL(); |
123 |
124 |
805 if (IsEditMode() && iCurrentContainer->IsDraggable()) |
802 if (IsEditMode() && iCurrentContainer->IsDraggable()) |
806 { |
803 { |
807 iCurrentContainer->CancelDragL(EFalse); |
804 iCurrentContainer->CancelDragL(EFalse); |
808 } |
805 } |
809 } |
806 } |
810 if (iCurrentSuiteModel) |
|
811 { |
|
812 iCurrentSuiteModel->SetVisibleL(EFalse); |
|
813 } |
|
814 |
|
815 } |
807 } |
816 break; |
808 break; |
817 case ERemoveLiwObjects: |
809 case ERemoveLiwObjects: |
818 { |
810 { |
819 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
811 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
1223 { |
1215 { |
1224 DEBUG(("\t_Mm_:CMmAppUi::HandleListBoxEventL EEventItemSingleClicked")); |
1216 DEBUG(("\t_Mm_:CMmAppUi::HandleListBoxEventL EEventItemSingleClicked")); |
1225 HandleHighlightItemSingleClickedL( iCurrentContainer->Widget()->CurrentItemIndex() ); |
1217 HandleHighlightItemSingleClickedL( iCurrentContainer->Widget()->CurrentItemIndex() ); |
1226 } |
1218 } |
1227 else if ( aEventType == MEikListBoxObserver::EEventPanningStarted ) |
1219 else if ( aEventType == MEikListBoxObserver::EEventPanningStarted ) |
1228 { |
1220 { |
1229 iKeyClickLocked = ETrue; |
1221 iKeyClickLocked = ETrue; |
1230 } |
1222 } |
1231 |
1223 |
1232 DEBUG(("_Mm_:CMmAppUi::HandleListBoxEventL OUT")); |
1224 DEBUG(("_Mm_:CMmAppUi::HandleListBoxEventL OUT")); |
1233 } |
1225 } |
1234 |
1226 |
1235 // --------------------------------------------------------------------------- |
1227 // --------------------------------------------------------------------------- |
1486 TBool ignoreItemSpecific( EFalse ); |
1478 TBool ignoreItemSpecific( EFalse ); |
1487 if ( iCurrentSuiteModel ) |
1479 if ( iCurrentSuiteModel ) |
1488 { |
1480 { |
1489 TInt itemId( KErrNotFound ); |
1481 TInt itemId( KErrNotFound ); |
1490 TBool suiteModelHasItems = iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; |
1482 TBool suiteModelHasItems = iCurrentContainer->GetSuiteModelL()->GetItemModelsCount() > 1; |
1491 TBool highlightVisible = iCurrentContainer->IsHighlightVisible(); |
1483 TBool highlightVisible = iCurrentContainer->IsHighlightVisible(); |
1492 if ( !highlightVisible && suiteModelHasItems ) |
1484 if ( !highlightVisible && suiteModelHasItems ) |
1493 { |
1485 { |
1494 // if there is no highlight, but there are items, show menuitems for logically |
1486 // if there is no highlight, but there are items, show menuitems for logically |
1495 // current suite highlight fetched from suite model. |
1487 // current suite highlight fetched from suite model. |
1496 TInt suiteHighlight = iCurrentSuiteModel->GetSuiteHighlight(); |
1488 TInt suiteHighlight = iCurrentSuiteModel->GetSuiteHighlight(); |
1497 ASSERT( suiteHighlight != KErrNotFound ); |
1489 ASSERT( suiteHighlight != KErrNotFound ); |
1498 itemId = iCurrentSuiteModel->IdByIndex( suiteHighlight ); |
1490 itemId = iCurrentSuiteModel->IdByIndex( suiteHighlight ); |
1499 ignoreItemSpecific = ETrue; |
1491 ignoreItemSpecific = ETrue; |
1500 } |
1492 } |
1501 else |
1493 else |
1502 { |
1494 { |
1503 TBool idByContainer = highlightVisible && suiteModelHasItems; |
1495 TBool idByContainer = highlightVisible && suiteModelHasItems; |
1504 itemId = idByContainer ? |
1496 itemId = idByContainer |
1505 iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) : |
1497 ? iCurrentSuiteModel->IdByIndex( iCurrentContainer->GetHighlight() ) |
1506 iCurrentSuiteModel->IdByIndex( KErrNotFound ); |
1498 : iCurrentSuiteModel->IdByIndex( KErrNotFound ); |
1507 } |
1499 } |
1508 menuIterator = iCurrentSuiteModel->GetMenuStructureL( itemId ); |
1500 menuIterator = iCurrentSuiteModel->GetMenuStructureL( itemId ); |
1509 } |
1501 } |
1510 |
1502 |
1511 // check if there is a menu structure available |
1503 // check if there is a menu structure available |
1512 // for the specified item |
1504 // for the specified item |
1513 if ( menuIterator ) |
1505 if ( menuIterator ) |
1514 { |
1506 { |
1534 //get custom menu items and their positions |
1526 //get custom menu items and their positions |
1535 while ( menuIterator->HasNext() ) |
1527 while ( menuIterator->HasNext() ) |
1536 { |
1528 { |
1537 CHnMenuItemModel* menuItem = menuIterator->GetNext(); |
1529 CHnMenuItemModel* menuItem = menuIterator->GetNext(); |
1538 if ( (menuItem->MenuItemType() == CHnMenuItemModel::EItemApplication) || !ignoreItemSpecific ) |
1530 if ( (menuItem->MenuItemType() == CHnMenuItemModel::EItemApplication) || !ignoreItemSpecific ) |
1539 { |
1531 { |
1540 CEikMenuPaneItem::SData menuData; |
1532 CEikMenuPaneItem::SData menuData; |
1541 menuData.iCommandId = menuItem->Command(); |
1533 menuData.iCommandId = menuItem->Command(); |
1542 menuData.iText = menuItem->NameL(). |
1534 menuData.iText = menuItem->NameL(). |
1543 Left( CEikMenuPaneItem::SData::ENominalTextLength ); |
1535 Left( CEikMenuPaneItem::SData::ENominalTextLength ); |
1544 menuData.iFlags = 0; |
1536 menuData.iFlags = 0; |
1545 |
1537 |
1546 //check for children |
1538 //check for children |
1547 MHnMenuItemModelIterator* childIterator = |
1539 MHnMenuItemModelIterator* childIterator = |
1548 menuItem->GetMenuStructure(); |
1540 menuItem->GetMenuStructure(); |
1549 if ( childIterator->HasNext() ) |
1541 if ( childIterator->HasNext() ) |
1550 { |
1542 { |
1551 //this is a cascade item |
1543 //this is a cascade item |
1552 //one menu item can contain only one cascade menu |
1544 //one menu item can contain only one cascade menu |
1553 //check if there are available cascade menu containers |
1545 //check if there are available cascade menu containers |
1554 TInt freeResource = GetNextCascadeMenuResourceId(); |
1546 TInt freeResource = GetNextCascadeMenuResourceId(); |
1555 if ( freeResource != KErrNotFound ) |
1547 if ( freeResource != KErrNotFound ) |
1556 { |
1548 { |
1557 //error checking |
1549 //error checking |
1558 if( !iCascadeMenuMap.Insert( freeResource, |
1550 if( !iCascadeMenuMap.Insert( freeResource, |
1559 childIterator ) ) |
1551 childIterator ) ) |
1560 { |
1552 { |
1561 //add item only if there is an |
1553 //add item only if there is an |
1562 //available resource |
1554 //available resource |
1563 menuData.iCascadeId = freeResource; |
1555 menuData.iCascadeId = freeResource; |
1564 } |
1556 } |
1565 } |
1557 } |
1566 } |
1558 } |
1567 else |
1559 else |
1568 { |
1560 { |
1569 //normal entry |
1561 //normal entry |
1570 menuData.iCascadeId = 0; |
1562 menuData.iCascadeId = 0; |
1571 } |
1563 } |
1572 positionArray.AppendL( menuItem->Position() ); |
1564 positionArray.AppendL( menuItem->Position() ); |
1573 menuItemMap.InsertL( menuItem->Position(), menuData ); |
1565 menuItemMap.InsertL( menuItem->Position(), menuData ); |
1574 } |
1566 } |
1575 } |
1567 } |
1576 |
1568 |
1577 aMenuPane->Reset(); |
1569 aMenuPane->Reset(); |
1578 positionArray.Sort(); |
1570 positionArray.Sort(); |
1579 |
1571 |
1740 RemoveFromStack(previousContainer); |
1732 RemoveFromStack(previousContainer); |
1741 } |
1733 } |
1742 |
1734 |
1743 iCurrentContainer = aWidgetContainer; |
1735 iCurrentContainer = aWidgetContainer; |
1744 iCurrentContainer->Widget()->View()->SetDisableRedraw(ETrue); |
1736 iCurrentContainer->Widget()->View()->SetDisableRedraw(ETrue); |
1745 iDummyContainer->MakeVisible( ETrue ); |
1737 if( isHiddenFromFS ) |
|
1738 { |
|
1739 iCurrentContainer->MakeVisible( EFalse ); |
|
1740 } |
|
1741 else |
|
1742 { |
|
1743 iDummyContainer->MakeVisible( ETrue ); |
|
1744 } |
|
1745 |
1746 RefreshCbaL(); |
1746 RefreshCbaL(); |
1747 iCurrentContainer->SetEditModeL( IsEditMode() ); |
1747 iCurrentContainer->SetEditModeL( IsEditMode() ); |
1748 iCurrentContainer->SetSuiteModelL( iCurrentSuiteModel ); |
1748 iCurrentContainer->SetSuiteModelL( iCurrentSuiteModel ); |
1749 iCurrentContainer->HandleResourceChange( KAknsMessageSkinChange ); |
1749 iCurrentContainer->HandleResourceChange( KAknsMessageSkinChange ); |
1750 iCurrentContainer->HandleResourceChange( KUidValueCoeColorSchemeChangeEvent ); |
1750 iCurrentContainer->HandleResourceChange( KUidValueCoeColorSchemeChangeEvent ); |
2376 // |
2376 // |
2377 // --------------------------------------------------------------------------- |
2377 // --------------------------------------------------------------------------- |
2378 // |
2378 // |
2379 void CMmAppUi::HandleSuiteModelInitializedL( CHnSuiteModel* aModel ) |
2379 void CMmAppUi::HandleSuiteModelInitializedL( CHnSuiteModel* aModel ) |
2380 { |
2380 { |
|
2381 |
2381 StatusPane()->MakeVisible( ETrue ); |
2382 StatusPane()->MakeVisible( ETrue ); |
2382 Cba()->MakeVisible( ETrue ); |
2383 Cba()->MakeVisible( ETrue ); |
2383 |
|
2384 if ( aModel == iHNInterface->GetLastSuiteModelL() ) |
2384 if ( aModel == iHNInterface->GetLastSuiteModelL() ) |
2385 { |
2385 { |
2386 TBool showOpenFolderEffect(iCurrentSuiteModel |
2386 TBool showOpenFolderEffect(iCurrentSuiteModel |
2387 && (iCurrentSuiteModel->CustomId() != aModel->CustomId() |
2387 && (iCurrentSuiteModel->CustomId() != aModel->CustomId() |
2388 || iCurrentSuiteModel->WidgetType() |
2388 || iCurrentSuiteModel->WidgetType() |
2390 if( showOpenFolderEffect ) |
2390 if( showOpenFolderEffect ) |
2391 { |
2391 { |
2392 StartLayoutSwitchFullScreen( EMenuOpenFolderEffect ); |
2392 StartLayoutSwitchFullScreen( EMenuOpenFolderEffect ); |
2393 } |
2393 } |
2394 |
2394 |
2395 if ( iCurrentSuiteModel ) |
|
2396 { |
|
2397 iCurrentSuiteModel->SetVisibleL( EFalse ); |
|
2398 DEBUG16(("\t\t_Mm_:SetVisible EFalse - %S", |
|
2399 &(iCurrentSuiteModel->SuiteName()))); |
|
2400 } |
|
2401 iCurrentSuiteModel = aModel; |
2395 iCurrentSuiteModel = aModel; |
2402 ShowSuiteL(); |
2396 ShowSuiteL(); |
2403 iGarbage.ResetAndDestroy(); |
2397 iGarbage.ResetAndDestroy(); |
2404 |
2398 |
2405 if ( iEditModeStatus == ETransitionToEditMode ) |
2399 if ( iEditModeStatus == ETransitionToEditMode ) |
2407 iEditModeStatus = EEditMode; |
2401 iEditModeStatus = EEditMode; |
2408 } |
2402 } |
2409 else if ( iEditModeStatus == ETransitionFromEditMode ) |
2403 else if ( iEditModeStatus == ETransitionFromEditMode ) |
2410 { |
2404 { |
2411 iEditModeStatus = ENoEditMode; |
2405 iEditModeStatus = ENoEditMode; |
2412 } |
|
2413 |
|
2414 if (iScreenOn && IsForeground()) |
|
2415 { |
|
2416 iCurrentSuiteModel->SetVisibleL( ETrue ); |
|
2417 DEBUG16(("\t\t_Mm_:SetVisible ETrue - %S", |
|
2418 &(iCurrentSuiteModel->SuiteName()))); |
|
2419 } |
2406 } |
2420 |
2407 |
2421 HideMenuPaneIfVisibleL(); |
2408 HideMenuPaneIfVisibleL(); |
2422 EndFullScreen(); |
2409 EndFullScreen(); |
2423 } |
2410 } |
2753 if( ( !iIsKastorEffectStarted && iScreenOn && IsForeground() ) || |
2740 if( ( !iIsKastorEffectStarted && iScreenOn && IsForeground() ) || |
2754 aKastorEffect == AknTransEffect::EApplicationStart || |
2741 aKastorEffect == AknTransEffect::EApplicationStart || |
2755 aKastorEffect == AknTransEffect::EApplicationExit ) |
2742 aKastorEffect == AknTransEffect::EApplicationExit ) |
2756 { |
2743 { |
2757 DEBUG(("_MM_:CMmAppUi::StartLayoutSwitchFullScreen Foreground")); |
2744 DEBUG(("_MM_:CMmAppUi::StartLayoutSwitchFullScreen Foreground")); |
2758 TUid uid1( KUidMatrixMenuApp ); |
2745 TUid uidNext( KUidMatrixMenuApp ); |
2759 TUid uid2( KUidMatrixMenuApp ); |
2746 TUid uidPrev( KUidMatrixMenuApp ); |
2760 if ( aKastorEffect == AknTransEffect::EApplicationExit ) |
2747 |
2761 { |
2748 if( aKastorEffect == AknTransEffect::EApplicationExit ) |
2762 uid2 = TUid::Null(); |
2749 { |
|
2750 uidPrev = TUid::Null(); |
|
2751 } |
|
2752 else if( aKastorEffect == AknTransEffect::EApplicationStart ) |
|
2753 { |
|
2754 uidPrev = uidPrev.Uid( AI_UID3_AIFW_COMMON ); |
2763 } |
2755 } |
2764 |
2756 |
2765 AknTransEffect::TParamBuffer params = AknTransEffect::GfxTransParam( |
2757 AknTransEffect::TParamBuffer params = AknTransEffect::GfxTransParam( |
2766 uid1, uid2, AknTransEffect::TParameter::EFlagNone ); |
2758 uidNext, uidPrev, AknTransEffect::TParameter::EFlagNone ); |
2767 |
2759 |
2768 GfxTransEffect::BeginFullScreen( aKastorEffect, TRect(), |
2760 GfxTransEffect::BeginFullScreen( aKastorEffect, TRect(), |
2769 AknTransEffect::EParameterType, params ); |
2761 AknTransEffect::EParameterType, params ); |
2770 |
2762 |
2771 iIsKastorEffectStarted = ETrue; |
2763 iIsKastorEffectStarted = ETrue; |
3029 HandleDragStopL( iCurrentContainer->GetHighlight() ); |
3017 HandleDragStopL( iCurrentContainer->GetHighlight() ); |
3030 iCurrentContainer->DrawNow(); |
3018 iCurrentContainer->DrawNow(); |
3031 } |
3019 } |
3032 iCurrentContainer->SetHasFocusL( EFalse ); |
3020 iCurrentContainer->SetHasFocusL( EFalse ); |
3033 } |
3021 } |
3034 if ( iCurrentSuiteModel ) |
|
3035 { |
|
3036 iCurrentSuiteModel->SetVisibleL( EFalse ); |
|
3037 } |
|
3038 |
|
3039 } |
3022 } |
3040 |
3023 |
3041 // --------------------------------------------------------------------------- |
3024 // --------------------------------------------------------------------------- |
3042 // |
3025 // |
3043 // --------------------------------------------------------------------------- |
3026 // --------------------------------------------------------------------------- |