2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FWebCtrlWebSetting.h
20 * @brief This is the header file for the %WebSetting class.
22 * This header file contains the declarations of the %WebSetting class for a %Web control.
24 #ifndef _FWEB_CTRL_WEB_SETTING_H_
25 #define _FWEB_CTRL_WEB_SETTING_H_
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FUiCtrlInputTypes.h>
31 namespace Tizen { namespace Web { namespace Controls
33 class _WebSettingImpl;
34 }}} // Tizen::Web::Control
36 namespace Tizen { namespace Web { namespace Controls
42 * Defines the types of cache mode.
48 WEB_CACHE_VALIDATED, /**< The use of cache data only when the cache data is valid */
49 WEB_CACHE_IGNORE /**< The retrieval of data from a network resource without using cache data */
53 * @enum CertificateErrorHandlingMode
55 * Defines the types of certification error handling mode.
59 enum CertificateErrorHandlingMode
61 WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM, /**< The web certificate error handling mode: The confirm popup is displayed to get the user confirmation */
62 WEB_CERTIFICATE_ERROR_HANDLING_MODE_CANCEL, /**< The web certificate error handling mode: The confirm popup is not displayed and the request is canceled */
63 WEB_CERTIFICATE_ERROR_HANDLING_MODE_CONTINUE /**< The web certificate error handling mode: The confirm popup is not displayed and the request proceeds */
68 * @brief This class holds the setting values for a %Web control.
72 * The %WebSetting class holds the setting values, which configure the behavior of a %Web control. An application can, for example, enable or disable JavaScript and image auto loading.
74 class _OSP_EXPORT_ WebSetting
75 : public Tizen::Base::Object
79 * This is the default constructor for this class.
86 * Copying of objects using this copy constructor is allowed.
87 * This is the copy constructor for the %WebSetting class. @n
88 * It creates an instance of %WebSetting with the values of the specified instance.
92 * @param[in] setting An instance of %WebSetting
94 WebSetting(const WebSetting& setting);
97 * This destructor overrides Tizen::Base::Object::~Object().
101 virtual ~WebSetting(void);
104 * Sets a cache control strategy for a %Web control.
109 * @privilege %http://tizen.org/privilege/web.service
111 * @param[in] mode A cache mode
112 * @exception E_SUCCESS The method is successful.
113 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
114 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
115 * @remarks The specific error code can be accessed using the GetLastResult() method.
117 void SetCacheControl(CacheMode mode);
120 * Sets the font size of the content.
124 * @param[in] fontSize The font size
126 void SetFontSize(int fontSize);
129 * Sets the text encoding for the content of a %Web control.
133 * @param[in] encoding The text encoding
135 void SetDefaultTextEncoding(const Tizen::Base::String& encoding);
138 * Enables or disables the use of JavaScript.
142 * @param[in] enable Set to @c true if the %Web control uses JavaScript, @n
145 void SetJavascriptEnabled(bool enable);
148 * Decides if a %Web control loads images included in the content.
152 * @param[in] enable Set to @c true if the %Web control must load images included in the content, @n
155 void SetAutoImageLoadEnabled(bool enable);
158 * Sets the input style of the keypad, which is displayed for the <input> or <textarea> tag.
162 * @param[in] inputStyle The input style of keypad
163 * @remarks If an application sets the input style to @c INPUT_STYLE_OVERLAY, the application must implement IWebKeypadEventListener to rearrange the layout of the current Form.
166 void SetInputStyle(Tizen::Ui::Controls::InputStyle inputStyle);
169 * Gets the value of the cache control strategy for a %Web control. @n
170 * The default is @c WEB_CACHE_VALIDATED.
174 * @return A cache mode
176 CacheMode GetCacheControl(void) const;
179 * Gets the font size of the content. @n
180 * The default is @c 17.
184 * @return The size of the font
186 int GetFontSize(void) const;
189 * Gets the text encoding of the content of a %Web control. @n
190 * The default is UTF-8.
194 * @return The text encoding
196 Tizen::Base::String GetDefaultTextEncoding(void) const;
199 * Checks whether a %Web control uses JavaScript. @n
200 * The default is true.
204 * @return @c true if JavaScript is enabled and used by a %Web control, @n
207 bool IsJavascriptEnabled(void) const;
210 * Checks whether a %Web control loads images included in the content automatically. @n
211 * The default is true.
215 * @return @c true if auto image loading is enabled, @n
218 bool IsAutoImageLoadEnabled(void) const;
221 * Gets the input style of the keypad, which is displayed for the <input> or <textarea> tag. @n
222 * The default is @c INPUT_STYLE_FULLSCREEN.
226 * @return The input style of keypad
228 Tizen::Ui::Controls::InputStyle GetInputStyle(void) const;
231 * Sets a certificate error handling mode for a %Web control.
236 * @privilege %http://tizen.org/privilege/web.service
238 * @param[in] mode A certificate error handling mode
239 * @exception E_SUCCESS The method is successful.
240 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
241 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
242 * @remarks The specific error code can be accessed using the GetLastResult() method.
244 void SetCertificateErrorHandlingMode(CertificateErrorHandlingMode mode);
247 * Gets the value of the certificate error handling mode for a %Web control. @n
248 * The default is @c WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM.
252 * @return A certificate error handling mode
254 CertificateErrorHandlingMode GetCertificateErrorHandlingMode(void) const;
257 * Sets a user agent for a %Web control.
261 * @param[in] agent The user agent
263 void SetUserAgent(const Tizen::Base::String& agent);
266 * Gets a value of user agent for a %Web control.
270 * @return The value of user agent
272 Tizen::Base::String GetUserAgent(void) const;
275 * Decides if a %Web control loads the resized contents to fit width automatically.
279 * @param[in] enable Set to @c true if the %Web control should load contents to fit width, @n
282 void SetAutoFittingEnabled(bool enable);
285 * Checks whether a %Web control loads the resize contents to fit width. @n
286 * The default is true.
290 * @return @c true if auto fitting is enabled, @n
293 bool IsAutoFittingEnabled(void) const;
296 * Decides if a %Web control allows JavaScript to open new window.
300 * @param[in] enable Set to @c true if the %Web control should allow JavaScript to open new window, @n
303 void SetJavaScriptPopupEnabled(bool enable);
306 * Checks whether a %Web control allows JavaScript to open new window. Returns true if opening new window by JavaScript is enabled. @n
307 * The default is true.
311 * @return @c true if opening new window by JavaScript is enabled, @n
314 bool IsJavaScriptPopupEnabled(void) const;
317 * Decides if a %Web control supports html5 geolocation feature.
322 * @privilege %http://tizen.org/privilege/web.service
324 * @param[in] enable Set to @c true if the %Web control should support html5 geolocation feature, @n
326 * @exception E_SUCCESS The method is successful.
327 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
328 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
329 * @remarks The specific error code can be accessed using the GetLastResult() method.
331 void SetGeolocationEnabled(bool enable);
334 * Checks whether a %Web control supports html5 geolocation feature. Returns true if html5 geolocation feature is enabled. @n
335 * The default is true.
339 * @return @c true if html5 geolocation feature is enabled, @n
342 bool IsGeolocationEnabled(void) const;
345 * Decides if a %Web control saves form data automatically and supports autocomplete feature.
350 * @privilege %http://tizen.org/privilege/web.service
352 * @param[in] enable Set to @c true if the %Web control should save form data automatically and supports autocomplete feature, @n
354 * @exception E_SUCCESS The method is successful.
355 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
356 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method.
357 * @remarks The specific error code can be accessed using the GetLastResult() method.
359 void SetAutoFormDataShowEnabled(bool enable);
362 * Checks whether %Web control saves form data automatically and supports autocomplete feature. Returns true if those are enabled. @n
363 * The default is true.
367 * @return @c true if saving form data and autocomplete feature are enabled, @n
370 bool IsAutoFormDataShowEnabled(void) const;
373 * Decides if a %Web control saves id/password for login form automatically and supports autofill feature.
378 * @privilege %http://tizen.org/privilege/web.service
380 * @param[in] enable Set to @c true if the %Web control should save login id/password automatically and supports autofill feature, @n
382 * @exception E_SUCCESS The method is successful.
383 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
384 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method.
385 * @remarks The specific error code can be accessed using the GetLastResult() method.
387 void SetAutoLoginFormFillEnabled(bool enable);
390 * Checks whether %Web control saves id/password for login form automatically and supports autofill feature. Returns true if those are enabled. @n
391 * The default is true.
395 * @return @c true if saving id/password for login form and autofill feature are enabled, @n
398 bool IsAutoLoginFormFillEnabled(void) const;
401 * Gets the hash value of the current instance.
405 * @return The hash value of the current instance
407 virtual int GetHashCode(void) const;
410 * Compares two instances of the %WebSetting class.
414 * @return @c true if the two instances match, @n
416 * @param[in] obj The object to compare with the current instance
417 * @remarks This method returns @c true if and only if the two instances contain the same elements.
418 * @see Tizen::Base::Object::Equals()
420 virtual bool Equals(const Tizen::Base::Object& obj) const;
423 * Copying of objects using this copy assignment operator is allowed.
427 * @param[in] setting The instance of the %WebSetting class to assign from
429 WebSetting& operator =(const WebSetting& setting);
432 _WebSettingImpl* __pWebSettingImpl;
434 friend class _WebSettingImpl;
437 }}} // Tizen::Web::Control
438 #endif // _FWEB_CTRL_WEB_SETTING_H_