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 * @param[in] mode A cache mode
110 void SetCacheControl(CacheMode mode);
113 * Sets the font size of the content.
117 * @param[in] fontSize The font size
119 void SetFontSize(int fontSize);
122 * Sets the text encoding for the content of a %Web control.
126 * @param[in] encoding The text encoding
128 void SetDefaultTextEncoding(const Tizen::Base::String& encoding);
131 * Enables or disables the use of JavaScript.
135 * @param[in] enable Set to @c true if the %Web control uses JavaScript, @n
138 void SetJavascriptEnabled(bool enable);
141 * Decides if a %Web control loads images included in the content.
145 * @param[in] enable Set to @c true if the %Web control must load images included in the content, @n
148 void SetAutoImageLoadEnabled(bool enable);
151 * Sets the input style of the keypad, which is displayed for the <input> or <textarea> tag.
155 * @param[in] inputStyle The input style of keypad
156 * @remarks If an application sets the input style to INPUT_STYLE_OVERLAY, the application must implement IWebKeypadEventListener to rearrange the layout of the current Form.
159 void SetInputStyle(Tizen::Ui::Controls::InputStyle inputStyle);
162 * Gets the value of the cache control strategy for a %Web control.
166 * @return A cache mode
168 CacheMode GetCacheControl(void) const;
171 * Gets the font size of the content.
175 * @return The size of the font
177 int GetFontSize(void) const;
180 * Gets the text encoding of the content of a %Web control.
184 * @return The text encoding
186 Tizen::Base::String GetDefaultTextEncoding(void) const;
189 * Checks whether a %Web control uses JavaScript. @n
190 * Returns @c true if JavaScript is enabled.
194 * @return @c true if JavaScript is enabled and used by a %Web control, @n
197 bool IsJavascriptEnabled(void) const;
200 * Checks whether a %Web control loads images included in the content automatically. @n
201 * Returns @c true if auto image loading is enabled.
205 * @return @c true if auto image loading is enabled, @n
208 bool IsAutoImageLoadEnabled(void) const;
211 * Gets the input style of the keypad, which is displayed for the <input> or <textarea> tag.
215 * @return The input style of keypad @n
216 * The default value of the input style is INPUT_STYLE_FULLSCREEN.
218 Tizen::Ui::Controls::InputStyle GetInputStyle(void) const;
221 * Sets a certificate error handling mode for a %Web control.
225 * @param[in] mode A certificate error handling mode
227 void SetCertificateErrorHandlingMode(CertificateErrorHandlingMode mode);
230 * Gets the value of the certificate error handling mode for a %Web control.
234 * @return A certificate error handling mode
236 CertificateErrorHandlingMode GetCertificateErrorHandlingMode(void) const;
239 * Sets a user agent for a %Web control.
243 * @param[in] agent The user agent
245 void SetUserAgent(const Tizen::Base::String& agent);
248 * Gets a value of user agent for a %Web control.
252 * @return The value of user agent
254 Tizen::Base::String GetUserAgent(void) const;
257 * Decides if a %Web control loads the resized contents to fit width automatically.
261 * @param[in] enable Set to @c true if the %Web control should load contents to fit width, @n
264 void SetAutoFittingEnabled(bool enable);
267 * Checks whether a %Web control loads the resize contents to fit width. Returns true if auto fitting is enabled.
271 * @return @c true if auto fitting is enabled, @n
274 bool IsAutoFittingEnabled(void) const;
277 * Decides if a %Web control allows JavaScript to open new window.
281 * @param[in] enable Set to @c true if the %Web control should allow JavaScript to open new window, @n
284 void SetJavaScriptPopupEnabled(bool enable);
287 * Checks whether a %Web control allows JavaScript to open new window. Returns true if opening new window by JavaScript is enabled.
291 * @return @c true if opening new window by JavaScript is enabled, @n
294 bool IsJavaScriptPopupEnabled(void) const;
297 * Decides if a %Web control supports html5 geolocation feature.
301 * @param[in] enable Set to @c true if the %Web control should support html5 geolocation feature, @n
304 void SetGeolocationEnabled(bool enable);
307 * Checks whether a %Web control supports html5 geolocation feature. Returns true if html5 geolocation feature is enabled.
311 * @return @c true if html5 geolocation feature is enabled, @n
314 bool IsGeolocationEnabled(void) const;
317 * Gets the hash value of the current instance.
321 * @return The hash value of the current instance
323 virtual int GetHashCode(void) const;
326 * Compares two instances of the %WebSetting class.
330 * @return @c true if the two instances match, @n
332 * @param[in] obj The object to compare with the current instance
333 * @remarks This method returns @c true if and only if the two instances contain the same elements.
334 * @see Tizen::Object::Equals()
336 virtual bool Equals(const Object& obj) const;
339 * Copying of objects using this copy assignment operator is allowed.
343 * @param[in] setting The instance of the %WebSetting class to assign from
345 WebSetting& operator =(const WebSetting& setting);
348 _WebSettingImpl* __pWebSettingImpl;
350 friend class _WebSettingImpl;
353 }}} // Tizen::Web::Control
354 #endif // _FWEB_CTRL_WEB_SETTING_H_