85 #include "FreestyleEmailUiContactHandler.h" |
85 #include "FreestyleEmailUiContactHandler.h" |
86 #include "FreestyleEmailUiLauncherGridVisualiser.h" |
86 #include "FreestyleEmailUiLauncherGridVisualiser.h" |
87 #include "FreestyleEmailUiHtmlViewerView.h" |
87 #include "FreestyleEmailUiHtmlViewerView.h" |
88 #include "FSDelayedLoader.h" |
88 #include "FSDelayedLoader.h" |
89 #include "FSEmail.pan" |
89 #include "FSEmail.pan" |
90 #include "fsemailstatuspaneindicatorhandler.h" |
90 |
91 #include "ipsplgcommon.h" |
91 #include "ipsplgcommon.h" |
92 |
92 |
93 // CONST VALUES |
93 // CONST VALUES |
94 const TInt KControlBarTransitionTime = 250; |
94 const TInt KControlBarTransitionTime = 250; |
95 const TInt KMaxPreviewPaneLength = 60; |
95 const TInt KMaxPreviewPaneLength = 60; |
1590 SetMskL(); |
1590 SetMskL(); |
1591 } |
1591 } |
1592 |
1592 |
1593 iCurrentClientRect = clientRect; |
1593 iCurrentClientRect = clientRect; |
1594 iThisViewActive = ETrue; |
1594 iThisViewActive = ETrue; |
1595 //emailindicator handling, we dont care if something goes wrong in the mailindicator update. User can still open the mailbox |
1595 |
1596 TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( activationData.iMailBoxId.Id())); |
1596 //emailindicator handling, is removed from 9.2 |
|
1597 //TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( activationData.iMailBoxId.Id())); |
1597 |
1598 |
1598 //Update mailbox widget index status in homescreen |
1599 //Update mailbox widget index status in homescreen |
1599 TFsEmailUiUtility::ToggleEmailIconL(EFalse, activationData.iMailBoxId ); |
1600 TFsEmailUiUtility::ToggleEmailIconL(EFalse, activationData.iMailBoxId ); |
1600 |
1601 |
1601 iShiftDepressed = EFalse; // clear state just in case |
1602 iShiftDepressed = EFalse; // clear state just in case |
3488 void CFSEmailUiMailListVisualiser::HandleForegroundEventL( TBool aForeground ) |
3489 void CFSEmailUiMailListVisualiser::HandleForegroundEventL( TBool aForeground ) |
3489 { |
3490 { |
3490 FUNC_LOG; |
3491 FUNC_LOG; |
3491 if( iMailFolder ) |
3492 if( iMailFolder ) |
3492 { |
3493 { |
3493 //emailindicator handling, we dont care if something goes wrong in the mailindicator update. User can still open the mailbox |
3494 //emailindicator handling, is removed from 9.2 |
3494 TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( iMailFolder->GetMailBoxId().Id())); |
3495 //TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( iMailFolder->GetMailBoxId().Id())); |
3495 //Update mailbox widget index status in homescreen |
3496 //Update mailbox widget index status in homescreen |
3496 TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() ); |
3497 TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() ); |
3497 } |
3498 } |
3498 |
3499 |
3499 if ( aForeground && iFirstStartCompleted ) // Safety |
3500 if ( aForeground && iFirstStartCompleted ) // Safety |
5929 msgPtr.ResetFlag( EFSMsgFlag_Read ); |
5930 msgPtr.ResetFlag( EFSMsgFlag_Read ); |
5930 } |
5931 } |
5931 msgPtr.SaveMessageL(); // Save flag |
5932 msgPtr.SaveMessageL(); // Save flag |
5932 |
5933 |
5933 // Switch icon to correct one if mail list is visible |
5934 // Switch icon to correct one if mail list is visible |
5934 UpdateMsgIconAndBoldingL( aIndex ); |
5935 TBool needRefresh = ( iAppUi.CurrentActiveView()->Id() == MailListId ); |
|
5936 UpdateMsgIconAndBoldingL( aIndex, needRefresh); |
5935 |
5937 |
5936 if ( iCurrentSortCriteria.iField == EFSMailSortByUnread ) |
5938 if ( iCurrentSortCriteria.iField == EFSMailSortByUnread ) |
5937 { |
5939 { |
5938 // Attribute affecting the current sorting order has been changed. |
5940 // Attribute affecting the current sorting order has been changed. |
5939 // Thus, the list order may now be incorrect. |
5941 // Thus, the list order may now be incorrect. |
6254 CFSEmailUiMailListModelItem* item = |
6256 CFSEmailUiMailListModelItem* item = |
6255 static_cast<CFSEmailUiMailListModelItem*>( Model()->Item(currentItemIndex) ); |
6257 static_cast<CFSEmailUiMailListModelItem*>( Model()->Item(currentItemIndex) ); |
6256 if ( item && item->ModelItemType() == ETypeMailItem ) |
6258 if ( item && item->ModelItemType() == ETypeMailItem ) |
6257 { |
6259 { |
6258 CFSMailMessage& messagePtr = item->MessagePtr(); |
6260 CFSMailMessage& messagePtr = item->MessagePtr(); |
6259 |
6261 // Delete message from framework, and perform internal housekeeping |
6260 TInt okToDelete(ETrue); |
6262 TFSMailMsgId msgId = messagePtr.GetMessageId(); |
6261 if ( iAppUi.GetCRHandler()->WarnBeforeDelete() ) |
6263 RArray<TFSMailMsgId> msgIds; |
6262 { |
6264 CleanupClosePushL( msgIds ); |
6263 TInt queryTextId(0); |
6265 msgIds.Append( msgId ); |
6264 if ( messagePtr.IsFlagSet( EFSMsgFlag_CalendarMsg )) |
6266 TFSMailMsgId folderId = FolderId(); |
6265 { |
6267 TFSMailMsgId mailBox = iAppUi.GetActiveMailbox()->GetId(); |
6266 queryTextId = R_FREESTYLE_EMAIL_DELETE_CALEVENT_NOTE; |
6268 iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
6267 } |
6269 RemoveMsgItemsFromListIfFoundL( msgIds ); |
6268 else |
6270 CleanupStack::PopAndDestroy( &msgIds ); |
6269 { |
|
6270 queryTextId = R_FREESTYLE_EMAIL_DELETE_MAIL_NOTE; |
|
6271 } |
|
6272 HBufC* msgSubject = TFsEmailUiUtility::CreateSubjectTextLC( &messagePtr ); |
|
6273 |
|
6274 okToDelete = TFsEmailUiUtility::ShowConfirmationQueryL( queryTextId, *msgSubject ); |
|
6275 |
|
6276 CleanupStack::PopAndDestroy( msgSubject ); |
|
6277 } |
|
6278 |
|
6279 if ( okToDelete ) |
|
6280 { |
|
6281 // Delete message from framework, and perform internal housekeeping |
|
6282 TFSMailMsgId msgId = messagePtr.GetMessageId(); |
|
6283 RArray<TFSMailMsgId> msgIds; |
|
6284 CleanupClosePushL( msgIds ); |
|
6285 msgIds.Append( msgId ); |
|
6286 TFSMailMsgId folderId = FolderId(); |
|
6287 TFSMailMsgId mailBox = iAppUi.GetActiveMailbox()->GetId(); |
|
6288 iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
|
6289 RemoveMsgItemsFromListIfFoundL( msgIds ); |
|
6290 CleanupStack::PopAndDestroy( &msgIds ); |
|
6291 } |
|
6292 else |
|
6293 { |
|
6294 UnmarkAllItemsL(); |
|
6295 } |
|
6296 } |
6271 } |
6297 } |
6272 } |
6298 } |
6273 } |
6299 |
6274 |
6300 // --------------------------------------------------------------------------- |
6275 // --------------------------------------------------------------------------- |