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 EwkSettings 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
* Enables/disables the Javascript Fullscreen API. The Javascript API allows
57
* to request full screen mode, for more information see:
58
* http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
60
* Default value for Javascript Fullscreen API setting is @c EINA_TRUE .
62
* @param settings settings object to enable Javascript Fullscreen API
63
* @param enable @c EINA_TRUE to enable Javascript Fullscreen API or
64
* @c EINA_FALSE to disable
66
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
68
EAPI Eina_Bool ewk_settings_fullscreen_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
71
* Returns whether the Javascript Fullscreen API is enabled or not.
73
* @param settings settings object to query whether Javascript Fullscreen API is enabled
75
* @return @c EINA_TRUE if the Javascript Fullscreen API is enabled
76
* @c EINA_FALSE if not or on failure
78
EAPI Eina_Bool ewk_settings_fullscreen_enabled_get(const Ewk_Settings *settings);
81
* Enables/disables the javascript executing.
83
* By default, JavaScript execution is enabled.
85
* @param settings settings object to set javascript executing
86
* @param enable @c EINA_TRUE to enable javascript executing
87
* @c EINA_FALSE to disable
89
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
91
EAPI Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
94
* Returns whether JavaScript execution is enabled.
96
* @param settings settings object to query if the javascript can be executed
98
* @return @c EINA_TRUE if the javascript can be executed
99
* @c EINA_FALSE if not or on failure
101
EAPI Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings *settings);
104
* Enables/disables auto loading of the images.
106
* By default, auto loading of the images is enabled.
108
* @param settings settings object to set auto loading of the images
109
* @param automatic @c EINA_TRUE to enable auto loading of the images
110
* @c EINA_FALSE to disable
112
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
114
EAPI Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings *settings, Eina_Bool automatic);
117
* Returns whether the images can be loaded automatically or not.
119
* @param settings settings object to get auto loading of the images
121
* @return @c EINA_TRUE if the images are loaded automatically
122
* @c EINA_FALSE if not or on failure
124
EAPI Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings *settings);
127
* Enables/disables developer extensions.
129
* By default, the developer extensions are disabled.
131
* @param settings settings object to set developer extensions
132
* @param enable @c EINA_TRUE to enable developer extensions
133
* @c EINA_FALSE to disable
135
* @return @c EINA_TRUE on success or @EINA_FALSE on failure
137
EAPI Eina_Bool ewk_settings_developer_extras_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
140
* Queries if developer extensions are enabled.
142
* By default, the developer extensions are disabled.
144
* @param settings settings object to set developer extensions
146
* @return @c EINA_TRUE if developer extensions are enabled
147
@c EINA_FALSE if not or on failure
149
EAPI Eina_Bool ewk_settings_developer_extras_enabled_get(const Ewk_Settings *settings);
152
* Allow / Disallow file access from file:// URLs.
154
* By default, file access from file:// URLs is not allowed.
156
* @param settings settings object to set file access permission
157
* @param enable @c EINA_TRUE to enable file access permission
158
* @c EINA_FALSE to disable
160
* @return @c EINA_TRUE on success or @EINA_FALSE on failure
162
EAPI Eina_Bool ewk_settings_file_access_from_file_urls_allowed_set(Ewk_Settings *settings, Eina_Bool enable);
165
* Queries if file access from file:// URLs is allowed.
167
* By default, file access from file:// URLs is not allowed.
169
* @param settings settings object to query file access permission
171
* @return @c EINA_TRUE if file access from file:// URLs is allowed
172
* @c EINA_FALSE if not or on failure
174
EAPI Eina_Bool ewk_settings_file_access_from_file_urls_allowed_get(const Ewk_Settings *settings);
177
* Enables/disables frame flattening.
179
* By default, the frame flattening is disabled.
181
* @param settings settings object to set the frame flattening
182
* @param enable @c EINA_TRUE to enable the frame flattening
183
* @c EINA_FALSE to disable
185
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
187
* @see ewk_settings_enable_frame_flattening_get()
189
EAPI Eina_Bool ewk_settings_frame_flattening_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
192
* Returns whether the frame flattening is enabled.
194
* The frame flattening is a feature which expands sub frames until all the frames become
195
* one scrollable page.
197
* @param settings settings object to get the frame flattening.
199
* @return @c EINA_TRUE if the frame flattening is enabled
200
* @c EINA_FALSE if not or on failure
202
EAPI Eina_Bool ewk_settings_frame_flattening_enabled_get(const Ewk_Settings *settings);
205
* Enables/disables DNS prefetching.
207
* By default, DNS prefetching is disabled.
209
* @param settings settings object to set DNS prefetching
210
* @param enable @c EINA_TRUE to enable DNS prefetching or
211
* @c EINA_FALSE to disable
213
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
215
* @see ewk_settings_DNS_prefetching_enabled_get()
217
EAPI Eina_Bool ewk_settings_dns_prefetching_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
220
* Returns whether DNS prefetching is enabled or not.
222
* DNS prefetching is an attempt to resolve domain names before a user tries to follow a link.
224
* @param settings settings object to get DNS prefetching
226
* @return @c EINA_TRUE if DNS prefetching is enabled
227
* @c EINA_FALSE if not or on failure
229
EAPI Eina_Bool ewk_settings_dns_prefetching_enabled_get(const Ewk_Settings *settings);
232
* Sets a callback function used to notify the client when
233
* the continuous spell checking setting was changed by WebKit.
235
* Specifying of this callback is needed if the application wants to receive notifications
236
* once WebKit changes this setting.
237
* If the application is not interested, this callback is not set.
238
* Changing of this setting at the WebKit level can be made as a result of modifying
239
* options in a Context Menu by a user.
241
* @param cb a new callback function to set or @c NULL to invalidate the previous one
243
EAPI void ewk_settings_continuous_spell_checking_change_cb_set(Ewk_Settings_Continuous_Spell_Checking_Change_Cb cb);
246
* Queries if continuous spell checking is enabled.
248
* @return @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled
250
EAPI Eina_Bool ewk_settings_continuous_spell_checking_enabled_get(void);
253
* Enables/disables continuous spell checking.
255
* Additionally, this function calls a callback function (if defined) to notify
256
* the client about the change of the setting.
257
* This feature is disabled by default.
259
* @see ewk_settings_continuous_spell_checking_change_cb_set
261
* @param enable @c EINA_TRUE to enable continuous spell checking or @c EINA_FALSE to disable
263
EAPI void ewk_settings_continuous_spell_checking_enabled_set(Eina_Bool enable);
266
* Gets the the list of all available the spell checking languages to use.
268
* @see ewk_settings_spell_checking_languages_set
270
* @return the list with available spell checking languages, or @c NULL on failure
271
* the Eina_List and its items should be freed after, use eina_stringshare_del()
273
EAPI Eina_List *ewk_settings_spell_checking_available_languages_get(void);
276
* Sets @a languages as the list of languages to use by default WebKit
277
* implementation of spellchecker feature with Enchant library support.
279
* If @languages is @c NULL, the default language is used.
280
* If the default language can not be determined then any available dictionary will be used.
282
* @note This function invalidates the previously set languages.
283
* The dictionaries are requested asynchronously.
285
* @param languages a list of comma (',') separated language codes
286
* of the form 'en_US', ie, language_VARIANT, may be @c NULL.
288
EAPI void ewk_settings_spell_checking_languages_set(const char *languages);
291
* Gets the the list of the spell checking languages in use.
293
* @see ewk_settings_spell_checking_available_languages_get
294
* @see ewk_settings_spell_checking_languages_set
296
* @return the list with the spell checking languages in use,
297
* the Eina_List and its items should be freed after, use eina_stringshare_del()
299
EAPI Eina_List *ewk_settings_spell_checking_languages_get(void);
302
* Enables/disables the encoding detector.
304
* By default, the encoding detector is disabled.
306
* @param settings settings object to set the encoding detector
307
* @param enable @c EINA_TRUE to enable the encoding detector,
308
* @c EINA_FALSE to disable
310
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
312
EAPI Eina_Bool ewk_settings_encoding_detector_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
315
* Returns whether the encoding detector is enabled or not.
317
* @param settings settings object to query whether encoding detector is enabled
319
* @return @c EINA_TRUE if the encoding detector is enabled
320
* @c EINA_FALSE if not or on failure
322
EAPI Eina_Bool ewk_settings_encoding_detector_enabled_get(const Ewk_Settings *settings);
325
* Sets preferred minimum contents width which is used as default minimum contents width
326
* for non viewport meta element sites.
328
* By default, preferred minimum contents width is equal to @c 980.
330
* @param settings settings object to set the encoding detector
331
* @param enable @c EINA_TRUE to enable the encoding detector,
332
* @c EINA_FALSE to disable
334
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
336
EAPI Eina_Bool ewk_settings_preferred_minimum_contents_width_set(Ewk_Settings *settings, unsigned width);
339
* Returns preferred minimum contents width or @c 0 on failure.
341
* @param settings settings object to query preferred minimum contents width
343
* @return preferred minimum contents width
346
EAPI unsigned ewk_settings_preferred_minimum_contents_width_get(const Ewk_Settings *settings);
349
* Enables/disables the offline application cache.
351
* By default, the offline application cache is enabled.
353
* @param settings settings object to set the offline application cache state
354
* @param enable @c EINA_TRUE to enable the offline application cache,
355
* @c EINA_FALSE to disable
357
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
359
EAPI Eina_Bool ewk_settings_offline_web_application_cache_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
362
* Returns whether the offline application cache is enabled or not.
364
* @param settings settings object to query whether offline application cache is enabled
366
* @return @c EINA_TRUE if the offline application cache is enabled
367
* @c EINA_FALSE if disabled or on failure
369
EAPI Eina_Bool ewk_settings_offline_web_application_cache_enabled_get(const Ewk_Settings *settings);
372
* Enables/disables if the scripts can open new windows.
374
* By default, the scripts can open new windows.
376
* @param settings settings object to set if the scripts can open new windows
377
* @param enable @c EINA_TRUE if the scripts can open new windows
378
* @c EINA_FALSE if not
380
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure (scripts are disabled)
382
EAPI Eina_Bool ewk_settings_scripts_can_open_windows_set(Ewk_Settings *settings, Eina_Bool enable);
385
* Returns whether the scripts can open new windows.
387
* @param settings settings object to query whether the scripts can open new windows
389
* @return @c EINA_TRUE if the scripts can open new windows
390
* @c EINA_FALSE if not or on failure (scripts are disabled)
392
EAPI Eina_Bool ewk_settings_scripts_can_open_windows_get(const Ewk_Settings *settings);
395
* Enables/disables the HTML5 local storage functionality.
397
* Local storage provides simple synchronous storage access.
398
* HTML5 local storage specification is available at
399
* http://dev.w3.org/html5/webstorage/.
401
* By default, the HTML5 local storage is enabled.
403
* @param settings settings object to set the HTML5 local storage state
404
* @param enable @c EINA_TRUE to enable HTML5 local storage,
405
* @c EINA_FALSE to disable
407
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
409
EAPI Eina_Bool ewk_settings_local_storage_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
412
* Returns whether the HTML5 local storage functionality is enabled or not.
414
* Local storage provides simple synchronous storage access.
415
* HTML5 local storage specification is available at
416
* http://dev.w3.org/html5/webstorage/.
418
* By default, the HTML5 local storage is enabled.
420
* @param settings settings object to query whether HTML5 local storage is enabled
422
* @return @c EINA_TRUE if the HTML5 local storage is enabled
423
* @c EINA_FALSE if disabled or on failure
425
EAPI Eina_Bool ewk_settings_local_storage_enabled_get(const Ewk_Settings *settings);
430
#endif // ewk_settings_h