87 #include "FreestyleEmailUiLauncherGridVisualiser.h" |
87 #include "FreestyleEmailUiLauncherGridVisualiser.h" |
88 #include "FreestyleEmailUiHtmlViewerView.h" |
88 #include "FreestyleEmailUiHtmlViewerView.h" |
89 #include "FSDelayedLoader.h" |
89 #include "FSDelayedLoader.h" |
90 #include "FSEmail.pan" |
90 #include "FSEmail.pan" |
91 #include "fsemailstatuspaneindicatorhandler.h" |
91 #include "fsemailstatuspaneindicatorhandler.h" |
|
92 #include "ipsplgcommon.h" |
92 |
93 |
93 // CONST VALUES |
94 // CONST VALUES |
94 const TInt KControlBarTransitionTime = 250; |
95 const TInt KControlBarTransitionTime = 250; |
95 const TInt KMaxPreviewPaneLength = 60; |
96 const TInt KMaxPreviewPaneLength = 60; |
96 const TInt KMsgUpdaterTimerDelay = 2500000; // Time to update list, 2,5sec |
97 const TInt KMsgUpdaterTimerDelay = 2500000; // Time to update list, 2,5sec |
1633 { |
1634 { |
1634 TInt res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT; |
1635 TInt res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT; |
1635 if( Layout_Meta_Data::IsLandscapeOrientation() ) |
1636 if( Layout_Meta_Data::IsLandscapeOrientation() ) |
1636 { |
1637 { |
1637 // landscape must use different layout |
1638 // landscape must use different layout |
1638 res = R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT; |
1639 res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT; |
1639 } |
1640 } |
1640 |
1641 |
1641 if ( StatusPane()->CurrentLayoutResId() != res ) |
1642 if ( StatusPane()->CurrentLayoutResId() != res ) |
1642 { |
1643 { |
1643 TRAP_IGNORE( |
1644 TRAP_IGNORE( |
1724 if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE ) |
1725 if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE ) |
1725 { |
1726 { |
1726 // Sync/cancel sync |
1727 // Sync/cancel sync |
1727 CFSMailBox* activeMailbox = iAppUi.GetActiveMailbox(); |
1728 CFSMailBox* activeMailbox = iAppUi.GetActiveMailbox(); |
1728 TBool supportsSync = activeMailbox->HasCapability( EFSMBoxCapaSupportsSync ); |
1729 TBool supportsSync = activeMailbox->HasCapability( EFSMBoxCapaSupportsSync ); |
|
1730 TFSMailBoxStatus onlineStatus = activeMailbox->GetMailBoxStatus(); |
|
1731 if ( onlineStatus == EFSMailBoxOnline && |
|
1732 KIpsPlgImap4PluginUid == activeMailbox->GetId().PluginId() ) |
|
1733 { |
|
1734 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
|
1735 } |
1729 |
1736 |
1730 // flag to hide or show SyncButton |
1737 // flag to hide or show SyncButton |
1731 TBool hideSync = GetLatestSyncState(); |
1738 TBool hideSync = GetLatestSyncState(); |
1732 if(activeMailbox->CurrentSyncState()==StartingSync) hideSync=EFalse; |
1739 if(activeMailbox->CurrentSyncState()==StartingSync) hideSync=EFalse; |
1733 |
1740 |
1734 // hide or show options: Sync/cancel sync |
1741 // hide or show options: Sync/cancel sync |
1735 if ( !supportsSync ) |
1742 if ( !supportsSync ) |
1736 { |
1743 { |
1737 // POP3 behaviour |
1744 // POP3 behaviour |
1738 TFSMailBoxStatus onlineStatus = activeMailbox->GetMailBoxStatus(); |
|
1739 if( onlineStatus == EFSMailBoxOnline || iMailListModelUpdater->IsUpdating() ) |
1745 if( onlineStatus == EFSMailBoxOnline || iMailListModelUpdater->IsUpdating() ) |
1740 { |
1746 { |
1741 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, EFalse ); |
1747 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, EFalse ); |
1742 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
1748 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
1743 } |
1749 } |
3155 TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( iMailFolder->GetMailBoxId().Id())); |
3161 TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( iMailFolder->GetMailBoxId().Id())); |
3156 //Update mailbox widget index status in homescreen |
3162 //Update mailbox widget index status in homescreen |
3157 TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() ); |
3163 TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() ); |
3158 } |
3164 } |
3159 |
3165 |
3160 if ( iFirstStartCompleted ) // Safety |
3166 if ( aForeground && iFirstStartCompleted ) // Safety |
3161 { |
3167 { |
3162 // Update mail list settings and date formats, is done every time |
3168 // Update mail list settings and date formats, is done every time |
3163 // the user might have changed these in settings, so the list needs to refresh |
3169 // the user might have changed these in settings, so the list needs to refresh |
3164 // Store previous modes |
3170 // Store previous modes |
3165 TInt prevListMode = iListMode; |
3171 TInt prevListMode = iListMode; |
3791 case EFsEmailUiCmdActionsMoveMessage: |
3797 case EFsEmailUiCmdActionsMoveMessage: |
3792 { |
3798 { |
3793 TFSMailMsgId folderID; |
3799 TFSMailMsgId folderID; |
3794 folderID.SetNullId(); // Selection is popped up with NULL |
3800 folderID.SetNullId(); // Selection is popped up with NULL |
3795 MoveMsgsToFolderL( folderID ); |
3801 MoveMsgsToFolderL( folderID ); |
3796 |
|
3797 TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync ); |
|
3798 if ( supportsSync ) |
|
3799 { |
|
3800 //If synchronizing is ongoing and a new sync is started we ignore it |
|
3801 if(!GetLatestSyncState()) |
|
3802 { |
|
3803 iAppUi.SyncActiveMailBoxL(); |
|
3804 |
|
3805 // Sync the mailbox |
|
3806 ManualMailBoxSync(ETrue); |
|
3807 |
|
3808 iAppUi.ManualMailBoxSync( ETrue ); |
|
3809 } |
|
3810 } |
|
3811 } |
3802 } |
3812 break; |
3803 break; |
3813 case EFsEmailUiCmdActionsMoveToDrafts: |
3804 case EFsEmailUiCmdActionsMoveToDrafts: |
3814 { |
3805 { |
3815 MoveMessagesToDraftsL(); |
3806 MoveMessagesToDraftsL(); |
3988 { |
3979 { |
3989 // Activate folder selection view and handle moving after callback gets destination |
3980 // Activate folder selection view and handle moving after callback gets destination |
3990 iMoveToFolderOngoing = ETrue; |
3981 iMoveToFolderOngoing = ETrue; |
3991 TFolderListActivationData folderListData; |
3982 TFolderListActivationData folderListData; |
3992 folderListData.iCallback = this; |
3983 folderListData.iCallback = this; |
3993 folderListData.iSourceFolderType = iMailFolder->GetFolderType(); |
3984 if(iMailFolder) // Coverity error fix , assuming that inbox is best bet for safe data. |
|
3985 { |
|
3986 folderListData.iSourceFolderType = iMailFolder->GetFolderType(); |
|
3987 } |
|
3988 else |
|
3989 { |
|
3990 folderListData.iSourceFolderType = EFSInbox; |
|
3991 } |
3994 const TPckgBuf<TFolderListActivationData> pkgOut( folderListData ); |
3992 const TPckgBuf<TFolderListActivationData> pkgOut( folderListData ); |
3995 if ( targetEntries.Count() == 1 ) |
3993 if ( targetEntries.Count() == 1 ) |
3996 { |
3994 { |
3997 iAppUi.EnterFsEmailViewL( FolderListId, KFolderListMoveMessage, pkgOut ); |
3995 iAppUi.EnterFsEmailViewL( FolderListId, KFolderListMoveMessage, pkgOut ); |
3998 } |
3996 } |
4227 // --------------------------------------------------------------------------- |
4225 // --------------------------------------------------------------------------- |
4228 // |
4226 // |
4229 void CFSEmailUiMailListVisualiser::SetMskL() |
4227 void CFSEmailUiMailListVisualiser::SetMskL() |
4230 { |
4228 { |
4231 FUNC_LOG; |
4229 FUNC_LOG; |
|
4230 // If there is no keyboard present, than Msk buttom must not be shown |
|
4231 if ( iAppUi.ShortcutBinding().KeyBoardType() == |
|
4232 CFSEmailUiShortcutBinding::ENoKeyboard ) |
|
4233 { |
|
4234 return; |
|
4235 } |
4232 // Get the mail list count |
4236 // Get the mail list count |
4233 TInt listCount(0); |
4237 TInt listCount(0); |
4234 if ( iMailList ) |
4238 if ( iMailList ) |
4235 { |
4239 { |
4236 listCount = iMailList->Count(); |
4240 listCount = iMailList->Count(); |
4237 } |
4241 } |
4238 |
4242 |
4239 if ( iFocusedControl == EControlBarComponent ) |
4243 if ( iFocusedControl == EControlBarComponent ) |
4240 { |
4244 { |
4241 ChangeMskCommandL( R_FSE_QTN_MSK_CHANGE ); |
4245 ChangeMskCommandL( R_FSE_QTN_MSK_CHANGE ); // change - switch focus on |
4242 } |
4246 } |
4243 else if ( iFocusedControl == EMailListComponent ) |
4247 else if ( iFocusedControl == EMailListComponent ) |
4244 { |
4248 { |
4245 if ( listCount ) // Safety check |
4249 if ( listCount ) // Safety check |
4246 { |
4250 { |
4250 if ( iShiftDepressed ) |
4254 if ( iShiftDepressed ) |
4251 { |
4255 { |
4252 // Nodes may not be marked |
4256 // Nodes may not be marked |
4253 if ( iMailList->IsNode( iMailList->FocusedItem() ) ) |
4257 if ( iMailList->IsNode( iMailList->FocusedItem() ) ) |
4254 { |
4258 { |
4255 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
4259 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); // nothing |
4256 } |
4260 } |
4257 else |
4261 else |
4258 { |
4262 { |
4259 if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) |
4263 if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) |
4260 { |
4264 { |
4261 ChangeMskCommandL( R_FSE_QTN_MSK_UNMARK ); |
4265 ChangeMskCommandL( R_FSE_QTN_MSK_UNMARK ); // unmark item |
4262 } |
4266 } |
4263 else |
4267 else |
4264 { |
4268 { |
4265 ChangeMskCommandL( R_FSE_QTN_MSK_MARK ); |
4269 ChangeMskCommandL( R_FSE_QTN_MSK_MARK ); // mark item |
4266 } |
4270 } |
4267 } |
4271 } |
4268 } |
4272 } |
4269 else |
4273 else |
4270 { |
4274 { |
4274 CFSMailMessage* messagePtr = &item->MessagePtr(); |
4278 CFSMailMessage* messagePtr = &item->MessagePtr(); |
4275 if ( messagePtr ) |
4279 if ( messagePtr ) |
4276 { |
4280 { |
4277 if ( iMailFolder && iMailFolder->GetFolderType() == EFSOutbox ) |
4281 if ( iMailFolder && iMailFolder->GetFolderType() == EFSOutbox ) |
4278 { |
4282 { |
4279 ChangeMskCommandL( R_FSE_QTN_MSK_OPEN_BLOCKED ); |
4283 ChangeMskCommandL( R_FSE_QTN_MSK_OPEN_BLOCKED ); // blocked email opening |
4280 } |
4284 } |
4281 else |
4285 else |
4282 { |
4286 { |
4283 ChangeMskCommandL( R_FSE_QTN_MSK_OPEN ); |
4287 ChangeMskCommandL( R_FSE_QTN_MSK_OPEN ); // open email |
4284 } |
4288 } |
4285 } |
4289 } |
4286 } |
4290 } |
4287 |
4291 |
4288 // SEPARAOR ITEM; COLLAPSE / EXPAND NODE |
4292 // SEPARAOR ITEM; COLLAPSE / EXPAND NODE |
5510 // Send flags, local and server |
5514 // Send flags, local and server |
5511 msgPtr.ResetFlag( EFSMsgFlag_Read ); |
5515 msgPtr.ResetFlag( EFSMsgFlag_Read ); |
5512 } |
5516 } |
5513 msgPtr.SaveMessageL(); // Save flag |
5517 msgPtr.SaveMessageL(); // Save flag |
5514 |
5518 |
5515 if ( !iMailOpened ) |
5519 // Switch icon to correct one if mail list is visible |
5516 { |
5520 // UpdateMsgIconAndBoldingL( aIndex ); |
5517 // Switch icon to correct one if mail list is visible |
|
5518 UpdateMsgIconAndBoldingL( aIndex ); |
|
5519 } |
|
5520 |
5521 |
5521 if ( iCurrentSortCriteria.iField == EFSMailSortByUnread ) |
5522 if ( iCurrentSortCriteria.iField == EFSMailSortByUnread ) |
5522 { |
5523 { |
5523 // Attribute affecting the current sorting order has been changed. |
5524 // Attribute affecting the current sorting order has been changed. |
5524 // Thus, the list order may now be incorrect. |
5525 // Thus, the list order may now be incorrect. |
7022 if ( iThisViewActive ) |
7023 if ( iThisViewActive ) |
7023 { |
7024 { |
7024 SetMailboxNameToStatusPaneL(); |
7025 SetMailboxNameToStatusPaneL(); |
7025 } |
7026 } |
7026 } |
7027 } |
7027 else if ( aEvent == TFSEventMailDeleted && iMailFolder ) // <cmail> Added iMailFolder null safety check </cmail> |
7028 else if ( (aEvent == TFSEventMailDeleted || aEvent == TFSEventMailDeletedFromViewer) && iMailFolder ) // <cmail> Added iMailFolder null safety check </cmail> |
7028 { |
7029 { |
7029 // Change mail item icon or read status |
7030 // Change mail item icon or read status |
7030 RArray<TFSMailMsgId>* removedEntries = static_cast<RArray<TFSMailMsgId>*>(aParam1); |
7031 RArray<TFSMailMsgId>* removedEntries = static_cast<RArray<TFSMailMsgId>*>(aParam1); |
7031 if ( removedEntries && removedEntries->Count() ) |
7032 if ( removedEntries && removedEntries->Count() ) |
7032 { |
7033 { |
7109 // event is not related to the current folder => do nothing |
7110 // event is not related to the current folder => do nothing |
7110 } |
7111 } |
7111 } |
7112 } |
7112 else if ( aEvent == TFSEventMailChanged && iMailFolder ) // Added iMailFolder null safety check |
7113 else if ( aEvent == TFSEventMailChanged && iMailFolder ) // Added iMailFolder null safety check |
7113 { |
7114 { |
7114 if ( !iMailOpened ) // do not handle mail changed while viewer/editor is open. This may cause flickering |
7115 //if ( !iMailOpened ) // do not handle mail changed while viewer/editor is open. This may cause flickering |
7115 { |
7116 { |
7116 // Change mail item icon or read status |
7117 // Change mail item icon or read status |
7117 RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>( aParam1 ); |
7118 RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>( aParam1 ); |
7118 TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 ); |
7119 TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 ); |
7119 TFSMailMsgId currentFolderId = iMailFolder->GetFolderId(); |
7120 TFSMailMsgId currentFolderId = iMailFolder->GetFolderId(); |