2 * Copyright (C) 2012 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 Describes the settings API.
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.
34 #ifndef ewk_settings_h
35 #define ewk_settings_h
43 /** Creates a type name for Ewk_Settings */
44 typedef struct Ewk_Settings Ewk_Settings;
47 * Creates a type name for the callback function used to notify the client when
48 * the continuous spell checking setting was changed by WebKit.
50 * @param enable @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled
52 typedef void (*Ewk_Settings_Continuous_Spell_Checking_Change_Cb)(Eina_Bool enable);
56 * \enum _Ewk_Editable_Link_Behavior
58 * @brief Editable link behavior mode (Must remain in sync with WKEditableLinkBehavior)
60 enum _Ewk_Editable_Link_Behavior {
61 EWK_EDITABLE_LINK_BEHAVIOR_DEFAULT,
62 EWK_EDITABLE_LINK_BEHAVIOR_ALWAYS_LIVE,
63 EWK_EDITABLE_LINK_BEHAVIOR_ONLY_LIVE_WITH_SHIFTKEY,
64 EWK_EDITABLE_LINK_BEHAVIOR_LIVE_WHEN_NOT_FOCUSED,
65 EWK_EDITABLE_LINK_BEHAVIOR_NEVER_LIVE
67 typedef enum _Ewk_Editable_Link_Behavior Ewk_Editable_Link_Behavior;
71 * Enables/disables the Javascript Fullscreen API. The Javascript API allows
72 * to request full screen mode, for more information see:
73 * http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
75 * Default value for Javascript Fullscreen API setting is @c EINA_TRUE .
77 * @param settings settings object to enable Javascript Fullscreen API
78 * @param enable @c EINA_TRUE to enable Javascript Fullscreen API or
79 * @c EINA_FALSE to disable
81 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
83 EAPI Eina_Bool ewk_settings_fullscreen_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
86 * Returns whether the Javascript Fullscreen API is enabled or not.
88 * @param settings settings object to query whether Javascript Fullscreen API is enabled
90 * @return @c EINA_TRUE if the Javascript Fullscreen API is enabled
91 * @c EINA_FALSE if not or on failure
93 EAPI Eina_Bool ewk_settings_fullscreen_enabled_get(const Ewk_Settings *settings);
96 * Enables/disables the javascript executing.
98 * @param settings settings object to set javascript executing
99 * @param enable @c EINA_TRUE to enable javascript executing
100 * @c EINA_FALSE to disable
102 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
104 EAPI Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
107 * Returns the javascript can be executable or not.
109 * @param settings settings object to query if the javascript can be executed
111 * @return @c EINA_TRUE if the javascript can be executed
112 * @c EINA_FALSE if not or on failure
114 EAPI Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings *settings);
117 * Enables/disables auto loading of the images.
119 * @param settings settings object to set auto loading of the images
120 * @param automatic @c EINA_TRUE to enable auto loading of the images,
121 * @c EINA_FALSE to disable
123 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
125 EAPI Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings *settings, Eina_Bool automatic);
128 * Returns the images can be loaded automatically or not.
130 * @param settings settings object to get auto loading of the images
132 * @return @c EINA_TRUE if the images are loaded automatically,
133 * @c EINA_FALSE if not or on failure
135 EAPI Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings *settings);
139 * Requests enables/disables the plug-ins.
141 * @param settings settings object to set the plug-ins
142 * @param enable @c EINA_TRUE to enable the plug-ins
143 * @c EINA_FALSE to disable
145 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
147 EAPI Eina_Bool ewk_settings_plugins_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
150 * Returs enables/disables the plug-ins.
152 * @param settings settings object to set the plug-ins
154 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
156 EAPI Eina_Bool ewk_settings_plugins_enabled_get(const Ewk_Settings *settings);
159 * Requests setting of auto fit.
161 * @param settings settings object to fit to width
162 * @param enable to fit to width.
164 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
166 EAPI Eina_Bool ewk_settings_auto_fitting_set(Ewk_Settings *settings, Eina_Bool enable);
169 * Returns the auto fit status.
171 * @param settings settings object to fit to width
173 * @return @c EINA_TRUE if enable auto fit or @c EINA_FALSE.
175 EAPI Eina_Bool ewk_settings_auto_fitting_get(const Ewk_Settings *settings);
178 * Requests to set the default font size.
180 * @param settings settings object to set the default font size
181 * @param size a new default font size to set
183 * @return @c EINA_TRUE on success @c EINA_FALSE otherwise
185 EAPI Eina_Bool ewk_settings_font_default_size_set(Ewk_Settings *settings, int size);
188 * Returns the default font size.
190 * @param settings settings object to set the default font size
192 * @return @c default font size.
194 EAPI int ewk_settings_font_default_size_get(const Ewk_Settings *settings);
197 * Requests enables/disables if the scripts can open the new windows.
199 * @param settings settings object to set if the scripts can open the new windows
200 * @param allow @c EINA_TRUE if the scripts can open the new windows
201 * @c EINA_FALSE if not
203 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (scripts are disabled)
205 EAPI Eina_Bool ewk_settings_scripts_window_open_set(Ewk_Settings *settings, Eina_Bool allow);
208 * Returns enables/disables if the scripts can open the new windows.
210 * @param settings settings object to set if the scripts can open the new windows
212 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (scripts are disabled)
214 EAPI Eina_Bool ewk_settings_scripts_window_open_get(const Ewk_Settings *settings);
217 * Requests for drawing layer borders.
219 * @param settings settings object to drawing layer borders.
220 * @param enable EINA_TRUE to draw layer borders.
222 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
225 EAPI Eina_Bool ewk_settings_compositing_borders_visible_set(Ewk_Settings *settings, Eina_Bool enable);
228 * Requests to set default text encoding name.
230 * @param settings settings object to set default text encoding name
231 * @param encoding default text encoding name
233 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
235 EAPI Eina_Bool ewk_settings_default_encoding_set(Ewk_Settings *settings, const char* encoding);
238 * Returns default text encoding name.
240 * @param settings settings object to query default text encoding nae
242 * @return default text encoding name
244 EAPI const char* ewk_settings_default_encoding_get(const Ewk_Settings *settings);
247 * Requests enables/disables private browsing.
249 * @param settings settings object to set private browsing
250 * @param enable @c EINA_TRUE to enable private browsing
251 * @c EINA_FALSE to disable
253 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
255 EAPI Eina_Bool ewk_settings_private_browsing_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
258 * Returns enables/disables private browsing.
260 * @param settings settings object to query if private browsing was enabled
262 * @return @c EINA_TRUE if private browsing was enabled
263 * @c EINA_FALSE if not or on failure
265 EAPI Eina_Bool ewk_settings_private_browsing_enabled_get(const Ewk_Settings *settings);
268 * Requests to set editable link behavior.
270 * @param settings settings object to set editable link behavior
271 * @param behavior editable link behaviro
273 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
275 EAPI Eina_Bool ewk_settings_editable_link_behavior_set(Ewk_Settings *settings, Ewk_Editable_Link_Behavior behavior);
277 //#if ENABLE(TIZEN_LOAD_REMOTE_IMAGES)
279 * Requests to set the load remote images enable/disable
281 * @param settings settings object to set load remote images
283 * @param loadRemoteImages @c EINA_TRUE to enable the load remote images
284 * @c EINA_FALSE to disable
286 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
288 EAPI Eina_Bool ewk_settings_load_remote_images_set(Ewk_Settings *settings, Eina_Bool loadRemoteImages);
290 * Returns enable/disable the load remote images
292 * @param settings settings object to get editable link behavior
294 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
296 EAPI Eina_Bool ewk_settings_load_remote_images_get(const Ewk_Settings *settings);
300 * Requests to enable/disable link effect
302 * @param settings settings object to enable/disable link effect
304 * @param linkEffectEnabled @c EINA_TRUE to enable the link effect
305 * @c EINA_FALSE to disable
307 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
309 EAPI Eina_Bool ewk_settings_link_effect_enabled_set(Ewk_Settings *settings, Eina_Bool linkEffectEnabled);
312 * Returns enable/disable link effect
314 * @param settings settings object to get whether link effect is enabled or disabled
316 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
318 EAPI Eina_Bool ewk_settings_link_effect_enabled_get(const Ewk_Settings *settings);
321 * Requests to set using encoding detector.
323 * @param settings settings object to set using encoding detector
324 * @param use use encoding detector
326 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
328 EAPI Eina_Bool ewk_settings_uses_encoding_detector_set(Ewk_Settings *settings, Eina_Bool use);
331 * Returns uses encoding detector.
333 * @param settings settings object to query uses encoding detector
335 * @return uses encoding detector
337 EAPI Eina_Bool ewk_settings_uses_encoding_detector_get(const Ewk_Settings *settings);
339 //#if ENABLE(TIZEN_ISF_PORT)
341 * Requests to set showing ime on autofocus (default value : true)
343 * @param settings settings object to show ime on autofocus
344 * @param enable @c EINA_TRUE to enable showing ime on autofocus @c EINA_FALSE to disable
346 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
348 EINA_DEPRECATED EAPI Eina_Bool ewk_settings_show_ime_on_autofocus_set(Ewk_Settings *settings, Eina_Bool enable);
351 * Returns enable/disable showing ime on autofocus
353 * @param settings settings object to show ime on autofocus enable/disable
355 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
357 EINA_DEPRECATED EAPI Eina_Bool ewk_settings_show_ime_on_autofocus_get(const Ewk_Settings *settings);
360 * Requests to set using default keypad (default value : true)
362 * @param settings settings object to use default keypad
363 * @param enable @c EINA_TRUE to use default keypad @c EINA_FALSE to disable
365 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
367 EAPI Eina_Bool ewk_settings_default_keypad_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
370 * Returns enable/disable using default keypad
372 * @param settings settings object to use default keypad
374 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
376 EAPI Eina_Bool ewk_settings_default_keypad_enabled_get(const Ewk_Settings *settings);
379 * Requests to set using keypad without user action (default value : true)
381 * @param settings settings object using keypad without user action
382 * @param enable @c EINA_TRUE to use without user action @c EINA_FALSE to disable
384 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
386 EAPI Eina_Bool ewk_settings_uses_keypad_without_user_action_set(Ewk_Settings *settings, Eina_Bool use);
389 * Returns using keypad without user action
391 * @param settings settings object using keypad without user action
392 * @param settings settings object to query using keypad without user action
394 * @return @c EINA_TRUE on enable or @c EINA_FALSE on disable
396 EAPI Eina_Bool ewk_settings_uses_keypad_without_user_action_get(const Ewk_Settings *settings);
400 * Enables/disables frame flattening.
402 * By default, the frame flattening is disabled.
404 * @param settings settings object to set the frame flattening
405 * @param enable @c EINA_TRUE to enable the frame flattening @c EINA_FALSE to disable
407 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
409 * @see ewk_settings_enable_frame_flattening_get()
411 EAPI Eina_Bool ewk_settings_frame_flattening_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
414 * Returns the frame flattening.
416 * The frame flattening is a feature which expands sub frames until all the frames become
417 * one scrollable page.
419 * @param settings settings object to get the frame flattening.
421 * @return @c EINA_TRUE if the frame flattening is enabled or @c EINA_FALSE otherwise
423 EAPI Eina_Bool ewk_settings_frame_flattening_enabled_get(const Ewk_Settings *settings);
425 // #if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
427 * Requests setting use of text zoom.
429 * @param settings settings object to text zoom
430 * @param enable to text zoom.
432 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
434 EAPI Eina_Bool ewk_settings_text_zoom_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
437 * Returns whether text zoom is enabled or not.
439 * @param settings settings object to text zoom
441 * @return @c EINA_TRUE if enable text zoom or @c EINA_FALSE.
443 EAPI Eina_Bool ewk_settings_text_zoom_enabled_get(const Ewk_Settings *settings);
446 // #if ENABLE(TIZEN_STYLE_SCOPED)
448 * Requests to set style scoped option (default value : true)
450 * @param settings settings object to enable style coped
451 * @param enable @c EINA_TRUE to enable style scoped @c EINA_FALSE to disable
453 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
455 EAPI Eina_Bool ewk_settings_style_scoped_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
458 * Returns enable/disable style scoped
460 * @param settings settings object to style scoped
462 * @return @c EINA_TRUE if enable style scoped of @c EINA_FALSE.
464 EAPI Eina_Bool ewk_settings_style_scoped_enabled_get(const Ewk_Settings *settings);
467 // #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
469 * Requests enable/disable password form autofill
471 * @param setting setting object to set password form autofill
472 * @param enable @c EINA_TRUE to enable password form autofill
473 * @c EINA_FALSE to disable
475 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
477 EAPI Eina_Bool ewk_settings_autofill_password_form_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
480 * Returns if password form autofill is enabled or disabled.
482 * @param setting setting object to get password form autofill
484 * @return @c EINA_TRUE if password form autofill is enabled
485 * @c EINA_FALSE if password form autofill is disabled
487 EAPI Eina_Bool ewk_settings_autofill_password_form_enabled_get(Ewk_Settings* settings);
490 * Requests enable/disable form candidate data for autofill
492 * @param setting setting object to set form candidate data for autofill
493 * @param enable @c EINA_TRUE to enable form candidate data for autofill
494 * @c EINA_FALSE to disable
496 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
498 EAPI Eina_Bool ewk_settings_form_candidate_data_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
501 * Returns if form candidate data for autofill is enabled or disabled.
503 * @param setting setting object to get form candidate data for autofill
505 * @return @c EINA_TRUE if form candidate data for autofill is enabled
506 * @c EINA_FALSE if form candidate data for autofill is disabled
508 EAPI Eina_Bool ewk_settings_form_candidate_data_enabled_get(Ewk_Settings* settings);
510 // #endif // #if OS(TIZEN)
513 * Sets a callback function used to notify the client when
514 * the continuous spell checking setting was changed by WebKit.
516 * Specifying of this callback is needed if the application wants to receive notifications
517 * once WebKit changes this setting.
518 * If the application is not interested, this callback is not set.
519 * Changing of this setting at the WebKit level can be made as a result of modifying
520 * options in a Context Menu by a user.
522 * @param cb a new callback function to set or @c NULL to invalidate the previous one
524 EAPI void ewk_settings_continuous_spell_checking_change_cb_set(Ewk_Settings_Continuous_Spell_Checking_Change_Cb cb);
527 * Queries if continuous spell checking is enabled.
529 * @return @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE otherwise.
531 EAPI Eina_Bool ewk_settings_continuous_spell_checking_enabled_get(void);
534 * Enables/disables continuous spell checking.
536 * Additionally, this function calls a callback function (if defined) to notify
537 * the client about the change of the setting.
538 * This feature is disabled by default.
540 * @see ewk_settings_continuous_spell_checking_change_cb_set
542 * @param enable @c EINA_TRUE to enable continuous spell checking or @c EINA_FALSE to disable
544 EAPI void ewk_settings_continuous_spell_checking_enabled_set(Eina_Bool enable);
547 * Gets the the list of all available the spell checking languages to use.
549 * @see ewk_settings_spell_checking_languages_set
551 * @return the list with available spell checking languages, or @c NULL on failure
552 * the Eina_List and its items should be freed after, use eina_stringshare_del()
554 EAPI Eina_List *ewk_settings_spell_checking_available_languages_get(void);
557 * Sets @a languages as the list of languages to use by default WebKit
558 * implementation of spellchecker feature with Enchant library support.
560 * If @languages is @c NULL, the default language is used.
561 * If the default language can not be determined then any available dictionary will be used.
563 * @note This function invalidates the previously set languages.
564 * The dictionaries are requested asynchronously.
566 * @param languages a list of comma (',') separated language codes
567 * of the form 'en_US', ie, language_VARIANT, may be @c NULL.
569 EAPI void ewk_settings_spell_checking_languages_set(const char *languages);
572 * Gets the the list of the spell checking languages in use.
574 * @see ewk_settings_spell_checking_available_languages_get
575 * @see ewk_settings_spell_checking_languages_set
577 * @return the list with the spell checking languages in use,
578 * the Eina_List and its items should be freed after, use eina_stringshare_del()
580 EAPI Eina_List *ewk_settings_spell_checking_languages_get(void);
582 // #if ENABLE(TIZEN_LINK_MAGNIFIER)
584 * Sets link magnifier enabled.
586 * @param settings settings object
587 * @param enabled link magnifier enabled
589 EAPI void ewk_settings_link_magnifier_enabled_set(Ewk_Settings *settings, Eina_Bool enabled);
592 * Gets link magnifier enabled.
594 * @param settings settings object
596 * @return @c EINA_TRUE if link magnifier enabled, @c EINA_FALSE otherwise
598 EAPI Eina_Bool ewk_settings_link_magnifier_enabled_get(const Ewk_Settings *settings);
601 //#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
603 * Requests enable/disable text selection by default WebKit.
605 * @param settings setting object to set text selection by default WebKit
606 * @param enable @c EINA_TRUE to enable text selection by default WebKit
607 * @c EINA_FALSE to disable
609 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
611 EAPI Eina_Bool ewk_settings_text_selection_enabled_set(Ewk_Settings* settings, Eina_Bool enable);
614 * Returns if text selection by default WebKit is enabled or disabled.
616 * @param settings setting object to get text selection by default WebKit
618 * @return @c EINA_TRUE if text selection by default WebKit is enabled
619 * @c EINA_FALSE if not or on failure
621 EAPI Eina_Bool ewk_settings_text_selection_enabled_get(const Ewk_Settings* settings);
624 * Requests enables/disables to clear text selection when webview lose focus
626 * @param settings setting object to set to clear text selection when webview lose focus
627 * @param enable @c EINA_TRUE to clear text selection when webview lose focus
628 * @c EINA_FALSE to disable
630 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
632 EAPI Eina_Bool ewk_settings_clear_text_selection_automatically_set(Ewk_Settings* settings, Eina_Bool enable);
635 * Returns whether text selection is cleared when webview lose focus or not.
637 * @param settings setting object to get whether text selection is cleared when webview lose focus or not
639 * @return @c EINA_TRUE if text selection is cleared when webview lose focus
640 * @c EINA_FALSE if not or on failure
642 EAPI Eina_Bool ewk_settings_clear_text_selection_automatically_get(const Ewk_Settings* settings);
646 * Enables/disables text autosizing.
648 * By default, the text autosizing is disabled.
650 * @param settings settings object to set the text autosizing
651 * @param enable @c EINA_TRUE to enable the text autosizing
652 * @c EINA_FALSE to disable
654 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
656 * @see ewk_settings_text_autosizing_enabled_get()
658 EAPI Eina_Bool ewk_settings_text_autosizing_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
661 * Returns whether the text autosizing is enabled.
663 * The text autosizing is a feature which adjusts the font size of text in wide
664 * columns, and makes text more legible.
666 * @param settings settings object to query whether text autosizing is enabled
668 * @return @c EINA_TRUE if the text autosizing is enabled
669 * @c EINA_FALSE if not or on failure
671 EAPI Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings *settings);
676 #endif // ewk_settings_h