[M67 Dev][EWK] Classify EWK APIs by public, internal, or product
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_settings.h
1 /*
2  * Copyright (C) 2016 Samsung Electronics
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
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.
12  *
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.
24  */
25
26 /**
27  * @file    ewk_settings.h
28  * @brief   This file describes the Ewk Settings API.
29  *
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.
33  */
34
35 #ifndef ewk_settings_h
36 #define ewk_settings_h
37
38 #include <Eina.h>
39 #include <tizen.h>
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /**
46  * @addtogroup WEBVIEW
47  * @{
48  */
49
50 /**
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
53  */
54 typedef struct Ewk_Settings Ewk_Settings;
55
56 /**
57  * @if MOBILE
58  * @brief Requests enable/disable password form autofill
59  *
60  * @since_tizen 2.4
61  *
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
65  *
66  * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
67  * @endif
68  */
69 EXPORT_API Eina_Bool ewk_settings_autofill_password_form_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
70
71 /**
72  * @if MOBILE
73  * @brief Requests enable/disable form candidate data for autofill
74  *
75  * @since_tizen 2.4
76  *
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
80  *
81  * @return @c EINA_TRUE on success, otherwise  @c EINA_FALSE
82  * @endif
83  */
84 EXPORT_API Eina_Bool ewk_settings_form_candidate_data_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
85
86 /**
87  * @if MOBILE
88  * @brief Enables/disables form autofill profile feature.
89  *
90  * @since_tizen 2.4
91  *
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
95  *
96  * @return @c EINA_TRUE on success, otherwise @c EINA_FALSE
97  * @endif
98  */
99 EXPORT_API Eina_Bool ewk_settings_form_profile_data_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
100
101 /**
102  * @if MOBILE
103  * @brief Requests setting of auto fit.
104  *
105  * @since_tizen 2.3
106  *
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
109  *                   otherwise @c false
110  *
111  * @return @c EINA_TRUE on success,\n
112  *         otherwise @c EINA_FALSE on failure
113  * @endif
114  */
115 EXPORT_API Eina_Bool ewk_settings_auto_fitting_set(Ewk_Settings* settings, Eina_Bool enable);
116
117 /**
118  * @if MOBILE
119  * @brief Returns the auto fit status.
120  *
121  * @since_tizen 2.3
122  *
123  * @param[in] settings The settings object to fit to width
124  *
125  * @return @c EINA_TRUE if auto fit is enabled,\n
126  *         otherwise @c EINA_FALSE
127  * @endif
128  */
129 EXPORT_API Eina_Bool ewk_settings_auto_fitting_get(const Ewk_Settings* settings);
130
131 /**
132  * @brief Enables/disables JavaScript executing.
133  *
134  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
135  *
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
139  *
140  * @return @c EINA_TRUE on success,\n
141  *         otherwise @c EINA_FALSE on failure
142  */
143 EXPORT_API Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
144
145 /**
146  * @brief Returns whether JavaScript can be executable.
147  *
148  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
149  *
150  * @param[in] settings The settings object to query if JavaScript can be
151  *            executed
152  *
153  * @return @c EINA_TRUE if JavaScript can be executed,\n
154  *         otherwise @c EINA_FALSE if not or on failure
155  */
156 EXPORT_API Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings* settings);
157
158 /**
159  * @brief Enables/disables auto loading of images.
160  *
161  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
162  *
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
166  *
167  * @return @c EINA_TRUE on success,\n
168  *         otherwise @c EINA_FALSE on failure
169  */
170 EXPORT_API Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings* settings, Eina_Bool automatic);
171
172 /**
173  * @brief Returns whether images can be loaded automatically.
174  *
175  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
176  *
177  * @param[in] settings The settings object to get auto loading of images
178  *
179  * @return @c EINA_TRUE if images are loaded automatically,\n
180  *         otherwise @c EINA_FALSE if not or on failure
181  */
182 EXPORT_API Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings* settings);
183
184 /**
185  * @brief Sets the default text encoding name.
186  *
187  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
188  *
189  * @param[in] settings The settings object to set the default text encoding name
190  * @param[in] encoding The default text encoding name
191  *
192  * @return @c EINA_TRUE on success,\n
193  *         otherwise @c EINA_FALSE on failure
194  */
195 EXPORT_API Eina_Bool ewk_settings_default_text_encoding_name_set(Ewk_Settings* settings, const char* encoding);
196
197 /**
198  * @brief Gets the default text encoding name.
199  *
200  * @details The returned string is guaranteed to be stringshared.
201  *
202  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
203  *
204  * @param[in] settings The settings object to query the default text encoding
205  *            name
206  *
207  * @return The default text encoding name
208  */
209 EXPORT_API const char* ewk_settings_default_text_encoding_name_get(Ewk_Settings* settings);
210
211 /**
212  * @brief Sets the default font size.
213  *
214  * @details By default, the default font size is @c 16.
215  *
216  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
217  *
218  * @param[in] settings The settings object to set the default font size
219  * @param[in] size A new default font size to set
220  *
221  * @return @c EINA_TRUE on success,\n
222  *         otherwise @c EINA_FALSE on failure
223  */
224 EXPORT_API Eina_Bool ewk_settings_default_font_size_set(Ewk_Settings* settings, int size);
225
226 /**
227  * @brief Returns the default font size.
228  *
229  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
230  *
231  * @param[in] settings The settings object to get the default font size
232  *
233  * @return The default font size,\n
234  *         otherwise @c 0 on failure
235  */
236 EXPORT_API int ewk_settings_default_font_size_get(const Ewk_Settings* settings);
237
238 /**
239  * @if MOBILE
240  * @deprecated Deprecated since 2.4
241  *
242  * @brief Requests to enable/disable private browsing.
243  *
244  * @since_tizen 2.3
245  *
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
249  *
250  * @return @c EINA_TRUE on success,\n
251  *         otherwise @c EINA_FALSE on failure
252  * @endif
253  */
254 EXPORT_API Eina_Bool ewk_settings_private_browsing_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
255
256 /**
257  * @if MOBILE
258  * @deprecated Deprecated since 2.4
259  *
260  * @brief Enables/disables private browsing.
261  *
262  * @since_tizen 2.3
263  *
264  * @param[in] settings The settings object to query if private browsing is
265  *            enabled
266  *
267  * @return @c EINA_TRUE if private browsing is enabled,\n
268  *         otherwise @c EINA_FALSE if not or on failure
269  * @endif
270  */
271 EXPORT_API Eina_Bool ewk_settings_private_browsing_enabled_get(const Ewk_Settings* settings);
272
273 /**
274  * @brief Enables/disables if the scripts can open new windows.
275  *
276  * @details By default, the scripts can open new windows.
277  *
278  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
279  *
280  * @param[in] settings The settings object to set if the scripts can open
281  *            new windows
282  * @param[in] enable If @c EINA_TRUE the scripts can open new windows\n
283  *                   otherwise @c EINA_FALSE if not
284  *
285  * @return @c EINA_TRUE on success,\n
286  *         otherwise @c EINA_FALSE on failure (scripts are disabled)
287  */
288 EXPORT_API Eina_Bool ewk_settings_scripts_can_open_windows_set(Ewk_Settings* settings, Eina_Bool enable);
289
290 /**
291  * @brief Returns whether the scripts can open new windows.
292  *
293  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
294  *
295  * @param[in] settings The settings object to query whether the scripts can
296  *            open new windows
297  *
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)
300  */
301 EXPORT_API Eina_Bool ewk_settings_scripts_can_open_windows_get(const Ewk_Settings* settings);
302
303 /**
304 * @}
305 */
306
307 #ifdef __cplusplus
308 }
309 #endif
310 #endif // ewk_settings_h