~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit2/UIProcess/API/efl/ewk_settings.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2012 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   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_h
 
35
#define ewk_settings_h
 
36
 
 
37
#include <Eina.h>
 
38
 
 
39
#ifdef __cplusplus
 
40
extern "C" {
 
41
#endif
 
42
 
 
43
/** Creates a type name for Ewk_Settings */
 
44
typedef struct EwkSettings Ewk_Settings;
 
45
 
 
46
/**
 
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.
 
49
 *
 
50
 * @param enable @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled
 
51
 */
 
52
typedef void (*Ewk_Settings_Continuous_Spell_Checking_Change_Cb)(Eina_Bool enable);
 
53
 
 
54
 
 
55
/**
 
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
 
59
 *
 
60
 * Default value for Javascript Fullscreen API setting is @c EINA_TRUE .
 
61
 *
 
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
 
65
 *
 
66
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
67
 */
 
68
EAPI Eina_Bool ewk_settings_fullscreen_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
69
 
 
70
/**
 
71
 * Returns whether the Javascript Fullscreen API is enabled or not.
 
72
 *
 
73
 * @param settings settings object to query whether Javascript Fullscreen API is enabled
 
74
 *
 
75
 * @return @c EINA_TRUE if the Javascript Fullscreen API is enabled
 
76
 *         @c EINA_FALSE if not or on failure
 
77
 */
 
78
EAPI Eina_Bool ewk_settings_fullscreen_enabled_get(const Ewk_Settings *settings);
 
79
 
 
80
/**
 
81
 * Enables/disables the javascript executing.
 
82
 *
 
83
 * By default, JavaScript execution is enabled.
 
84
 *
 
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
 
88
 *
 
89
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
90
 */
 
91
EAPI Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
92
 
 
93
/**
 
94
 * Returns whether JavaScript execution is enabled.
 
95
 *
 
96
 * @param settings settings object to query if the javascript can be executed
 
97
 *
 
98
 * @return @c EINA_TRUE if the javascript can be executed
 
99
 *         @c EINA_FALSE if not or on failure
 
100
 */
 
101
EAPI Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings *settings);
 
102
 
 
103
/**
 
104
 * Enables/disables auto loading of the images.
 
105
 *
 
106
 * By default, auto loading of the images is enabled.
 
107
 *
 
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
 
111
 *
 
112
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
113
 */
 
114
EAPI Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings *settings, Eina_Bool automatic);
 
115
 
 
116
/**
 
117
 * Returns whether the images can be loaded automatically or not.
 
118
 *
 
119
 * @param settings settings object to get auto loading of the images
 
120
 *
 
121
 * @return @c EINA_TRUE if the images are loaded automatically
 
122
 *         @c EINA_FALSE if not or on failure
 
123
 */
 
124
EAPI Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings *settings);
 
125
 
 
126
/**
 
127
 * Enables/disables developer extensions.
 
128
 *
 
129
 * By default, the developer extensions are disabled.
 
130
 *
 
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
 
134
 *
 
135
 * @return @c EINA_TRUE on success or @EINA_FALSE on failure
 
136
 */
 
137
EAPI Eina_Bool ewk_settings_developer_extras_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
138
 
 
139
/**
 
140
 * Queries if developer extensions are enabled.
 
141
 *
 
142
 * By default, the developer extensions are disabled.
 
143
 *
 
144
 * @param settings settings object to set developer extensions
 
145
 *
 
146
 * @return @c EINA_TRUE if developer extensions are enabled
 
147
           @c EINA_FALSE if not or on failure
 
148
 */
 
149
EAPI Eina_Bool ewk_settings_developer_extras_enabled_get(const Ewk_Settings *settings);
 
150
 
 
151
/**
 
152
 * Allow / Disallow file access from file:// URLs.
 
153
 *
 
154
 * By default, file access from file:// URLs is not allowed.
 
155
 *
 
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
 
159
 *
 
160
 * @return @c EINA_TRUE on success or @EINA_FALSE on failure
 
161
 */
 
162
EAPI Eina_Bool ewk_settings_file_access_from_file_urls_allowed_set(Ewk_Settings *settings, Eina_Bool enable);
 
163
 
 
164
/**
 
165
 * Queries if  file access from file:// URLs is allowed.
 
166
 *
 
167
 * By default, file access from file:// URLs is not allowed.
 
168
 *
 
169
 * @param settings settings object to query file access permission
 
170
 *
 
171
 * @return @c EINA_TRUE if file access from file:// URLs is allowed
 
172
 *         @c EINA_FALSE if not or on failure
 
173
 */
 
174
EAPI Eina_Bool ewk_settings_file_access_from_file_urls_allowed_get(const Ewk_Settings *settings);
 
175
 
 
176
/**
 
177
 * Enables/disables frame flattening.
 
178
 *
 
179
 * By default, the frame flattening is disabled.
 
180
 *
 
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
 
184
 *
 
185
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
186
 *
 
187
 * @see ewk_settings_enable_frame_flattening_get()
 
188
 */
 
189
EAPI Eina_Bool ewk_settings_frame_flattening_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
190
 
 
191
/**
 
192
 * Returns whether the frame flattening is enabled.
 
193
 *
 
194
 * The frame flattening is a feature which expands sub frames until all the frames become
 
195
 * one scrollable page.
 
196
 *
 
197
 * @param settings settings object to get the frame flattening.
 
198
 *
 
199
 * @return @c EINA_TRUE if the frame flattening is enabled
 
200
 *         @c EINA_FALSE if not or on failure
 
201
 */
 
202
EAPI Eina_Bool ewk_settings_frame_flattening_enabled_get(const Ewk_Settings *settings);
 
203
 
 
204
/**
 
205
 * Enables/disables DNS prefetching.
 
206
 *
 
207
 * By default, DNS prefetching is disabled.
 
208
 *
 
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
 
212
 *
 
213
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
214
 *
 
215
 * @see ewk_settings_DNS_prefetching_enabled_get()
 
216
 */
 
217
EAPI Eina_Bool ewk_settings_dns_prefetching_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
218
 
 
219
/**
 
220
 * Returns whether DNS prefetching is enabled or not.
 
221
 *
 
222
 * DNS prefetching is an attempt to resolve domain names before a user tries to follow a link.
 
223
 *
 
224
 * @param settings settings object to get DNS prefetching
 
225
 *
 
226
 * @return @c EINA_TRUE if DNS prefetching is enabled
 
227
 *         @c EINA_FALSE if not or on failure
 
228
 */
 
229
EAPI Eina_Bool ewk_settings_dns_prefetching_enabled_get(const Ewk_Settings *settings);
 
230
 
 
231
/**
 
232
 * Sets a callback function used to notify the client when
 
233
 * the continuous spell checking setting was changed by WebKit.
 
234
 *
 
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.
 
240
 *
 
241
 * @param cb a new callback function to set or @c NULL to invalidate the previous one
 
242
 */
 
243
EAPI void ewk_settings_continuous_spell_checking_change_cb_set(Ewk_Settings_Continuous_Spell_Checking_Change_Cb cb);
 
244
 
 
245
/**
 
246
 * Queries if continuous spell checking is enabled.
 
247
 *
 
248
 * @return @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled
 
249
 */
 
250
EAPI Eina_Bool ewk_settings_continuous_spell_checking_enabled_get(void);
 
251
 
 
252
/**
 
253
 * Enables/disables continuous spell checking.
 
254
 *
 
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.
 
258
 *
 
259
 * @see ewk_settings_continuous_spell_checking_change_cb_set
 
260
 *
 
261
 * @param enable @c EINA_TRUE to enable continuous spell checking or @c EINA_FALSE to disable
 
262
 */
 
263
EAPI void ewk_settings_continuous_spell_checking_enabled_set(Eina_Bool enable);
 
264
 
 
265
/**
 
266
 * Gets the the list of all available the spell checking languages to use.
 
267
 *
 
268
 * @see ewk_settings_spell_checking_languages_set
 
269
 *
 
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()
 
272
 */
 
273
EAPI Eina_List *ewk_settings_spell_checking_available_languages_get(void);
 
274
 
 
275
/**
 
276
 * Sets @a languages as the list of languages to use by default WebKit
 
277
 * implementation of spellchecker feature with Enchant library support.
 
278
 *
 
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.
 
281
 *
 
282
 * @note This function invalidates the previously set languages.
 
283
 *       The dictionaries are requested asynchronously.
 
284
 *
 
285
 * @param languages a list of comma (',') separated language codes
 
286
 *        of the form 'en_US', ie, language_VARIANT, may be @c NULL.
 
287
 */
 
288
EAPI void ewk_settings_spell_checking_languages_set(const char *languages);
 
289
 
 
290
/**
 
291
 * Gets the the list of the spell checking languages in use.
 
292
 *
 
293
 * @see ewk_settings_spell_checking_available_languages_get
 
294
 * @see ewk_settings_spell_checking_languages_set
 
295
 *
 
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()
 
298
 */
 
299
EAPI Eina_List *ewk_settings_spell_checking_languages_get(void);
 
300
 
 
301
/**
 
302
 * Enables/disables the encoding detector.
 
303
 *
 
304
 * By default, the encoding detector is disabled.
 
305
 *
 
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
 
309
 *
 
310
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
311
 */
 
312
EAPI Eina_Bool ewk_settings_encoding_detector_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
313
 
 
314
/**
 
315
* Returns whether the encoding detector is enabled or not.
 
316
 *
 
317
 * @param settings settings object to query whether encoding detector is enabled
 
318
 *
 
319
 * @return @c EINA_TRUE if the encoding detector is enabled
 
320
 *         @c EINA_FALSE if not or on failure
 
321
 */
 
322
EAPI Eina_Bool ewk_settings_encoding_detector_enabled_get(const Ewk_Settings *settings);
 
323
 
 
324
/**
 
325
 * Sets preferred minimum contents width which is used as default minimum contents width
 
326
 * for non viewport meta element sites.
 
327
 *
 
328
 * By default, preferred minimum contents width is equal to @c 980.
 
329
 *
 
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
 
333
 *
 
334
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
335
 */
 
336
EAPI Eina_Bool ewk_settings_preferred_minimum_contents_width_set(Ewk_Settings *settings, unsigned width);
 
337
 
 
338
/**
 
339
 * Returns preferred minimum contents width or @c 0 on failure.
 
340
 *
 
341
 * @param settings settings object to query preferred minimum contents width
 
342
 *
 
343
 * @return preferred minimum contents width
 
344
 *         @c 0 on failure
 
345
 */
 
346
EAPI unsigned ewk_settings_preferred_minimum_contents_width_get(const Ewk_Settings *settings);
 
347
 
 
348
/**
 
349
 * Enables/disables the offline application cache.
 
350
 *
 
351
 * By default, the offline application cache is enabled.
 
352
 *
 
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
 
356
 *
 
357
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
358
 */
 
359
EAPI Eina_Bool ewk_settings_offline_web_application_cache_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
360
 
 
361
/**
 
362
 * Returns whether the offline application cache is enabled or not.
 
363
 *
 
364
 * @param settings settings object to query whether offline application cache is enabled
 
365
 *
 
366
 * @return @c EINA_TRUE if the offline application cache is enabled
 
367
 *         @c EINA_FALSE if disabled or on failure
 
368
 */
 
369
EAPI Eina_Bool ewk_settings_offline_web_application_cache_enabled_get(const Ewk_Settings *settings);
 
370
 
 
371
/**
 
372
 * Enables/disables if the scripts can open new windows.
 
373
 *
 
374
 * By default, the scripts can open new windows.
 
375
 *
 
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
 
379
 *
 
380
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure (scripts are disabled)
 
381
 */
 
382
EAPI Eina_Bool ewk_settings_scripts_can_open_windows_set(Ewk_Settings *settings, Eina_Bool enable);
 
383
 
 
384
/**
 
385
 * Returns whether the scripts can open new windows.
 
386
 *
 
387
 * @param settings settings object to query whether the scripts can open new windows
 
388
 *
 
389
 * @return @c EINA_TRUE if the scripts can open new windows
 
390
 *         @c EINA_FALSE if not or on failure (scripts are disabled)
 
391
 */
 
392
EAPI Eina_Bool ewk_settings_scripts_can_open_windows_get(const Ewk_Settings *settings);
 
393
 
 
394
/**
 
395
 * Enables/disables the HTML5 local storage functionality.
 
396
 *
 
397
 * Local storage provides simple synchronous storage access.
 
398
 * HTML5 local storage specification is available at
 
399
 * http://dev.w3.org/html5/webstorage/.
 
400
 *
 
401
 * By default, the HTML5 local storage is enabled.
 
402
 *
 
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
 
406
 *
 
407
 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
 
408
 */
 
409
EAPI Eina_Bool ewk_settings_local_storage_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
 
410
 
 
411
/**
 
412
 * Returns whether the HTML5 local storage functionality is enabled or not.
 
413
 *
 
414
 * Local storage provides simple synchronous storage access.
 
415
 * HTML5 local storage specification is available at
 
416
 * http://dev.w3.org/html5/webstorage/.
 
417
 *
 
418
 * By default, the HTML5 local storage is enabled.
 
419
 *
 
420
 * @param settings settings object to query whether HTML5 local storage is enabled
 
421
 *
 
422
 * @return @c EINA_TRUE if the HTML5 local storage is enabled
 
423
 *         @c EINA_FALSE if disabled or on failure
 
424
 */
 
425
EAPI Eina_Bool ewk_settings_local_storage_enabled_get(const Ewk_Settings *settings);
 
426
 
 
427
#ifdef __cplusplus
 
428
}
 
429
#endif
 
430
#endif // ewk_settings_h