2 * Copyright (C) 2016 Samsung Electronics
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
27 * @file ewk_settings.h
28 * @brief This file describes the Ewk Settings API.
30 * @remarks The ewk_settings is used for setting the preference of a specific
31 * ewk_view. We can get the ewk_settings from ewk_view using
32 * the ewk_view_settings_get() API.
35 #ifndef ewk_settings_h
36 #define ewk_settings_h
51 * @brief The structure type that creates a type name for #Ewk_Settings.
52 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
54 typedef struct Ewk_Settings Ewk_Settings;
58 * @brief Requests enable/disable password form autofill
62 * @param[in] setting Setting object to set password form autofill
63 * @param[in] enable @c EINA_TRUE to enable password form autofill
64 * @c EINA_FALSE to disable
66 * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
69 EXPORT_API Eina_Bool ewk_settings_autofill_password_form_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
73 * @brief Requests enable/disable form candidate data for autofill
77 * @param[in] setting Setting object to set form candidate data for autofill
78 * @param[in] enable @c EINA_TRUE to enable form candidate data for autofill
79 * @c EINA_FALSE to disable
81 * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
84 EXPORT_API Eina_Bool ewk_settings_form_candidate_data_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
88 * @brief Enables/disables form autofill profile feature.
92 * @param[in] settings Settings object to set the form autofill profile
93 * @param[in] enable @c EINA_TRUE to enable the text autosizing
94 * @c EINA_FALSE to disable
96 * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
99 EXPORT_API Eina_Bool ewk_settings_form_profile_data_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
103 * @brief Requests setting of auto fit.
107 * @param[in] settings The settings object to fit to width
108 * @param[in] enable If @c true the settings object is fit to width,\n
111 * @return @c EINA_TRUE on success,\n
112 * otherwise @c EINA_FALSE on failure
115 EXPORT_API Eina_Bool ewk_settings_auto_fitting_set(Ewk_Settings* settings, Eina_Bool enable);
119 * @brief Returns the auto fit status.
123 * @param[in] settings The settings object to fit to width
125 * @return @c EINA_TRUE if auto fit is enabled,\n
126 * otherwise @c EINA_FALSE
129 EXPORT_API Eina_Bool ewk_settings_auto_fitting_get(const Ewk_Settings* settings);
132 * @brief Enables/disables JavaScript executing.
134 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
136 * @param[in] settings The settings object to set JavaScript executing
137 * @param[in] enable If @c EINA_TRUE JavaScript executing is enabled,\n
138 * otherwise @c EINA_FALSE to disable it
140 * @return @c EINA_TRUE on success,\n
141 * otherwise @c EINA_FALSE on failure
143 EXPORT_API Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
146 * @brief Returns whether JavaScript can be executable.
148 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
150 * @param[in] settings The settings object to query if JavaScript can be
153 * @return @c EINA_TRUE if JavaScript can be executed,\n
154 * otherwise @c EINA_FALSE if not or on failure
156 EXPORT_API Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings* settings);
159 * @brief Enables/disables auto loading of images.
161 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
163 * @param[in] settings The settings object to set auto loading of images
164 * @param[in] automatic If @c EINA_TRUE auto loading of images is enabled,\n
165 * otherwise @c EINA_FALSE to disable it
167 * @return @c EINA_TRUE on success,\n
168 * otherwise @c EINA_FALSE on failure
170 EXPORT_API Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings* settings, Eina_Bool automatic);
173 * @brief Returns whether images can be loaded automatically.
175 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
177 * @param[in] settings The settings object to get auto loading of images
179 * @return @c EINA_TRUE if images are loaded automatically,\n
180 * otherwise @c EINA_FALSE if not or on failure
182 EXPORT_API Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings* settings);
185 * @brief Sets the default text encoding name.
187 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
189 * @param[in] settings The settings object to set the default text encoding name
190 * @param[in] encoding The default text encoding name
192 * @return @c EINA_TRUE on success,\n
193 * otherwise @c EINA_FALSE on failure
195 EXPORT_API Eina_Bool ewk_settings_default_text_encoding_name_set(Ewk_Settings* settings, const char* encoding);
198 * @brief Gets the default text encoding name.
200 * @details The returned string is guaranteed to be stringshared.
202 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
204 * @param[in] settings The settings object to query the default text encoding
207 * @return The default text encoding name
209 EXPORT_API const char* ewk_settings_default_text_encoding_name_get(Ewk_Settings* settings);
212 * @brief Sets the default font size.
214 * @details By default, the default font size is @c 16.
216 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
218 * @param[in] settings The settings object to set the default font size
219 * @param[in] size A new default font size to set
221 * @return @c EINA_TRUE on success,\n
222 * otherwise @c EINA_FALSE on failure
224 EXPORT_API Eina_Bool ewk_settings_default_font_size_set(Ewk_Settings* settings, int size);
227 * @brief Returns the default font size.
229 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
231 * @param[in] settings The settings object to get the default font size
233 * @return The default font size,\n
234 * otherwise @c 0 on failure
236 EXPORT_API int ewk_settings_default_font_size_get(const Ewk_Settings* settings);
240 * @deprecated Deprecated since 2.4
242 * @brief Requests to enable/disable private browsing.
246 * @param[in] settings The settings object to set private browsing
247 * @param[in] enable If @c EINA_TRUE private browsing is enabled\n
248 * otherwise @c EINA_FALSE to disable it
250 * @return @c EINA_TRUE on success,\n
251 * otherwise @c EINA_FALSE on failure
254 EXPORT_API Eina_Bool ewk_settings_private_browsing_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
258 * @deprecated Deprecated since 2.4
260 * @brief Enables/disables private browsing.
264 * @param[in] settings The settings object to query if private browsing is
267 * @return @c EINA_TRUE if private browsing is enabled,\n
268 * otherwise @c EINA_FALSE if not or on failure
271 EXPORT_API Eina_Bool ewk_settings_private_browsing_enabled_get(const Ewk_Settings* settings);
274 * @brief Enables/disables if the scripts can open new windows.
276 * @details By default, the scripts can open new windows.
278 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
280 * @param[in] settings The settings object to set if the scripts can open
282 * @param[in] enable If @c EINA_TRUE the scripts can open new windows\n
283 * otherwise @c EINA_FALSE if not
285 * @return @c EINA_TRUE on success,\n
286 * otherwise @c EINA_FALSE on failure (scripts are disabled)
288 EXPORT_API Eina_Bool ewk_settings_scripts_can_open_windows_set(Ewk_Settings* settings, Eina_Bool enable);
291 * @brief Returns whether the scripts can open new windows.
293 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
295 * @param[in] settings The settings object to query whether the scripts can
298 * @return @c EINA_TRUE if the scripts can open new windows\n
299 * otherwise @c EINA_FALSE if not or on failure (scripts are disabled)
301 EXPORT_API Eina_Bool ewk_settings_scripts_can_open_windows_get(const Ewk_Settings* settings);
310 #endif // ewk_settings_h