1 /* |
1 /* |
2 * Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
87 //<cmail> |
87 //<cmail> |
88 #include <data_caging_path_literals.hrh> // hardcoded paths removal from cmail |
88 #include <data_caging_path_literals.hrh> // hardcoded paths removal from cmail |
89 #include "cfsccontactactionmenu.h" |
89 #include "cfsccontactactionmenu.h" |
90 //</cmail> |
90 //</cmail> |
91 #include <layoutmetadata.cdl.h> // for Layout_Meta_Data |
91 #include <layoutmetadata.cdl.h> // for Layout_Meta_Data |
92 #include <aknnavilabel.h> |
|
93 #include <AknPriv.hrh> |
|
94 #include "freestyleemailcenrepkeys.h" |
|
95 #include <centralrepository.h> |
|
96 |
92 |
97 // INTERNAL INCLUDE FILES |
93 // INTERNAL INCLUDE FILES |
98 #include "FreestyleEmailUiContactHandler.h" |
94 #include "FreestyleEmailUiContactHandler.h" |
99 #include "FreestyleEmailUiAppui.h" |
95 #include "FreestyleEmailUiAppui.h" |
100 #include "FreestyleEmailUi.hrh" |
96 #include "FreestyleEmailUi.hrh" |
156 } |
152 } |
157 |
153 |
158 const TUint KConnectionStatusIconRotationInterval = 100; |
154 const TUint KConnectionStatusIconRotationInterval = 100; |
159 const TUint KFakeSyncAnimStopTimerInterval = 3000; // 3 secs |
155 const TUint KFakeSyncAnimStopTimerInterval = 3000; // 3 secs |
160 const TInt KConnectionStatusIconRotationAmount = 18; |
156 const TInt KConnectionStatusIconRotationAmount = 18; |
161 const TInt KFullCircleInDegrees = 360; |
|
162 // Length of the drive letter descriptor (e.g. "c:") |
157 // Length of the drive letter descriptor (e.g. "c:") |
163 const TInt KDriveDescLength = 2; |
158 const TInt KDriveDescLength = 2; |
164 |
159 |
165 |
160 |
166 // TDisplayImagesCache |
161 // TDisplayImagesCache |
747 RemoveView(iHtmlViewerViewId); |
742 RemoveView(iHtmlViewerViewId); |
748 // destroys the Download Information mediator |
743 // destroys the Download Information mediator |
749 // Destruction must be done here as other Tls data depends on it. |
744 // Destruction must be done here as other Tls data depends on it. |
750 CFSEmailDownloadInfoMediator::Destroy(); |
745 CFSEmailDownloadInfoMediator::Destroy(); |
751 |
746 |
752 delete iNaviDecorator; |
747 delete iNaviDecorator2MailViewer; |
753 |
748 |
754 delete iConnectionStatusIconAnimTimer; |
749 delete iConnectionStatusIconAnimTimer; |
755 delete iFakeSyncAnimStopTimer; |
750 delete iFakeSyncAnimStopTimer; |
756 |
751 |
757 MTouchFeedback* touchFeedback( MTouchFeedback::Instance() ); |
752 MTouchFeedback* touchFeedback( MTouchFeedback::Instance() ); |
890 if ( AppUiExitOngoing() ) |
885 if ( AppUiExitOngoing() ) |
891 { |
886 { |
892 return; |
887 return; |
893 } |
888 } |
894 |
889 |
895 if( aViewId == MailListId ) |
|
896 { |
|
897 // notify Eik that SplitInput was disabled when entering the list form homescreen |
|
898 CEikAppUi::HandleResourceChangeL( KAknSplitInputDisabled ); |
|
899 } |
|
900 |
|
901 // Do nothing if the externally activated view was already active |
890 // Do nothing if the externally activated view was already active |
902 if ( iCurrentActiveView->Id() != aViewId ) |
891 if ( iCurrentActiveView->Id() != aViewId ) |
903 { |
892 { |
904 // this function removes setting view from view stack so |
893 // this function removes setting view from view stack so |
905 // it cannot be active any more |
894 // it cannot be active any more |
906 iSettingsViewActive = EFalse; |
895 iSettingsViewActive = EFalse; |
907 |
|
908 iPreviousActiveView = iCurrentActiveView; |
896 iPreviousActiveView = iCurrentActiveView; |
909 |
897 |
910 // Check if the view is in the history stack. In that case, we don't |
898 // Check if the view is in the history stack. In that case, we don't |
911 // actually navigate forward but backward. |
899 // actually navigate forward but backward. |
912 if ( IsViewInHistoryStack( aViewId ) ) |
900 if ( IsViewInHistoryStack( aViewId ) ) |
1357 |
1345 |
1358 if (aEvent.Type() == EEventKey) |
1346 if (aEvent.Type() == EEventKey) |
1359 { |
1347 { |
1360 iLastWsEventType = EEventKey; |
1348 iLastWsEventType = EEventKey; |
1361 } |
1349 } |
|
1350 |
1362 TInt key = aEvent.Key()->iScanCode; |
1351 TInt key = aEvent.Key()->iScanCode; |
1363 // <cmail> |
1352 // <cmail> |
1364 // to disable voice commands during creating new mail message |
1353 // to disable voice commands during creating new mail message |
1365 if (EStdKeyYes == key && aEvent.Type() == EEventKeyDown && iCurrentActiveView == iComposeView ) |
1354 if (EStdKeyYes == key && aEvent.Type() == EEventKeyDown && iCurrentActiveView == iComposeView ) |
1366 { |
1355 { |
1502 } |
1491 } |
1503 */ |
1492 */ |
1504 // </cmail> |
1493 // </cmail> |
1505 CAknAppUi::HandleResourceChangeL( aType ); |
1494 CAknAppUi::HandleResourceChangeL( aType ); |
1506 |
1495 |
1507 if ( aType == KAknSplitInputEnabled || aType == KAknSplitInputDisabled ) |
|
1508 { |
|
1509 StatusPane()->MakeVisible( aType == KAknSplitInputDisabled ); |
|
1510 if ( iCurrentActiveView != NULL ) |
|
1511 { |
|
1512 iCurrentActiveView->HandleStatusPaneSizeChange(); |
|
1513 } |
|
1514 } |
|
1515 |
|
1516 // Refresh mode is changed to manual to avoid any flickering during |
1496 // Refresh mode is changed to manual to avoid any flickering during |
1517 // resource change handling in list views. Trap any leaves so that we set |
1497 // resource change handling in list views. Trap any leaves so that we set |
1518 // the automatic refresh mode back on even in case of error. |
1498 // the automatic refresh mode back on even in case of error. |
1519 iEnv->SetRefreshMode( EAlfRefreshModeManual ); |
1499 iEnv->SetRefreshMode( EAlfRefreshModeManual ); |
1520 switch ( aType ) |
1500 switch ( aType ) |
1540 //if( aType == KAknsMessageSkinChange && iConstructComplete ) |
1520 //if( aType == KAknsMessageSkinChange && iConstructComplete ) |
1541 // { |
1521 // { |
1542 // CAlfEnv::Static()->NotifySkinChangedL(); |
1522 // CAlfEnv::Static()->NotifySkinChangedL(); |
1543 // } |
1523 // } |
1544 |
1524 |
1545 if( aType == KEikDynamicLayoutVariantSwitch |
1525 if ( aType == KEikDynamicLayoutVariantSwitch ) |
1546 || aType == KAknSplitInputEnabled || aType == KAknSplitInputDisabled ) |
|
1547 { |
1526 { |
1548 // Changing layout for status pane (just in case it is not switched |
1527 // Changing layout for status pane (just in case it is not switched |
1549 // correctly), fix for HMNN-82BAGR error |
1528 // correctly), fix for HMNN-82BAGR error |
1550 // it's not related with skin change so "moved up" TJOS-83DELP fix |
1529 // it's not related with skin change so "moved up" TJOS-83DELP fix |
1551 TBool landscape(Layout_Meta_Data::IsLandscapeOrientation()); |
1530 TBool landscape(Layout_Meta_Data::IsLandscapeOrientation()); |
1586 switch (aType) |
1565 switch (aType) |
1587 { |
1566 { |
1588 case KAknsMessageSkinChange: |
1567 case KAknsMessageSkinChange: |
1589 type = CFsEmailUiViewBase::ESkinChanged; |
1568 type = CFsEmailUiViewBase::ESkinChanged; |
1590 break; |
1569 break; |
1591 case KAknSplitInputEnabled: // fall though |
|
1592 case KAknSplitInputDisabled: // fall though |
|
1593 case KEikDynamicLayoutVariantSwitch: |
1570 case KEikDynamicLayoutVariantSwitch: |
1594 type = CFsEmailUiViewBase::EScreenLayoutChanged; |
1571 type = CFsEmailUiViewBase::EScreenLayoutChanged; |
1595 break; |
1572 break; |
1596 default: |
1573 default: |
1597 break; |
1574 break; |
1606 |
1583 |
1607 if ( !iIsForeground && type == CFsEmailUiViewBase::EScreenLayoutChanged ) |
1584 if ( !iIsForeground && type == CFsEmailUiViewBase::EScreenLayoutChanged ) |
1608 { |
1585 { |
1609 iPendingLayoutSwitch = ETrue; |
1586 iPendingLayoutSwitch = ETrue; |
1610 } |
1587 } |
1611 if ( iCurrentActiveView && !iSettingsViewActive && !iMRViewer ) |
1588 |
|
1589 if ( iCurrentActiveView && !iSettingsViewActive ) |
1612 { |
1590 { |
1613 iCurrentActiveView->HandleDynamicVariantSwitchL( type ); |
1591 iCurrentActiveView->HandleDynamicVariantSwitchL( type ); |
1614 } |
1592 } |
1615 |
1593 |
1616 // Notify status indicator about layout change |
1594 // Notify status indicator about layout change |
2590 TRAP_IGNORE( FsTextureManager()->ProvideBitmapL( |
2568 TRAP_IGNORE( FsTextureManager()->ProvideBitmapL( |
2591 EStatusTextureDisconnectedGeneral, iConnectionIconBitmap, iConnectionIconMask ) ); |
2569 EStatusTextureDisconnectedGeneral, iConnectionIconBitmap, iConnectionIconMask ) ); |
2592 if ( iConnectionIconBitmap ) |
2570 if ( iConnectionIconBitmap ) |
2593 { |
2571 { |
2594 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
2572 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
2595 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
2573 AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved ); |
2596 } |
2574 } |
2597 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask); |
2575 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask); |
2598 } |
2576 } |
2599 iConnectionStatusIconAnimTimer->Stop(); |
2577 iConnectionStatusIconAnimTimer->Stop(); |
2600 } |
2578 } |
2700 } |
2678 } |
2701 |
2679 |
2702 if ( iConnectionIconBitmap ) |
2680 if ( iConnectionIconBitmap ) |
2703 { |
2681 { |
2704 TSize iconSize( LayoutHandler()->statusPaneIconSize() ); |
2682 TSize iconSize( LayoutHandler()->statusPaneIconSize() ); |
2705 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
2683 AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved ); |
2706 } |
2684 } |
2707 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconMask && iConnectionIconBitmap ); |
2685 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconMask && iConnectionIconBitmap ); |
2708 if (startTimer) |
2686 if (startTimer) |
2709 { |
2687 { |
2710 iConnectionStatusIconAnimTimer->Start( KConnectionStatusIconRotationInterval ); |
2688 iConnectionStatusIconAnimTimer->Start( KConnectionStatusIconRotationInterval ); |
3032 // ----------------------------------------------------------------------------- |
3010 // ----------------------------------------------------------------------------- |
3033 TInt CFreestyleEmailUiAppUi::LastSeenWsEventType() |
3011 TInt CFreestyleEmailUiAppUi::LastSeenWsEventType() |
3034 { |
3012 { |
3035 return iLastWsEventType; |
3013 return iLastWsEventType; |
3036 } |
3014 } |
|
3015 |
3037 // CFreestyleEmailUiAppUi::RunFakeSyncAnimL |
3016 // CFreestyleEmailUiAppUi::RunFakeSyncAnimL |
3038 // ----------------------------------------------------------------------------- |
3017 // ----------------------------------------------------------------------------- |
3039 void CFreestyleEmailUiAppUi::RunFakeSyncAnimL() |
3018 void CFreestyleEmailUiAppUi::RunFakeSyncAnimL() |
3040 { |
3019 { |
3041 FUNC_LOG; |
3020 FUNC_LOG; |
3061 EStatusTextureSynchronising, |
3040 EStatusTextureSynchronising, |
3062 iConnectionIconBitmap, |
3041 iConnectionIconBitmap, |
3063 iConnectionIconMask ); |
3042 iConnectionIconMask ); |
3064 if ( iConnectionIconBitmap && iConnectionIconMask ) |
3043 if ( iConnectionIconBitmap && iConnectionIconMask ) |
3065 { |
3044 { |
3066 AknIconUtils::SetSizeAndRotation( |
3045 AknIconUtils::SetSize( |
3067 iConnectionIconBitmap, |
3046 iConnectionIconBitmap, |
3068 LayoutHandler()->statusPaneIconSize(), |
3047 LayoutHandler()->statusPaneIconSize(), |
3069 EAspectRatioNotPreserved, |
3048 EAspectRatioNotPreserved ); |
3070 iConnectionStatusIconAngle ); |
3049 titlePane->SetSmallPicture( |
3071 |
3050 iConnectionIconBitmap, |
3072 titlePane->SetSmallPicture( |
3051 iConnectionIconMask, |
3073 iConnectionIconBitmap, |
|
3074 iConnectionIconMask, |
|
3075 ETrue ); |
3052 ETrue ); |
3076 iConnectionStatusIconAnimTimer->Start( |
3053 iConnectionStatusIconAnimTimer->Start( |
3077 KConnectionStatusIconRotationInterval ); |
3054 KConnectionStatusIconRotationInterval ); |
3078 iFakeSyncAnimStopTimer->Start( |
3055 iFakeSyncAnimStopTimer->Start( |
3079 KFakeSyncAnimStopTimerInterval ); |
3056 KFakeSyncAnimStopTimerInterval ); |
3083 } |
3060 } |
3084 } |
3061 } |
3085 } |
3062 } |
3086 } |
3063 } |
3087 |
3064 |
|
3065 // ----------------------------------------------------------------------------- |
|
3066 // |
|
3067 // ----------------------------------------------------------------------------- |
|
3068 void CFreestyleEmailUiAppUi::ConstructNaviPaneL() |
|
3069 { |
|
3070 FUNC_LOG; |
|
3071 |
|
3072 CAknNavigationControlContainer* naviPaneContainer = |
|
3073 static_cast<CAknNavigationControlContainer*>( |
|
3074 StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); |
|
3075 |
|
3076 // Following navipane is for mailviewer view |
|
3077 if ( !iNaviDecorator2MailViewer ) |
|
3078 { |
|
3079 // Constructing a decorator with own decorated control, |
|
3080 // which is (currently an empty) container. |
|
3081 CFreestyleEmailUiNaviPaneControlContainer2MailViewer* c = |
|
3082 CFreestyleEmailUiNaviPaneControlContainer2MailViewer::NewL(); |
|
3083 c->SetContainerWindowL( *naviPaneContainer ); |
|
3084 iNaviDecorator2MailViewer = CAknNavigationDecorator::NewL( |
|
3085 naviPaneContainer, |
|
3086 c, |
|
3087 CAknNavigationDecorator::ENotSpecified ); |
|
3088 |
|
3089 // In order to get navi arrows visible, they must be set visible AND not dimmed... |
|
3090 iNaviDecorator2MailViewer->SetContainerWindowL( *naviPaneContainer ); |
|
3091 iNaviDecorator2MailViewer->MakeScrollButtonVisible( ETrue ); |
|
3092 iNaviDecorator2MailViewer->SetScrollButtonDimmed( CAknNavigationDecorator::ELeftButton, EFalse ); |
|
3093 iNaviDecorator2MailViewer->SetScrollButtonDimmed( CAknNavigationDecorator::ERightButton, EFalse ); |
|
3094 |
|
3095 iNaviDecorator2MailViewer->SetComponentsToInheritVisibility( ETrue ); |
|
3096 naviPaneContainer->PushL( *iNaviDecorator2MailViewer ); |
|
3097 } |
|
3098 } |
|
3099 |
|
3100 // ----------------------------------------------------------------------------- |
|
3101 // |
|
3102 // ----------------------------------------------------------------------------- |
|
3103 CAknNavigationDecorator* CFreestyleEmailUiAppUi::NaviDecoratorL( const TUid aViewId ) |
|
3104 { |
|
3105 FUNC_LOG; |
|
3106 CAknNavigationDecorator* decorator( NULL ); |
|
3107 // Depending on who's asking, return proper navipane instance |
|
3108 if ( aViewId.iUid == MailViewerId.iUid ) |
|
3109 { |
|
3110 if ( !iNaviDecorator2MailViewer ) |
|
3111 { |
|
3112 ConstructNaviPaneL(); |
|
3113 } |
|
3114 decorator = iNaviDecorator2MailViewer; |
|
3115 } |
|
3116 return decorator; |
|
3117 } |
|
3118 |
3088 void CFreestyleEmailUiAppUi::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) |
3119 void CFreestyleEmailUiAppUi::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) |
3089 { |
3120 { |
3090 if ( aTriggeredTimer == iConnectionStatusIconAnimTimer ) |
3121 if ( aTriggeredTimer == iConnectionStatusIconAnimTimer ) |
3091 { |
3122 { |
3092 if ( iConnectionStatusVisible ) |
3123 if ( iConnectionStatusVisible ) |
3101 TRAP_IGNORE( titlePane = |
3132 TRAP_IGNORE( titlePane = |
3102 (CAknTitlePane*)StatusPane()->ControlL( titlePaneUid ) ); |
3133 (CAknTitlePane*)StatusPane()->ControlL( titlePaneUid ) ); |
3103 |
3134 |
3104 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
3135 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
3105 iConnectionStatusIconAngle += KConnectionStatusIconRotationAmount; |
3136 iConnectionStatusIconAngle += KConnectionStatusIconRotationAmount; |
3106 iConnectionStatusIconAngle %= KFullCircleInDegrees; |
|
3107 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
3137 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
3108 titlePane->DrawNow(); |
3138 titlePane->DrawNow(); |
3109 iConnectionStatusIconAnimTimer->Start(KConnectionStatusIconRotationInterval); |
3139 iConnectionStatusIconAnimTimer->Start(KConnectionStatusIconRotationInterval); |
3110 } |
3140 } |
3111 } |
3141 } |
3173 { |
3203 { |
3174 activeView->FlipStateChangedL( iFlipOpen ); |
3204 activeView->FlipStateChangedL( iFlipOpen ); |
3175 } |
3205 } |
3176 } |
3206 } |
3177 |
3207 |
3178 void CFreestyleEmailUiAppUi::SetNaviPaneTextL( const TDesC& aText ) |
3208 |
3179 { |
|
3180 if (aText.Length()) |
|
3181 { |
|
3182 CAknNavigationControlContainer* np = |
|
3183 static_cast<CAknNavigationControlContainer*>( |
|
3184 StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); |
|
3185 |
|
3186 if (!iNaviDecorator) |
|
3187 { |
|
3188 iNaviDecorator = np->CreateNavigationLabelL( KNullDesC() ); |
|
3189 np->PushL( *iNaviDecorator ); |
|
3190 } |
|
3191 CAknNaviLabel* naviLabel = static_cast<CAknNaviLabel*>( iNaviDecorator->DecoratedControl() ); |
|
3192 if( naviLabel ) |
|
3193 { |
|
3194 naviLabel->SetTextL( aText ); |
|
3195 iNaviDecorator->DrawDeferred(); |
|
3196 } |
|
3197 } |
|
3198 else |
|
3199 { |
|
3200 if (iNaviDecorator) |
|
3201 { |
|
3202 delete iNaviDecorator; |
|
3203 iNaviDecorator = NULL; |
|
3204 } |
|
3205 } |
|
3206 } |
|
3207 |
3209 |
3208 //////////////////////////////////////////////////////////////////////////////// |
3210 //////////////////////////////////////////////////////////////////////////////// |
3209 // |
3211 // |
3210 ///////////////////////////////////////////////////////////////////////////////// |
3212 ///////////////////////////////////////////////////////////////////////////////// |
3211 // ----------------------------------------------------------------------------- |
3213 // ----------------------------------------------------------------------------- |