24 #include <AknWaitDialog.h> |
24 #include <AknWaitDialog.h> |
25 #include <AknGlobalListQuery.h> |
25 #include <AknGlobalListQuery.h> |
26 #include <AknGlobalNote.h> |
26 #include <AknGlobalNote.h> |
27 #include <aknnavi.h> |
27 #include <aknnavi.h> |
28 #include <aknnavide.h> |
28 #include <aknnavide.h> |
|
29 #include <APGCLI.H> |
|
30 #include <APMSTD.H> |
|
31 #include <FavouritesDb.h> |
29 //<cmail> |
32 //<cmail> |
30 #include <featmgr.h> |
33 #include <featmgr.h> |
31 #include "CFSMailMessage.h" |
34 #include "CFSMailMessage.h" |
32 #include "CFSMailClient.h" |
35 #include "CFSMailClient.h" |
33 #include <FreestyleEmailUi.rsg> |
36 #include <FreestyleEmailUi.rsg> |
34 #include <SchemeHandler.h> // CSchemeHandler |
37 #include <SchemeHandler.h> // CSchemeHandler |
35 #include <brctlinterface.h> |
38 #include <brctlinterface.h> |
36 #include <csxhelp/cmail.hlp.hrh> |
39 #include <csxhelp/cmail.hlp.hrh> |
|
40 #include <baclipb.h> // for clipboard copy |
|
41 |
|
42 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
43 #include <txtclipboard.h> |
|
44 #endif |
|
45 |
37 // Meeting request |
46 // Meeting request |
38 #include <MeetingRequestUids.hrh> |
47 #include <MeetingRequestUids.hrh> |
39 //<cmail> |
48 #include <layoutmetadata.cdl.h> |
40 #include "cesmricalviewer.h" |
49 #include "cesmricalviewer.h" |
41 #include "FreestyleEmailUiHtmlViewerView.h" |
50 #include "FreestyleEmailUiHtmlViewerView.h" |
42 #include "FreestyleEmailUi.hrh" |
51 #include "FreestyleEmailUi.hrh" |
43 #include "FreestyleEmailUiAppui.h" |
52 #include "FreestyleEmailUiAppui.h" |
44 #include "FreestyleEmailUiHtmlViewerContainer.h" |
53 #include "FreestyleEmailUiHtmlViewerContainer.h" |
55 #include "FSDelayedLoader.h" |
64 #include "FSDelayedLoader.h" |
56 #include "FreestyleMessageHeaderURL.h" |
65 #include "FreestyleMessageHeaderURL.h" |
57 #include <akntoolbar.h> |
66 #include <akntoolbar.h> |
58 // CONSTANTS |
67 // CONSTANTS |
59 // Zoom levels available on the UI |
68 // Zoom levels available on the UI |
60 const TInt KZoomLevels[] = { 50, 75, 100, 125 }; |
69 const TInt KZoomLevels[] = { 75, 100, 125, 150 }; |
61 const TInt KZoomLevelCount = sizeof( KZoomLevels ) / sizeof( TInt ); |
70 const TInt KZoomLevelCount = sizeof( KZoomLevels ) / sizeof( TInt ); |
62 |
71 |
63 CFsEmailUiHtmlViewerView* CFsEmailUiHtmlViewerView::NewL( |
72 CFsEmailUiHtmlViewerView* CFsEmailUiHtmlViewerView::NewL( |
64 CAlfEnv& aEnv, |
73 CAlfEnv& aEnv, |
65 CFreestyleEmailUiAppUi& aAppUi, |
74 CFreestyleEmailUiAppUi& aAppUi, |
127 BaseConstructL( R_FSEMAILUI_HTML_VIEW ); |
136 BaseConstructL( R_FSEMAILUI_HTML_VIEW ); |
128 iAsyncCallback = new (ELeave) CAsyncCallBack( CActive::EPriorityLow ); |
137 iAsyncCallback = new (ELeave) CAsyncCallBack( CActive::EPriorityLow ); |
129 iOpenMessages = new (ELeave) CStack<CFSMailMessage, ETrue>(); |
138 iOpenMessages = new (ELeave) CStack<CFSMailMessage, ETrue>(); |
130 iEmbeddedMessages = new (ELeave) CStack<CFSMailMessage, EFalse>(); |
139 iEmbeddedMessages = new (ELeave) CStack<CFSMailMessage, EFalse>(); |
131 iNextOrPrevMessageSelected = EFalse; |
140 iNextOrPrevMessageSelected = EFalse; |
132 iForwardingMessage = EFalse; |
|
133 } |
141 } |
134 |
142 |
135 // ----------------------------------------------------------------------------- |
143 // ----------------------------------------------------------------------------- |
136 // CFsEmailUiHtmlViewerView::Id() |
144 // CFsEmailUiHtmlViewerView::Id() |
137 // Returns View's ID. |
145 // Returns View's ID. |
593 { |
600 { |
594 iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); |
601 iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); |
595 TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId); |
602 TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId); |
596 iAttachmentsListModel->UpdateListL( msgPartData ); |
603 iAttachmentsListModel->UpdateListL( msgPartData ); |
597 |
604 |
598 TRAPD( error, LoadContentFromMailMessageL( iMessage ) ); |
605 TRAPD( error, LoadContentFromMailMessageL( iMessage, ETrue ) ); |
599 if ( error == KErrNotFound || error == KErrInUse || error == KErrLocked ) |
606 if ( error == KErrNotFound || error == KErrInUse || error == KErrLocked ) |
600 { |
607 { |
601 bodypartNotFound = ETrue; |
608 bodypartNotFound = ETrue; |
602 } |
609 } |
603 else if ( error != KErrNone) |
610 else if ( error != KErrNone) |
815 // ----------------------------------------------------------------------------- |
819 // ----------------------------------------------------------------------------- |
816 // |
820 // |
817 void CFsEmailUiHtmlViewerView::ChildDoDeactivate() |
821 void CFsEmailUiHtmlViewerView::ChildDoDeactivate() |
818 { |
822 { |
819 FUNC_LOG; |
823 FUNC_LOG; |
820 // Don't cancel fetching the message parts when forwarding the message: |
824 CancelFetchings(); |
821 // it would also cancel the fetchings initiated by the forwarding, |
825 |
822 // causing the forwarding to abort. |
|
823 if ( !iForwardingMessage ) |
|
824 { |
|
825 CancelFetchings(); |
|
826 } |
|
827 |
|
828 if ( iContainer ) |
826 if ( iContainer ) |
829 { |
827 { |
830 HideContainer(); |
828 HideContainer(); |
831 iContainer->ResetContent(); |
829 iContainer->ResetContent(); |
832 iAppUi.RemoveFromStack(iContainer); |
830 iAppUi.RemoveFromStack(iContainer); |
833 iContainer->CancelFetch(); |
831 iContainer->CancelFetch(); |
834 iContainer->ClearCacheAndLoadEmptyContent(); |
832 iContainer->ClearCacheAndLoadEmptyContent(); |
835 } |
833 } |
836 Toolbar()->SetToolbarObserver( this ); |
834 Toolbar()->SetToolbarObserver( this ); |
837 iMessage = NULL; |
835 iMessage = NULL; |
838 HideNaviPane(); |
|
839 } |
836 } |
840 |
837 |
841 void CFsEmailUiHtmlViewerView::DoExitL() |
838 void CFsEmailUiHtmlViewerView::DoExitL() |
842 { |
839 { |
843 FUNC_LOG; |
840 FUNC_LOG; |
926 { |
946 { |
927 // remove help support in pf5250 |
947 // remove help support in pf5250 |
928 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
948 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
929 } |
949 } |
930 |
950 |
|
951 TBool toolbarExists = EFalse; |
|
952 if( iAppUi.CurrentFixedToolbar() ) |
|
953 { |
|
954 toolbarExists = iAppUi.CurrentFixedToolbar()->IsVisible(); |
|
955 } |
|
956 |
931 // Some commands are blocked when viewing embedded message object |
957 // Some commands are blocked when viewing embedded message object |
932 // or separate HTML file. |
958 // or separate HTML file. |
933 const TBool blockCmds( !iMessage || iActivationData.iEmbeddedMessageMode ); |
959 const TBool blockCmds( !iMessage || iActivationData.iEmbeddedMessageMode || toolbarExists ); |
934 const TBool blockReplyALLCmd( !iMessage || iActivationData.iEmbeddedMessageMode || |
960 const TBool blockReplyALLCmd( toolbarExists || !iMessage || iActivationData.iEmbeddedMessageMode || |
935 TFsEmailUiUtility::CountRecipientsSmart( iAppUi, iMessage ) < 2 ); |
961 TFsEmailUiUtility::CountRecipientsSmart( iAppUi, iMessage ) < 2 ); |
936 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReply, blockCmds ); |
962 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReply, blockCmds ); |
937 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, blockReplyALLCmd ); |
963 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, blockReplyALLCmd ); |
938 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, blockCmds ); |
964 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, blockCmds ); |
939 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsDelete, blockCmds ); |
965 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsDelete, blockCmds ); |
940 |
966 |
|
967 if( iActivationData.iEmbeddedMessageMode ) |
|
968 { |
|
969 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
|
970 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
|
971 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
|
972 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
|
973 } |
|
974 |
941 TBool hideNext = !ShowNextMessageMenuInOptions(); |
975 TBool hideNext = !ShowNextMessageMenuInOptions(); |
942 TBool blockNextCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hideNext; |
976 TBool blockNextCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hideNext; |
943 aMenuPane->SetItemDimmed( EFsEmailUiCmdNextMessage, blockNextCmd ); |
977 TInt menuPos; |
|
978 if( aMenuPane->MenuItemExists( EFsEmailUiCmdNextMessage, menuPos ) ) |
|
979 { |
|
980 aMenuPane->SetItemDimmed( EFsEmailUiCmdNextMessage, blockNextCmd ); |
|
981 } |
944 TBool hidePrev = !ShowPreviousMessageMenuInOptions(); |
982 TBool hidePrev = !ShowPreviousMessageMenuInOptions(); |
945 TBool blockPrevCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hidePrev; |
983 TBool blockPrevCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hidePrev; |
946 aMenuPane->SetItemDimmed( EFsEmailUiCmdPreviousMessage, blockPrevCmd ); |
984 if( aMenuPane->MenuItemExists( EFsEmailUiCmdPreviousMessage, menuPos ) ) |
|
985 { |
|
986 aMenuPane->SetItemDimmed( EFsEmailUiCmdPreviousMessage, blockPrevCmd ); |
|
987 } |
|
988 |
|
989 CFSMailFolder* currentFolder = NULL; |
|
990 if ( iMessage ) |
|
991 { |
|
992 TRAP_IGNORE( currentFolder = |
|
993 iAppUi.GetMailClient()->GetFolderByUidL( |
|
994 iMessage->GetMailBoxId(), |
|
995 iMessage->GetFolderId() ) ); |
|
996 } |
|
997 |
|
998 if ( currentFolder && |
|
999 currentFolder->GetFolderType() != EFSOutbox ) |
|
1000 { |
|
1001 // Mark as read/unread options |
|
1002 TBool messageIsRead( iMessage->IsFlagSet( EFSMsgFlag_Read ) ); |
|
1003 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); |
|
1004 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); |
|
1005 |
|
1006 // Move to another folder option |
|
1007 aMenuPane->SetItemDimmed( |
|
1008 EFsEmailUiCmdActionsMoveMessage, |
|
1009 !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ) ); |
|
1010 |
|
1011 // Follow-up flag option |
|
1012 aMenuPane->SetItemDimmed( |
|
1013 EFsEmailUiCmdActionsFlag, |
|
1014 !( iMailBox && TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) ) ); |
|
1015 } |
|
1016 else |
|
1017 { |
|
1018 // In case of outbox, all these are dimmed |
|
1019 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
|
1020 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
|
1021 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
|
1022 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
|
1023 } |
|
1024 delete currentFolder; |
947 } |
1025 } |
948 else if ( aResourceId == R_FSEMAILUI_HTMLVIEWER_SUBMENU_ZOOM_LEVEL && |
1026 else if ( aResourceId == R_FSEMAILUI_HTMLVIEWER_SUBMENU_ZOOM_LEVEL && |
949 iContainer && iContainer->BrowserControlIf() ) |
1027 iContainer && iContainer->BrowserControlIf() ) |
950 { |
1028 { |
951 DynInitZoomMenuL( aMenuPane ); |
1029 DynInitZoomMenuL( aMenuPane ); |
1042 iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( |
1120 iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( |
1043 respondStatus, *iMessage, *this ); |
1121 respondStatus, *iMessage, *this ); |
1044 } |
1122 } |
1045 } |
1123 } |
1046 |
1124 |
|
1125 void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() |
|
1126 { |
|
1127 CFsEmailUiViewBase::HandleStatusPaneSizeChange(); |
|
1128 |
|
1129 if ( iContainer ) |
|
1130 { |
|
1131 iContainer->SetRect( ContainerRect() ); |
|
1132 } |
|
1133 } |
|
1134 |
|
1135 void CFsEmailUiHtmlViewerView::HandleViewRectChange() |
|
1136 { |
|
1137 CFsEmailUiViewBase::HandleViewRectChange(); |
|
1138 |
|
1139 if ( iContainer ) |
|
1140 { |
|
1141 iContainer->SetRect( ContainerRect() ); |
|
1142 } |
|
1143 } |
1047 |
1144 |
1048 void CFsEmailUiHtmlViewerView::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
1145 void CFsEmailUiHtmlViewerView::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
1049 { |
1146 { |
1050 FUNC_LOG; |
1147 FUNC_LOG; |
1051 |
1148 |
|
1149 if ( aType == EScreenLayoutChanged ) |
|
1150 { |
|
1151 SetStatusBarLayout(); |
|
1152 } |
|
1153 |
1052 if ( iContainer ) |
1154 if ( iContainer ) |
1053 { |
1155 { |
|
1156 iContainer->SetRect( ContainerRect() ); |
1054 iContainer->HandleResourceChange( aType ); |
1157 iContainer->HandleResourceChange( aType ); |
1055 } |
1158 } |
1056 } |
1159 } |
1057 |
1160 |
|
1161 TRect CFsEmailUiHtmlViewerView::ContainerRect() const |
|
1162 { |
|
1163 TRect rect = ClientRect(); |
|
1164 |
|
1165 CAknToolbar* toolbar = iAppUi.CurrentFixedToolbar(); |
|
1166 if( toolbar && toolbar->IsVisible() && Layout_Meta_Data::IsLandscapeOrientation() ) |
|
1167 { |
|
1168 TPoint pos = toolbar->PositionRelativeToScreen(); |
|
1169 |
|
1170 // In some LS status pane layouts the toolbar will be shown on top of the client area |
|
1171 if( pos.iX > 0 ) |
|
1172 { |
|
1173 rect.iBr.iX = pos.iX; |
|
1174 } |
|
1175 } |
|
1176 return rect; |
|
1177 } |
|
1178 |
1058 void CFsEmailUiHtmlViewerView::LoadContentFromFileL( const TDesC& aFileName ) |
1179 void CFsEmailUiHtmlViewerView::LoadContentFromFileL( const TDesC& aFileName ) |
1059 { |
1180 { |
1060 FUNC_LOG; |
1181 FUNC_LOG; |
1061 |
1182 |
1062 if ( iContainer ) |
1183 if ( iContainer ) |
1322 break; |
1448 break; |
1323 case EFsEmailUiCmdActionsRemoteLookup: |
1449 case EFsEmailUiCmdActionsRemoteLookup: |
1324 { |
1450 { |
1325 LaunchRemoteLookupL( aEmailAddress ); |
1451 LaunchRemoteLookupL( aEmailAddress ); |
1326 } |
1452 } |
|
1453 break; |
|
1454 case EFsEmailUiCmdActionsCopyToClipboard: |
|
1455 { |
|
1456 CopyCurrentToClipBoardL( aEmailAddress ); |
|
1457 } |
1327 break; |
1458 break; |
1328 default: |
1459 default: |
1329 //nothing right now? |
1460 //nothing right now? |
1330 break; |
1461 break; |
1331 } |
1462 } |
1332 } |
1463 } |
|
1464 } |
|
1465 |
|
1466 // ----------------------------------------------------------------------------- |
|
1467 // CFsEmailUiHtmlViewerView::HandleWebAddressCommandL() |
|
1468 // ----------------------------------------------------------------------------- |
|
1469 // |
|
1470 void CFsEmailUiHtmlViewerView::HandleWebAddressCommandL( TInt aCommand, const TDesC& aUrl ) |
|
1471 { |
|
1472 FUNC_LOG; |
|
1473 switch ( aCommand ) |
|
1474 { |
|
1475 case EFsEmailUiCmdActionsOpenWeb: |
|
1476 { |
|
1477 OpenLinkInBrowserL( aUrl ); |
|
1478 break; |
|
1479 } |
|
1480 case EFsEmailUiCmdActionsAddBookmark: |
|
1481 { |
|
1482 SaveWebAddressToFavouritesL( aUrl ); |
|
1483 break; |
|
1484 } |
|
1485 case EFsEmailUiCmdActionsCopyWWWAddressToClipboard: |
|
1486 { |
|
1487 CopyCurrentToClipBoardL( aUrl ); |
|
1488 break; |
|
1489 } |
|
1490 } |
1333 } |
1491 } |
1334 |
1492 |
1335 void CFsEmailUiHtmlViewerView::SaveEmailAsContactL( |
1493 void CFsEmailUiHtmlViewerView::SaveEmailAsContactL( |
1336 const TDesC& aEmailAddress ) |
1494 const TDesC& aEmailAddress ) |
1337 { |
1495 { |
2813 |
2971 |
2814 delete iMailBox; |
2972 delete iMailBox; |
2815 iMailBox = NULL; |
2973 iMailBox = NULL; |
2816 } |
2974 } |
2817 |
2975 |
|
2976 void CFsEmailUiHtmlViewerView::ReloadPageL( ) |
|
2977 { |
|
2978 FUNC_LOG; |
|
2979 if( iContainer ) |
|
2980 { |
|
2981 iContainer->ReloadPageL(); |
|
2982 } |
|
2983 } |
|
2984 |
2818 TBool CFsEmailUiHtmlViewerView::GetAsyncFetchStatus() |
2985 TBool CFsEmailUiHtmlViewerView::GetAsyncFetchStatus() |
2819 { |
2986 { |
2820 return ( iFetchingHtmlMessageBody || iFetchingMessageStructure || iFetchingPlainTextMessageBody ); |
2987 return ( iFetchingHtmlMessageBody || iFetchingMessageStructure || iFetchingPlainTextMessageBody ); |
2821 } |
2988 } |
2822 |
2989 |
2823 // --------------------------------------------------------------------------- |
2990 // --------------------------------------------------------------------------- |
2824 // CFsEmailUiHtmlViewerView::UpdateNaviPaneL |
2991 // CFsEmailUiHtmlViewerView::UpdateEmailHeaderIndicatorsL |
2825 // --------------------------------------------------------------------------- |
2992 // --------------------------------------------------------------------------- |
2826 // |
2993 // |
2827 void CFsEmailUiHtmlViewerView::UpdateNaviPaneL( TBool aForESMR ) |
2994 void CFsEmailUiHtmlViewerView::UpdateEmailHeaderIndicators() |
2828 { |
2995 { |
2829 FUNC_LOG; |
2996 FUNC_LOG; |
2830 // Get navigation decorator for mail viewer |
2997 // Reload mail header. |
2831 CAknNavigationDecorator* naviDecorator = iAppUi.NaviDecoratorL( MailViewerId ); |
2998 if ( iContainer ) |
2832 if ( naviDecorator ) |
2999 { |
2833 { |
3000 iContainer->RefreshCurrentMailHeader(); |
2834 // Check if there's next and previous message available, and set |
3001 } |
2835 // the navipane arrows accordingly |
|
2836 TFSMailMsgId currentMsgId = iMessage->GetMessageId(); |
|
2837 TFSMailMsgId tmpMsgId; |
|
2838 TFSMailMsgId tmpMsgFolderId; |
|
2839 CAknNavigationDecorator::TScrollButton nextButton = CAknNavigationDecorator::ERightButton; |
|
2840 CAknNavigationDecorator::TScrollButton prevButton = CAknNavigationDecorator::ELeftButton; |
|
2841 if (AknLayoutUtils::LayoutMirrored()) |
|
2842 { |
|
2843 nextButton = CAknNavigationDecorator::ELeftButton; |
|
2844 prevButton = CAknNavigationDecorator::ERightButton; |
|
2845 } |
|
2846 if ( iAppUi.IsNextMsgAvailable( currentMsgId, tmpMsgId, tmpMsgFolderId ) ) |
|
2847 { |
|
2848 naviDecorator->SetScrollButtonDimmed( nextButton, EFalse ); |
|
2849 } |
|
2850 else |
|
2851 { |
|
2852 naviDecorator->SetScrollButtonDimmed( nextButton, ETrue ); |
|
2853 } |
|
2854 if ( iAppUi.IsPreviousMsgAvailable( currentMsgId, tmpMsgId, tmpMsgFolderId ) ) |
|
2855 { |
|
2856 naviDecorator->SetScrollButtonDimmed( prevButton, EFalse ); |
|
2857 } |
|
2858 else |
|
2859 { |
|
2860 naviDecorator->SetScrollButtonDimmed( prevButton, ETrue ); |
|
2861 } |
|
2862 |
|
2863 // Set this view's navipane to the top of the navipane control stack |
|
2864 CAknNavigationControlContainer* naviPaneContainer = |
|
2865 static_cast<CAknNavigationControlContainer*>( |
|
2866 StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); |
|
2867 naviPaneContainer->PushL( *naviDecorator ); |
|
2868 naviDecorator->SetNaviDecoratorObserver( aForESMR ? NULL : this ); |
|
2869 } |
|
2870 |
|
2871 // Set priority and follow-up flags |
|
2872 CCustomStatuspaneIndicators* indicators = iAppUi.GetStatusPaneIndicatorContainer(); |
|
2873 if ( indicators) |
|
2874 { |
|
2875 indicators->ShowStatusPaneIndicators(); |
|
2876 |
|
2877 if ( iMessage->IsFlagSet( EFSMsgFlag_Low ) ) |
|
2878 { |
|
2879 indicators->SetPriorityFlag( EMsgPriorityLow ); |
|
2880 } |
|
2881 else if ( iMessage->IsFlagSet( EFSMsgFlag_Important ) ) |
|
2882 { |
|
2883 indicators->SetPriorityFlag( EMsgPriorityHigh ); |
|
2884 } |
|
2885 else |
|
2886 { |
|
2887 indicators->SetPriorityFlag( EMsgPriorityNormal ); |
|
2888 } |
|
2889 |
|
2890 CCustomStatuspaneIndicators::TFollowUpFlagType flagType = CCustomStatuspaneIndicators::EFollowUpNone; |
|
2891 if (iMessage->IsFlagSet(EFSMsgFlag_FollowUp)) |
|
2892 { |
|
2893 flagType = CCustomStatuspaneIndicators::EFollowUp; |
|
2894 } |
|
2895 if (iMessage->IsFlagSet(EFSMsgFlag_FollowUpComplete)) |
|
2896 { |
|
2897 flagType = CCustomStatuspaneIndicators::EFollowUpComplete; |
|
2898 } |
|
2899 indicators->SetFollowUpFlag( flagType ); |
|
2900 } |
|
2901 |
|
2902 } |
|
2903 |
|
2904 // --------------------------------------------------------------------------- |
|
2905 // CFsEmailUiHtmlViewerView::HandleNaviDecoratorEventL |
|
2906 // --------------------------------------------------------------------------- |
|
2907 // |
|
2908 void CFsEmailUiHtmlViewerView::HandleNaviDecoratorEventL( TInt aEventID ) |
|
2909 { |
|
2910 FUNC_LOG; |
|
2911 CAknNavigationDecorator* naviDecorator = iAppUi.NaviDecoratorL( MailViewerId ); |
|
2912 if ( naviDecorator ) |
|
2913 { |
|
2914 naviDecorator->SetNaviDecoratorObserver( NULL ); |
|
2915 } |
|
2916 MAknNaviDecoratorObserver::TAknNaviDecoratorEvents nextButton = MAknNaviDecoratorObserver::EAknNaviDecoratorEventRightTabArrow; |
|
2917 if (AknLayoutUtils::LayoutMirrored()) |
|
2918 { |
|
2919 nextButton = MAknNaviDecoratorObserver::EAknNaviDecoratorEventLeftTabArrow; |
|
2920 } |
|
2921 if( aEventID == nextButton ) |
|
2922 { |
|
2923 ShowNextMessageL(); |
|
2924 } |
|
2925 else |
|
2926 { |
|
2927 ShowPreviousMessageL(); |
|
2928 } |
|
2929 } |
|
2930 |
|
2931 // ----------------------------------------------------------------------------- |
|
2932 // CFsEmailUiHtmlViewerView::HideNaviPane |
|
2933 // ----------------------------------------------------------------------------- |
|
2934 void CFsEmailUiHtmlViewerView::HideNaviPane() |
|
2935 { |
|
2936 FUNC_LOG; |
|
2937 CAknNavigationControlContainer* naviPaneContainer = NULL; |
|
2938 TRAP_IGNORE( naviPaneContainer = static_cast<CAknNavigationControlContainer*>(StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ) ); |
|
2939 TRAP_IGNORE( naviPaneContainer->PushDefaultL() ); |
|
2940 |
|
2941 CCustomStatuspaneIndicators* indicators = iAppUi.GetStatusPaneIndicatorContainer(); |
|
2942 if ( indicators) |
|
2943 { |
|
2944 indicators->HideStatusPaneIndicators(); |
|
2945 } |
|
2946 } |
3002 } |
2947 |
3003 |
2948 // ----------------------------------------------------------------------------- |
3004 // ----------------------------------------------------------------------------- |
2949 // CFsEmailUiHtmlViewerView::IsOpenedInMRViewerL |
3005 // CFsEmailUiHtmlViewerView::IsOpenedInMRViewerL |
2950 // --------------------------------------------------------------------------- |
3006 // --------------------------------------------------------------------------- |
2974 CleanupStack::PopAndDestroy( msg ); |
3030 CleanupStack::PopAndDestroy( msg ); |
2975 } |
3031 } |
2976 return retVal; |
3032 return retVal; |
2977 } |
3033 } |
2978 |
3034 |
2979 |
3035 // ----------------------------------------------------------------------------- |
|
3036 // CFsEmailUiHtmlViewerView::CopyToClipBoardL |
|
3037 // ----------------------------------------------------------------------------- |
|
3038 void CFsEmailUiHtmlViewerView::CopyCurrentToClipBoardL( const TDesC& aArgument ) const |
|
3039 { |
|
3040 FUNC_LOG; |
|
3041 |
|
3042 // Making sure that we are copying something to the clipboard |
|
3043 if ( aArgument.Length() > 0 ) |
|
3044 { |
|
3045 HBufC* clipBoardText = aArgument.AllocLC(); |
|
3046 CClipboard* cb = CClipboard::NewForWritingLC( CCoeEnv::Static()->FsSession() ); |
|
3047 cb->StreamDictionary().At( KClipboardUidTypePlainText ); |
|
3048 CPlainText* plainText = CPlainText::NewL(); |
|
3049 CleanupStack::PushL( plainText ); |
|
3050 plainText->InsertL( 0 , *clipBoardText ); |
|
3051 plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() ); |
|
3052 CleanupStack::PopAndDestroy( plainText ); |
|
3053 cb->CommitL(); |
|
3054 CleanupStack::PopAndDestroy( cb ); |
|
3055 CleanupStack::PopAndDestroy( clipBoardText ); |
|
3056 } |
|
3057 } |
|
3058 |
|
3059 // -------------------------------------------------------------------------------- |
|
3060 // CFsEmailUiHtmlViewerView::OpenLinkInBrowserL |
|
3061 // -------------------------------------------------------------------------------- |
|
3062 void CFsEmailUiHtmlViewerView::OpenLinkInBrowserL( const TDesC& aUrl ) const |
|
3063 { |
|
3064 FUNC_LOG; |
|
3065 |
|
3066 // Create session |
|
3067 RApaLsSession session; |
|
3068 User::LeaveIfError( session.Connect() ); |
|
3069 CleanupClosePushL( session ); |
|
3070 |
|
3071 // Gets the default application UID for for the given MIME type |
|
3072 TUid uid; |
|
3073 TDataType dataType( _L8( "text/html" ) ); |
|
3074 session.AppForDataType( dataType, uid ); |
|
3075 |
|
3076 // Runs the default application using the dataType |
|
3077 TThreadId threadId; |
|
3078 User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) ); |
|
3079 |
|
3080 CleanupStack::PopAndDestroy(); // session |
|
3081 } |
|
3082 |
|
3083 // -------------------------------------------------------------------------------- |
|
3084 // CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL |
|
3085 // -------------------------------------------------------------------------------- |
|
3086 void CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL( const TDesC& aUrl ) const |
|
3087 { |
|
3088 FUNC_LOG; |
|
3089 HBufC* url = aUrl.AllocLC(); |
|
3090 |
|
3091 RFavouritesSession fSession; |
|
3092 User::LeaveIfError( fSession.Connect() ); |
|
3093 CleanupClosePushL( fSession ); |
|
3094 |
|
3095 RFavouritesDb favourites; |
|
3096 User::LeaveIfError( favourites.Open( fSession, KBrowserBookmarks ) ); |
|
3097 CleanupClosePushL( favourites ); |
|
3098 |
|
3099 CFavouritesItem *favouritesItem = CFavouritesItem::NewLC(); |
|
3100 favouritesItem->SetType( CFavouritesItem::EItem ); |
|
3101 favouritesItem->SetUrlL( aUrl ); |
|
3102 // Should be less than KFavouritesMaxName ( 50 ) |
|
3103 if ( url->Length() > KFavouritesMaxName ) |
|
3104 { |
|
3105 favouritesItem->SetNameL( url->Left( KFavouritesMaxName ) ); |
|
3106 } |
|
3107 else |
|
3108 { |
|
3109 favouritesItem->SetNameL( *url ); |
|
3110 } |
|
3111 |
|
3112 favouritesItem->SetParentFolder( KFavouritesRootUid ); |
|
3113 |
|
3114 TInt error = favourites.Add( *favouritesItem, ETrue ); |
|
3115 |
|
3116 CleanupStack::PopAndDestroy( favouritesItem ); |
|
3117 CleanupStack::PopAndDestroy( &favourites ); |
|
3118 CleanupStack::PopAndDestroy( &fSession ); |
|
3119 |
|
3120 CleanupStack::PopAndDestroy( url ); |
|
3121 |
|
3122 if ( error == KErrNone ) |
|
3123 { |
|
3124 TFsEmailUiUtility::ShowInfoNoteL( |
|
3125 R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue ); |
|
3126 } |
|
3127 else // Error in bookmark creation, show could not complete message |
|
3128 { |
|
3129 TFsEmailUiUtility::ShowErrorNoteL( |
|
3130 R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); |
|
3131 } |
|
3132 } |
|
3133 |
|
3134 /* |
|
3135 * Delaying the fetch for MfE till the user scrolls to the bottom of |
|
3136 * the message. |
|
3137 */ |
|
3138 void CFsEmailUiHtmlViewerView::StartFetchingMessageL() |
|
3139 { |
|
3140 CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); |
|
3141 TFetchedType type; |
|
3142 if( htmlBodyPart ) |
|
3143 { |
|
3144 type = EMessageHtmlBodyPart; |
|
3145 } |
|
3146 else |
|
3147 { |
|
3148 type = EMessagePlainTextBodyPart; |
|
3149 } |
|
3150 |
|
3151 if ( !MessagePartFullyFetchedL( type )) |
|
3152 { |
|
3153 iAsyncProcessComplete = EFalse; |
|
3154 iStartAsyncFetchType = type; |
|
3155 //check to make sure we don't kick off fetch twice for the cases where bodypart |
|
3156 //not found(OZ) |
|
3157 if(iMessage && !GetAsyncFetchStatus()) |
|
3158 { |
|
3159 StartFetchingMessagePartL( *iMessage, type ); |
|
3160 } |
|
3161 } |
|
3162 } |
2980 ////////////////////////////////////////////////////////////////////////////////////// |
3163 ////////////////////////////////////////////////////////////////////////////////////// |
2981 // CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE |
3164 // CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE |
2982 /////////////////////////////////////////////////////////////////////////////////// |
3165 /////////////////////////////////////////////////////////////////////////////////// |
2983 CFlagSelectionNoteHandler* CFlagSelectionNoteHandler::NewL( CFsEmailUiHtmlViewerView& aViewerVisualiser ) |
3166 CFlagSelectionNoteHandler* CFlagSelectionNoteHandler::NewL( CFsEmailUiHtmlViewerView& aViewerVisualiser ) |
2984 { |
3167 { |