[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_internal.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_internal.h
28  * @brief   Describes the settings API.
29  *
30  * @note The ewk_settings is for setting the preference of specific ewk_view.
31  * We can get the ewk_settings from ewk_view using ewk_view_settings_get() API.
32  */
33
34 #ifndef ewk_settings_internal_h
35 #define ewk_settings_internal_h
36
37 #include "ewk_settings.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /**
44  * Creates a type name for the callback function used to notify the client when
45  * the continuous spell checking setting was changed by WebKit.
46  *
47  * @param enable @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled
48  */
49 typedef void (*Ewk_Settings_Continuous_Spell_Checking_Change_Cb)(Eina_Bool enable);
50
51 /**
52  * \enum    _Ewk_Editable_Link_Behavior
53  *
54  * @brief   Editable link behavior mode (Must remain in sync with WKEditableLinkBehavior)
55  */
56 enum _Ewk_Editable_Link_Behavior {
57     EWK_EDITABLE_LINK_BEHAVIOR_DEFAULT,
58     EWK_EDITABLE_LINK_BEHAVIOR_ALWAYS_LIVE,
59     EWK_EDITABLE_LINK_BEHAVIOR_ONLY_LIVE_WITH_SHIFTKEY,
60     EWK_EDITABLE_LINK_BEHAVIOR_LIVE_WHEN_NOT_FOCUSED,
61     EWK_EDITABLE_LINK_BEHAVIOR_NEVER_LIVE
62 };
63 typedef enum _Ewk_Editable_Link_Behavior Ewk_Editable_Link_Behavior;
64
65 enum _Ewk_Legacy_Font_Size_Mode {
66     EWK_LEGACY_FONT_SIZE_MODE_ALWAYS,
67     EWK_LEGACY_FONT_SIZE_MODE_ONLY_IF_PIXEL_VALUES_MATCH,
68     EWK_LEGACY_FONT_SIZE_MODE_NEVER
69 };
70
71 typedef enum _Ewk_Legacy_Font_Size_Mode Ewk_Legacy_Font_Size_Mode;
72
73 enum _Ewk_List_Style_Position {
74     EWK_LIST_STYLE_POSITION_OUTSIDE, /**< Default WebKit value. */
75     EWK_LIST_STYLE_POSITION_INSIDE
76 };
77 typedef enum _Ewk_List_Style_Position Ewk_List_Style_Position;
78
79 /*
80  * Enables/disables the Javascript Fullscreen API. The Javascript API allows
81  * to request full screen mode, for more information see:
82  * http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
83  *
84  * Default value for Javascript Fullscreen API setting is @c EINA_TRUE .
85  *
86  * @param settings settings object to enable Javascript Fullscreen API
87  * @param enable @c EINA_TRUE to enable Javascript Fullscreen API or
88  *               @c EINA_FALSE to disable
89  *
90  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
91  */
92 EXPORT_API Eina_Bool ewk_settings_fullscreen_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
93
94 /**
95  * Returns whether the Javascript Fullscreen API is enabled or not.
96  *
97  * @param settings settings object to query whether Javascript Fullscreen API is enabled
98  *
99  * @return @c EINA_TRUE if the Javascript Fullscreen API is enabled
100  *         @c EINA_FALSE if not or on failure
101  */
102 EXPORT_API Eina_Bool ewk_settings_fullscreen_enabled_get(const Ewk_Settings *settings);
103
104 /**
105  * Requests enables/disables the plug-ins.
106  *
107  * @param settings settings object to set the plug-ins
108  * @param enable @c EINA_TRUE to enable the plug-ins
109  *        @c EINA_FALSE to disable
110  *
111  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
112  */
113 EXPORT_API Eina_Bool ewk_settings_plugins_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
114
115 /**
116  * Returs enables/disables the plug-ins.
117  *
118  * @param settings settings object to set the plug-ins
119 *
120  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
121  */
122 EXPORT_API Eina_Bool ewk_settings_plugins_enabled_get(const Ewk_Settings *settings);
123
124 /**
125  * Checks whether WebKit supports the @a encoding.
126  *
127  * @param encoding the encoding string to check whether WebKit supports it
128  *
129  * @return @c EINA_TRUE if WebKit supports @a encoding or @c EINA_FALSE if not or
130  *      on failure
131  */
132 EXPORT_API Eina_Bool ewk_settings_is_encoding_valid(const char* encoding);
133
134 /**
135  * Requests to set default text encoding name.
136  *
137  * @param settings settings object to set default text encoding name
138  * @param encoding default text encoding name
139  *
140  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
141  */
142 EXPORT_API Eina_Bool ewk_settings_default_encoding_set(Ewk_Settings *settings, const char* encoding);
143
144 /**
145  * Sets link magnifier enabled.
146  *
147  * @param settings settings object
148  * @param enabled link magnifier enabled
149  */
150 EXPORT_API void ewk_settings_link_magnifier_enabled_set(Ewk_Settings *settings, Eina_Bool enabled);
151
152 /**
153  * Gets link magnifier enabled.
154  *
155  * @param settings settings object
156  *
157  * @return @c EINA_TRUE if link magnifier enabled, @c EINA_FALSE otherwise
158  */
159 EXPORT_API Eina_Bool ewk_settings_link_magnifier_enabled_get(const Ewk_Settings *settings);
160
161 /**
162  * Requests to enable/disable link effect
163  *
164  * @param settings settings object to enable/disable link effect
165  *
166  * @param linkEffectEnabled @c EINA_TRUE to enable the link effect
167  *        @c EINA_FALSE to disable
168  *
169  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
170  */
171 EXPORT_API Eina_Bool ewk_settings_link_effect_enabled_set(Ewk_Settings *settings, Eina_Bool linkEffectEnabled);
172
173 /**
174  * Returns enable/disable link effect
175  *
176  * @param settings settings object to get whether link effect is enabled or disabled
177  *
178  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
179  */
180 EXPORT_API Eina_Bool ewk_settings_link_effect_enabled_get(const Ewk_Settings *settings);
181
182 /**
183  * Requests to set using default keypad (default value : true)
184  *
185  * @param settings settings object to use default keypad
186  * @param enable @c EINA_TRUE to use default keypad  @c EINA_FALSE to disable
187  *
188  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
189  */
190 EXPORT_API Eina_Bool ewk_settings_default_keypad_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
191
192 /**
193  * Returns enable/disable using default keypad
194  *
195  * @param settings settings object to use default keypad
196  *
197  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
198  */
199 EXPORT_API Eina_Bool ewk_settings_default_keypad_enabled_get(const Ewk_Settings *settings);
200
201 /**
202  * Requests to set using keypad without user action (default value : true)
203  *
204  * @param settings settings object using keypad without user action
205  * @param enable @c EINA_TRUE to use without user action @c EINA_FALSE to disable
206  *
207  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
208  */
209 EXPORT_API Eina_Bool ewk_settings_uses_keypad_without_user_action_set(Ewk_Settings *settings, Eina_Bool enable);
210
211 /**
212  * Returns using keypad without user action
213  *
214  * @param settings settings object using keypad without user action
215  * @param settings settings object to query using keypad without user action
216  *
217  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
218  */
219 EXPORT_API Eina_Bool ewk_settings_uses_keypad_without_user_action_get(const Ewk_Settings *settings);
220
221
222 /**
223  * Requests setting use of text zoom.
224  *
225  * @param settings settings object to text zoom
226  * @param enable to text zoom.
227  *
228  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
229  */
230 EXPORT_API Eina_Bool ewk_settings_text_zoom_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
231
232 /**
233  * Returns whether text zoom is enabled or not.
234  *
235  * @param settings settings object to text zoom
236  *
237  * @return @c EINA_TRUE if enable text zoom or @c EINA_FALSE.
238  */
239 EXPORT_API Eina_Bool ewk_settings_text_zoom_enabled_get(const Ewk_Settings *settings);
240
241 /**
242  * Requests enable/disable text selection by default WebKit.
243  *
244  * @param settings setting object to set text selection by default WebKit
245  * @param enable @c EINA_TRUE to enable text selection by default WebKit
246  *        @c EINA_FALSE to disable
247  *
248  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
249  */
250 EXPORT_API Eina_Bool ewk_settings_text_selection_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
251
252 /**
253  * Returns if text selection by default WebKit is enabled or disabled.
254  *
255  * @param settings setting object to get text selection by default WebKit
256  *
257  * @return @c EINA_TRUE if text selection by default WebKit is enabled
258  *         @c EINA_FALSE if not or on failure
259  */
260 EXPORT_API Eina_Bool ewk_settings_text_selection_enabled_get(const Ewk_Settings* settings);
261
262 /**
263  * Requests enables/disables to clear text selection when webview lose focus
264  *
265  * @param settings setting object to set to clear text selection when webview lose focus
266  * @param enable @c EINA_TRUE to clear text selection when webview lose focus
267  *        @c EINA_FALSE to disable
268  *
269  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
270  */
271 EXPORT_API Eina_Bool ewk_settings_clear_text_selection_automatically_set(Ewk_Settings* settings, Eina_Bool enable);
272
273 /**
274  * Enables/disables text autosizing.
275  *
276  * By default, the text autosizing is disabled.
277  *
278  * @param settings settings object to set the text autosizing
279  * @param enable @c EINA_TRUE to enable the text autosizing
280  *               @c EINA_FALSE to disable
281  *
282  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
283  *
284  * @see ewk_settings_text_autosizing_enabled_get()
285  */
286 EXPORT_API Eina_Bool ewk_settings_text_autosizing_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
287
288 /**
289  * Returns whether the text autosizing is enabled.
290  *
291  * The text autosizing is a feature which adjusts the font size of text in wide
292  * columns, and makes text more legible.
293  *
294  * @param settings settings object to query whether text autosizing is enabled
295  *
296  * @return @c EINA_TRUE if the text autosizing is enabled
297  *         @c EINA_FALSE if not or on failure
298  */
299 EXPORT_API Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings *settings);
300
301
302 /**
303  * Sets the scale factor for text autosizing.
304  *
305  * Default value is 1.0.
306  *
307  * @param settings settings object to set the text autosizing
308  * @param factor font scale factor for text autosizing
309  */
310 EXPORT_API Eina_Bool ewk_settings_text_autosizing_font_scale_factor_set(Ewk_Settings *settings, double factor);
311
312 /**
313  * Gets the current scale factor for text autosizing.
314  *
315  * @param settings settings object to set scale factor for text autosizing
316  *
317  * @return the current font scale factor for text autosizing.
318  * In case of error, it returns non-positive value.
319  */
320 EXPORT_API double ewk_settings_text_autosizing_font_scale_factor_get(const Ewk_Settings *settings);
321
322 /**
323  * Requests to enable/disable edge effect
324  *
325  * @param settings settings object to enable/disable edge effect
326  *
327  * @param enable @c EINA_TRUE to enable the edge effect
328  *        @c EINA_FALSE to disable
329  *
330  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
331  */
332 EXPORT_API Eina_Bool ewk_settings_edge_effect_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
333
334 /**
335  * Returns enable/disable edge effect
336  *
337  * @param settings settings object to get whether edge effect is enabled or disabled
338  *
339  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
340  */
341 EXPORT_API Eina_Bool ewk_settings_edge_effect_enabled_get(const Ewk_Settings* settings);
342
343 /**
344  * Sets text style for selection mode enabled.
345  *
346  * @param settings settings object
347  * @param enabled text style for selection mode
348  */
349
350 EXPORT_API void ewk_settings_text_style_state_enabled_set(Ewk_Settings *settings, Eina_Bool enabled);
351 /**
352  * Gets text style for selection mode enabled.
353  *
354  * @param settings settings object
355  *
356  * @return @c EINA_TRUE if text style for selection mode enabled, @c EINA_FALSE otherwise
357  */
358 EXPORT_API Eina_Bool ewk_settings_text_style_state_enabled_get(const Ewk_Settings *settings);
359
360 /**
361  * Requests to enable/disable to select word by double tap
362  *
363  * @param settings settings object to enable/disable to select word by double tap
364  * @param enable @c EINA_TRUE to select word by double tap
365  *        @c EINA_FALSE to disable
366  *
367  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
368  */
369 EXPORT_API Eina_Bool ewk_settings_select_word_automatically_set(Ewk_Settings *settings, Eina_Bool enabled);
370
371 /**
372  * Returns enable/disable text selection by double tap
373  *
374  * @param settings settings object to get whether word by double tap is selected
375  *
376  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
377  */
378 EXPORT_API Eina_Bool ewk_settings_select_word_automatically_get(const Ewk_Settings *settings);
379
380 /**
381  * Sets legacy font size mode
382  *
383  * @param settings settings object
384  * @param mode legacy font size mode
385  *
386  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
387  */
388 EXPORT_API Eina_Bool ewk_settings_current_legacy_font_size_mode_set(Ewk_Settings *settings, Ewk_Legacy_Font_Size_Mode mode);
389
390 /**
391  * Returns set legacy font size mode
392  *
393  * @param settings settings object
394  *
395  * @return @c Ewk_Legacy_Font_Size_Mode set legacy font size mode
396  */
397 EXPORT_API Ewk_Legacy_Font_Size_Mode ewk_settings_current_legacy_font_size_mode_get(const Ewk_Settings *settings);
398
399 /**
400  * Sets to paste image as URI (default: paste as base64-encoded-data)
401  *
402  * @param settings settings object
403 * @param enable @c EINA_TRUE to paste image as URI    @c EINA_FALSE to paste image as data
404  *
405  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
406  */
407 EXPORT_API Eina_Bool ewk_settings_paste_image_uri_mode_set(Ewk_Settings *settings, Eina_Bool enabled);
408
409 /**
410  * Returns whether  paste image as URI mode is enabled
411  *
412  * @param settings settings object
413  *
414  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
415  */
416 EXPORT_API Eina_Bool ewk_settings_paste_image_uri_mode_get(const Ewk_Settings *settings);
417
418 /**
419  * DEPRECATED.
420  * Gets the initial position value for the HTML list element <ul></ul>.
421  *
422  * @param settings setting object to get the initial position value
423  *
424  * @return the initial position value for the HTML list element.
425  */
426 EINA_DEPRECATED EXPORT_API Ewk_List_Style_Position ewk_settings_initial_list_style_position_get(const Ewk_Settings* settings);
427
428 /**
429  * DEPRECATED.
430  * Sets the initial position value for the HTML list element <ul></ul>.
431  *
432  * This value affect the lists that are going to be created,
433  * does not make sense to manipulate it for existed elements.
434  *
435  * @param settings setting object to set the initial list style position
436  * @param style a new style to set
437  *
438  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
439  */
440 EINA_DEPRECATED EXPORT_API Eina_Bool ewk_settings_initial_list_style_position_set(Ewk_Settings* settings, Ewk_List_Style_Position style);
441
442 /**
443  * Enable or disable supporting of -webkit-text-size-adjust
444  *
445  * -webkit-text-size-adjust affects text size adjusting feature.
446  *
447  * @param settings setting object to set the support of -webkit-text-size-adjust
448  * @param enable @c EINA_TRUE to support -webkit-text-size-adjust, @c EINA_FALSE not to support
449  *
450  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
451  */
452 EXPORT_API Eina_Bool ewk_settings_webkit_text_size_adjust_enabled_set(Ewk_Settings* settings, Eina_Bool enabled);
453
454 /**
455  * Requests to enable/disable to detect email address when tapping on email address without link property
456  *
457  * @param settings settings object to enable/disable to detect email address when tapping on email address without link property
458  *
459  * @param enable @c EINA_TRUE to enable to detect email address when tapping on email address without link property
460  *        @c EINA_FALSE to disable
461  */
462 EXPORT_API void ewk_settings_detect_contents_automatically_set(Ewk_Settings* settings, Eina_Bool enable);
463
464 /**
465  * Returns enable/disable to detect email address when tapping on email address without link property
466  *
467  * @param settings settings object to get whether email address is detected when tapping on email address without link property
468  *
469  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
470  */
471 EXPORT_API Eina_Bool ewk_settings_detect_contents_automatically_get(const Ewk_Settings* settings);
472
473 /**
474  * Sets cache builder mode enabled.
475  *
476  * @param settings settings object
477  * @param enabled cache builder mode
478  */
479 EXPORT_API void ewk_settings_cache_builder_enabled_set(Ewk_Settings *settings, Eina_Bool enabled);
480
481 /**
482  * Requests enables/disables to the specific extra feature
483  *
484  * @param settings setting object to enable/disable the specific extra feature
485  * @param feature feature name
486  * @param enable @c EINA_TRUE to enable the specific extra feature
487  *        @c EINA_FALSE to disable
488  *
489  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
490  */
491 EXPORT_API void ewk_settings_extra_feature_set(Ewk_Settings* settings, const char* feature, Eina_Bool enable);
492
493 /**
494  * Returns enable/disable to the specific extra feature
495  *
496  * @param settings settings object to get whether the specific extra feature is enabled or not.
497  * @param feature feature name
498  *
499  * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
500  */
501 EXPORT_API Eina_Bool ewk_settings_extra_feature_get(const Ewk_Settings* settings, const char* feature);
502
503 /**
504  * Enables/disables the javascript access to clipboard.
505  *
506  * By default, JavaScript access to clipboard is disabled.
507  *
508  * @param settings settings object to set javascript access to clipboard
509  * @param enable @c EINA_TRUE to enable javascript access to clipboard
510  *               @c EINA_FALSE to disable
511  *
512  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
513  */
514 EXPORT_API Eina_Bool ewk_settings_javascript_can_access_clipboard_set(Ewk_Settings *settings, Eina_Bool enable);
515
516 /**
517  * Returns whether javascript access to clipboard is enabled.
518  *
519  * @param settings settings object to query if the javascript can access to clipboard
520  *
521  * @return @c EINA_TRUE if the javascript can access to clipboard
522  *         @c EINA_FALSE if not or on failure
523  */
524 EXPORT_API Eina_Bool ewk_settings_javascript_can_access_clipboard_get(const Ewk_Settings *settings);
525
526 /**
527  * Enables/disables the DOM Paste is allowed.
528  *
529  * By default, DOM Paste is disabled.
530  *
531  * @param settings settings object to set DOM Paste allowance
532  * @param enable @c EINA_TRUE to enable DOM Paste
533  *               @c EINA_FALSE to disable
534  *
535  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
536  */
537 EXPORT_API Eina_Bool ewk_settings_dom_paste_allowed_set(Ewk_Settings *settings, Eina_Bool enable);
538
539 /**
540  * Returns whether DOM Paste is allowed.
541  *
542  * @param settings settings object to query if the DOM Paste is enabled.
543  *
544  * @return @c EINA_TRUE if the DOM Paste is enabled
545  *         @c EINA_FALSE if not or on failure
546  */
547 EXPORT_API Eina_Bool ewk_settings_dom_paste_allowed_get(const Ewk_Settings *settings);
548
549 #ifdef __cplusplus
550 }
551 #endif
552 #endif // ewk_settings_internal_h