browserui/browser/BrowserAppSrc/BrowserPreferences.cpp
changeset 0 84ad3b177aa3
child 1 57d5b8e231c4
equal deleted inserted replaced
-1:000000000000 0:84ad3b177aa3
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     It manages WmlBrowser's preferences
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <s32stor.h>
       
    24 #include <eikappui.h>
       
    25 #include <eikapp.h>
       
    26 #include <eikenv.h>
       
    27 
       
    28 #include <ApSettingsHandlerUi.h>
       
    29 
       
    30 #include <ApEngineConsts.h>
       
    31 #include <aputils.h>
       
    32 #include <ApDataHandler.h>
       
    33 #include <ApDataHandler.h>
       
    34 #include <ApAccessPointItem.h>
       
    35 #include <ApSelect.h>
       
    36 #include <ApListItem.h>
       
    37 #include <ApListItemList.h>
       
    38 #include <VpnAPEngine.h>
       
    39 #include <VpnApItem.h>
       
    40 #include <aknutils.h>
       
    41 
       
    42 #include <COEMAIN.H>
       
    43 #include <FeatMgr.h>
       
    44 #include <BrCtlDefs.h>
       
    45 
       
    46 #include "CommsModel.h"
       
    47 #include "ApiProvider.h"
       
    48 #include "BrowserApplication.h"
       
    49 #include "BrowserPreferences.h"
       
    50 #include "Browser.hrh"
       
    51 #include "BrowserUiVariant.hrh"
       
    52 #include <bldvariant.hrh>
       
    53 #include "commonconstants.h"
       
    54 #include "BrowserAppUi.h"
       
    55 #include "BrowserOverriddenSettings.h"
       
    56 #include "SettingsContainer.h"  // for TEncoding
       
    57 #include "BrowserUtil.h" // for Util::AllocateUrlWithSchemeL
       
    58 #include "logger.h"
       
    59 
       
    60 #include "CmApplicationSettingsUi.h"
       
    61 #include <cmmanager.h>
       
    62 #include <cmdestination.h>
       
    63 
       
    64 // CONSTANTS
       
    65 
       
    66 //Shared data values for Full Screen setting
       
    67 const TInt KBrowserFullScreenSettingDataSoftkeysOff			 = 0; //full screen
       
    68 const TInt KBrowserFullScreenSettingDataSoftkeysOn			 = 1; //softkeys displayed
       
    69 
       
    70 //Shared data values for Adaptive Bookmarks setting
       
    71 const TInt KBrowserAdaptiveBookmarksSettingDataOn            = 0;
       
    72 const TInt KBrowserAdaptiveBookmarksSettingDataHideFolder    = 1;
       
    73 const TInt KBrowserAdaptiveBookmarksSettingDataOff           = 2;
       
    74 
       
    75 // ========================= MEMBER FUNCTIONS ================================
       
    76 
       
    77 // ----------------------------------------------------------------------------
       
    78 // CBrowserPreferences::ConstructL
       
    79 // ----------------------------------------------------------------------------
       
    80 //
       
    81 void CBrowserPreferences::ConstructL( TBrowserOverriddenSettings* aSettings )
       
    82     {
       
    83     LOG_ENTERFN("CBrowserPreferences::ConstructL");
       
    84     iObservers = new ( ELeave ) CArrayPtrFlat< MPreferencesObserver >( 1 );
       
    85     iCommsModel.ApDb().AddObserverL( this );
       
    86     	
       
    87 	iApDH = CApDataHandler::NewLC( iCommsModel.CommsDb() );
       
    88 	CleanupStack::Pop();
       
    89 	
       
    90     iVpnEngine = CVpnApEngine::NewLC( &(iCommsModel.CommsDb()) );
       
    91     CleanupStack::Pop();	
       
    92 	
       
    93  	CRepository* repository = CRepository::NewL( KCRUidBrowserUiLV );
       
    94 
       
    95     if ( repository->Get( 
       
    96          KBrowserUiCommonFlags, iEngineLocalFeaturesBitmask ) != KErrNone )
       
    97         {
       
    98         // in case of problems, assume everything is off
       
    99         iEngineLocalFeaturesBitmask = 0;
       
   100         } 
       
   101     if ( repository->Get( 
       
   102         KBrowserUiCommonFlags, iUiLocalFeaturesBitmask ) != KErrNone )
       
   103         {
       
   104         // in case of problems, assume everything is off
       
   105         iUiLocalFeaturesBitmask = 0;
       
   106         } 
       
   107     if ( repository->Get( 
       
   108         KBrowserUiCdmaFlags, iCdmaUiLocalFeaturesBitmask ) != KErrNone )
       
   109         {
       
   110         // in case of problems, assume everything is off
       
   111         iCdmaUiLocalFeaturesBitmask = 0;
       
   112         } 
       
   113 
       
   114     delete repository;
       
   115 
       
   116     iRepository = CRepository::NewL( KCRUidBrowser );
       
   117 
       
   118     iEmbeddedMode = ApiProvider().IsEmbeddedModeOn(); // EFalse;
       
   119     if( iEmbeddedMode )
       
   120         {
       
   121         // embedded mode doesn't allow multiple windows feature
       
   122         iUiLocalFeaturesBitmask &= ~KBrowserMultipleWindows;
       
   123         }
       
   124     iOverriden = EFalse;
       
   125 
       
   126     SetIntValueL( KBrowserConfirmedDTMFOnce, EFalse );
       
   127 
       
   128     //Read ini values to local variables.
       
   129     TRAP_IGNORE( RestoreSettingsL() );
       
   130     
       
   131     // and overwrite some of them if needed
       
   132     if ( aSettings )
       
   133         {
       
   134         SetOverriddenSettingsL( aSettings );
       
   135         }
       
   136     }
       
   137 
       
   138 // ----------------------------------------------------------------------------
       
   139 // CBrowserPreferences::EngineLocalFeatureSupported
       
   140 // ----------------------------------------------------------------------------
       
   141 //
       
   142 TBool CBrowserPreferences::EngineLocalFeatureSupported( const TInt aFeature ) const
       
   143     {
       
   144 LOG_ENTERFN("CBrowserPreferences::EngineLocalFeatureSupported");
       
   145 BROWSER_LOG( ( _L( "EnginLocalFeatureSupported returns %d" ),
       
   146         (iEngineLocalFeaturesBitmask & aFeature) ) );
       
   147     return (iEngineLocalFeaturesBitmask & aFeature);    
       
   148     }
       
   149 
       
   150 // ----------------------------------------------------------------------------
       
   151 // CBrowserPreferences::UiLocalFeatureSupported
       
   152 // ----------------------------------------------------------------------------
       
   153 //
       
   154 TBool CBrowserPreferences::UiLocalFeatureSupported( const TInt aFeature ) const
       
   155     {
       
   156 LOG_ENTERFN("CBrowserPreferences::UiLocalFeatureSupported");
       
   157 BROWSER_LOG( ( _L( "UiLocalFeatureSupported returns %d" ),
       
   158         (iUiLocalFeaturesBitmask & aFeature) ) );
       
   159     return (iUiLocalFeaturesBitmask & aFeature);
       
   160     }
       
   161 
       
   162 
       
   163 
       
   164 
       
   165 // ----------------------------------------------------------------------------
       
   166 // CBrowserPreferences::NewLC
       
   167 // ----------------------------------------------------------------------------
       
   168 //
       
   169 CBrowserPreferences* CBrowserPreferences::NewLC
       
   170     ( MCommsModel& aCommsModel, MApiProvider& aApiProvider , TBrowserOverriddenSettings* aSettings)
       
   171 	{
       
   172 LOG_ENTERFN("CBrowserPreferences::NewLC");
       
   173 	CBrowserPreferences* result;
       
   174 	result = new ( ELeave ) CBrowserPreferences( aCommsModel, aApiProvider );
       
   175 	CleanupStack::PushL( result );
       
   176 	result->ConstructL( aSettings );	
       
   177 	return result;
       
   178 	}
       
   179 
       
   180 // ----------------------------------------------------------------------------
       
   181 // CBrowserPreferences::NewL
       
   182 // ----------------------------------------------------------------------------
       
   183 //
       
   184 CBrowserPreferences* CBrowserPreferences::NewL
       
   185 	( MCommsModel& aCommsModel, MApiProvider& aApiProvider, TBrowserOverriddenSettings* aSettings )
       
   186 	{
       
   187 LOG_ENTERFN("CBrowserPreferences::NewL");
       
   188 	CBrowserPreferences* result;
       
   189 	result = CBrowserPreferences::NewLC( aCommsModel, aApiProvider, aSettings );
       
   190 	CleanupStack::Pop();
       
   191 	return result;	
       
   192 	}
       
   193 
       
   194 // ----------------------------------------------------------------------------
       
   195 // CBrowserPreferences::CBrowserPreferences
       
   196 // ----------------------------------------------------------------------------
       
   197 //
       
   198 CBrowserPreferences::CBrowserPreferences( MCommsModel& aCommsModel,
       
   199                                             MApiProvider& aApiProvider) : 
       
   200     iApiProvider( aApiProvider ),
       
   201     iCommsModel( aCommsModel ),
       
   202     iEmbeddedMode( EFalse )
       
   203     {
       
   204     LOG_ENTERFN("CBrowserPreferences::CBrowserPreferences");
       
   205     iAllPreferences.iCookies = EWmlSettingsCookieAllow;
       
   206     iAllPreferences.iHttpSecurityWarnings = ETrue;
       
   207     iAllPreferences.iDownloadsOpen = ETrue;    
       
   208     iAllPreferences.iConnDialogs = ETrue;
       
   209     iAllPreferences.iHomePgURL = NULL;
       
   210     iAllPreferences.iSearchPgURL = NULL;
       
   211     iAllPreferences.iQueryOnExit = EFalse;
       
   212     iAllPreferences.iSendReferrer = EFalse;
       
   213     iAllPreferences.iAssocVpn = KWmlNoDefaultAccessPoint;
       
   214     iAllPreferences.iDefaultAccessPoint = KWmlNoDefaultAccessPoint;
       
   215     iAllPreferences.iDefaultSnapId = KWmlNoDefaultSnapId;
       
   216     iAllPreferences.iDefaultAPDetails = NULL;
       
   217     iAllPreferences.iShortCutFuncHomePg = NULL;
       
   218     iAllPreferences.iShortCutFuncBkMark = NULL;
       
   219     iAllPreferences.iShortCutFuncFindKeyWord = NULL;
       
   220     iAllPreferences.iShortCutFuncPrePage = NULL;
       
   221     iAllPreferences.iShortCutFuncSwitchWin = NULL;
       
   222     iAllPreferences.iShortCutFuncMiniImage = NULL;
       
   223     iAllPreferences.iShortCutFuncFullScreen = NULL;
       
   224     iAllPreferences.iShortCutFuncGoAddr = NULL;
       
   225     iAllPreferences.iShortCutFuncZoomIn = NULL;
       
   226     iAllPreferences.iShortCutFuncZoomOut = NULL;
       
   227     iAllPreferences.iShortCutFuncZoomMode = NULL;
       
   228     }
       
   229 
       
   230 // ----------------------------------------------------------------------------
       
   231 // CBrowserPreferences::~CBrowserPreferences
       
   232 // ----------------------------------------------------------------------------
       
   233 //
       
   234 CBrowserPreferences::~CBrowserPreferences()
       
   235     {
       
   236     LOG_ENTERFN("CBrowserPreferences::~CBrowserPreferences");
       
   237     delete iObservers;
       
   238     delete iApDH;
       
   239     delete iVpnEngine;
       
   240     delete iVpnItem;
       
   241     iCommsModel.ApDb().RemoveObserver( this );
       
   242     delete iSelfDownloadContentTypes;
       
   243     iSelfDownloadContentTypes = 0;
       
   244 
       
   245     // All Settings struct - for observers
       
   246     delete iAllPreferences.iSearchPgURL;
       
   247     iAllPreferences.iSearchPgURL = NULL;
       
   248     delete iAllPreferences.iHomePgURL;
       
   249     iAllPreferences.iHomePgURL = NULL;
       
   250 	delete iAllPreferences.iDefaultAPDetails;
       
   251     delete iRepository;
       
   252 
       
   253     // For short cut functions
       
   254     delete iAllPreferences.iShortCutFuncHomePg;
       
   255     iAllPreferences.iShortCutFuncHomePg = NULL; 
       
   256 
       
   257     delete iAllPreferences.iShortCutFuncBkMark;
       
   258     iAllPreferences.iShortCutFuncBkMark = NULL; 
       
   259 
       
   260     delete iAllPreferences.iShortCutFuncFindKeyWord;
       
   261     iAllPreferences.iShortCutFuncFindKeyWord = NULL; 
       
   262 
       
   263     delete iAllPreferences.iShortCutFuncPrePage;
       
   264     iAllPreferences.iShortCutFuncPrePage = NULL; 
       
   265 
       
   266     delete iAllPreferences.iShortCutFuncSwitchWin;
       
   267     iAllPreferences.iShortCutFuncSwitchWin = NULL; 
       
   268 
       
   269     delete iAllPreferences.iShortCutFuncMiniImage;
       
   270     iAllPreferences.iShortCutFuncMiniImage = NULL; 
       
   271 
       
   272     delete iAllPreferences.iShortCutFuncFullScreen;
       
   273     iAllPreferences.iShortCutFuncFullScreen = NULL; 
       
   274 
       
   275     delete iAllPreferences.iShortCutFuncGoAddr;
       
   276     iAllPreferences.iShortCutFuncGoAddr = NULL; 
       
   277 
       
   278     delete iAllPreferences.iShortCutFuncZoomIn;
       
   279     iAllPreferences.iShortCutFuncZoomIn = NULL; 
       
   280 
       
   281     delete iAllPreferences.iShortCutFuncZoomOut;
       
   282     iAllPreferences.iShortCutFuncZoomOut = NULL; 
       
   283 
       
   284     delete iAllPreferences.iShortCutFuncZoomMode;
       
   285     iAllPreferences.iShortCutFuncZoomMode = NULL; 
       
   286 
       
   287     delete iAllPreferences.iUrlSuffixList;  
       
   288     iAllPreferences.iUrlSuffixList = NULL;  
       
   289     }
       
   290 
       
   291 // ----------------------------------------------------------------------------
       
   292 // CBrowserPreferences::AddObserverL
       
   293 // ----------------------------------------------------------------------------
       
   294 //
       
   295 void CBrowserPreferences::AddObserverL( MPreferencesObserver* anObserver )
       
   296     {
       
   297     LOG_ENTERFN("CBrowserPreferences::AddObserverL");
       
   298     iObservers->AppendL( anObserver );
       
   299     }
       
   300 
       
   301 // ----------------------------------------------------------------------------
       
   302 // CBrowserPreferences::RemoveObserver
       
   303 // ----------------------------------------------------------------------------
       
   304 //
       
   305 void CBrowserPreferences::RemoveObserver( MPreferencesObserver* anObserver )
       
   306     {
       
   307     LOG_ENTERFN("CBrowserPreferences::RemoveObserver");
       
   308     TInt i( 0 );
       
   309     TInt count = iObservers->Count();
       
   310     for ( i = 0; i < count; i++ )
       
   311         {
       
   312         if ( iObservers->At( i ) == anObserver )
       
   313             {
       
   314             iObservers->Delete( i );
       
   315             break; 
       
   316             }
       
   317         }
       
   318     }
       
   319 
       
   320 // ----------------------------------------------------------------------------
       
   321 // CBrowserPreferences::NotifyObserversL
       
   322 // ----------------------------------------------------------------------------
       
   323 //
       
   324 void CBrowserPreferences::NotifyObserversL( TPreferencesEvent aEvent,
       
   325         TBrCtlDefs::TBrCtlSettings aSettingType = TBrCtlDefs::ESettingsUnknown )
       
   326     {
       
   327     LOG_ENTERFN("CBrowserPreferences::NotifyObserversL");
       
   328     TInt i;
       
   329     TInt count = iObservers->Count();
       
   330     
       
   331     // Passed struct of all preferences to observers
       
   332     for ( i = 0; i < count; i++ )
       
   333         {
       
   334         iObservers->At( i )->HandlePreferencesChangeL( 
       
   335                                                     aEvent, 
       
   336                                                     iAllPreferences,
       
   337                                                     aSettingType );
       
   338         }
       
   339     }
       
   340 
       
   341 // ----------------------------------------------------------------------------
       
   342 // CBrowserPreferences::RestoreSettingsL
       
   343 // ----------------------------------------------------------------------------
       
   344 //
       
   345 void CBrowserPreferences::RestoreSettingsL()
       
   346     {
       
   347     LOG_ENTERFN("CBrowserPreferences::RestoreSettingsL");
       
   348 //
       
   349 //  READ USER VARIATED SETTINGS
       
   350 //
       
   351     
       
   352 	//Read auto load content setting
       
   353     iAllPreferences.iAutoLoadContent = GetIntValue( KBrowserNGImagesEnabled );
       
   354     
       
   355     //Read font size
       
   356     iAllPreferences.iFontSize = GetIntValue( KBrowserNGFontSize );
       
   357 
       
   358 	// Read Allow Cookies setting
       
   359     if ( GetIntValue( KBrowserNGCookiesEnabled ) )
       
   360         {    
       
   361         iAllPreferences.iCookies = EWmlSettingsCookieAllow;
       
   362         }
       
   363     else
       
   364         {
       
   365         iAllPreferences.iCookies = EWmlSettingsCookieReject;
       
   366         }
       
   367         
       
   368     // Read ECMA Setting
       
   369     if ( GetIntValue( KBrowserNGECMAScriptSupport ) )
       
   370         {
       
   371         iAllPreferences.iEcma = EWmlSettingsECMAEnable;
       
   372         }
       
   373     else
       
   374         {
       
   375         iAllPreferences.iEcma = EWmlSettingsECMADisable;
       
   376         }
       
   377 
       
   378     // Read IMEI Setting
       
   379     if ( IMEI_NOTIFICATION )
       
   380         {
       
   381         if ( GetIntValue( KBrowserIMEINotification ) )
       
   382             {
       
   383             iAllPreferences.iIMEINotification = EWmlSettingsIMEIEnable;
       
   384             }
       
   385         else
       
   386             {
       
   387             iAllPreferences.iIMEINotification = EWmlSettingsIMEIDisable;
       
   388             }
       
   389         }
       
   390     
       
   391     TInt encoding;
       
   392 	iRepository->Get( KBrowserNGEncoding, encoding );
       
   393     iAllPreferences.iEncoding = ( TUint32 ) encoding;
       
   394     
       
   395     iAllPreferences.iScriptLog = GetIntValue( KBrowserNGScriptLog ) ;
       
   396 
       
   397     //Read Fullscreen setting
       
   398     TInt value;
       
   399     value = GetIntValue ( KBrowserNGFullScreen );
       
   400 
       
   401     switch ( value )
       
   402         {
       
   403         case KBrowserFullScreenSettingDataSoftkeysOff:
       
   404         	{
       
   405             iAllPreferences.iFullScreen = EWmlSettingsFullScreenFullScreen;
       
   406             break;
       
   407         	}
       
   408   
       
   409         case KBrowserFullScreenSettingDataSoftkeysOn:
       
   410             {
       
   411             iAllPreferences.iFullScreen = EWmlSettingsFullScreenSoftkeysOnly;
       
   412             break;
       
   413             }
       
   414  
       
   415         default:
       
   416             {
       
   417             break;
       
   418             }
       
   419         }
       
   420 
       
   421 	  iAllPreferences.iSendReferrer = (TBool) GetIntValue( KBrowserSendReferrerHeader );
       
   422 
       
   423 
       
   424     //Read adaptive bookmarks setting
       
   425     if (ADAPTIVEBOOKMARKS)
       
   426         {
       
   427         TInt adBm;
       
   428         adBm = GetIntValue ( KBrowserNGAdaptiveBookmarks );
       
   429 
       
   430         switch(adBm)
       
   431             {
       
   432             case (KBrowserAdaptiveBookmarksSettingDataOn):
       
   433                 {
       
   434                 iAllPreferences.iAdaptiveBookmarks = 
       
   435                                             EWmlSettingsAdaptiveBookmarksOn;
       
   436                 break;
       
   437                 }
       
   438             case (KBrowserAdaptiveBookmarksSettingDataHideFolder):
       
   439                 {
       
   440                 iAllPreferences.iAdaptiveBookmarks = 
       
   441                                     EWmlSettingsAdaptiveBookmarksHideFolder;
       
   442                 break;
       
   443                 }
       
   444             case (KBrowserAdaptiveBookmarksSettingDataOff):
       
   445                 {
       
   446                 iAllPreferences.iAdaptiveBookmarks = 
       
   447                                     EWmlSettingsAdaptiveBookmarksOff;
       
   448                 break;
       
   449                 }
       
   450             default:
       
   451                 {
       
   452                 break;
       
   453                 }
       
   454             }        
       
   455         }
       
   456 
       
   457 //  
       
   458 //  READ OPERATOR VARIATED SETTINGS
       
   459 //
       
   460 
       
   461 	iAllPreferences.iHomePgType = 
       
   462                 ( TWmlSettingsHomePage ) GetIntValue( KBrowserNGHomepageType );
       
   463     iAllPreferences.iPageOverview = GetIntValue ( 
       
   464 		                                    KBrowserNGPageOverview );
       
   465 	iAllPreferences.iBackList = GetIntValue ( 
       
   466 		                                    KBrowserNGBackList );
       
   467 	iAllPreferences.iAutoRefresh = GetIntValue ( 
       
   468 		                                    KBrowserNGAutoRefresh );	
       
   469     
       
   470     if(PROGRESSIVE_DOWNLOAD)
       
   471 	    {
       
   472     	iAllPreferences.iDownloadsOpen = GetIntValue ( KBrowserNGOpenDownloads );
       
   473     	}
       
   474     else
       
   475     	{
       
   476     	iAllPreferences.iDownloadsOpen = EFalse;
       
   477     	}
       
   478 		                                    
       
   479     //Read suppress security UI setting
       
   480     iAllPreferences.iHTTPSecuritySupressed = GetIntValue ( KBrowserSecurityUI );
       
   481 
       
   482     //Read show connection queries setting
       
   483     iAllPreferences.iConnDialogs = GetIntValue( KBrowserConnectionDialogs );
       
   484     
       
   485     if( !iAllPreferences.iHTTPSecuritySupressed )
       
   486         {
       
   487         // Read HTTP security warnings setting
       
   488 	    iAllPreferences.iHttpSecurityWarnings = GetIntValue ( 
       
   489 		                            KBrowserNGShowSecurityWarnings );
       
   490         }
       
   491     else 
       
   492         {
       
   493         //we don't want to see sec warning because they're supressed
       
   494         iAllPreferences.iHttpSecurityWarnings = EFalse;
       
   495         }    
       
   496     
       
   497     // Media Volume uses different SD ini. Revert to Browser SD ini after use
       
   498     iAllPreferences.iMediaVolume = GetIntValue( KBrowserMediaVolumeControl );
       
   499     
       
   500     // Pop up Blocking
       
   501     iAllPreferences.iPopupBlocking = GetIntValue( KBrowserNGPopupBlocking );
       
   502 
       
   503     // Form Data Saving
       
   504     iAllPreferences.iFormDataSaving = (TWmlSettingsFormData) GetIntValue( KBrowserFormDataSaving );
       
   505 
       
   506     // Access Keys
       
   507     iAllPreferences.iAccessKeys = (TBool) GetIntValue( KBrowserNGAccessKeys );
       
   508     
       
   509     // The leaving functions come at the end
       
   510 
       
   511     // Search Page
       
   512     if ( iAllPreferences.iSearchPgURL )
       
   513         {
       
   514         delete iAllPreferences.iSearchPgURL;
       
   515         iAllPreferences.iSearchPgURL = NULL;
       
   516         }
       
   517         
       
   518     // Web reed feeds settings - begin
       
   519     iAllPreferences.iAutomaticUpdatingAP = GetIntValue( KBrowserNGAutomaticUpdatingAccessPoint );
       
   520     
       
   521     iAllPreferences.iAutomaticUpdatingWhileRoaming = GetIntValue( KBrowserNGAutomaticUpdatingWhileRoaming );
       
   522     
       
   523     // Web reed feeds settings - end
       
   524     if (CBrowserAppUi::Static()->OrientationCanBeChanged() )
       
   525         {
       
   526         iAllPreferences.iRotateDisplay = GetIntValue( KBrowserNGRotateDisplay );
       
   527         }
       
   528     else
       
   529         {
       
   530         iAllPreferences.iRotateDisplay = 0;
       
   531         }
       
   532       if ( iAllPreferences.iUrlSuffixList )
       
   533         {
       
   534         delete iAllPreferences.iUrlSuffixList;
       
   535         iAllPreferences.iUrlSuffixList = NULL;
       
   536         }
       
   537     iAllPreferences.iUrlSuffixList = HBufC::NewL( KUrlSuffixMaxLength );
       
   538     TPtr suffix = iAllPreferences.iUrlSuffixList->Des();
       
   539     GetStringValueL( KBrowserUrlSuffix, KBrowserUrlSuffix, suffix );
       
   540 
       
   541     // If something fails for an option, the default value will be used
       
   542     TInt ap;
       
   543 
       
   544     // Read Accesss point selection mode for advanced settings
       
   545     const TInt selectionMode = GetIntValue( KBrowserAccessPointSelectionMode );
       
   546     switch ( selectionMode )
       
   547         {
       
   548         case EBrowserCenRepApSelModeUserDefined: 
       
   549              {
       
   550              iAllPreferences.iAccessPointSelectionMode = EConnectionMethod; 
       
   551              break; 
       
   552              }
       
   553         case EBrowserCenRepApSelModeAlwaysAsk: 
       
   554              {
       
   555              iAllPreferences.iAccessPointSelectionMode = EAlwaysAsk; 
       
   556              break; 
       
   557              }
       
   558         case EBrowserCenRepApSelModeDestination:
       
   559              {
       
   560              iAllPreferences.iAccessPointSelectionMode = EDestination; 
       
   561              break; 
       
   562              }
       
   563         default: // Default to Always ask.
       
   564              {
       
   565              iAllPreferences.iAccessPointSelectionMode = EAlwaysAsk; 
       
   566              break; 
       
   567              }
       
   568         }
       
   569  
       
   570     //we differentiate by connecting with a Snap or an access point                         
       
   571    if (iAllPreferences.iAccessPointSelectionMode == EConnectionMethod)
       
   572    	    {   		
       
   573         //Read default AP setting
       
   574         ap = GetIntValue( KBrowserDefaultAccessPoint );
       
   575 
       
   576         SetDefaultAccessPointL( ap );   
       
   577 		}
       
   578     else if (iAllPreferences.iAccessPointSelectionMode == EDestination)
       
   579 		{
       
   580    		iAllPreferences.iDefaultSnapId = GetIntValue( KBrowserNGDefaultSnapId );
       
   581 		}
       
   582 	
       
   583     // For Short Cut keys
       
   584     if ( iAllPreferences.iShortCutFuncHomePg )
       
   585         {
       
   586         delete iAllPreferences.iShortCutFuncHomePg;
       
   587         iAllPreferences.iShortCutFuncHomePg = NULL;
       
   588         }
       
   589     iAllPreferences.iShortCutFuncHomePg = HBufC::NewL( KShortCutFuncStringLength );
       
   590     TPtr func1 = iAllPreferences.iShortCutFuncHomePg->Des();
       
   591     GetStringValueL( KBrowserNGShortCutFuncHomePg, KShortCutFuncStringLength, func1 );
       
   592 
       
   593     if ( iAllPreferences.iShortCutFuncBkMark )
       
   594         {
       
   595         delete iAllPreferences.iShortCutFuncBkMark;
       
   596         iAllPreferences.iShortCutFuncBkMark = NULL;
       
   597         }
       
   598     iAllPreferences.iShortCutFuncBkMark = HBufC::NewL( KShortCutFuncStringLength );
       
   599     TPtr func2 = iAllPreferences.iShortCutFuncBkMark->Des();
       
   600     GetStringValueL( KBrowserNGShortCutFuncBkMark, KShortCutFuncStringLength, func2 );
       
   601 
       
   602     if ( iAllPreferences.iShortCutFuncFindKeyWord )
       
   603         {
       
   604         delete iAllPreferences.iShortCutFuncFindKeyWord;
       
   605         iAllPreferences.iShortCutFuncFindKeyWord = NULL;
       
   606         }
       
   607     iAllPreferences.iShortCutFuncFindKeyWord = HBufC::NewL( KShortCutFuncStringLength );
       
   608     TPtr func3 = iAllPreferences.iShortCutFuncFindKeyWord->Des();
       
   609     GetStringValueL( KBrowserNGShortCutFuncFindKeyWord, KShortCutFuncStringLength, func3 );
       
   610 
       
   611     if ( iAllPreferences.iShortCutFuncPrePage )
       
   612         {
       
   613         delete iAllPreferences.iShortCutFuncPrePage;
       
   614         iAllPreferences.iShortCutFuncPrePage = NULL;
       
   615         }
       
   616     iAllPreferences.iShortCutFuncPrePage = HBufC::NewL( KShortCutFuncStringLength );
       
   617     TPtr func4 = iAllPreferences.iShortCutFuncPrePage->Des();
       
   618     GetStringValueL( KBrowserNGShortCutFuncPrePage, KShortCutFuncStringLength, func4 );
       
   619 
       
   620     if ( iAllPreferences.iShortCutFuncSwitchWin )
       
   621         {
       
   622         delete iAllPreferences.iShortCutFuncSwitchWin;
       
   623         iAllPreferences.iShortCutFuncSwitchWin = NULL;
       
   624         }
       
   625     iAllPreferences.iShortCutFuncSwitchWin = HBufC::NewL( KShortCutFuncStringLength );
       
   626     TPtr func5 = iAllPreferences.iShortCutFuncSwitchWin->Des();
       
   627     GetStringValueL( KBrowserNGShortCutFuncSwitchWin, KShortCutFuncStringLength, func5 );
       
   628 
       
   629     if ( iAllPreferences.iShortCutFuncMiniImage )
       
   630         {
       
   631         delete iAllPreferences.iShortCutFuncMiniImage;
       
   632         iAllPreferences.iShortCutFuncMiniImage = NULL;
       
   633         }
       
   634     iAllPreferences.iShortCutFuncMiniImage = HBufC::NewL( KShortCutFuncStringLength );
       
   635     TPtr func6 = iAllPreferences.iShortCutFuncMiniImage->Des();
       
   636     GetStringValueL( KBrowserNGShortCutFuncMiniImage, KShortCutFuncStringLength, func6 );
       
   637 
       
   638     if ( iAllPreferences.iShortCutFuncGoAddr )
       
   639         {
       
   640         delete iAllPreferences.iShortCutFuncGoAddr;
       
   641         iAllPreferences.iShortCutFuncGoAddr = NULL;
       
   642         }
       
   643     iAllPreferences.iShortCutFuncGoAddr = HBufC::NewL( KShortCutFuncStringLength );
       
   644     TPtr func7 = iAllPreferences.iShortCutFuncGoAddr->Des();
       
   645     GetStringValueL( KBrowserNGShortCutFuncGoAddr, KShortCutFuncStringLength, func7 );
       
   646 
       
   647     if ( iAllPreferences.iShortCutFuncZoomIn )
       
   648         {
       
   649         delete iAllPreferences.iShortCutFuncZoomIn;
       
   650         iAllPreferences.iShortCutFuncZoomIn = NULL;
       
   651         }
       
   652     iAllPreferences.iShortCutFuncZoomIn = HBufC::NewL( KShortCutFuncStringLength );
       
   653     TPtr func8 = iAllPreferences.iShortCutFuncZoomIn->Des();
       
   654     GetStringValueL( KBrowserNGShortCutFuncZoomIn, KShortCutFuncStringLength, func8 );
       
   655 
       
   656     if ( iAllPreferences.iShortCutFuncZoomOut )
       
   657         {
       
   658         delete iAllPreferences.iShortCutFuncZoomOut;
       
   659         iAllPreferences.iShortCutFuncZoomOut = NULL;
       
   660         }
       
   661     iAllPreferences.iShortCutFuncZoomOut = HBufC::NewL( KShortCutFuncStringLength );
       
   662     TPtr func9 = iAllPreferences.iShortCutFuncZoomOut->Des();
       
   663     GetStringValueL( KBrowserNGShortCutFuncZoomOut, KShortCutFuncStringLength, func9 );
       
   664 
       
   665 /*
       
   666     if ( iAllPreferences.iShortCutFuncZoomMode )
       
   667         {
       
   668         delete iAllPreferences.iShortCutFuncZoomMode;
       
   669         iAllPreferences.iShortCutFuncZoomMode = NULL;
       
   670         }
       
   671     iAllPreferences.iShortCutFuncZoomMode = HBufC::NewL( KShortCutFuncStringLength );
       
   672     TPtr func11 = iAllPreferences.iShortCutFuncZoomMode->Des();
       
   673     GetStringValueL( KBrowserNGShortCutFuncZoomMode, KShortCutFuncStringLength, func11 );
       
   674 */
       
   675 
       
   676     if ( iAllPreferences.iShortCutFuncFullScreen )
       
   677         {
       
   678         delete iAllPreferences.iShortCutFuncFullScreen;
       
   679         iAllPreferences.iShortCutFuncFullScreen = NULL;
       
   680         }
       
   681     iAllPreferences.iShortCutFuncFullScreen = HBufC::NewL( KShortCutFuncStringLength );
       
   682     TPtr func10 = iAllPreferences.iShortCutFuncFullScreen->Des();
       
   683     GetStringValueL( KBrowserNGShortCutFuncFullScreen, KShortCutFuncStringLength, func10 );
       
   684 
       
   685     // For Configuring Toolbar Buttons
       
   686     iAllPreferences.iToolbarOnOff       = GetIntValue( KToolbarOnOff );
       
   687     
       
   688     iAllPreferences.iToolbarButton1Cmd  = GetIntValue( KToolbarButton1Cmd );
       
   689     iAllPreferences.iToolbarButton2Cmd  = GetIntValue( KToolbarButton2Cmd );
       
   690     iAllPreferences.iToolbarButton3Cmd  = GetIntValue( KToolbarButton3Cmd );
       
   691     iAllPreferences.iToolbarButton4Cmd  = GetIntValue( KToolbarButton4Cmd );
       
   692     iAllPreferences.iToolbarButton5Cmd  = GetIntValue( KToolbarButton5Cmd );
       
   693     iAllPreferences.iToolbarButton6Cmd  = GetIntValue( KToolbarButton6Cmd );
       
   694     iAllPreferences.iToolbarButton7Cmd  = GetIntValue( KToolbarButton7Cmd );
       
   695     
       
   696     // For configuring Shortcut Keys 
       
   697     iAllPreferences.iShortcutKeysForQwerty  = GetIntValue( KShortcutKeysForQwerty );
       
   698 	
       
   699     iAllPreferences.iShortcutKey1Cmd  = GetIntValue( KShortcutKey1Cmd );
       
   700     iAllPreferences.iShortcutKey2Cmd  = GetIntValue( KShortcutKey2Cmd );
       
   701     iAllPreferences.iShortcutKey3Cmd  = GetIntValue( KShortcutKey3Cmd );
       
   702     iAllPreferences.iShortcutKey4Cmd  = GetIntValue( KShortcutKey4Cmd );
       
   703     iAllPreferences.iShortcutKey5Cmd  = GetIntValue( KShortcutKey5Cmd );
       
   704     iAllPreferences.iShortcutKey6Cmd  = GetIntValue( KShortcutKey6Cmd );
       
   705     iAllPreferences.iShortcutKey7Cmd  = GetIntValue( KShortcutKey7Cmd );
       
   706     iAllPreferences.iShortcutKey8Cmd  = GetIntValue( KShortcutKey8Cmd );
       
   707     iAllPreferences.iShortcutKey9Cmd  = GetIntValue( KShortcutKey9Cmd );
       
   708     iAllPreferences.iShortcutKey0Cmd  = GetIntValue( KShortcutKey0Cmd );
       
   709     iAllPreferences.iShortcutKeyStarCmd  = GetIntValue( KShortcutKeyStarCmd );
       
   710     iAllPreferences.iShortcutKeyHashCmd  = GetIntValue( KShortcutKeyHashCmd );
       
   711 
       
   712 
       
   713     iAllPreferences.iZoomLevelMin = GetIntValue( KBrowserNGZoomMin );
       
   714     iAllPreferences.iZoomLevelMax = GetIntValue( KBrowserNGZoomMax );
       
   715     iAllPreferences.iZoomLevelDefault = GetIntValue( KBrowserNGZoomDefault );
       
   716             
       
   717     iAllPreferences.iMaxRecentUrlsToShow = GetIntValue( KBrowserNGMaxRecentUrls );
       
   718 
       
   719     }
       
   720 
       
   721 
       
   722 // ----------------------------------------------------------------------------
       
   723 // CBrowserPreferences::AllPreferencesL
       
   724 // ----------------------------------------------------------------------------
       
   725 //
       
   726 const TPreferencesValues& CBrowserPreferences::AllPreferencesL()
       
   727     {
       
   728     return iAllPreferences;
       
   729     }
       
   730 
       
   731 // ----------------------------------------------------------------------------
       
   732 // CBrowserPreferences::VpnDataL
       
   733 // ----------------------------------------------------------------------------
       
   734 //
       
   735 TBool CBrowserPreferences::VpnDataL( TUint aDefaultAccessPoint, CVpnApItem& aVpnItem )
       
   736     {
       
   737     TBool ret( EFalse );
       
   738     
       
   739     if( iVpnEngine->IsVpnApL( aDefaultAccessPoint ) )
       
   740         {
       
   741         iVpnEngine->VpnDataL( aDefaultAccessPoint, aVpnItem );
       
   742         ret = ETrue;
       
   743         }
       
   744     
       
   745     return ret;
       
   746     }
       
   747 
       
   748 // ----------------------------------------------------------------------------
       
   749 // CBrowserPreferences::SetDefaultAccessPointL
       
   750 // ----------------------------------------------------------------------------
       
   751 //
       
   752 void CBrowserPreferences::SetDefaultAccessPointL( TUint aDefaultAccessPoint, TUint aAssocVpn )
       
   753 	{
       
   754     LOG_ENTERFN("CBrowserPreferences::SetDefaultAccessPointL");
       
   755 	BROWSER_LOG( ( _L( " aDefaultAccessPoint: %u" ), aDefaultAccessPoint ) );
       
   756 
       
   757     //get the connection identifier based on the connection type
       
   758     switch ( AccessPointSelectionMode() )
       
   759         {
       
   760         //get the destination identifyer based on the snap Id
       
   761         case EDestination:
       
   762         	{
       
   763 		    RCmManager        cmManager;
       
   764 		    cmManager.OpenL();
       
   765 
       
   766             // if user-defined destination then check that destination still exists.
       
   767             // if it doesn't, reset access point to always ask and homepage to blank access point home page.
       
   768             TUint snapId = iAllPreferences.iDefaultSnapId;
       
   769             if (snapId != KWmlNoDefaultSnapId)
       
   770                 {            
       
   771     			TRAPD(err, RCmDestination dest = cmManager.DestinationL( snapId ));
       
   772     			if (err != KErrNone)
       
   773     			    {
       
   774     			    aDefaultAccessPoint = KWmlNoDefaultAccessPoint;
       
   775         	    	aAssocVpn = KWmlNoDefaultAccessPoint;
       
   776         	    	
       
   777         			SetAccessPointSelectionModeL(EAlwaysAsk );
       
   778         			if (iAllPreferences.iHomePgType == EWmlSettingsHomePageAccessPoint)
       
   779         				{
       
   780         				HBufC* buf = HBufC::NewLC( KMaxHomePgUrlLength );  // cleanupstack
       
   781             			TPtr ptr( buf->Des() );
       
   782             			// read user defined home page from SD shouldn't get any error
       
   783                         HomePageUrlL( ptr, ETrue );
       
   784                         SetHomePageUrlL(ptr);
       
   785             			CleanupStack::PopAndDestroy( buf );
       
   786         				}
       
   787     			    }
       
   788                 }
       
   789  		    cmManager.Close();
       
   790 
       
   791 			break;
       
   792         	}
       
   793         	
       
   794         //if connecting with Iap Id
       
   795         case EConnectionMethod:
       
   796             {
       
   797             // if user-defined access point then check that access point still exists.
       
   798             // if it doesn't, reset access point to always ask and homepage to blank access point home page.
       
   799   	        CApListItem* apItem = iCommsModel.AccessPointsL()->ItemForUid( aDefaultAccessPoint );
       
   800 	        if (apItem == NULL)
       
   801 		        {
       
   802     	    	aDefaultAccessPoint = KWmlNoDefaultAccessPoint;
       
   803     	    	aAssocVpn = KWmlNoDefaultAccessPoint;
       
   804     	    	delete iAllPreferences.iDefaultAPDetails;
       
   805     			iAllPreferences.iDefaultAPDetails = NULL;
       
   806     			SetAccessPointSelectionModeL(EAlwaysAsk );
       
   807     			if (iAllPreferences.iHomePgType == EWmlSettingsHomePageAccessPoint)
       
   808     				{
       
   809     				HBufC* buf = HBufC::NewLC( KMaxHomePgUrlLength );  // cleanupstack
       
   810         			TPtr ptr( buf->Des() );
       
   811         			// read user defined home page from SD shouldn't get any error
       
   812                     HomePageUrlL( ptr, ETrue );
       
   813                     SetHomePageUrlL(ptr);
       
   814         			CleanupStack::PopAndDestroy( buf );
       
   815     				}
       
   816 		    	}
       
   817             
       
   818 		    break;	
       
   819         	}
       
   820 
       
   821         default:
       
   822         	{
       
   823         	break;	
       
   824         	}
       
   825         }
       
   826     
       
   827     	
       
   828 	// check web feeds for deleted access point
       
   829 	CApListItem* apItem = iCommsModel.AccessPointsL()->ItemForUid( iAllPreferences.iAutomaticUpdatingAP );
       
   830 	if (apItem == NULL)
       
   831 		{
       
   832         SetAutomaticUpdatingApL( KWmlNoDefaultAccessPoint );
       
   833 		}
       
   834     bool checkAPMode = ( (iAllPreferences.iAccessPointSelectionMode != EDestination) && (iAllPreferences.iAccessPointSelectionMode != EAlwaysAsk) );
       
   835     if( ( KWmlNoDefaultAccessPoint != aDefaultAccessPoint ) && ( checkAPMode ) && iVpnEngine->IsVpnApL( aDefaultAccessPoint ) )
       
   836         {
       
   837         delete iVpnItem;
       
   838         iVpnItem = NULL;
       
   839 
       
   840         iVpnItem = CVpnApItem::NewLC();
       
   841         CleanupStack::Pop();
       
   842 
       
   843         iVpnEngine->VpnDataL( aDefaultAccessPoint, *iVpnItem );
       
   844 
       
   845         TUint32 ass( aDefaultAccessPoint );
       
   846         iVpnItem->ReadUint( EApVpnWapAccessPointID, ass );
       
   847         aAssocVpn = ass;            
       
   848 
       
   849         // get real WAP id
       
   850         TUint32 ap( aDefaultAccessPoint );
       
   851         iVpnItem->ReadUint( EApVpnRealWapID, ap );
       
   852         aDefaultAccessPoint = ap;
       
   853         }    
       
   854     BROWSER_LOG( ( _L( "VPN OK" ) ) );
       
   855 	iAllPreferences.iDefaultAccessPoint = aDefaultAccessPoint;
       
   856 	iAllPreferences.iAssocVpn = aAssocVpn;
       
   857 	
       
   858 	CApAccessPointItem* api = CApAccessPointItem::NewLC();//maybe we can optimise this too	    
       
   859 	BROWSER_LOG( ( _L( "CApAccessPointItem OK" ) ) );
       
   860     TInt err;
       
   861     if  ( iOverridenSettings )
       
   862         {
       
   863         iCustomAp = iOverridenSettings->GetBrowserSetting( 
       
   864                                                 EBrowserOverSettingsCustomAp );
       
   865         }
       
   866     if ( ( iOverridenSettings ) &&  iCustomAp  )
       
   867         {
       
   868 	    TRAP( err, iApDH->AccessPointDataL( iCustomAp, *api ) );
       
   869         if ( err != KErrNone )
       
   870             {
       
   871             iCustomAp = 0;
       
   872 	        TRAP( err, iApDH->AccessPointDataL( iAllPreferences.iDefaultAccessPoint, *api ) );
       
   873             }
       
   874         }
       
   875     else
       
   876         {
       
   877 	    TRAP( err, iApDH->AccessPointDataL( 
       
   878 	                            iAllPreferences.iDefaultAccessPoint, *api ) );	        
       
   879         }
       
   880     BROWSER_LOG( ( _L( " AccessPointDataL: %d" ), err ) );
       
   881 	//Reset default AP pointer and delete the data
       
   882 	delete iAllPreferences.iDefaultAPDetails;
       
   883 	iAllPreferences.iDefaultAPDetails = NULL;
       
   884 	if  ( err != KErrNone )//Let's select the first 
       
   885 		{
       
   886 #ifndef __WINSCW__ //we will not select on Wins (defaultap will be assigned a uid indicating that there is 
       
   887 					//no default ap) but rather let ConnMan show the Conn Dlg
       
   888 		// The first valid access point has to be selected if exists
       
   889 		LOG_WRITE("WE SHOULD NOT BE HERE!!!");
       
   890 		CApSelect* apSelect = CApSelect::NewLC
       
   891 			(
       
   892 			iCommsModel.CommsDb(),
       
   893 			KEApIspTypeAll, //KEApIspTypeWAPMandatory, 
       
   894 			EApBearerTypeAll,
       
   895 			KEApSortNameAscending,
       
   896 			EIPv4 | EIPv6
       
   897 			);
       
   898 		if ( apSelect->MoveToFirst() )
       
   899 			{
       
   900 			iAllPreferences.iDefaultAccessPoint = apSelect->Uid();
       
   901 			iApDH->AccessPointDataL( iAllPreferences.iDefaultAccessPoint, *api );
       
   902 			iAllPreferences.iDefaultAPDetails = api;//save the ap details
       
   903 			}
       
   904 		else
       
   905 			{
       
   906 			iAllPreferences.iDefaultAccessPoint = KWmlNoDefaultAccessPoint;
       
   907 			iAllPreferences.iDefaultAPDetails = NULL;
       
   908 			delete api;
       
   909 			}
       
   910 		CleanupStack::PopAndDestroy(); // apSelect
       
   911 		CleanupStack::Pop();//api
       
   912 #else
       
   913 		iAllPreferences.iDefaultAccessPoint = KWmlNoDefaultAccessPoint;
       
   914 		iAllPreferences.iDefaultAPDetails = NULL;
       
   915 		CleanupStack::PopAndDestroy( api );		
       
   916 #endif//WINSCW	
       
   917 		}
       
   918 	else
       
   919 		{
       
   920 		iAllPreferences.iDefaultAPDetails = api;//store new default accesspoint details
       
   921 		CleanupStack::Pop( ); // api			
       
   922 		}
       
   923 	/*
       
   924 	* If VPN set VPN AP ID to default access point!
       
   925 	*/
       
   926 	if( KWmlNoDefaultAccessPoint != iAllPreferences.iAssocVpn )
       
   927 	    {
       
   928 	    iAllPreferences.iDefaultAccessPoint = iAllPreferences.iAssocVpn;
       
   929 	    }
       
   930     if( !iEmbeddedMode )
       
   931         {
       
   932 	    //Store ini value / gateway 
       
   933         SetIntValueL ( KBrowserDefaultAccessPoint, 
       
   934                                         iAllPreferences.iDefaultAccessPoint );
       
   935         }
       
   936     NotifyObserversL( EPreferencesItemChange );
       
   937 	    
       
   938 	//  LOG_LEAVEFN("CBrowserPreferences::SetDefaultAccessPointL");
       
   939 	}
       
   940 	
       
   941 	
       
   942 // ----------------------------------------------------------------------------
       
   943 // CBrowserPreferences::SetDefaultSnapId: DestNetChange
       
   944 // ----------------------------------------------------------------------------
       
   945 //
       
   946  void CBrowserPreferences::SetDefaultSnapId (TUint aSnapId)
       
   947 		{
       
   948 	
       
   949 		//storing the value of the default snap ID
       
   950 		iAllPreferences.iDefaultSnapId = aSnapId;
       
   951 		                                        
       
   952         SetIntValueL ( KBrowserNGDefaultSnapId, 
       
   953                                         iAllPreferences.iDefaultSnapId );
       
   954 	
       
   955 		}
       
   956 
       
   957 
       
   958 // ----------------------------------------------------------------------------
       
   959 // CBrowserPreferences::SetAutoLoadContentL
       
   960 // ----------------------------------------------------------------------------
       
   961 //
       
   962 void CBrowserPreferences::SetAutoLoadContentL( TInt aAutoLoadContent )
       
   963     {
       
   964     LOG_ENTERFN("CBrowserPreferences::SetAutoLoadContentL");
       
   965     if ( aAutoLoadContent != iAllPreferences.iAutoLoadContent )
       
   966         {
       
   967         iAllPreferences.iAutoLoadContent = aAutoLoadContent;
       
   968 
       
   969         // Store value in Shared Data and forward new setting to BrCtl
       
   970         if( !iEmbeddedMode )
       
   971             {
       
   972             SetIntValueL( KBrowserNGImagesEnabled, 
       
   973                                     iAllPreferences.iAutoLoadContent );
       
   974             }
       
   975         NotifyObserversL( EPreferencesItemChange, 
       
   976                                         TBrCtlDefs::ESettingsAutoLoadImages );
       
   977         }
       
   978     }
       
   979 
       
   980 // ----------------------------------------------------------------------------
       
   981 // CBrowserPreferences::SetPageOverviewL
       
   982 // ----------------------------------------------------------------------------
       
   983 //
       
   984 void CBrowserPreferences::SetPageOverviewL( TBool aPageOverview )
       
   985     {
       
   986     LOG_ENTERFN("CBrowserPreferences::SetPageOverviewL");
       
   987     if ( aPageOverview != iAllPreferences.iPageOverview )
       
   988         {
       
   989         iAllPreferences.iPageOverview = aPageOverview;
       
   990 
       
   991         // Store value in Shared Data and forward new setting to BrCtl
       
   992         if( !iEmbeddedMode )
       
   993             {
       
   994             SetIntValueL( KBrowserNGPageOverview, 
       
   995                                         iAllPreferences.iPageOverview );
       
   996             }
       
   997         NotifyObserversL( EPreferencesItemChange,
       
   998                             TBrCtlDefs::ESettingsPageOverview);
       
   999         }
       
  1000     }
       
  1001     
       
  1002 // ----------------------------------------------------------------------------
       
  1003 // CBrowserPreferences::SetBackListL
       
  1004 // ----------------------------------------------------------------------------
       
  1005 //
       
  1006 void CBrowserPreferences::SetBackListL( TBool aBackList )
       
  1007     {
       
  1008     LOG_ENTERFN("CBrowserPreferences::SetBackListL");
       
  1009     if ( aBackList != iAllPreferences.iBackList )
       
  1010         {
       
  1011         iAllPreferences.iBackList = aBackList;
       
  1012 
       
  1013         // Store value in Shared Data and forward new setting to BrCtl
       
  1014         if( !iEmbeddedMode )
       
  1015             {
       
  1016             SetIntValueL( KBrowserNGBackList, 
       
  1017                                         iAllPreferences.iBackList );
       
  1018             }
       
  1019         NotifyObserversL( EPreferencesItemChange,
       
  1020                             TBrCtlDefs::ESettingsBackList);
       
  1021         }
       
  1022     }
       
  1023     
       
  1024 // ----------------------------------------------------------------------------
       
  1025 // CBrowserPreferences::SetAutoRefreshL
       
  1026 // ----------------------------------------------------------------------------
       
  1027 //
       
  1028 void CBrowserPreferences::SetAutoRefreshL( TBool aAutoRefresh )
       
  1029     {
       
  1030     LOG_ENTERFN("CBrowserPreferences::SetAutoRefreshL");
       
  1031     if ( aAutoRefresh != iAllPreferences.iAutoRefresh )
       
  1032         {
       
  1033         iAllPreferences.iAutoRefresh = aAutoRefresh;
       
  1034 
       
  1035         // Store value in Shared Data and forward new setting to BrCtl
       
  1036         if( !iEmbeddedMode )
       
  1037             {
       
  1038             SetIntValueL( KBrowserNGAutoRefresh, 
       
  1039                                         iAllPreferences.iAutoRefresh );
       
  1040             }
       
  1041         NotifyObserversL( EPreferencesItemChange,
       
  1042                             TBrCtlDefs::ESettingsAutoRefresh);
       
  1043         }
       
  1044     }    
       
  1045 
       
  1046 // ----------------------------------------------------------------------------
       
  1047 // CBrowserPreferences::SetTextWrapL
       
  1048 // ----------------------------------------------------------------------------
       
  1049 //
       
  1050 void CBrowserPreferences::SetTextWrapL( TBool aTextWrap )
       
  1051     {
       
  1052     LOG_ENTERFN("CBrowserPreferences::SetTextWrapL");
       
  1053     if ( aTextWrap != iAllPreferences.iTextWrap )
       
  1054         {
       
  1055         iAllPreferences.iTextWrap = aTextWrap;
       
  1056 
       
  1057         // Store value in Shared Data and forward new setting to BrCtl
       
  1058         if ( !iEmbeddedMode )
       
  1059             {
       
  1060             SetIntValueL( KBrowserTextWrapEnabled, iAllPreferences.iTextWrap );
       
  1061             }            
       
  1062         NotifyObserversL( EPreferencesItemChange, 
       
  1063                                         TBrCtlDefs::ESettingsTextWrapEnabled );
       
  1064         }
       
  1065     }
       
  1066 
       
  1067 // ----------------------------------------------------------------------------
       
  1068 // CBrowserPreferences::SetFontSizeL
       
  1069 // ----------------------------------------------------------------------------
       
  1070 //
       
  1071 void CBrowserPreferences::SetFontSizeL( TInt aFontSize )
       
  1072     {
       
  1073     LOG_ENTERFN("CBrowserPreferences::SetFontSizeL");
       
  1074     if ( aFontSize != iAllPreferences.iFontSize )
       
  1075         {
       
  1076         iAllPreferences.iFontSize = aFontSize;
       
  1077 
       
  1078         // Store value in Shared Data and forward new setting to BrCtl
       
  1079         if( !iEmbeddedMode )
       
  1080             {
       
  1081             SetIntValueL( KBrowserNGFontSize, iAllPreferences.iFontSize );
       
  1082             }
       
  1083         NotifyObserversL( EPreferencesItemChange, 
       
  1084                                             TBrCtlDefs::ESettingsFontSize );
       
  1085         }
       
  1086     }
       
  1087 
       
  1088 // ----------------------------------------------------------------------------
       
  1089 // CBrowserPreferences::SetEncodingL
       
  1090 // ----------------------------------------------------------------------------
       
  1091 //
       
  1092 void CBrowserPreferences::SetEncodingL( TUint32 aEncoding )
       
  1093     {
       
  1094     LOG_ENTERFN("CBrowserPreferences::SetEncodingL");
       
  1095     if ( aEncoding != iAllPreferences.iEncoding )
       
  1096         {
       
  1097         iAllPreferences.iEncoding = aEncoding;
       
  1098     
       
  1099         // Store value in Shared Data and forward new setting to BrCtl
       
  1100         if( !iEmbeddedMode )
       
  1101             {
       
  1102             SetIntValueL ( KBrowserNGEncoding, 
       
  1103                             ( TInt ) iAllPreferences.iEncoding );
       
  1104             }
       
  1105         NotifyObserversL( EPreferencesItemChange, 
       
  1106                                         TBrCtlDefs::ESettingsCharacterset );
       
  1107         }
       
  1108     }
       
  1109 
       
  1110 // ----------------------------------------------------------------------------
       
  1111 // CBrowserPreferences::SetScriptLogL
       
  1112 // ----------------------------------------------------------------------------
       
  1113 //
       
  1114 void CBrowserPreferences::SetScriptLogL( TUint32 aScriptLog )
       
  1115     {
       
  1116     LOG_ENTERFN("CBrowserPreferences::SetScriptLogL");
       
  1117     if ( aScriptLog != iAllPreferences.iScriptLog )
       
  1118         {
       
  1119         iAllPreferences.iScriptLog = aScriptLog;
       
  1120     
       
  1121         // Store value in Shared Data and forward new setting to BrCtl
       
  1122         if( !iEmbeddedMode )
       
  1123             {
       
  1124             TBool ret = SetIntValueL ( KBrowserNGScriptLog, 
       
  1125                             ( TInt ) iAllPreferences.iScriptLog );
       
  1126             }
       
  1127         NotifyObserversL( EPreferencesItemChange, 
       
  1128                                         TBrCtlDefs::ESettingsScriptLog );
       
  1129         }
       
  1130     }
       
  1131 
       
  1132 // ----------------------------------------------------------------------------
       
  1133 // CBrowserPreferences::SetAdaptiveBookmarksL
       
  1134 // ----------------------------------------------------------------------------
       
  1135 //
       
  1136 void CBrowserPreferences::SetAdaptiveBookmarksL( 
       
  1137                             TWmlSettingsAdaptiveBookmarks aAdaptiveBookmarks )
       
  1138     {
       
  1139     LOG_ENTERFN( "CBrowserPreferences::SetAdaptiveBookmarksL" );
       
  1140     
       
  1141     if ( ADAPTIVEBOOKMARKS )
       
  1142         {
       
  1143         if ( aAdaptiveBookmarks != iAllPreferences.iAdaptiveBookmarks )
       
  1144             {
       
  1145             iAllPreferences.iAdaptiveBookmarks = aAdaptiveBookmarks;
       
  1146             
       
  1147             if( !iEmbeddedMode )
       
  1148                 {
       
  1149 
       
  1150             switch( iAllPreferences.iAdaptiveBookmarks )
       
  1151                 {
       
  1152 				case (EWmlSettingsAdaptiveBookmarksOn):
       
  1153                     {
       
  1154              
       
  1155        				SetIntValueL ( KBrowserNGAdaptiveBookmarks, 
       
  1156        					KBrowserAdaptiveBookmarksSettingDataOn );                   
       
  1157                     break;
       
  1158                     }
       
  1159                 case (EWmlSettingsAdaptiveBookmarksHideFolder):
       
  1160                     {
       
  1161                     SetIntValueL ( KBrowserNGAdaptiveBookmarks, 
       
  1162                     	KBrowserAdaptiveBookmarksSettingDataHideFolder );
       
  1163                     break;
       
  1164                     }
       
  1165                 case (EWmlSettingsAdaptiveBookmarksOff):
       
  1166                     {
       
  1167                     SetIntValueL ( KBrowserNGAdaptiveBookmarks, 
       
  1168                     	KBrowserAdaptiveBookmarksSettingDataOff );
       
  1169                     break;
       
  1170                     }
       
  1171                     default:
       
  1172                         {
       
  1173                         break;
       
  1174                         }
       
  1175                     }
       
  1176                 }
       
  1177             NotifyObserversL( EPreferencesItemChange ); // Bookmarks View is interested
       
  1178             }
       
  1179         }
       
  1180     }
       
  1181 
       
  1182 // ---------------------------------------------------------
       
  1183 // CBrowserPreferences::SetFullScreenL
       
  1184 // ---------------------------------------------------------
       
  1185 //
       
  1186 void CBrowserPreferences::SetFullScreenL( TWmlSettingsFullScreen aFullScreen )
       
  1187     {
       
  1188     LOG_ENTERFN("CBrowserPreferences::SetFullScreenL");
       
  1189   
       
  1190     if ( aFullScreen != iAllPreferences.iFullScreen )
       
  1191         {
       
  1192         iAllPreferences.iFullScreen = aFullScreen;
       
  1193         if( !iEmbeddedMode )
       
  1194             {
       
  1195             switch ( iAllPreferences.iFullScreen )
       
  1196                 {
       
  1197 				case EWmlSettingsFullScreenSoftkeysOnly:
       
  1198                     {
       
  1199                     SetIntValueL ( KBrowserNGFullScreen, 
       
  1200                     	KBrowserFullScreenSettingDataSoftkeysOn );
       
  1201                     break;
       
  1202                     }
       
  1203                 case EWmlSettingsFullScreenFullScreen:
       
  1204                     {
       
  1205                     SetIntValueL ( KBrowserNGFullScreen, 
       
  1206                     	KBrowserFullScreenSettingDataSoftkeysOff );
       
  1207                     break;
       
  1208                     }
       
  1209                 default:
       
  1210                     {
       
  1211                     break;
       
  1212                     }    
       
  1213                 }
       
  1214             }
       
  1215         NotifyObserversL( EPreferencesItemChange ); // ContentView is interested
       
  1216         }
       
  1217     }
       
  1218 
       
  1219 // ----------------------------------------------------------------------------
       
  1220 // CBrowserPreferences::SetCookiesL
       
  1221 // ----------------------------------------------------------------------------
       
  1222 //
       
  1223 void CBrowserPreferences::SetCookiesL( TWmlSettingsCookies aCookies )
       
  1224     {
       
  1225     LOG_ENTERFN("CBrowserPreferences::SetCookiesL");
       
  1226     if ( aCookies != iAllPreferences.iCookies )
       
  1227         {
       
  1228         iAllPreferences.iCookies = aCookies;
       
  1229 
       
  1230         // Store value in Shared Data and forward new setting to BrCtl
       
  1231         if( !iEmbeddedMode )
       
  1232             {
       
  1233             SetIntValueL( KBrowserNGCookiesEnabled, 
       
  1234                                             iAllPreferences.iCookies );
       
  1235             }
       
  1236         NotifyObserversL( EPreferencesItemChange, 
       
  1237                                         TBrCtlDefs::ESettingsCookiesEnabled );
       
  1238         }
       
  1239     }
       
  1240 
       
  1241 // ----------------------------------------------------------------------------
       
  1242 // CBrowserPreferences::SetEcmaL
       
  1243 // ----------------------------------------------------------------------------
       
  1244 //
       
  1245 void CBrowserPreferences::SetEcmaL( TWmlSettingsECMA aEcma )
       
  1246     {
       
  1247     LOG_ENTERFN("CBrowserPreferences::SetEcmaL");
       
  1248     if ( aEcma != iAllPreferences.iEcma )
       
  1249         {
       
  1250         iAllPreferences.iEcma = aEcma;
       
  1251 
       
  1252         // Store value in Shared Data and forward new setting to BrCtl
       
  1253         if( !iEmbeddedMode )
       
  1254             {
       
  1255 			SetIntValueL( KBrowserNGECMAScriptSupport, 
       
  1256 			                                    iAllPreferences.iEcma );
       
  1257             }
       
  1258         NotifyObserversL( EPreferencesItemChange, 
       
  1259                                     TBrCtlDefs::ESettingsECMAScriptEnabled );
       
  1260         }
       
  1261     }
       
  1262 
       
  1263 // ----------------------------------------------------------------------------
       
  1264 // CBrowserPreferences::SetDownloadsOpen
       
  1265 // ----------------------------------------------------------------------------
       
  1266 //
       
  1267 void CBrowserPreferences::SetDownloadsOpenL( TBool aOpen )
       
  1268     {
       
  1269     LOG_ENTERFN("CBrowserPreferences::SetDownloadsOpenL");
       
  1270     if ( aOpen != iAllPreferences.iDownloadsOpen )
       
  1271         {
       
  1272         iAllPreferences.iDownloadsOpen = aOpen;
       
  1273         if( !iEmbeddedMode )
       
  1274             {
       
  1275 			SetIntValueL ( KBrowserNGOpenDownloads, 
       
  1276 				        (TInt) iAllPreferences.iDownloadsOpen );
       
  1277             }
       
  1278         NotifyObserversL( EPreferencesItemChange, 
       
  1279                                     TBrCtlDefs::ESettingsAutoOpenDownloads );
       
  1280         }
       
  1281     }
       
  1282 
       
  1283 
       
  1284 // ----------------------------------------------------------------------------
       
  1285 // CBrowserPreferences::SetHttpSecurityWarningsL
       
  1286 // ----------------------------------------------------------------------------
       
  1287 //
       
  1288 void CBrowserPreferences::SetHttpSecurityWarningsL( TBool aWarningsOn )
       
  1289     {
       
  1290     LOG_ENTERFN("CBrowserPreferences::SetHttpSecurityWarningsL");
       
  1291     if ( aWarningsOn != iAllPreferences.iHttpSecurityWarnings )
       
  1292         {
       
  1293         iAllPreferences.iHttpSecurityWarnings = aWarningsOn;
       
  1294         if( !iEmbeddedMode )
       
  1295             {
       
  1296 			SetIntValueL ( KBrowserNGShowSecurityWarnings, 
       
  1297 				        (TInt) iAllPreferences.iHttpSecurityWarnings );
       
  1298             }
       
  1299         NotifyObserversL( EPreferencesItemChange, 
       
  1300                                     TBrCtlDefs::ESettingsSecurityWarnings );
       
  1301         }
       
  1302     }
       
  1303 
       
  1304 // ----------------------------------------------------------------------------
       
  1305 // CBrowserPreferences::SetIMEINotification
       
  1306 // ----------------------------------------------------------------------------
       
  1307 //
       
  1308 void CBrowserPreferences::SetIMEINotificationL( 
       
  1309                                         TWmlSettingsIMEI aIMEINotification )
       
  1310     {
       
  1311     LOG_ENTERFN("CBrowserPreferences::SetIMEINotificationL");
       
  1312     if ( IMEI_NOTIFICATION )
       
  1313         {
       
  1314         if ( aIMEINotification != iAllPreferences.iIMEINotification )
       
  1315             {
       
  1316             iAllPreferences.iIMEINotification = aIMEINotification;
       
  1317             
       
  1318             // Store value in Shared Data and forward new setting to BrCtl
       
  1319             if( !iEmbeddedMode )
       
  1320                 {
       
  1321                 SetIntValueL( KBrowserIMEINotification, 
       
  1322                                         iAllPreferences.iIMEINotification );
       
  1323                 }
       
  1324             NotifyObserversL( EPreferencesItemChange, 
       
  1325                                     TBrCtlDefs::ESettingsIMEINotifyEnabled );
       
  1326             }
       
  1327         }
       
  1328     }
       
  1329 
       
  1330 // ----------------------------------------------------------------------------
       
  1331 // CBrowserPreferences::HandleApDbEventL
       
  1332 // ----------------------------------------------------------------------------
       
  1333 //
       
  1334 void CBrowserPreferences::HandleApDbEventL( TEvent anEvent )
       
  1335     {
       
  1336     LOG_ENTERFN("CBrowserPreferences::HandleApDbEventL");
       
  1337     if ( anEvent == EDbChanged )//maybe somebody has modified the AP (not very likely though)
       
  1338         {
       
  1339         SetDefaultAccessPointL( iAllPreferences.iDefaultAccessPoint );
       
  1340         }    
       
  1341     }
       
  1342 
       
  1343 // ----------------------------------------------------------------------------
       
  1344 // CBrowserPreferences::HomePageUrlL
       
  1345 // Get the user defined home page URL from shared data file.
       
  1346 // ----------------------------------------------------------------------------
       
  1347 //
       
  1348 TInt CBrowserPreferences::HomePageUrlL( TDes& aUrl, TBool aForceLoadFromSD ) const
       
  1349     {
       
  1350 LOG_ENTERFN("CBrowserPreferences::HomePageUrlL");
       
  1351     TInt homePgFound( KErrNotFound );
       
  1352     TBool homepage = UiLocalFeatureSupported( KBrowserUiHomePageSetting );
       
  1353     TWmlSettingsHomePage pgtype = HomePageType();
       
  1354 BROWSER_LOG( ( _L( " pgtype: %d" ), pgtype ) );
       
  1355 
       
  1356 	if (homepage)
       
  1357 		{
       
  1358 		if (aForceLoadFromSD || (pgtype != EWmlSettingsHomePageAccessPoint))
       
  1359 			{
       
  1360 			// if we are requiring a force load from the shared data, or our homepage
       
  1361 		    // is set to be something other than the access point's home page, get
       
  1362 		    // the value of the home page from the shared data
       
  1363 			homePgFound = GetStringValueL( KBrowserNGHomepageURL, KMaxHomePgUrlLength, aUrl );
       
  1364 			}
       
  1365 		else if ((iAllPreferences.iAccessPointSelectionMode == EConnectionMethod) && 
       
  1366 				 (pgtype == EWmlSettingsHomePageAccessPoint))
       
  1367         {
       
  1368 			// The user has a defined access point, and wants to use the access point's
       
  1369     		// home page
       
  1370 BROWSER_LOG( ( _L( "HomePageUrl, Access Point" ) ) );
       
  1371         
       
  1372         TUint defaultAp = DefaultAccessPoint();
       
  1373         if ( defaultAp != KWmlNoDefaultAccessPoint ) // There is an access point defined
       
  1374             {
       
  1375             CApAccessPointItem* apItem = iAllPreferences.iDefaultAPDetails;
       
  1376             if ( apItem )
       
  1377                 {
       
  1378                 const HBufC* defaultHP = apItem->ReadConstLongTextL( EApWapStartPage );
       
  1379                 if ( defaultHP->Length() )
       
  1380                     {
       
  1381                     aUrl.Zero();
       
  1382                     aUrl.Append( *defaultHP );
       
  1383                     homePgFound = KErrNone;
       
  1384                     }
       
  1385                 }
       
  1386             else
       
  1387             	{
       
  1388 BROWSER_LOG( ( _L( "HomePageUrl, Read from Central Repository" ) ) );
       
  1389             	homePgFound = GetStringValueL( KBrowserNGHomepageURL, KMaxHomePgUrlLength, aUrl );
       
  1390             	}
       
  1391             }
       
  1392         }
       
  1393         }
       
  1394 BROWSER_LOG( ( _L( "CBrowserPreferences::HomePageUrlL returns %d" ), homePgFound ) );
       
  1395     return homePgFound;
       
  1396     }
       
  1397 
       
  1398 // ----------------------------------------------------------------------------
       
  1399 // CBrowserPreferences::HomePageFromIapL
       
  1400 // Get the home page URL from belongs to the access point.
       
  1401 // ----------------------------------------------------------------------------
       
  1402 //
       
  1403 TInt CBrowserPreferences::HomePageFromIapL( TDes& aUrl, TUint aIap ) const
       
  1404     {
       
  1405 LOG_ENTERFN("CBrowserPreferences::HomePageFromIapL");
       
  1406     TInt homePgFound( KErrNotFound );
       
  1407 
       
  1408     CApListItem* apItem = iCommsModel.AccessPointsL()->ItemForUid( aIap );
       
  1409     if ( apItem )
       
  1410         {
       
  1411         TPtrC defaultHP( apItem->StartPage() );
       
  1412         if ( defaultHP.Length() )
       
  1413             {
       
  1414             aUrl.Zero();
       
  1415             aUrl.Append( defaultHP );
       
  1416             homePgFound = KErrNone;
       
  1417             }
       
  1418         }
       
  1419 BROWSER_LOG( ( _L( "CBrowserPreferences::HomePageFromIapL returns %d" ), homePgFound ) );
       
  1420     return homePgFound;
       
  1421     }
       
  1422 
       
  1423 // ----------------------------------------------------------------------------
       
  1424 // CBrowserPreferences::SearchPageUrlL
       
  1425 // Get the user defined search page URL from shared data file.
       
  1426 // ----------------------------------------------------------------------------
       
  1427 //
       
  1428 TPtrC CBrowserPreferences::SearchPageUrlL()
       
  1429     {
       
  1430 LOG_ENTERFN("CBrowserPreferences::SearchPageUrlL");    
       
  1431     TBool urlTooBig = EFalse;
       
  1432     TInt error = KErrTooBig;
       
  1433     TInt length = 512;
       
  1434 
       
  1435     do
       
  1436         {
       
  1437         HBufC* temp = HBufC::NewL( length );
       
  1438         if ( iAllPreferences.iSearchPgURL )
       
  1439             {
       
  1440             delete iAllPreferences.iSearchPgURL;
       
  1441             iAllPreferences.iSearchPgURL = NULL;
       
  1442             }
       
  1443 
       
  1444         iAllPreferences.iSearchPgURL = temp;
       
  1445         TPtr ptr = iAllPreferences.iSearchPgURL->Des();
       
  1446         // Here should handle the error variable, but its still not clear
       
  1447         // how big can a CenRep string be.( KMaxUnicodeStringLength )
       
  1448 		error = iRepository->Get( KBrowserNGSearchPageURL, ptr);
       
  1449 
       
  1450         if ( error == KErrTooBig )
       
  1451             {
       
  1452             if ( length >= KMaxSearchPgUrlLength )
       
  1453                 {
       
  1454                 urlTooBig = ETrue;
       
  1455                 break;
       
  1456                 }
       
  1457             else
       
  1458                 length = length * 2;
       
  1459             }
       
  1460         } while ( error == KErrTooBig );
       
  1461 
       
  1462     // If the URL exceeds the limit, return NULL.
       
  1463     if ( urlTooBig )
       
  1464         {
       
  1465         delete iAllPreferences.iSearchPgURL;
       
  1466         iAllPreferences.iSearchPgURL = NULL;
       
  1467         iAllPreferences.iSearchPgURL = KNullDesC().AllocL();
       
  1468         }
       
  1469 
       
  1470     NotifyObserversL( EPreferencesItemChange );
       
  1471     
       
  1472 #ifdef _DEBUG
       
  1473     TPtrC logString = *iAllPreferences.iSearchPgURL;
       
  1474     BROWSER_LOG( ( _L( "CBrowserPreferences::SearchPageUrlL returns %S" ), &logString ) );
       
  1475 #endif // _DEBUG
       
  1476     return iAllPreferences.iSearchPgURL->Des();
       
  1477     }
       
  1478 
       
  1479 // ----------------------------------------------------------------------------
       
  1480 // CBrowserPreferences::SetPopupBlockingL
       
  1481 // ----------------------------------------------------------------------------
       
  1482 //
       
  1483 void CBrowserPreferences::SetPopupBlockingL( TBool aPopupBlocking )
       
  1484     {
       
  1485     LOG_ENTERFN("CBrowserPreferences::SetPopupBlockingL");
       
  1486     if ( aPopupBlocking != iAllPreferences.iPopupBlocking )
       
  1487         {
       
  1488         iAllPreferences.iPopupBlocking = aPopupBlocking;
       
  1489         SetIntValueL( KBrowserNGPopupBlocking, iAllPreferences.iPopupBlocking );
       
  1490         }
       
  1491     }
       
  1492 
       
  1493 // ----------------------------------------------------------------------------
       
  1494 // CBrowserPreferences::SetFormDataSavingL
       
  1495 // ----------------------------------------------------------------------------
       
  1496 //
       
  1497 void CBrowserPreferences::SetFormDataSavingL( TWmlSettingsFormData aFormDataSaving )
       
  1498     {
       
  1499     LOG_ENTERFN("CBrowserPreferences::SetFormDataSavingL");
       
  1500     if ( aFormDataSaving != iAllPreferences.iFormDataSaving )
       
  1501         {
       
  1502         iAllPreferences.iFormDataSaving = aFormDataSaving;
       
  1503 
       
  1504 
       
  1505         // TO DO: Add to cenrep
       
  1506         SetIntValueL( KBrowserFormDataSaving, 
       
  1507                         iAllPreferences.iFormDataSaving );
       
  1508         }
       
  1509     NotifyObserversL( EPreferencesItemChange,
       
  1510                             TBrCtlDefs::ESettingsAutoFormFillEnabled );
       
  1511     }    
       
  1512 
       
  1513 // ----------------------------------------------------------------------------
       
  1514 // CBrowserPreferences::GetIntValue
       
  1515 // ----------------------------------------------------------------------------
       
  1516 //
       
  1517 TInt CBrowserPreferences::GetIntValue( TUint32 aKey) const
       
  1518     {
       
  1519 LOG_ENTERFN("CBrowserPreferences::GetIntValue");
       
  1520     TInt retVal = 0; 
       
  1521       
       
  1522 	if ( iRepository )
       
  1523 	   	{
       
  1524     	iRepository->Get(aKey, retVal);	
       
  1525     	}
       
  1526                 
       
  1527 BROWSER_LOG( ( _L( "CBrowserPreferences::GetIntValue returns %d" ), retVal ) );
       
  1528     return retVal;
       
  1529     }
       
  1530     									   
       
  1531 // ----------------------------------------------------------------------------
       
  1532 // CBrowserPreferences::SetIntValueL
       
  1533 // ----------------------------------------------------------------------------
       
  1534 //
       
  1535 TBool CBrowserPreferences::SetIntValueL ( TUint32 aKey, const TInt& aValue )
       
  1536     {
       
  1537 LOG_ENTERFN("CBrowserPreferences::SetIntValueL");
       
  1538 BROWSER_LOG( ( _L( "aValue: %d" ), aValue ) );
       
  1539     
       
  1540     // Log setting value BEFORE the change
       
  1541     #ifdef I__BROWSER_LOG_ENABLED
       
  1542         TInt preValue;
       
  1543     	iRepository->Get( aKey, preValue );
       
  1544         BROWSER_LOG( ( _L( "Prechange CenRep setting value: %d" ), preValue ) );
       
  1545     #endif // I__BROWSER_LOG_ENABLED
       
  1546     
       
  1547     TBool retVal=EFalse;
       
  1548 	if ( iRepository && ( KErrNone == iRepository->Set( aKey, aValue ) ) )
       
  1549     	{
       
  1550     	retVal = ETrue;
       
  1551     	}	
       
  1552 
       
  1553     // Log setting value AFTER the change
       
  1554     #ifdef I__BROWSER_LOG_ENABLED
       
  1555         TInt postValue;
       
  1556     	iRepository->Get( aKey, postValue );
       
  1557         BROWSER_LOG( ( _L( "Postchange CenRep setting value: %d" ), postValue ) );
       
  1558     #endif // I__BROWSER_LOG_ENABLED
       
  1559 
       
  1560     BROWSER_LOG( ( _L( "CBrowserPreferences::SetIntValueL returns %d" ), retVal ) );
       
  1561     return retVal;
       
  1562     }	
       
  1563 
       
  1564 // ----------------------------------------------------------------------------
       
  1565 // CBrowserPreferences::GetStringValueL
       
  1566 // ----------------------------------------------------------------------------
       
  1567 //
       
  1568 HBufC* CBrowserPreferences::GetStringValueL ( TUint32 aKey ) const
       
  1569     {
       
  1570 LOG_ENTERFN("CBrowserPreferences::GetStringValueL(TUint32)");
       
  1571     HBufC* retVal = NULL;
       
  1572     TFileName value;
       
  1573     TInt err( KErrNotFound );
       
  1574 
       
  1575 	
       
  1576 	if( iRepository )
       
  1577 		{
       
  1578 		err = iRepository->Get( aKey, value );
       
  1579 		}
       
  1580 
       
  1581     if ( err == KErrNone )
       
  1582        	{
       
  1583        	retVal = HBufC::NewL( value.Length() );
       
  1584        	TPtr ptr = retVal->Des();
       
  1585        	ptr.Copy ( value );
       
  1586        	}
       
  1587         
       
  1588     #ifdef _DEBUG
       
  1589         TPtrC logString = *retVal;
       
  1590         BROWSER_LOG( ( _L( "CBrowserPreferences::GetStringValueL returns %S" ), &logString ) );
       
  1591     #endif // _DEBUG
       
  1592     
       
  1593     return retVal;
       
  1594     }
       
  1595 
       
  1596 // ----------------------------------------------------------------------------
       
  1597 // CBrowserPreferences::GetStringValueL
       
  1598 // ----------------------------------------------------------------------------
       
  1599 //
       
  1600 TInt CBrowserPreferences::GetStringValueL( 
       
  1601 		TUint32 aKey, TInt aMaxBufSize, 
       
  1602 		TDes& aBuf) const
       
  1603     {
       
  1604 LOG_ENTERFN("CBrowserPreferences::GetStringValueL(TUint32,TInt,TDes&)");
       
  1605     // Not sure this works, but CRepository has no information about the return
       
  1606     // values of the methods. 
       
  1607     // So dont know if iRepository->Get returns with an errorid on error,therefore
       
  1608     // error = iRepository->Get( aKey, ptr ) may not work.
       
  1609     TInt length( 256 );
       
  1610     HBufC* value = HBufC::NewL( length );
       
  1611     TPtr ptr = value->Des();
       
  1612     TInt error;
       
  1613     
       
  1614 	error = iRepository->Get( aKey, ptr );
       
  1615 
       
  1616     for( length=length*2; (error==KErrTooBig) && (length<aMaxBufSize); length=length*2)
       
  1617         {
       
  1618         delete value;
       
  1619         value = HBufC::NewL( length );
       
  1620         ptr = value->Des();
       
  1621         
       
  1622 		error = iRepository->Get( aKey, ptr );
       
  1623         }
       
  1624     if( error == KErrNone )
       
  1625         {
       
  1626         aBuf.Zero();
       
  1627         aBuf.Append( ptr );
       
  1628         }
       
  1629     delete value;
       
  1630     
       
  1631     BROWSER_LOG( ( _L( "CBrowserPreferences::GetStringValueL(TUint32,TInt,TDes&) returns %d" ),
       
  1632         error ) );
       
  1633     return error;
       
  1634     }
       
  1635 
       
  1636 
       
  1637 // ----------------------------------------------------------------------------
       
  1638 // CBrowserPreferences::SetStringValueL
       
  1639 // ----------------------------------------------------------------------------
       
  1640 //
       
  1641 TBool CBrowserPreferences::SetStringValueL( TUint32 aKey, const TDesC& aValue )
       
  1642     {
       
  1643 LOG_ENTERFN("CBrowserPreferences::SetStringValueL");
       
  1644 
       
  1645     // Log setting value BEFORE the change
       
  1646     #ifdef _DEBUG
       
  1647         TPtrC paramVal = aValue;
       
  1648         BROWSER_LOG( ( _L( "aValue %S" ), &paramVal ) );
       
  1649         HBufC* doNothing = HBufC::NewL( 512 );
       
  1650         TPtr preChange = doNothing->Des();
       
  1651     	iRepository->Get( aKey, preChange );	
       
  1652         BROWSER_LOG( ( _L( "Prechange CenRep setting value: %S" ), &preChange ) );
       
  1653         delete doNothing;
       
  1654     #endif // _DEBUG
       
  1655 
       
  1656     TBool retVal=EFalse;
       
  1657 	
       
  1658 	if ( iRepository && ( KErrNone == iRepository->Set( aKey, aValue ) ) )
       
  1659     	{
       
  1660     	retVal = ETrue;
       
  1661     	}	
       
  1662     // Log setting value AFTER the change
       
  1663     #ifdef _DEBUG
       
  1664         HBufC* doNothing2 = HBufC::NewL( 512 );
       
  1665         TPtr postChange = doNothing2->Des();
       
  1666    		iRepository->Get( aKey, postChange );	
       
  1667         
       
  1668         BROWSER_LOG( ( _L( "Postchange CenRep setting value: %S" ), &postChange ) );
       
  1669         delete doNothing2;
       
  1670     #endif // _DEBUG
       
  1671     
       
  1672     BROWSER_LOG( ( _L( "CBrowserPreferences::SetStringValueL returns %d" ), retVal) );
       
  1673     return retVal;
       
  1674     }
       
  1675 
       
  1676 // ----------------------------------------------------------------------------
       
  1677 // CBrowserPreferences::SetOverridenSettingsL
       
  1678 // ----------------------------------------------------------------------------
       
  1679 //
       
  1680 void CBrowserPreferences::SetOverriddenSettingsL(TBrowserOverriddenSettings* aSettings)
       
  1681     {
       
  1682 LOG_ENTERFN("CBrowserPreferences::SetOverriddenSettingsL");
       
  1683 
       
  1684     if( aSettings != NULL )
       
  1685         {
       
  1686         TUint tempValue;
       
  1687         iOverriden = ETrue;
       
  1688         iOverridenSettings = aSettings;
       
  1689         
       
  1690         // Check overridden settings by looking at their default values
       
  1691         // (see how Launcher2 sets them in the OverriddenSettings constructor)
       
  1692         tempValue = iOverridenSettings->GetBrowserSetting( EBrowserOverSettingsCustomAp );
       
  1693         if( tempValue != 0 )
       
  1694             {
       
  1695             iAllPreferences.iAccessPointSelectionMode = EConnectionMethod;
       
  1696             iCustomAp = tempValue;
       
  1697           	SetDefaultAccessPointL( iCustomAp );
       
  1698             }
       
  1699         tempValue = iOverridenSettings->GetBrowserSetting( EBrowserOverSettingsAutoLoadImages );
       
  1700         if( tempValue != KMaxTUint )
       
  1701             {           
       
  1702             iAllPreferences.iAutoLoadContent = tempValue;
       
  1703             }
       
  1704 
       
  1705         tempValue = iOverridenSettings->GetBrowserSetting( EBrowserOverSettingsFontSize );
       
  1706         if( tempValue != EBrowserOverFontSizeLevelUndefined )
       
  1707             {
       
  1708             iAllPreferences.iFontSize = tempValue;
       
  1709             }
       
  1710         tempValue = iOverridenSettings->GetBrowserSetting( EBrowserOverSettingsFullScreen );
       
  1711         switch( tempValue )
       
  1712             {
       
  1713             case KBrowserFullScreenSettingDataSoftkeysOff:
       
  1714                 {
       
  1715                 iAllPreferences.iFullScreen = EWmlSettingsFullScreenFullScreen;
       
  1716                 break;
       
  1717                 }
       
  1718             case KBrowserFullScreenSettingDataSoftkeysOn:
       
  1719             default:
       
  1720                 {
       
  1721                 iAllPreferences.iFullScreen = EWmlSettingsFullScreenSoftkeysOnly;
       
  1722                 break;
       
  1723                 }
       
  1724             }
       
  1725         }
       
  1726     return;
       
  1727     }
       
  1728 
       
  1729 // ----------------------------------------------------------------------------
       
  1730 // CBrowserPreferences::SetEmbeddedModeL(TBool aEmbeddedMode)
       
  1731 // ----------------------------------------------------------------------------
       
  1732 //
       
  1733 void CBrowserPreferences::SetEmbeddedModeL(TBool aEmbeddedMode)
       
  1734     {
       
  1735     LOG_ENTERFN("CBrowserPreferences::SetEmbeddedModeL");
       
  1736 
       
  1737     iEmbeddedMode = aEmbeddedMode;
       
  1738     if( iEmbeddedMode /* && ApiProvider().StartedUp()*/ )
       
  1739         {
       
  1740         NotifyObserversL( EPreferencesItemChange, 
       
  1741                                             TBrCtlDefs::ESettingsEmbedded );
       
  1742         }
       
  1743     return;
       
  1744     }
       
  1745 
       
  1746 // ----------------------------------------------------------------------------
       
  1747 // CBrowserPreferences::SetMediaVolumeL( TInt aMediaVolume )
       
  1748 // ----------------------------------------------------------------------------
       
  1749 //
       
  1750 void CBrowserPreferences::SetMediaVolumeL( TInt aMediaVolume )
       
  1751     {
       
  1752     LOG_ENTERFN("CBrowserPreferences::SetMediaVolumeL");
       
  1753 
       
  1754     // Media Volume uses different SD ini. Revert to Browser SD ini after use
       
  1755     iAllPreferences.iMediaVolume = aMediaVolume;
       
  1756     SetIntValueL ( KBrowserMediaVolumeControl, iAllPreferences.iMediaVolume );
       
  1757     }
       
  1758 
       
  1759 // ----------------------------------------------------------------------------
       
  1760 // CBrowserPreferences::SetHomePageTypeL( TWmlSettingsHomePage aHomePageType )
       
  1761 // ----------------------------------------------------------------------------
       
  1762 //
       
  1763 void CBrowserPreferences::SetHomePageTypeL( TWmlSettingsHomePage aHomePageType )
       
  1764     {
       
  1765     LOG_ENTERFN("CBrowserPreferences::SetHomePageTypeL");
       
  1766 	SetIntValueL( KBrowserNGHomepageType, aHomePageType );
       
  1767     iAllPreferences.iHomePgType = aHomePageType;
       
  1768     }
       
  1769 
       
  1770 // ----------------------------------------------------------------------------
       
  1771 // CBrowserPreferences::SetHomePageUrlL( TDesC& aHomePageURL )
       
  1772 // ----------------------------------------------------------------------------
       
  1773 //
       
  1774 void CBrowserPreferences::SetHomePageUrlL( const TDesC& aHomePageURL )
       
  1775     {
       
  1776     LOG_ENTERFN("CBrowserPreferences::SetHomePageUrlL");
       
  1777 
       
  1778     if( aHomePageURL.Length() )
       
  1779         {
       
  1780         // Save the homepage with a scheme (default is http if not specified).
       
  1781         HBufC* temp = Util::AllocateUrlWithSchemeL( aHomePageURL ); 
       
  1782         delete iAllPreferences.iHomePgURL;
       
  1783         iAllPreferences.iHomePgURL = temp;
       
  1784         SetStringValueL( KBrowserNGHomepageURL, 
       
  1785                                         iAllPreferences.iHomePgURL->Des() );
       
  1786         }
       
  1787     }
       
  1788 
       
  1789 // ----------------------------------------------------------------------------
       
  1790 // CBrowserPreferences::SetSearchPageUrlL( TDesC& aSearchPageURL )
       
  1791 // ----------------------------------------------------------------------------
       
  1792 //
       
  1793 void CBrowserPreferences::SetSearchPageUrlL( const TDesC& aSearchPageURL )
       
  1794     {
       
  1795     LOG_ENTERFN("CBrowserPreferences::SetSearchPageUrlL");
       
  1796 
       
  1797     // Save the searchpage with a scheme (default is http if not specified).
       
  1798     HBufC* temp = Util::AllocateUrlWithSchemeL( aSearchPageURL ); 
       
  1799     delete iAllPreferences.iSearchPgURL;
       
  1800     iAllPreferences.iSearchPgURL = temp;
       
  1801     SetStringValueL( KBrowserNGSearchPageURL, 
       
  1802 	                            iAllPreferences.iSearchPgURL->Des() );
       
  1803     }
       
  1804 
       
  1805 // ----------------------------------------------------------------------------
       
  1806 // CBrowserPreferences::FlushSD()
       
  1807 // ----------------------------------------------------------------------------
       
  1808 //
       
  1809 void CBrowserPreferences::FlushSD()
       
  1810     {
       
  1811     }
       
  1812 
       
  1813 // ----------------------------------------------------------------------------
       
  1814 // CBrowserPreferences::CustomAccessPointDefined()
       
  1815 // ----------------------------------------------------------------------------
       
  1816 //
       
  1817 TBool CBrowserPreferences::CustomAccessPointDefined()
       
  1818     {
       
  1819 LOG_ENTERFN("CBrowserPreferences::CustomAccessPointDefined");
       
  1820     TBool retval( iOverridenSettings && iCustomAp );
       
  1821     BROWSER_LOG( ( _L( "CBrowserPreferences::CustomAccessPointDefined returns %d" ),
       
  1822         (TInt)retval ) );
       
  1823     return retval;
       
  1824     }
       
  1825 
       
  1826 // ----------------------------------------------------------------------------
       
  1827 // CBrowserPreferences::SelfDownloadContentTypesL
       
  1828 // ----------------------------------------------------------------------------
       
  1829 //
       
  1830 TPtrC CBrowserPreferences::SelfDownloadContentTypesL()
       
  1831     {
       
  1832 LOG_ENTERFN("CBrowserPreferences::SelfDownloadContentTypesL");
       
  1833 
       
  1834     TInt error = KErrNone;
       
  1835     const TInt KLengthIncrement = 32; // 32 characters
       
  1836     TInt length = KLengthIncrement; // Initially KLengthIncrement
       
  1837 
       
  1838     do
       
  1839         {
       
  1840         HBufC* temp = HBufC::NewL( length );
       
  1841         delete iSelfDownloadContentTypes;
       
  1842         iSelfDownloadContentTypes = temp;
       
  1843         TPtr ptr = iSelfDownloadContentTypes->Des();
       
  1844 		error = iRepository->Get( KBrowserSelfDownloadContentTypes, ptr );
       
  1845 
       
  1846         if ( error == KErrOverflow )
       
  1847             {
       
  1848             // Increase the size of the placeholder
       
  1849             length += KLengthIncrement;
       
  1850             }
       
  1851         } while ( error == KErrOverflow );
       
  1852 
       
  1853     #ifdef _DEBUG
       
  1854         TPtrC logString = *iSelfDownloadContentTypes;
       
  1855         BROWSER_LOG( ( _L( "CBrowserPreferences::SelfDownloadContentTypesL returns %S" ),
       
  1856             &logString ) );
       
  1857     #endif // _DEBUG
       
  1858 
       
  1859     return (*iSelfDownloadContentTypes);
       
  1860     }
       
  1861 
       
  1862 // ----------------------------------------------------------------------------
       
  1863 // CBrowserPreferences::AccessPointAlwaysAsk()
       
  1864 // ----------------------------------------------------------------------------
       
  1865 //
       
  1866 TCmSettingSelectionMode CBrowserPreferences::AccessPointSelectionMode()
       
  1867     {
       
  1868 LOG_ENTERFN("CBrowserPreferences::AccessPointSelectionMode");
       
  1869 BROWSER_LOG( ( _L( "CBrowserPreferences::AccessPointSelectionMode returns %d" ),
       
  1870         iAllPreferences.iAccessPointSelectionMode ) );
       
  1871     return iAllPreferences.iAccessPointSelectionMode;
       
  1872     }
       
  1873 
       
  1874 // ----------------------------------------------------------------------------
       
  1875 // CBrowserPreferences::SetAccessPointSelectionModeL
       
  1876 // ----------------------------------------------------------------------------
       
  1877 //
       
  1878 void CBrowserPreferences::SetAccessPointSelectionModeL( 
       
  1879                 TCmSettingSelectionMode aAccessPointSelectionMode )
       
  1880     {
       
  1881     LOG_ENTERFN("CBrowserPreferences::SetAccessPointSelectionModeL");
       
  1882 
       
  1883 	if ( aAccessPointSelectionMode != iAllPreferences.iAccessPointSelectionMode )
       
  1884 		{
       
  1885 		iAllPreferences.iAccessPointSelectionMode = aAccessPointSelectionMode;
       
  1886 
       
  1887         switch ( aAccessPointSelectionMode )                              
       
  1888             {
       
  1889             case EAlwaysAsk:
       
  1890                 {
       
  1891                 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); 
       
  1892                 break; 
       
  1893                 }
       
  1894             case EDestination:
       
  1895                 {
       
  1896                 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeDestination ); 
       
  1897                 break; 
       
  1898                 }
       
  1899             case EConnectionMethod:
       
  1900                 {
       
  1901                 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeUserDefined ); 
       
  1902                 break;
       
  1903                 }
       
  1904             default:
       
  1905                 {
       
  1906                 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); 
       
  1907                 break; 
       
  1908                 }
       
  1909             }          
       
  1910 		}  
       
  1911     }
       
  1912 
       
  1913 // ----------------------------------------------------------------------------
       
  1914 // CBrowserPreferences::SetAutomaticUpdatingApL
       
  1915 // ----------------------------------------------------------------------------
       
  1916 //
       
  1917 void CBrowserPreferences::SetAutomaticUpdatingApL( TUint aSetting )
       
  1918     {
       
  1919     LOG_ENTERFN("CBrowserPreferences::SetAutomaticUpdatingApL");
       
  1920 
       
  1921     iAllPreferences.iAutomaticUpdatingAP = aSetting;
       
  1922     SetIntValueL ( KBrowserNGAutomaticUpdatingAccessPoint, aSetting );
       
  1923     }
       
  1924 
       
  1925 
       
  1926 void CBrowserPreferences::SetAutomaticUpdatingWhileRoamingL( TBool aAutoUpdateRoaming )
       
  1927     {
       
  1928     LOG_ENTERFN("CBrowserPreferences::SetAutomaticUpdatingWhileRoamingL");
       
  1929     if ( aAutoUpdateRoaming != iAllPreferences.iAutomaticUpdatingWhileRoaming )
       
  1930         {
       
  1931         iAllPreferences.iAutomaticUpdatingWhileRoaming = aAutoUpdateRoaming;
       
  1932         SetIntValueL( KBrowserNGAutomaticUpdatingWhileRoaming, 
       
  1933                                         iAllPreferences.iAutomaticUpdatingWhileRoaming );
       
  1934     	}
       
  1935     	
       
  1936     }
       
  1937 
       
  1938 
       
  1939    
       
  1940 // ---------------------------------------------------------
       
  1941 // CBrowserPreferences::SetToolbarOnOffL()
       
  1942 // ---------------------------------------------------------
       
  1943 //
       
  1944 void CBrowserPreferences::SetToolbarOnOffL(TInt aCommand)
       
  1945     {
       
  1946     if ( aCommand != iAllPreferences.iToolbarOnOff )
       
  1947         {
       
  1948         iAllPreferences.iToolbarOnOff = aCommand;
       
  1949         SetIntValueL( KToolbarOnOff, iAllPreferences.iToolbarOnOff );
       
  1950         
       
  1951         NotifyObserversL( EPreferencesItemChange, 
       
  1952                           TBrCtlDefs::ESettingsToolbarOnOff );
       
  1953         }
       
  1954     }
       
  1955 
       
  1956     
       
  1957     
       
  1958 // ---------------------------------------------------------
       
  1959 // CBrowserPreferences::SetToolbarButton1CmdL()
       
  1960 // ---------------------------------------------------------
       
  1961 //
       
  1962 void CBrowserPreferences::SetToolbarButton1CmdL(TInt aCommand)
       
  1963     {
       
  1964     if ( aCommand != iAllPreferences.iToolbarButton1Cmd )
       
  1965         {
       
  1966         iAllPreferences.iToolbarButton1Cmd = aCommand;
       
  1967         SetIntValueL( KToolbarButton1Cmd, iAllPreferences.iToolbarButton1Cmd );
       
  1968         
       
  1969         NotifyObserversL( EPreferencesItemChange, 
       
  1970                           TBrCtlDefs::ESettingsToolbarButton1Cmd );
       
  1971         }
       
  1972     }
       
  1973 
       
  1974 
       
  1975 // ---------------------------------------------------------
       
  1976 // CBrowserPreferences::SetToolbarButton2CmdL()
       
  1977 // ---------------------------------------------------------
       
  1978 //
       
  1979 void CBrowserPreferences::SetToolbarButton2CmdL(TInt aCommand)
       
  1980     {
       
  1981     if ( aCommand != iAllPreferences.iToolbarButton2Cmd )
       
  1982         {
       
  1983         iAllPreferences.iToolbarButton2Cmd = aCommand;
       
  1984         SetIntValueL( KToolbarButton2Cmd, iAllPreferences.iToolbarButton2Cmd );
       
  1985         
       
  1986         NotifyObserversL( EPreferencesItemChange, 
       
  1987                           TBrCtlDefs::ESettingsToolbarButton2Cmd );
       
  1988         }
       
  1989     }
       
  1990 
       
  1991 // ---------------------------------------------------------
       
  1992 // CBrowserPreferences::SetToolbarButton3CmdL()
       
  1993 // ---------------------------------------------------------
       
  1994 //
       
  1995 void CBrowserPreferences::SetToolbarButton3CmdL(TInt aCommand)
       
  1996     {
       
  1997     if ( aCommand != iAllPreferences.iToolbarButton3Cmd )
       
  1998         {
       
  1999         iAllPreferences.iToolbarButton3Cmd = aCommand;
       
  2000         SetIntValueL( KToolbarButton3Cmd, iAllPreferences.iToolbarButton3Cmd );
       
  2001         
       
  2002         NotifyObserversL( EPreferencesItemChange, 
       
  2003                           TBrCtlDefs::ESettingsToolbarButton3Cmd );
       
  2004         }
       
  2005     }
       
  2006 
       
  2007 // ---------------------------------------------------------
       
  2008 // CBrowserPreferences::SetToolbarButton4CmdL()
       
  2009 // ---------------------------------------------------------
       
  2010 //
       
  2011 void CBrowserPreferences::SetToolbarButton4CmdL(TInt aCommand)
       
  2012     {
       
  2013     if ( aCommand != iAllPreferences.iToolbarButton4Cmd )
       
  2014         {
       
  2015         iAllPreferences.iToolbarButton4Cmd = aCommand;
       
  2016         SetIntValueL( KToolbarButton4Cmd, iAllPreferences.iToolbarButton4Cmd );
       
  2017         
       
  2018         NotifyObserversL( EPreferencesItemChange, 
       
  2019                           TBrCtlDefs::ESettingsToolbarButton4Cmd );
       
  2020         }
       
  2021     }
       
  2022 
       
  2023 // ---------------------------------------------------------
       
  2024 // CBrowserPreferences::SetToolbarButton5CmdL()
       
  2025 // ---------------------------------------------------------
       
  2026 //
       
  2027 void CBrowserPreferences::SetToolbarButton5CmdL(TInt aCommand)
       
  2028     {
       
  2029     if ( aCommand != iAllPreferences.iToolbarButton5Cmd )
       
  2030         {
       
  2031         iAllPreferences.iToolbarButton5Cmd = aCommand;
       
  2032         SetIntValueL( KToolbarButton5Cmd, iAllPreferences.iToolbarButton5Cmd );
       
  2033         
       
  2034         NotifyObserversL( EPreferencesItemChange, 
       
  2035                           TBrCtlDefs::ESettingsToolbarButton5Cmd );
       
  2036         }
       
  2037     }
       
  2038 
       
  2039 // ---------------------------------------------------------
       
  2040 // CBrowserPreferences::SetToolbarButton6CmdL()
       
  2041 // ---------------------------------------------------------
       
  2042 //
       
  2043 void CBrowserPreferences::SetToolbarButton6CmdL(TInt aCommand)
       
  2044     {
       
  2045     if ( aCommand != iAllPreferences.iToolbarButton6Cmd )
       
  2046         {
       
  2047         iAllPreferences.iToolbarButton6Cmd = aCommand;
       
  2048         SetIntValueL( KToolbarButton6Cmd, iAllPreferences.iToolbarButton6Cmd );
       
  2049         
       
  2050         NotifyObserversL( EPreferencesItemChange, 
       
  2051                           TBrCtlDefs::ESettingsToolbarButton6Cmd );
       
  2052         }
       
  2053     }
       
  2054 
       
  2055 // ---------------------------------------------------------
       
  2056 // CBrowserPreferences::SetToolbarButton7CmdL()
       
  2057 // ---------------------------------------------------------
       
  2058 //
       
  2059 void CBrowserPreferences::SetToolbarButton7CmdL(TInt aCommand)
       
  2060     {
       
  2061     if ( aCommand != iAllPreferences.iToolbarButton7Cmd )
       
  2062         {
       
  2063         iAllPreferences.iToolbarButton7Cmd = aCommand;
       
  2064         SetIntValueL( KToolbarButton7Cmd, iAllPreferences.iToolbarButton7Cmd );
       
  2065         
       
  2066         NotifyObserversL( EPreferencesItemChange, 
       
  2067                           TBrCtlDefs::ESettingsToolbarButton7Cmd );
       
  2068         }
       
  2069     }
       
  2070 
       
  2071 // ---------------------------------------------------------
       
  2072 // CBrowserPreferences::SetShortcutKey1CmdL()
       
  2073 // ---------------------------------------------------------
       
  2074 //
       
  2075 void CBrowserPreferences::SetShortcutKey1CmdL(TInt aCommand)
       
  2076     {
       
  2077     if ( aCommand != iAllPreferences.iShortcutKey1Cmd )
       
  2078         {
       
  2079         iAllPreferences.iShortcutKey1Cmd = aCommand;
       
  2080         SetIntValueL( KShortcutKey1Cmd, iAllPreferences.iShortcutKey1Cmd );
       
  2081         }
       
  2082     }
       
  2083 
       
  2084 // ---------------------------------------------------------
       
  2085 // CBrowserPreferences::SetShortcutKey2CmdL()
       
  2086 // ---------------------------------------------------------
       
  2087 //
       
  2088 void CBrowserPreferences::SetShortcutKey2CmdL(TInt aCommand)
       
  2089     {
       
  2090     if ( aCommand != iAllPreferences.iShortcutKey2Cmd )
       
  2091         {
       
  2092         iAllPreferences.iShortcutKey2Cmd = aCommand;
       
  2093         SetIntValueL( KShortcutKey2Cmd, iAllPreferences.iShortcutKey2Cmd );
       
  2094         }
       
  2095     }
       
  2096     
       
  2097 // ---------------------------------------------------------
       
  2098 // CBrowserPreferences::SetShortcutKey3CmdL()
       
  2099 // ---------------------------------------------------------
       
  2100 //
       
  2101 void CBrowserPreferences::SetShortcutKey3CmdL(TInt aCommand)
       
  2102     {
       
  2103     if ( aCommand != iAllPreferences.iShortcutKey3Cmd )
       
  2104         {
       
  2105         iAllPreferences.iShortcutKey3Cmd = aCommand;
       
  2106         SetIntValueL( KShortcutKey3Cmd, iAllPreferences.iShortcutKey3Cmd );
       
  2107         }
       
  2108     }
       
  2109 
       
  2110 // ---------------------------------------------------------
       
  2111 // CBrowserPreferences::SetShortcutKey4CmdL()
       
  2112 // ---------------------------------------------------------
       
  2113 //
       
  2114 void CBrowserPreferences::SetShortcutKey4CmdL(TInt aCommand)
       
  2115     {
       
  2116     if ( aCommand != iAllPreferences.iShortcutKey4Cmd )
       
  2117         {
       
  2118         iAllPreferences.iShortcutKey4Cmd = aCommand;
       
  2119         SetIntValueL( KShortcutKey4Cmd, iAllPreferences.iShortcutKey4Cmd );
       
  2120         }
       
  2121     }
       
  2122 
       
  2123 // ---------------------------------------------------------
       
  2124 // CBrowserPreferences::SetShortcutKey5CmdL()
       
  2125 // ---------------------------------------------------------
       
  2126 //
       
  2127 void CBrowserPreferences::SetShortcutKey5CmdL(TInt aCommand)
       
  2128     {
       
  2129     if ( aCommand != iAllPreferences.iShortcutKey5Cmd )
       
  2130         {
       
  2131         iAllPreferences.iShortcutKey5Cmd = aCommand;
       
  2132         SetIntValueL( KShortcutKey5Cmd, iAllPreferences.iShortcutKey5Cmd );
       
  2133         }
       
  2134     }
       
  2135 
       
  2136 // ---------------------------------------------------------
       
  2137 // CBrowserPreferences::SetShortcutKey6CmdL()
       
  2138 // ---------------------------------------------------------
       
  2139 //
       
  2140 void CBrowserPreferences::SetShortcutKey6CmdL(TInt aCommand)
       
  2141     {
       
  2142     if ( aCommand != iAllPreferences.iShortcutKey6Cmd )
       
  2143         {
       
  2144         iAllPreferences.iShortcutKey6Cmd = aCommand;
       
  2145         SetIntValueL( KShortcutKey6Cmd, iAllPreferences.iShortcutKey6Cmd );
       
  2146         }
       
  2147     }
       
  2148 
       
  2149 // ---------------------------------------------------------
       
  2150 // CBrowserPreferences::SetShortcutKey7CmdL()
       
  2151 // ---------------------------------------------------------
       
  2152 //
       
  2153 void CBrowserPreferences::SetShortcutKey7CmdL(TInt aCommand)
       
  2154     {
       
  2155     if ( aCommand != iAllPreferences.iShortcutKey7Cmd )
       
  2156         {
       
  2157         iAllPreferences.iShortcutKey7Cmd = aCommand;
       
  2158         SetIntValueL( KShortcutKey7Cmd, iAllPreferences.iShortcutKey7Cmd );
       
  2159         }
       
  2160     }
       
  2161 
       
  2162 // ---------------------------------------------------------
       
  2163 // CBrowserPreferences::SetShortcutKey8CmdL()
       
  2164 // ---------------------------------------------------------
       
  2165 //
       
  2166 void CBrowserPreferences::SetShortcutKey8CmdL(TInt aCommand)
       
  2167     {
       
  2168     if ( aCommand != iAllPreferences.iShortcutKey8Cmd )
       
  2169         {
       
  2170         iAllPreferences.iShortcutKey8Cmd = aCommand;
       
  2171         SetIntValueL( KShortcutKey8Cmd, iAllPreferences.iShortcutKey8Cmd );
       
  2172         }
       
  2173     }
       
  2174 
       
  2175 // ---------------------------------------------------------
       
  2176 // CBrowserPreferences::SetShortcutKey9CmdL()
       
  2177 // ---------------------------------------------------------
       
  2178 //
       
  2179 void CBrowserPreferences::SetShortcutKey9CmdL(TInt aCommand)
       
  2180     {
       
  2181     if ( aCommand != iAllPreferences.iShortcutKey9Cmd )
       
  2182         {
       
  2183         iAllPreferences.iShortcutKey9Cmd = aCommand;
       
  2184         SetIntValueL( KShortcutKey9Cmd, iAllPreferences.iShortcutKey9Cmd );
       
  2185         }
       
  2186     }
       
  2187 
       
  2188 // ---------------------------------------------------------
       
  2189 // CBrowserPreferences::SetShortcutKey0CmdL()
       
  2190 // ---------------------------------------------------------
       
  2191 //
       
  2192 void CBrowserPreferences::SetShortcutKey0CmdL(TInt aCommand)
       
  2193     {
       
  2194     if ( aCommand != iAllPreferences.iShortcutKey0Cmd )
       
  2195         {
       
  2196         iAllPreferences.iShortcutKey0Cmd = aCommand;
       
  2197         SetIntValueL( KShortcutKey0Cmd, iAllPreferences.iShortcutKey0Cmd );
       
  2198         }
       
  2199     }
       
  2200 
       
  2201 // ---------------------------------------------------------
       
  2202 // CBrowserPreferences::SetShortcutKeyStarCmdL()
       
  2203 // ---------------------------------------------------------
       
  2204 //
       
  2205 void CBrowserPreferences::SetShortcutKeyStarCmdL(TInt aCommand)
       
  2206     {
       
  2207     if ( aCommand != iAllPreferences.iShortcutKeyStarCmd )
       
  2208         {
       
  2209         iAllPreferences.iShortcutKeyStarCmd = aCommand;
       
  2210         SetIntValueL( KShortcutKeyStarCmd, iAllPreferences.iShortcutKeyStarCmd );
       
  2211         }
       
  2212     }
       
  2213 
       
  2214 // ---------------------------------------------------------
       
  2215 // CBrowserPreferences::SetShortcutKeyHashCmdL()
       
  2216 // ---------------------------------------------------------
       
  2217 //
       
  2218 void CBrowserPreferences::SetShortcutKeyHashCmdL(TInt aCommand)
       
  2219     {
       
  2220     if ( aCommand != iAllPreferences.iShortcutKeyHashCmd )
       
  2221         {
       
  2222         iAllPreferences.iShortcutKeyHashCmd = aCommand;
       
  2223         SetIntValueL( KShortcutKeyHashCmd, iAllPreferences.iShortcutKeyHashCmd );
       
  2224         }
       
  2225     }
       
  2226 
       
  2227     
       
  2228 // ----------------------------------------------------------------------------
       
  2229 // CBrowserPreferences::SetURLSuffixList
       
  2230 // ----------------------------------------------------------------------------
       
  2231 //
       
  2232 void CBrowserPreferences::SetURLSuffixList( HBufC* aSetting )
       
  2233     {
       
  2234     LOG_ENTERFN("CBrowserPreferences::SetUpdateHoursDefined");
       
  2235         
       
  2236     SetStringValueL ( KBrowserUrlSuffix, aSetting->Des() );    
       
  2237 
       
  2238     TPtr ptr = iAllPreferences.iUrlSuffixList->Des();
       
  2239     ptr.Copy( aSetting->Des() );
       
  2240     }
       
  2241 
       
  2242 // End of File