|
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 application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MSGMAILEDITORAPPUI_H |
|
20 #define MSGMAILEDITORAPPUI_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <RPbkViewResourceFile.h> |
|
24 #include <MsgAttachmentUtils.h> |
|
25 #include <akntoolbarobserver.h> |
|
26 #include <msvstd.h> |
|
27 #include "MsgMailAppUi.h" |
|
28 #include "mmsgmailappuiopdelegate.h" |
|
29 #include "cmsgmailbaseop.h" |
|
30 |
|
31 |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CMsgMailEditorDocument; |
|
35 class CMsgMailSendOptionsDlg; |
|
36 class CMsgExpandableControl; |
|
37 class CMsgAddressControl; |
|
38 class CPbkContactEngine; |
|
39 class CMsgRecipientItem; |
|
40 class CAknWaitDialog; |
|
41 class CMsgRecipientList; |
|
42 class TAdditionalHeaderStatus; |
|
43 class CMsgMailViewAttachmentsDlg; |
|
44 class CMsgCheckNames; |
|
45 class CMsgMailEditorHeader; |
|
46 class CMsgMailNaviPaneUtils; |
|
47 class CAknLocalScreenClearer; |
|
48 |
|
49 /** |
|
50 * Application UI class. |
|
51 */ |
|
52 class CMsgMailEditorAppUi |
|
53 : public CMsgMailAppUi, |
|
54 public MAknToolbarObserver, |
|
55 public MMsgMailAppUiOpDelegate, |
|
56 public MMsgMailOpObserver |
|
57 { |
|
58 public: // // Constructors and destructor |
|
59 /** |
|
60 * Default constructor |
|
61 */ |
|
62 CMsgMailEditorAppUi(); |
|
63 |
|
64 /** |
|
65 * Symbian OS default constructor. |
|
66 */ |
|
67 void ConstructL(); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 ~CMsgMailEditorAppUi(); |
|
73 |
|
74 /** |
|
75 * inline |
|
76 * Return pointer to mail editor document. |
|
77 * @return CMsgMailEditorDocument. |
|
78 * Ownership not transferred. |
|
79 */ |
|
80 inline CMsgMailEditorDocument* Document() const; |
|
81 |
|
82 public: //New functions |
|
83 /** |
|
84 * Fetches attachment from other application and |
|
85 * adds it to message. |
|
86 * @param aCommand Type of fetch operation |
|
87 * we want to proceed e.g. EMsgMailEditorCmdInsertImage. |
|
88 */ |
|
89 void DoFetchFileL( TInt aCommand ); |
|
90 |
|
91 /** |
|
92 * Displays toolbar Insert Other selection list. |
|
93 * If option is selected proceeds to fetching. |
|
94 */ |
|
95 void DoShowToolBarOtherL(); |
|
96 |
|
97 public: // Functions from base classes |
|
98 /// From MMsgEditorLauncher |
|
99 void LaunchViewL(); |
|
100 |
|
101 //From MAknToolbarObserver |
|
102 void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); |
|
103 |
|
104 // From MAknToolbarObserver |
|
105 void OfferToolbarEventL( TInt aCommand ); |
|
106 |
|
107 // From CEikAppUi |
|
108 void HandleCommandL(TInt aCommand); |
|
109 TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, |
|
110 TEventCode aType); |
|
111 |
|
112 |
|
113 protected: // Functions from base classes |
|
114 // From MObjectProvider |
|
115 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
116 |
|
117 // From CEikAppUi |
|
118 void HandleSystemEventL( const TWsEvent& aEvent ); |
|
119 |
|
120 private: // Functions from base classes |
|
121 // From CCoeAppUi |
|
122 CArrayFix< TCoeHelpContext >* HelpContextL( ) const; |
|
123 |
|
124 /// From MEikMenuObserver |
|
125 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
126 |
|
127 /// From MMsgEditorObserver. |
|
128 void EditorObserver( |
|
129 TMsgEditorObserverFunc aFunc, |
|
130 TAny* aArg1, |
|
131 TAny* aArg2, |
|
132 TAny* aArg3 ); |
|
133 |
|
134 /// From MMsgMailAppUiOpDelegate |
|
135 void DelegateSaveMsgL(); |
|
136 TMsvId DelegateMoveMsgToOutboxL(); |
|
137 CMsgBodyControl& DelegateInitLaunchL(); |
|
138 void DelegateExecuteViewL(); |
|
139 void DelegateFinalizeLaunchL(); |
|
140 |
|
141 /// From MMsgMailOpObserver |
|
142 void HandleOpCompleted( const CMsgMailBaseOp& aOp, |
|
143 TInt aResult ); |
|
144 |
|
145 private: // implementation |
|
146 |
|
147 void HandleAttaAddedL(); |
|
148 void SetTitlePaneL( TInt aResourceId ); |
|
149 void DoCreateControlsL(); |
|
150 void DoAttachmentL(); |
|
151 void DoCheckEncodingL(); |
|
152 void DoMsgSaveExitL(); |
|
153 void PrepereToExitL(); |
|
154 void DoSendMessageL(); |
|
155 void DoSendOptionsL(); |
|
156 void DoHideToolbar( const TBool aHide ); |
|
157 void DoShowSelectionListL(); |
|
158 void DoShowExtensionToolBar(); |
|
159 |
|
160 void DoShowToolBarTextL(); |
|
161 void DoBackstepL(); |
|
162 void DoAddRecipientL(); |
|
163 void DoAdditionalHeadersL(); |
|
164 void DoGetRecipientsL(); |
|
165 void DoRemoveDuplicatesL(); |
|
166 void DoHandleCommandL( TInt aCommand ); |
|
167 void EditorObserverL( |
|
168 TMsgEditorObserverFunc aFunc, |
|
169 TAny* aArg1, |
|
170 TAny* aArg2, |
|
171 TAny* aArg3 ); |
|
172 TBool CheckRecipientsL(TBool aHighLight); |
|
173 void ShowIncorrectAddressErrorL(const TDesC& aTitle, |
|
174 const TDesC& aAddress) const; |
|
175 TBool IsEmptyL() const; |
|
176 void SetSubjectL(const TDesC& aText) const; |
|
177 TBool AreAddressFieldsEmptyL() const; |
|
178 void UpdateMessageSizeL(); |
|
179 void ShowSelectedMailboxL(); |
|
180 void CheckRecipientsInFieldL(CMsgAddressControl* aAddressField, |
|
181 TBool& aHighlight, TBool& aResult); |
|
182 void RemoveDuplicatesL(CMsgAddressControl* aAddressField); |
|
183 void RemoveDuplicatesL(CMsgAddressControl* aAddressField, |
|
184 CMsgAddressControl* aLaterAddressField); |
|
185 void AddRecipientArrayL(CMsgAddressControl* aControl, |
|
186 const CDesCArray& aArray); |
|
187 void UpdateHeaderVisibilityL( |
|
188 RPointerArray<TAdditionalHeaderStatus>& aHeaders); |
|
189 void UpdatePriorityIndicatorL(); |
|
190 void DoMessageInfoL(); |
|
191 void InitPhoneBookL(); |
|
192 void SearchUnverifiedStringL(const TDesC& aText, |
|
193 CMsgAddressControl* aControl); |
|
194 TBool AllAddressValidL(); |
|
195 void SetFocusToFirstFreeFieldL(); |
|
196 void StopWaitNote(); |
|
197 void StartWaitNoteLC( |
|
198 TInt aStringResourceId, |
|
199 TBool aDelayOff = EFalse ); |
|
200 void StartWaitNoteLC( |
|
201 TInt aStringResourceId, |
|
202 TBool aDelayOff, |
|
203 TInt aResouceID ); |
|
204 HBufC* StringLoaderLoadLC( TInt aTextResource ); |
|
205 TBool SpecialScrolling( TUint aKeyCode ); |
|
206 void RotateFocus( TBool aDirection, TInt aCurrentFocus ); |
|
207 void SetMiddleSoftKeyLabelL( |
|
208 const TInt aResourceId, const TInt aCommandId ); |
|
209 void RemoveMSKCommands(); |
|
210 void CheckFocusForMskL(TInt aControl); |
|
211 TBool CheckGlobalReplyToSettingL(); |
|
212 void SetInputModeToAddressFields( TInt aInputMode ); |
|
213 void SetFocusAfterAddRecipientL( TMsgControlId aFocusBeforeAdd ); |
|
214 |
|
215 #ifdef RD_SCALABLE_UI_V2 |
|
216 void ControlTouchedL( const CMsgBaseControl& aControl ); |
|
217 #endif |
|
218 |
|
219 /* |
|
220 * Removes unneeded prefixes from subject text |
|
221 */ |
|
222 void HandleSubjectL(); |
|
223 |
|
224 /** |
|
225 * Handles enter key events. |
|
226 */ |
|
227 void HandleEnterKeyL(); |
|
228 |
|
229 private: // Data |
|
230 |
|
231 /** |
|
232 * Own: address finder |
|
233 */ |
|
234 CMsgCheckNames* iCheckNames; |
|
235 |
|
236 /** |
|
237 * Own: A wait dialog |
|
238 */ |
|
239 CAknWaitDialog* iWaitNote; |
|
240 |
|
241 /** |
|
242 * Mail editor UI header handler |
|
243 * Own. |
|
244 */ |
|
245 CMsgMailEditorHeader* iMailEditorHeader; |
|
246 |
|
247 /** |
|
248 * Middle soft key command |
|
249 */ |
|
250 TInt iCurrentMskCommandId; |
|
251 |
|
252 /** |
|
253 * Navi pane utils. Own. |
|
254 */ |
|
255 CMsgMailNaviPaneUtils* iNaviPaneUtils; |
|
256 |
|
257 /** |
|
258 * Attachment dialog. Own. |
|
259 */ |
|
260 CMsgMailViewAttachmentsDlg* iAttachmentDlg; |
|
261 |
|
262 /** |
|
263 * Saved focused control for touch support. |
|
264 * Does not own. |
|
265 */ |
|
266 CMsgBaseControl* iFocusedControl; |
|
267 |
|
268 /** |
|
269 * Operation object for sending a message. Own. |
|
270 */ |
|
271 CMsgMailBaseOp* iSendOp; |
|
272 |
|
273 /** |
|
274 * Operation object for launching editor. Own. |
|
275 */ |
|
276 CMsgMailBaseOp* iLaunchOp; |
|
277 |
|
278 /** |
|
279 * Operation object for fetching (attaching) files. Own. |
|
280 */ |
|
281 CMsgMailBaseOp* iFetchFileOp; |
|
282 |
|
283 /** |
|
284 * Document is deleted when the editor is closed. |
|
285 * ETrue : Always delete document |
|
286 * EFalse : Default behaviour |
|
287 */ |
|
288 TBool iForceDeleteDocument; |
|
289 |
|
290 /** |
|
291 * Screen clearer. Own. |
|
292 */ |
|
293 CAknLocalScreenClearer* iScreenClearer; |
|
294 |
|
295 }; |
|
296 |
|
297 // Inline functions |
|
298 #include "MsgMailEditorAppUi.inl" |
|
299 |
|
300 #endif |
|
301 |
|
302 // End of File |