browserui/browser/BrowserAppInc/BrowserPreferences.h
branchRCL_3
changeset 65 8e6fa1719340
equal deleted inserted replaced
64:6385c4c93049 65:8e6fa1719340
       
     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         /**
       
   139         * To access an int value key in ini file
       
   140         * @param aKey the ini file key to read
       
   141         * @return the value of the given key
       
   142         * @since Series60 2.0
       
   143         */
       
   144         TInt GetIntValue( TUint32 aKey) const;
       
   145 
       
   146         /**
       
   147         * To access an string value key in ini file
       
   148         * @param aKey the ini file key to read
       
   149         * @return the value of the given key
       
   150         * @since Series60 2.0
       
   151         */
       
   152         TInt GetStringValueL ( TUint32 aKey, TInt aMaxBufSize, TDes& aBuf ) const;
       
   153 		
       
   154     private:    // New functions
       
   155         
       
   156         /**
       
   157         * restores preferences from shared data db. If fails, it uses defaults.
       
   158         * @since Series60 1.2
       
   159         */
       
   160         void RestoreSettingsL();
       
   161         
       
   162     private:    //Utility functions for accessing shared data
       
   163 
       
   164         /**
       
   165         * To set an int value key in ini file
       
   166         * @param aKey the ini file key to write
       
   167         * @param aValue new value for the key
       
   168         * @return ETrue if successful
       
   169         * @since Series60 2.0
       
   170         */
       
   171         TBool SetIntValueL ( TUint32 aKey, const TInt& aValue);
       
   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         HBufC* GetStringValueL ( TUint32 aKey ) 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         * To get Search Feature Flag.
       
   965         */
       
   966         inline TInt SearchFeature() const;
       
   967 
       
   968         /** 
       
   969         * To get Service Feature Flag.
       
   970         */
       
   971         inline TInt ServiceFeature() const;
       
   972 		
       
   973         /** 
       
   974         * To get cursor show mode
       
   975         */
       
   976         inline TBrCtlDefs::TCursorSettings CursorShowMode() const;
       
   977         
       
   978         inline TBrCtlDefs::TEnterKeySettings EnterKeyMode() const;
       
   979         
       
   980     private:
       
   981 
       
   982         /**
       
   983         * Constructor.
       
   984         * @param aCommsModel Comms model.
       
   985         */
       
   986         CBrowserPreferences( MCommsModel& aCommsModel, MApiProvider& aApiProvider );
       
   987 
       
   988         /**
       
   989         * By default constructor is private.
       
   990         */
       
   991         void ConstructL( TBrowserOverriddenSettings* aSettings );
       
   992         TInt GetSearchFeatureStatusL( TUint32 aKey, RApaLsSession& aLs );
       
   993     private: 
       
   994 
       
   995         MApiProvider& iApiProvider; // enables access to CBrowserAppUi
       
   996 
       
   997         // Application settings to store in file        
       
   998         TUint   iCustomAp;
       
   999     public:
       
  1000         enum        ///< Text font size
       
  1001             {
       
  1002             EAllSmall,
       
  1003             ESmall,
       
  1004             ENormal,
       
  1005             ELarge,
       
  1006             EAllLarge
       
  1007             } TFontSize;
       
  1008     private:
       
  1009         // Observers
       
  1010         CArrayPtrFlat< MPreferencesObserver >* iObservers;   
       
  1011         MCommsModel& iCommsModel;
       
  1012 
       
  1013         CRepository* iRepository;
       
  1014         CApDataHandler* iApDH;
       
  1015         CVpnApItem* iVpnItem;
       
  1016         CVpnApEngine* iVpnEngine;        
       
  1017         
       
  1018         // OSS needs a separate repository for non shared settings.
       
  1019         
       
  1020         TInt iEngineLocalFeaturesBitmask; //Engine Local Features Bitmask
       
  1021 
       
  1022         TInt iUiLocalFeaturesBitmask; //Ui Local Features Bitmask
       
  1023 
       
  1024         TBrowserOverriddenSettings* iOverridenSettings;
       
  1025 
       
  1026         TBool iEmbeddedMode; //ETrue = the browser is in embedded mode
       
  1027 
       
  1028         TInt iCdmaUiLocalFeaturesBitmask;  // CDMA UI Local Features Bitmask
       
  1029 
       
  1030         TBool iOverriden;//Settings were overriden or not
       
  1031 
       
  1032         HBufC* iSelfDownloadContentTypes; ///< List of such content types. Owned.
       
  1033 
       
  1034         // A buffer struct for holding each setting value
       
  1035         TPreferencesValues  iAllPreferences;
       
  1036     };
       
  1037 
       
  1038 #include "BrowserPreferences.inl"
       
  1039 
       
  1040 // Toolbar button command translation matrix
       
  1041 // 
       
  1042 //  translates cenrep value to browser command and setting string resource id 
       
  1043 //  for each toolbar button
       
  1044 //
       
  1045 //  NOTE: THIS MUST STAY IN SYNC WITH SAME DEFINITION IN toolbar.h in webengine.
       
  1046 // 
       
  1047 typedef const TInt TToolbarCommandDecodeEntry[1];
       
  1048 
       
  1049 #define KToolbarCommandDecodeMatrixCount  23
       
  1050 #define KToolbarCommandDecodeMatrixStringId  0 // first entry is the Setting String Id
       
  1051 
       
  1052 static const TToolbarCommandDecodeEntry    ToolbarCommandDecodeMatrix[] =
       
  1053 {
       
  1054     // Index #          Setting String Id
       
  1055     // = cenrep value
       
  1056        /* 0  */       { R_BROWSER_SETTING_NONE               },
       
  1057        /* 1  */       { R_BROWSER_SETTING_SHOW_HELP          },
       
  1058        /* 2  */       { R_BROWSER_SETTING_SWITCH_WINDOW      },
       
  1059        /* 3  */       { R_BROWSER_SETTING_SAVE_PAGE          },
       
  1060        /* 4  */       { R_BROWSER_SETTING_VIEW_IMAGES        },
       
  1061        /* 5  */       { R_BROWSER_SETTING_VISUAL_HISTORY     },
       
  1062        /* 6  */       { R_BROWSER_SETTING_MANAGE_BOOKMARKS   },
       
  1063        /* 7  */       { R_BROWSER_SETTING_SUBSCRIBE_TO_FEEDS },
       
  1064        /* 8  */       { R_BROWSER_SETTING_ROTATE_SCREEN      },
       
  1065        /* 9  */       { R_BROWSER_SETTING_SETTINGS           },
       
  1066        /* 10 */       { R_BROWSER_SETTING_ZOOM_OUT           },
       
  1067        /* 11 */       { R_BROWSER_SETTING_ZOOM_IN            },
       
  1068        /* 12 */       { R_BROWSER_SETTING_GO_TO_HOMPAGE      },
       
  1069        /* 13 */       { R_BROWSER_SETTING_PREVIOUS_PAGE      },
       
  1070        /* 14 */       { R_BROWSER_SETTING_MINIATURE_SHOW     },
       
  1071        /* 15 */       { R_BROWSER_SETTING_RELOAD             },
       
  1072        /* 16 */       { R_BROWSER_SETTING_FIND_KEYWORD       },
       
  1073        /* 17 */       { R_BROWSER_SETTING_RECENT_URLS        }, // toolbar only - recent urls drop down list
       
  1074        /* 18 */       { R_BROWSER_SETTING_SAVE_AS_BOOKMARK   },
       
  1075        /* 19 */       { R_BROWSER_SETTING_LIST_BOOKMARKS     }, // toolbar only - bookmarks drop down list
       
  1076        /* 20 */       { R_BROWSER_SETTING_GO_TO_WEB_ADDRESS  },
       
  1077        /* 21 */       { R_BROWSER_SETTING_SHOW_KEYMAP        },
       
  1078        /* 22 */       { R_BROWSER_SETTING_FULL_SCREEN        },
       
  1079 };
       
  1080 
       
  1081 
       
  1082 // Shortcut Keys command translation matrix
       
  1083 // 
       
  1084 //  translates cenrep value to browser command and setting string resource id 
       
  1085 //  for each shortcut key
       
  1086 //
       
  1087 // 
       
  1088 typedef const TInt TShortcutsCommandDecodeEntry[2];
       
  1089 
       
  1090 #define KShortcutsCommandDecodeMatrixCount      22
       
  1091 #define KShortcutsCommandDecodeMatrixCmdVal     0   // First entry is the Command Value
       
  1092 #define KShortcutsCommandDecodeMatrixStringId   1   // Second entry is the Setting String Id
       
  1093 
       
  1094 static const TShortcutsCommandDecodeEntry    ShortcutsCommandDecodeMatrix[] =
       
  1095 {
       
  1096     // Index #    Command Value                     Setting String Id
       
  1097     // = cenrep value
       
  1098     /* 0  */    { EWmlNoCmd,                        R_BROWSER_SETTING_NONE               },
       
  1099     /* 1  */    { EAknCmdHelp,                      R_BROWSER_SETTING_SHOW_HELP          },
       
  1100     /* 2  */    { EWmlCmdSwitchWindow,              R_BROWSER_SETTING_SWITCH_WINDOW      },
       
  1101     /* 3  */    { EWmlCmdSavePage,                  R_BROWSER_SETTING_SAVE_PAGE          },
       
  1102     /* 4  */    { EWmlCmdShowImages,                R_BROWSER_SETTING_VIEW_IMAGES        },
       
  1103     /* 5  */    { EWmlCmdHistory,                   R_BROWSER_SETTING_VISUAL_HISTORY     },
       
  1104     /* 6  */    { EWmlCmdFavourites,                R_BROWSER_SETTING_MANAGE_BOOKMARKS   },
       
  1105     /* 7  */    { EWmlCmdShowSubscribeList,         R_BROWSER_SETTING_SUBSCRIBE_TO_FEEDS },
       
  1106     /* 8  */    { EWmlCmdRotateDisplay,             R_BROWSER_SETTING_ROTATE_SCREEN      },
       
  1107     /* 9  */    { EWmlCmdPreferences,               R_BROWSER_SETTING_SETTINGS           },
       
  1108     /* 10 */    { EWmlCmdZoomOut,                   R_BROWSER_SETTING_ZOOM_OUT           },
       
  1109     /* 11 */    { EWmlCmdZoomIn,                    R_BROWSER_SETTING_ZOOM_IN            },
       
  1110     /* 12 */    { EWmlCmdLaunchHomePage,            R_BROWSER_SETTING_GO_TO_HOMPAGE      },
       
  1111     /* 13 */    { EWmlCmdOneStepBack,               R_BROWSER_SETTING_PREVIOUS_PAGE      },
       
  1112     /* 14 */    { EWmlCmdShowMiniature,             R_BROWSER_SETTING_MINIATURE_SHOW     },
       
  1113     /* 15 */    { EWmlCmdReload,                    R_BROWSER_SETTING_RELOAD             },
       
  1114     /* 16 */    { EWmlCmdFindKeyword,               R_BROWSER_SETTING_FIND_KEYWORD       },
       
  1115     /* 17 */    { EWmlCmdSaveAsBookmark,            R_BROWSER_SETTING_SAVE_AS_BOOKMARK   },
       
  1116     /* 18 */    { EWmlCmdGoToAddress,               R_BROWSER_SETTING_GO_TO_WEB_ADDRESS  },
       
  1117     /* 19 */    { EWmlCmdShowToolBar,               R_BROWSER_SETTING_SHOW_TOOLBAR       }, 
       
  1118     /* 20 */    { EWmlCmdShowShortcutKeymap,        R_BROWSER_SETTING_SHOW_KEYMAP        },
       
  1119     /* 21 */    { EWmlCmdEnterFullScreenBrowsing,   R_BROWSER_SETTING_FULL_SCREEN        },
       
  1120 };
       
  1121 
       
  1122 #endif  //BROWSER_PREFERENCES_H
       
  1123 
       
  1124 // End of File