56 #include <aknstyluspopupmenu.h> |
56 #include <aknstyluspopupmenu.h> |
57 #include <aknlayoutscalable_avkon.cdl.h> |
57 #include <aknlayoutscalable_avkon.cdl.h> |
58 #include <aknlayoutscalable_apps.cdl.h> |
58 #include <aknlayoutscalable_apps.cdl.h> |
59 #include <layoutmetadata.cdl.h> |
59 #include <layoutmetadata.cdl.h> |
60 #include <touchfeedback.h> |
60 #include <touchfeedback.h> |
|
61 #include <aknphysics.h> |
61 |
62 |
62 // INTERNAL INCLUDE FILES |
63 // INTERNAL INCLUDE FILES |
63 #include "FSEmailBuildFlags.h" |
64 #include "FSEmailBuildFlags.h" |
64 #include "FreestyleEmailUiConstants.h" |
65 #include "FreestyleEmailUiConstants.h" |
65 #include "FreestyleEmailUiLiterals.h" |
66 #include "FreestyleEmailUiLiterals.h" |
123 iRowHeight( 0 ), |
124 iRowHeight( 0 ), |
124 iColumnWidth( 0 ), |
125 iColumnWidth( 0 ), |
125 iSelector( 0 ), |
126 iSelector( 0 ), |
126 iStartupAnimation( 0 ), |
127 iStartupAnimation( 0 ), |
127 iStartupEffectStyle( 0 ), |
128 iStartupEffectStyle( 0 ), |
128 iWizardWaitnoteShown( EFalse ) |
129 iWizardWaitnoteShown( EFalse ), |
|
130 iPointerAction( EFalse ), |
|
131 iIsDragging( EFalse ), |
|
132 iScrolled( EFalse ), |
|
133 iLaunchWizardExecuted( EFalse ) |
129 { |
134 { |
130 FUNC_LOG; |
135 FUNC_LOG; |
131 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
136 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
132 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
137 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
133 iControl = aControl; |
138 iControl = aControl; |
146 iMailboxDeleter = CFSEmailUiMailboxDeleter::NewL( *iAppUi.GetMailClient(), *this ); |
151 iMailboxDeleter = CFSEmailUiMailboxDeleter::NewL( *iAppUi.GetMailClient(), *this ); |
147 |
152 |
148 // Create startup timer |
153 // Create startup timer |
149 iStartupCallbackTimer = CFSEmailUiGenericTimer::NewL( this ); |
154 iStartupCallbackTimer = CFSEmailUiGenericTimer::NewL( this ); |
150 |
155 |
|
156 iCurrentLevel.iParentPos.iY = 0; |
|
157 iCurrentLevel.iParentPos.iX = 0; |
|
158 |
|
159 if ( CAknPhysics::FeatureEnabled() ) |
|
160 { |
|
161 iPhysics = CAknPhysics::NewL(*this, NULL); |
|
162 } |
151 } |
163 } |
152 |
164 |
153 // ---------------------------------------------------------------------------- |
165 // ---------------------------------------------------------------------------- |
154 // CFSEmailUiLauncherGridVisualiser::DoFirstStartL() |
166 // CFSEmailUiLauncherGridVisualiser::DoFirstStartL() |
155 // Purpose of this function is to do first start only when grid is really |
167 // Purpose of this function is to do first start only when grid is really |
289 transition = KScaleSelected; |
303 transition = KScaleSelected; |
290 } |
304 } |
291 TAlfTimedValue scaleValue; |
305 TAlfTimedValue scaleValue; |
292 scaleValue.SetTarget( transition, KIconScalingTransitionTimeMs * 2 ); |
306 scaleValue.SetTarget( transition, KIconScalingTransitionTimeMs * 2 ); |
293 iCurrentLevel.iItemVisualData[selectedItem].iImage->SetScale( scaleValue ); |
307 iCurrentLevel.iItemVisualData[selectedItem].iImage->SetScale( scaleValue ); |
294 HandleRowMovement( EDirectionTouch, selectedItem ); |
308 if ( !iScrolled ) |
|
309 { |
|
310 HandleRowMovement( EDirectionTouch, selectedItem ); |
|
311 } |
295 } |
312 } |
296 } |
313 } |
297 |
314 |
298 CFSEmailUiLauncherGridVisualiser::~CFSEmailUiLauncherGridVisualiser() |
315 CFSEmailUiLauncherGridVisualiser::~CFSEmailUiLauncherGridVisualiser() |
299 { |
316 { |
368 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var,0,0)); |
385 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var,0,0)); |
369 |
386 |
370 TAknLayoutRect gridIconLRect; |
387 TAknLayoutRect gridIconLRect; |
371 gridIconLRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
388 gridIconLRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
372 TSize iconSize = gridIconLRect.Rect().Size(); |
389 TSize iconSize = gridIconLRect.Rect().Size(); |
373 // </cmail> |
|
374 |
390 |
375 for ( TInt itemIndex = 0; itemIndex < count; itemIndex++ ) |
391 for ( TInt itemIndex = 0; itemIndex < count; itemIndex++ ) |
376 { |
392 { |
377 TInt itemId = reader.ReadInt16(); |
393 TInt itemId = reader.ReadInt16(); |
378 switch ( itemId ) |
394 switch ( itemId ) |
679 { |
695 { |
680 iFirstStartComplete = ETrue; |
696 iFirstStartComplete = ETrue; |
681 iAppUi.GridStarted( startedFromOds ); |
697 iAppUi.GridStarted( startedFromOds ); |
682 iAppUi.ShowMailboxQueryL(); |
698 iAppUi.ShowMailboxQueryL(); |
683 } |
699 } |
684 // <cmail> |
|
685 else |
700 else |
686 { |
701 { |
687 // Ensure that FSMailServer is running, but don't do it on first |
702 // Ensure that FSMailServer is running, but don't do it on first |
688 // activation, as it's done anyway in AppUi's ConstructL |
703 // activation, as it's done anyway in AppUi's ConstructL |
689 TFsEmailUiUtility::EnsureFsMailServerIsRunning( iEikonEnv->WsSession() ); |
704 TFsEmailUiUtility::EnsureFsMailServerIsRunning( iEikonEnv->WsSession() ); |
749 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnlineAll, ETrue ); |
763 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnlineAll, ETrue ); |
750 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
764 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
751 } |
765 } |
752 else |
766 else |
753 { |
767 { |
754 // <cmail> |
|
755 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
768 aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); |
756 // </cmail> |
|
757 |
769 |
758 if( mbStatus.iMailboxCount <= 0 ) |
770 if( mbStatus.iMailboxCount <= 0 ) |
759 { |
771 { |
760 // If no mailboxes configured, dimm all mailbox related items |
772 // If no mailboxes configured, dimm all mailbox related items |
761 aMenuPane->SetItemDimmed( EFsEmailUiCmdDeleteMailbox, ETrue ); |
773 aMenuPane->SetItemDimmed( EFsEmailUiCmdDeleteMailbox, ETrue ); |
1052 || (scanCode == EStdKeyDownArrow) |
1056 || (scanCode == EStdKeyDownArrow) |
1053 || (scanCode == EStdKeyEnter) |
1057 || (scanCode == EStdKeyEnter) |
1054 || (scanCode == EStdKeyDeviceA) |
1058 || (scanCode == EStdKeyDeviceA) |
1055 || (scanCode ==EStdKeyDevice3)) |
1059 || (scanCode ==EStdKeyDevice3)) |
1056 { |
1060 { |
1057 |
1061 TBool scrolled = iScrolled; |
1058 if ( !iAppUi.SetFocusVisibility( ETrue ) ) |
1062 if ( iScrolled ) |
|
1063 { |
|
1064 iScrolled = EFalse; |
|
1065 SetFocusedItemL( iFirstVisibleRow * iVisibleColumns ); |
|
1066 } |
|
1067 |
|
1068 //iCurrentLevel.iSelected = |
|
1069 if ( !iAppUi.SetFocusVisibility( ETrue ) || |
|
1070 scrolled ) |
1059 { |
1071 { |
1060 // focus is now activated. ignore key press. |
1072 // focus is now activated. ignore key press. |
1061 UpdateFocusVisibility(); |
1073 UpdateFocusVisibility(); |
1062 ResizeItemIcon( EFalse ); |
1074 ResizeItemIcon( EFalse ); |
1063 return ETrue; |
1075 return ETrue; |
1108 // |
1120 // |
1109 TBool CFSEmailUiLauncherGridVisualiser::HandlePointerEventL( |
1121 TBool CFSEmailUiLauncherGridVisualiser::HandlePointerEventL( |
1110 const TAlfEvent& aEvent ) |
1122 const TAlfEvent& aEvent ) |
1111 { |
1123 { |
1112 FUNC_LOG; |
1124 FUNC_LOG; |
1113 TBool result( EFalse ); |
1125 if( !IsViewActive() ) |
1114 TInt currentlyFocused( iCurrentLevel.iSelected ); |
1126 { |
|
1127 return EFalse; |
|
1128 } |
1115 TPointerEvent::TType type = aEvent.PointerEvent().iType; |
1129 TPointerEvent::TType type = aEvent.PointerEvent().iType; |
1116 TInt id = FindPointedItem( aEvent ); |
1130 TInt id = FindPointedItem( aEvent ); |
1117 |
1131 |
1118 if( KErrNotFound != id ) |
1132 switch( type ) |
1119 { |
1133 { |
1120 // The event coordinates correspond with an item. |
1134 case TPointerEvent::EButton1Down: |
1121 switch( type ) |
1135 { |
1122 { |
1136 iPreviousPosition = iOriginalPosition = aEvent.PointerEvent().iParentPosition; |
1123 case TPointerEvent::EButton1Down: |
1137 iPointerAction = ETrue; |
|
1138 iIsDragging = EFalse; |
|
1139 |
|
1140 if( iPhysics ) |
|
1141 { |
|
1142 iPhysics->StopPhysics(); |
|
1143 iPhysics->ResetFriction(); |
|
1144 iStartTime.HomeTime(); |
|
1145 UpdatePhysicsL(); |
|
1146 iTotalDragging = 0; |
|
1147 } |
|
1148 if ( id != KErrNotFound) |
1124 { |
1149 { |
1125 // tactile feedback |
1150 // tactile feedback |
1126 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1151 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1127 if ( feedback ) |
1152 if ( feedback ) |
1128 { |
1153 { |
1131 |
1156 |
1132 iItemIdInButtonDownEvent.iItemId = id; |
1157 iItemIdInButtonDownEvent.iItemId = id; |
1133 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
1158 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
1134 SetFocusedItemL( id ); |
1159 SetFocusedItemL( id ); |
1135 UpdateFocusVisibility(); |
1160 UpdateFocusVisibility(); |
1136 break; |
|
1137 } |
1161 } |
1138 case TPointerEvent::EButton1Up: |
1162 break; |
|
1163 } |
|
1164 case TPointerEvent::EButton1Up: |
|
1165 { |
|
1166 if( iIsDragging && iPhysics ) |
|
1167 { |
|
1168 TPoint drag( iOriginalPosition - aEvent.PointerEvent().iParentPosition ); |
|
1169 iPhysics->StartPhysics( drag, iStartTime ); |
|
1170 iIsDragging = EFalse; |
|
1171 iPointerAction = EFalse; |
|
1172 iTotalDragging = 0; |
|
1173 } |
|
1174 else if ( id != KErrNotFound ) |
1139 { |
1175 { |
1140 if ( iStylusPopUpMenuLaunched ) |
1176 if ( iStylusPopUpMenuLaunched ) |
1141 { |
1177 { |
1142 // A pop-up menu was launched. Do not open the selected |
1178 // A pop-up menu was launched. Do not open the selected |
1143 // item. |
1179 // item. |
1144 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
1180 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
1145 break; |
1181 break; |
1146 } |
1182 } |
1147 |
1183 |
1148 // Hide focus always after pointer up event. |
1184 // Hide focus always after pointer up event. |
1149 iAppUi.SetFocusVisibility( EFalse ); |
1185 iAppUi.SetFocusVisibility( EFalse ); |
1150 |
1186 |
1151 // If key was released on item that had focus |
1187 // If key was released on item that had focus |
1159 SelectL(); |
1195 SelectL(); |
1160 } |
1196 } |
1161 else |
1197 else |
1162 { |
1198 { |
1163 HandleButtonReleaseEvent(); |
1199 HandleButtonReleaseEvent(); |
1164 break; |
|
1165 } |
1200 } |
1166 } |
1201 } |
1167 case TPointerEvent::EDrag: |
1202 else if( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) |
1168 { |
1203 { |
1169 // if pointer is moved on to other item, decrease focused |
1204 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
1170 // item's icon. |
1205 ResizeItemIcon( ETrue ); |
1171 if ( ( currentlyFocused != id ) && |
1206 |
1172 ( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) ) |
|
1173 { |
|
1174 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
|
1175 ResizeItemIcon( ETrue ); |
|
1176 } |
|
1177 |
|
1178 // if pointer is moved on item that has focus, increase item's |
|
1179 // icon. |
|
1180 else if ( id == iItemIdInButtonDownEvent.iItemId ) |
|
1181 { |
|
1182 iItemIdInButtonDownEvent.iLaunchSelection = ETrue; |
|
1183 ResizeItemIcon( EFalse ); |
|
1184 } |
|
1185 |
|
1186 break; |
|
1187 } |
|
1188 case TPointerEvent::EButtonRepeat: |
|
1189 { |
|
1190 // Long tap. |
|
1191 if ( currentlyFocused != id || |
|
1192 iItemIdInButtonDownEvent.iItemId == KErrNotFound ) |
|
1193 { |
|
1194 // The item beneath the touch was changed during the long |
|
1195 // tap. Thus, do not show the pop-up. |
|
1196 break; |
|
1197 } |
|
1198 |
|
1199 // Check the type of the currently selected item. |
|
1200 TInt itemType = iCurrentLevel.iItems[id].iId; |
|
1201 |
|
1202 if ( itemType == EDefaultMailboxItem || |
|
1203 itemType == EOtherMailboxItems ) |
|
1204 { |
|
1205 // The selected item is a mail box. Launch the pop-up |
|
1206 // menu. |
|
1207 LaunchStylusPopupMenu( id ); |
|
1208 } |
|
1209 |
|
1210 break; |
|
1211 } |
|
1212 default: |
|
1213 { |
|
1214 break; |
|
1215 } |
|
1216 } |
|
1217 |
|
1218 result = ETrue; |
|
1219 } |
|
1220 // if event do not concern any of items. |
|
1221 else if( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) |
|
1222 { |
|
1223 iItemIdInButtonDownEvent.iLaunchSelection = EFalse; |
|
1224 ResizeItemIcon( ETrue ); |
|
1225 |
|
1226 switch( type ) |
|
1227 { |
|
1228 case TPointerEvent::EButton1Down: |
|
1229 { |
|
1230 // ask if focus is on (flip open) |
|
1231 // iItemIdInButtonDownEvent.iItemId = currentlyFocused |
|
1232 break; |
|
1233 } |
|
1234 case TPointerEvent::EButton1Up: |
|
1235 { |
|
1236 // Hide focus always after pointer up event. |
1207 // Hide focus always after pointer up event. |
1237 iAppUi.SetFocusVisibility( EFalse ); |
1208 iAppUi.SetFocusVisibility( EFalse ); |
1238 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
1209 iItemIdInButtonDownEvent.iItemId = KErrNotFound; |
1239 HandleButtonReleaseEvent(); |
1210 HandleButtonReleaseEvent(); |
1240 break; |
|
1241 } |
1211 } |
1242 default: |
1212 else |
1243 { |
1213 { |
1244 break; |
1214 iAppUi.SetFocusVisibility( EFalse ); |
1245 } |
1215 } |
1246 } |
1216 break; |
1247 } |
1217 } |
1248 else |
1218 case TPointerEvent::EDrag: |
1249 { |
1219 { |
1250 if( aEvent.IsPointerEvent() && aEvent.PointerUp() ) |
1220 if( iPhysics ) |
1251 { |
1221 { |
1252 // Hide focus always after pointer up event. |
1222 TPoint position = aEvent.PointerEvent().iParentPosition; |
1253 iAppUi.SetFocusVisibility( EFalse ); |
1223 TPoint delta( 0, iPreviousPosition.iY - position.iY ); |
1254 } |
1224 iTotalDragging = iTotalDragging + delta.iY; |
1255 } |
1225 if (Abs(iTotalDragging) >= iPhysics->DragThreshold() || iIsDragging ) |
1256 |
1226 { |
1257 return result; |
1227 // Hide focus always when dragging. |
|
1228 iAppUi.SetFocusVisibility( EFalse ); |
|
1229 if ( iSelector ) |
|
1230 { |
|
1231 TAlfTimedValue selectorOpacity; |
|
1232 selectorOpacity.SetValueNow( 0 ); |
|
1233 iSelector->SetOpacity( selectorOpacity ); |
|
1234 } |
|
1235 |
|
1236 iIsDragging = ETrue; |
|
1237 |
|
1238 iPhysics->RegisterPanningPosition( delta ); |
|
1239 iScrolled = ETrue; |
|
1240 } |
|
1241 // Save current position as previous pos for future calculations |
|
1242 iPreviousPosition = position; |
|
1243 } |
|
1244 break; |
|
1245 } |
|
1246 case TPointerEvent::EButtonRepeat: |
|
1247 { |
|
1248 if (!iIsDragging && id != KErrNotFound ) |
|
1249 { |
|
1250 // Check the type of the currently selected item. |
|
1251 TInt itemType = iCurrentLevel.iItems[id].iId; |
|
1252 |
|
1253 if ( itemType == EDefaultMailboxItem || |
|
1254 itemType == EOtherMailboxItems ) |
|
1255 { |
|
1256 // The selected item is a mail box. Launch the pop-up |
|
1257 // menu. |
|
1258 LaunchStylusPopupMenu( id ); |
|
1259 } |
|
1260 } |
|
1261 break; |
|
1262 } |
|
1263 default: |
|
1264 { |
|
1265 break; |
|
1266 } |
|
1267 } |
|
1268 return ETrue; |
1258 } |
1269 } |
1259 |
1270 |
1260 // --------------------------------------------------------------------------- |
1271 // --------------------------------------------------------------------------- |
1261 // CFSEmailUiLauncherGridVisualiser::FindPointedItem |
1272 // CFSEmailUiLauncherGridVisualiser::FindPointedItem |
1262 // |
1273 // |
1412 if ( iCurrentLevel.iSelected >= itemCount ) |
1423 if ( iCurrentLevel.iSelected >= itemCount ) |
1413 { |
1424 { |
1414 iCurrentLevel.iSelected = itemCount - 1; |
1425 iCurrentLevel.iSelected = itemCount - 1; |
1415 } |
1426 } |
1416 } |
1427 } |
1417 |
1428 if (!iPointerAction) |
1418 TInt x = iCurrentLevel.iSelected % iVisibleColumns; |
1429 { |
1419 TInt y = (iCurrentLevel.iSelected-x) / iVisibleColumns; |
1430 TInt x = iCurrentLevel.iSelected % iVisibleColumns; |
1420 |
1431 TInt y = (iCurrentLevel.iSelected-x) / iVisibleColumns; |
1421 ScrollToRow( y ); |
1432 ScrollToRow( y ); |
1422 |
1433 } |
1423 } |
1434 } |
1424 |
1435 |
1425 |
1436 |
1426 void CFSEmailUiLauncherGridVisualiser::MoveSelectorToCurrentItem( TDirection aDir ) |
1437 void CFSEmailUiLauncherGridVisualiser::MoveSelectorToCurrentItem( TDirection aDir ) |
1427 { |
1438 { |
1428 FUNC_LOG; |
1439 FUNC_LOG; |
1429 TAlfRealPoint curPos = iSelector->Pos().ValueNow(); // this is the wrapped value of the current position |
1440 TAlfRealPoint curPos = iSelector->Pos().ValueNow(); // this is the wrapped value of the current position |
1430 iSelector->SetPos( curPos, 0 ); // wrap position now |
1441 iSelector->SetPos( curPos, 0 ); // wrap position now |
1431 |
1442 |
1432 // Calculate where are we heading |
1443 // Calculate where are we heading |
1433 // <cmail> Platform layout change |
|
1434 CAlfVisual* selectedBase = iCurrentLevel.iItemVisualData[iCurrentLevel.iSelected].iBase; |
1444 CAlfVisual* selectedBase = iCurrentLevel.iItemVisualData[iCurrentLevel.iSelected].iBase; |
1435 TPoint displayPos = selectedBase->LocalToDisplay( selectedBase->Pos().Target() ); |
1445 TPoint displayPos = selectedBase->LocalToDisplay( selectedBase->Pos().Target() ); |
1436 // </cmail> |
|
1437 TPoint targetPos = iSelector->DisplayToLocal( displayPos ); |
1446 TPoint targetPos = iSelector->DisplayToLocal( displayPos ); |
1438 |
1447 |
1439 // Check if we need to wrap the selector over the edge of the screen |
1448 // Check if we need to wrap the selector over the edge of the screen |
1440 TPoint ringWrapOffset( 0, 0 ); |
1449 TPoint ringWrapOffset( 0, 0 ); |
1441 const TInt KGridWrapWidth = (iVisibleColumns+2)*iColumnWidth; |
1450 const TInt KGridWrapWidth = (iVisibleColumns+2)*iColumnWidth; |
1537 offset = iFirstVisibleRow * iRowHeight; |
1536 offset = iFirstVisibleRow * iRowHeight; |
1538 |
1537 |
1539 TAlfTimedPoint alfScrollOffset; |
1538 TAlfTimedPoint alfScrollOffset; |
1540 alfScrollOffset.iY.SetTarget( offset , KScrollTransitionTimeMs ); |
1539 alfScrollOffset.iY.SetTarget( offset , KScrollTransitionTimeMs ); |
1541 iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); |
1540 iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); |
1542 // <cmail> |
1541 iScrollbarModel.SetFocusPosition(offset); |
1543 iScrollbarModel.SetFocusPosition(iFirstVisibleRow); |
|
1544 TRAP_IGNORE( iScrollbar->SetModelL(&iScrollbarModel) ); |
1542 TRAP_IGNORE( iScrollbar->SetModelL(&iScrollbarModel) ); |
1545 iScrollbar->DrawNow(); |
1543 iScrollbar->DrawNow(); |
1546 // </cmail> |
|
1547 } |
1544 } |
1548 |
1545 |
1549 void CFSEmailUiLauncherGridVisualiser::RefreshLauncherViewL() |
1546 void CFSEmailUiLauncherGridVisualiser::RefreshLauncherViewL() |
1550 { |
1547 { |
1551 FUNC_LOG; |
1548 FUNC_LOG; |
1906 if ( !iConstructionCompleted ) |
1900 if ( !iConstructionCompleted ) |
1907 { |
1901 { |
1908 DoFirstStartL(); |
1902 DoFirstStartL(); |
1909 } |
1903 } |
1910 |
1904 |
1911 iAiwSHandler->ExecuteServiceCmdL( KAiwCmdSettingWizardFsEmail.iUid, |
1905 if ( ! iLaunchWizardExecuted ) // prevent reentrant calling |
1912 iAiwSHandler->InParamListL(), |
1906 { |
1913 iAiwSHandler->OutParamListL() ); |
1907 iLaunchWizardExecuted = ETrue; |
|
1908 TRAPD( err, iAiwSHandler->ExecuteServiceCmdL( KAiwCmdSettingWizardFsEmail.iUid, |
|
1909 iAiwSHandler->InParamListL(), |
|
1910 iAiwSHandler->OutParamListL() ) ); |
|
1911 // ExecuteServiceCmdL is synchronous - uses CActiveSchedulerWait |
|
1912 iLaunchWizardExecuted = EFalse; |
|
1913 User::LeaveIfError( err ); |
|
1914 } |
|
1915 |
1914 } |
1916 } |
1915 |
1917 |
1916 void CFSEmailUiLauncherGridVisualiser::GoToInboxL( TFSMailMsgId& aMailboxId, TFSMailMsgId& aMailboxInboxId ) |
1918 void CFSEmailUiLauncherGridVisualiser::GoToInboxL( TFSMailMsgId& aMailboxId, TFSMailMsgId& aMailboxInboxId ) |
1917 { |
1919 { |
1918 FUNC_LOG; |
1920 FUNC_LOG; |
1948 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)); |
1949 |
1950 |
1950 //TInt gridIconSize = iAppUi.LayoutHandler()->GridIconSize(); |
1951 //TInt gridIconSize = iAppUi.LayoutHandler()->GridIconSize(); |
1951 TSize iconSize = gridIconRect.Rect().Size(); |
1952 TSize iconSize = gridIconRect.Rect().Size(); |
1952 //iconSize.SetSize( gridIconSize, gridIconSize ); |
1953 //iconSize.SetSize( gridIconSize, gridIconSize ); |
1953 // </cmail> |
|
1954 |
1954 |
1955 // Scale bitmaps |
1955 // Scale bitmaps |
1956 for( TInt i = 0 ; i < iIconArray.Count() ; i++ ) |
1956 for( TInt i = 0 ; i < iIconArray.Count() ; i++ ) |
1957 { |
1957 { |
1958 iIconArray[i]->Size().SetSize( iconSize.iWidth, iconSize.iHeight ); |
1958 iIconArray[i]->Size().SetSize( iconSize.iWidth, iconSize.iHeight ); |
1973 HBufC* launcherItemText = aItem->Caption( EFalse ).AllocLC(); |
1973 HBufC* launcherItemText = aItem->Caption( EFalse ).AllocLC(); |
1974 CAknIcon* launcherItemIcon = aItem->Icon(); |
1974 CAknIcon* launcherItemIcon = aItem->Icon(); |
1975 |
1975 |
1976 if ( launcherItemIcon ) |
1976 if ( launcherItemIcon ) |
1977 { |
1977 { |
1978 // <cmail> Use layout data instead of hard-coded values |
|
1979 TRect mainPaneRect; |
1978 TRect mainPaneRect; |
1980 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1979 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
1981 |
1980 |
1982 TAknLayoutRect scrollBarRect; |
1981 TAknLayoutRect scrollBarRect; |
1983 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1982 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
1991 |
1990 |
1992 TAknLayoutRect gridIconRect; |
1991 TAknLayoutRect gridIconRect; |
1993 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1992 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
1994 |
1993 |
1995 TSize iconSize = gridIconRect.Rect().Size(); |
1994 TSize iconSize = gridIconRect.Rect().Size(); |
1996 // </cmail> |
|
1997 |
1995 |
1998 const CFbsBitmap* bitmap = launcherItemIcon->Bitmap(); |
1996 const CFbsBitmap* bitmap = launcherItemIcon->Bitmap(); |
1999 const CFbsBitmap* mask = launcherItemIcon->Mask(); |
1997 const CFbsBitmap* mask = launcherItemIcon->Mask(); |
2000 |
1998 |
2001 // First add plugin id and icon id pair to array, needed in provide bitmap |
1999 // First add plugin id and icon id pair to array, needed in provide bitmap |
2006 |
2004 |
2007 // Create texture, goes to provide bitmap |
2005 // Create texture, goes to provide bitmap |
2008 CAlfTexture* texture = &CAlfStatic::Env().TextureManager().CreateTextureL( iPluginTextureId, this, EAlfTextureFlagDefault ); |
2006 CAlfTexture* texture = &CAlfStatic::Env().TextureManager().CreateTextureL( iPluginTextureId, this, EAlfTextureFlagDefault ); |
2009 // Update texture id |
2007 // Update texture id |
2010 iPluginTextureId++; // Id is updated dynamically |
2008 iPluginTextureId++; // Id is updated dynamically |
2011 // Set initiel size |
2009 // Set initial size |
2012 // <cmail> Use layout data instead of hard-coded values |
|
2013 //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); |
|
2014 // <cmail> |
|
2015 texture->Size().SetSize( iconSize.iHeight, iconSize.iWidth ); |
2010 texture->Size().SetSize( iconSize.iHeight, iconSize.iWidth ); |
2016 iModel->AddL( |
2011 iModel->AddL( |
2017 EShortcut, |
2012 EShortcut, |
2018 aItem->Id(), |
2013 aItem->Id(), |
2019 *launcherItemText, |
2014 *launcherItemText, |
2045 FUNC_LOG; |
2040 FUNC_LOG; |
2046 if ( iConstructionCompleted ) |
2041 if ( iConstructionCompleted ) |
2047 { |
2042 { |
2048 iCurrentLevel.iParent = 0; |
2043 iCurrentLevel.iParent = 0; |
2049 |
2044 |
2050 // <cmail> Use layout data instead of hard-coded values |
|
2051 TRect mainPaneRect; |
2045 TRect mainPaneRect; |
2052 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2046 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2053 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2047 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2054 |
2048 |
2055 TAknLayoutRect scrollBarRect; |
2049 TAknLayoutRect scrollBarRect; |
2056 // <cmail> |
2050 |
2057 // scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
|
2058 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::scroll_pane_cp03()); |
2051 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::scroll_pane_cp03()); |
2059 // </cmail> |
2052 |
2060 TRect gridRect = mainPaneRect; |
2053 TRect gridRect = mainPaneRect; |
2061 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2054 gridRect.iBr.iX -= scrollBarRect.Rect().Width(); |
2062 |
2055 |
2063 TAknLayoutRect cellRect; |
2056 TAknLayoutRect cellRect; |
2064 cellRect.LayoutRect(gridRect, AknLayoutScalable_Apps::aid_size_cell_cmail_l(var, 0, 0)); |
2057 cellRect.LayoutRect(gridRect, AknLayoutScalable_Apps::aid_size_cell_cmail_l(var, 0, 0)); |
2077 |
2070 |
2078 TSize displaySize = mainPaneRect.Size(); |
2071 TSize displaySize = mainPaneRect.Size(); |
2079 |
2072 |
2080 TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; |
2073 TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; |
2081 TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; |
2074 TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; |
2082 |
|
2083 // </cmail> |
|
2084 |
2075 |
2085 iCurrentLevel.iGridLayout->SetSize( gridRect.Size() ); |
2076 iCurrentLevel.iGridLayout->SetSize( gridRect.Size() ); |
2086 iCurrentLevel.iGridLayout->SetColumnsL( columns ); |
2077 iCurrentLevel.iGridLayout->SetColumnsL( columns ); |
2087 iCurrentLevel.iGridLayout->SetRowsL( rows ); |
2078 iCurrentLevel.iGridLayout->SetRowsL( rows ); |
2088 |
2079 |
2089 PopulateL( iCurrentLevel ); |
2080 PopulateL( iCurrentLevel ); |
2090 UpdateScrollBarRangeL(); |
2081 UpdateScrollBarRangeL(); |
2091 |
2082 |
2092 TInt scrollbarWidth = scrollBarRect.Rect().Width(); |
2083 TInt scrollbarWidth = scrollBarRect.Rect().Width(); |
2093 // <cmail> |
|
2094 if( iRowCount > iVisibleRows ) |
2084 if( iRowCount > iVisibleRows ) |
2095 { |
2085 { |
2096 iScrollbar->MakeVisible(ETrue); |
2086 iScrollbar->MakeVisible(ETrue); |
2097 } |
2087 } |
2098 else |
2088 else |
2099 { |
2089 { |
2100 iScrollbar->MakeVisible(EFalse); |
2090 iScrollbar->MakeVisible(EFalse); |
2101 } |
2091 } |
2102 // </cmail> |
|
2103 |
2092 |
2104 TInt scrollbarTopLeftX = displaySize.iWidth - scrollbarWidth; |
2093 TInt scrollbarTopLeftX = displaySize.iWidth - scrollbarWidth; |
2105 TInt scrollbarTopLeftY = 0; |
2094 TInt scrollbarTopLeftY = 0; |
2106 TInt scrollbarBottomRightX = displaySize.iWidth; |
2095 TInt scrollbarBottomRightX = displaySize.iWidth; |
2107 TInt scrollbarBottomRightY = displaySize.iHeight; |
2096 TInt scrollbarBottomRightY = displaySize.iHeight; |
2167 |
2156 |
2168 // Selector ring wrap limits can be calculated when row and column sizes are known. |
2157 // Selector ring wrap limits can be calculated when row and column sizes are known. |
2169 SetRingWrapLimits(); |
2158 SetRingWrapLimits(); |
2170 MoveSelection( EDirectionNone ); |
2159 MoveSelection( EDirectionNone ); |
2171 |
2160 |
2172 // <cmail> |
|
2173 TRect scrollbarRect; |
2161 TRect scrollbarRect; |
2174 scrollbarRect.SetRect(scrollbarTopLeftX, scrollbarTopLeftY, scrollbarBottomRightX, scrollbarBottomRightY); |
2162 scrollbarRect.SetRect(scrollbarTopLeftX, scrollbarTopLeftY, scrollbarBottomRightX, scrollbarBottomRightY); |
2175 scrollbarRect.Move(mainPaneRect.iTl); |
2163 scrollbarRect.Move(mainPaneRect.iTl); |
2176 iScrollbar->SetRect(scrollbarRect); |
2164 iScrollbar->SetRect(scrollbarRect); |
2177 iScrollbar->DrawDeferred(); |
2165 iScrollbar->DrawDeferred(); |
2178 // </cmail> |
|
2179 iRefreshNeeded = EFalse; |
2166 iRefreshNeeded = EFalse; |
2180 } |
2167 } |
2181 } |
2168 } |
2182 |
2169 |
2183 void CFSEmailUiLauncherGridVisualiser::SetRingWrapLimits() |
2170 void CFSEmailUiLauncherGridVisualiser::SetRingWrapLimits() |
2345 |
2332 |
2346 void CFSEmailUiLauncherGridVisualiser::UpdateScrollBarRangeL() |
2333 void CFSEmailUiLauncherGridVisualiser::UpdateScrollBarRangeL() |
2347 { |
2334 { |
2348 FUNC_LOG; |
2335 FUNC_LOG; |
2349 |
2336 |
2350 iScrollbarModel.SetScrollSpan(iRowCount); |
2337 TRect mainPaneRect; |
2351 iScrollbarModel.SetWindowSize(iVisibleRows); |
2338 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
|
2339 TAknLayoutRect scrollBarRect; |
|
2340 scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); |
|
2341 |
|
2342 iScrollbarModel.SetScrollSpan(iRowCount * (scrollBarRect.Rect().Height() / iVisibleRows)); |
|
2343 iScrollbarModel.SetWindowSize(scrollBarRect.Rect().Height()); |
2352 iScrollbarModel.SetFocusPosition(iFirstVisibleRow); |
2344 iScrollbarModel.SetFocusPosition(iFirstVisibleRow); |
2353 iScrollbar->SetModelL(&iScrollbarModel); |
2345 iScrollbar->SetModelL(&iScrollbarModel); |
2354 iScrollbar->DrawNow(); |
2346 iScrollbar->DrawNow(); |
2355 } |
2347 } |
2356 |
2348 |
2357 void CFSEmailUiLauncherGridVisualiser::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType) |
2349 void CFSEmailUiLauncherGridVisualiser::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType) |
2358 { |
2350 { |
2359 FUNC_LOG; |
2351 FUNC_LOG; |
2360 const TInt KScrollTransitionTimeMs = KSelectTransitionTimeMs; |
2352 if( iPhysics ) |
|
2353 { |
|
2354 iPhysics->StopPhysics(); |
|
2355 iPhysics->ResetFriction(); |
|
2356 } |
|
2357 |
2361 if (aScrollBar == iScrollbar) |
2358 if (aScrollBar == iScrollbar) |
2362 { |
2359 { |
2363 |
|
2364 switch( aEventType ) |
2360 switch( aEventType ) |
2365 { |
2361 { |
2366 case EEikScrollHome : |
2362 case EEikScrollHome : |
2367 //Jump to beginning |
2363 //Jump to beginning |
2368 break; |
2364 break; |
2369 case EEikScrollEnd : |
2365 case EEikScrollEnd : |
2370 //Jump to end |
2366 //Jump to end |
2371 break; |
2367 break; |
2372 default: |
2368 default: |
2373 iFirstVisibleRow = aScrollBar->ThumbPosition(); |
2369 iScrolled = ETrue; |
2374 TReal offset = iFirstVisibleRow * iRowHeight; |
2370 iAppUi.SetFocusVisibility( EFalse ); |
|
2371 if ( iSelector ) |
|
2372 { |
|
2373 TAlfTimedValue selectorOpacity; |
|
2374 selectorOpacity.SetValueNow( 0 ); |
|
2375 iSelector->SetOpacity( selectorOpacity ); |
|
2376 } |
|
2377 iFirstVisibleRow = iCurrentLevel.iParentPos.iY/iRowHeight; |
|
2378 TReal offset = aScrollBar->ThumbPosition() + 1; |
2375 TAlfTimedPoint alfScrollOffset; |
2379 TAlfTimedPoint alfScrollOffset; |
2376 alfScrollOffset.iY.SetTarget( offset , KScrollTransitionTimeMs ); |
2380 alfScrollOffset.iY.SetTarget( offset , 0); |
2377 iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); |
2381 iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); |
|
2382 iCurrentLevel.iParentPos.iY = offset; |
2378 break; |
2383 break; |
2379 } |
2384 } |
2380 } |
2385 } |
2381 } |
2386 } |
2382 // </cmail> |
2387 |
2383 void CFSEmailUiLauncherGridVisualiser::UpdateLauncherItemListL() |
2388 void CFSEmailUiLauncherGridVisualiser::UpdateLauncherItemListL() |
2384 { |
2389 { |
2385 FUNC_LOG; |
2390 FUNC_LOG; |
2386 |
2391 |
2387 // Read info about all implementations into infoArray |
2392 // Read info about all implementations into infoArray |
2508 |
2513 |
2509 // Bitmap provider for grid ecom plugins icons |
2514 // Bitmap provider for grid ecom plugins icons |
2510 void CFSEmailUiLauncherGridVisualiser::ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) |
2515 void CFSEmailUiLauncherGridVisualiser::ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) |
2511 { |
2516 { |
2512 FUNC_LOG; |
2517 FUNC_LOG; |
2513 // <cmail> Use layout data instead of hard-coded values |
|
2514 TRect mainPaneRect; |
2518 TRect mainPaneRect; |
2515 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2519 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
2516 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2520 TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; |
2517 |
2521 |
2518 TAknLayoutRect scrollBarRect; |
2522 TAknLayoutRect scrollBarRect; |
2523 TAknLayoutRect itemRect; |
2527 TAknLayoutRect itemRect; |
2524 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
2528 itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var, 0, 0)); |
2525 |
2529 |
2526 TAknLayoutRect gridIconRect; |
2530 TAknLayoutRect gridIconRect; |
2527 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
2531 gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); |
2528 // </cmail> |
|
2529 |
2532 |
2530 CAknIcon* launcherItemIcon(0); |
2533 CAknIcon* launcherItemIcon(0); |
2531 for ( TInt i=0; i<iPluginIdIconIdPairs.Count(); i++ ) |
2534 for ( TInt i=0; i<iPluginIdIconIdPairs.Count(); i++ ) |
2532 { |
2535 { |
2533 if ( aId == iPluginIdIconIdPairs[i].iIconId ) |
2536 if ( aId == iPluginIdIconIdPairs[i].iIconId ) |
2536 } |
2539 } |
2537 } |
2540 } |
2538 |
2541 |
2539 if ( launcherItemIcon ) |
2542 if ( launcherItemIcon ) |
2540 { |
2543 { |
2541 // <cmail> Use layout data instead of hard-coded values |
|
2542 // Set bitmap size |
2544 // Set bitmap size |
2543 //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); |
|
2544 |
|
2545 TSize iconSize = gridIconRect.Rect().Size(); |
2545 TSize iconSize = gridIconRect.Rect().Size(); |
2546 // </cmail> |
|
2547 if( launcherItemIcon->Bitmap() ) |
2546 if( launcherItemIcon->Bitmap() ) |
2548 { |
2547 { |
2549 AknIconUtils::DisableCompression( launcherItemIcon->Bitmap() ); |
2548 AknIconUtils::DisableCompression( launcherItemIcon->Bitmap() ); |
2550 AknIconUtils::SetSize( launcherItemIcon->Bitmap(), iconSize, EAspectRatioPreserved ); |
2549 AknIconUtils::SetSize( launcherItemIcon->Bitmap(), iconSize, EAspectRatioPreserved ); |
2551 } |
2550 } |
2678 CFsEmailUiViewBase::FocusVisibilityChange( aVisible ); |
2677 CFsEmailUiViewBase::FocusVisibilityChange( aVisible ); |
2679 UpdateFocusVisibility(); |
2678 UpdateFocusVisibility(); |
2680 ResizeItemIcon( !aVisible ); |
2679 ResizeItemIcon( !aVisible ); |
2681 } |
2680 } |
2682 |
2681 |
|
2682 // ----------------------------------------------------------------------------- |
|
2683 // CFSEmailUiLauncherGridVisualiser::ViewPositionChanged |
|
2684 // From MAknPhysicsObserver |
|
2685 // ----------------------------------------------------------------------------- |
|
2686 // |
|
2687 void CFSEmailUiLauncherGridVisualiser::ViewPositionChanged( |
|
2688 const TPoint& aNewPosition, |
|
2689 TBool /*aDrawNow*/, |
|
2690 TUint /*aFlags*/ ) |
|
2691 { |
|
2692 FUNC_LOG; |
|
2693 |
|
2694 // controls must be created first |
|
2695 if ( !iConstructionCompleted ) |
|
2696 { |
|
2697 return; |
|
2698 } |
|
2699 |
|
2700 TRect mainPaneRect; |
|
2701 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
|
2702 iCurrentLevel.iParentPos.iY = aNewPosition.iY - mainPaneRect.Height()/2; |
|
2703 TAlfTimedPoint alfScrollOffset; |
|
2704 alfScrollOffset.iY.SetTarget( iCurrentLevel.iParentPos.iY , 0 ); |
|
2705 iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); |
|
2706 iScrollbarModel.SetFocusPosition( iCurrentLevel.iParentPos.iY ); |
|
2707 TRAP_IGNORE( iScrollbar->SetModelL(&iScrollbarModel) ); |
|
2708 iScrollbar->DrawNow(); |
|
2709 iFirstVisibleRow = iCurrentLevel.iParentPos.iY/iRowHeight; |
|
2710 if ( iFirstVisibleRow < 0 ) |
|
2711 { |
|
2712 iFirstVisibleRow = 0; |
|
2713 } |
|
2714 else if ( iFirstVisibleRow > iRowCount ) |
|
2715 { |
|
2716 iFirstVisibleRow = iRowCount; |
|
2717 } |
|
2718 } |
|
2719 |
|
2720 // ----------------------------------------------------------------------------- |
|
2721 // CNcsComposeViewContainer::PhysicEmulationEnded |
|
2722 // From MAknPhysicsObserver |
|
2723 // ----------------------------------------------------------------------------- |
|
2724 // |
|
2725 void CFSEmailUiLauncherGridVisualiser::PhysicEmulationEnded() |
|
2726 { |
|
2727 FUNC_LOG; |
|
2728 } |
|
2729 |
|
2730 // ----------------------------------------------------------------------------- |
|
2731 // CNcsComposeViewContainer::ViewPosition |
|
2732 // From MAknPhysicsObserver |
|
2733 // ----------------------------------------------------------------------------- |
|
2734 // |
|
2735 TPoint CFSEmailUiLauncherGridVisualiser::ViewPosition() const |
|
2736 { |
|
2737 FUNC_LOG; |
|
2738 TRect mainPaneRect; |
|
2739 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
|
2740 TInt current = iCurrentLevel.iParentPos.iY; |
|
2741 TInt viewCentre = mainPaneRect.Size().iHeight / 2; |
|
2742 TPoint point( 0, current + viewCentre ); |
|
2743 return point; |
|
2744 } |
2683 |
2745 |
2684 // ---------------------------------------------------------------------------- |
2746 // ---------------------------------------------------------------------------- |
2685 // LaunchStylusPopupMenuL() |
2747 // LaunchStylusPopupMenuL() |
2686 // Launches and displays the pop-up menu invoked by a long tap event. |
2748 // Launches and displays the pop-up menu invoked by a long tap event. |
2687 // ---------------------------------------------------------------------------- |
2749 // ---------------------------------------------------------------------------- |