|
1 /* |
|
2 * Copyright (c) 2002-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 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: It manages Browser's preferences. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BROWSER_PREFERENCES_H |
|
20 #define BROWSER_PREFERENCES_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <ActiveApDb.h> |
|
25 #include <BrCtlDefs.h> |
|
26 #include "Browser.hrh" |
|
27 #include "Preferences.h" |
|
28 #include <BrowserNG.rsg> |
|
29 #include "BrowserUiPrivateCRKeys.h" |
|
30 #include <BrowserUiSDKCRKeys.h> |
|
31 #include <centralrepository.h> |
|
32 #include <bldvariant.hrh> |
|
33 |
|
34 // CONSTANTS |
|
35 |
|
36 // FORWARD DECLARATION |
|
37 |
|
38 class MCommsModel; |
|
39 class MApiProvider; |
|
40 class CRepository; |
|
41 |
|
42 // class CBrCtlInterface; |
|
43 class TBrowserOverriddenSettings; |
|
44 class CApDataHandler; |
|
45 class CVpnApItem; |
|
46 class CVpnApEngine; |
|
47 // CLASS DECLARATION |
|
48 |
|
49 /** |
|
50 * Stores Browser settings. |
|
51 * |
|
52 * @lib Browser.app |
|
53 * @since Series60 1.2 |
|
54 */ |
|
55 class CBrowserPreferences : public CBase, |
|
56 public MPreferences, |
|
57 public MActiveApDbObserver |
|
58 { |
|
59 public: // construction |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * @since Series60 1.2 |
|
64 * @param aCommsModel Comms model |
|
65 * @return The constructed preferences object |
|
66 */ |
|
67 static CBrowserPreferences* NewLC( MCommsModel& aCommsModel, |
|
68 MApiProvider& aApiProvider, |
|
69 TBrowserOverriddenSettings* aSettings); |
|
70 |
|
71 /** |
|
72 * Two-phased constructor. |
|
73 * @since Series60 1.2 |
|
74 * @param aCommsModel Comms model |
|
75 * @return The constructed preferences object |
|
76 */ |
|
77 static CBrowserPreferences* NewL( MCommsModel& aCommsModel, |
|
78 MApiProvider& aApiProvider , |
|
79 TBrowserOverriddenSettings* aSettings ); |
|
80 |
|
81 public: // destruction |
|
82 |
|
83 /** |
|
84 * Destructor. |
|
85 */ |
|
86 virtual ~CBrowserPreferences(); |
|
87 |
|
88 |
|
89 public: // observation |
|
90 |
|
91 /** |
|
92 * Adds an observer to the list of observers to be notified about changes. |
|
93 * @since Series60 1.2 |
|
94 * @param anObserver Observer to be notified about events |
|
95 */ |
|
96 void AddObserverL( MPreferencesObserver* anObserver ); |
|
97 |
|
98 |
|
99 /** |
|
100 * Removes an observer. |
|
101 * @since Series60 1.2 |
|
102 * @param anObserver The observer |
|
103 */ |
|
104 void RemoveObserver( MPreferencesObserver* anObserver ); |
|
105 |
|
106 /** |
|
107 * Notify all observers about change. |
|
108 * @since Series60 1.2 (updated in 3.0) |
|
109 */ |
|
110 void NotifyObserversL( TPreferencesEvent aEvent, |
|
111 TBrCtlDefs::TBrCtlSettings aSettingType ); |
|
112 |
|
113 public: // From MActiveApDbObserver |
|
114 |
|
115 /** |
|
116 * Derived classes should implement this method, and act accordingly |
|
117 * to database events. |
|
118 * @since Series60 1.2 |
|
119 * @param anEvent Database-related event |
|
120 */ |
|
121 void HandleApDbEventL( TEvent anEvent ); |
|
122 |
|
123 public: // New functions |
|
124 |
|
125 /** |
|
126 * Stores preferences into shared data db. |
|
127 * @since Series60 1.2 |
|
128 */ |
|
129 void StoreSettingsL() const; |
|
130 |
|
131 /** |
|
132 * Returns a structure containing all of the settings according to the |
|
133 * central repository values |
|
134 * @since Series60 3.0 |
|
135 */ |
|
136 const TPreferencesValues& AllPreferencesL(); |
|
137 |
|
138 private: // New functions |
|
139 |
|
140 /** |
|
141 * restores preferences from shared data db. If fails, it uses defaults. |
|
142 * @since Series60 1.2 |
|
143 */ |
|
144 void RestoreSettingsL(); |
|
145 |
|
146 private: //Utility functions for accessing shared data |
|
147 |
|
148 /** |
|
149 * To access an int value key in ini file |
|
150 * @param aKey the ini file key to read |
|
151 * @return the value of the given key |
|
152 * @since Series60 2.0 |
|
153 */ |
|
154 TInt GetIntValue( TUint32 aKey) const; |
|
155 |
|
156 /** |
|
157 * To set an int value key in ini file |
|
158 * @param aKey the ini file key to write |
|
159 * @param aValue new value for the key |
|
160 * @return ETrue if successful |
|
161 * @since Series60 2.0 |
|
162 */ |
|
163 TBool SetIntValueL ( TUint32 aKey, const TInt& aValue); |
|
164 |
|
165 /** |
|
166 * To access an string value key in ini file |
|
167 * @param aKey the ini file key to read |
|
168 * @return the value of the given key |
|
169 * @since Series60 2.0 |
|
170 */ |
|
171 HBufC* GetStringValueL ( TUint32 aKey ) const; |
|
172 |
|
173 /** |
|
174 * To access an string value key in ini file |
|
175 * @param aKey the ini file key to read |
|
176 * @return the value of the given key |
|
177 * @since Series60 2.0 |
|
178 */ |
|
179 TInt GetStringValueL ( TUint32 aKey, TInt aMaxBufSize, TDes& aBuf ) const; |
|
180 |
|
181 /** |
|
182 * To set an int value key in ini file |
|
183 * @param aKey the ini file key to write |
|
184 * @param aValue new value for the key |
|
185 * @return ETrue if successful |
|
186 * @since Series60 2.0 |
|
187 */ |
|
188 TBool SetStringValueL( TUint32 aKey, const TDesC& aValue ); |
|
189 |
|
190 private: // New functions |
|
191 |
|
192 /** |
|
193 * Enables access to functions in CBrowserAppUi |
|
194 **/ |
|
195 inline MApiProvider& ApiProvider() { return iApiProvider; } |
|
196 |
|
197 public: // New functions |
|
198 |
|
199 /** |
|
200 * To set overriden values |
|
201 * @param aSettings settings to verride |
|
202 * @return void |
|
203 * @since Series60 2.0 |
|
204 */ |
|
205 void SetOverriddenSettingsL(TBrowserOverriddenSettings* aSettings); |
|
206 |
|
207 /** |
|
208 * To set embedded mode |
|
209 * @param aEmbeddedMode true if embedded mode is on |
|
210 * @return void |
|
211 * @since Series60 2.0 |
|
212 */ |
|
213 void SetEmbeddedModeL(TBool aEmbeddedMode); |
|
214 |
|
215 /** |
|
216 * To get embedded mode |
|
217 * @return TBool |
|
218 * @since Series60 3.0 |
|
219 */ |
|
220 inline TBool EmbeddedMode() const { return iEmbeddedMode; } |
|
221 |
|
222 /** |
|
223 * To access DefaultAccessPoint setting. |
|
224 * @since Series60 1.2 |
|
225 * @return UID for default accesspoint |
|
226 */ |
|
227 inline TUint DefaultAccessPoint() const; |
|
228 |
|
229 |
|
230 /** |
|
231 * Get the default snap id |
|
232 * @since Series60 1.2 |
|
233 * @return |
|
234 */ |
|
235 inline TUint DefaultSnapId() const; |
|
236 |
|
237 /** |
|
238 * To access Accossiated VPN if exist setting. |
|
239 * @since Series60 1.2 |
|
240 * @return UID for Accossiated VPN or KWmlNoDefaultAccessPoint |
|
241 */ |
|
242 inline TUint AssociatedVpn() const; |
|
243 |
|
244 /** |
|
245 * To access deafult AP details if exist setting. |
|
246 * @since Series60 1.2 |
|
247 * @return CApAccessPointItem* or NULL |
|
248 */ |
|
249 inline CApAccessPointItem* DefaultAPDetails(); |
|
250 |
|
251 /** |
|
252 * To access vpn item if exists. |
|
253 * aDefaultAccessPoint |
|
254 * aVpnItem |
|
255 * @since Series60 1.2 |
|
256 * @return TBool - if vpn item is valid |
|
257 */ |
|
258 TBool VpnDataL( TUint aDefaultAccessPoint, CVpnApItem& aVpnItem ); |
|
259 |
|
260 /** |
|
261 * To access AutoLoadContent setting. |
|
262 * @since Series60 1.2 |
|
263 * @return Value of setting |
|
264 */ |
|
265 inline TInt AutoLoadContent() const; |
|
266 |
|
267 /** |
|
268 * To access PageOverview setting. |
|
269 * @return Value of setting |
|
270 */ |
|
271 inline TBool PageOverview() const; |
|
272 |
|
273 /** |
|
274 * To access BackList setting. |
|
275 * @return Value of setting |
|
276 */ |
|
277 inline TBool BackList() const; |
|
278 |
|
279 /** |
|
280 * To access AutoRefresh setting. |
|
281 * @return Value of setting |
|
282 */ |
|
283 inline TBool AutoRefresh() const; |
|
284 |
|
285 /** |
|
286 * Sets the automatic updating access point of Web Feeds |
|
287 */ |
|
288 void SetAutomaticUpdatingApL( TUint aAutomaticUpdatingAP ); |
|
289 |
|
290 |
|
291 /** |
|
292 * Sets the automatic updating while roaming of News & Blogs |
|
293 */ |
|
294 void SetAutomaticUpdatingWhileRoamingL( TBool aAutoUpdateRoaming ) ; |
|
295 |
|
296 /** |
|
297 * To access user-defined URL suffix list (.com, org, .net) |
|
298 */ |
|
299 inline HBufC* URLSuffixList( ) const; |
|
300 |
|
301 /** |
|
302 * To modify user-defined URL suffix list (.com, .org, .net) |
|
303 */ |
|
304 void SetURLSuffixList( HBufC* aValue ); |
|
305 |
|
306 /** |
|
307 * automatic updating access point of Web Feeds |
|
308 */ |
|
309 inline TUint AutomaticUpdatingAP() const; |
|
310 |
|
311 |
|
312 /** |
|
313 * automatic updating while roaming of News & Blogs |
|
314 */ |
|
315 inline TBool AutomaticUpdatingWhileRoaming() const; |
|
316 |
|
317 /** |
|
318 * To access TextWrap setting |
|
319 * @since Series60 1.2 |
|
320 * @return setting item value |
|
321 */ |
|
322 inline TBool TextWrap() const; |
|
323 |
|
324 /** |
|
325 * To access FontSize setting |
|
326 * @since Series60 1.2 |
|
327 * @return Font size |
|
328 */ |
|
329 inline TInt FontSize() const; |
|
330 |
|
331 /** |
|
332 * To access Encoding setting |
|
333 * @since Series60 1.2 |
|
334 * @return Default Encoding |
|
335 */ |
|
336 inline TUint32 Encoding() const; |
|
337 |
|
338 /** |
|
339 * To access Adaptive Bookmarks setting |
|
340 * @since Series60 1.2 |
|
341 * @return TWmlSettingsAdaptiveBookmarks |
|
342 */ |
|
343 inline TWmlSettingsAdaptiveBookmarks AdaptiveBookmarks() const; |
|
344 |
|
345 /** |
|
346 * To access FullScreen setting |
|
347 * @since Series60 2.1 |
|
348 * @return TWmlSettingsFullScreen |
|
349 */ |
|
350 inline TWmlSettingsFullScreen FullScreen() const; |
|
351 |
|
352 /** |
|
353 * To access Cookies setting |
|
354 * @since Series60 1.2 |
|
355 * @return TWmlSettingsCookies |
|
356 */ |
|
357 inline TWmlSettingsCookies Cookies() const; |
|
358 |
|
359 /** |
|
360 * To access ECMA setting |
|
361 * @since Series60 2.x |
|
362 * @return TWmlSettingsECMA |
|
363 */ |
|
364 inline TWmlSettingsECMA Ecma() const; |
|
365 |
|
366 /** |
|
367 * To access SCRIPTLOG setting |
|
368 * @since Series60 3.2 |
|
369 * @return TUint32 |
|
370 */ |
|
371 inline TUint32 ScriptLog() const; |
|
372 |
|
373 /** |
|
374 * To access HTTP security warnings setting |
|
375 * @since Series60 1.2S |
|
376 * @return ETrue if security warnings are enabled |
|
377 */ |
|
378 inline TBool HttpSecurityWarnings() const; |
|
379 |
|
380 /** |
|
381 * To access IMEI notification setting |
|
382 * @since Series60 2.6 |
|
383 * @return ETrue if notification is enabled |
|
384 */ |
|
385 inline TWmlSettingsIMEI IMEINotification() const; |
|
386 |
|
387 /** |
|
388 * Call this to check whether Http |
|
389 */ |
|
390 inline TBool HttpSecurityWarningsStatSupressed() const; |
|
391 |
|
392 /** |
|
393 * To access Downloads Open setting |
|
394 * @since Series60 3.x |
|
395 * @return TBool |
|
396 */ |
|
397 inline TBool DownloadsOpen() const; |
|
398 |
|
399 /** |
|
400 * To access user-defined homepage URL setting |
|
401 */ |
|
402 TInt HomePageUrlL( TDes& aUrl, TBool aForceLoadFromSD = EFalse ) const; |
|
403 |
|
404 /** |
|
405 * Get the home page URL from belongs to the access point. |
|
406 */ |
|
407 TInt HomePageFromIapL( TDes& aUrl, TUint aIap ) const; |
|
408 |
|
409 /** |
|
410 * To access user-defined search page URL setting |
|
411 */ |
|
412 TPtrC SearchPageUrlL(); |
|
413 |
|
414 /** |
|
415 * To determine that is there an overridden default access point defined or not |
|
416 */ |
|
417 TBool CustomAccessPointDefined(); |
|
418 |
|
419 /** |
|
420 * Shows/Hides the query on exit dialog |
|
421 * 0 = Not show the dialog |
|
422 * 1 = Show the dialog |
|
423 * |
|
424 * @since Series60 2.7 |
|
425 * @return ETrue if query on exit is enabled |
|
426 */ |
|
427 inline TBool QueryOnExit() const; |
|
428 |
|
429 /** |
|
430 * Sends/Don not send the referrer header |
|
431 * 0 = Do not send the referrer header |
|
432 * 1 = Send the referrer header |
|
433 * |
|
434 * @since Series60 2.7 |
|
435 * @return ETrue if Send referrer header is enabled |
|
436 */ |
|
437 inline TBool SendReferrer() const; |
|
438 |
|
439 /** |
|
440 * To access ShowConnectionDialogs setting |
|
441 * @since Series60 2.0 |
|
442 * @return value of setting |
|
443 */ |
|
444 inline TBool ShowConnectionDialogs() const; |
|
445 |
|
446 /** |
|
447 * To check that an engine local feature is supported or not |
|
448 * @since Series60 2.1 |
|
449 * @return Returns ETrue if feature is supported |
|
450 * @param aBitmask Feature to check |
|
451 */ |
|
452 inline TBool EngineLocalFeatureSupported( const TInt aFeature ) const; |
|
453 |
|
454 /** |
|
455 * To check that a ui local feature is supported or not |
|
456 * @since Series60 2.1 |
|
457 * @return Returns ETrue if feature is supported |
|
458 * @param aBitmask Feature to check |
|
459 */ |
|
460 inline TBool UiLocalFeatureSupported( const TInt aFeature ) const; |
|
461 |
|
462 /** |
|
463 * To access MediaVolume setting |
|
464 * @since Series60 2.6 |
|
465 * @return TInt |
|
466 */ |
|
467 inline TInt MediaVolume() const; |
|
468 |
|
469 /** |
|
470 * To access home page's type: AP/user defined. |
|
471 * @since Series60 2.6 |
|
472 * @return value of setting |
|
473 */ |
|
474 inline TWmlSettingsHomePage HomePageType() const; |
|
475 |
|
476 /** |
|
477 * To access Popup Blocking Enabled setting. |
|
478 * @since Series60 3.0 |
|
479 * @return value of setting |
|
480 */ |
|
481 inline TBool PopupBlocking() const; |
|
482 |
|
483 /** |
|
484 * To access Form Data Saving setting. |
|
485 * @since Series60 3.1 |
|
486 * @return value of setting |
|
487 */ |
|
488 inline TWmlSettingsFormData FormDataSaving() const; |
|
489 |
|
490 /** |
|
491 * To access Access Keys setting. |
|
492 * @since Series60 3.2 |
|
493 * @return value of setting: 1-Enabled, 0-Disabled |
|
494 */ |
|
495 inline TBool AccessKeys() const; |
|
496 |
|
497 /** |
|
498 * To modify DefaultAccessPoint setting |
|
499 * @since Series60 1.2 |
|
500 * @param aDefaultAccessPoint Id of default accesspoint |
|
501 */ |
|
502 void SetDefaultAccessPointL( TUint aDefaultAccessPoint, TUint aAssocVpn = KWmlNoDefaultAccessPoint ); |
|
503 |
|
504 /** |
|
505 * Set default snapid |
|
506 * @since Series60 1.2 |
|
507 * @param |
|
508 */ |
|
509 void SetDefaultSnapId (TUint aSnapId); |
|
510 |
|
511 /** |
|
512 * To modify AutoLoadContent setting |
|
513 * @since Series60 1.2 |
|
514 * @param aAutoLoadContent Change the setting on/off |
|
515 */ |
|
516 void SetAutoLoadContentL( TInt aAutoLoadContent ); |
|
517 |
|
518 /** |
|
519 * To modify PageOverview setting |
|
520 * @param aPageOverview Change the setting on/off |
|
521 */ |
|
522 void SetPageOverviewL( TBool aPageOverview ); |
|
523 |
|
524 /** |
|
525 * To modify BackList setting |
|
526 * @param aBackList Change the setting on/off |
|
527 */ |
|
528 void SetBackListL( TBool aBackList ); |
|
529 |
|
530 /** |
|
531 * To modify AutoRefresh setting |
|
532 * @param aAutoRefresh Change the setting on/off |
|
533 */ |
|
534 void SetAutoRefreshL( TBool aAutoRefresh ); |
|
535 |
|
536 /** |
|
537 * To modify TextWrap setting |
|
538 * @since Series60 1.2 |
|
539 * @param aTextWrap Change the setting on/off |
|
540 */ |
|
541 void SetTextWrapL( TBool aTextWrap ); |
|
542 |
|
543 /** |
|
544 * To modify FontSize setting |
|
545 * @since Series60 1.2 |
|
546 * @param aFontSize Set new font size |
|
547 */ |
|
548 void SetFontSizeL( TInt aFontSize ); |
|
549 |
|
550 /** |
|
551 * To modify Encoding setting |
|
552 * @since Series60 1.2 |
|
553 * @param aEncoding Set new font size |
|
554 */ |
|
555 void SetEncodingL( TUint32 aEncoding ); |
|
556 |
|
557 /** |
|
558 * To modify Adaptive Bookmarks setting |
|
559 * @since Series60 1.2 |
|
560 * @param aAdaptiveBookmarks |
|
561 */ |
|
562 void SetAdaptiveBookmarksL( TWmlSettingsAdaptiveBookmarks aAdaptiveBookmarks ); |
|
563 |
|
564 /** |
|
565 * To modify FullScreen setting |
|
566 * @since Series60 2.1 |
|
567 * @param aFullScreen |
|
568 */ |
|
569 void SetFullScreenL( TWmlSettingsFullScreen aFullScreen ); |
|
570 |
|
571 /** |
|
572 * To modify Cookies setting |
|
573 * @since Series60 1.2 |
|
574 * @param aCookies |
|
575 */ |
|
576 void SetCookiesL( TWmlSettingsCookies aCookies ); |
|
577 |
|
578 /** |
|
579 * To modify ECMA setting |
|
580 * @since Series60 2.x |
|
581 * @param aEcma |
|
582 */ |
|
583 void SetEcmaL( TWmlSettingsECMA aEcma ); |
|
584 |
|
585 /** |
|
586 * To modify ScriptLog setting |
|
587 * @since Series60 3.2 |
|
588 * @param aScriptLog |
|
589 */ |
|
590 void SetScriptLogL( TUint32 aScriptLog ); |
|
591 |
|
592 /** |
|
593 * To modify HTTP security warnings setting |
|
594 * @since Series60 1.2S |
|
595 * @param aWarningsOn True to enable security warnings, false to disable |
|
596 */ |
|
597 void SetHttpSecurityWarningsL( TBool aWarningsOn ); |
|
598 |
|
599 /** |
|
600 * To modify IMEI notification setting |
|
601 * @since Series60 2.6 |
|
602 * @param aIMEINotification True to enable IMEI notification |
|
603 */ |
|
604 void SetIMEINotificationL( TWmlSettingsIMEI aIMEINotification ); |
|
605 |
|
606 /** |
|
607 * To modify MediaVolume setting |
|
608 * @since Series60 2.6 |
|
609 * @param aMediaVolume Change the media volume value |
|
610 */ |
|
611 void SetMediaVolumeL( TInt aMediaVolume ); |
|
612 |
|
613 /** |
|
614 * To modify Downloads Open setting |
|
615 * @since Series60 3.x |
|
616 * @param aOpen True to enable download open |
|
617 */ |
|
618 void SetDownloadsOpenL( TBool aOpen ); |
|
619 |
|
620 /** |
|
621 * To flush all the shared data key settings |
|
622 * @since Series60 2.6 |
|
623 */ |
|
624 void FlushSD(); |
|
625 |
|
626 /** |
|
627 * To modify HomePage's type setting |
|
628 * @since Series60 2.6 |
|
629 * @param aHomePageType Change the home page type: AP/user defined. |
|
630 */ |
|
631 void SetHomePageTypeL( TWmlSettingsHomePage aHomePageType ); |
|
632 |
|
633 /** |
|
634 * To modify user-defined HomePage. |
|
635 * @since Series60 2.6 |
|
636 * @param aHomePageURL Change the home page's url. |
|
637 */ |
|
638 void SetHomePageUrlL( const TDesC& aHomePageURL ); |
|
639 |
|
640 /** |
|
641 * To modify user-defined Search Page URL |
|
642 * @since Series60 2.6 |
|
643 * @param aSearchPageURL Change the search page's url. |
|
644 */ |
|
645 void SetSearchPageUrlL( const TDesC& aSearchPageURL ); |
|
646 |
|
647 /** |
|
648 * To modify user-defined Pop-up blocking enabled setting |
|
649 * @since Series60 3.0 |
|
650 * @param aPopupBlocking Change setting on/off |
|
651 */ |
|
652 void SetPopupBlockingL( TBool aPopupBlocking ); |
|
653 |
|
654 /** |
|
655 * To modify Form Data Saving setting |
|
656 * @since Series60 3.1 |
|
657 * @param aFormDataSaving Change setting off/form data only/ form data plus password |
|
658 */ |
|
659 void SetFormDataSavingL( TWmlSettingsFormData aFormDataSaving ); |
|
660 |
|
661 /** |
|
662 * To access to the list of self download content types. |
|
663 * See CBrCtlInterface::SetSelfDownloadContentTypesL()! |
|
664 */ |
|
665 TPtrC SelfDownloadContentTypesL(); |
|
666 |
|
667 /** |
|
668 * To access Default Access Point selection mode settings. |
|
669 */ |
|
670 TCmSettingSelectionMode AccessPointSelectionMode(); |
|
671 |
|
672 /** |
|
673 * To modify Default Access Point Settings |
|
674 */ |
|
675 void SetAccessPointSelectionModeL( TCmSettingSelectionMode aAccessPointSelectionMode ); |
|
676 |
|
677 |
|
678 /** |
|
679 * To access pre defined short cut keys |
|
680 */ |
|
681 inline HBufC* ShortCutFuncHomePg() const; |
|
682 |
|
683 /** |
|
684 * To access pre defined short cut keys |
|
685 */ |
|
686 inline HBufC* ShortCutFuncBkMark() const; |
|
687 |
|
688 /** |
|
689 * To access pre defined short cut keys |
|
690 */ |
|
691 inline HBufC* ShortCutFuncFindKeyWord() const; |
|
692 |
|
693 /** |
|
694 * To access pre defined short cut keys |
|
695 */ |
|
696 inline HBufC* ShortCutFuncPrePage() const; |
|
697 |
|
698 /** |
|
699 * To access pre defined short cut keys |
|
700 */ |
|
701 inline HBufC* ShortCutFuncSwitchWin() const; |
|
702 |
|
703 /** |
|
704 * To access pre defined short cut keys |
|
705 */ |
|
706 inline HBufC* ShortCutFuncMiniImage() const; |
|
707 |
|
708 /** |
|
709 * To access pre defined short cut keys |
|
710 */ |
|
711 inline HBufC* ShortCutFuncFullScreen() const; |
|
712 |
|
713 /** |
|
714 * To access pre defined short cut keys |
|
715 */ |
|
716 inline HBufC* ShortCutFuncGoAddr() const; |
|
717 |
|
718 /** |
|
719 * To access pre defined short cut keys |
|
720 */ |
|
721 inline HBufC* ShortCutFuncZoomIn() const; |
|
722 |
|
723 /** |
|
724 * To access pre defined short cut keys |
|
725 */ |
|
726 inline HBufC* ShortCutFuncZoomOut() const; |
|
727 |
|
728 /** |
|
729 * To access pre defined short cut keys |
|
730 */ |
|
731 inline HBufC* ShortCutFuncZoomMode() const; |
|
732 |
|
733 /** |
|
734 * To access rotate display setting |
|
735 */ |
|
736 inline TBool RotateDisplay() const; |
|
737 |
|
738 /** |
|
739 * To get Toolbar On/Off value |
|
740 */ |
|
741 inline TInt ShowToolbarOnOff() const; |
|
742 |
|
743 /** |
|
744 * To get Toolbar Button 1 command value |
|
745 */ |
|
746 inline TInt ShowToolbarButton1Cmd() const; |
|
747 |
|
748 /** |
|
749 * To set Toolbar On/Off value |
|
750 */ |
|
751 void SetToolbarOnOffL(TInt aCommand); |
|
752 |
|
753 /** |
|
754 * To set Toolbar Button 1 command value |
|
755 */ |
|
756 void SetToolbarButton1CmdL(TInt aCommand); |
|
757 |
|
758 /** |
|
759 * To get Toolbar Button 2 command value |
|
760 */ |
|
761 inline TInt ShowToolbarButton2Cmd() const; |
|
762 |
|
763 /** |
|
764 * To set Toolbar Button 2 command value |
|
765 */ |
|
766 void SetToolbarButton2CmdL(TInt aCommand); |
|
767 |
|
768 /** |
|
769 * To get Toolbar Button 3 command value |
|
770 */ |
|
771 inline TInt ShowToolbarButton3Cmd() const; |
|
772 |
|
773 /** |
|
774 * To set Toolbar Button 3 command value |
|
775 */ |
|
776 void SetToolbarButton3CmdL(TInt aCommand); |
|
777 |
|
778 /** |
|
779 * To get Toolbar Button 4 command value |
|
780 */ |
|
781 inline TInt ShowToolbarButton4Cmd() const; |
|
782 |
|
783 /** |
|
784 * To set Toolbar Button 4 command value |
|
785 */ |
|
786 void SetToolbarButton4CmdL(TInt aCommand); |
|
787 |
|
788 /** |
|
789 * To get Toolbar Button 5 command value |
|
790 */ |
|
791 inline TInt ShowToolbarButton5Cmd() const; |
|
792 |
|
793 /** |
|
794 * To set Toolbar Button 5 command value |
|
795 */ |
|
796 void SetToolbarButton5CmdL(TInt aCommand); |
|
797 |
|
798 /** |
|
799 * To get Toolbar Button 6 command value |
|
800 */ |
|
801 inline TInt ShowToolbarButton6Cmd() const; |
|
802 |
|
803 /** |
|
804 * To set Toolbar Button 6 command value |
|
805 */ |
|
806 void SetToolbarButton6CmdL(TInt aCommand); |
|
807 |
|
808 /** |
|
809 * To get Toolbar Button 7 command value |
|
810 */ |
|
811 inline TInt ShowToolbarButton7Cmd() const; |
|
812 |
|
813 /** |
|
814 * To set Toolbar Button 7 command value |
|
815 */ |
|
816 void SetToolbarButton7CmdL(TInt aCommand); |
|
817 |
|
818 /** |
|
819 * To get Shortcut Key 1 command value |
|
820 */ |
|
821 inline TInt ShortcutKey1Cmd() const; |
|
822 |
|
823 /** |
|
824 * To set Shortcut Key 1 command value |
|
825 */ |
|
826 void SetShortcutKey1CmdL(TInt aCommand); |
|
827 |
|
828 /** |
|
829 * To get Shortcut Key 2 command value |
|
830 */ |
|
831 inline TInt ShortcutKey2Cmd() const; |
|
832 |
|
833 /** |
|
834 * To set Shortcut Key 2 command value |
|
835 */ |
|
836 void SetShortcutKey2CmdL(TInt aCommand); |
|
837 |
|
838 /** |
|
839 * To get Shortcut Key 3 command value |
|
840 */ |
|
841 inline TInt ShortcutKey3Cmd() const; |
|
842 |
|
843 /** |
|
844 * To set Shortcut Key 3 command value |
|
845 */ |
|
846 void SetShortcutKey3CmdL(TInt aCommand); |
|
847 |
|
848 /** |
|
849 * To get Shortcut Key 4 command value |
|
850 */ |
|
851 inline TInt ShortcutKey4Cmd() const; |
|
852 |
|
853 /** |
|
854 * To set Shortcut Key 4 command value |
|
855 */ |
|
856 void SetShortcutKey4CmdL(TInt aCommand); |
|
857 |
|
858 /** |
|
859 * To get Shortcut Key 5 command value |
|
860 */ |
|
861 inline TInt ShortcutKey5Cmd() const; |
|
862 |
|
863 /** |
|
864 * To set Shortcut Key 5 command value |
|
865 */ |
|
866 void SetShortcutKey5CmdL(TInt aCommand); |
|
867 |
|
868 /** |
|
869 * To get Shortcut Key 6 command value |
|
870 */ |
|
871 inline TInt ShortcutKey6Cmd() const; |
|
872 |
|
873 /** |
|
874 * To set Shortcut Key 6 command value |
|
875 */ |
|
876 void SetShortcutKey6CmdL(TInt aCommand); |
|
877 |
|
878 /** |
|
879 * To get Shortcut Key 7 command value |
|
880 */ |
|
881 inline TInt ShortcutKey7Cmd() const; |
|
882 |
|
883 /** |
|
884 * To set Shortcut Key 7 command value |
|
885 */ |
|
886 void SetShortcutKey7CmdL(TInt aCommand); |
|
887 |
|
888 /** |
|
889 * To get Shortcut Key 8 command value |
|
890 */ |
|
891 inline TInt ShortcutKey8Cmd() const; |
|
892 |
|
893 /** |
|
894 * To set Shortcut Key 8 command value |
|
895 */ |
|
896 void SetShortcutKey8CmdL(TInt aCommand); |
|
897 |
|
898 /** |
|
899 * To get Shortcut Key 9 command value |
|
900 */ |
|
901 inline TInt ShortcutKey9Cmd() const; |
|
902 |
|
903 /** |
|
904 * To set Shortcut Key 9 command value |
|
905 */ |
|
906 void SetShortcutKey9CmdL(TInt aCommand); |
|
907 |
|
908 /** |
|
909 * To get Shortcut Key 0 command value |
|
910 */ |
|
911 inline TInt ShortcutKey0Cmd() const; |
|
912 |
|
913 /** |
|
914 * To set Shortcut Key 0 command value |
|
915 */ |
|
916 void SetShortcutKey0CmdL(TInt aCommand); |
|
917 |
|
918 /** |
|
919 * To get Shortcut Key Star command value |
|
920 */ |
|
921 inline TInt ShortcutKeyStarCmd() const; |
|
922 |
|
923 /** |
|
924 * To set Shortcut Key Star command value |
|
925 */ |
|
926 void SetShortcutKeyStarCmdL(TInt aCommand); |
|
927 |
|
928 /** |
|
929 * To get Shortcut Key Hash command value |
|
930 */ |
|
931 inline TInt ShortcutKeyHashCmd() const; |
|
932 |
|
933 /** |
|
934 * To set Shortcut Key Hash command value |
|
935 */ |
|
936 void SetShortcutKeyHashCmdL(TInt aCommand); |
|
937 |
|
938 /** |
|
939 * To get Shortcut Key for Qwerty command value |
|
940 */ |
|
941 inline TInt ShortcutKeysForQwerty() const; |
|
942 |
|
943 /** |
|
944 * To get Zoom Level minimum value |
|
945 */ |
|
946 inline TUint32 ZoomLevelMinimum() const; |
|
947 |
|
948 /** |
|
949 * To get Zoom Level maximum value |
|
950 */ |
|
951 inline TUint32 ZoomLevelMaximum() const; |
|
952 |
|
953 /** |
|
954 * To get Zoom Level default value |
|
955 */ |
|
956 inline TUint32 ZoomLevelDefault() const; |
|
957 |
|
958 /** |
|
959 * To get Maximum number of Recent URLs to be displayed in pop up |
|
960 */ |
|
961 inline TInt MaxRecentUrls() const; |
|
962 |
|
963 |
|
964 private: |
|
965 |
|
966 /** |
|
967 * Constructor. |
|
968 * @param aCommsModel Comms model. |
|
969 */ |
|
970 CBrowserPreferences( MCommsModel& aCommsModel, MApiProvider& aApiProvider ); |
|
971 |
|
972 /** |
|
973 * By default constructor is private. |
|
974 */ |
|
975 void ConstructL( TBrowserOverriddenSettings* aSettings ); |
|
976 |
|
977 private: |
|
978 |
|
979 MApiProvider& iApiProvider; // enables access to CBrowserAppUi |
|
980 |
|
981 // Application settings to store in file |
|
982 TUint iCustomAp; |
|
983 public: |
|
984 enum ///< Text font size |
|
985 { |
|
986 EAllSmall, |
|
987 ESmall, |
|
988 ENormal, |
|
989 ELarge, |
|
990 EAllLarge |
|
991 } TFontSize; |
|
992 private: |
|
993 // Observers |
|
994 CArrayPtrFlat< MPreferencesObserver >* iObservers; |
|
995 MCommsModel& iCommsModel; |
|
996 |
|
997 CRepository* iRepository; |
|
998 CApDataHandler* iApDH; |
|
999 CVpnApItem* iVpnItem; |
|
1000 CVpnApEngine* iVpnEngine; |
|
1001 |
|
1002 // OSS needs a separate repository for non shared settings. |
|
1003 |
|
1004 TInt iEngineLocalFeaturesBitmask; //Engine Local Features Bitmask |
|
1005 |
|
1006 TInt iUiLocalFeaturesBitmask; //Ui Local Features Bitmask |
|
1007 |
|
1008 TBrowserOverriddenSettings* iOverridenSettings; |
|
1009 |
|
1010 TBool iEmbeddedMode; //ETrue = the browser is in embedded mode |
|
1011 |
|
1012 TInt iCdmaUiLocalFeaturesBitmask; // CDMA UI Local Features Bitmask |
|
1013 |
|
1014 TBool iOverriden;//Settings were overriden or not |
|
1015 |
|
1016 HBufC* iSelfDownloadContentTypes; ///< List of such content types. Owned. |
|
1017 |
|
1018 // A buffer struct for holding each setting value |
|
1019 TPreferencesValues iAllPreferences; |
|
1020 }; |
|
1021 |
|
1022 #include "BrowserPreferences.inl" |
|
1023 |
|
1024 // Toolbar button command translation matrix |
|
1025 // |
|
1026 // translates cenrep value to browser command and setting string resource id |
|
1027 // for each toolbar button |
|
1028 // |
|
1029 // NOTE: THIS MUST STAY IN SYNC WITH SAME DEFINITION IN toolbar.h in webengine. |
|
1030 // |
|
1031 typedef const TInt TToolbarCommandDecodeEntry[1]; |
|
1032 |
|
1033 #define KToolbarCommandDecodeMatrixCount 23 |
|
1034 #define KToolbarCommandDecodeMatrixStringId 0 // first entry is the Setting String Id |
|
1035 |
|
1036 static const TToolbarCommandDecodeEntry ToolbarCommandDecodeMatrix[] = |
|
1037 { |
|
1038 // Index # Setting String Id |
|
1039 // = cenrep value |
|
1040 /* 0 */ { R_BROWSER_SETTING_NONE }, |
|
1041 /* 1 */ { R_BROWSER_SETTING_SHOW_HELP }, |
|
1042 /* 2 */ { R_BROWSER_SETTING_SWITCH_WINDOW }, |
|
1043 /* 3 */ { R_BROWSER_SETTING_SAVE_PAGE }, |
|
1044 /* 4 */ { R_BROWSER_SETTING_VIEW_IMAGES }, |
|
1045 /* 5 */ { R_BROWSER_SETTING_VISUAL_HISTORY }, |
|
1046 /* 6 */ { R_BROWSER_SETTING_MANAGE_BOOKMARKS }, |
|
1047 /* 7 */ { R_BROWSER_SETTING_SUBSCRIBE_TO_FEEDS }, |
|
1048 /* 8 */ { R_BROWSER_SETTING_ROTATE_SCREEN }, |
|
1049 /* 9 */ { R_BROWSER_SETTING_SETTINGS }, |
|
1050 /* 10 */ { R_BROWSER_SETTING_ZOOM_OUT }, |
|
1051 /* 11 */ { R_BROWSER_SETTING_ZOOM_IN }, |
|
1052 /* 12 */ { R_BROWSER_SETTING_GO_TO_HOMPAGE }, |
|
1053 /* 13 */ { R_BROWSER_SETTING_PREVIOUS_PAGE }, |
|
1054 /* 14 */ { R_BROWSER_SETTING_MINIATURE_SHOW }, |
|
1055 /* 15 */ { R_BROWSER_SETTING_RELOAD }, |
|
1056 /* 16 */ { R_BROWSER_SETTING_FIND_KEYWORD }, |
|
1057 /* 17 */ { R_BROWSER_SETTING_RECENT_URLS }, // toolbar only - recent urls drop down list |
|
1058 /* 18 */ { R_BROWSER_SETTING_SAVE_AS_BOOKMARK }, |
|
1059 /* 19 */ { R_BROWSER_SETTING_LIST_BOOKMARKS }, // toolbar only - bookmarks drop down list |
|
1060 /* 20 */ { R_BROWSER_SETTING_GO_TO_WEB_ADDRESS }, |
|
1061 /* 21 */ { R_BROWSER_SETTING_SHOW_KEYMAP }, |
|
1062 /* 22 */ { R_BROWSER_SETTING_FULL_SCREEN }, |
|
1063 }; |
|
1064 |
|
1065 |
|
1066 // Shortcut Keys command translation matrix |
|
1067 // |
|
1068 // translates cenrep value to browser command and setting string resource id |
|
1069 // for each shortcut key |
|
1070 // |
|
1071 // |
|
1072 typedef const TInt TShortcutsCommandDecodeEntry[2]; |
|
1073 |
|
1074 #define KShortcutsCommandDecodeMatrixCount 22 |
|
1075 #define KShortcutsCommandDecodeMatrixCmdVal 0 // First entry is the Command Value |
|
1076 #define KShortcutsCommandDecodeMatrixStringId 1 // Second entry is the Setting String Id |
|
1077 |
|
1078 static const TShortcutsCommandDecodeEntry ShortcutsCommandDecodeMatrix[] = |
|
1079 { |
|
1080 // Index # Command Value Setting String Id |
|
1081 // = cenrep value |
|
1082 /* 0 */ { EWmlNoCmd, R_BROWSER_SETTING_NONE }, |
|
1083 /* 1 */ { EAknCmdHelp, R_BROWSER_SETTING_SHOW_HELP }, |
|
1084 /* 2 */ { EWmlCmdSwitchWindow, R_BROWSER_SETTING_SWITCH_WINDOW }, |
|
1085 /* 3 */ { EWmlCmdSavePage, R_BROWSER_SETTING_SAVE_PAGE }, |
|
1086 /* 4 */ { EWmlCmdShowImages, R_BROWSER_SETTING_VIEW_IMAGES }, |
|
1087 /* 5 */ { EWmlCmdHistory, R_BROWSER_SETTING_VISUAL_HISTORY }, |
|
1088 /* 6 */ { EWmlCmdFavourites, R_BROWSER_SETTING_MANAGE_BOOKMARKS }, |
|
1089 /* 7 */ { EWmlCmdShowSubscribeList, R_BROWSER_SETTING_SUBSCRIBE_TO_FEEDS }, |
|
1090 /* 8 */ { EWmlCmdRotateDisplay, R_BROWSER_SETTING_ROTATE_SCREEN }, |
|
1091 /* 9 */ { EWmlCmdPreferences, R_BROWSER_SETTING_SETTINGS }, |
|
1092 /* 10 */ { EWmlCmdZoomOut, R_BROWSER_SETTING_ZOOM_OUT }, |
|
1093 /* 11 */ { EWmlCmdZoomIn, R_BROWSER_SETTING_ZOOM_IN }, |
|
1094 /* 12 */ { EWmlCmdLaunchHomePage, R_BROWSER_SETTING_GO_TO_HOMPAGE }, |
|
1095 /* 13 */ { EWmlCmdOneStepBack, R_BROWSER_SETTING_PREVIOUS_PAGE }, |
|
1096 /* 14 */ { EWmlCmdShowMiniature, R_BROWSER_SETTING_MINIATURE_SHOW }, |
|
1097 /* 15 */ { EWmlCmdReload, R_BROWSER_SETTING_RELOAD }, |
|
1098 /* 16 */ { EWmlCmdFindKeyword, R_BROWSER_SETTING_FIND_KEYWORD }, |
|
1099 /* 17 */ { EWmlCmdSaveAsBookmark, R_BROWSER_SETTING_SAVE_AS_BOOKMARK }, |
|
1100 /* 18 */ { EWmlCmdGoToAddress, R_BROWSER_SETTING_GO_TO_WEB_ADDRESS }, |
|
1101 /* 19 */ { EWmlCmdShowToolBar, R_BROWSER_SETTING_SHOW_TOOLBAR }, |
|
1102 /* 20 */ { EWmlCmdShowShortcutKeymap, R_BROWSER_SETTING_SHOW_KEYMAP }, |
|
1103 /* 21 */ { EWmlCmdEnterFullScreenBrowsing, R_BROWSER_SETTING_FULL_SCREEN }, |
|
1104 }; |
|
1105 |
|
1106 #endif //BROWSER_PREFERENCES_H |
|
1107 |
|
1108 // End of File |