|
1 /* |
|
2 * Copyright (c) 2005 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef ASPADVANCESETTINGSDIALOG_H |
|
21 #define ASPADVANCESETTINGSDIALOG_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include "AspDialogUtil.h" |
|
27 |
|
28 #include <e32base.h> |
|
29 #include <aknlists.h> |
|
30 #include <AknDialog.h> |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 |
|
39 /** |
|
40 * CAspAdvanceSettingsDialog |
|
41 * |
|
42 * CAspAdvanceSettingsDialog is used for editing sync connection data. |
|
43 */ |
|
44 NONSHARABLE_CLASS (CAspAdvanceSettingsDialog) : public CAknDialog, public MEikListBoxObserver |
|
45 { |
|
46 public: |
|
47 |
|
48 |
|
49 public: |
|
50 /** |
|
51 * Launches dialog. |
|
52 * @param aParam Class that contains dialog parameters. |
|
53 * @return Completion code. |
|
54 */ |
|
55 static TBool ShowDialogL(); |
|
56 |
|
57 public:// Constructors and destructor |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 */ |
|
62 static CAspAdvanceSettingsDialog* NewL(); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CAspAdvanceSettingsDialog(); |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * C++ default constructor. |
|
73 */ |
|
74 CAspAdvanceSettingsDialog(); |
|
75 |
|
76 /** |
|
77 * By default Symbian OS constructor is private. |
|
78 */ |
|
79 void ConstructL(); |
|
80 |
|
81 private: |
|
82 /** |
|
83 * From MEikListBoxObserver, called by framework. |
|
84 * @param aListBox. |
|
85 * @param aEventType. |
|
86 * @return None |
|
87 */ |
|
88 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
89 |
|
90 /** |
|
91 * From the base class. |
|
92 * Called by framework before the dialog is shown. |
|
93 * @param None |
|
94 * @return None |
|
95 */ |
|
96 void PreLayoutDynInitL(); |
|
97 |
|
98 /** |
|
99 * From the base class. |
|
100 * Called by framework before exiting the dialog. |
|
101 * @param aButtonId Button id. |
|
102 * @return ETrue to exit\ EFalse to not to exit. |
|
103 */ |
|
104 TBool OkToExitL(TInt aButtonId); |
|
105 |
|
106 /** |
|
107 * From the base class. |
|
108 * Called by framework for key event handling. |
|
109 * @param aKeyEvent. |
|
110 * @param aType. |
|
111 * @return Return code. |
|
112 */ |
|
113 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
114 |
|
115 /** |
|
116 * From the base class. |
|
117 * Called by framework when dialog is activated. |
|
118 * @param None. |
|
119 * @return None. |
|
120 */ |
|
121 void ActivateL(); |
|
122 |
|
123 /** |
|
124 * Method to get context sensitive help topic. |
|
125 * @param aContext Help topic to open. |
|
126 * @return None. |
|
127 */ |
|
128 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
129 |
|
130 /** |
|
131 * From the base class. |
|
132 * Called by framework before menu is shown. |
|
133 * @param aResourceId Menu resource id. |
|
134 * @param aMenuPane Pointer to the menu. |
|
135 * @return None. |
|
136 */ |
|
137 void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane); |
|
138 |
|
139 /** |
|
140 * From the base class. |
|
141 * Handles menu events. |
|
142 * @param aCommandId Command id. |
|
143 * @return None. |
|
144 */ |
|
145 void ProcessCommandL(TInt aCommandId); |
|
146 |
|
147 /** |
|
148 * From base class. |
|
149 * Called when UI layout changes. |
|
150 * @param aType. |
|
151 * @return None. |
|
152 */ |
|
153 void HandleResourceChange(TInt aType); |
|
154 |
|
155 private: |
|
156 /** |
|
157 * Handles setting item editing. |
|
158 * @param None. |
|
159 * @return None. |
|
160 */ |
|
161 void HandleOKL(); |
|
162 |
|
163 /** |
|
164 * Set setting list icons. |
|
165 * @param None. |
|
166 * @return None. |
|
167 */ |
|
168 void SetIconsL(); |
|
169 |
|
170 |
|
171 public: // common editors |
|
172 |
|
173 /** |
|
174 * Shows editor for list type setting. |
|
175 * @param aItem Setting item data. |
|
176 * @return Return code. |
|
177 */ |
|
178 static TBool EditSettingItemListL(CAspListItemData& aItem); |
|
179 /** |
|
180 * Checks whether MSK label and menu command are correct for the context |
|
181 * @param aKeyEvent |
|
182 * @return None. |
|
183 */ |
|
184 void CheckContentSettingL(const TKeyEvent& aKeyEvent); |
|
185 /** |
|
186 * Checks whether MSK label and menu command are correct for the context |
|
187 * @param None |
|
188 * @return None. |
|
189 */ |
|
190 void CheckContentSettingL(); |
|
191 /** |
|
192 * Utility function, updates dialog cba. |
|
193 * @param aResourceId. |
|
194 * @return None. |
|
195 */ |
|
196 void UpdateCbaL(TInt aResourceId); |
|
197 |
|
198 /** |
|
199 * Utility function, updates menu bar. |
|
200 * @param aResource. |
|
201 * @return None. |
|
202 */ |
|
203 |
|
204 void UpdateMenuL(TInt aResource); |
|
205 |
|
206 |
|
207 |
|
208 private: |
|
209 |
|
210 /** |
|
211 * Handles setting item editing. |
|
212 * @param aItem Setting item data. |
|
213 * @return Return code. |
|
214 */ |
|
215 TBool EditSettingItemL(CAspListItemData& aItem); |
|
216 |
|
217 /** |
|
218 * Set the MSK empty. |
|
219 * @param None. |
|
220 * @return None. |
|
221 */ |
|
222 void SetEmptyMiddleSoftKeyLabelL(); |
|
223 |
|
224 private: |
|
225 |
|
226 /** |
|
227 * Check setting values before dialog close. |
|
228 * @param aButtonId Button id. |
|
229 * @return ETrue to exit\ EFalse to not to exit. |
|
230 */ |
|
231 TBool CheckSettingValuesL(TInt aButtonId); |
|
232 |
|
233 /** |
|
234 * Check setting values before dialog close. |
|
235 * @param aButtonId Button id. |
|
236 * @return ETrue to exit\ EFalse to not to exit. |
|
237 */ |
|
238 TBool CheckSettingValues(TInt aButtonId); |
|
239 |
|
240 |
|
241 private: |
|
242 /** |
|
243 * Create one CNSmlDSProfileData for each setting. |
|
244 * @param None. |
|
245 * @return None. |
|
246 */ |
|
247 void CreateSettingsListL(); |
|
248 |
|
249 /** |
|
250 * Initalizes setting item needed for listbox handling. |
|
251 * @param aItem. |
|
252 * @return None. |
|
253 */ |
|
254 void InitSettingItemL(CAspListItemData* aItem); |
|
255 |
|
256 /** |
|
257 * Add settings titles into listbox. |
|
258 * @param aListBox. |
|
259 * @param aItemList List of setting items. |
|
260 * @return None. |
|
261 */ |
|
262 void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList); |
|
263 |
|
264 /** |
|
265 * Adds one setting item into item list. |
|
266 * @param aItemId Item id. |
|
267 * @param aHeaders Array of item headers. |
|
268 * @return None. |
|
269 */ |
|
270 void AddItemL(TInt aItemId, CDesCArray* aHeaders); |
|
271 /** |
|
272 * Adds one setting item into item list. |
|
273 * @param aItemId Item id. |
|
274 * @param aResourceId. |
|
275 * @return None. |
|
276 */ |
|
277 void AddItemL(TInt aItemId, TInt aResourceId); |
|
278 |
|
279 /** |
|
280 * Set setting item visibility (normal/readonly/hidden). |
|
281 * @param None. |
|
282 * @return None. |
|
283 */ |
|
284 void SetVisibility(); |
|
285 |
|
286 private: |
|
287 |
|
288 void WriteRepositoryL(TInt aKey, const TInt& aValue); |
|
289 |
|
290 void ReadRepositoryL(TInt aKey, TInt& aValue); |
|
291 |
|
292 /** |
|
293 * Creates icon. |
|
294 * @param aId. |
|
295 * @param aFileName. |
|
296 * @param aFileIndex. |
|
297 * @param aFileMaskIndex. |
|
298 * @return Created icon. |
|
299 */ |
|
300 CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex); |
|
301 |
|
302 /** |
|
303 * Returns setting item with listbox position aIndex. |
|
304 * @param aIndex Listbox index. |
|
305 * @return Pointer to setting item. |
|
306 */ |
|
307 CAspListItemData* GetItemForIndex(TInt aIndex); |
|
308 |
|
309 /** |
|
310 * Returns setting item with id aItemId. |
|
311 * @param aItemId Item id. |
|
312 * @return Pointer to setting item. |
|
313 */ |
|
314 CAspListItemData* Item(TInt aItemId); |
|
315 |
|
316 /** |
|
317 * Returns listbox. |
|
318 * @param None. |
|
319 * @return Pointer to listbox. |
|
320 */ |
|
321 CAknSettingStyleListBox* ListBox(); |
|
322 |
|
323 /** |
|
324 * Returns profile. |
|
325 * @param None. |
|
326 * @return Pointer to sync profile. |
|
327 */ |
|
328 //CAspProfile* Profile(); |
|
329 |
|
330 |
|
331 private: |
|
332 // setting list |
|
333 CAknSettingStyleListBox* iSettingListBox; |
|
334 |
|
335 // list of setting items |
|
336 CAspSettingList *iSettingList; |
|
337 |
|
338 // list that contains all contents (applications) |
|
339 //CAspContentList* iContentList; |
|
340 |
|
341 // profile data |
|
342 CAspProfile* iProfile; |
|
343 |
|
344 // sync session |
|
345 RSyncMLSession* iSyncSession; |
|
346 |
|
347 // for title and icon handling |
|
348 CStatusPaneHandler* iStatusPaneHandler; |
|
349 |
|
350 // resource handler |
|
351 CAspResHandler* iResHandler; |
|
352 |
|
353 // dialog edit mode |
|
354 TInt iEditMode; |
|
355 |
|
356 // for bearer type list construction |
|
357 CAspBearerHandler* iBearerHandler; |
|
358 |
|
359 // for access point selection |
|
360 CAspAccessPointHandler* iApHandler; |
|
361 |
|
362 // long buffer for string handling |
|
363 TBuf<KBufSize255> iBuf; |
|
364 |
|
365 // list that contains all contents (applications) |
|
366 CAspContentList* iContentList; |
|
367 |
|
368 // list that contains all profiles |
|
369 CAspProfileList* iProfileList; |
|
370 |
|
371 // id of the calling application |
|
372 TInt iApplicationId; |
|
373 |
|
374 // is setting database in read only state |
|
375 TBool iSettingEnforcement; |
|
376 // profile's server id |
|
377 TBuf<KAspMaxServerIdLength> iOldServerId; |
|
378 // id of current cba resource |
|
379 TInt iCommandSetId; |
|
380 // is MSK empty |
|
381 TBool iDefConnSupported; |
|
382 TBool iMSKEmpty; |
|
383 }; |
|
384 |
|
385 |
|
386 #endif // ASPPROFILEDIALOG_H |
|
387 |
|
388 // End of File |