|
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: Dialog for application local settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCAAPPSETTINGSDIALOG_H |
|
20 #define CCAAPPSETTINGSDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <akndialog.h> |
|
24 #include <bldvariant.hrh> |
|
25 #include <eiklbo.h> |
|
26 #include "MCAUiSettingsDialogCmdCB.h" |
|
27 #include "MCASettingSapExt.h" |
|
28 #include "MCASettingsPC.h" |
|
29 #include "MCASettingsCommand.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CAknSettingItemArray; |
|
33 class CCAStatusPaneHandler; |
|
34 class CAknSettingStyleListBox; |
|
35 class CCAUISessionManager; |
|
36 class CAknSettingItem; |
|
37 class CIMPSSAPSettings; |
|
38 class CIMPSSAPSettingsStore; |
|
39 class CRepository; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * Application settings dialog |
|
45 * Implements the dialog that is used with application settings |
|
46 * |
|
47 * @lib chatng.app |
|
48 */ |
|
49 class CCAAppSettingsDialog : public CAknDialog, |
|
50 public MEikListBoxObserver, |
|
51 public MCAUiSettingsDialogCmdCB |
|
52 { |
|
53 private: // Enumerations |
|
54 |
|
55 //Setting items' indexes |
|
56 enum TSettingListLayout |
|
57 { |
|
58 ENickName = 0, |
|
59 EAuthorizePresence, |
|
60 EReceiveIMessages, |
|
61 EReceiveInvitations, |
|
62 EMessageFlow, |
|
63 EContactOrdering, |
|
64 EFriendsListUpdate, |
|
65 EContactsToBeReloaded, |
|
66 EAutoLogin, |
|
67 EAliasName, |
|
68 EShowOffline, |
|
69 EOwnColor, |
|
70 EOtherColor, |
|
71 EMessageTone, |
|
72 EShowTimeStamp, |
|
73 ELastItemMarker |
|
74 }; |
|
75 |
|
76 public: // Constructors and destructor |
|
77 |
|
78 /** |
|
79 * C++ default constructor. |
|
80 * @param aTitleBar Reference to status-pane handler |
|
81 * @param aSettings Reference to settings API |
|
82 */ |
|
83 CCAAppSettingsDialog( CCAStatusPaneHandler& aTitleBar, |
|
84 MCASettingsPC& aSettingsPC, |
|
85 CCAUISessionManager& aUISessionManager, |
|
86 CIMPSSAPSettings* aServer ); |
|
87 |
|
88 /** |
|
89 * Destructor. |
|
90 */ |
|
91 virtual ~CCAAppSettingsDialog(); |
|
92 |
|
93 public: // New methods |
|
94 |
|
95 /** |
|
96 * Method which is called with async callback |
|
97 * @param aInstance Object which is called |
|
98 * @return EFalse |
|
99 */ |
|
100 static TInt CallBack( TAny* aInstance ); |
|
101 |
|
102 /** |
|
103 * Real callback handler. Launches dialogs. |
|
104 * @return EFalse |
|
105 */ |
|
106 TInt DoHandleCallBackL(); |
|
107 |
|
108 void GetParameters( MCAUiSettingsDialogCmdCB::TSettingsDialogParams& aSettingsDialogParams ); |
|
109 |
|
110 /** |
|
111 * Help Key Support |
|
112 * This function is called by the Framework to get the context to launch |
|
113 * Help |
|
114 * |
|
115 * @param aContext The context that contains the appid and the help id. |
|
116 */ |
|
117 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
118 |
|
119 /** |
|
120 * Set the status of a dialog |
|
121 * @param aContext The status whether a dialog is shown |
|
122 */ |
|
123 void SetIsTargetDialogOpened( TBool aBool ); |
|
124 |
|
125 /** |
|
126 * Get the status of a dialog |
|
127 * @return Dialog status |
|
128 */ |
|
129 TBool GetIsTargetDialogOpened(); |
|
130 private: //From MEikCommandObserver |
|
131 |
|
132 /** |
|
133 * From MEikCommandObserver Command handler |
|
134 * @since 1.2 |
|
135 * @param aCommand Command that was initiated |
|
136 */ |
|
137 void ProcessCommandL( TInt aCommand ); |
|
138 |
|
139 private: // Functions from MEikListBoxObserver |
|
140 |
|
141 /** |
|
142 * From MEikListBoxObserver Callback for listbox events |
|
143 * @since 1.2 |
|
144 * @param aListBox Originating listbox |
|
145 * @param aEventType Event type |
|
146 */ |
|
147 void HandleListBoxEventL( CEikListBox* aListBox, |
|
148 TListBoxEvent aEventType ); |
|
149 |
|
150 private: // Functions from CCoeControl |
|
151 |
|
152 /** |
|
153 * Called by framework when system wide resources are changed. |
|
154 * @since 3.1 |
|
155 */ |
|
156 void HandleResourceChange( TInt aType ); |
|
157 |
|
158 /** |
|
159 * From CCoeControl |
|
160 * @see CCoeControl for more information |
|
161 */ |
|
162 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
163 TEventCode aType ); |
|
164 |
|
165 /** |
|
166 * From CEikDialog |
|
167 * @see CEikDialog for more information |
|
168 */ |
|
169 void DisplayMenuL(); |
|
170 protected: // Functions from CEikDialog |
|
171 |
|
172 /** |
|
173 * From MEikMenuObserver |
|
174 * @see MEikMenuObserver |
|
175 */ |
|
176 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
177 |
|
178 /** |
|
179 * From CEikDialog |
|
180 * @see CEikDialog for more information |
|
181 */ |
|
182 void PreLayoutDynInitL(); |
|
183 |
|
184 /** |
|
185 * From CEikDialog |
|
186 * @see CEikDialog for more information |
|
187 */ |
|
188 TBool OkToExitL( TInt aButtonId ); |
|
189 |
|
190 private: //New methods |
|
191 |
|
192 |
|
193 /** |
|
194 * Lauches text-setting-page |
|
195 * @since 1.2 |
|
196 */ |
|
197 void DisplayTextSettingPageL(); |
|
198 |
|
199 |
|
200 /** |
|
201 * Adds binary-type item to settings array |
|
202 * @since 1.2 |
|
203 * @param aBuffer Buffer for setting value |
|
204 * @param aId Resource id for the associated values and texts |
|
205 * @param aTitleResource Title text's resource id |
|
206 * @param aSettingPageResource Setting page's resource id |
|
207 * @param aAssociatedResource Associated resource |
|
208 * @see CAknSettingItem for more information about parameters |
|
209 */ |
|
210 void AddBinaryItemL( TBool& aBuffer, |
|
211 TInt aId, |
|
212 TInt aTitleResource, |
|
213 TInt aSettingPageResource, |
|
214 TInt aAssociatedResource ); |
|
215 |
|
216 /** |
|
217 * Adds enumerated text-type item to settings array |
|
218 * @since 2.1 |
|
219 * @param aBuffer Buffer for setting value |
|
220 * @param aId Resource id for the associated values and texts |
|
221 * @param aTitleResource Title text's resource id |
|
222 * @param aSettingPageResource Setting page's resource id |
|
223 * @param aAssociatedResource Associated resource |
|
224 * @see CAknSettingItem for more information about parameters |
|
225 */ |
|
226 void AddEnumTextItemL( TInt& aBuffer, |
|
227 TInt aId, |
|
228 TInt aTitleResource, |
|
229 TInt aSettingPageResource, |
|
230 TInt aAssociatedResource ); |
|
231 |
|
232 /** |
|
233 * Adds colour setting item to settings array. |
|
234 * @since S60 v3.2 |
|
235 * @param aKey Key for key-value pair in SAP settings, |
|
236 used to get colour information from SAP settings. |
|
237 * @param aBuffer Buffer for setting value. |
|
238 * @param aId Resource id for the associated values and texts. |
|
239 * @param aTitleResource Title text's resource id. |
|
240 * @param aSettingPageResource Setting page's resource id. |
|
241 * @see CAknSettingItem for more information about parameters. |
|
242 */ |
|
243 void AddColourItemL( |
|
244 const TDesC& aKey, |
|
245 TBool& aBuffer, |
|
246 TInt aId, |
|
247 TInt aTitleResource ); |
|
248 |
|
249 /** |
|
250 * Stores the values of setting items to persistent storage |
|
251 * @since 1.2 |
|
252 */ |
|
253 void StoreValuesL(); |
|
254 |
|
255 /** |
|
256 * Handles the errorcodes, leaves on non-CSP error codes |
|
257 * @since 2.5 |
|
258 */ |
|
259 void HandleErrorL( TInt aErrorCode ); |
|
260 |
|
261 /** |
|
262 * Externalizes the values of setting items' iternal buffers |
|
263 * @since 1.2 |
|
264 */ |
|
265 void StoreAllL() const; |
|
266 |
|
267 /** |
|
268 * Updates title-pane text with text found from given resource id |
|
269 * @param aResourceId Resource id for text |
|
270 * @since 1.2 |
|
271 */ |
|
272 void UpdateTitlePaneL( const TInt aResourceId ); |
|
273 |
|
274 /** |
|
275 * Handle CBA change. |
|
276 * @param aResourceId. Id for resource to use. |
|
277 * @since 2.8 |
|
278 */ |
|
279 void HandleCBAChangeL( const TInt aResourceId ); |
|
280 |
|
281 /** |
|
282 * Adds tone setting item to setting item array |
|
283 */ |
|
284 void AddToneSettingItemL( TBool aBranded ); |
|
285 |
|
286 |
|
287 private: // Data |
|
288 |
|
289 // Owns. Array for setting items |
|
290 CAknSettingItemArray* iSettingItemArray; |
|
291 |
|
292 // Doesn't own. Pointer to status-pane handler |
|
293 CCAStatusPaneHandler* iTitlePane; |
|
294 |
|
295 |
|
296 //Doesn't own |
|
297 CCAUISessionManager* iUISessionManager; |
|
298 // Doesn't own. Pointer to listbox in settings dialog |
|
299 CAknSettingStyleListBox* iListbox; |
|
300 |
|
301 // Flag for default nickname usage |
|
302 TBool iDefaultNick; |
|
303 TBool iOldDefaultNick; |
|
304 |
|
305 // Enum for authorizing IM presence |
|
306 TInt iAuthorizeIMPr; |
|
307 TInt iOldAuthorizeIMPr; |
|
308 |
|
309 // Enum for receiving instant messages |
|
310 TInt iReceiveIMessages; |
|
311 TInt iOldReceiveIMessages; |
|
312 |
|
313 // Enum for receiving invitations |
|
314 TInt iReceiveInvitations; |
|
315 TInt iOldReceiveInvitations; |
|
316 |
|
317 // Value for message flow |
|
318 TInt iMsgFlow; |
|
319 TInt iOldMsgFlow; |
|
320 |
|
321 // Flag for contact list ordering |
|
322 TBool iOrderAlphabetically; |
|
323 TBool iOldOrderAlphabetically; |
|
324 |
|
325 // Flag for automatic friends-list update |
|
326 TBool iAutoUpdFriends; |
|
327 TBool iOldAutoUpdFriends; |
|
328 |
|
329 // Owns. Buffer for default nickname |
|
330 HBufC* iDefaultNickName; |
|
331 HBufC* iOldDefaultNickName; |
|
332 |
|
333 |
|
334 //owns. Buffer for tone filename |
|
335 HBufC* iToneFileName; |
|
336 TPtr iToneFileNamePtr; |
|
337 TBool iToneFileInUse; |
|
338 //Tells if branded tones are in use |
|
339 TInt iBrandedTones; |
|
340 |
|
341 // "show offline contacts" |
|
342 TBool iShowOffline; |
|
343 TBool iOldShowOffline; |
|
344 |
|
345 // is own/other message color defined |
|
346 TBool iOwnColorDefined; |
|
347 TBool iOthersColorDefined; |
|
348 |
|
349 // Show timestamp settings item |
|
350 TBool iOldShowTimeStamp; |
|
351 TBool iShowTimeStamp; |
|
352 |
|
353 // Ordinal number that is used to layout the dialog correctly |
|
354 TInt iOrdinal; |
|
355 |
|
356 MCASettingSapExt* iSAPExtension; |
|
357 |
|
358 // Doesn't own. Pointer to settings API |
|
359 MCASettingsPC* iSettingsPC; |
|
360 // async callback for showing dialogs |
|
361 CAsyncCallBack* iAsyncCallBack; |
|
362 |
|
363 // settingitem index which will be edited with callback |
|
364 TInt iEditIndex; |
|
365 |
|
366 // Is edit dialog launched from menu (ETrue) |
|
367 TBool iIsPopUp; |
|
368 |
|
369 // Not owned. the server whose settings we show |
|
370 CIMPSSAPSettings* iServer; |
|
371 |
|
372 // Not owned. Pointer to message flow setting item |
|
373 CAknSettingItem* iFlowSettingItem; |
|
374 |
|
375 // owns. |
|
376 CRepository* iCenRep; |
|
377 MCASettingsCommand* iCommandSetings; |
|
378 |
|
379 TBool iIsEditItemFlag; |
|
380 |
|
381 TBool iIsTargetDialogOpened; |
|
382 |
|
383 TBool iSavingFlag; |
|
384 }; |
|
385 |
|
386 #endif // CCAAPPSETTINGSDIALOG_H |
|
387 |
|
388 // End of File |