|
1 /* |
|
2 * Copyright (c) 2007 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: File for dialog control. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef IPSSETUIDIALOG_H |
|
21 #define IPSSETUIDIALOG_H |
|
22 |
|
23 |
|
24 #include <iapprefs.h> // TImIAPChoice |
|
25 #include <msvapi.h> // MMsvSessionObserver |
|
26 |
|
27 #include "ipssetuibasedialog.h" // CIpsSetUiBaseDialog |
|
28 |
|
29 class CIpsSetData; |
|
30 class CIpsSetUi; |
|
31 |
|
32 class CIpsSetUiDialogCtrl : |
|
33 public CIpsSetUiBaseDialog |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Class destructor. |
|
39 */ |
|
40 ~CIpsSetUiDialogCtrl(); |
|
41 |
|
42 /** |
|
43 * 2-phase constructor. |
|
44 */ |
|
45 static CIpsSetUiDialogCtrl* NewL( |
|
46 CIpsSetUi& aDialog, |
|
47 CEikFormattedCellListBox& aListBox, |
|
48 CAknTitlePane& aTitlePane, |
|
49 CEikButtonGroupContainer& aButtons, |
|
50 CMsvSession& aSession, |
|
51 TUint64& aFlags ); |
|
52 |
|
53 /** |
|
54 * 2-phase constructor with stack push. |
|
55 */ |
|
56 static CIpsSetUiDialogCtrl* NewLC( |
|
57 CIpsSetUi& aDialog, |
|
58 CEikFormattedCellListBox& aListBox, |
|
59 CAknTitlePane& aTitlePane, |
|
60 CEikButtonGroupContainer& aButtons, |
|
61 CMsvSession& aSession, |
|
62 TUint64& aFlags ); |
|
63 |
|
64 // New functions |
|
65 |
|
66 /** |
|
67 * Retrieves the current help context. |
|
68 * |
|
69 * @param aContext Current help context. |
|
70 */ |
|
71 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
72 |
|
73 void DynInitMenuPaneL( /*TInt aResourceId,*/ |
|
74 CEikMenuPane* aMenuPane ); |
|
75 |
|
76 /** |
|
77 * Saves the settings. |
|
78 */ |
|
79 void StoreSettingsToAccountL(); |
|
80 |
|
81 // From base class CIpsSetUiBaseDialog |
|
82 |
|
83 /** |
|
84 * Catches key events. |
|
85 * |
|
86 * @param aKeyEvent Invoked event. |
|
87 * @param aType Type of event. |
|
88 * @return State of the key event after procesessing. |
|
89 */ |
|
90 TKeyResponse OfferKeyEventL( |
|
91 const TKeyEvent& aKeyEvent, |
|
92 TEventCode aType ); |
|
93 |
|
94 /** |
|
95 * Processes the dialog commands. |
|
96 * |
|
97 * @param aCommandId Invoked command. |
|
98 */ |
|
99 virtual void ProcessCommandL( TInt aCommandId ); |
|
100 |
|
101 /** |
|
102 * Check whether the dialog can be exited. |
|
103 * |
|
104 * @param aButtonId Pressed button. |
|
105 */ |
|
106 virtual TBool OkToExitL( |
|
107 const TInt aButtonId ); |
|
108 |
|
109 protected: |
|
110 |
|
111 /** |
|
112 * Constructor. |
|
113 * |
|
114 * @param aDialog Actual dialog. |
|
115 * @param aListBox Listbox the dialog is showing. |
|
116 * @param aTitlePane Guess... |
|
117 * @param aFlags Flags to control dialog behavior and exit. |
|
118 */ |
|
119 CIpsSetUiDialogCtrl( |
|
120 CIpsSetUi& aDialog, |
|
121 CEikFormattedCellListBox& aListBox, |
|
122 CAknTitlePane& aTitlePane, |
|
123 CMsvSession& aSession, |
|
124 TUint64& aFlags ); |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * 2nd phase of construction. |
|
130 * |
|
131 * @param aButtons Button container of the dialog |
|
132 * @leave For any odd reason. |
|
133 */ |
|
134 void ConstructL( CEikButtonGroupContainer& aButtons ); |
|
135 |
|
136 // New functions |
|
137 |
|
138 /** |
|
139 * Gets IapChoice from the item. |
|
140 * |
|
141 * @param aItemId Preferably access point item id. |
|
142 * @return Access point choice item. |
|
143 */ |
|
144 TImIAPChoice GetIapPref( const TInt aItemId ); |
|
145 |
|
146 /** |
|
147 * Handles any event from the system. |
|
148 * |
|
149 * @param aCommandId Commands to be handled. |
|
150 */ |
|
151 virtual TBool EventHandlerL( const TInt aCommandId ); |
|
152 |
|
153 /** |
|
154 * Handles softkey pressed event. |
|
155 * |
|
156 * @param aButton Button that is pressed. |
|
157 * @return ETrue, when handled. |
|
158 */ |
|
159 TBool KeyPressSoftkeyL( const TInt aButton ); |
|
160 |
|
161 /** |
|
162 * Handles OK key press. |
|
163 * |
|
164 * @param aButton Button that is pressed. |
|
165 */ |
|
166 TBool KeyPressOKButtonL( const TInt aButton ); |
|
167 |
|
168 /** |
|
169 * @param aItem Port item for initialization. |
|
170 */ |
|
171 void InitPort( CIpsSetUiItem& aItem ); |
|
172 |
|
173 /** |
|
174 * Get the port item |
|
175 * |
|
176 * @param aIncoming Defines item for fetching. |
|
177 * @param aEditor Defines if the editor should be found. |
|
178 * @return Requested item. |
|
179 */ |
|
180 CIpsSetUiItem& PortItem( |
|
181 const TBool aIncoming, |
|
182 const TBool aEditor ); |
|
183 |
|
184 /** |
|
185 |
|
186 |
|
187 /** |
|
188 * Open folder subscription dialog. |
|
189 */ |
|
190 TIpsSetUiEventResult HandleEventSubscribeFoldersL(); |
|
191 |
|
192 /** |
|
193 * @param aBaseItem Port item for handling after editor close. |
|
194 */ |
|
195 void HandleEventPort( CIpsSetUiItem& aBaseItem ); |
|
196 |
|
197 /** |
|
198 * Handle the change of Outgoing User Authentication value |
|
199 * |
|
200 * @param aBaseItem Authentication item |
|
201 * @param aForceClear Clears the username and password fields. |
|
202 */ |
|
203 void HandleEventAuthentication( |
|
204 CIpsSetUiItem& aBaseItem, |
|
205 const TBool aForceClear ); |
|
206 |
|
207 /** |
|
208 * Hides/Unhides roaming depending on the status |
|
209 * |
|
210 * @param aBaseItem Scheduling item |
|
211 */ |
|
212 void HandleEventSchedule( CIpsSetUiItem& aBaseItem ); |
|
213 |
|
214 /** |
|
215 * Change the setting label for day item. |
|
216 * |
|
217 * @param aParam Day item |
|
218 */ |
|
219 void HandleEventDaysL( CIpsSetUiItem& aBaseItem ); |
|
220 |
|
221 /** |
|
222 * Updates the settings text for download size item. |
|
223 * |
|
224 * @param aBaseItem Download size page |
|
225 */ |
|
226 void HandleDownloadSizeL( CIpsSetUiItem& aBaseItem ); |
|
227 |
|
228 /** |
|
229 * Updates the settings text for email retrieval settings. |
|
230 * |
|
231 * @param aBaseItem Download size page |
|
232 */ |
|
233 //void HandleEmailsToRetrieve( CIpsSetUiItem& aBaseItem ); |
|
234 |
|
235 /** |
|
236 * Changes resource for port editor |
|
237 */ |
|
238 TIpsSetUiEventResult HandlePort(); |
|
239 |
|
240 /** |
|
241 * Launch IAP page. |
|
242 * |
|
243 * @since FS v1.0 |
|
244 * @param aBaseItem Access point item. |
|
245 */ |
|
246 TIpsSetUiEventResult HandleAccessPointOpeningL( CIpsSetUiItem& aBaseItem ); |
|
247 |
|
248 /** |
|
249 * @return Access point settings from the item. |
|
250 */ |
|
251 TImIAPChoice GetIapChoiceL( const TUid& aId ) const; |
|
252 |
|
253 /** |
|
254 * Gets IapPrefs from the item. |
|
255 * |
|
256 * @return Access point preferences item. |
|
257 */ |
|
258 CImIAPPreferences& GetIapPrefsL(const TUid& aId); |
|
259 |
|
260 |
|
261 /** |
|
262 * Initialize signature item |
|
263 * |
|
264 * @param aBaseItem Signature item for init |
|
265 */ |
|
266 void InitSignatureL( |
|
267 CIpsSetUiItem& aBaseItem ); |
|
268 |
|
269 /** |
|
270 * Initializes download size items |
|
271 * |
|
272 * @param aBaseItem Download size item |
|
273 * @param aValue Value for initialization |
|
274 */ |
|
275 void InitDownloadSizeL( |
|
276 CIpsSetUiItem& aBaseItem, |
|
277 const TInt aValue ); |
|
278 |
|
279 /** |
|
280 * @param aBaseItem Access point item for initialization |
|
281 */ |
|
282 void InitIapL( CIpsSetUiItem& aBaseItem ); |
|
283 |
|
284 /** |
|
285 * Initializes retrieve limit editors |
|
286 * |
|
287 * @param aBaseItem Editor for initialization. |
|
288 * @param aValue Stored value. |
|
289 */ |
|
290 void InitRetrieve( |
|
291 CIpsSetUiItem& aBaseItem, |
|
292 const TInt aValue ); |
|
293 |
|
294 /** |
|
295 * Initializes hours dialog |
|
296 * |
|
297 * @param aBaseItem Hours item |
|
298 * @param aStartTime Starting hour |
|
299 * @param aStopTime Stop hour |
|
300 */ |
|
301 void InitHoursL( |
|
302 CIpsSetUiItem& aBaseItem, |
|
303 const TInt64 aStartTime, |
|
304 const TInt64 aStopTime ); |
|
305 |
|
306 /** |
|
307 * Initializes roaming item |
|
308 * |
|
309 * @param aBaseItem Roaming item for initialization |
|
310 * @param aValue for initialization |
|
311 */ |
|
312 void InitRoaming( |
|
313 CIpsSetUiItem& aBaseItem, |
|
314 const TInt aValue ); |
|
315 |
|
316 //<cmail> |
|
317 void InitSecuritySetting( |
|
318 CIpsSetUiItem& aBaseItem, |
|
319 const TInt aValue ); |
|
320 |
|
321 //</cmail> |
|
322 |
|
323 /** |
|
324 * Stores the retrieval limit status. |
|
325 */ |
|
326 void StoreRetrievalLimit(); |
|
327 |
|
328 /** |
|
329 * Formats time string for setting item. |
|
330 * |
|
331 * @param aText Return string |
|
332 * @param aStartTime Starting hour |
|
333 * @param aStopTime Stopping hour |
|
334 */ |
|
335 void FormatTimeStringL( |
|
336 TDes& aText, |
|
337 const TInt64 aStartTime, |
|
338 const TInt64 aStopTime ) const; |
|
339 |
|
340 // From base class CIpsSetUiBaseArray |
|
341 |
|
342 /** |
|
343 * @param aBaseItem Item for initialization. |
|
344 */ |
|
345 void InitUserData( CIpsSetUiItem& aBaseItem ); |
|
346 |
|
347 |
|
348 /** |
|
349 * @param aBaseItem Item for initialization. |
|
350 */ |
|
351 void InitUserDataL( CIpsSetUiItem& aBaseItem ); |
|
352 |
|
353 /** |
|
354 * Initializes user name. Should be used for Outgoing setting. |
|
355 * |
|
356 * @param aBaseItem Container for username |
|
357 * @param aLogin Text to be stored |
|
358 */ |
|
359 void InitLogin( |
|
360 CIpsSetUiItem& aBaseItem, |
|
361 const TDesC& aLogin ); |
|
362 |
|
363 /** |
|
364 * Creates array of custom items. |
|
365 * |
|
366 * @param aId Item which stores the array |
|
367 * @return Item which contains the array and ownership to it. |
|
368 */ |
|
369 CIpsSetUiItem* CreateCustomItemToArrayLC( const TUid& aId ); |
|
370 |
|
371 /** |
|
372 * Make hide check including protocol checks. |
|
373 * |
|
374 * @param aItem Item to be checked |
|
375 * @return KErrNotSupported when the item should not be visible |
|
376 */ |
|
377 TInt IsHidden( |
|
378 const CIpsSetUiItem& aItem ) const; |
|
379 |
|
380 // From base class CIpsSetUiBaseDialog |
|
381 |
|
382 /** |
|
383 * Setting page event handling. |
|
384 * |
|
385 * @param aSettingPage Setting page that invokes the event. |
|
386 * @param aEventType Invoked event. |
|
387 */ |
|
388 virtual void HandleSettingPageEventL( |
|
389 CAknSettingPage* aSettingPage, |
|
390 TAknSettingPageEvent aEventType ); |
|
391 |
|
392 /** |
|
393 * Array change event handling. |
|
394 * |
|
395 * @param aBaseItem Item that invoked the event. |
|
396 * @return Result of the event handling. |
|
397 */ |
|
398 virtual TInt EventSubArrayChangeL( |
|
399 CIpsSetUiItem& aBaseItem ); |
|
400 |
|
401 /** |
|
402 * Handles the events, after the settings editor has been closed |
|
403 * |
|
404 * @param aBaseItem Item that has been edited. |
|
405 * @return Result of the handling |
|
406 */ |
|
407 TInt EventItemEditEndsL( CIpsSetUiItem& aBaseItem ); |
|
408 |
|
409 /** |
|
410 * Handles the events, before the settings editor is opened |
|
411 * |
|
412 * @param aBaseItem Item that is going to be edited. |
|
413 * @return Result of the handling |
|
414 */ |
|
415 TIpsSetUiEventResult EventItemEditStartsL( CIpsSetUiItem& aBaseItem ); |
|
416 |
|
417 /** |
|
418 * Launches the multiline editor |
|
419 * |
|
420 * @param aBaseItem Multiline editor item |
|
421 * @param aUpdateMode Editors mode |
|
422 * @return Result of edit |
|
423 */ |
|
424 TIpsSetUiEventResult SettingLaunchMultilineEditorL( |
|
425 CIpsSetUiItem& aBaseItem, |
|
426 TIpsSetUiUpdateMode& aUpdateMode ); |
|
427 |
|
428 // Data |
|
429 |
|
430 /** |
|
431 * Dialog which created the controller. |
|
432 */ |
|
433 CIpsSetUi& iDialog; |
|
434 |
|
435 |
|
436 /** |
|
437 * Message server session. |
|
438 */ |
|
439 CMsvSession& iSession; |
|
440 |
|
441 /** |
|
442 * Flags to control dialog behavior. |
|
443 */ |
|
444 TUint64& iFlags; |
|
445 |
|
446 /** |
|
447 * Data object store. |
|
448 * Owned. |
|
449 */ |
|
450 CIpsSetData* iData; |
|
451 |
|
452 /** |
|
453 * Temporary storage for signature. |
|
454 */ |
|
455 RBuf iSignature; |
|
456 |
|
457 }; |
|
458 |
|
459 #endif // IPSSETUIDIALOG_H |
|
460 |
|
461 // End of File |