25 #include <AknsSkinInstance.h> |
25 #include <AknsSkinInstance.h> |
26 #include <apgcli.h> // RApaLsSession |
26 #include <apgcli.h> // RApaLsSession |
27 #include <e32math.h> |
27 #include <e32math.h> |
28 #include <FreestyleEmailUi.rsg> |
28 #include <FreestyleEmailUi.rsg> |
29 #include <touchlogicalfeedback.h> |
29 #include <touchlogicalfeedback.h> |
30 // <cmail> SF path changes |
|
31 #include <alf/alfutil.h> |
30 #include <alf/alfutil.h> |
32 #include <alf/alfenv.h> |
31 #include <alf/alfenv.h> |
33 #include <alf/alfevent.h> |
32 #include <alf/alfevent.h> |
34 #include <alf/alftextvisual.h> |
33 #include <alf/alftextvisual.h> |
35 //</cmail> |
34 #include <aknnotewrappers.h> |
36 #include <aknnotewrappers.h> |
|
37 #include <freestyleemailui.mbg> |
35 #include <freestyleemailui.mbg> |
38 #include <gulicon.h> |
36 #include <gulicon.h> |
39 //<cmail> |
37 #include <akntoolbar.h> |
40 #include "CFSMailMessage.h" |
38 #include "CFSMailMessage.h" |
41 #include <alf/alfframebrush.h> |
39 #include <alf/alfframebrush.h> |
42 #include "CFSMailBox.h" |
40 #include "CFSMailBox.h" |
43 #include "CFSMailClient.h" |
41 #include "CFSMailClient.h" |
44 //</cmail> |
|
45 #include <hlplch.h> |
42 #include <hlplch.h> |
46 #include <akntitle.h> |
43 #include <akntitle.h> |
47 #include <centralrepository.h> |
44 #include <centralrepository.h> |
48 //<cmail> |
|
49 #include <alf/alfanchorlayout.h> |
45 #include <alf/alfanchorlayout.h> |
50 #include <alf/alfbrusharray.h> |
46 #include <alf/alfbrusharray.h> |
51 #include <alf/alfstatic.h> |
47 #include <alf/alfstatic.h> |
52 #include <alf/alfgencomponent.h> |
48 #include <alf/alfgencomponent.h> |
53 #include <alf/alfconstants.h> |
49 #include <alf/alfconstants.h> |
54 #include "fsalfscrollbarlayout.h" |
50 #include "fsalfscrollbarlayout.h" |
55 #include <csxhelp/cmail.hlp.hrh> |
51 #include <csxhelp/cmail.hlp.hrh> |
56 //</cmail> |
|
57 #include <featmgr.h> |
52 #include <featmgr.h> |
58 //</cmail> |
|
59 |
53 |
60 #include <aknmessagequerydialog.h> |
54 #include <aknmessagequerydialog.h> |
61 // <cmail> Use layout data instead of hard-coded values |
55 #include <aknstyluspopupmenu.h> |
62 #include <aknlayoutscalable_avkon.cdl.h> |
56 #include <aknlayoutscalable_avkon.cdl.h> |
63 #include <aknlayoutscalable_apps.cdl.h> |
57 #include <aknlayoutscalable_apps.cdl.h> |
64 #include <layoutmetadata.cdl.h> |
58 #include <layoutmetadata.cdl.h> |
65 // </cmail> |
|
66 |
59 |
67 // INTERNAL INCLUDE FILES |
60 // INTERNAL INCLUDE FILES |
68 #include "FSEmailBuildFlags.h" |
61 #include "FSEmailBuildFlags.h" |
69 #include "FreestyleEmailUiConstants.h" |
62 #include "FreestyleEmailUiConstants.h" |
70 #include "FreestyleEmailUiLiterals.h" |
63 #include "FreestyleEmailUiLiterals.h" |
86 const TInt KSelectTransitionTimeMs = 300; |
79 const TInt KSelectTransitionTimeMs = 300; |
87 const TInt KIconScalingTransitionTimeMs = 350; |
80 const TInt KIconScalingTransitionTimeMs = 350; |
88 const TInt KStartupAnimationTime = 0; |
81 const TInt KStartupAnimationTime = 0; |
89 const TReal KScaleSelected = 1.0; |
82 const TReal KScaleSelected = 1.0; |
90 const TReal KScaleNotSelected = 0.77; |
83 const TReal KScaleNotSelected = 0.77; |
91 // <cmail> Use layout data instead of hard-coded values |
|
92 // </cmail> |
|
93 |
84 |
94 |
85 |
95 CFSEmailUiLauncherGridVisualiser* CFSEmailUiLauncherGridVisualiser::NewL(CAlfEnv& aEnv, |
86 CFSEmailUiLauncherGridVisualiser* CFSEmailUiLauncherGridVisualiser::NewL(CAlfEnv& aEnv, |
96 CFSEmailUiLauncherGrid* aControl, |
87 CFSEmailUiLauncherGrid* aControl, |
97 CFreestyleEmailUiAppUi* aAppUi, |
88 CFreestyleEmailUiAppUi* aAppUi, |
98 CAlfControlGroup& aControlGroup, |
89 CAlfControlGroup& aControlGroup, |
99 TInt aColumns, TInt aRows) |
90 TInt aColumns, TInt aRows) |
100 { |
91 { |
101 FUNC_LOG; |
92 FUNC_LOG; |
102 CFSEmailUiLauncherGridVisualiser* self = CFSEmailUiLauncherGridVisualiser::NewLC(aEnv, aControl, aAppUi, aControlGroup, aRows, aColumns); |
93 CFSEmailUiLauncherGridVisualiser* self = CFSEmailUiLauncherGridVisualiser::NewLC(aEnv, aControl, aAppUi, aControlGroup, aRows, aColumns); |
103 CleanupStack::Pop(self); |
94 CleanupStack::Pop(self); |
104 return self; |
95 return self; |
105 } |
96 } |
106 |
97 |
107 CFSEmailUiLauncherGridVisualiser* CFSEmailUiLauncherGridVisualiser::NewLC(CAlfEnv& aEnv, |
98 CFSEmailUiLauncherGridVisualiser* CFSEmailUiLauncherGridVisualiser::NewLC(CAlfEnv& aEnv, |
108 CFSEmailUiLauncherGrid* aControl, |
99 CFSEmailUiLauncherGrid* aControl, |
109 CFreestyleEmailUiAppUi* aAppUi, |
100 CFreestyleEmailUiAppUi* aAppUi, |
110 CAlfControlGroup& aControlGroup, |
101 CAlfControlGroup& aControlGroup, |
111 TInt aColumns, TInt aRows) |
102 TInt aColumns, TInt aRows) |
112 { |
103 { |
113 FUNC_LOG; |
104 FUNC_LOG; |
114 CFSEmailUiLauncherGridVisualiser* self = new (ELeave) CFSEmailUiLauncherGridVisualiser(aEnv, aControl, aAppUi, aControlGroup); |
105 CFSEmailUiLauncherGridVisualiser* self = new (ELeave) CFSEmailUiLauncherGridVisualiser(aEnv, aControl, aAppUi, aControlGroup); |
115 CleanupStack::PushL(self); |
106 CleanupStack::PushL(self); |
116 self->ConstructL(aColumns, aRows); |
107 self->ConstructL(aColumns, aRows); |
117 return self; |
108 return self; |
118 } |
109 } |
119 |
110 |
120 CFSEmailUiLauncherGridVisualiser::CFSEmailUiLauncherGridVisualiser(CAlfEnv& aEnv, |
111 CFSEmailUiLauncherGridVisualiser::CFSEmailUiLauncherGridVisualiser(CAlfEnv& aEnv, |
121 CFSEmailUiLauncherGrid* aControl, |
112 CFSEmailUiLauncherGrid* aControl, |
122 CFreestyleEmailUiAppUi* aAppUi, |
113 CFreestyleEmailUiAppUi* aAppUi, |
123 CAlfControlGroup& aControlGroup) |
114 CAlfControlGroup& aControlGroup) |
124 : CFsEmailUiViewBase(aControlGroup, *aAppUi), |
115 : CFsEmailUiViewBase(aControlGroup, *aAppUi), |
125 iEnv( aEnv ), |
116 iEnv( aEnv ), |
126 iVisibleRows( 0 ), |
117 iVisibleRows( 0 ), |
127 iVisibleColumns( 0 ), |
118 iVisibleColumns( 0 ), |
128 iRowCount( 0 ), |
119 iRowCount( 0 ), |
129 iFirstVisibleRow( 0 ), |
120 iFirstVisibleRow( 0 ), |
130 iRowHeight( 0 ), |
121 iRowHeight( 0 ), |
147 iVisibleRows = aRows; |
138 iVisibleRows = aRows; |
148 iVisibleColumns = aColumns; |
139 iVisibleColumns = aColumns; |
149 iConstructionCompleted = EFalse; |
140 iConstructionCompleted = EFalse; |
150 iDoubleClickLock = EFalse; |
141 iDoubleClickLock = EFalse; |
151 iUiOperationLaunched = EFalse; |
142 iUiOperationLaunched = EFalse; |
152 |
143 |
153 iMailboxDeleter = CFSEmailUiMailboxDeleter::NewL( *iAppUi.GetMailClient(), *this ); |
144 iMailboxDeleter = CFSEmailUiMailboxDeleter::NewL( *iAppUi.GetMailClient(), *this ); |
154 } |
145 } |
155 |
146 |
|
147 // ---------------------------------------------------------------------------- |
156 // CFSEmailUiLauncherGridVisualiser::DoFirstStartL() |
148 // CFSEmailUiLauncherGridVisualiser::DoFirstStartL() |
157 // Purpose of this function is to do first start only when grid is |
149 // Purpose of this function is to do first start only when grid is really |
158 // really needed to be shown. Implemented to make app startuo faster. |
150 // needed to be shown. Implemented to make app startup faster. |
|
151 // ---------------------------------------------------------------------------- |
|
152 // |
159 void CFSEmailUiLauncherGridVisualiser::DoFirstStartL() |
153 void CFSEmailUiLauncherGridVisualiser::DoFirstStartL() |
160 { |
154 { |
161 FUNC_LOG; |
155 FUNC_LOG; |
162 iPluginIdIconIdPairs.Reset(); |
156 iPluginIdIconIdPairs.Reset(); |
163 |
157 |
164 // <cmail> Use layout data instead of hard-coded values |
|
165 TRect mainPaneRect; |
158 TRect mainPaneRect; |
166 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
159 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
167 |
160 mainPaneRect ); |
|
161 |
168 TAknLayoutRect scrollBarRect; |
162 TAknLayoutRect scrollBarRect; |
169 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
163 scrollBarRect.LayoutRect( mainPaneRect, |
|
164 AknLayoutScalable_Avkon::aid_size_touch_scroll_bar() ); |
170 TRect gridRect = mainPaneRect; |
165 TRect gridRect = mainPaneRect; |
171 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
166 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
172 |
167 |
173 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
168 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
174 iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; |
169 iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastRow() + 1; |
175 iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; |
170 iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastColumn() + 1; |
176 // </cmail> |
171 |
177 |
|
178 iStartupAnimation = ETrue; |
172 iStartupAnimation = ETrue; |
179 iCurrentLevel.iSelected = KDefaultSelection; |
173 iCurrentLevel.iSelected = KDefaultSelection; |
180 CAlfTextureManager& manager = iEnv.TextureManager(); |
174 CAlfTextureManager& manager = iEnv.TextureManager(); |
181 |
175 |
182 iParentLayout = CAlfDeckLayout::AddNewL(*iControl); |
176 iParentLayout = CAlfDeckLayout::AddNewL( *iControl ); |
183 iParentLayout->SetFlags(EAlfVisualFlagLayoutUpdateNotification); |
177 iParentLayout->SetFlags( EAlfVisualFlagLayoutUpdateNotification ); |
184 |
178 |
185 // Widget layout divides the screen between grid and scroll bar |
179 // Widget layout divides the screen between grid and scroll bar |
186 iWidgetLayout = CAlfAnchorLayout::AddNewL( *iControl, iParentLayout ); |
180 iWidgetLayout = CAlfAnchorLayout::AddNewL( *iControl, iParentLayout ); |
187 //<cmail> |
181 TSize displaySize = mainPaneRect.Size(); |
188 TSize displaySize = mainPaneRect.Size(); //iControl->DisplayArea().Size(); |
|
189 //</cmail> |
|
190 iWidgetLayout->SetSize( displaySize ); |
182 iWidgetLayout->SetSize( displaySize ); |
191 |
183 |
192 // Constructed here, updated later, #0 item in iWidgetLayout |
184 // Constructed here, updated later, #0 item in iWidgetLayout |
193 ConstructScrollbarL( iWidgetLayout ); |
185 ConstructScrollbarL( iWidgetLayout ); |
194 |
186 |
195 // Grid layout is constructed here, #1 item in iWidgetLayout |
187 // Grid layout is constructed here, #1 item in iWidgetLayout |
196 iCurrentLevel.iGridLayout = CAlfGridLayout::AddNewL( *iControl, iVisibleColumns, iVisibleRows, iWidgetLayout ); |
188 iCurrentLevel.iGridLayout = |
|
189 CAlfGridLayout::AddNewL( *iControl, iVisibleColumns, iVisibleRows, |
|
190 iWidgetLayout ); |
197 iCurrentLevel.iGridLayout->EnableScrollingL( ETrue ); |
191 iCurrentLevel.iGridLayout->EnableScrollingL( ETrue ); |
198 iCurrentLevel.iGridLayout->SetFlags( EAlfVisualFlagAutomaticLocaleMirroringEnabled ); |
192 iCurrentLevel.iGridLayout->SetFlags( EAlfVisualFlagAutomaticLocaleMirroringEnabled ); |
199 |
193 |
200 // Selector is added to iGridLayout |
194 // Selector is added to iGridLayout |
201 iSelector = iControl->AppendLayoutL( EAlfLayoutTypeLayout, iCurrentLevel.iGridLayout ); |
195 iSelector = iControl->AppendLayoutL( EAlfLayoutTypeLayout, |
|
196 iCurrentLevel.iGridLayout ); |
202 iSelector->SetFlags( EAlfVisualFlagManualLayout ); |
197 iSelector->SetFlags( EAlfVisualFlagManualLayout ); |
203 |
198 |
204 iRingMovementXFunc = CAlfTableMappingFunction::NewL(iEnv); |
199 iRingMovementXFunc = CAlfTableMappingFunction::NewL( iEnv ); |
205 iRingMovementYFunc = CAlfTableMappingFunction::NewL(iEnv); |
200 iRingMovementYFunc = CAlfTableMappingFunction::NewL( iEnv ); |
206 |
201 |
207 TAlfTimedPoint selectorPos = iSelector->Pos(); |
202 TAlfTimedPoint selectorPos = iSelector->Pos(); |
208 selectorPos.iX.SetMappingFunctionIdentifier( iRingMovementXFunc->MappingFunctionIdentifier() ); |
203 selectorPos.iX.SetMappingFunctionIdentifier( iRingMovementXFunc->MappingFunctionIdentifier() ); |
209 selectorPos.iY.SetMappingFunctionIdentifier( iRingMovementYFunc->MappingFunctionIdentifier() ); |
204 selectorPos.iY.SetMappingFunctionIdentifier( iRingMovementYFunc->MappingFunctionIdentifier() ); |
210 iSelector->SetPos( selectorPos ); |
205 iSelector->SetPos( selectorPos ); |
211 |
206 |
212 UpdateFocusVisibility(); |
207 UpdateFocusVisibility(); |
213 iSelectorImageVisual = CAlfImageVisual::AddNewL( *iControl, iSelector ); |
208 iSelectorImageVisual = CAlfImageVisual::AddNewL( *iControl, iSelector ); |
214 iSelectorImageVisual->SetScaleMode( CAlfImageVisual::EScaleFit ); |
209 iSelectorImageVisual->SetScaleMode( CAlfImageVisual::EScaleFit ); |
215 // <cmail> Use layout data instead of hard-coded values |
210 |
|
211 // Use layout data instead of hard-coded values |
216 iSelectorImageVisual->SetSize( iAppUi.LayoutHandler()->SelectorVisualSizeInThisResolution() ); |
212 iSelectorImageVisual->SetSize( iAppUi.LayoutHandler()->SelectorVisualSizeInThisResolution() ); |
217 TAknLayoutRect itemRect; |
213 TAknLayoutRect itemRect; |
218 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var,0,0)); |
214 itemRect.LayoutRect( gridRect, |
|
215 AknLayoutScalable_Apps::cell_cmail_l_pane( var, 0, 0 ) ); |
219 iSelectorImageVisual->SetSize( itemRect.Rect().Size() ); |
216 iSelectorImageVisual->SetSize( itemRect.Rect().Size() ); |
220 // </cmail> |
|
221 |
|
222 iSelectorImageVisual->EnableBrushesL(); |
217 iSelectorImageVisual->EnableBrushesL(); |
223 CAlfFrameBrush* brush = iAppUi.FsTextureManager()->GridSelectorBrushL(); |
218 CAlfFrameBrush* brush = iAppUi.FsTextureManager()->GridSelectorBrushL(); |
224 iSelectorImageVisual->Brushes()->AppendL( brush, EAlfDoesNotHaveOwnership ); |
219 iSelectorImageVisual->Brushes()->AppendL( brush, EAlfDoesNotHaveOwnership ); |
225 iStartupEffectStyle = EFalse; |
220 iStartupEffectStyle = EFalse; |
226 |
221 |
227 iAiwSHandler = CAiwServiceHandler::NewL(); |
222 iAiwSHandler = CAiwServiceHandler::NewL(); |
228 iAiwSHandler->AttachL( R_AIW_INTEREST_LAUNCH_SETUP_WIZARD ); |
223 iAiwSHandler->AttachL( R_AIW_INTEREST_LAUNCH_SETUP_WIZARD ); |
|
224 |
|
225 if( !iStylusPopUpMenu ) |
|
226 { |
|
227 // Construct the long tap pop-up menu. |
|
228 TPoint point( 0, 0 ); |
|
229 iStylusPopUpMenu = CAknStylusPopUpMenu::NewL( this , point ); |
|
230 TResourceReader reader; |
|
231 iCoeEnv->CreateResourceReaderLC( reader, |
|
232 R_STYLUS_POPUP_MENU_LAUNCHER_GRID_VIEW ); |
|
233 iStylusPopUpMenu->ConstructFromResourceL( reader ); |
|
234 CleanupStack::PopAndDestroy(); // reader |
|
235 } |
229 |
236 |
230 // Initial visual layout update is done when the view gets activated. |
237 // Initial visual layout update is done when the view gets activated. |
231 iRefreshNeeded = ETrue; |
238 iRefreshNeeded = ETrue; |
232 |
239 |
233 // First start toggle |
240 // First start toggle |
331 itemInModel.Append( EFalse ); |
337 itemInModel.Append( EFalse ); |
332 } |
338 } |
333 |
339 |
334 TInt count = reader.ReadInt16(); |
340 TInt count = reader.ReadInt16(); |
335 |
341 |
336 // <cmail> Use layout data instead of hard-coded values |
342 // <cmail> Use layout data instead of hard-coded values |
337 TRect mainPaneRect; |
343 TRect mainPaneRect; |
338 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
344 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
339 |
345 |
340 TAknLayoutRect scrollBarRect; |
346 TAknLayoutRect scrollBarRect; |
341 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
347 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
342 TRect gridRect = mainPaneRect; |
348 TRect gridRect = mainPaneRect; |
343 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
349 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
344 |
350 |
345 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
351 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
346 TAknLayoutRect itemRect; |
352 TAknLayoutRect itemRect; |
347 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var,0,0)); |
353 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var,0,0)); |
348 |
354 |
349 TAknLayoutRect gridIconLRect; |
355 TAknLayoutRect gridIconLRect; |
350 gridIconLRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
356 gridIconLRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
351 TSize iconSize = gridIconLRect.Rect().Size(); |
357 TSize iconSize = gridIconLRect.Rect().Size(); |
352 // </cmail> |
358 // </cmail> |
353 |
359 |
354 for ( TInt itemIndex = 0; itemIndex < count; itemIndex++ ) |
360 for ( TInt itemIndex = 0; itemIndex < count; itemIndex++ ) |
355 { |
361 { |
356 TInt itemId = reader.ReadInt16(); |
362 TInt itemId = reader.ReadInt16(); |
357 switch ( itemId ) |
363 switch ( itemId ) |
358 { |
364 { |
359 case EDefaultMailboxItem: |
365 case EDefaultMailboxItem: |
360 { |
366 { |
361 |
367 |
362 RPointerArray<CFSMailBox> mailBoxes; |
368 RPointerArray<CFSMailBox> mailBoxes; |
363 CleanupResetAndDestroyClosePushL( mailBoxes ); |
369 CleanupResetAndDestroyClosePushL( mailBoxes ); |
364 TFSMailMsgId id; |
370 TFSMailMsgId id; |
365 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
371 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
366 id, |
372 id, |
367 mailBoxes ); |
373 mailBoxes ); |
368 |
374 |
369 if ( mailBoxes.Count() > 0 ) |
375 if ( mailBoxes.Count() > 0 ) |
370 { |
376 { |
371 // Try to get branded graphic |
377 // Try to get branded graphic |
372 CGulIcon* mbIcon(0); |
378 CGulIcon* mbIcon(0); |
373 TRAPD( err, mbIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailBoxes[0]->GetId() ) ); |
379 TRAPD( err, mbIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailBoxes[0]->GetId() ) ); |
374 if ( err == KErrNone && mbIcon ) |
380 if ( err == KErrNone && mbIcon ) |
375 { |
381 { |
376 CleanupStack::PushL( mbIcon ); |
382 CleanupStack::PushL( mbIcon ); |
377 AknIconUtils::SetSize(mbIcon->Bitmap(), iconSize); |
383 AknIconUtils::SetSize(mbIcon->Bitmap(), iconSize); |
378 AknIconUtils::SetSize(mbIcon->Mask(), iconSize); |
384 AknIconUtils::SetSize(mbIcon->Mask(), iconSize); |
379 |
385 |
380 // Create texture into TextureManager, If not already existing |
386 // Create texture into TextureManager, If not already existing |
381 // Note: size(0,0) means original icon size |
387 // Note: size(0,0) means original icon size |
382 iAppUi.FsTextureManager()->CreateBrandedMailboxTexture( mbIcon, |
388 iAppUi.FsTextureManager()->CreateBrandedMailboxTexture( mbIcon, |
383 mailBoxes[0]->GetId().PluginId(), |
389 mailBoxes[0]->GetId().PluginId(), |
384 mailBoxes[0]->GetId().Id(), |
390 mailBoxes[0]->GetId().Id(), |
403 EShortcut, |
409 EShortcut, |
404 EDefaultMailboxItem, |
410 EDefaultMailboxItem, |
405 mailBoxes[0]->GetName(), |
411 mailBoxes[0]->GetName(), |
406 *iconTexture, |
412 *iconTexture, |
407 mailBoxes[0]->GetId(), |
413 mailBoxes[0]->GetId(), |
408 mailBoxes[0]->GetStandardFolderId( EFSInbox ) ); |
414 mailBoxes[0]->GetStandardFolderId( EFSInbox ) ); |
409 |
415 |
410 iAppUi.SubscribeMailboxL( mailBoxes[0]->GetId() ); |
416 iAppUi.SubscribeMailboxL( mailBoxes[0]->GetId() ); |
411 } |
417 } |
412 |
418 |
413 CleanupStack::PopAndDestroy( &mailBoxes ); |
419 CleanupStack::PopAndDestroy( &mailBoxes ); |
414 } |
420 } |
415 break; |
421 break; |
416 case EOtherMailboxItems: |
422 case EOtherMailboxItems: |
417 { |
423 { |
418 RPointerArray<CFSMailBox> mailBoxes; |
424 RPointerArray<CFSMailBox> mailBoxes; |
419 CleanupResetAndDestroyClosePushL( mailBoxes ); |
425 CleanupResetAndDestroyClosePushL( mailBoxes ); |
420 TFSMailMsgId id; |
426 TFSMailMsgId id; |
421 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
427 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
422 id, |
428 id, |
423 mailBoxes ); |
429 mailBoxes ); |
424 |
430 |
425 for ( TInt i = 1; i < mailBoxes.Count(); i++ ) |
431 for ( TInt i = 1; i < mailBoxes.Count(); i++ ) |
426 { |
432 { |
427 // Try to get branded graphic |
433 // Try to get branded graphic |
428 CGulIcon* mbIcon(0); |
434 CGulIcon* mbIcon(0); |
429 TRAPD( err, mbIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailBoxes[i]->GetId() ) ); |
435 TRAPD( err, mbIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailBoxes[i]->GetId() ) ); |
430 if ( err == KErrNone && mbIcon ) |
436 if ( err == KErrNone && mbIcon ) |
431 { |
437 { |
432 CleanupStack::PushL( mbIcon ); |
438 CleanupStack::PushL( mbIcon ); |
433 AknIconUtils::SetSize(mbIcon->Bitmap(), iconSize); |
439 AknIconUtils::SetSize(mbIcon->Bitmap(), iconSize); |
434 AknIconUtils::SetSize(mbIcon->Mask(), iconSize); |
440 AknIconUtils::SetSize(mbIcon->Mask(), iconSize); |
435 |
441 |
436 // Create texture into TextureManager, If not already existing |
442 // Create texture into TextureManager, If not already existing |
437 iAppUi.FsTextureManager()->CreateBrandedMailboxTexture( mbIcon, |
443 iAppUi.FsTextureManager()->CreateBrandedMailboxTexture( mbIcon, |
438 mailBoxes[i]->GetId().PluginId(), |
444 mailBoxes[i]->GetId().PluginId(), |
439 mailBoxes[i]->GetId().Id(), |
445 mailBoxes[i]->GetId().Id(), |
440 TSize(0,0)); |
446 TSize(0,0)); |
442 iconTexture = &iAppUi.FsTextureManager()->TextureByMailboxIdL( mailBoxes[i]->GetId().PluginId(), |
448 iconTexture = &iAppUi.FsTextureManager()->TextureByMailboxIdL( mailBoxes[i]->GetId().PluginId(), |
443 mailBoxes[i]->GetId().Id(), |
449 mailBoxes[i]->GetId().Id(), |
444 TSize(0,0)); |
450 TSize(0,0)); |
445 CleanupStack::PopAndDestroy( mbIcon ); |
451 CleanupStack::PopAndDestroy( mbIcon ); |
446 } |
452 } |
447 else |
453 else |
448 { |
454 { |
449 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridInboxTexture ); |
455 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridInboxTexture ); |
450 } |
456 } |
451 iIconArray.AppendL( iconTexture ); |
457 iIconArray.AppendL( iconTexture ); |
452 // Branded mailbox name is nowadays set in new mailbox event |
458 // Branded mailbox name is nowadays set in new mailbox event |
453 // handling, so we don't need to use brand manager here anymore. |
459 // handling, so we don't need to use brand manager here anymore. |
454 iModel->AddL( |
460 iModel->AddL( |
455 EShortcut, |
461 EShortcut, |
456 EDefaultMailboxItem, |
462 EDefaultMailboxItem, |
457 mailBoxes[i]->GetName(), |
463 mailBoxes[i]->GetName(), |
458 *iconTexture, |
464 *iconTexture, |
459 mailBoxes[i]->GetId(), |
465 mailBoxes[i]->GetId(), |
460 mailBoxes[i]->GetStandardFolderId( EFSInbox ) ); |
466 mailBoxes[i]->GetStandardFolderId( EFSInbox ) ); |
461 |
467 |
462 iAppUi.SubscribeMailboxL( mailBoxes[i]->GetId() ); |
468 iAppUi.SubscribeMailboxL( mailBoxes[i]->GetId() ); |
463 } |
469 } |
464 |
470 |
465 CleanupStack::PopAndDestroy( &mailBoxes ); |
471 CleanupStack::PopAndDestroy( &mailBoxes ); |
466 } |
472 } |
467 break; |
473 break; |
468 case EDirectoryItem: |
474 case EDirectoryItem: |
469 { |
475 { |
470 RPointerArray<CFSMailBox> mailBoxes; |
476 RPointerArray<CFSMailBox> mailBoxes; |
471 CleanupResetAndDestroyClosePushL( mailBoxes ); |
477 CleanupResetAndDestroyClosePushL( mailBoxes ); |
472 TFSMailMsgId id; |
478 TFSMailMsgId id; |
473 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
479 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
474 id, |
480 id, |
475 mailBoxes ); |
481 mailBoxes ); |
476 |
482 |
477 for ( TInt i = 0; i < mailBoxes.Count(); i++ ) |
483 for ( TInt i = 0; i < mailBoxes.Count(); i++ ) |
478 { |
484 { |
479 if ( TFsEmailUiUtility::IsRemoteLookupSupported( *mailBoxes[i] ) ) |
485 if ( TFsEmailUiUtility::IsRemoteLookupSupported( *mailBoxes[i] ) ) |
480 { |
486 { |
481 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_DIRECTORY ); |
487 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_DIRECTORY ); |
494 { |
500 { |
495 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_SETTINGS ); |
501 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_SETTINGS ); |
496 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridSettingsTexture ); |
502 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridSettingsTexture ); |
497 iModel->AddL(EShortcut, ESettingsItem, *text, *iconTexture ); |
503 iModel->AddL(EShortcut, ESettingsItem, *text, *iconTexture ); |
498 CleanupStack::PopAndDestroy( text ); |
504 CleanupStack::PopAndDestroy( text ); |
499 iIconArray.AppendL( iconTexture ); |
505 iIconArray.AppendL( iconTexture ); |
500 } |
506 } |
501 break; |
507 break; |
502 case EAddNewMailboxItem: |
508 case EAddNewMailboxItem: |
503 { |
509 { |
504 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_ADD_NEW_MAILBOX ); |
510 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_ADD_NEW_MAILBOX ); |
505 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridAddNewBoxTexture ); |
511 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridAddNewBoxTexture ); |
506 iModel->AddL(EShortcut, EAddNewMailboxItem, *text, *iconTexture ); |
512 iModel->AddL(EShortcut, EAddNewMailboxItem, *text, *iconTexture ); |
507 CleanupStack::PopAndDestroy( text ); |
513 CleanupStack::PopAndDestroy( text ); |
508 iIconArray.AppendL( iconTexture ); |
514 iIconArray.AppendL( iconTexture ); |
509 } |
515 } |
510 break; |
516 break; |
511 case EHelpItem: |
517 case EHelpItem: |
512 { |
518 { |
513 // remove help support in pf5250 |
519 // remove help support in pf5250 |
514 if (! FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
520 if (! FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
515 { |
521 { |
516 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_HELP ); |
522 HBufC* text = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_GRIDITEM_HELP ); |
517 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridHelpTexture ); |
523 iconTexture = &iAppUi.FsTextureManager()->TextureByIndex( EGridHelpTexture ); |
518 iModel->AddL(EShortcut, EHelpItem, *text, *iconTexture ); |
524 iModel->AddL(EShortcut, EHelpItem, *text, *iconTexture ); |
519 CleanupStack::PopAndDestroy( text ); |
525 CleanupStack::PopAndDestroy( text ); |
520 iIconArray.AppendL( iconTexture ); |
526 iIconArray.AppendL( iconTexture ); |
521 } |
527 } |
522 } |
528 } |
523 break; |
529 break; |
524 case EIntellisyncFileSyncItem: |
530 case EIntellisyncFileSyncItem: |
525 case EIntellisyncTravelInfoItem: |
531 case EIntellisyncTravelInfoItem: |
649 // scroll bar needs to be updated manually anyway |
655 // scroll bar needs to be updated manually anyway |
650 UpdateScrollBarRangeL(); |
656 UpdateScrollBarRangeL(); |
651 } |
657 } |
652 |
658 |
653 SetDefaultStatusPaneTextL(); |
659 SetDefaultStatusPaneTextL(); |
654 |
660 |
655 // Mailbox query is called here but shown only once in appui if needed |
661 // Mailbox query is called here but shown only once in appui if needed |
656 // doNotshowQuery is ETrue when started from wizard |
662 // doNotshowQuery is ETrue when started from wizard |
657 if ( !iFirstStartComplete ) |
663 if ( !iFirstStartComplete ) |
658 { |
664 { |
659 iFirstStartComplete = ETrue; |
665 iFirstStartComplete = ETrue; |
660 iAppUi.GridStarted( startedFromOds ); |
666 iAppUi.GridStarted( startedFromOds ); |
661 iAppUi.ShowMailboxQueryL(); |
667 iAppUi.ShowMailboxQueryL(); |
662 } |
668 } |
663 // <cmail> |
669 // <cmail> |
664 else |
670 else |
665 { |
671 { |
666 // Ensure that FSMailServer is running, but don't do it on first |
672 // Ensure that FSMailServer is running, but don't do it on first |
667 // activation, as it's done anyway in AppUi's ConstructL |
673 // activation, as it's done anyway in AppUi's ConstructL |
668 TFsEmailUiUtility::EnsureFsMailServerIsRunning( iEikonEnv->WsSession() ); |
674 TFsEmailUiUtility::EnsureFsMailServerIsRunning( iEikonEnv->WsSession() ); |
669 } |
675 } |
670 |
676 |
671 if( iRowCount > iVisibleRows ) |
677 if( iRowCount > iVisibleRows ) |
672 { |
678 { |
673 iScrollbar->MakeVisible(ETrue); |
679 iScrollbar->MakeVisible(ETrue); |
674 } |
680 } |
675 else |
681 else |
676 { |
682 { |
677 iScrollbar->MakeVisible(EFalse); |
683 iScrollbar->MakeVisible(EFalse); |
678 } |
684 } |
679 |
685 |
680 iAppUi.HideTitlePaneConnectionStatus(); |
686 iAppUi.HideTitlePaneConnectionStatus(); |
681 |
687 |
682 // Erase the navigation history when main grid activated. This is the default view |
688 // Erase the navigation history when main grid activated. This is the default view |
683 // of the application and back navigation is never possible from here. The view stack |
689 // of the application and back navigation is never possible from here. The view stack |
684 // might be in inconsistent state because of some unexpected error in view switching. |
690 // might be in inconsistent state because of some unexpected error in view switching. |
685 // Erasing the history helps recovering from such situations. |
691 // Erasing the history helps recovering from such situations. |
686 iAppUi.EraseViewHistory(); |
692 iAppUi.EraseViewHistory(); |
687 |
693 FocusVisibilityChange( iAppUi.IsFocusShown() ); |
688 UpdateFocusVisibility(); |
694 UpdateFocusVisibility(); |
689 } |
695 } |
690 // </cmail> Toolbar |
|
691 |
696 |
692 void CFSEmailUiLauncherGridVisualiser::ChildDoDeactivate() |
697 void CFSEmailUiLauncherGridVisualiser::ChildDoDeactivate() |
693 { |
698 { |
694 FUNC_LOG; |
699 FUNC_LOG; |
695 iScrollbar->MakeVisible(EFalse); |
700 iScrollbar->MakeVisible(EFalse); |
696 // </cmail> |
701 } |
697 } |
|
698 |
|
699 |
702 |
700 void CFSEmailUiLauncherGridVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
703 void CFSEmailUiLauncherGridVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
701 { |
704 { |
702 FUNC_LOG; |
705 FUNC_LOG; |
703 |
706 |
704 if ( aResourceId == R_FSEMAILUI_MAINUIGRID_MENUPANE ) |
707 if ( aResourceId == R_FSEMAILUI_MAINUIGRID_MENUPANE ) |
705 { |
708 { |
706 if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
709 if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
707 { |
710 { |
708 // remove help support in pf5250 |
711 // remove help support in pf5250 |
709 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
712 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
710 } |
713 } |
711 |
714 |
712 TFSLauncherGridMailboxStatus mbStatus = CheckMailboxStatusL(); |
715 TFSLauncherGridMailboxStatus mbStatus = CheckMailboxStatusL(); |
713 |
716 |
714 // Checks if a device has a keyboard or not. |
717 // Checks if a device has a keyboard or not. |
715 if( !iKeyboardFlipOpen ) |
718 if( !iKeyboardFlipOpen ) |
716 { |
719 { |
717 if( mbStatus.iMailboxCount <= 0 ) |
720 if( mbStatus.iMailboxCount <= 0 ) |
718 { |
721 { |
719 // If no mailboxes configured, dim all mailbox related items. |
722 // If no mailboxes configured, dim all mailbox related items. |
720 aMenuPane->SetItemDimmed( EFsEmailUiCmdDeleteMailbox, ETrue ); |
723 aMenuPane->SetItemDimmed( EFsEmailUiCmdDeleteMailbox, ETrue ); |
721 } |
724 } |
722 |
725 |
723 aMenuPane->SetItemDimmed( EFsEmailUiCmdOpen, ETrue ); |
726 aMenuPane->SetItemDimmed( EFsEmailUiCmdOpen, ETrue ); |
724 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
727 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
725 aMenuPane->SetItemDimmed( EFsEmailUiCmdSyncAll, ETrue ); |
728 aMenuPane->SetItemDimmed( EFsEmailUiCmdSyncAll, ETrue ); |
726 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); |
729 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); |
727 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
730 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
730 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnlineAll, ETrue ); |
733 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnlineAll, ETrue ); |
731 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
734 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
732 } |
735 } |
733 else |
736 else |
734 { |
737 { |
735 // <cmail> |
738 // <cmail> |
736 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
739 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
737 // </cmail> |
740 // </cmail> |
738 |
741 |
739 if( mbStatus.iMailboxCount <= 0 ) |
742 if( mbStatus.iMailboxCount <= 0 ) |
740 { |
743 { |
741 // If no mailboxes configured, dimm all mailbox related items |
744 // If no mailboxes configured, dimm all mailbox related items |
742 aMenuPane->SetItemDimmed( EFsEmailUiCmdDeleteMailbox, ETrue ); |
745 aMenuPane->SetItemDimmed( EFsEmailUiCmdDeleteMailbox, ETrue ); |
743 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue); |
746 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue); |
744 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
747 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
745 aMenuPane->SetItemDimmed( EFsEmailUiCmdSyncAll, ETrue ); |
748 aMenuPane->SetItemDimmed( EFsEmailUiCmdSyncAll, ETrue ); |
746 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnline, ETrue ); |
749 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnline, ETrue ); |
747 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnlineAll, ETrue ); |
750 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnlineAll, ETrue ); |
748 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
751 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
836 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
839 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
837 } |
840 } |
838 } |
841 } |
839 |
842 |
840 // Add shortcut hints |
843 // Add shortcut hints |
841 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
844 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
842 CFSEmailUiShortcutBinding::EContextMainGrid ); |
845 CFSEmailUiShortcutBinding::EContextMainGrid ); |
843 } |
846 } |
844 } |
847 } |
845 } |
848 } |
846 |
849 |
847 void CFSEmailUiLauncherGridVisualiser::HandleCommandL(TInt aCommand) |
850 void CFSEmailUiLauncherGridVisualiser::HandleCommandL( TInt aCommand ) |
848 { |
851 { |
849 FUNC_LOG; |
852 FUNC_LOG; |
|
853 |
850 switch ( aCommand ) |
854 switch ( aCommand ) |
851 { |
855 { |
852 case EAknSoftkeyOpen: |
856 case EAknSoftkeyOpen: |
853 { |
857 { |
854 if (!iAppUi.IsTimerFocusShown()) |
858 if( !iAppUi.IsFocusShown() ) |
855 { |
859 { |
856 int wasActive = iAppUi.StartFocusRemovalTimer(); |
860 // No need to handle return value |
857 |
861 iAppUi.SetFocusVisibility( ETrue ); |
858 if (!wasActive) |
862 UpdateFocusVisibility(); |
859 { |
863 ResizeItemIcon( EFalse ); |
860 UpdateFocusVisibility(); |
|
861 ResizeItemIcon( EFalse ); |
|
862 } |
|
863 |
|
864 break; |
864 break; |
865 } |
865 } |
866 } |
866 } |
867 case EFsEmailUiCmdOpen: |
867 case EFsEmailUiCmdOpen: |
868 { |
868 { |
869 SelectL(); |
869 SelectL(); |
|
870 break; |
870 } |
871 } |
871 break; |
|
872 // <cmail> Hiding is disabled in Cmail |
|
873 // case EFsEmailUiCmdHide: |
|
874 // { |
|
875 // TApaTaskList taskList( iEikonEnv->WsSession() ); |
|
876 // TApaTask task = taskList.FindApp( KFSEmailUiUid ); |
|
877 // if ( task.Exists() ) |
|
878 // { |
|
879 // task.SendToBackground(); // Send self to background |
|
880 // } |
|
881 // } |
|
882 // break; |
|
883 // </cmail> |
|
884 case EFsEmailUiCmdDeleteMailbox: |
872 case EFsEmailUiCmdDeleteMailbox: |
885 { |
873 { |
|
874 // Deletion by using the option menu. |
886 iMailboxDeleter->DeleteMailboxL(); |
875 iMailboxDeleter->DeleteMailboxL(); |
887 break; |
876 break; |
888 } |
877 } |
|
878 case EFsEmailUiCmdDeleteSelectedMailbox: |
|
879 { |
|
880 // Deletion by using the long tap pop-up menu. |
|
881 iMailboxDeleter->DeleteMailboxL( iMailboxToDelete ); |
|
882 |
|
883 // Hide the focus. |
|
884 iAppUi.SetFocusVisibility( EFalse ); |
|
885 HandleButtonReleaseEvent(); // Finishes the focus removal. |
|
886 break; |
|
887 } |
889 case EFsEmailUiCmdSync: |
888 case EFsEmailUiCmdSync: |
890 case EFsEmailUiCmdSyncAll: |
889 case EFsEmailUiCmdSyncAll: |
891 { |
890 { |
892 if (aCommand == EFsEmailUiCmdSyncAll) |
891 if (aCommand == EFsEmailUiCmdSyncAll) |
893 { |
892 { |
894 iAppUi.ManualMailBoxSyncAll(ETrue); |
893 iAppUi.ManualMailBoxSyncAll(ETrue); |
895 } |
894 } |
896 else |
895 else |
897 { |
896 { |
898 iAppUi.ManualMailBoxSync(ETrue); |
897 iAppUi.ManualMailBoxSync(ETrue); |
899 } |
898 } |
900 RPointerArray<CFSMailBox> mailBoxes; |
899 RPointerArray<CFSMailBox> mailBoxes; |
901 CleanupResetAndDestroyClosePushL( mailBoxes ); |
900 CleanupResetAndDestroyClosePushL( mailBoxes ); |
902 TFSMailMsgId id; |
901 TFSMailMsgId id; |
903 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
902 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
904 id, |
903 id, |
905 mailBoxes ); |
904 mailBoxes ); |
906 |
905 |
907 for ( TInt i = 0; i < mailBoxes.Count(); i++ ) |
906 for ( TInt i = 0; i < mailBoxes.Count(); i++ ) |
908 { |
907 { |
909 iAppUi.SubscribeMailboxL( mailBoxes[i]->GetId() ); |
908 iAppUi.SubscribeMailboxL( mailBoxes[i]->GetId() ); |
910 // <cmail> |
|
911 mailBoxes[i]->GetMailBoxStatus(); |
909 mailBoxes[i]->GetMailBoxStatus(); |
912 // </cmail> |
|
913 mailBoxes[i]->RefreshNowL( iAppUi ); |
910 mailBoxes[i]->RefreshNowL( iAppUi ); |
914 } |
911 } |
915 |
912 |
916 CleanupStack::PopAndDestroy( &mailBoxes ); |
913 CleanupStack::PopAndDestroy( &mailBoxes ); |
917 } |
914 } |
918 break; |
915 break; |
919 case EFsEmailUiCmdCancelSync: |
916 case EFsEmailUiCmdCancelSync: |
920 { |
917 { |
921 RPointerArray<CFSMailBox> mailBoxes; |
918 RPointerArray<CFSMailBox> mailBoxes; |
922 CleanupResetAndDestroyClosePushL( mailBoxes ); |
919 CleanupResetAndDestroyClosePushL( mailBoxes ); |
923 TFSMailMsgId id; |
920 TFSMailMsgId id; |
924 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
921 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
925 id, |
922 id, |
926 mailBoxes ); |
923 mailBoxes ); |
927 |
924 |
928 for ( TInt i = 0; i < mailBoxes.Count(); i++ ) |
925 for ( TInt i = 0; i < mailBoxes.Count(); i++ ) |
981 CleanupStack::PopAndDestroy( &mailBoxes ); |
978 CleanupStack::PopAndDestroy( &mailBoxes ); |
982 } |
979 } |
983 break; |
980 break; |
984 case EFsEmailUiCmdAbout: |
981 case EFsEmailUiCmdAbout: |
985 { |
982 { |
986 DisplayProductInfoL(); |
983 DisplayProductInfoL(); |
987 } |
984 } |
988 break; |
985 break; |
989 case EFsEmailUiCmdHelp: |
986 case EFsEmailUiCmdHelp: |
990 { |
987 { |
991 TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); |
988 TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); |
992 } |
989 } |
993 break; |
990 break; |
994 // <cmail> |
991 case KErrCancel: |
|
992 { |
|
993 // The pop-up menu was closed. Hide the focus. |
|
994 iAppUi.SetFocusVisibility( EFalse ); |
|
995 HandleButtonReleaseEvent(); // Finishes the focus removal. |
|
996 break; |
|
997 } |
995 case EFsEmailUiCmdHide: |
998 case EFsEmailUiCmdHide: |
996 // </cmail> |
|
997 case EEikCmdExit: |
999 case EEikCmdExit: |
998 case EAknSoftkeyExit: |
1000 case EAknSoftkeyExit: |
999 case EFsEmailUiCmdExit: |
1001 case EFsEmailUiCmdExit: |
1000 { |
1002 { |
1001 iAppUi.Exit(); |
1003 iAppUi.Exit(); |
1002 } |
1004 } |
1003 break; |
1005 break; |
1004 default: |
1006 default: |
1005 break; |
1007 break; |
1006 } |
1008 } // switch ( aCommand ) |
1007 } |
1009 } |
1008 |
1010 |
1009 TBool CFSEmailUiLauncherGridVisualiser::OfferEventL(const TAlfEvent& aEvent) |
1011 TBool CFSEmailUiLauncherGridVisualiser::OfferEventL(const TAlfEvent& aEvent) |
1010 { |
1012 { |
1011 FUNC_LOG; |
1013 FUNC_LOG; |
1012 if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey ) |
1014 if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey ) |
1013 { |
1015 { |
1014 // If wait note is being shown while a mailbox is being created, |
1016 // If wait note is being shown while a mailbox is being created, |
1015 // then do not react to key presses. |
1017 // then do not react to key presses. |
1016 if ( iWizardWaitnoteShown ) |
1018 if ( iWizardWaitnoteShown ) |
1017 { |
1019 { |
1018 return ETrue; // key consumed |
1020 return ETrue; // key consumed |
1019 } |
1021 } |
1020 |
1022 |
1021 // Swap right and left controls in mirrored layout |
1023 // Swap right and left controls in mirrored layout |
1022 TInt scanCode = aEvent.KeyEvent().iScanCode; |
1024 TInt scanCode = aEvent.KeyEvent().iScanCode; |
1023 if ( AknLayoutUtils::LayoutMirrored() ) |
1025 if ( AknLayoutUtils::LayoutMirrored() ) |
1024 { |
1026 { |
1025 if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow; |
1027 if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow; |
1026 else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; |
1028 else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; |
1027 } |
1029 } |
1028 |
1030 |
1029 if ((scanCode == EStdKeyRightArrow) |
1031 if ((scanCode == EStdKeyRightArrow) |
1030 || (scanCode == EStdKeyLeftArrow) |
1032 || (scanCode == EStdKeyLeftArrow) |
1031 || (scanCode == EStdKeyUpArrow) |
1033 || (scanCode == EStdKeyUpArrow) |
1032 || (scanCode == EStdKeyDownArrow) |
1034 || (scanCode == EStdKeyDownArrow) |
1033 || (scanCode == EStdKeyEnter) |
1035 || (scanCode == EStdKeyEnter) |
1034 || (scanCode == EStdKeyDeviceA) |
1036 || (scanCode == EStdKeyDeviceA) |
1035 || (scanCode ==EStdKeyDevice3)) |
1037 || (scanCode ==EStdKeyDevice3)) |
1036 { |
1038 { |
1037 TBool wasActive = iAppUi.StartFocusRemovalTimer(); |
1039 |
1038 if (!wasActive) |
1040 if ( !iAppUi.SetFocusVisibility( ETrue ) ) |
1039 { |
1041 { |
1040 // focus is now activated. ignore key press. |
1042 // focus is now activated. ignore key press. |
1041 UpdateFocusVisibility(); |
1043 UpdateFocusVisibility(); |
1042 ResizeItemIcon( EFalse ); |
1044 ResizeItemIcon( EFalse ); |
1043 return ETrue; |
1045 return ETrue; |
1044 } |
1046 } |
1045 } |
1047 } |
1046 |
1048 |
1047 switch(scanCode) |
1049 switch(scanCode) |
1048 { |
1050 { |
1049 case EStdKeyRightArrow: |
1051 case EStdKeyRightArrow: |
1050 MoveSelection(EDirectionRight); |
1052 MoveSelection(EDirectionRight); |
1051 return ETrue; |
1053 return ETrue; |
1078 } |
1080 } |
1079 } |
1081 } |
1080 return EFalse; // was not consumed |
1082 return EFalse; // was not consumed |
1081 } |
1083 } |
1082 |
1084 |
1083 // <cmail> |
1085 |
1084 // --------------------------------------------------------------------------- |
1086 // --------------------------------------------------------------------------- |
1085 // CFSEmailUiLauncherGridVisualiser::HandlePointerEventL |
1087 // CFSEmailUiLauncherGridVisualiser::HandlePointerEventL |
1086 // |
1088 // |
1087 // --------------------------------------------------------------------------- |
1089 // --------------------------------------------------------------------------- |
1088 // |
1090 // |
1089 TBool CFSEmailUiLauncherGridVisualiser::HandlePointerEventL(const TAlfEvent& aEvent) |
1091 TBool CFSEmailUiLauncherGridVisualiser::HandlePointerEventL( |
|
1092 const TAlfEvent& aEvent ) |
1090 { |
1093 { |
1091 FUNC_LOG; |
1094 FUNC_LOG; |
1092 TBool result( EFalse ); |
1095 TBool result( EFalse ); |
1093 TInt currentlyFocused( iCurrentLevel.iSelected ); |
1096 TInt currentlyFocused( iCurrentLevel.iSelected ); |
1094 TPointerEvent::TType type = aEvent.PointerEvent().iType; |
1097 TPointerEvent::TType type = aEvent.PointerEvent().iType; |
1095 TInt id = FindPointedItem( aEvent ); |
1098 TInt id = FindPointedItem( aEvent ); |
|
1099 |
1096 if( KErrNotFound != id ) |
1100 if( KErrNotFound != id ) |
1097 { |
1101 { |
|
1102 // The event coordinates correspond with an item. |
1098 switch( type ) |
1103 switch( type ) |
1099 { |
1104 { |
1100 case TPointerEvent::EButton1Down: |
1105 case TPointerEvent::EButton1Down: |
1101 { |
1106 { |
1102 iItemIdInButtonDownEvent.iItemId = id; |
1107 iItemIdInButtonDownEvent.iItemId = id; |
1103 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
1108 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
1104 UpdateFocusVisibility(); |
|
1105 |
|
1106 SetFocusedItemL( id ); |
1109 SetFocusedItemL( id ); |
|
1110 UpdateFocusVisibility(); |
1107 break; |
1111 break; |
1108 } |
1112 } |
1109 case TPointerEvent::EButton1Up: |
1113 case TPointerEvent::EButton1Up: |
1110 { |
1114 { |
|
1115 if ( iStylusPopUpMenuLaunched ) |
|
1116 { |
|
1117 // A pop-up menu was launched. Do not open the selected |
|
1118 // item. |
|
1119 iStylusPopUpMenuLaunched = EFalse; |
|
1120 break; |
|
1121 } |
|
1122 |
|
1123 // Hide focus always after pointer up event. |
|
1124 iAppUi.SetFocusVisibility( EFalse ); |
|
1125 |
1111 // If key was released on item that had focus |
1126 // If key was released on item that had focus |
1112 // trigger selection. |
1127 // trigger selection. |
1113 if( iItemIdInButtonDownEvent.iItemId == id && |
1128 if( iItemIdInButtonDownEvent.iItemId == id && |
1114 iItemIdInButtonDownEvent.iLaunchSelection ) |
1129 iItemIdInButtonDownEvent.iLaunchSelection ) |
1115 { |
1130 { |
1116 // keyboard focus is now hidden |
|
1117 iAppUi.CancelFocusRemovalTimer(); |
|
1118 |
|
1119 HandleButtonReleaseEvent(); |
1131 HandleButtonReleaseEvent(); |
1120 |
1132 // LAUNCH OPENING. This may leave if user cancels the |
1121 // LAUNCH OPENING. This may leave if user cancels the operation |
1133 // operation |
1122 SelectL(); |
1134 SelectL(); |
1123 } |
1135 } |
1124 else |
1136 else |
1125 { |
1137 { |
1126 HandleButtonReleaseEvent(); |
1138 HandleButtonReleaseEvent(); |
1144 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
1156 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
1145 ResizeItemIcon( EFalse ); |
1157 ResizeItemIcon( EFalse ); |
1146 } |
1158 } |
1147 break; |
1159 break; |
1148 } |
1160 } |
|
1161 case TPointerEvent::EButtonRepeat: |
|
1162 { |
|
1163 // Long tap. |
|
1164 // Check the type of the currently selected item. |
|
1165 TInt itemType = iCurrentLevel.iItems[id].iId; |
|
1166 |
|
1167 if ( itemType == EDefaultMailboxItem || |
|
1168 itemType == EOtherMailboxItems ) |
|
1169 { |
|
1170 // The selected item is a mail box. Launch the pop-up |
|
1171 // menu. |
|
1172 LaunchStylusPopupMenu( id ); |
|
1173 } |
|
1174 |
|
1175 break; |
|
1176 } |
1149 default: |
1177 default: |
1150 { |
1178 { |
1151 break; |
1179 break; |
1152 } |
1180 } |
1153 } |
1181 } |
|
1182 |
1154 result = ETrue; |
1183 result = ETrue; |
1155 } |
1184 } |
1156 // if event do not concern any of items. |
1185 // if event do not concern any of items. |
1157 else if( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) |
1186 else if( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) |
1158 { |
1187 { |
1159 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
1188 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
1160 ResizeItemIcon( ETrue ); |
1189 ResizeItemIcon( ETrue ); |
|
1190 |
1161 switch( type ) |
1191 switch( type ) |
1162 { |
1192 { |
1163 case TPointerEvent::EButton1Down: |
1193 case TPointerEvent::EButton1Down: |
1164 { |
1194 { |
1165 // ask if focus is on (flip open) |
1195 // ask if focus is on (flip open) |
1166 // iItemIdInButtonDownEvent.iItemId = currentlyFocused |
1196 // iItemIdInButtonDownEvent.iItemId = currentlyFocused |
1167 break; |
1197 break; |
1168 } |
1198 } |
1169 case TPointerEvent::EButton1Up: |
1199 case TPointerEvent::EButton1Up: |
1170 { |
1200 { |
|
1201 // Hide focus always after pointer up event. |
|
1202 iAppUi.SetFocusVisibility( EFalse ); |
1171 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
1203 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
1172 HandleButtonReleaseEvent(); |
1204 HandleButtonReleaseEvent(); |
1173 break; |
1205 break; |
1174 } |
1206 } |
1175 default: |
1207 default: |
1176 { |
1208 { |
1177 break; |
1209 break; |
1178 } |
1210 } |
1179 } |
1211 } |
1180 } |
1212 } |
|
1213 else |
|
1214 { |
|
1215 if( aEvent.IsPointerEvent() && aEvent.PointerUp() ) |
|
1216 { |
|
1217 // Hide focus always after pointer up event. |
|
1218 iAppUi.SetFocusVisibility( EFalse ); |
|
1219 } |
|
1220 } |
|
1221 |
1181 return result; |
1222 return result; |
1182 } |
1223 } |
1183 |
1224 |
1184 // --------------------------------------------------------------------------- |
1225 // --------------------------------------------------------------------------- |
1185 // CFSEmailUiLauncherGridVisualiser::FindPointedItem |
1226 // CFSEmailUiLauncherGridVisualiser::FindPointedItem |
1186 // |
1227 // |
1187 // --------------------------------------------------------------------------- |
1228 // --------------------------------------------------------------------------- |
1188 // |
1229 // |
1189 TInt CFSEmailUiLauncherGridVisualiser::FindPointedItem( const TAlfEvent& aEvent ) |
1230 TInt CFSEmailUiLauncherGridVisualiser::FindPointedItem( const TAlfEvent& aEvent ) |
1190 { |
1231 { |
1191 FUNC_LOG; |
1232 FUNC_LOG; |
1192 TInt result = KErrNotFound; |
1233 TInt result = KErrNotFound; |
1193 |
1234 |
1194 TInt count = iCurrentLevel.iItemVisualData.Count(); |
1235 TInt count = iCurrentLevel.iItemVisualData.Count(); |
1195 const TPoint pos = aEvent.PointerEvent().iParentPosition; |
1236 const TPoint pos = aEvent.PointerEvent().iParentPosition; |
1196 |
1237 |
1197 for(TInt a = 0; count > a; a++) |
1238 for(TInt a = 0; count > a; a++) |
1198 { |
1239 { |
1199 const TRect rect(iCurrentLevel.iItemVisualData[a].iBase->DisplayRect()); |
1240 const TRect rect(iCurrentLevel.iItemVisualData[a].iBase->DisplayRect()); |
1200 if(rect.Contains( pos )) |
1241 if(rect.Contains( pos )) |
1201 { |
1242 { |
1202 result = a; |
1243 result = a; |
1203 break; |
1244 break; |
1204 } |
1245 } |
1205 } |
1246 } |
1206 return result; |
1247 return result; |
1207 } |
1248 } |
1208 |
1249 |
1209 // --------------------------------------------------------------------------- |
1250 // --------------------------------------------------------------------------- |
1210 // CFSEmailUiLauncherGridVisualiser::SetFocusedItemL |
1251 // CFSEmailUiLauncherGridVisualiser::SetFocusedItemL |
1211 // |
1252 // |
1212 // --------------------------------------------------------------------------- |
1253 // --------------------------------------------------------------------------- |
1213 // |
1254 // |
1214 void CFSEmailUiLauncherGridVisualiser::SetFocusedItemL( TInt aId ) |
1255 void CFSEmailUiLauncherGridVisualiser::SetFocusedItemL( TInt aId ) |
1215 { |
1256 { |
1216 FUNC_LOG; |
1257 FUNC_LOG; |
1217 TInt oldSelection = iCurrentLevel.iSelected; |
1258 TInt oldSelection = iCurrentLevel.iSelected; |
1218 |
1259 |
1219 HandleRowMovement( EDirectionTouch, aId ); |
1260 HandleRowMovement( EDirectionTouch, aId ); |
1220 |
1261 |
1221 FocusItem( EFalse, oldSelection ); |
1262 FocusItem( EFalse, oldSelection ); |
1222 // iCurrentLevel.iSelected = aId; |
|
1223 FocusItem( ETrue, iCurrentLevel.iSelected ); |
1263 FocusItem( ETrue, iCurrentLevel.iSelected ); |
1224 MoveSelectorToCurrentItem( EDirectionTouch ); |
1264 MoveSelectorToCurrentItem( EDirectionTouch ); |
1225 } |
1265 } |
1226 |
1266 |
1227 void CFSEmailUiLauncherGridVisualiser::MoveSelection( TDirection aDir ) |
1267 void CFSEmailUiLauncherGridVisualiser::MoveSelection( TDirection aDir ) |
1228 { |
1268 { |
1229 FUNC_LOG; |
1269 FUNC_LOG; |
1230 // NULL double click flag just be sure that the UI does not |
1270 // NULL double click flag just be sure that the UI does not |
1231 // go into state that wizard cannot be started. |
1271 // go into state that wizard cannot be started. |
1232 iDoubleClickLock = EFalse; |
1272 iDoubleClickLock = EFalse; |
1233 // Store old selection |
1273 // Store old selection |
1234 TInt oldSelection = iCurrentLevel.iSelected; |
1274 TInt oldSelection = iCurrentLevel.iSelected; |
1235 TInt itemCount = iCurrentLevel.iItemVisualData.Count(); |
1275 TInt itemCount = iCurrentLevel.iItemVisualData.Count(); |
1236 |
1276 |
1237 HandleRowMovement( aDir, iCurrentLevel.iSelected ); |
1277 HandleRowMovement( aDir, iCurrentLevel.iSelected ); |
1238 |
1278 |
1239 // Set the correct icon focuses (i.e. enlarged) |
1279 // Set the correct icon focuses (i.e. enlarged) |
1240 if ( aDir != EDirectionNone && oldSelection >= 0 && oldSelection < itemCount ) |
1280 if ( aDir != EDirectionNone && oldSelection >= 0 && oldSelection < itemCount ) |
1241 { |
1281 { |
1487 else |
1527 else |
1488 { |
1528 { |
1489 FocusItem( ETrue, iCurrentLevel.iSelected ); |
1529 FocusItem( ETrue, iCurrentLevel.iSelected ); |
1490 } |
1530 } |
1491 UpdateScrollBarRangeL(); |
1531 UpdateScrollBarRangeL(); |
1492 } |
1532 } |
1493 } |
1533 } |
1494 |
1534 |
1495 TBool CFSEmailUiLauncherGridVisualiser::UiOperationLaunched() |
1535 TBool CFSEmailUiLauncherGridVisualiser::UiOperationLaunched() |
1496 { |
1536 { |
1497 FUNC_LOG; |
1537 FUNC_LOG; |
1498 return iUiOperationLaunched; |
1538 return iUiOperationLaunched; |
1499 } |
1539 } |
1500 |
1540 |
1501 void CFSEmailUiLauncherGridVisualiser::PopulateL( TLevel& aLevel ) |
1541 void CFSEmailUiLauncherGridVisualiser::PopulateL( TLevel& aLevel ) |
1502 { |
1542 { |
1503 FUNC_LOG; |
1543 FUNC_LOG; |
1504 if ( iConstructionCompleted ) |
1544 if ( iConstructionCompleted ) |
1505 { |
1545 { |
1506 for( TInt i = 0; i < aLevel.iItemVisualData.Count(); i++ ) |
1546 for( TInt i = 0; i < aLevel.iItemVisualData.Count(); i++ ) |
1507 { |
1547 { |
1508 aLevel.iItemVisualData[i].iBase->RemoveAndDestroyAllD(); |
1548 aLevel.iItemVisualData[i].iBase->RemoveAndDestroyAllD(); |
1509 } |
1549 } |
1510 aLevel.iItemVisualData.Reset(); |
1550 aLevel.iItemVisualData.Reset(); |
1511 aLevel.iItems.Reset(); |
1551 aLevel.iItems.Reset(); |
1512 |
1552 |
1513 // <cmail> Use layout data instead of hard-coded values |
1553 // <cmail> Use layout data instead of hard-coded values |
1514 TRect mainPaneRect; |
1554 TRect mainPaneRect; |
1515 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1555 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1516 |
1556 |
1517 TAknLayoutRect scrollBarRect; |
1557 TAknLayoutRect scrollBarRect; |
1518 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1558 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1519 TRect gridRect = mainPaneRect; |
1559 TRect gridRect = mainPaneRect; |
1520 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1560 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1521 |
1561 |
1522 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1562 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1523 |
1563 |
1524 TAknLayoutRect itemRect; |
1564 TAknLayoutRect itemRect; |
1525 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1565 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1526 |
1566 |
1527 TRect itemrc = itemRect.Rect(); |
1567 TRect itemrc = itemRect.Rect(); |
1528 itemrc.SetRect(TPoint(0,0), itemRect.Rect().Size()); |
1568 itemrc.SetRect(TPoint(0,0), itemRect.Rect().Size()); |
1529 |
1569 |
1530 TAknLayoutRect gridIconRect; |
1570 TAknLayoutRect gridIconRect; |
1531 gridIconRect.LayoutRect(itemrc, AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1571 gridIconRect.LayoutRect(itemrc, AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1532 |
1572 |
1533 TAknLayoutText gridText; |
1573 TAknLayoutText gridText; |
1534 gridText.LayoutText(itemrc, AknLayoutScalable_Apps::cell_cmail_l_pane_t1(var)); |
1574 gridText.LayoutText(itemrc, AknLayoutScalable_Apps::cell_cmail_l_pane_t1(var)); |
1535 // </cmail> |
1575 // </cmail> |
1536 |
1576 |
1537 if( aLevel.iParent >= 0 ) |
1577 if( aLevel.iParent >= 0 ) |
1538 { |
1578 { |
1539 iModel->FindChildren( aLevel.iParent, aLevel.iItems ); |
1579 iModel->FindChildren( aLevel.iParent, aLevel.iItems ); |
1540 |
1580 |
1541 for( TInt i = 0; i < aLevel.iItems.Count(); i++ ) |
1581 for( TInt i = 0; i < aLevel.iItems.Count(); i++ ) |
1542 { |
1582 { |
1543 TItemVisualData newItem; |
1583 TItemVisualData newItem; |
1544 |
1584 |
1545 newItem.iBase = CAlfAnchorLayout::AddNewL( *iControl, aLevel.iGridLayout ); |
1585 newItem.iBase = CAlfAnchorLayout::AddNewL( *iControl, aLevel.iGridLayout ); |
1546 newItem.iBase->SetTactileFeedbackL( ETouchEventStylusDown, ETouchFeedbackBasic ); |
1586 newItem.iBase->SetTactileFeedbackL( ETouchEventStylusDown, ETouchFeedbackBasic ); |
1547 |
1587 |
1548 // <cmail> Use layout data instead of hard-coded values |
1588 // <cmail> Use layout data instead of hard-coded values |
1549 // Set anchors for text |
1589 // Set anchors for text |
1550 newItem.iBase->SetAnchor( |
1590 newItem.iBase->SetAnchor( |
1551 EAlfAnchorTopLeft, |
1591 EAlfAnchorTopLeft, |
1552 0, |
1592 0, |
1553 EAlfAnchorOriginLeft, |
1593 EAlfAnchorOriginLeft, |
1587 newItem.iText->EnableShadow( EFalse ); |
1627 newItem.iText->EnableShadow( EFalse ); |
1588 // <cmail> Use layout data instead of hard-coded values |
1628 // <cmail> Use layout data instead of hard-coded values |
1589 TRgb itemColor (KRgbGray); |
1629 TRgb itemColor (KRgbGray); |
1590 // text #9 application grid unfocused application title texts #215 |
1630 // text #9 application grid unfocused application title texts #215 |
1591 if( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
1631 if( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
1592 itemColor, KAknsIIDQsnTextColors, |
1632 itemColor, KAknsIIDQsnTextColors, |
1593 EAknsCIQsnTextColorsCG9 ) != KErrNone ) |
1633 EAknsCIQsnTextColorsCG9 ) != KErrNone ) |
1594 { |
1634 { |
1595 itemColor = gridText.Color();//iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
1635 itemColor = gridText.Color();//iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
1596 } |
1636 } |
1597 newItem.iText->SetColor(itemColor); |
1637 newItem.iText->SetColor(itemColor); |
1598 // </cmail> |
1638 // </cmail> |
1599 |
1639 |
1600 newItem.iText->SetTextL( *aLevel.iItems[i].iCaption ); |
1640 newItem.iText->SetTextL( *aLevel.iItems[i].iCaption ); |
1601 |
1641 |
1602 TAlfTimedValue opacity; |
1642 TAlfTimedValue opacity; |
1603 opacity.SetValueNow ( KDefaultCaptionOpacity ); |
1643 opacity.SetValueNow ( KDefaultCaptionOpacity ); |
1604 newItem.iText->SetOpacity( opacity ); |
1644 newItem.iText->SetOpacity( opacity ); |
1605 |
1645 |
1606 newItem.iText->SetTextStyle( iAppUi.LayoutHandler()->FSTextStyleFromLayoutL(AknLayoutScalable_Apps::cell_cmail_l_pane_t1(var)).Id() );//FSTextStyleFromIdL( EFSFontTypeSmall )->Id() ); |
1646 newItem.iText->SetTextStyle( iAppUi.LayoutHandler()->FSTextStyleFromLayoutL(AknLayoutScalable_Apps::cell_cmail_l_pane_t1(var)).Id() );//FSTextStyleFromIdL( EFSFontTypeSmall )->Id() ); |
1607 newItem.iText->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
1647 newItem.iText->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
1608 newItem.iText->SetAlign( EAlfAlignHCenter, EAlfAlignVTop ); |
1648 newItem.iText->SetAlign( EAlfAlignHCenter, EAlfAlignVTop ); |
1609 |
1649 |
1610 newItem.iImage = CAlfImageVisual::AddNewL( *iControl, newItem.iBase ); |
1650 newItem.iImage = CAlfImageVisual::AddNewL( *iControl, newItem.iBase ); |
1611 newItem.iImage->SetScaleMode( CAlfImageVisual::EScaleFit ); |
1651 newItem.iImage->SetScaleMode( CAlfImageVisual::EScaleFit ); |
1612 newItem.iImage->SetImage( TAlfImage( *aLevel.iItems[i].iIconTexture ) ); |
1652 newItem.iImage->SetImage( TAlfImage( *aLevel.iItems[i].iIconTexture ) ); |
1613 newItem.iImage->SetFlag( EAlfVisualFlagManualSize ); |
1653 newItem.iImage->SetFlag( EAlfVisualFlagManualSize ); |
1614 |
1654 |
1615 // <cmail> Use layout data instead of hard-coded values |
1655 // <cmail> Use layout data instead of hard-coded values |
1616 newItem.iImage->SetSize( gridIconRect.Rect().Size() ); |
1656 newItem.iImage->SetSize( gridIconRect.Rect().Size() ); |
1617 newItem.iImage->SetScale( KScaleNotSelected ); |
1657 newItem.iImage->SetScale( KScaleNotSelected ); |
1618 // </cmail> |
1658 // </cmail> |
1619 |
1659 |
1620 User::LeaveIfError( aLevel.iItemVisualData.Append( newItem ) ); |
1660 User::LeaveIfError( aLevel.iItemVisualData.Append( newItem ) ); |
1621 } |
1661 } |
1622 } |
1662 } |
1623 |
1663 |
1624 // <cmail> Use layout data instead of hard-coded values |
1664 // <cmail> Use layout data instead of hard-coded values |
1625 // Set columns and rows |
1665 // Set columns and rows |
1626 //iVisibleColumns = iAppUi.LayoutHandler()->GridColumnsInThisResolution(); |
1666 //iVisibleColumns = iAppUi.LayoutHandler()->GridColumnsInThisResolution(); |
1627 //iVisibleRows = iAppUi.LayoutHandler()->GridRowsInThisResolution(); |
1667 //iVisibleRows = iAppUi.LayoutHandler()->GridRowsInThisResolution(); |
1628 iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; |
1668 iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; |
1629 iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; |
1669 iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; |
1655 { |
1695 { |
1656 case EDefaultMailboxItem: |
1696 case EDefaultMailboxItem: |
1657 case EOtherMailboxItems: |
1697 case EOtherMailboxItems: |
1658 { |
1698 { |
1659 TMailListActivationData tmp; |
1699 TMailListActivationData tmp; |
1660 tmp.iFolderId = iCurrentLevel.iItems[iCurrentLevel.iSelected].iMailBoxInboxId; |
1700 tmp.iFolderId = iCurrentLevel.iItems[iCurrentLevel.iSelected].iMailBoxInboxId; |
1661 tmp.iMailBoxId = iCurrentLevel.iItems[iCurrentLevel.iSelected].iMailBoxId; |
1701 tmp.iMailBoxId = iCurrentLevel.iItems[iCurrentLevel.iSelected].iMailBoxId; |
1662 const TPckgBuf<TMailListActivationData> pkgOut( tmp ); |
1702 const TPckgBuf<TMailListActivationData> pkgOut( tmp ); |
1663 iAppUi.ShowTitlePaneConnectionStatus(); |
1703 iAppUi.ShowTitlePaneConnectionStatus(); |
1664 iAppUi.EnterFsEmailViewL( MailListId, KStartListWithFolderId, pkgOut ); |
1704 iAppUi.EnterFsEmailViewL( MailListId, KStartListWithFolderId, pkgOut ); |
1665 } |
1705 } |
1666 break; |
1706 break; |
1667 case EDirectoryItem: |
1707 case EDirectoryItem: |
1668 { |
1708 { |
1669 // TO prevent accidental double clicks of the directory item, |
1709 // TO prevent accidental double clicks of the directory item, |
1670 // prevents multiple RCL windows to be seen |
1710 // prevents multiple RCL windows to be seen |
1671 if ( !iDoubleClickLock ) |
1711 if ( !iDoubleClickLock ) |
1672 { |
1712 { |
1673 // Lock to make sure that wizard is not started twice in a row |
1713 // Lock to make sure that wizard is not started twice in a row |
1674 iDoubleClickLock = ETrue; |
1714 iDoubleClickLock = ETrue; |
1675 RPointerArray<CFSMailBox> mailBoxes; |
1715 RPointerArray<CFSMailBox> mailBoxes; |
1676 CleanupResetAndDestroyClosePushL( mailBoxes ); |
1716 CleanupResetAndDestroyClosePushL( mailBoxes ); |
1677 TFSMailMsgId id; |
1717 TFSMailMsgId id; |
1678 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
1718 TInt err = iAppUi.GetMailClient()->ListMailBoxes( |
1679 id, |
1719 id, |
1680 mailBoxes ); |
1720 mailBoxes ); |
1681 |
1721 |
1682 // Remove mailboxes that doesn't support RCL |
1722 // Remove mailboxes that doesn't support RCL |
1683 for ( TInt i = mailBoxes.Count()-1; i >= 0 ; i-- ) |
1723 for ( TInt i = mailBoxes.Count()-1; i >= 0 ; i-- ) |
1684 { |
1724 { |
1685 if ( !TFsEmailUiUtility::IsRemoteLookupSupported( *mailBoxes[i] ) ) |
1725 if ( !TFsEmailUiUtility::IsRemoteLookupSupported( *mailBoxes[i] ) ) |
1686 { |
1726 { |
1849 { |
1889 { |
1850 // <cmail> Use layout data instead of hard-coded values |
1890 // <cmail> Use layout data instead of hard-coded values |
1851 TRect mainPaneRect; |
1891 TRect mainPaneRect; |
1852 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1892 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1853 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1893 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1854 |
1894 |
1855 TAknLayoutRect scrollBarRect; |
1895 TAknLayoutRect scrollBarRect; |
1856 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1896 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1857 TRect gridRect = mainPaneRect; |
1897 TRect gridRect = mainPaneRect; |
1858 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1898 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1859 |
1899 |
1860 TAknLayoutRect itemRect; |
1900 TAknLayoutRect itemRect; |
1861 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1901 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1862 |
1902 |
1863 TAknLayoutRect gridIconRect; |
1903 TAknLayoutRect gridIconRect; |
1864 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1904 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1865 |
1905 |
1866 //TInt gridIconSize = iAppUi.LayoutHandler()->GridIconSize(); |
1906 //TInt gridIconSize = iAppUi.LayoutHandler()->GridIconSize(); |
1867 TSize iconSize = gridIconRect.Rect().Size(); |
1907 TSize iconSize = gridIconRect.Rect().Size(); |
1868 //iconSize.SetSize( gridIconSize, gridIconSize ); |
1908 //iconSize.SetSize( gridIconSize, gridIconSize ); |
1869 // </cmail> |
1909 // </cmail> |
1870 |
1910 |
1871 // Scale bitmaps |
1911 // Scale bitmaps |
1872 for( TInt i = 0 ; i < iIconArray.Count() ; i++ ) |
1912 for( TInt i = 0 ; i < iIconArray.Count() ; i++ ) |
1873 { |
1913 { |
1874 iIconArray[i]->Size().SetSize( iconSize.iWidth, iconSize.iHeight ); |
1914 iIconArray[i]->Size().SetSize( iconSize.iWidth, iconSize.iHeight ); |
1875 } |
1915 } |
1876 // Scale visuals |
1916 // Scale visuals |
1877 for ( TInt item = 0; item < iCurrentLevel.iItemVisualData.Count() ; item++ ) |
1917 for ( TInt item = 0; item < iCurrentLevel.iItemVisualData.Count() ; item++ ) |
1878 { |
1918 { |
1879 iCurrentLevel.iItemVisualData[item].iImage->SetSize( iconSize ); |
1919 iCurrentLevel.iItemVisualData[item].iImage->SetSize( iconSize ); |
1880 } |
1920 } |
1881 } |
1921 } |
1882 } |
1922 } |
1883 |
1923 |
1884 void CFSEmailUiLauncherGridVisualiser::AddItemToModelL( CFSEmailLauncherItem* aItem, TInt aPluginArrayIndex ) |
1924 void CFSEmailUiLauncherGridVisualiser::AddItemToModelL( CFSEmailLauncherItem* aItem, TInt aPluginArrayIndex ) |
1885 { |
1925 { |
1892 if ( launcherItemIcon ) |
1932 if ( launcherItemIcon ) |
1893 { |
1933 { |
1894 // <cmail> Use layout data instead of hard-coded values |
1934 // <cmail> Use layout data instead of hard-coded values |
1895 TRect mainPaneRect; |
1935 TRect mainPaneRect; |
1896 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1936 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1897 |
1937 |
1898 TAknLayoutRect scrollBarRect; |
1938 TAknLayoutRect scrollBarRect; |
1899 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1939 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1900 TRect gridRect = mainPaneRect; |
1940 TRect gridRect = mainPaneRect; |
1901 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1941 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1902 |
1942 |
1903 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1943 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1904 |
1944 |
1905 TAknLayoutRect itemRect; |
1945 TAknLayoutRect itemRect; |
1906 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1946 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1907 |
1947 |
1908 TAknLayoutRect gridIconRect; |
1948 TAknLayoutRect gridIconRect; |
1909 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1949 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1910 |
1950 |
1911 TSize iconSize = gridIconRect.Rect().Size(); |
1951 TSize iconSize = gridIconRect.Rect().Size(); |
1912 // </cmail> |
1952 // </cmail> |
1913 |
1953 |
1914 const CFbsBitmap* bitmap = launcherItemIcon->Bitmap(); |
1954 const CFbsBitmap* bitmap = launcherItemIcon->Bitmap(); |
1915 const CFbsBitmap* mask = launcherItemIcon->Mask(); |
1955 const CFbsBitmap* mask = launcherItemIcon->Mask(); |
1916 |
1956 |
1917 // First add plugin id and icon id pair to array, needed in provide bitmap |
1957 // First add plugin id and icon id pair to array, needed in provide bitmap |
1918 TPluginIdIconIdPair idPair; |
1958 TPluginIdIconIdPair idPair; |
1919 idPair.iPluginArrayIndex = aPluginArrayIndex; |
1959 idPair.iPluginArrayIndex = aPluginArrayIndex; |
1920 idPair.iIconId = iPluginTextureId; |
1960 idPair.iIconId = iPluginTextureId; |
1921 iPluginIdIconIdPairs.Append( idPair ); |
1961 iPluginIdIconIdPairs.Append( idPair ); |
1922 |
1962 |
1923 // Create texture, goes to provide bitmap |
1963 // Create texture, goes to provide bitmap |
1924 CAlfTexture* texture = &CAlfStatic::Env().TextureManager().CreateTextureL( iPluginTextureId, this, EAlfTextureFlagDefault ); |
1964 CAlfTexture* texture = &CAlfStatic::Env().TextureManager().CreateTextureL( iPluginTextureId, this, EAlfTextureFlagDefault ); |
1925 // Update texture id |
1965 // Update texture id |
1926 iPluginTextureId++; // Id is updated dynamically |
1966 iPluginTextureId++; // Id is updated dynamically |
1927 // Set initiel size |
1967 // Set initiel size |
1928 // <cmail> Use layout data instead of hard-coded values |
1968 // <cmail> Use layout data instead of hard-coded values |
1929 //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); |
1969 //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); |
1930 // <cmail> |
1970 // <cmail> |
1931 texture->Size().SetSize( iconSize.iHeight, iconSize.iWidth ); |
1971 texture->Size().SetSize( iconSize.iHeight, iconSize.iWidth ); |
1932 iModel->AddL( |
1972 iModel->AddL( |
1933 EShortcut, |
1973 EShortcut, |
1934 aItem->Id(), |
1974 aItem->Id(), |
1935 *launcherItemText, |
1975 *launcherItemText, |
1936 *texture, |
1976 *texture, |
1937 0, |
1977 0, |
1938 aItem ); |
1978 aItem ); |
1939 iIconArray.AppendL( texture ); |
1979 iIconArray.AppendL( texture ); |
1940 } |
1980 } |
1941 else |
1981 else |
1942 { |
1982 { |
1943 CAlfTexture* texture = &iAppUi.FsTextureManager()->TextureByIndex( EGridInboxTexture ); |
1983 CAlfTexture* texture = &iAppUi.FsTextureManager()->TextureByIndex( EGridInboxTexture ); |
1944 |
1984 |
1945 iModel->AddL( |
1985 iModel->AddL( |
1946 EShortcut, |
1986 EShortcut, |
1947 aItem->Id(), |
1987 aItem->Id(), |
1948 *launcherItemText, |
1988 *launcherItemText, |
1949 *texture, |
1989 *texture, |
1950 0, |
1990 0, |
1951 aItem ); |
1991 aItem ); |
1952 iIconArray.AppendL( texture ); |
1992 iIconArray.AppendL( texture ); |
1953 } |
1993 } |
1954 |
1994 |
1955 CleanupStack::PopAndDestroy( launcherItemText ); |
1995 CleanupStack::PopAndDestroy( launcherItemText ); |
1956 } |
1996 } |
1960 { |
2000 { |
1961 FUNC_LOG; |
2001 FUNC_LOG; |
1962 if ( iConstructionCompleted ) |
2002 if ( iConstructionCompleted ) |
1963 { |
2003 { |
1964 iCurrentLevel.iParent = 0; |
2004 iCurrentLevel.iParent = 0; |
1965 |
2005 |
1966 // <cmail> Use layout data instead of hard-coded values |
2006 // <cmail> Use layout data instead of hard-coded values |
1967 TRect mainPaneRect; |
2007 TRect mainPaneRect; |
1968 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2008 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1969 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2009 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
1970 |
2010 |
1971 TAknLayoutRect scrollBarRect; |
2011 TAknLayoutRect scrollBarRect; |
1972 // <cmail> |
2012 // <cmail> |
1973 // scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
2013 // scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1974 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::scroll_pane_cp03()); |
2014 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::scroll_pane_cp03()); |
1975 // </cmail> |
2015 // </cmail> |
1976 TRect gridRect = mainPaneRect; |
2016 TRect gridRect = mainPaneRect; |
1977 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2017 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
1978 |
2018 |
1979 TAknLayoutRect cellRect; |
2019 TAknLayoutRect cellRect; |
1980 cellRect.LayoutRect(gridRect, AknLayoutScalable_Apps::aid_size_cell_cmail_l(var, 0, 0)); |
2020 cellRect.LayoutRect(gridRect, AknLayoutScalable_Apps::aid_size_cell_cmail_l(var, 0, 0)); |
1981 |
2021 |
1982 TAknLayoutRect itemRect; |
2022 TAknLayoutRect itemRect; |
1983 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
2023 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
1984 |
2024 |
1985 TAknLayoutRect gridIconRect; |
2025 TAknLayoutRect gridIconRect; |
1986 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
2026 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1987 |
2027 |
1988 TAknLayoutRect selectorRect; |
2028 TAknLayoutRect selectorRect; |
1989 selectorRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::grid_highlight_pane_cp018(var)); |
2029 selectorRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::grid_highlight_pane_cp018(var)); |
1990 |
2030 |
1991 CFSEmailUiLayoutHandler* layoutHandler = iAppUi.LayoutHandler(); |
2031 CFSEmailUiLayoutHandler* layoutHandler = iAppUi.LayoutHandler(); |
1992 iSelectorImageVisual->SetSize( selectorRect.Rect().Size() ); // layoutHandler->SelectorVisualSizeInThisResolution() ); |
2032 iSelectorImageVisual->SetSize( selectorRect.Rect().Size() ); // layoutHandler->SelectorVisualSizeInThisResolution() ); |
1993 |
2033 |
1994 TSize displaySize = mainPaneRect.Size();//iControl->DisplayArea().Size(); |
2034 TSize displaySize = mainPaneRect.Size();//iControl->DisplayArea().Size(); |
1995 |
2035 |
1996 TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; //layoutHandler->GridColumnsInThisResolution(); |
2036 TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; //layoutHandler->GridColumnsInThisResolution(); |
1997 TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; //layoutHandler->GridRowsInThisResolution(); |
2037 TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; //layoutHandler->GridRowsInThisResolution(); |
1998 |
2038 |
1999 // </cmail> |
2039 // </cmail> |
2000 |
2040 |
2001 iCurrentLevel.iGridLayout->SetSize( gridRect.Size() ); |
2041 iCurrentLevel.iGridLayout->SetSize( gridRect.Size() ); |
2002 iCurrentLevel.iGridLayout->SetColumnsL( columns ); |
2042 iCurrentLevel.iGridLayout->SetColumnsL( columns ); |
2003 iCurrentLevel.iGridLayout->SetRowsL( rows ); |
2043 iCurrentLevel.iGridLayout->SetRowsL( rows ); |
2048 EAlfAnchorMetricAbsolute, |
2088 EAlfAnchorMetricAbsolute, |
2049 EAlfAnchorMetricAbsolute, |
2089 EAlfAnchorMetricAbsolute, |
2050 TAlfTimedPoint( scrollbarTopLeftX, scrollbarTopLeftY ) ); |
2090 TAlfTimedPoint( scrollbarTopLeftX, scrollbarTopLeftY ) ); |
2051 iWidgetLayout->SetAnchor( |
2091 iWidgetLayout->SetAnchor( |
2052 EAlfAnchorBottomRight, |
2092 EAlfAnchorBottomRight, |
2053 0, |
2093 0, |
2054 EAlfAnchorOriginLeft, |
2094 EAlfAnchorOriginLeft, |
2055 EAlfAnchorOriginTop, |
2095 EAlfAnchorOriginTop, |
2056 EAlfAnchorMetricAbsolute, |
2096 EAlfAnchorMetricAbsolute, |
2057 EAlfAnchorMetricAbsolute, |
2097 EAlfAnchorMetricAbsolute, |
2058 TAlfTimedPoint( scrollbarBottomRightX, scrollbarBottomRightY ) ); |
2098 TAlfTimedPoint( scrollbarBottomRightX, scrollbarBottomRightY ) ); |
2059 |
2099 |
2060 // Set anchors for the grid |
2100 // Set anchors for the grid |
2061 iWidgetLayout->SetAnchor( |
2101 iWidgetLayout->SetAnchor( |
2062 EAlfAnchorTopLeft, |
2102 EAlfAnchorTopLeft, |
2063 1, |
2103 1, |
2064 EAlfAnchorOriginLeft, |
2104 EAlfAnchorOriginLeft, |
2065 EAlfAnchorOriginTop, |
2105 EAlfAnchorOriginTop, |
2066 EAlfAnchorMetricAbsolute, |
2106 EAlfAnchorMetricAbsolute, |
2067 EAlfAnchorMetricAbsolute, |
2107 EAlfAnchorMetricAbsolute, |
2068 TAlfTimedPoint( gridTopLeftX, gridTopLeftY ) ); |
2108 TAlfTimedPoint( gridTopLeftX, gridTopLeftY ) ); |
2069 iWidgetLayout->SetAnchor( |
2109 iWidgetLayout->SetAnchor( |
2070 EAlfAnchorBottomRight, |
2110 EAlfAnchorBottomRight, |
2071 1, |
2111 1, |
2072 EAlfAnchorOriginLeft, |
2112 EAlfAnchorOriginLeft, |
2073 EAlfAnchorOriginTop, |
2113 EAlfAnchorOriginTop, |
2074 EAlfAnchorMetricAbsolute, |
2114 EAlfAnchorMetricAbsolute, |
2075 EAlfAnchorMetricAbsolute, |
2115 EAlfAnchorMetricAbsolute, |
2076 TAlfTimedPoint( gridBottomRightX, gridBottomRightY ) ); |
2116 TAlfTimedPoint( gridBottomRightX, gridBottomRightY ) ); |
2077 |
2117 |
2078 iParentLayout->UpdateChildrenLayout(); |
2118 iParentLayout->UpdateChildrenLayout(); |
2079 |
2119 |
2080 TSize gridSize = iCurrentLevel.iGridLayout->Size().IntTarget().AsSize(); |
2120 TSize gridSize = iCurrentLevel.iGridLayout->Size().IntTarget().AsSize(); |
2081 iColumnWidth = gridSize.iWidth / iVisibleColumns; |
2121 iColumnWidth = gridSize.iWidth / iVisibleColumns; |
2082 iRowHeight = gridSize.iHeight / iVisibleRows; |
2122 iRowHeight = gridSize.iHeight / iVisibleRows; |
2083 |
2123 |
2084 // Selector ring wrap limits can be calculated when row and column sizes are known. |
2124 // Selector ring wrap limits can be calculated when row and column sizes are known. |
2085 SetRingWrapLimits(); |
2125 SetRingWrapLimits(); |
2086 MoveSelection( EDirectionNone ); |
2126 MoveSelection( EDirectionNone ); |
2121 HBufC* text_5 = StringLoader::LoadLC( R_DISCLAIMER_PART_5 ); |
2161 HBufC* text_5 = StringLoader::LoadLC( R_DISCLAIMER_PART_5 ); |
2122 HBufC* text_6 = StringLoader::LoadLC( R_DISCLAIMER_PART_6 ); |
2162 HBufC* text_6 = StringLoader::LoadLC( R_DISCLAIMER_PART_6 ); |
2123 HBufC* text_7 = StringLoader::LoadLC( R_DISCLAIMER_PART_7 ); |
2163 HBufC* text_7 = StringLoader::LoadLC( R_DISCLAIMER_PART_7 ); |
2124 HBufC* text_8 = StringLoader::LoadLC( R_DISCLAIMER_PART_8 ); |
2164 HBufC* text_8 = StringLoader::LoadLC( R_DISCLAIMER_PART_8 ); |
2125 HBufC* text_9 = StringLoader::LoadLC( R_DISCLAIMER_PART_9 ); |
2165 HBufC* text_9 = StringLoader::LoadLC( R_DISCLAIMER_PART_9 ); |
2126 HBufC* text_10 = StringLoader::LoadLC( R_DISCLAIMER_PART_10 ); |
2166 HBufC* text_10 = StringLoader::LoadLC( R_DISCLAIMER_PART_10 ); |
2127 HBufC* text_11 = StringLoader::LoadLC( R_DISCLAIMER_PART_11 ); |
2167 HBufC* text_11 = StringLoader::LoadLC( R_DISCLAIMER_PART_11 ); |
2128 |
2168 |
2129 //Create a buffer for dialog content |
2169 //Create a buffer for dialog content |
2130 HBufC* text = HBufC::NewLC( text_1->Length() + text_2->Length() + text_3->Length() + |
2170 HBufC* text = HBufC::NewLC( text_1->Length() + text_2->Length() + text_3->Length() + |
2131 text_4->Length() + text_5->Length() + text_6->Length() + |
2171 text_4->Length() + text_5->Length() + text_6->Length() + |
2132 text_7->Length() + text_8->Length() + text_9->Length() + |
2172 text_7->Length() + text_8->Length() + text_9->Length() + |
2133 text_10->Length() + text_11->Length() ); |
2173 text_10->Length() + text_11->Length() ); |
2134 //Copy the disclaimer text parts to dialog content |
2174 //Copy the disclaimer text parts to dialog content |
2135 text->Des() += *text_1; |
2175 text->Des() += *text_1; |
2136 text->Des() += *text_2; |
2176 text->Des() += *text_2; |
2137 text->Des() += *text_3; |
2177 text->Des() += *text_3; |
2156 CleanupStack::PopAndDestroy( text_4 ); |
2196 CleanupStack::PopAndDestroy( text_4 ); |
2157 CleanupStack::PopAndDestroy( text_3 ); |
2197 CleanupStack::PopAndDestroy( text_3 ); |
2158 CleanupStack::PopAndDestroy( text_2 ); |
2198 CleanupStack::PopAndDestroy( text_2 ); |
2159 CleanupStack::PopAndDestroy( text_1 ); |
2199 CleanupStack::PopAndDestroy( text_1 ); |
2160 dlg->PrepareLC( R_DISCLAIMER_MESSAGE ); |
2200 dlg->PrepareLC( R_DISCLAIMER_MESSAGE ); |
2161 |
2201 |
2162 //Create heading for the dialog, load and create the heading text |
2202 //Create heading for the dialog, load and create the heading text |
2163 CAknPopupHeadingPane* headingPane = dlg->Heading(); |
2203 CAknPopupHeadingPane* headingPane = dlg->Heading(); |
2164 HBufC* appName = StringLoader::LoadLC(R_FSEMAIL_APP_NAME ); |
2204 HBufC* appName = StringLoader::LoadLC(R_FSEMAIL_APP_NAME ); |
2165 HBufC* version = StringLoader::LoadLC( R_DISCLAIMER_FSEMAIL_VERSION ); |
2205 HBufC* version = StringLoader::LoadLC( R_DISCLAIMER_FSEMAIL_VERSION ); |
2166 HBufC* title = HBufC::NewLC(version->Length() + appName->Length() + 1); |
2206 HBufC* title = HBufC::NewLC(version->Length() + appName->Length() + 1); |
2167 title->Des() += *appName; |
2207 title->Des() += *appName; |
2168 title->Des() += KSpace; |
2208 title->Des() += KSpace; |
2169 title->Des() += *version; |
2209 title->Des() += *version; |
2170 headingPane->SetTextL( *title ); |
2210 headingPane->SetTextL( *title ); |
2171 CleanupStack::PopAndDestroy( title ); |
2211 CleanupStack::PopAndDestroy( title ); |
2172 CleanupStack::PopAndDestroy( version ); |
2212 CleanupStack::PopAndDestroy( version ); |
2173 CleanupStack::PopAndDestroy( appName ); |
2213 CleanupStack::PopAndDestroy( appName ); |
2174 dlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY ); |
2214 dlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_OK_EMPTY ); |
2175 //show dialog |
2215 //show dialog |
2176 TInt ret = dlg->RunLD(); |
2216 TInt ret = dlg->RunLD(); |
2177 } |
2217 } |
2178 |
2218 |
2179 void CFSEmailUiLauncherGridVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
2219 void CFSEmailUiLauncherGridVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
2180 { |
2220 { |
2183 CFsEmailUiViewBase::HandleDynamicVariantSwitchL( aType ); |
2223 CFsEmailUiViewBase::HandleDynamicVariantSwitchL( aType ); |
2184 |
2224 |
2185 if ( iConstructionCompleted ) |
2225 if ( iConstructionCompleted ) |
2186 { |
2226 { |
2187 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
2227 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
2188 |
2228 |
2189 // <cmail> Use layout data instead of hard-coded values |
|
2190 TRect mainPaneRect; |
2229 TRect mainPaneRect; |
2191 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2230 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2192 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2231 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2193 |
2232 |
2194 TAknLayoutRect scrollBarRect; |
2233 TAknLayoutRect scrollBarRect; |
2195 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
2234 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
2196 TRect gridRect = mainPaneRect; |
2235 TRect gridRect = mainPaneRect; |
2197 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2236 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2198 |
2237 |
2199 TAknLayoutRect cellRect; |
2238 TAknLayoutRect cellRect; |
2200 cellRect.LayoutRect(gridRect, AknLayoutScalable_Apps::aid_size_cell_cmail_l(var, 0, 0)); |
2239 cellRect.LayoutRect(gridRect, AknLayoutScalable_Apps::aid_size_cell_cmail_l(var, 0, 0)); |
2201 |
2240 |
2202 TSize displaySize = cellRect.Rect().Size(); |
2241 TSize displaySize = cellRect.Rect().Size(); |
2203 // </cmail> |
|
2204 iParentLayout->SetSize( displaySize ); |
2242 iParentLayout->SetSize( displaySize ); |
2205 RescaleIconsL(); |
2243 RescaleIconsL(); |
2206 VisualLayoutUpdatedL(); |
2244 VisualLayoutUpdatedL(); |
2207 |
2245 |
2208 UpdateFocusVisibility(); |
2246 UpdateFocusVisibility(); |
2209 } |
2247 } |
2210 } |
2248 } |
2211 |
2249 |
2212 void CFSEmailUiLauncherGridVisualiser::HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
2250 void CFSEmailUiLauncherGridVisualiser::HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
2213 { |
2251 { |
2214 FUNC_LOG; |
2252 FUNC_LOG; |
2215 iRefreshNeeded = ETrue; |
2253 iRefreshNeeded = ETrue; |
2216 |
2254 |
2217 CFsEmailUiViewBase::HandleDynamicVariantSwitchOnBackgroundL( aType ); |
2255 CFsEmailUiViewBase::HandleDynamicVariantSwitchOnBackgroundL( aType ); |
2218 } |
2256 } |
2219 |
2257 |
2220 void CFSEmailUiLauncherGridVisualiser::HandleContentChangeL() |
2258 void CFSEmailUiLauncherGridVisualiser::HandleContentChangeL() |
2221 { |
2259 { |
2396 } |
2434 } |
2397 else if( onOffStatus == EFSMailBoxOnline ) |
2435 else if( onOffStatus == EFSMailBoxOnline ) |
2398 { |
2436 { |
2399 returnStatus.iMailboxesOnline++; |
2437 returnStatus.iMailboxesOnline++; |
2400 } |
2438 } |
2401 |
2439 |
2402 // Then check sync state |
2440 // Then check sync state |
2403 TSSMailSyncState latestSyncstate = mailBoxes[i]->CurrentSyncState(); |
2441 TSSMailSyncState latestSyncstate = mailBoxes[i]->CurrentSyncState(); |
2404 if( latestSyncstate == InboxSyncing || |
2442 if( latestSyncstate == InboxSyncing || |
2405 latestSyncstate == StartingSync || |
2443 latestSyncstate == StartingSync || |
2406 latestSyncstate == EmailSyncing ) |
2444 latestSyncstate == EmailSyncing ) |
2407 { |
2445 { |
2408 returnStatus.iMailboxesSyncing++; |
2446 returnStatus.iMailboxesSyncing++; |
2409 } |
2447 } |
2410 } |
2448 } |
2411 |
2449 |
2412 CleanupStack::PopAndDestroy( &mailBoxes ); |
2450 CleanupStack::PopAndDestroy( &mailBoxes ); |
2413 return returnStatus; |
2451 return returnStatus; |
2414 } |
2452 } |
2415 |
2453 |
2416 // Bitmap provider for grid ecom plugins icons |
2454 // Bitmap provider for grid ecom plugins icons |
2417 void CFSEmailUiLauncherGridVisualiser::ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) |
2455 void CFSEmailUiLauncherGridVisualiser::ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) |
2418 { |
2456 { |
2419 FUNC_LOG; |
2457 FUNC_LOG; |
2420 // <cmail> Use layout data instead of hard-coded values |
2458 // <cmail> Use layout data instead of hard-coded values |
2421 TRect mainPaneRect; |
2459 TRect mainPaneRect; |
2422 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2460 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2423 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2461 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2424 |
2462 |
2425 TAknLayoutRect scrollBarRect; |
2463 TAknLayoutRect scrollBarRect; |
2426 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
2464 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
2427 TRect gridRect = mainPaneRect; |
2465 TRect gridRect = mainPaneRect; |
2428 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2466 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2429 |
2467 |
2430 TAknLayoutRect itemRect; |
2468 TAknLayoutRect itemRect; |
2431 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
2469 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
2432 |
2470 |
2433 TAknLayoutRect gridIconRect; |
2471 TAknLayoutRect gridIconRect; |
2434 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
2472 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
2435 // </cmail> |
2473 // </cmail> |
2436 |
2474 |
2437 CAknIcon* launcherItemIcon(0); |
2475 CAknIcon* launcherItemIcon(0); |
2438 for ( TInt i=0; i<iPluginIdIconIdPairs.Count(); i++ ) |
2476 for ( TInt i=0; i<iPluginIdIconIdPairs.Count(); i++ ) |
2439 { |
2477 { |
2440 if ( aId == iPluginIdIconIdPairs[i].iIconId ) |
2478 if ( aId == iPluginIdIconIdPairs[i].iIconId ) |
2441 { |
2479 { |
2442 launcherItemIcon = iLauncherItems[iPluginIdIconIdPairs[i].iPluginArrayIndex]->Icon(); |
2480 launcherItemIcon = iLauncherItems[iPluginIdIconIdPairs[i].iPluginArrayIndex]->Icon(); |
2443 } |
2481 } |
2444 } |
2482 } |
2445 |
2483 |
2446 if ( launcherItemIcon ) |
2484 if ( launcherItemIcon ) |
2447 { |
2485 { |
2448 // <cmail> Use layout data instead of hard-coded values |
2486 // <cmail> Use layout data instead of hard-coded values |
2449 // Set bitmap size |
2487 // Set bitmap size |
2450 //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); |
2488 //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); |
2451 |
2489 |
2452 TSize iconSize = gridIconRect.Rect().Size(); |
2490 TSize iconSize = gridIconRect.Rect().Size(); |
2453 // </cmail> |
2491 // </cmail> |