26
|
1 |
/*******************************************************************************
|
|
2 |
* Copyright (c) 2007, 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved. This program and the accompanying materials
|
|
4 |
* are made available under the terms of the Eclipse Public License v1.0
|
|
5 |
* which accompanies this distribution, and is available at
|
|
6 |
* http://www.eclipse.org/legal/epl-v10.html
|
|
7 |
*
|
|
8 |
* Contributors:
|
|
9 |
* Nokia Corporation - S60 implementation
|
|
10 |
*******************************************************************************/
|
|
11 |
|
|
12 |
|
|
13 |
#ifndef BROWSERPREFERENCES_H
|
|
14 |
#define BROWSERPREFERENCES_H
|
|
15 |
|
|
16 |
|
|
17 |
#include "eswtexpanded.hrh"
|
|
18 |
|
|
19 |
|
|
20 |
class CSwtBrowserVpnApItem;
|
|
21 |
class CSwtBrowserApItem;
|
|
22 |
|
|
23 |
const TUint KWmlNoDefaultAccessPoint = KMaxTUint;
|
|
24 |
|
|
25 |
|
|
26 |
/**
|
|
27 |
* Struct for MPreferencesObserver
|
|
28 |
*/
|
|
29 |
struct TPreferencesValues
|
|
30 |
{
|
|
31 |
// Setting Values
|
|
32 |
TUint iDefaultAccessPoint;
|
|
33 |
CSwtBrowserApItem* iDefaultAPDetails; //cache all data
|
|
34 |
TUint iAssocVpn;
|
|
35 |
TBool iAccessPointSelectionMode;
|
|
36 |
TBool iAutoLoadImages;
|
|
37 |
TUint iFontSize;
|
|
38 |
TBool iTextWrap;
|
|
39 |
TBool iCookies;
|
|
40 |
TBool iPageOverview;
|
|
41 |
TBool iBackList;
|
|
42 |
TBool iAutoRefresh;
|
|
43 |
TBool iEcma;
|
|
44 |
TBool iIMEINotification;
|
|
45 |
TUint32 iEncoding;
|
|
46 |
TBool iFullScreen;
|
|
47 |
TBool iQueryOnExit;
|
|
48 |
TBool iSendReferrer;
|
|
49 |
TUint iHomePgType;
|
|
50 |
TBool iHTTPSecuritySupressed;
|
|
51 |
TBool iConnDialogs;
|
|
52 |
TBool iHttpSecurityWarnings;
|
|
53 |
TUint iMediaVolume;
|
|
54 |
HBufC* iSearchPgURL;
|
|
55 |
HBufC* iHomePgURL;
|
|
56 |
TBool iPopupBlocking;
|
|
57 |
TUint iFormDataSaving;
|
|
58 |
TUint iAutomaticUpdating;
|
|
59 |
TUint iAutomaticUpdatingAP;
|
|
60 |
TUint iZoomMin;
|
|
61 |
TUint iZoomMax;
|
|
62 |
TUint iZoomDef;
|
|
63 |
};
|
|
64 |
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Enum for MPreferencesObserver
|
|
68 |
*/
|
|
69 |
enum TPreferencesEvent
|
|
70 |
{
|
|
71 |
EPreferencesActivate, // Preferences opened
|
|
72 |
EPreferencesDeactivate, // Preferences closed
|
|
73 |
EPreferencesItemChange // Setting change has occurred
|
|
74 |
};
|
|
75 |
|
|
76 |
|
|
77 |
/**
|
|
78 |
* MPreferencesObserver
|
|
79 |
* Observer for the MPreferences Class.
|
|
80 |
* @lib eswt
|
|
81 |
*/
|
|
82 |
class MPreferencesObserver
|
|
83 |
{
|
|
84 |
public:
|
|
85 |
|
|
86 |
/**
|
|
87 |
* From MPreferencesObserver
|
|
88 |
* Observer for Preference changes
|
|
89 |
* @param aEvent The type of preference event which happened
|
|
90 |
* @param aValues A struct of all settings values
|
|
91 |
* @return void
|
|
92 |
*/
|
|
93 |
virtual void HandlePreferencesChangeL(const TPreferencesEvent aEvent,
|
|
94 |
TPreferencesValues& aValues, TBrCtlDefs::TBrCtlSettings aSettingType) = 0;
|
|
95 |
};
|
|
96 |
|
|
97 |
|
|
98 |
/**
|
|
99 |
* MBrowserPreferences
|
|
100 |
* Interface for Preferences handling.
|
|
101 |
* @lib eswt
|
|
102 |
*/
|
|
103 |
class MBrowserPreferences
|
|
104 |
{
|
|
105 |
public: // New functions
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Returns a structure containing all of the settings according to the
|
|
109 |
* central repository values
|
|
110 |
* @return Returns references of TPreferencesValues which contains all preferences
|
|
111 |
*/
|
|
112 |
virtual const TPreferencesValues& AllPreferences() const = 0;
|
|
113 |
|
|
114 |
/**
|
|
115 |
* To access DefaultAccessPoint setting
|
|
116 |
* @return UID for default accesspoint
|
|
117 |
*/
|
|
118 |
virtual TUint DefaultAccessPoint() const = 0;
|
|
119 |
|
|
120 |
/**
|
|
121 |
* To access vpn item if exists.
|
|
122 |
* @param aDefaultAccessPoint UID for the accesspoint
|
|
123 |
* @param aVpnItem Vpn Item
|
|
124 |
* @return ETrue when vpn item is valid, EFalse otherwise.
|
|
125 |
*/
|
|
126 |
virtual TBool VpnDataL(TUint aDefaultAccessPoint,
|
|
127 |
CSwtBrowserVpnApItem& aVpnItem) = 0;
|
|
128 |
|
|
129 |
/**
|
|
130 |
* To access HTTP security warnings setting
|
|
131 |
* @return ETrue if security warnings are enabled
|
|
132 |
*/
|
|
133 |
virtual TBool HttpSecurityWarnings() const = 0;
|
|
134 |
|
|
135 |
/**
|
|
136 |
* To check whether the CDMA UI local feature ("R-BrUI2") is
|
|
137 |
* supported or not.
|
|
138 |
* @param aFeature The feature to check.
|
|
139 |
* @return ETrue when the feature is supported, EFalse otherwise.
|
|
140 |
*/
|
|
141 |
virtual TBool CdmaUiLocalFeatureSupported(const TInt aFeature) const = 0;
|
|
142 |
|
|
143 |
/**
|
|
144 |
* To access ShowConnectionDialogs setting
|
|
145 |
* @return ETrue if the dialog is confirmed, otherwise EFalse..
|
|
146 |
*/
|
|
147 |
virtual TBool ShowConnectionDialogs() const = 0;
|
|
148 |
|
|
149 |
/**
|
|
150 |
* To check that a ui local feature is supported or not
|
|
151 |
* @param aFeature Feature to check
|
|
152 |
* @return Returns ETrue if feature is supported
|
|
153 |
*/
|
|
154 |
virtual TBool UiLocalFeatureSupported(const TInt aFeature) const = 0;
|
|
155 |
|
|
156 |
/**
|
|
157 |
* To modify DefaultAccessPoint setting.
|
|
158 |
* @param aDefaultAccessPoint Id of default accesspoint/
|
|
159 |
* @param aAssocVpn Associated Vpn.
|
|
160 |
* @return void.
|
|
161 |
*/
|
|
162 |
virtual void SetDefaultAccessPointL(TUint aDefaultAccessPoint,
|
|
163 |
TUint aAssocVpn = KWmlNoDefaultAccessPoint) = 0;
|
|
164 |
|
|
165 |
/**
|
|
166 |
* To modify FontSize setting
|
|
167 |
* @param aFontSize Set new font size
|
|
168 |
* @return void.
|
|
169 |
*/
|
|
170 |
virtual void SetFontSizeL(TInt aFontSize) = 0;
|
|
171 |
|
|
172 |
/**
|
|
173 |
* To modify Encoding setting
|
|
174 |
* @param aEncoding The encoding to set.
|
|
175 |
* @return void.
|
|
176 |
*/
|
|
177 |
virtual void SetEncodingL(TUint32 aEncoding) = 0;
|
|
178 |
|
|
179 |
/**
|
|
180 |
* To access to the list of self download content types.
|
|
181 |
* See CBrCtlInterface::SetSelfDownloadContentTypesL()!
|
|
182 |
* @return Returns the pointer to the string which indicates download content types.
|
|
183 |
*/
|
|
184 |
virtual TPtrC SelfDownloadContentTypesL() = 0;
|
|
185 |
|
|
186 |
/**
|
|
187 |
* To access Default Access Point Always Ask settings.
|
|
188 |
* @return Returns ETrue when always ask mode is on, otherwise EFalse.
|
|
189 |
*/
|
|
190 |
virtual TBool AccessPointSelectionMode() = 0;
|
|
191 |
|
|
192 |
/**
|
|
193 |
* To modify Default Access Point Settings
|
|
194 |
* @param aAccessPointSelectionMode Access point selection mode.
|
|
195 |
* @return void.
|
|
196 |
*/
|
|
197 |
virtual void SetAccessPointSelectionModeL(
|
|
198 |
TWmlSettingsAccessPointSelectionMode aAccessPointSelectionMode) = 0;
|
|
199 |
|
|
200 |
/**
|
|
201 |
* To access AutoLoadImages setting.
|
|
202 |
* @return Value of setting
|
|
203 |
*/
|
|
204 |
virtual TBool AutoLoadImages() const = 0;
|
|
205 |
|
|
206 |
/**
|
|
207 |
* To access BackList setting.
|
|
208 |
* @return Value of setting
|
|
209 |
*/
|
|
210 |
virtual TBool BackList() const = 0;
|
|
211 |
|
|
212 |
/**
|
|
213 |
* To access AutoRefresh setting.
|
|
214 |
* @return Value of setting
|
|
215 |
*/
|
|
216 |
virtual TBool AutoRefresh() const = 0;
|
|
217 |
|
|
218 |
/**
|
|
219 |
* To access Cookies setting
|
|
220 |
* @return TWmlSettingsCookies
|
|
221 |
*/
|
|
222 |
virtual TBool Cookies() const = 0;
|
|
223 |
|
|
224 |
/**
|
|
225 |
* To access ECMA setting
|
|
226 |
* @return TWmlSettingsECMA
|
|
227 |
*/
|
|
228 |
virtual TBool Ecma() const = 0;
|
|
229 |
|
|
230 |
/**
|
|
231 |
* Get IMEI notification setting
|
|
232 |
* @return EWmlSettingsIMEIEnable if notification is enabled,
|
|
233 |
* otherwise EWmlSettingsIMEIDisable
|
|
234 |
*/
|
|
235 |
virtual TBool IMEINotification() const = 0;
|
|
236 |
|
|
237 |
/**
|
|
238 |
* Sends/Don not send the referrer header
|
|
239 |
* 0 = Do not send the referrer header
|
|
240 |
* 1 = Send the referrer header
|
|
241 |
* @return ETrue if Send referrer header is enabled
|
|
242 |
*/
|
|
243 |
virtual TBool SendReferrer() const = 0;
|
|
244 |
|
|
245 |
/**
|
|
246 |
* To access PageOverview setting.
|
|
247 |
* @return Value of setting
|
|
248 |
*/
|
|
249 |
virtual TBool PageOverview() const = 0;
|
|
250 |
|
|
251 |
/**
|
|
252 |
* To access Form Data Saving setting.
|
|
253 |
* @return value of setting
|
|
254 |
*/
|
|
255 |
virtual TUint FormDataSaving() const = 0;
|
|
256 |
|
|
257 |
/**
|
|
258 |
* Adds an observer to be notified about changes. Derived classes MUST
|
|
259 |
* notify all observers when preferences changed!
|
|
260 |
* @param anObserver Observer to be notified about events.
|
|
261 |
* @return void.
|
|
262 |
*/
|
|
263 |
virtual void AddObserverL(MPreferencesObserver* anObserver) = 0;
|
|
264 |
|
|
265 |
/**
|
|
266 |
* Removes an observer.
|
|
267 |
* @param anObserver The observer.
|
|
268 |
* @return void.
|
|
269 |
*/
|
|
270 |
virtual void RemoveObserver(MPreferencesObserver* anObserver) = 0;
|
|
271 |
|
|
272 |
/**
|
|
273 |
* Notifies observer.
|
|
274 |
* @param TPreferencesEvent The preference event.
|
|
275 |
* @param aSettingType the setting type.
|
|
276 |
* @return void.
|
|
277 |
*/
|
|
278 |
virtual void NotifyObserversL(TPreferencesEvent aEvent,
|
|
279 |
TBrCtlDefs::TBrCtlSettings aSettingType) = 0;
|
|
280 |
};
|
|
281 |
|
|
282 |
#endif // BROWSERPREFERENCES_H
|