250 TEditorLaunchParams params; |
250 TEditorLaunchParams params; |
251 |
251 |
252 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
252 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
253 params.iMsgId = iMessage->GetMessageId(); |
253 params.iMsgId = iMessage->GetMessageId(); |
254 params.iActivatedExternally = EFalse; |
254 params.iActivatedExternally = EFalse; |
255 |
|
256 if ( iContainer ) |
|
257 { |
|
258 HideContainer(); |
|
259 iContainer->ResetContent(); |
|
260 } |
|
261 |
|
262 iAppUi.LaunchEditorL( KEditorCmdReply, params ); |
255 iAppUi.LaunchEditorL( KEditorCmdReply, params ); |
263 } |
256 } |
264 } |
257 } |
265 break; |
258 break; |
266 case EFsEmailUiCmdActionsReplyAll: |
259 case EFsEmailUiCmdActionsReplyAll: |
270 { |
263 { |
271 TEditorLaunchParams params; |
264 TEditorLaunchParams params; |
272 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
265 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
273 params.iMsgId = iMessage->GetMessageId(); |
266 params.iMsgId = iMessage->GetMessageId(); |
274 params.iActivatedExternally = EFalse; |
267 params.iActivatedExternally = EFalse; |
275 |
|
276 if ( iContainer ) |
|
277 { |
|
278 HideContainer(); |
|
279 iContainer->ResetContent(); |
|
280 } |
|
281 |
|
282 iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); |
268 iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); |
283 } |
269 } |
284 } |
270 } |
285 break; |
271 break; |
286 case EFsEmailUiCmdActionsForward: |
272 case EFsEmailUiCmdActionsForward: |
290 { |
276 { |
291 TEditorLaunchParams params; |
277 TEditorLaunchParams params; |
292 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
278 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
293 params.iMsgId = iMessage->GetMessageId(); |
279 params.iMsgId = iMessage->GetMessageId(); |
294 params.iActivatedExternally = EFalse; |
280 params.iActivatedExternally = EFalse; |
295 |
|
296 if ( iContainer ) |
|
297 { |
|
298 HideContainer(); |
|
299 iContainer->ResetContent(); |
|
300 } |
|
301 |
|
302 iForwardingMessage = ETrue; |
281 iForwardingMessage = ETrue; |
303 iAppUi.LaunchEditorL( KEditorCmdForward, params ); |
282 iAppUi.LaunchEditorL( KEditorCmdForward, params ); |
304 } |
283 } |
305 } |
284 } |
306 break; |
285 break; |
336 iAppUi.Exit(); |
315 iAppUi.Exit(); |
337 } |
316 } |
338 break; |
317 break; |
339 case EFsEmailUiCmdOpenAttachmentList: |
318 case EFsEmailUiCmdOpenAttachmentList: |
340 { |
319 { |
341 TAttachmentListActivationData params; |
320 if( iMessage ) |
342 params.iMailBoxId = iMessage->GetMailBoxId(); |
321 { |
343 params.iFolderId = iMessage->GetFolderId(); |
322 TAttachmentListActivationData params; |
344 params.iMessageId = iMessage->GetMessageId(); |
323 params.iMailBoxId = iMessage->GetMailBoxId(); |
345 // use package buffer to pass the params |
324 params.iFolderId = iMessage->GetFolderId(); |
346 TPckgBuf<TAttachmentListActivationData> buf( params ); |
325 params.iMessageId = iMessage->GetMessageId(); |
347 TUid emptyCustomMessageId = { 0 }; |
326 |
348 iAppUi.EnterFsEmailViewL( AttachmentMngrViewId, emptyCustomMessageId, buf ); |
327 // use package buffer to pass the params |
|
328 TPckgBuf<TAttachmentListActivationData> buf( params ); |
|
329 TUid emptyCustomMessageId = { 0 }; |
|
330 iAppUi.EnterFsEmailViewL( AttachmentMngrViewId, emptyCustomMessageId, buf ); |
|
331 } |
349 |
332 |
350 } |
333 } |
351 break; |
334 break; |
352 case EFsEmailUiCmdPreviousMessage: |
335 case EFsEmailUiCmdPreviousMessage: |
353 { |
336 { |
741 } |
725 } |
742 } |
726 } |
743 iNextOrPrevMessageSelected = EFalse; |
727 iNextOrPrevMessageSelected = EFalse; |
744 iForwardingMessage = EFalse; |
728 iForwardingMessage = EFalse; |
745 |
729 |
|
730 //update rect only if it has changed from previous time. |
|
731 if ( iContainer->Rect() != ContainerRect() ) |
|
732 { |
|
733 iContainer->SetRect( ContainerRect() ); |
|
734 } |
|
735 |
746 TIMESTAMP( "Html viewer opened" ); |
736 TIMESTAMP( "Html viewer opened" ); |
747 } |
737 } |
748 |
738 |
749 // ----------------------------------------------------------------------------- |
739 // ----------------------------------------------------------------------------- |
750 // CFsEmailUiHtmlViewerView::OfferToolbarEventL |
740 // CFsEmailUiHtmlViewerView::OfferToolbarEventL |
837 { |
827 { |
838 HideContainer(); |
828 HideContainer(); |
839 iContainer->ResetContent(ETrue); |
829 iContainer->ResetContent(ETrue); |
840 iAppUi.RemoveFromStack(iContainer); |
830 iAppUi.RemoveFromStack(iContainer); |
841 iContainer->CancelFetch(); |
831 iContainer->CancelFetch(); |
842 iContainer->ClearCacheAndLoadEmptyContent(); |
832 if ( !iAppUi.AppUiExitOngoing() ) |
|
833 { |
|
834 // if app ui is exiting, a call to this function causes a KERN-EXEC 3 crash in iBrCtlInterface->ClearCache(); |
|
835 iContainer->ClearCacheAndLoadEmptyContent(); |
|
836 } |
843 } |
837 } |
844 Toolbar()->SetToolbarObserver( this ); |
838 Toolbar()->SetToolbarObserver( this ); |
845 iMessage = NULL; |
839 iMessage = NULL; |
846 } |
840 } |
847 |
841 |
1036 else if ( aResourceId == R_FSEMAILUI_HTMLVIEWER_SUBMENU_ZOOM_LEVEL && |
1031 else if ( aResourceId == R_FSEMAILUI_HTMLVIEWER_SUBMENU_ZOOM_LEVEL && |
1037 iContainer && iContainer->BrowserControlIf() ) |
1032 iContainer && iContainer->BrowserControlIf() ) |
1038 { |
1033 { |
1039 DynInitZoomMenuL( aMenuPane ); |
1034 DynInitZoomMenuL( aMenuPane ); |
1040 } |
1035 } |
1041 else if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_MORE ) |
|
1042 { |
|
1043 if( iActivationData.iEmbeddedMessageMode ) |
|
1044 { |
|
1045 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
|
1046 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
|
1047 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
|
1048 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
|
1049 } |
|
1050 else |
|
1051 { |
|
1052 CFSMailFolder* currentFolder = NULL; |
|
1053 if ( iMessage ) |
|
1054 { |
|
1055 TRAP_IGNORE( currentFolder = |
|
1056 iAppUi.GetMailClient()->GetFolderByUidL( |
|
1057 iMessage->GetMailBoxId(), |
|
1058 iMessage->GetFolderId() ) ); |
|
1059 } |
|
1060 |
|
1061 if ( currentFolder && |
|
1062 currentFolder->GetFolderType() != EFSOutbox ) |
|
1063 { |
|
1064 // Mark as read/unread options |
|
1065 TBool messageIsRead( iMessage->IsFlagSet( EFSMsgFlag_Read ) ); |
|
1066 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); |
|
1067 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); |
|
1068 |
|
1069 // Move to another folder option |
|
1070 aMenuPane->SetItemDimmed( |
|
1071 EFsEmailUiCmdActionsMoveMessage, |
|
1072 !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ) ); |
|
1073 |
|
1074 // Follow-up flag option |
|
1075 aMenuPane->SetItemDimmed( |
|
1076 EFsEmailUiCmdActionsFlag, |
|
1077 !( iMailBox && TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) ) ); |
|
1078 } |
|
1079 else |
|
1080 { |
|
1081 // In case of outbox, all these are dimmed |
|
1082 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
|
1083 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
|
1084 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
|
1085 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
|
1086 } |
|
1087 delete currentFolder; |
|
1088 } |
|
1089 aMenuPane->SetItemDimmed( EFsEmailUiCmdMessageDetails, ETrue ); |
|
1090 } |
|
1091 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
1036 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
1092 CFSEmailUiShortcutBinding::EContextHtmlViewer ); |
1037 CFSEmailUiShortcutBinding::EContextHtmlViewer ); |
1093 } |
1038 } |
1094 |
1039 |
1095 // ----------------------------------------------------------------------------- |
1040 // ----------------------------------------------------------------------------- |
1125 } |
1070 } |
1126 else // ( aCommandId == EFsEmailUiCmdCalActionsDecline ) |
1071 else // ( aCommandId == EFsEmailUiCmdCalActionsDecline ) |
1127 { |
1072 { |
1128 respondStatus = EESMRAttendeeStatusDecline; |
1073 respondStatus = EESMRAttendeeStatusDecline; |
1129 } |
1074 } |
1130 iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( |
1075 if( iMessage ) |
1131 respondStatus, *iMessage, *this ); |
1076 { |
|
1077 iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( |
|
1078 respondStatus, *iMessage, *this ); |
|
1079 } |
1132 } |
1080 } |
1133 } |
1081 } |
1134 |
1082 |
1135 void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() |
1083 void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() |
1136 { |
1084 { |
1322 } |
1270 } |
1323 } |
1271 } |
1324 } |
1272 } |
1325 } |
1273 } |
1326 |
1274 |
1327 if (iContainer && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() && |
1275 if ( iContainer && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() ) |
1328 ( aEvent == TFSEventNewMail || |
1276 { |
1329 aEvent == TFSEventMailDeleted || |
1277 if ( aEvent == TFSEventNewMail || |
1330 aEvent == TFSEventMailChanged ) ) |
1278 aEvent == TFSEventMailDeleted || |
1331 { |
1279 aEvent == TFSEventMailChanged ) |
1332 iContainer->MailListModelUpdatedL(); |
1280 { |
|
1281 iContainer->MailListModelUpdatedL(); |
|
1282 } |
|
1283 |
|
1284 // DSW fix for FAMZ-82YJQ2 |
|
1285 // Dismiss the download status dialog after sync has been finished or cancelled |
|
1286 |
|
1287 if ( aEvent == TFSEventMailboxSyncStateChanged ) |
|
1288 { |
|
1289 TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 ); |
|
1290 if ( newSyncState && ( *newSyncState == FinishedSuccessfully || |
|
1291 *newSyncState == SyncCancelled || |
|
1292 *newSyncState == Idle || |
|
1293 *newSyncState == SyncError )) |
|
1294 { |
|
1295 iContainer->HideDownloadStatus(); |
|
1296 } |
|
1297 } |
1333 } |
1298 } |
1334 } |
1299 } |
1335 |
1300 |
1336 void CFsEmailUiHtmlViewerView::DynInitZoomMenuL( CEikMenuPane* aMenuPane ) |
1301 void CFsEmailUiHtmlViewerView::DynInitZoomMenuL( CEikMenuPane* aMenuPane ) |
1337 { |
1302 { |
2185 // ----------------------------------------------------------------------------- |
2150 // ----------------------------------------------------------------------------- |
2186 TBool CFsEmailUiHtmlViewerView::MessagePartFullyFetchedL( TFetchedType aFetchedContentType ) const |
2151 TBool CFsEmailUiHtmlViewerView::MessagePartFullyFetchedL( TFetchedType aFetchedContentType ) const |
2187 { |
2152 { |
2188 FUNC_LOG; |
2153 FUNC_LOG; |
2189 TBool retVal = ETrue; |
2154 TBool retVal = ETrue; |
2190 if( aFetchedContentType == EMessagePlainTextBodyPart ) |
2155 if( aFetchedContentType == EMessagePlainTextBodyPart && iMessage ) |
2191 { |
2156 { |
2192 CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); |
2157 CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); |
2193 if( textPart ) |
2158 if( textPart ) |
2194 { |
2159 { |
2195 TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); |
2160 TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); |
2517 /*iWaitDialog = new(ELeave)CAknWaitDialog( |
2482 /*iWaitDialog = new(ELeave)CAknWaitDialog( |
2518 (REINTERPRET_CAST(CEikDialog**,&iWaitDialog)), ETrue); |
2483 (REINTERPRET_CAST(CEikDialog**,&iWaitDialog)), ETrue); |
2519 iWaitDialog->SetCallback(this); |
2484 iWaitDialog->SetCallback(this); |
2520 iDialogNotDismissed = ETrue; |
2485 iDialogNotDismissed = ETrue; |
2521 iWaitDialog->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG); |
2486 iWaitDialog->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG); |
2522 */ |
2487 */ |
|
2488 if( iMessage ) |
|
2489 { |
2523 StartFetchingMessagePartL( *iMessage, iStartAsyncFetchType ); |
2490 StartFetchingMessagePartL( *iMessage, iStartAsyncFetchType ); |
|
2491 } |
2524 // iFetchingAlready = ETrue; |
2492 // iFetchingAlready = ETrue; |
2525 //</cmail> |
2493 //</cmail> |
2526 } |
2494 } |
2527 |
2495 |
2528 // --------------------------------------------------------------------------- |
2496 // --------------------------------------------------------------------------- |
3188 * Delaying the fetch for MfE till the user scrolls to the bottom of |
3156 * Delaying the fetch for MfE till the user scrolls to the bottom of |
3189 * the message. |
3157 * the message. |
3190 */ |
3158 */ |
3191 void CFsEmailUiHtmlViewerView::StartFetchingMessageL() |
3159 void CFsEmailUiHtmlViewerView::StartFetchingMessageL() |
3192 { |
3160 { |
3193 CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); |
3161 if( iMessage ) |
3194 TFetchedType type; |
3162 { |
3195 if( htmlBodyPart ) |
3163 CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); |
3196 { |
3164 TFetchedType type; |
3197 type = EMessageHtmlBodyPart; |
3165 if( htmlBodyPart ) |
3198 } |
|
3199 else |
|
3200 { |
|
3201 type = EMessagePlainTextBodyPart; |
|
3202 } |
|
3203 |
|
3204 if ( !MessagePartFullyFetchedL( type )) |
|
3205 { |
|
3206 iAsyncProcessComplete = EFalse; |
|
3207 iStartAsyncFetchType = type; |
|
3208 //check to make sure we don't kick off fetch twice for the cases where bodypart |
|
3209 //not found(OZ) |
|
3210 if(iMessage && !GetAsyncFetchStatus()) |
|
3211 { |
3166 { |
3212 StartFetchingMessagePartL( *iMessage, type ); |
3167 type = EMessageHtmlBodyPart; |
|
3168 } |
|
3169 else |
|
3170 { |
|
3171 type = EMessagePlainTextBodyPart; |
|
3172 } |
|
3173 |
|
3174 |
|
3175 if ( !MessagePartFullyFetchedL( type )) |
|
3176 { |
|
3177 iAsyncProcessComplete = EFalse; |
|
3178 iStartAsyncFetchType = type; |
|
3179 //check to make sure we don't kick off fetch twice for the cases where bodypart |
|
3180 //not found(OZ) |
|
3181 if(iMessage && !GetAsyncFetchStatus()) |
|
3182 { |
|
3183 StartFetchingMessagePartL( *iMessage, type ); |
|
3184 } |
3213 } |
3185 } |
3214 } |
3186 } |
3215 } |
3187 } |
3216 |
3188 |
3217 void CFsEmailUiHtmlViewerView::CheckMessageBodyL( CFSMailMessage& /*aMessage*/, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent) |
3189 void CFsEmailUiHtmlViewerView::CheckMessageBodyL( CFSMailMessage& /*aMessage*/, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent) |
3218 { |
3190 { |
3219 CFSMailMessagePart* bodyPart = iMessage->HtmlBodyPartL(); |
3191 if( iMessage ) |
3220 if ( !bodyPart ) |
3192 { |
3221 { |
3193 CFSMailMessagePart* bodyPart = iMessage->HtmlBodyPartL(); |
3222 bodyPart = iMessage->PlainTextBodyPartL(); |
3194 if ( !bodyPart ) |
3223 } |
3195 { |
3224 |
3196 bodyPart = iMessage->PlainTextBodyPartL(); |
3225 if ( bodyPart ) |
3197 } |
3226 { |
3198 |
3227 aMessageBodyStructurePresent = ETrue; |
3199 if ( bodyPart ) |
3228 CleanupStack::PushL( bodyPart ); |
3200 { |
3229 |
3201 aMessageBodyStructurePresent = ETrue; |
3230 if ( bodyPart->FetchedContentSize() == 0 && bodyPart->ContentSize() != 0 ) |
3202 CleanupStack::PushL( bodyPart ); |
3231 { |
3203 |
|
3204 if ( bodyPart->FetchedContentSize() == 0 && bodyPart->ContentSize() != 0 ) |
|
3205 { |
|
3206 aMessageBodyContentPresent = EFalse; |
|
3207 } |
|
3208 else |
|
3209 { |
|
3210 aMessageBodyContentPresent = ETrue; |
|
3211 } |
|
3212 |
|
3213 CleanupStack::PopAndDestroy( bodyPart ); |
|
3214 } |
|
3215 else |
|
3216 { |
|
3217 aMessageBodyStructurePresent = EFalse; |
3232 aMessageBodyContentPresent = EFalse; |
3218 aMessageBodyContentPresent = EFalse; |
3233 } |
3219 } |
3234 else |
|
3235 { |
|
3236 aMessageBodyContentPresent = ETrue; |
|
3237 } |
|
3238 |
|
3239 CleanupStack::PopAndDestroy( bodyPart ); |
|
3240 } |
|
3241 else |
|
3242 { |
|
3243 aMessageBodyStructurePresent = EFalse; |
|
3244 aMessageBodyContentPresent = EFalse; |
|
3245 } |
3220 } |
3246 } |
3221 } |
3247 |
3222 |
3248 ////////////////////////////////////////////////////////////////////////////////////// |
3223 ////////////////////////////////////////////////////////////////////////////////////// |
3249 // CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE |
3224 // CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE |