|
1 /* |
|
2 * Copyright (c) 2006 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: |
|
15 * Class declaration file |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __IMUMSETTINGSDIALOG_H__ |
|
21 #define __IMUMSETTINGSDIALOG_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <bldvariant.hrh> |
|
25 #include <AknForm.h> // CAknDialog |
|
26 #include <e32base.h> // CArrayFixFlat |
|
27 #include <muiuflagger.h> // CMuiuFlags |
|
28 #include <ConeResLoader.h> // RConeResourceLoader |
|
29 |
|
30 #include "ImumMboxData.h" |
|
31 |
|
32 // DATA TYPES |
|
33 enum TIMSFlags |
|
34 { |
|
35 // Indicates the settings state between wizard and normal setitngs |
|
36 EImumSettingsWizard = 0, |
|
37 // Indicates that the settings should be closed |
|
38 EImumSettingShouldClose, |
|
39 // Indicates if the settings and mce should be exitted |
|
40 EImumSettingShouldExit, |
|
41 // Indicates the need of query in exit |
|
42 EImumSettingQueryClose, |
|
43 // Indicates the need of opening settings menu |
|
44 EImumSettingOpenOptionsMenu, |
|
45 // Indicates if the submenu item is currently selected |
|
46 EImumSettingPositionSubMenu, |
|
47 // Indicates if the settings should be created/saved |
|
48 EImumSettingSave, |
|
49 // Keep this flag last |
|
50 EImumSettingLastFlag |
|
51 }; |
|
52 |
|
53 enum TImumUiExitCodes |
|
54 { |
|
55 // Nothing has changed, no need for save |
|
56 EImumUiNoChanges = 0, |
|
57 // After back key has been pressed, exit settings |
|
58 EImumUiClose, |
|
59 // After back key has been pressed, save and exit settings |
|
60 EImumUiSaveAndClose, |
|
61 // After options->exit has been chose, exit settings |
|
62 EImumUiExit, |
|
63 // After options->exit has been chose, save and exit settings |
|
64 EImumUiSaveAndExit, |
|
65 // External wizard created new mailbox |
|
66 EImumUiExtWizardCreated |
|
67 }; |
|
68 |
|
69 // FORWARD DECLARATIONS |
|
70 class CIMSSettingsBaseUI; |
|
71 class CEikFormattedCellListBox; |
|
72 class CImumMboxManager; |
|
73 class CAknTitlePane; |
|
74 class CEikEdwin; |
|
75 class CEikRichTextEditor; |
|
76 class CImumInternalApiImpl; |
|
77 class CImumInSettingsData; |
|
78 class CAiwGenericParamList; |
|
79 class CIMSWizardControl; |
|
80 |
|
81 // CLASS DECLARATION |
|
82 |
|
83 /** |
|
84 * CIMSSettingsUi |
|
85 */ |
|
86 class CIMSSettingsUi : |
|
87 public CAknDialog |
|
88 { |
|
89 public: // Constructors and destructor |
|
90 |
|
91 /** |
|
92 * Destructor. |
|
93 */ |
|
94 virtual ~CIMSSettingsUi(); |
|
95 |
|
96 public: // New functions |
|
97 |
|
98 /** |
|
99 * Launches settings dialog for creating new account |
|
100 * @since S60 3.0 |
|
101 * @param aSession: reference to the session object |
|
102 * @param aSettings: reference to the settings object |
|
103 * @return EFalse if no saving, ETrue otherwise |
|
104 */ |
|
105 IMPORT_C static TMsvId NewAccountL( |
|
106 TImumUiExitCodes& aExitCode, |
|
107 CImumInSettingsData& aMailboxSettings, |
|
108 CMsvSession& aMsvSession ); |
|
109 |
|
110 /** |
|
111 * Launches settings dialog for creating new account |
|
112 * @since S60 3.2 |
|
113 * @param aSession: reference to the session object |
|
114 * @param aSettings: reference to the settings object |
|
115 * @param aDefaultWizOnly: if ETrue, no external wizard is |
|
116 * launched, even if one exists |
|
117 * @return EFalse if no saving, ETrue otherwise |
|
118 */ |
|
119 IMPORT_C static TMsvId NewAccountL( |
|
120 TImumUiExitCodes& aExitCode, |
|
121 CImumInSettingsData& aMailboxSettings, |
|
122 CMsvSession& aMsvSession, |
|
123 TBool aDefaultWizOnly ); |
|
124 |
|
125 /** |
|
126 * Launches settings dialog for editing existing account |
|
127 * @since S60 3.0 |
|
128 * @param aSession: reference to the session object |
|
129 * @param aSettings: reference to the settings object |
|
130 * @param aId: TMsvId of the edited settings |
|
131 * @return EFalse if no saving, ETrue otherwise |
|
132 */ |
|
133 IMPORT_C static void EditAccountL( |
|
134 TImumUiExitCodes& aExitCode, |
|
135 CImumInSettingsData& aMailboxSettings, |
|
136 CMsvSession& aMsvSession ); |
|
137 |
|
138 /** |
|
139 * |
|
140 * @since S60 3.0 |
|
141 */ |
|
142 void LaunchHelp(); |
|
143 |
|
144 /** |
|
145 * |
|
146 * @since S60 3.0 |
|
147 */ |
|
148 void DoQuitL(); |
|
149 |
|
150 /** |
|
151 * Execute commands as requested by a flags |
|
152 * @since S60 3.2 |
|
153 */ |
|
154 void ExecFlags(); |
|
155 |
|
156 public: // Functions from base classes |
|
157 |
|
158 //From CAknDialog |
|
159 /** |
|
160 * ProcessCommandL |
|
161 * @since S60 3.0 |
|
162 * @param aCommandId, command id |
|
163 */ |
|
164 void ProcessCommandL( TInt aCommandId ); |
|
165 |
|
166 /** |
|
167 * OfferKeyEventL |
|
168 * Used here to handle exit event from subsettings |
|
169 * @since S60 3.0 |
|
170 * @param aKeyEvent, event id |
|
171 * @param aType, event type |
|
172 * @return Response |
|
173 */ |
|
174 TKeyResponse OfferKeyEventL( |
|
175 const TKeyEvent& aKeyEvent, |
|
176 TEventCode aType ); |
|
177 |
|
178 void HandleCommandL( TInt aCommand ); |
|
179 |
|
180 /** |
|
181 * |
|
182 * @since S60 3.1 |
|
183 */ |
|
184 virtual void HandleResourceChange( TInt aType ); |
|
185 |
|
186 protected: // New functions |
|
187 protected: // Functions from base classes |
|
188 |
|
189 //From CEikDialog |
|
190 |
|
191 /** |
|
192 * OkToExitL |
|
193 * @since S60 3.0 |
|
194 * @param aButtonId, button id |
|
195 * @return if exit |
|
196 */ |
|
197 virtual TBool OkToExitL( TInt aButtonId ); |
|
198 |
|
199 /** |
|
200 * PreLayoutDynInitL |
|
201 */ |
|
202 virtual void PreLayoutDynInitL(); |
|
203 |
|
204 /** |
|
205 * DynInitMenuPaneL |
|
206 * @since S60 3.0 |
|
207 * @param aResourceId |
|
208 * @param aMenuPane |
|
209 * @return command id |
|
210 */ |
|
211 virtual void DynInitMenuPaneL( |
|
212 TInt aResourceId, |
|
213 CEikMenuPane* aMenuPane ); |
|
214 |
|
215 /** |
|
216 * |
|
217 * @since S60 3.0 |
|
218 */ |
|
219 virtual void GetHelpContext( |
|
220 TCoeHelpContext& aContext ) const; |
|
221 |
|
222 |
|
223 /** |
|
224 * Sets Settings ui's size and position |
|
225 * From CAknDialog |
|
226 * @since S60 3.2 |
|
227 */ |
|
228 virtual void SetSizeAndPosition( const TSize& aSize ); |
|
229 |
|
230 |
|
231 /** |
|
232 * Method to create help screen control |
|
233 * From CEikDialog |
|
234 * @since S60 3.2 |
|
235 */ |
|
236 virtual SEikControlInfo CreateCustomControlL( TInt aControlType ); |
|
237 |
|
238 private: // Constructors |
|
239 |
|
240 /** |
|
241 * C++ default constructor. |
|
242 * @since S60 3.0 |
|
243 * @param aSession, session reference |
|
244 * @param aSettings, mail settings reference |
|
245 * @param aId, entry id |
|
246 * @param aEmailAddress, emailaddress from plugin |
|
247 * when user browses in settings |
|
248 */ |
|
249 CIMSSettingsUi( |
|
250 TImumUiExitCodes& aExitCode, |
|
251 CImumInSettingsData& aMailboxSettings ); |
|
252 |
|
253 /** |
|
254 * |
|
255 * @since S60 3.0 |
|
256 */ |
|
257 void SettingsConstructL( |
|
258 const TInt aResource, |
|
259 CMsvSession& aMsvSession, |
|
260 const TDesC& aEmailAddress ); |
|
261 |
|
262 private: // New functions |
|
263 |
|
264 /** |
|
265 * Check to see if we are editing an existing |
|
266 * or a new account |
|
267 * @since S60 3.0 |
|
268 * @return ETrue if editing, EFalse if creating new |
|
269 */ |
|
270 inline TBool EditingAnAccount() const; |
|
271 |
|
272 /** |
|
273 * Change font color in startup and when skin is changed. |
|
274 * @since S60 3.1 |
|
275 */ |
|
276 void SetFontAndSkin(); |
|
277 |
|
278 /** |
|
279 * Determines the exitcode |
|
280 * |
|
281 * @since S60 v3.2 |
|
282 * @return Exit code based on the current status. |
|
283 */ |
|
284 TImumUiExitCodes ExitCode(); |
|
285 |
|
286 /** |
|
287 * |
|
288 * @since S60 v3.2 |
|
289 * @param |
|
290 * @return |
|
291 */ |
|
292 static void StartL( |
|
293 TInt aResource, |
|
294 TImumUiExitCodes& aExitCode, |
|
295 CImumInSettingsData& aMailboxSettings, |
|
296 CMsvSession& aMsvSession, |
|
297 const TDesC& aEmailAddress ); |
|
298 |
|
299 /** |
|
300 * Tries to launch external wizard via AIW |
|
301 * |
|
302 * @since S60 v3.2 |
|
303 * @param aEmailAddress in which the email address is set if get |
|
304 * @param aMailboxId is set if external wizard creates mailbox |
|
305 * @leave KErrNotFound if not found approrpiate email wizard -plugin |
|
306 * @leave KErrCancel if operation was cancelled in external wizard |
|
307 */ |
|
308 static void LaunchExtWizardL( |
|
309 TDes& aEmailAddress, |
|
310 TMsvId& aMailboxId ); |
|
311 |
|
312 /** |
|
313 * Loads icon array to settings listbox object. |
|
314 * |
|
315 * @since S60 v3.2 |
|
316 */ |
|
317 void LoadListboxIconArrayL(); |
|
318 |
|
319 private: // Data |
|
320 |
|
321 // Flags of settings |
|
322 CMuiuFlags* iFlags; |
|
323 // Exitcode to be returned to MTM |
|
324 TImumUiExitCodes& iExitCode; |
|
325 // The settings manager that handles account creation |
|
326 CImumInSettingsData& iMailboxSettings; |
|
327 // |
|
328 CImumInternalApiImpl* iMailboxApi; |
|
329 // The listbox with skin support |
|
330 CEikFormattedCellListBox* iListBox; |
|
331 // |
|
332 CIMSSettingsBaseUI* iSettings; |
|
333 // |
|
334 TInt iResourceMenuBar; |
|
335 // Object to load the resources |
|
336 RConeResourceLoader iResourceLoader; |
|
337 // Descriptor to hold email address received from external plugin |
|
338 HBufC* iEmailAddress; |
|
339 |
|
340 // Help screen container, NOT OWNED |
|
341 CIMSWizardControl* iWizardContainer; |
|
342 }; |
|
343 |
|
344 #endif // __IMUMSETTINGSDIALOG_H__ |
|
345 |
|
346 // End of File |