22 #include <AknUtils.h> |
22 #include <AknUtils.h> |
23 #include <gulicon.h> |
23 #include <gulicon.h> |
24 #include <StringLoader.h> |
24 #include <StringLoader.h> |
25 #include <FreestyleEmailUi.rsg> |
25 #include <FreestyleEmailUi.rsg> |
26 #include <featmgr.h> |
26 #include <featmgr.h> |
27 #include "CFSMailClient.h" |
27 #include "cfsmailclient.h" |
28 #include "CFSMailBox.h" |
28 #include "cfsmailbox.h" |
29 #include "CFSMailFolder.h" |
29 #include "cfsmailfolder.h" |
30 #include "fscontrolbar.h" |
30 #include "fscontrolbar.h" |
31 #include "fscontrolbuttoninterface.h" |
31 #include "fscontrolbuttoninterface.h" |
32 #include "fstreelist.h" |
32 #include "fstreelist.h" |
33 #include "fstreevisualizerbase.h" |
33 #include "fstreevisualizerbase.h" |
34 #include "fstreeplainonelinenodedata.h" |
34 #include "fstreeplainonelinenodedata.h" |
35 #include "fstreeplainonelinenodevisualizer.h" |
35 #include "fstreeplainonelinenodevisualizer.h" |
36 #include "fstreeplaintwolineitemdata.h" |
36 #include "fstreeplaintwolineitemdata.h" |
37 #include "fstreeplaintwolineitemvisualizer.h" |
37 #include "fstreeplaintwolineitemvisualizer.h" |
38 #include "CFSMailCommon.h" |
38 #include "cfsmailcommon.h" |
39 #include "ceuiemaillisttouchmanager.h" |
39 #include "ceuiemaillisttouchmanager.h" |
40 #include "FSEmailBuildFlags.h" |
40 #include "FSEmailBuildFlags.h" |
41 #include "cfsccontactactionmenu.h" |
41 #include "cfsccontactactionmenu.h" |
42 #include "mfsccontactactionmenumodel.h" |
42 #include "mfsccontactactionmenumodel.h" |
43 |
43 |
50 #include <alf/alfstatic.h> |
50 #include <alf/alfstatic.h> |
51 |
51 |
52 #include <aknnotewrappers.h> |
52 #include <aknnotewrappers.h> |
53 #include <msvapi.h> |
53 #include <msvapi.h> |
54 #include <akntitle.h> |
54 #include <akntitle.h> |
55 #include "ESMailSettingsPluginUids.hrh" |
55 #include "esmailsettingspluginuids.hrh" |
56 #include "ESMailSettingsPlugin.h" |
56 #include "esmailsettingsplugin.h" |
57 #include "MFSMailBrandManager.h" |
57 #include "mfsmailbrandmanager.h" |
58 #include <AknWaitDialog.h> |
58 #include <AknWaitDialog.h> |
59 #include <aknlayoutscalable_apps.cdl.h> |
59 #include <aknlayoutscalable_apps.cdl.h> |
60 #include <layoutmetadata.cdl.h> |
60 #include <layoutmetadata.cdl.h> |
61 #include <csxhelp/cmail.hlp.hrh> |
61 #include <csxhelp/cmail.hlp.hrh> |
62 // Meeting request |
62 // Meeting request |
76 #include "FreestyleEmailUi.hrh" |
76 #include "FreestyleEmailUi.hrh" |
77 #include "FreestyleEmailUiTextureManager.h" |
77 #include "FreestyleEmailUiTextureManager.h" |
78 #include "FreestyleEmailUiMailListControl.h" |
78 #include "FreestyleEmailUiMailListControl.h" |
79 #include "FreestyleEmailUiMailViewerVisualiser.h" |
79 #include "FreestyleEmailUiMailViewerVisualiser.h" |
80 #include "FreestyleEmailUiStatusIndicator.h" |
80 #include "FreestyleEmailUiStatusIndicator.h" |
81 #include "FreestyleEmailCenRepHandler.h" |
81 #include "freestyleemailcenrephandler.h" |
82 #include "FreestyleEmailUiFolderListVisualiser.h" |
82 #include "FreestyleEmailUiFolderListVisualiser.h" |
83 #include "FreestyleEmailUiShortcutBinding.h" |
83 #include "FreestyleEmailUiShortcutBinding.h" |
84 #include "FreestyleEmailUiMsgDetailsVisualiser.h" |
84 #include "FreestyleEmailUiMsgDetailsVisualiser.h" |
85 #include "FreestyleEmailDownloadInformationMediator.h" |
85 #include "FreestyleEmailDownloadInformationMediator.h" |
86 #include "FreestyleEmailUiContactHandler.h" |
86 #include "FreestyleEmailUiContactHandler.h" |
468 CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aMailListControlGroup ) |
468 CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aMailListControlGroup ) |
469 : CFsEmailUiViewBase( aMailListControlGroup, *aAppUi ), |
469 : CFsEmailUiViewBase( aMailListControlGroup, *aAppUi ), |
470 iEnv( aEnv ), |
470 iEnv( aEnv ), |
471 iListMarkItemsState( ETrue ), //Initlly list has no markings |
471 iListMarkItemsState( ETrue ), //Initlly list has no markings |
472 iMoveToFolderOngoing( EFalse ), |
472 iMoveToFolderOngoing( EFalse ), |
473 iConsumeStdKeyYes_KeyUp( EFalse ) // use to prevent Call application execution if call for contact processed |
473 iConsumeStdKeyYes_KeyUp( EFalse ), // use to prevent Call application execution if call for contact processed |
|
474 iMailOpened(EFalse) |
474 { |
475 { |
475 FUNC_LOG; |
476 FUNC_LOG; |
476 } |
477 } |
477 |
478 |
478 // --------------------------------------------------------------------------- |
479 // --------------------------------------------------------------------------- |
1091 // Insert the model item |
1095 // Insert the model item |
1092 iModel->InsertL( newItem, idx ); |
1096 iModel->InsertL( newItem, idx ); |
1093 CleanupStack::Pop( newItem ); |
1097 CleanupStack::Pop( newItem ); |
1094 |
1098 |
1095 // Insert the tree list item |
1099 // Insert the tree list item |
1096 InsertListItemL( idx, parentId, childIdx, aAllowRefresh ); |
1100 TPoint viewPortCenterPos = iMailTreeListVisualizer->ViewPosition(); |
|
1101 TPoint viewPortTopPos = iMailTreeListVisualizer->ViewPortTopPosition(); |
|
1102 TInt itemPos = iMailTreeListVisualizer->GetItemWorldPosition( idx ); |
|
1103 TBool refresh = viewPortTopPos.iY != 0 && itemPos < viewPortCenterPos.iY; |
|
1104 |
|
1105 if( refresh ) |
|
1106 { |
|
1107 InsertListItemL( idx, parentId, childIdx, EFalse ); |
|
1108 // viewPort update needed |
|
1109 moveViewPortPosition += iAppUi.LayoutHandler()->TwoLineListItemHeight(); // add mail item height |
|
1110 viewPortCenterPos.iY += moveViewPortPosition; |
|
1111 iMailTreeListVisualizer->ViewPositionChanged( viewPortCenterPos, EFalse, 1 ); |
|
1112 } |
|
1113 else |
|
1114 { |
|
1115 InsertListItemL( idx, parentId, childIdx, aAllowRefresh ); |
|
1116 } |
1097 |
1117 |
1098 // Move focus after insertion if necessary |
1118 // Move focus after insertion if necessary |
1099 if ( firstItemWasFocused ) |
1119 if ( firstItemWasFocused ) |
1100 { |
1120 { |
1101 TFsTreeItemId firstItemId = iMailList->Child( KFsTreeRootID, 0 ); |
1121 TFsTreeItemId firstItemId = iMailList->Child( KFsTreeRootID, 0 ); |
1608 currentFolderType = iMailFolder->GetFolderType(); |
1630 currentFolderType = iMailFolder->GetFolderType(); |
1609 } |
1631 } |
1610 |
1632 |
1611 // MAIN MENU *************************************************************************** |
1633 // MAIN MENU *************************************************************************** |
1612 if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE ) |
1634 if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE ) |
1613 { |
1635 { |
|
1636 // Sync/cancel sync |
|
1637 CFSMailBox* activeMailbox = iAppUi.GetActiveMailbox(); |
|
1638 TBool supportsSync = activeMailbox->HasCapability( EFSMBoxCapaSupportsSync ); |
|
1639 |
|
1640 // flag to hide or show SyncButton |
|
1641 TBool hideSync = GetLatestSyncState(); |
|
1642 if(activeMailbox->CurrentSyncState()==StartingSync) hideSync=EFalse; |
|
1643 |
|
1644 // hide or show options: Sync/cancel sync |
|
1645 if ( !supportsSync ) |
|
1646 { |
|
1647 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); |
|
1648 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
|
1649 } |
|
1650 else if ( hideSync || iMailListModelUpdater->IsUpdating() ) |
|
1651 { |
|
1652 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
|
1653 } |
|
1654 else |
|
1655 { |
|
1656 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); |
|
1657 } |
|
1658 |
1614 // Saves a focus visibility. |
1659 // Saves a focus visibility. |
1615 iLastFocus = EFalse; |
1660 iLastFocus = EFalse; |
1616 if( iFocusedControl == EMailListComponent && IsFocusShown() ) |
1661 if( iFocusedControl == EMailListComponent && IsFocusShown() ) |
1617 { |
1662 { |
1618 iLastFocus = ETrue; |
1663 iLastFocus = ETrue; |
2996 // HandleForegroundEventL |
3044 // HandleForegroundEventL |
2997 // Function checks in foregroundevent that whether settings have changed and |
3045 // Function checks in foregroundevent that whether settings have changed and |
2998 // If there is a need to refresh the list. |
3046 // If there is a need to refresh the list. |
2999 // --------------------------------------------------------------------------- |
3047 // --------------------------------------------------------------------------- |
3000 // |
3048 // |
3001 void CFSEmailUiMailListVisualiser::HandleForegroundEventL() |
3049 void CFSEmailUiMailListVisualiser::HandleForegroundEventL( TBool aForeground ) |
3002 { |
3050 { |
3003 FUNC_LOG; |
3051 FUNC_LOG; |
3004 if ( iFirstStartCompleted ) // Safety |
3052 if( iMailFolder ) |
|
3053 { |
|
3054 TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() ); |
|
3055 } |
|
3056 if ( aForeground && iFirstStartCompleted ) // Safety |
3005 { |
3057 { |
3006 // Update mail list settings and date formats, is done every time |
3058 // Update mail list settings and date formats, is done every time |
3007 // the user might have changed these in settings, so the list needs to refresh |
3059 // the user might have changed these in settings, so the list needs to refresh |
3008 // Store previous modes |
3060 // Store previous modes |
3009 TInt prevListMode = iListMode; |
3061 TInt prevListMode = iListMode; |
3209 } |
3264 } |
3210 break; |
3265 break; |
3211 case EEikCmdExit: |
3266 case EEikCmdExit: |
3212 case EAknSoftkeyExit: |
3267 case EAknSoftkeyExit: |
3213 case EFsEmailUiCmdExit: |
3268 case EFsEmailUiCmdExit: |
|
3269 TIMESTAMP( "Exit selected from message list" ); |
3214 iAppUi.Exit(); |
3270 iAppUi.Exit(); |
3215 break; |
3271 break; |
3216 case EFsEmailUiCmdCalActionsReplyAsMail: |
3272 case EFsEmailUiCmdCalActionsReplyAsMail: |
3217 case EFsEmailUiCmdActionsReply: |
3273 case EFsEmailUiCmdActionsReply: |
3218 { |
3274 { |
|
3275 TIMESTAMP( "Reply to selected from message list" ); |
3219 ReplyL( NULL ); // Function will check marked/highlighted msg |
3276 ReplyL( NULL ); // Function will check marked/highlighted msg |
3220 } |
3277 } |
3221 break; |
3278 break; |
3222 case EFsEmailUiCmdActionsReplyAll: |
3279 case EFsEmailUiCmdActionsReplyAll: |
3223 { |
3280 { |
|
3281 TIMESTAMP( "Reply to all selected from message list" ); |
3224 ReplyAllL( NULL ); // Function will check marked/highlighted msg |
3282 ReplyAllL( NULL ); // Function will check marked/highlighted msg |
3225 } |
3283 } |
3226 break; |
3284 break; |
3227 case EFsEmailUiCmdCalActionsForwardAsMail: |
3285 case EFsEmailUiCmdCalActionsForwardAsMail: |
3228 case EFsEmailUiCmdActionsForward: |
3286 case EFsEmailUiCmdActionsForward: |
3229 { |
3287 { |
|
3288 TIMESTAMP( "Forward selected from message list" ); |
3230 ForwardL( NULL ); // Function will check marked/highlighted msg |
3289 ForwardL( NULL ); // Function will check marked/highlighted msg |
3231 } |
3290 } |
3232 break; |
3291 break; |
3233 case EFsEmailUiCmdActionsCallSender: |
3292 case EFsEmailUiCmdActionsCallSender: |
3234 { |
3293 { |
3534 if(!GetLatestSyncState()) |
3596 if(!GetLatestSyncState()) |
3535 { |
3597 { |
3536 iAppUi.SyncActiveMailBoxL(); |
3598 iAppUi.SyncActiveMailBoxL(); |
3537 // Sync was started by the user |
3599 // Sync was started by the user |
3538 ManualMailBoxSync(ETrue); |
3600 ManualMailBoxSync(ETrue); |
3539 iAppUi.ManualMailBoxSync( ETrue ); |
3601 iAppUi.ManualMailBoxSync( ETrue ); |
3540 } |
3602 } |
3541 } |
3603 } |
3542 } |
3604 } |
3543 break; |
3605 break; |
3544 case EFsEmailUiCmdCancelSync: |
3606 case EFsEmailUiCmdCancelSync: |
3545 { |
3607 { |
3546 TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync ); |
3608 TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync ); |
3547 if ( supportsSync ) |
3609 if ( supportsSync ) |
3548 { |
3610 { |
3549 iAppUi.StopActiveMailBoxSyncL(); |
3611 iAppUi.StopActiveMailBoxSyncL(); |
3550 } |
3612 // Sync was started by the user |
|
3613 ManualMailBoxSync(ETrue); |
|
3614 iAppUi.ManualMailBoxSync( ETrue ); |
|
3615 } |
3551 } |
3616 } |
3552 break; |
3617 break; |
3553 case EFsEmailUiCmdGoOffline: |
3618 case EFsEmailUiCmdGoOffline: |
3554 { |
3619 { |
3555 iAppUi.GetActiveMailbox()->GoOfflineL(); |
3620 iAppUi.GetActiveMailbox()->GoOfflineL(); |
6398 CFSMailMessage* confirmedMsgPtr(0); |
6480 CFSMailMessage* confirmedMsgPtr(0); |
6399 confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL(iAppUi.GetActiveMailboxId(), |
6481 confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL(iAppUi.GetActiveMailboxId(), |
6400 iMailFolder->GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope ); |
6482 iMailFolder->GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope ); |
6401 if ( confirmedMsgPtr ) |
6483 if ( confirmedMsgPtr ) |
6402 { |
6484 { |
|
6485 iMailOpened = ETrue; |
|
6486 |
6403 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
6487 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
6404 // Pointer confirmed, store Id and delete not needed anymore |
6488 // Pointer confirmed, store Id and delete not needed anymore |
6405 TFSMailMsgId confirmedId = confirmedMsgPtr->GetMessageId(); |
6489 TFSMailMsgId confirmedId = confirmedMsgPtr->GetMessageId(); |
6406 TBool isCalMessage = confirmedMsgPtr->IsFlagSet( EFSMsgFlag_CalendarMsg ); |
6490 TBool isCalMessage = confirmedMsgPtr->IsFlagSet( EFSMsgFlag_CalendarMsg ); |
6407 TBool isReadMessage = confirmedMsgPtr->IsFlagSet( EFSMsgFlag_Read ); |
6491 TBool isReadMessage = confirmedMsgPtr->IsFlagSet( EFSMsgFlag_Read ); |
6564 // Irrelevant items for focused mail list item get dimmed at runtime |
6648 // Irrelevant items for focused mail list item get dimmed at runtime |
6565 |
6649 |
6566 // Check mail list item's type |
6650 // Check mail list item's type |
6567 CFSEmailUiMailListModelItem* item = |
6651 CFSEmailUiMailListModelItem* item = |
6568 static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() ) ); |
6652 static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() ) ); |
6569 if ( item && item->ModelItemType() == ETypeMailItem ) |
6653 if ( item ) |
6570 { |
6654 { |
6571 // Add mark as read / unread options |
6655 if ( item->ModelItemType() == ETypeMailItem ) |
6572 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !IsMarkAsUnreadAvailableL() ); |
|
6573 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, !IsMarkAsReadAvailableL() ); |
|
6574 |
|
6575 // Check support for object mail iten moving |
|
6576 TBool supportsMoving = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); |
|
6577 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, !supportsMoving ); |
|
6578 |
|
6579 // Hide / show follow up |
|
6580 TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ); |
|
6581 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag ); |
|
6582 |
|
6583 // Hide mark if applicable |
|
6584 if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) |
|
6585 { |
6656 { |
6586 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue ); |
6657 // Add mark as read / unread options |
6587 } |
6658 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !IsMarkAsUnreadAvailableL() ); |
6588 |
6659 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, !IsMarkAsReadAvailableL() ); |
6589 // Hide collapse / expand all |
6660 |
6590 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); |
6661 // Check support for object mail iten moving |
6591 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); |
6662 TBool supportsMoving = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); |
6592 } |
6663 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, !supportsMoving ); |
6593 else if ( item->ModelItemType() == ETypeSeparator ) |
6664 |
6594 { |
6665 // Hide / show follow up |
6595 // Hide mark as read / unread options |
6666 TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ); |
6596 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
6667 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag ); |
6597 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
6668 |
6598 |
6669 // Hide mark if applicable |
6599 // Hide move & follow up |
6670 if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) |
6600 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
6671 { |
6601 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
6672 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue ); |
6602 |
6673 } |
6603 // Hide collapse / expand all when applicable |
6674 |
6604 if ( iNodesInUse == EListControlSeparatorDisabled || !iModel->Count() ) |
6675 // Hide collapse / expand all |
6605 { |
|
6606 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); |
6676 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); |
6607 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); |
6677 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); |
6608 } |
6678 } |
6609 else |
6679 else if ( item->ModelItemType() == ETypeSeparator ) |
6610 { |
6680 { |
6611 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() ); |
6681 // Hide mark as read / unread options |
6612 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() ); |
6682 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
|
6683 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
|
6684 |
|
6685 // Hide move & follow up |
|
6686 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
|
6687 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
|
6688 |
|
6689 // Hide collapse / expand all when applicable |
|
6690 if ( iNodesInUse == EListControlSeparatorDisabled || !iModel->Count() ) |
|
6691 { |
|
6692 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); |
|
6693 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); |
|
6694 } |
|
6695 else |
|
6696 { |
|
6697 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() ); |
|
6698 iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() ); |
|
6699 } |
6613 } |
6700 } |
6614 } |
6701 } |
6615 |
6702 |
6616 // Set the position for the popup |
6703 // Set the position for the popup |
6617 iStylusPopUpMenu->SetPosition( aPoint ); |
6704 iStylusPopUpMenu->SetPosition( aPoint ); |
6849 // event is not related to the current folder => do nothing |
6936 // event is not related to the current folder => do nothing |
6850 } |
6937 } |
6851 } |
6938 } |
6852 else if ( aEvent == TFSEventMailChanged && iMailFolder ) // Added iMailFolder null safety check |
6939 else if ( aEvent == TFSEventMailChanged && iMailFolder ) // Added iMailFolder null safety check |
6853 { |
6940 { |
6854 // Change mail item icon or read status |
6941 if ( !iMailOpened ) // do not handle mail changed while viewer/editor is open. This may cause flickering |
6855 RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>( aParam1 ); |
6942 { |
6856 TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 ); |
6943 // Change mail item icon or read status |
6857 TFSMailMsgId currentFolderId = iMailFolder->GetFolderId(); |
6944 RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>( aParam1 ); |
6858 if ( *parentFolderId == currentFolderId ) |
6945 TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 ); |
6859 { |
6946 TFSMailMsgId currentFolderId = iMailFolder->GetFolderId(); |
6860 // Refresh mailfolder to get correct actual data |
6947 if ( *parentFolderId == currentFolderId ) |
6861 /* |
6948 { |
6862 iMailListModelUpdater->Cancel(); |
6949 // Refresh mailfolder to get correct actual data |
6863 SafeDelete(iMailFolder); |
6950 /* |
6864 iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId ); |
6951 iMailListModelUpdater->Cancel(); |
6865 */ |
6952 SafeDelete(iMailFolder); |
6866 for ( TInt i=0 ; i<entries->Count() ; i++ ) |
6953 iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId ); |
6867 { |
6954 */ |
6868 TFSMailMsgId msgId = (*entries)[i]; |
6955 for ( TInt i=0 ; i<entries->Count() ; i++ ) |
6869 TInt idx = ItemIndexFromMessageId( msgId ); |
6956 { |
6870 if ( idx != KErrNotFound ) |
6957 TFSMailMsgId msgId = (*entries)[i]; |
6871 { |
6958 TInt idx = ItemIndexFromMessageId( msgId ); |
6872 UpdateItemAtIndexL( idx ); |
6959 if ( idx != KErrNotFound ) |
6873 } |
6960 { |
6874 } |
6961 UpdateItemAtIndexL( idx ); |
6875 } |
6962 } |
|
6963 } |
|
6964 } |
|
6965 } |
6876 } |
6966 } |
6877 else if ( aEvent == TFSEventMailboxSyncStateChanged ) |
6967 else if ( aEvent == TFSEventMailboxSyncStateChanged ) |
6878 { |
6968 { |
6879 TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 ); |
6969 TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 ); |
6880 if ( newSyncState != 0 && *newSyncState != 0 ) |
6970 if ( newSyncState != 0 && *newSyncState != 0 ) |
6881 { |
6971 { |
6882 switch ( *newSyncState ) |
6972 switch ( *newSyncState ) |
6883 { |
6973 { |
6884 case StartingSync: |
6974 case StartingSync: |
6885 { |
6975 { |
6886 //If sync was started by user, show the synchronisation indicator |
6976 //If sync was started by user, show the synchronisation indicator |
6887 if ( iManualMailBoxSync ) |
6977 if ( iManualMailBoxSync ) |
6888 { |
6978 { |
6889 ManualMailBoxSync(EFalse); |
6979 ManualMailBoxSync(EFalse); |
6890 } |
6980 } |
6891 } |
6981 } |
6892 break; |
6982 break; |
|
6983 |
|
6984 case SyncCancelled: |
|
6985 { |
|
6986 //If sync was started by user, show the synchronisation indicator |
|
6987 if ( iManualMailBoxSync ) |
|
6988 { |
|
6989 ManualMailBoxSync(EFalse); |
|
6990 } |
|
6991 } |
|
6992 break; |
|
6993 |
6893 } |
6994 } |
6894 } |
6995 } |
6895 } |
6996 } |
6896 } |
6997 } |
6897 } |
6998 } |