1 /* |
1 /* |
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007 - 2010 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 |
92 #include <aknnavilabel.h> |
93 #include <AknPriv.hrh> |
93 #include <AknPriv.hrh> |
94 #include "freestyleemailcenrepkeys.h" |
94 #include "freestyleemailcenrepkeys.h" |
95 #include <centralrepository.h> |
95 #include <centralrepository.h> |
96 |
96 |
97 // INTERNAL INCLUDE FILES |
97 // INTERNAL INCLUDE FILES |
156 } |
156 } |
157 |
157 |
158 const TUint KConnectionStatusIconRotationInterval = 100; |
158 const TUint KConnectionStatusIconRotationInterval = 100; |
159 const TUint KFakeSyncAnimStopTimerInterval = 3000; // 3 secs |
159 const TUint KFakeSyncAnimStopTimerInterval = 3000; // 3 secs |
160 const TInt KConnectionStatusIconRotationAmount = 18; |
160 const TInt KConnectionStatusIconRotationAmount = 18; |
|
161 const TInt KFullCircleInDegrees = 360; |
161 // Length of the drive letter descriptor (e.g. "c:") |
162 // Length of the drive letter descriptor (e.g. "c:") |
162 const TInt KDriveDescLength = 2; |
163 const TInt KDriveDescLength = 2; |
163 |
164 |
164 |
165 |
165 // TDisplayImagesCache |
166 // TDisplayImagesCache |
746 RemoveView(iHtmlViewerViewId); |
747 RemoveView(iHtmlViewerViewId); |
747 // destroys the Download Information mediator |
748 // destroys the Download Information mediator |
748 // Destruction must be done here as other Tls data depends on it. |
749 // Destruction must be done here as other Tls data depends on it. |
749 CFSEmailDownloadInfoMediator::Destroy(); |
750 CFSEmailDownloadInfoMediator::Destroy(); |
750 |
751 |
751 delete iNaviDecorator2MailViewer; |
752 delete iNaviDecorator; |
752 |
753 |
753 delete iConnectionStatusIconAnimTimer; |
754 delete iConnectionStatusIconAnimTimer; |
754 delete iFakeSyncAnimStopTimer; |
755 delete iFakeSyncAnimStopTimer; |
755 |
756 |
756 MTouchFeedback* touchFeedback( MTouchFeedback::Instance() ); |
757 MTouchFeedback* touchFeedback( MTouchFeedback::Instance() ); |
1599 |
1606 |
1600 if ( !iIsForeground && type == CFsEmailUiViewBase::EScreenLayoutChanged ) |
1607 if ( !iIsForeground && type == CFsEmailUiViewBase::EScreenLayoutChanged ) |
1601 { |
1608 { |
1602 iPendingLayoutSwitch = ETrue; |
1609 iPendingLayoutSwitch = ETrue; |
1603 } |
1610 } |
1604 |
1611 if ( iCurrentActiveView && !iSettingsViewActive && !iMRViewer ) |
1605 if ( iCurrentActiveView && !iSettingsViewActive ) |
|
1606 { |
1612 { |
1607 iCurrentActiveView->HandleDynamicVariantSwitchL( type ); |
1613 iCurrentActiveView->HandleDynamicVariantSwitchL( type ); |
1608 } |
1614 } |
1609 |
1615 |
1610 // Notify status indicator about layout change |
1616 // Notify status indicator about layout change |
2584 TRAP_IGNORE( FsTextureManager()->ProvideBitmapL( |
2590 TRAP_IGNORE( FsTextureManager()->ProvideBitmapL( |
2585 EStatusTextureDisconnectedGeneral, iConnectionIconBitmap, iConnectionIconMask ) ); |
2591 EStatusTextureDisconnectedGeneral, iConnectionIconBitmap, iConnectionIconMask ) ); |
2586 if ( iConnectionIconBitmap ) |
2592 if ( iConnectionIconBitmap ) |
2587 { |
2593 { |
2588 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
2594 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
2589 AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved ); |
2595 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
2590 } |
2596 } |
2591 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask); |
2597 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask); |
2592 } |
2598 } |
2593 iConnectionStatusIconAnimTimer->Stop(); |
2599 iConnectionStatusIconAnimTimer->Stop(); |
2594 } |
2600 } |
2694 } |
2700 } |
2695 |
2701 |
2696 if ( iConnectionIconBitmap ) |
2702 if ( iConnectionIconBitmap ) |
2697 { |
2703 { |
2698 TSize iconSize( LayoutHandler()->statusPaneIconSize() ); |
2704 TSize iconSize( LayoutHandler()->statusPaneIconSize() ); |
2699 AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved ); |
2705 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
2700 } |
2706 } |
2701 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconMask && iConnectionIconBitmap ); |
2707 titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconMask && iConnectionIconBitmap ); |
2702 if (startTimer) |
2708 if (startTimer) |
2703 { |
2709 { |
2704 iConnectionStatusIconAnimTimer->Start( KConnectionStatusIconRotationInterval ); |
2710 iConnectionStatusIconAnimTimer->Start( KConnectionStatusIconRotationInterval ); |
3055 EStatusTextureSynchronising, |
3061 EStatusTextureSynchronising, |
3056 iConnectionIconBitmap, |
3062 iConnectionIconBitmap, |
3057 iConnectionIconMask ); |
3063 iConnectionIconMask ); |
3058 if ( iConnectionIconBitmap && iConnectionIconMask ) |
3064 if ( iConnectionIconBitmap && iConnectionIconMask ) |
3059 { |
3065 { |
3060 AknIconUtils::SetSize( |
3066 AknIconUtils::SetSizeAndRotation( |
3061 iConnectionIconBitmap, |
3067 iConnectionIconBitmap, |
3062 LayoutHandler()->statusPaneIconSize(), |
3068 LayoutHandler()->statusPaneIconSize(), |
3063 EAspectRatioNotPreserved ); |
3069 EAspectRatioNotPreserved, |
3064 titlePane->SetSmallPicture( |
3070 iConnectionStatusIconAngle ); |
3065 iConnectionIconBitmap, |
3071 |
3066 iConnectionIconMask, |
3072 titlePane->SetSmallPicture( |
|
3073 iConnectionIconBitmap, |
|
3074 iConnectionIconMask, |
3067 ETrue ); |
3075 ETrue ); |
3068 iConnectionStatusIconAnimTimer->Start( |
3076 iConnectionStatusIconAnimTimer->Start( |
3069 KConnectionStatusIconRotationInterval ); |
3077 KConnectionStatusIconRotationInterval ); |
3070 iFakeSyncAnimStopTimer->Start( |
3078 iFakeSyncAnimStopTimer->Start( |
3071 KFakeSyncAnimStopTimerInterval ); |
3079 KFakeSyncAnimStopTimerInterval ); |
3075 } |
3083 } |
3076 } |
3084 } |
3077 } |
3085 } |
3078 } |
3086 } |
3079 |
3087 |
3080 // ----------------------------------------------------------------------------- |
|
3081 // |
|
3082 // ----------------------------------------------------------------------------- |
|
3083 void CFreestyleEmailUiAppUi::ConstructNaviPaneL() |
|
3084 { |
|
3085 FUNC_LOG; |
|
3086 |
|
3087 CAknNavigationControlContainer* naviPaneContainer = |
|
3088 static_cast<CAknNavigationControlContainer*>( |
|
3089 StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); |
|
3090 |
|
3091 // Following navipane is for mailviewer view |
|
3092 if ( !iNaviDecorator2MailViewer ) |
|
3093 { |
|
3094 // Constructing a decorator with own decorated control, |
|
3095 // which is (currently an empty) container. |
|
3096 CFreestyleEmailUiNaviPaneControlContainer2MailViewer* c = |
|
3097 CFreestyleEmailUiNaviPaneControlContainer2MailViewer::NewL(); |
|
3098 c->SetContainerWindowL( *naviPaneContainer ); |
|
3099 iNaviDecorator2MailViewer = CAknNavigationDecorator::NewL( |
|
3100 naviPaneContainer, |
|
3101 c, |
|
3102 CAknNavigationDecorator::ENotSpecified ); |
|
3103 |
|
3104 // In order to get navi arrows visible, they must be set visible AND not dimmed... |
|
3105 iNaviDecorator2MailViewer->SetContainerWindowL( *naviPaneContainer ); |
|
3106 iNaviDecorator2MailViewer->MakeScrollButtonVisible( ETrue ); |
|
3107 iNaviDecorator2MailViewer->SetScrollButtonDimmed( CAknNavigationDecorator::ELeftButton, EFalse ); |
|
3108 iNaviDecorator2MailViewer->SetScrollButtonDimmed( CAknNavigationDecorator::ERightButton, EFalse ); |
|
3109 |
|
3110 iNaviDecorator2MailViewer->SetComponentsToInheritVisibility( ETrue ); |
|
3111 naviPaneContainer->PushL( *iNaviDecorator2MailViewer ); |
|
3112 } |
|
3113 } |
|
3114 |
|
3115 // ----------------------------------------------------------------------------- |
|
3116 // |
|
3117 // ----------------------------------------------------------------------------- |
|
3118 CAknNavigationDecorator* CFreestyleEmailUiAppUi::NaviDecoratorL( const TUid aViewId ) |
|
3119 { |
|
3120 FUNC_LOG; |
|
3121 CAknNavigationDecorator* decorator( NULL ); |
|
3122 // Depending on who's asking, return proper navipane instance |
|
3123 if ( aViewId.iUid == MailViewerId.iUid ) |
|
3124 { |
|
3125 if ( !iNaviDecorator2MailViewer ) |
|
3126 { |
|
3127 ConstructNaviPaneL(); |
|
3128 } |
|
3129 decorator = iNaviDecorator2MailViewer; |
|
3130 } |
|
3131 return decorator; |
|
3132 } |
|
3133 |
|
3134 void CFreestyleEmailUiAppUi::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) |
3088 void CFreestyleEmailUiAppUi::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) |
3135 { |
3089 { |
3136 if ( aTriggeredTimer == iConnectionStatusIconAnimTimer ) |
3090 if ( aTriggeredTimer == iConnectionStatusIconAnimTimer ) |
3137 { |
3091 { |
3138 if ( iConnectionStatusVisible ) |
3092 if ( iConnectionStatusVisible ) |
3147 TRAP_IGNORE( titlePane = |
3101 TRAP_IGNORE( titlePane = |
3148 (CAknTitlePane*)StatusPane()->ControlL( titlePaneUid ) ); |
3102 (CAknTitlePane*)StatusPane()->ControlL( titlePaneUid ) ); |
3149 |
3103 |
3150 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
3104 TSize iconSize = LayoutHandler()->statusPaneIconSize(); |
3151 iConnectionStatusIconAngle += KConnectionStatusIconRotationAmount; |
3105 iConnectionStatusIconAngle += KConnectionStatusIconRotationAmount; |
|
3106 iConnectionStatusIconAngle %= KFullCircleInDegrees; |
3152 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
3107 AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); |
3153 titlePane->DrawNow(); |
3108 titlePane->DrawNow(); |
3154 iConnectionStatusIconAnimTimer->Start(KConnectionStatusIconRotationInterval); |
3109 iConnectionStatusIconAnimTimer->Start(KConnectionStatusIconRotationInterval); |
3155 } |
3110 } |
3156 } |
3111 } |
3218 { |
3173 { |
3219 activeView->FlipStateChangedL( iFlipOpen ); |
3174 activeView->FlipStateChangedL( iFlipOpen ); |
3220 } |
3175 } |
3221 } |
3176 } |
3222 |
3177 |
3223 |
3178 void CFreestyleEmailUiAppUi::SetNaviPaneTextL( const TDesC& aText ) |
|
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 } |
3224 |
3207 |
3225 //////////////////////////////////////////////////////////////////////////////// |
3208 //////////////////////////////////////////////////////////////////////////////// |
3226 // |
3209 // |
3227 ///////////////////////////////////////////////////////////////////////////////// |
3210 ///////////////////////////////////////////////////////////////////////////////// |
3228 // ----------------------------------------------------------------------------- |
3211 // ----------------------------------------------------------------------------- |