65
|
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 the License "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 |
* Container of the information about the active settings
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef SETTINGS_CONTAINER_H
|
|
21 |
#define SETTINGS_CONTAINER_H
|
|
22 |
|
|
23 |
// INCLUDE FILES
|
|
24 |
#include <coecntrl.h>
|
|
25 |
#include <coemop.h>
|
|
26 |
#include <AknLists.h>
|
|
27 |
|
|
28 |
// CONSTANTS
|
|
29 |
const TInt KWmlSettingsIndexNone = -1;
|
|
30 |
const TInt KWmlSettingsItemMaxLength = 100;
|
|
31 |
|
|
32 |
// FORWARD DECLARATION
|
|
33 |
class MApiProvider;
|
|
34 |
class CAknNavigationDecorator;
|
|
35 |
class CAknSettingStyleListBox;
|
|
36 |
|
|
37 |
|
|
38 |
struct TEncodingStruct
|
|
39 |
{
|
|
40 |
TUint32 iSystemId; // System id of the encoding (CHARCONV.h)
|
|
41 |
TUint32 iResId; // Resource string id
|
|
42 |
};
|
|
43 |
|
|
44 |
// CLASS DECLARATION
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Container of the settings view
|
|
48 |
* @since 1.2
|
|
49 |
*/
|
|
50 |
class CSettingsContainer : public CCoeControl, public MEikListBoxObserver
|
|
51 |
{
|
|
52 |
public: // construction, destruction
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Two-phased constructor.
|
|
56 |
* @since 1.2
|
|
57 |
* @param aRect Rectangle.
|
|
58 |
* @param aPreferences Preferences.
|
|
59 |
* @param aCommsModel Comms model.
|
|
60 |
*/
|
|
61 |
static CSettingsContainer* NewLC(
|
|
62 |
const TRect& aRect,
|
|
63 |
MApiProvider& aApiProvider,
|
|
64 |
MObjectProvider& aMopParent
|
|
65 |
);
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Two-phased constructor.
|
|
69 |
* @since 1.2
|
|
70 |
* @param aRect Rectangle.
|
|
71 |
* @param aPreferences Preferences.
|
|
72 |
* @param aCommsModel Comms model.
|
|
73 |
*/
|
|
74 |
static CSettingsContainer* NewL(
|
|
75 |
const TRect& aRect,
|
|
76 |
MApiProvider& aApiProvider,
|
|
77 |
MObjectProvider& aMopParent
|
|
78 |
);
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Destructor.
|
|
82 |
*/
|
|
83 |
virtual ~CSettingsContainer();
|
|
84 |
|
|
85 |
private: // constructor
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Constructor.
|
|
89 |
* @param aPreferences Preferences.
|
|
90 |
* @param aCommsModel Comms model.
|
|
91 |
*/
|
|
92 |
CSettingsContainer
|
|
93 |
( MApiProvider& aApiProvider, MObjectProvider& aMopParent );
|
|
94 |
|
|
95 |
/**
|
|
96 |
* By default constructor is private.
|
|
97 |
*/
|
|
98 |
void ConstructL( const TRect& aRect );
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Inherited functions
|
|
102 |
*/
|
|
103 |
public: // from CCoeControl
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Count component controls.
|
|
107 |
* @since 1.2
|
|
108 |
* @return Number of component controls.
|
|
109 |
*/
|
|
110 |
virtual TInt CountComponentControls() const;
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Handles focus changing
|
|
114 |
* @param aDrawNow
|
|
115 |
*/
|
|
116 |
void FocusChanged( TDrawNow aDrawNow );
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Handle resource change.
|
|
120 |
* @param aType Event type.
|
|
121 |
*/
|
|
122 |
void HandleResourceChange( TInt aType );
|
|
123 |
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Get a component control by index.
|
|
127 |
* @since 1.2
|
|
128 |
* @param aIndex Index of component control to be returned.
|
|
129 |
* @return Component control or NULL.
|
|
130 |
*/
|
|
131 |
virtual CCoeControl* ComponentControl( TInt aIndex ) const;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Handle size change, lay out and draw components.
|
|
135 |
* @since 1.2
|
|
136 |
*/
|
|
137 |
virtual void SizeChanged();
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Handle key event. Forwards all key events to the listbox, if present.
|
|
141 |
* @since 1.2
|
|
142 |
* @param aKeyEvent The key event.
|
|
143 |
* @param aType Key event type.
|
|
144 |
* @return Response (was the key event consumed?).
|
|
145 |
*/
|
|
146 |
virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
|
|
147 |
|
|
148 |
/**
|
|
149 |
* HandleListBoxEventL
|
|
150 |
* From CCoeControl
|
|
151 |
*
|
|
152 |
*/
|
|
153 |
void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
|
|
154 |
|
|
155 |
/**
|
|
156 |
* HandleGainingForegroundL
|
|
157 |
* Handles Foreground Event.
|
|
158 |
*/
|
|
159 |
void HandleGainingForegroundL();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* New functions
|
|
163 |
*/
|
|
164 |
public:
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Handles selection key or menu command to change value of an item.
|
|
168 |
* @since 1.2
|
|
169 |
*/
|
|
170 |
void ChangeItemL( TBool aSelectKeyWasPressed );
|
|
171 |
|
|
172 |
MApiProvider& ApiProvider() { return iApiProvider; }
|
|
173 |
|
|
174 |
/**
|
|
175 |
* Opens the appropriate setting list e.g. Page
|
|
176 |
* @since 3.1
|
|
177 |
*/
|
|
178 |
void DisplayCorrectSettingCategoryListL();
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Closes the current setting list, if the main list,
|
|
182 |
* then leaves settings
|
|
183 |
* @return ETrue if settings lists are closed EFalse if still open
|
|
184 |
* @since 3.1
|
|
185 |
*/
|
|
186 |
TBool CloseSettingsListL();
|
|
187 |
|
|
188 |
|
|
189 |
/**
|
|
190 |
* Checks for errors in settings values
|
|
191 |
* @return ETrue if settings values are set incorrectly
|
|
192 |
* @since 5.0
|
|
193 |
*/
|
|
194 |
TBool SettingsError();
|
|
195 |
|
|
196 |
|
|
197 |
/**
|
|
198 |
* Indicates if a setting item is modifiable
|
|
199 |
*
|
|
200 |
* @return TInt
|
|
201 |
* @since 3.1
|
|
202 |
*/
|
|
203 |
TBool IsSettingModifiable() const;
|
|
204 |
|
|
205 |
|
|
206 |
/**
|
|
207 |
* Saves changes made by the user to the ini file
|
|
208 |
* @since 1.2
|
|
209 |
*/
|
|
210 |
void SaveChangesL();
|
|
211 |
|
|
212 |
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Shows the main setting categories in a list box
|
|
216 |
* @since 3.1
|
|
217 |
*/
|
|
218 |
void DisplaySettingCategoriesL();
|
|
219 |
|
|
220 |
void DisplayGeneralSettingsL();
|
|
221 |
void DisplayPageSettingsL();
|
|
222 |
void DisplayPrivacySettingsL();
|
|
223 |
void DisplayWebFeedsSettingsL();
|
|
224 |
void DisplayToolbarSettingsL();
|
|
225 |
void DisplayShortcutsSettingsL();
|
|
226 |
|
|
227 |
/**
|
|
228 |
* New functions
|
|
229 |
*/
|
|
230 |
private:
|
|
231 |
TInt SetToolbarButtonValues(CArrayFixFlat<TInt> *values, TInt value, CArrayFixFlat<TInt> *displaymap);
|
|
232 |
TInt SetShortcutKeysValues(CArrayFixFlat<TInt> *values, TInt value, CArrayFixFlat<TInt> *displaymap);
|
|
233 |
|
|
234 |
void AddCategoryListBoxItemL( TInt aResourceId, CDesCArray& aList );
|
|
235 |
void ClearListBoxContentL();
|
|
236 |
void StoreListBoxIndexL();
|
|
237 |
void RestoreListBoxIndexL();
|
|
238 |
|
|
239 |
// Methods for adding settings to the settings lists
|
|
240 |
|
|
241 |
//---------------------------------------------------------------------
|
|
242 |
// General Settings
|
|
243 |
void AppendDefaultAccessPointL( CDesCArray*& aItemArray,
|
|
244 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
245 |
|
|
246 |
void AppendHomePageL( CDesCArray*& aItemArray,
|
|
247 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
248 |
|
|
249 |
void AppendPageOverviewL( CDesCArray*& aItemArray,
|
|
250 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
251 |
|
|
252 |
void AppendBackListL( CDesCArray*& aItemArray,
|
|
253 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
254 |
void AppendURLSuffixListL( CDesCArray*& aItemArray,
|
|
255 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
256 |
void AppendHttpSecurityWarningsL( CDesCArray*& aItemArray,
|
|
257 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
258 |
|
|
259 |
void AppendEcmaL( CDesCArray*& aItemArray,
|
|
260 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
261 |
|
|
262 |
void AppendScriptLogL( CDesCArray*& aItemArray,
|
|
263 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
264 |
|
|
265 |
void AppendDownloadsOpenL( CDesCArray*& aItemArray,
|
|
266 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
267 |
|
|
268 |
void AppendSearchProviderL( CDesCArray*& aItemArray,
|
|
269 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
270 |
//---------------------------------------------------------------------
|
|
271 |
// Page Settings
|
|
272 |
void AppendAutoLoadContentL( CDesCArray*& aItemArray,
|
|
273 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
274 |
|
|
275 |
void AppendAutoFullScreenL( CDesCArray*& aItemArray,
|
|
276 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
277 |
|
|
278 |
void AppendAutoMediaVolumeL( CDesCArray*& aItemArray,
|
|
279 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
280 |
|
|
281 |
void AppendEncodingL( CDesCArray*& aItemArray,
|
|
282 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
283 |
|
|
284 |
void AppendPopupBlockingL( CDesCArray*& aItemArray,
|
|
285 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
286 |
|
|
287 |
void AppendAutoRefreshL( CDesCArray*& aItemArray,
|
|
288 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
289 |
|
|
290 |
void AppendFontSizeL( CDesCArray*& aItemArray,
|
|
291 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
292 |
|
|
293 |
TInt GetFontSizeString();
|
|
294 |
|
|
295 |
|
|
296 |
//---------------------------------------------------------------------
|
|
297 |
// Toolbar Settings
|
|
298 |
void AppendToolbarOnOffL( CDesCArray*& aItemArray,
|
|
299 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
300 |
|
|
301 |
void AppendToolbarButtonsL( CDesCArray*& aItemArray,
|
|
302 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
303 |
|
|
304 |
void AppendShortcutKeysL( CDesCArray*& aItemArray,
|
|
305 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
306 |
|
|
307 |
//---------------------------------------------------------------------
|
|
308 |
// Privacy Settings
|
|
309 |
void AppendAdaptiveBookmarksL( CDesCArray*& aItemArray,
|
|
310 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
311 |
|
|
312 |
void AppendFormDataSavingL( CDesCArray*& aItemArray,
|
|
313 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
314 |
|
|
315 |
void AppendCookiesL( CDesCArray*& aItemArray,
|
|
316 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
317 |
|
|
318 |
void AppendIMEIL( CDesCArray*& aItemArray,
|
|
319 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
320 |
|
|
321 |
//---------------------------------------------------------------------
|
|
322 |
// Web feeds Settings
|
|
323 |
void AppendAutomaticUpdatingAPL( CDesCArray*& aItemArray,
|
|
324 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
325 |
|
|
326 |
void AppendAutomaticUpdatingWhileRoamingL( CDesCArray*& aItemArray,
|
|
327 |
TBuf<KWmlSettingsItemMaxLength>& aItemText );
|
|
328 |
//---------------------------------------------------------------------
|
|
329 |
//
|
|
330 |
/**
|
|
331 |
* Pops up a custom dialog to allow user to set setting items
|
|
332 |
*/
|
|
333 |
TInt ShowRadioButtonSettingPageL( TInt aTitle,
|
|
334 |
CArrayFixFlat<TInt>* aValues,
|
|
335 |
TInt aCurrentItem );
|
|
336 |
|
|
337 |
|
|
338 |
/**
|
|
339 |
* Pops up a custom dialog to allow user to set setting items
|
|
340 |
*/
|
|
341 |
TBool ShowRadioButtonSettingPageBoolL( TInt aTitle,
|
|
342 |
CArrayFixFlat<TInt>* aValues,
|
|
343 |
TInt* aCurrentItem );
|
|
344 |
|
|
345 |
/**
|
|
346 |
* Appends two text from resources to display it on lisbox
|
|
347 |
*/
|
|
348 |
void CreateItemFromTwoStringsL(
|
|
349 |
TInt aFirst,
|
|
350 |
TInt aSecond,
|
|
351 |
TBuf<KWmlSettingsItemMaxLength>& aResult);
|
|
352 |
|
|
353 |
TInt MapCurrentItem( TUint aCurrentItem ) const;
|
|
354 |
|
|
355 |
/**
|
|
356 |
* Gets encoding information as parameters.
|
|
357 |
* Creates an encoding object and add the new object to iEncodingArray.
|
|
358 |
*/
|
|
359 |
void AddEncodingL( TUint32 aSystemId, TUint32 aResId );
|
|
360 |
|
|
361 |
/**
|
|
362 |
* Add encodings here.
|
|
363 |
* To add or remove encodings modify this function!
|
|
364 |
*/
|
|
365 |
void CreateEncodingArrayL();
|
|
366 |
|
|
367 |
/**
|
|
368 |
* Check if the added encodings are supported by the system. Removes those that are not.
|
|
369 |
*/
|
|
370 |
void RemoveUnsupportedEncodingsL();
|
|
371 |
|
|
372 |
/**
|
|
373 |
* Notify BrowserControl that a setting has been changed in the UI
|
|
374 |
*/
|
|
375 |
void NotifySettingChanged( TInt aSettingItem, TInt aSettingValue );
|
|
376 |
|
|
377 |
/**
|
|
378 |
* Query user to delete Form data plus Password data
|
|
379 |
*/
|
|
380 |
void ShowFormDataDeleteAllQueryDialogL( );
|
|
381 |
/**
|
|
382 |
* Query user to delete Form Password data
|
|
383 |
*/
|
|
384 |
void ShowFormDataDeletePasswordQueryDialogL( );
|
|
385 |
|
|
386 |
/**
|
|
387 |
* Query user to select fromm user defined AP
|
|
388 |
*/
|
|
389 |
void SelectUserDefinedAPL( TUint32& id );
|
|
390 |
|
|
391 |
/**
|
|
392 |
* Launch Search Application Settings View.
|
|
393 |
*/
|
|
394 |
void RunSearchSettingsL();
|
|
395 |
|
|
396 |
#ifdef __SERIES60_HELP
|
|
397 |
/**
|
|
398 |
* Get help context for the control.
|
|
399 |
* @param aContext The context that is filled in.
|
|
400 |
* @return None.
|
|
401 |
*/
|
|
402 |
void GetHelpContext( TCoeHelpContext& aContext ) const;
|
|
403 |
|
|
404 |
#endif // __SERIES60_HELP
|
|
405 |
|
|
406 |
private:
|
|
407 |
|
|
408 |
// Media Volume indices
|
|
409 |
enum TMediaVolumeIndices
|
|
410 |
{
|
|
411 |
EVolumeMute = 0,
|
|
412 |
EVolumeLevel1,
|
|
413 |
EVolumeLevel2,
|
|
414 |
EVolumeLevel3,
|
|
415 |
EVolumeLevel4
|
|
416 |
};
|
|
417 |
|
|
418 |
enum TSettingCategory
|
|
419 |
{
|
|
420 |
EMain = 0,
|
|
421 |
EGeneral,
|
|
422 |
EPrivacy,
|
|
423 |
EPage,
|
|
424 |
EWebFeeds,
|
|
425 |
EToolbar,
|
|
426 |
EShortCuts,
|
|
427 |
ENone
|
|
428 |
};
|
|
429 |
|
|
430 |
private: // members
|
|
431 |
|
|
432 |
MApiProvider& iApiProvider; // not owned
|
|
433 |
CAknNavigationDecorator* iNaviDecorator; // not owned
|
|
434 |
|
|
435 |
// Settings List Box related members
|
|
436 |
CAknSettingStyleListBox* iSettingListBox; // OWNED
|
|
437 |
CArrayFixFlat<TUint>* iSettingIndex; // OWNED
|
|
438 |
TInt iMainSettingCurrentIndex; // hold the most recent index in the main setting list box
|
|
439 |
TInt iMainSettingTopPosIndex;
|
|
440 |
TInt iSubSettingCurrentIndex; // hold the most recent index in the sub setting list boxes
|
|
441 |
TInt iSubSettingTopPosIndex;
|
|
442 |
TBool iActionCancelled;
|
|
443 |
TBool iPenEnabled; // stores platform pen enabled flag value
|
|
444 |
|
|
445 |
TSettingCategory iCurrentSettingCategory;
|
|
446 |
|
|
447 |
// The settings are only updated when we leave the settings
|
|
448 |
// view to avoid unnecessary redraws
|
|
449 |
TInt iFontSize;
|
|
450 |
TUint32 iEncoding;
|
|
451 |
TBool iTextWrap;
|
|
452 |
|
|
453 |
// Holds a 'list' of all encodings
|
|
454 |
CArrayFixFlat<TEncodingStruct>* iEncodingArray; // OWNED
|
|
455 |
TBool iSelectionKeyDownPressed;
|
|
456 |
|
|
457 |
TBool iFlashPluginPresent;
|
|
458 |
};
|
|
459 |
|
|
460 |
#endif // SETTINGS_CONTAINER_H
|
|
461 |
|
|
462 |
// End of File
|