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