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