27 #include "FreestyleEmailUiViewBase.h" |
27 #include "FreestyleEmailUiViewBase.h" |
28 #include "FreestyleEmailUiConstants.h" |
28 #include "FreestyleEmailUiConstants.h" |
29 #include "FreestyleEmailUiContactHandlerObserver.h" |
29 #include "FreestyleEmailUiContactHandlerObserver.h" |
30 #include "FreestyleEmailUiAttachmentsListModel.h" |
30 #include "FreestyleEmailUiAttachmentsListModel.h" |
31 #include <AknWaitDialog.h> |
31 #include <AknWaitDialog.h> |
32 #include <AknNaviDecoratorObserver.h> |
|
33 #include "FreestyleEmailDownloadInformationMediator.h" |
32 #include "FreestyleEmailDownloadInformationMediator.h" |
34 #include "FreestyleEmailUiControlBarCallback.h" |
33 #include "FreestyleEmailUiControlBarCallback.h" |
35 |
34 |
36 class CFSMailMessage; |
35 class CFSMailMessage; |
37 class CFreestyleEmailUiAppUi; |
36 class CFreestyleEmailUiAppUi; |
51 public MFSEmailDownloadInformationObserver, |
50 public MFSEmailDownloadInformationObserver, |
52 public MFSMailRequestObserver, |
51 public MFSMailRequestObserver, |
53 public MProgressDialogCallback, |
52 public MProgressDialogCallback, |
54 public MFSEmailUiFolderListCallback, |
53 public MFSEmailUiFolderListCallback, |
55 public MESMRIcalViewerCallback, |
54 public MESMRIcalViewerCallback, |
56 public MESMRIcalViewerObserver, |
55 public MESMRIcalViewerObserver |
57 public MAknNaviDecoratorObserver |
|
58 { |
56 { |
59 public: |
57 public: |
60 |
58 |
61 /** Two-phased constructor. */ |
59 /** Two-phased constructor. */ |
62 static CFsEmailUiHtmlViewerView* NewL( CAlfEnv& aEnv, |
60 static CFsEmailUiHtmlViewerView* NewL( CAlfEnv& aEnv, |
72 * Id |
70 * Id |
73 * @return Id Uid value |
71 * @return Id Uid value |
74 */ |
72 */ |
75 TUid Id() const; |
73 TUid Id() const; |
76 |
74 |
|
75 void HandleStatusPaneSizeChange(); |
|
76 |
|
77 void HandleViewRectChange(); |
|
78 |
77 /** |
79 /** |
78 * HandleCommandL |
80 * HandleCommandL |
79 * From CAknView, takes care of command handling. |
81 * From CAknView, takes care of command handling. |
80 * @param aCommand Command to be handled |
82 * @param aCommand Command to be handled |
81 */ |
83 */ |
82 void HandleCommandL( TInt aCommand ); |
84 void HandleCommandL( TInt aCommand ); |
83 |
85 |
84 // Handle accept/decline/tentative/remove commands given for meeting request message directly from list UI. |
86 // Handle accept/decline/tentative/remove commands given for meeting request message directly from list UI. |
85 void HandleMrCommandL( TInt aCommandId, TFSMailMsgId aMailboxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId ); |
87 void HandleMrCommandL( TInt aCommandId, TFSMailMsgId aMailboxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId ); |
86 |
88 |
87 void CompletePendingMrCommand(); |
89 void CompletePendingMrCommand(); |
88 void CancelPendingMrCommandL(); |
90 void CancelPendingMrCommandL(); |
|
91 |
89 /** |
92 /** |
90 * ChildDoDeactivate |
93 * ChildDoDeactivate |
91 * From CFsEmailUiViewBase, deactivate the AknView |
94 * From CFsEmailUiViewBase, deactivate the AknView |
92 * Remove the container class instance from the App UI's stack and |
95 * Remove the container class instance from the App UI's stack and |
93 * deletes the instance |
96 * deletes the instance |
102 |
105 |
103 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
106 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
104 |
107 |
105 void SetMskL(); |
108 void SetMskL(); |
106 void PrepareForExit(); |
109 void PrepareForExit(); |
|
110 |
107 public : // for MFSMailRequestObserver |
111 public : // for MFSMailRequestObserver |
108 void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); |
112 void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); |
|
113 |
109 public: |
114 public: |
110 // from MProgressDialogCallback |
115 // from MProgressDialogCallback |
111 void DialogDismissedL( TInt aButtonId); |
116 void DialogDismissedL( TInt aButtonId); |
112 |
117 |
113 CFSMailMessage* CurrentMessage(); |
118 CFSMailMessage* CurrentMessage(); |
114 CFSEmailUiAttachmentsListModel* CurrentAttachmentsListModel(); |
119 CFSEmailUiAttachmentsListModel* CurrentAttachmentsListModel(); |
|
120 |
|
121 // Return view area that can be used for container |
|
122 TRect ContainerRect() const; |
115 |
123 |
116 public: |
124 public: |
117 void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); |
125 void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); |
118 void HandleMailBoxEventL( TFSMailEvent aEvent, |
126 void HandleMailBoxEventL( TFSMailEvent aEvent, |
119 TFSMailMsgId aMailbox, TAny* aParam1, TAny* /*aParam2*/, TAny* /*aParam3*/ ); |
127 TFSMailMsgId aMailbox, TAny* aParam1, TAny* /*aParam2*/, TAny* /*aParam3*/ ); |
120 |
128 |
121 void HandleEmailAddressCommandL( TInt aCommand, const TDesC& aEmailAddress ); |
129 void HandleEmailAddressCommandL( TInt aCommand, const TDesC& aEmailAddress ); |
|
130 void HandleWebAddressCommandL( TInt aCommand, const TDesC& aUrl ); |
122 |
131 |
123 void DownloadAttachmentL( const TAttachmentData& aAttachment ); |
132 void DownloadAttachmentL( const TAttachmentData& aAttachment ); |
124 void DownloadAllAttachmentsL(); |
133 void DownloadAllAttachmentsL(); |
125 void CancelAttachmentL( const TAttachmentData& aAttachment ); |
134 void CancelAttachmentL( const TAttachmentData& aAttachment ); |
126 void OpenAttachmentL( const TAttachmentData& aAttachment ); |
135 void OpenAttachmentL( const TAttachmentData& aAttachment ); |
133 // Helper funcitons to get viewed message ID and Folder id |
142 // Helper funcitons to get viewed message ID and Folder id |
134 TFSMailMsgId ViewedMessageFolderId(); |
143 TFSMailMsgId ViewedMessageFolderId(); |
135 TFSMailMsgId ViewedMessageId(); |
144 TFSMailMsgId ViewedMessageId(); |
136 |
145 |
137 TBool GetAsyncFetchStatus(); |
146 TBool GetAsyncFetchStatus(); |
|
147 void StartFetchingMessageL(); |
|
148 void ReloadPageL(); |
138 public: // from MFSEmailUiContactHandlerObserver |
149 public: // from MFSEmailUiContactHandlerObserver |
139 void OperationCompleteL( TContactHandlerCmd aCmd, |
150 void OperationCompleteL( TContactHandlerCmd aCmd, |
140 const RPointerArray<CFSEmailUiClsItem>& aContacts ); |
151 const RPointerArray<CFSEmailUiClsItem>& aContacts ); |
141 void OperationErrorL( TContactHandlerCmd, TInt aError ); |
152 void OperationErrorL( TContactHandlerCmd, TInt aError ); |
142 TBool IsRemoteLookupSupportedL(); |
153 TBool IsRemoteLookupSupportedL(); |
154 |
165 |
155 public: // from MESMRIcalViewerObserver |
166 public: // from MESMRIcalViewerObserver |
156 void OperationCompleted( TIcalViewerOperationResult aResult ); |
167 void OperationCompleted( TIcalViewerOperationResult aResult ); |
157 void OperationError( TIcalViewerOperationResult aResult ); |
168 void OperationError( TIcalViewerOperationResult aResult ); |
158 |
169 |
159 public: // from MAknNaviDecoratorObserver |
|
160 |
|
161 /** |
|
162 * Called by navigationDecorator if navi arrows (left/right) have been pressed |
|
163 * @aParam aEventID specifies a tapping of either left or right arrow |
|
164 */ |
|
165 void HandleNaviDecoratorEventL( TInt aEventID ); |
|
166 private: // from |
170 private: // from |
167 /** |
171 /** |
168 * @see CFsEmailUiViewBase::ChildDoActivateL |
172 * @see CFsEmailUiViewBase::ChildDoActivateL |
169 */ |
173 */ |
170 void ChildDoActivateL( const TVwsViewId& aPrevViewId, |
174 void ChildDoActivateL( const TVwsViewId& aPrevViewId, |
189 |
193 |
190 /** |
194 /** |
191 * @see CFsEmailUiViewBase::NavigateBackL |
195 * @see CFsEmailUiViewBase::NavigateBackL |
192 */ |
196 */ |
193 void NavigateBackL(); |
197 void NavigateBackL(); |
|
198 |
|
199 /** |
|
200 * @see CFsEmailUiViewBase::SetStatusBarLayout |
|
201 */ |
|
202 void SetStatusBarLayout(); |
194 private: // New functions |
203 private: // New functions |
195 // list of different types of content |
204 // list of different types of content |
196 enum TFetchedType |
205 enum TFetchedType |
197 { |
206 { |
198 EMessagePlainTextBodyPart = 0, |
207 EMessagePlainTextBodyPart = 0, |
201 }; |
210 }; |
202 void ClearMailViewer(); |
211 void ClearMailViewer(); |
203 void LoadContentFromFileL( const TDesC& aFileName ); |
212 void LoadContentFromFileL( const TDesC& aFileName ); |
204 void LoadContentFromFileL( RFile& aFile ); |
213 void LoadContentFromFileL( RFile& aFile ); |
205 void LoadContentFromUrlL( const TDesC& aUrl ); |
214 void LoadContentFromUrlL( const TDesC& aUrl ); |
206 void LoadContentFromMailMessageL( CFSMailMessage* aMailMessage ); |
215 void LoadContentFromMailMessageL( CFSMailMessage* aMailMessage, TBool aResetScrollPosition =ETrue ); |
207 void DeleteMailL(); |
216 void DeleteMailL(); |
208 void HideContainer(); |
217 void HideContainer(); |
209 void ShowContainerL(); |
218 void ShowContainerL(); |
210 void DynInitZoomMenuL( CEikMenuPane* aMenuPane ); |
219 void DynInitZoomMenuL( CEikMenuPane* aMenuPane ); |
211 TInt ZoomLevelIndexL(); |
220 TInt ZoomLevelIndexL(); |
247 // from the move to folder dialog. This is necessary because view swithching is asynchronous. |
256 // from the move to folder dialog. This is necessary because view swithching is asynchronous. |
248 static TInt MoveToFolderAndExitL( TAny* aMailViewerVisualiser ); |
257 static TInt MoveToFolderAndExitL( TAny* aMailViewerVisualiser ); |
249 void FolderSelectedL( TFSMailMsgId aSelectedFolderId, |
258 void FolderSelectedL( TFSMailMsgId aSelectedFolderId, |
250 TFSEmailUiCtrlBarResponse aResponse ); |
259 TFSEmailUiCtrlBarResponse aResponse ); |
251 |
260 |
252 void UpdateNaviPaneL( TBool aForESMR = EFalse ); |
261 void UpdateEmailHeaderIndicators(); |
253 void HideNaviPane(); |
|
254 TBool IsOpenedInMRViewerL(); |
262 TBool IsOpenedInMRViewerL(); |
|
263 void CopyCurrentToClipBoardL( const TDesC& aArgument) const; |
|
264 void OpenLinkInBrowserL( const TDesC& aUrl) const; |
|
265 void SaveWebAddressToFavouritesL( const TDesC& aUrl ) const; |
|
266 void SetScrollPosition(TInt aPosition); |
255 private: // Constructors |
267 private: // Constructors |
256 |
268 |
257 void ConstructL(); |
269 void ConstructL(); |
258 CFsEmailUiHtmlViewerView( CAlfEnv& aEnv, |
270 CFsEmailUiHtmlViewerView( CAlfEnv& aEnv, |
259 CFreestyleEmailUiAppUi& aAppUi, |
271 CFreestyleEmailUiAppUi& aAppUi, |