|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declares UI class for mail viewer application. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MSGMAILVIEWERAPPUI_H |
|
19 #define MSGMAILVIEWERAPPUI_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <MMailAppUiInterface.h> |
|
23 #include <MMessageLoadObserver.h> |
|
24 #include <akntoolbarobserver.h> |
|
25 #include <AknWaitNoteWrapper.h> |
|
26 #include <ConeResLoader.h> |
|
27 #include <aknnavide.h> // for CAknNavigationDecorator |
|
28 #include "MsgMailAppUi.h" |
|
29 #include "MMsgMailAttachmentDialogObserver.h" |
|
30 #include <cenrepnotifyhandler.h> |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CMsgMailViewerDocument; |
|
34 class CMsgAddressControl; |
|
35 class CAknNavigationDecorator; |
|
36 class CMsgMailViewerCharConv; |
|
37 class CMsgMailCharacterSetHandler; |
|
38 class CMailViewManager; |
|
39 class CMailMessage; |
|
40 class CMsgVoIPExtension; |
|
41 class MMailMsgBaseControl; |
|
42 class CMsgMailViewerAttachmentsDlg; |
|
43 class CMailOperation; |
|
44 class MMsvProgressReporter; |
|
45 class CMsgMailViewerFindItemHandler; |
|
46 class CMsgMailViewerContactMatcher; |
|
47 class CMsgMailViewerContactCaller; |
|
48 class CAiwServiceHandler; |
|
49 class CMsgMailViewerReplyToMatcher; |
|
50 |
|
51 // CLASS DECLARATION |
|
52 |
|
53 /** |
|
54 * Application UI class. |
|
55 * Msg Mail viewer |
|
56 */ |
|
57 class CMsgMailViewerAppUi |
|
58 : public CMsgMailAppUi, |
|
59 public MAknToolbarObserver, |
|
60 public MMailAppUiInterface, |
|
61 public MMessageLoadObserver, |
|
62 public MCenRepNotifyHandlerCallback, |
|
63 public MMsvSingleOpWatcher, |
|
64 public MProgressDialogCallback, |
|
65 public MMsgMailAttachmentDialogObserver |
|
66 #ifdef RD_SCALABLE_UI_V2 |
|
67 ,public MAknNaviDecoratorObserver |
|
68 #endif |
|
69 { |
|
70 public: // Constructors and destructor |
|
71 /** |
|
72 * Default constructor. |
|
73 */ |
|
74 CMsgMailViewerAppUi(); |
|
75 |
|
76 /** |
|
77 * Symbian OS default constructor. |
|
78 */ |
|
79 void ConstructL(); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 ~CMsgMailViewerAppUi(); |
|
85 |
|
86 public: // Functions from base classes |
|
87 /** |
|
88 * From CMsgEdittorAppUi, returns pointer to document object. |
|
89 */ |
|
90 CMsgMailViewerDocument* Document() const; |
|
91 |
|
92 /// From MCenRepNotifyHandlerCallback |
|
93 void HandleNotifyInt( TUint32 aId, TInt aNewValue ); |
|
94 void HandleNotifyError( |
|
95 TUint32 aId, TInt aError, |
|
96 CCenRepNotifyHandler* aHandler ); |
|
97 |
|
98 public: //Implementation |
|
99 void DoReplyViaL( TUid aMtmUid, const HBufC* aMatch = NULL, const HBufC* aName = NULL); |
|
100 |
|
101 protected: // From MObjectProvider |
|
102 /** |
|
103 * Provides access to menubar. |
|
104 * @return a pointer to menubar (NULL, if not available) |
|
105 */ |
|
106 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
107 |
|
108 private: // Functions from base classes |
|
109 /** |
|
110 * From MEikMenuObserver, initialise menu pane. |
|
111 * This function is called by the UIKON framework just before it |
|
112 * displays a menu pane. Its default implementation is empty, and by |
|
113 * overriding it, the application can set the state of menu items |
|
114 * dynamically according to the state of application data. |
|
115 * @param aResourceId resource ID identifying the menu pane being |
|
116 * initialised. |
|
117 * @param aMenuPane the in-memory representation of the menu pane. |
|
118 */ |
|
119 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
120 |
|
121 /** |
|
122 * From CEikAppUi, takes care of command handling. |
|
123 * @param aCommand command to be handled |
|
124 */ |
|
125 void HandleCommandL(TInt aCommand); |
|
126 |
|
127 /** |
|
128 * From CEikAppUi, handles key events. |
|
129 * @param aKeyEvent Event to handled. |
|
130 * @param aType Type of the key event. |
|
131 * @return Reponse code (EKeyWasConsumed, EKeyWasNotConsumed). |
|
132 */ |
|
133 virtual TKeyResponse HandleKeyEventL( |
|
134 const TKeyEvent& aKeyEvent,TEventCode aType); |
|
135 |
|
136 /** |
|
137 * From MMsgEditorLauncher, launches view. |
|
138 * Opens received mail. |
|
139 */ |
|
140 void LaunchViewL(); |
|
141 |
|
142 /** |
|
143 * From CMsgEditorAppUi, saves settings, closes viewer. |
|
144 * Writes settings in .INI-file. Closes mail editor. |
|
145 */ |
|
146 void DoMsgSaveExitL(); |
|
147 |
|
148 |
|
149 /** |
|
150 * From CMsgEditorAppUi, receives notification |
|
151 * when focus has changed. |
|
152 */ |
|
153 void EditorObserver( |
|
154 TMsgEditorObserverFunc aFunc, |
|
155 TAny* aArg1, |
|
156 TAny* aArg2, |
|
157 TAny* aArg3 ); |
|
158 |
|
159 /** |
|
160 * From CMsgEditorAppUi (MMsgEditorModelObserver), |
|
161 * HandleEntryDeletedL is called when the |
|
162 * currently open message has been deleted |
|
163 * by some other messaging client. |
|
164 */ |
|
165 void HandleEntryDeletedL(); |
|
166 |
|
167 #ifdef RD_SCALABLE_UI_V2 |
|
168 /** |
|
169 * From MAknNaviDecoratorObserver |
|
170 * Handles the events coming from next/previous arrows |
|
171 */ |
|
172 void HandleNaviDecoratorEventL( TInt aEventID ); |
|
173 #endif |
|
174 |
|
175 // From MMsgMailAttachmentDialogObserver |
|
176 void AttachmentDialogExit(); |
|
177 |
|
178 //From MAknToolbarObserver |
|
179 void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); |
|
180 |
|
181 // From MAknToolbarObserver |
|
182 void OfferToolbarEventL( TInt aCommand ); |
|
183 |
|
184 private: |
|
185 // From CCoeAppUi |
|
186 CArrayFix< TCoeHelpContext >* HelpContextL( ) const; |
|
187 |
|
188 // From MMailAppUiInterface |
|
189 void AddAttachmentL( |
|
190 CMsvAttachment& aAttachmentInfo, |
|
191 TBool aCanBeRemoved ); |
|
192 void AddControlL(TInt aControlType); |
|
193 void AddControlL(CCoeControl& aControl); |
|
194 void AddControlL(MMailMsgBaseControl& aControl); |
|
195 CCoeControl& ParentControl(); |
|
196 CEikStatusPane* StatusPane(); |
|
197 void StartWaitNoteL(/*const TDesC& aText*/); |
|
198 void StopWaitNote(); |
|
199 void SetTitleTextL(TInt aResourceId); |
|
200 void SetAddressFieldTextL(TInt aControlType, CDesCArray& aText); |
|
201 void SetAddressFieldTextL(TInt aControlType, const TDesC& aText); |
|
202 void SetBodyTextL(CRichText& aText); |
|
203 void SetSubjectL(const TDesC& aText); |
|
204 void SetContextBackToMessageL(); |
|
205 TRect MsgViewRect(TInt aPane); |
|
206 void AppUiHandleCommandL(TInt aCommand); |
|
207 TBool IsNextMessageAvailableL( TBool aForward ); |
|
208 void NextMessageL( TBool aForward ); |
|
209 void ViewMessageComplete(); |
|
210 |
|
211 // From MMessageLoadObserver |
|
212 void MessageLoadingL(TInt aStatus, CMailMessage& aMessage); |
|
213 |
|
214 // From MMsvSingleOpWatcher |
|
215 void OpCompleted( |
|
216 CMsvSingleOpWatcher& aOpWatcher, |
|
217 TInt aCompletionCode ); |
|
218 |
|
219 /// From MProgressDialogCallback |
|
220 void DialogDismissedL( TInt aButtonId ); |
|
221 |
|
222 private: // Implementation |
|
223 |
|
224 CRichText* BodyTextL(); |
|
225 void DoDeleteL(); |
|
226 void DoReplyOrForwardL(const TInt aOperation); |
|
227 void DoAttachmentL(); |
|
228 void DoMoveL(); |
|
229 void DoCreateContactL(TInt aCommand); |
|
230 void DoCreateAttachmentControlL(); |
|
231 void DoMessageInfoL() const; |
|
232 void DoHideToolbar( const TBool aHide ); |
|
233 void DoConvertToCharsetL( TUint aCharset ); |
|
234 void DoUpdateNaviPaneL(); |
|
235 TBool HandleExternalCmdL( TInt aCommand ); |
|
236 void HandleInternalCmdL( TInt aCommand ); |
|
237 TBool DoHideReplyToAll() const; |
|
238 TBool DoHideReplyToSender() const; |
|
239 TBool HasAddressFieldText(CMsgAddressControl* aAddressControl) const; |
|
240 TBool HasAnyAddressFieldText() const; |
|
241 TBool HasValidFromAddress() const; |
|
242 const TDesC& FromOrToAddressL() const; |
|
243 void HandleEKeyYesL(); |
|
244 TUint GetCharsetIdL() const; |
|
245 CMsgRecipientArray* GetRecipientArrayL( |
|
246 CMsgAddressControl* aAddressControl ) const; |
|
247 CMsgAddressControl* GetFirstAddressControl( |
|
248 TBool aDirection = ETrue ) const; |
|
249 const TDesC& FirstRecipientAddressL( |
|
250 CMsgAddressControl* aAddressControl ) const; |
|
251 const TDesC& FirstRecipientNameL( |
|
252 CMsgAddressControl* aAddressControl ) const; |
|
253 |
|
254 void DoReplyOptionsMenuL(CEikMenuPane& aMenuPane); |
|
255 void DoRetrieveMessageL(); |
|
256 void SetAutomaticHighlightL( TInt aValue ); |
|
257 void DoSetAutomaticHighlightL(); |
|
258 void SetAddressControlHighlight( |
|
259 CMsgAddressControl* aControl, TInt aValue ); |
|
260 void DynInitOptionsMenu1L(CEikMenuPane& aMenuPane); |
|
261 void DynInitOptionsMenu2L(CEikMenuPane& aMenuPane); |
|
262 TBool IsDefaultSendKeyValueVoIPL() const; |
|
263 void LoadResourceFileL(const TDesC& aResourceName); |
|
264 TMsgControlId FocusedControlId() const; |
|
265 TBool ValidateServiceL( TUid aUid ); |
|
266 TBool VoipProfileExistL() const; |
|
267 TInt MessageAddresseeCount() const; |
|
268 void ShowWaitNoteL( TBool aCanCancel ); |
|
269 void CloseWaitNote(); |
|
270 void ForwardOperationL(); |
|
271 void SetMiddleSoftKeyLabelL( |
|
272 const TInt aResourceId, const TInt aCommandId ); |
|
273 void RemoveMSKCommands(); |
|
274 TBool SpecialScrolling( TUint aKeyCode ); |
|
275 TBool CanMakeCallToContactL() const; |
|
276 CMsgAddressControl* FocusedOrFirstAddressControl() const; |
|
277 TBool IsAttachment() const; |
|
278 |
|
279 /** |
|
280 * Handles Enter key events. |
|
281 */ |
|
282 void HandleEnterKeyL(); |
|
283 |
|
284 private: //Data |
|
285 |
|
286 /** |
|
287 * Own: Wait note shown during launch. |
|
288 */ |
|
289 CAknWaitNoteWrapper* iWaitNote; |
|
290 |
|
291 /** |
|
292 * Own: AIW service handler, use single handler for all |
|
293 * AIWs to avoid menu misbehavior. |
|
294 */ |
|
295 CAiwServiceHandler* iServiceHandler; |
|
296 |
|
297 /** |
|
298 * Own: Contact matcher used when calling or replying to a sender |
|
299 */ |
|
300 CMsgMailViewerContactMatcher* iContactMatcher; |
|
301 |
|
302 /** |
|
303 * Own: handles CFindItemMenu related tasks |
|
304 */ |
|
305 CMsgMailViewerFindItemHandler* iFindItemHandler; |
|
306 |
|
307 /** |
|
308 * Own: handles CallUi for contact cooresponding to sender |
|
309 */ |
|
310 CMsgMailViewerContactCaller* iContactCaller; |
|
311 |
|
312 /** |
|
313 * State of the launching |
|
314 */ |
|
315 TInt iState; |
|
316 |
|
317 /** |
|
318 * Keeps count of character when changing line breaks to paragraph |
|
319 * delimitters. |
|
320 */ |
|
321 TInt iCount; |
|
322 |
|
323 /** |
|
324 * Own: Copy of the body text, used when converting linebreaks. |
|
325 */ |
|
326 HBufC* iText; |
|
327 |
|
328 /** |
|
329 * Own: Dynamic Charconverter menu handler |
|
330 **/ |
|
331 CMsgMailCharacterSetHandler* iCharSetHandler; |
|
332 |
|
333 /** |
|
334 * MUIU Email Local variation flags |
|
335 **/ |
|
336 //TInt iMuiuEmailLVFlags; |
|
337 |
|
338 // Plug-in resource loader |
|
339 RConeResourceLoader iResourceLoader; |
|
340 |
|
341 // Own: Wait dialog |
|
342 CAknWaitDialog* iWaitDialog; |
|
343 |
|
344 // Own: mail view manager |
|
345 CMailViewManager* iViewManager; |
|
346 |
|
347 // Own: Contains information of the VoIP profiles. |
|
348 CMsgVoIPExtension* iMsgVoIPExtension; |
|
349 |
|
350 // Viewer Params |
|
351 TUint iParams; |
|
352 // Internal Flags |
|
353 TUint iFlags; |
|
354 |
|
355 //own: attachment dilalog title |
|
356 HBufC* iTitle; |
|
357 |
|
358 // Internal Flag |
|
359 TBool iAttachmentLoadingOn; |
|
360 |
|
361 // Ref: to running operation |
|
362 CMailOperation* iOperation; |
|
363 |
|
364 // Own: Operation watcher |
|
365 CMsvSingleOpWatcher* iOperationWatcher; |
|
366 |
|
367 // Ref: to progress reporter |
|
368 MMsvProgressReporter* iProgressReporter; |
|
369 |
|
370 //Not owned |
|
371 CMsgMailViewerAttachmentsDlg* iAttachmentdlg; |
|
372 |
|
373 TInt iLastControlId; |
|
374 |
|
375 CMsgMailViewerReplyToMatcher* iReplyToMatcher; |
|
376 |
|
377 CAknWaitDialog* iOpeningWaitDialog; |
|
378 |
|
379 UNIT_TEST(ut_mailviewerappui) |
|
380 |
|
381 /** |
|
382 * Saved focused control for touch support. |
|
383 * Does not own. |
|
384 */ |
|
385 CMsgBaseControl* iFocusedControl; |
|
386 |
|
387 //Not owned |
|
388 CAknNavigationControlContainer* iNaviPane; |
|
389 |
|
390 // ETrue while the message is being reloaded |
|
391 TBool iMessageReload; |
|
392 |
|
393 // Default state for dialer |
|
394 // ETrue : Dialer is enabled |
|
395 // EFalse : Dialer is disabled |
|
396 TBool iDefaultDialerState; |
|
397 |
|
398 }; |
|
399 |
|
400 #include "MsgMailViewerAppUi.inl" // Inline functions |
|
401 |
|
402 #endif // MSGMAILVIEWERAPPUI_H |
|
403 |
|
404 // End of File |
|
405 |