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.
108 * @privilege %http://tizen.org/privilege/web.service
110 * @param[in] mode A cache mode
111 * @exception E_SUCCESS The method is successful.
112 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
113 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
114 * @remarks The specific error code can be accessed using the GetLastResult() method.
116 void SetCacheControl(CacheMode mode);
119 * Sets the font size of the content.
123 * @param[in] fontSize The font size
125 void SetFontSize(int fontSize);
128 * Sets the text encoding for the content of a %Web control.
132 * @param[in] encoding The text encoding
134 void SetDefaultTextEncoding(const Tizen::Base::String& encoding);
137 * Enables or disables the use of JavaScript.
141 * @param[in] enable Set to @c true if the %Web control uses JavaScript, @n
144 void SetJavascriptEnabled(bool enable);
147 * Decides if a %Web control loads images included in the content.
151 * @param[in] enable Set to @c true if the %Web control must load images included in the content, @n
154 void SetAutoImageLoadEnabled(bool enable);
157 * Sets the input style of the keypad, which is displayed for the <input> or <textarea> tag.
161 * @param[in] inputStyle The input style of keypad
162 * @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.
165 void SetInputStyle(Tizen::Ui::Controls::InputStyle inputStyle);
168 * Gets the value of the cache control strategy for a %Web control. @n
169 * The default value is @c WEB_CACHE_VALIDATED.
173 * @return A cache mode
175 CacheMode GetCacheControl(void) const;
178 * Gets the font size of the content. @n
179 * The default size is @c 17.
183 * @return The size of the font
185 int GetFontSize(void) const;
188 * Gets the text encoding of the content of a %Web control. @n
189 * The default encoding is UTF-8.
193 * @return The text encoding
195 Tizen::Base::String GetDefaultTextEncoding(void) const;
198 * Checks whether a %Web control uses JavaScript. @n
199 * The default value is @c true.
203 * @return @c true if JavaScript is enabled and used by a %Web control, @n
206 bool IsJavascriptEnabled(void) const;
209 * Checks whether a %Web control loads images included in the content automatically. @n
210 * The default value is @c true.
214 * @return @c true if auto image loading is enabled, @n
217 bool IsAutoImageLoadEnabled(void) const;
220 * Gets the input style of the keypad, which is displayed for the <input> or <textarea> tag. @n
221 * The default style is @c INPUT_STYLE_FULLSCREEN.
225 * @return The input style of keypad
227 Tizen::Ui::Controls::InputStyle GetInputStyle(void) const;
230 * Sets a certificate error handling mode for a %Web control.
235 * @privilege %http://tizen.org/privilege/web.service
237 * @param[in] mode A certificate error handling mode
238 * @exception E_SUCCESS The method is successful.
239 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
240 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
241 * @remarks The specific error code can be accessed using the GetLastResult() method.
243 void SetCertificateErrorHandlingMode(CertificateErrorHandlingMode mode);
246 * Gets the value of the certificate error handling mode for a %Web control. @n
247 * The default value is @c WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM.
251 * @return A certificate error handling mode
253 CertificateErrorHandlingMode GetCertificateErrorHandlingMode(void) const;
256 * Sets a user agent for a %Web control.
260 * @param[in] agent The user agent
262 void SetUserAgent(const Tizen::Base::String& agent);
265 * Gets a value of user agent for a %Web control.
269 * @return The value of user agent
271 Tizen::Base::String GetUserAgent(void) const;
274 * Decides if a %Web control loads the resized contents to fit width automatically.
278 * @param[in] enable Set to @c true if the %Web control should load contents to fit width, @n
281 void SetAutoFittingEnabled(bool enable);
284 * Checks whether a %Web control loads the resize contents to fit width. @n
285 * The default value is @c true.
289 * @return @c true if auto fitting is enabled, @n
292 bool IsAutoFittingEnabled(void) const;
295 * Decides if a %Web control allows JavaScript to open new window.
299 * @param[in] enable Set to @c true if the %Web control should allow JavaScript to open new window, @n
302 void SetJavaScriptPopupEnabled(bool enable);
305 * Checks whether a %Web control allows JavaScript to open new window. @n Returns @c true if opening new window by JavaScript is enabled.
306 * The default value is @c true.
310 * @return @c true if opening new window by JavaScript is enabled, @n
313 bool IsJavaScriptPopupEnabled(void) const;
316 * Decides if a %Web control supports html5 geolocation feature.
320 * @privilege %http://tizen.org/privilege/web.service
322 * @param[in] enable Set to @c true if the %Web control should support html5 geolocation feature, @n
324 * @exception E_SUCCESS The method is successful.
325 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
326 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
327 * @remarks The specific error code can be accessed using the GetLastResult() method.
329 void SetGeolocationEnabled(bool enable);
332 * Checks whether a %Web control supports html5 geolocation feature. @n Returns @c true if html5 geolocation feature is enabled.
333 * The default value is @c true.
337 * @return @c true if html5 geolocation feature is enabled, @n
340 bool IsGeolocationEnabled(void) const;
343 * Decides if a %Web control saves form data automatically and supports autocomplete feature.
347 * @privilege %http://tizen.org/privilege/web.service
349 * @param[in] enable Set to @c true if the %Web control should save form data automatically and supports autocomplete feature, @n
351 * @exception E_SUCCESS The method is successful.
352 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
353 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method.
354 * @remarks The specific error code can be accessed using the GetLastResult() method.
356 void SetAutoFormDataShowEnabled(bool enable);
359 * Checks whether %Web control saves form data automatically and supports autocomplete feature. @n Returns @c true if those are enabled.
360 * The default value is @c true.
364 * @return @c true if saving form data and autocomplete feature are enabled, @n
367 bool IsAutoFormDataShowEnabled(void) const;
370 * Decides if a %Web control saves ID/password for login form automatically and supports autofill feature.
374 * @privilege %http://tizen.org/privilege/web.service
376 * @param[in] enable Set to @c true if the %Web control should save login ID/password automatically and supports autofill feature, @n
378 * @exception E_SUCCESS The method is successful.
379 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
380 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method.
381 * @remarks The specific error code can be accessed using the GetLastResult() method.
383 void SetAutoLoginFormFillEnabled(bool enable);
386 * Checks whether %Web control saves ID/password for login form automatically and supports autofill feature. @n Returns @c true if those are enabled.
387 * The default value is @c true.
391 * @return @c true if saving ID/password for login form and autofill feature are enabled, @n
394 bool IsAutoLoginFormFillEnabled(void) const;
397 * Gets the hash value of the current instance.
401 * @return The hash value of the current instance
403 virtual int GetHashCode(void) const;
406 * Compares two instances of the %WebSetting class.
410 * @return @c true if the two instances match, @n
412 * @param[in] obj The object to compare with the current instance
413 * @remarks This method returns @c true if and only if the two instances contain the same elements.
414 * @see Tizen::Base::Object::Equals()
416 virtual bool Equals(const Tizen::Base::Object& obj) const;
419 * Copying of objects using this copy assignment operator is allowed.
423 * @param[in] setting The instance of the %WebSetting class to assign from
425 WebSetting& operator =(const WebSetting& setting);
428 _WebSettingImpl* __pWebSettingImpl;
430 friend class _WebSettingImpl;
433 }}} // Tizen::Web::Control
434 #endif // _FWEB_CTRL_WEB_SETTING_H_