1/*
2 * Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification,
5 * are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation and/or
12 * other materials provided with the distribution.
13 *
14 * Neither the name of Motorola Mobility, Inc. nor the names of its contributors may
15 * be used to endorse or promote products derived from this software without
16 * specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
32#error "Only <webkit2/webkit2.h> can be included directly."
33#endif
34
35#ifndef WebKitSettings_h
36#define WebKitSettings_h
37
38#include <glib-object.h>
39#include <webkit2/WebKitDefines.h>
40
41G_BEGIN_DECLS
42
43#define WEBKIT_TYPE_SETTINGS (webkit_settings_get_type())
44#define WEBKIT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_SETTINGS, WebKitSettings))
45#define WEBKIT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_SETTINGS, WebKitSettingsClass))
46#define WEBKIT_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_SETTINGS))
47#define WEBKIT_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_SETTINGS))
48#define WEBKIT_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_SETTINGS, WebKitSettingsClass))
49
50/**
51 * WebKitHardwareAccelerationPolicy:
52 * @WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND: Hardware acceleration is enabled/disabled as request by web contents.
53 * @WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS: Hardware acceleration is always enabled, even for websites not requesting it.
54 * @WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER: Hardware acceleration is always disabled, even for websites requesting it.
55 *
56 * Enum values used for determining the hardware acceleration policy.
57 *
58 * Since: 2.16
59 */
60typedef enum {
61 WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND,
62 WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS,
63 WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER
64} WebKitHardwareAccelerationPolicy;
65
66typedef struct _WebKitSettings WebKitSettings;
67typedef struct _WebKitSettingsClass WebKitSettingsClass;
68typedef struct _WebKitSettingsPrivate WebKitSettingsPrivate;
69
70struct _WebKitSettings {
71 GObject parent_instance;
72
73 WebKitSettingsPrivate *priv;
74};
75
76struct _WebKitSettingsClass {
77 GObjectClass parent_class;
78
79 void (*_webkit_reserved0) (void);
80 void (*_webkit_reserved1) (void);
81 void (*_webkit_reserved2) (void);
82 void (*_webkit_reserved3) (void);
83};
84
85WEBKIT_API GType
86webkit_settings_get_type(void);
87
88WEBKIT_API WebKitSettings *
89webkit_settings_new (void);
90
91WEBKIT_API WebKitSettings *
92webkit_settings_new_with_settings (const gchar *first_setting_name,
93 ...);
94
95WEBKIT_API gboolean
96webkit_settings_get_enable_javascript (WebKitSettings *settings);
97
98WEBKIT_API void
99webkit_settings_set_enable_javascript (WebKitSettings *settings,
100 gboolean enabled);
101
102WEBKIT_API gboolean
103webkit_settings_get_auto_load_images (WebKitSettings *settings);
104
105WEBKIT_API void
106webkit_settings_set_auto_load_images (WebKitSettings *settings,
107 gboolean enabled);
108
109WEBKIT_API gboolean
110webkit_settings_get_load_icons_ignoring_image_load_setting (WebKitSettings *settings);
111
112WEBKIT_API void
113webkit_settings_set_load_icons_ignoring_image_load_setting (WebKitSettings *settings,
114 gboolean enabled);
115
116WEBKIT_API gboolean
117webkit_settings_get_enable_offline_web_application_cache (WebKitSettings *settings);
118
119WEBKIT_API void
120webkit_settings_set_enable_offline_web_application_cache (WebKitSettings *settings,
121 gboolean enabled);
122
123WEBKIT_API gboolean
124webkit_settings_get_enable_html5_local_storage (WebKitSettings *settings);
125
126WEBKIT_API void
127webkit_settings_set_enable_html5_local_storage (WebKitSettings *settings,
128 gboolean enabled);
129
130WEBKIT_API gboolean
131webkit_settings_get_enable_html5_database (WebKitSettings *settings);
132
133WEBKIT_API void
134webkit_settings_set_enable_html5_database (WebKitSettings *settings,
135 gboolean enabled);
136WEBKIT_API gboolean
137webkit_settings_get_enable_xss_auditor (WebKitSettings *settings);
138
139WEBKIT_API void
140webkit_settings_set_enable_xss_auditor (WebKitSettings *settings,
141 gboolean enabled);
142
143WEBKIT_API gboolean
144webkit_settings_get_enable_frame_flattening (WebKitSettings *settings);
145
146WEBKIT_API void
147webkit_settings_set_enable_frame_flattening (WebKitSettings *settings,
148 gboolean enabled);
149
150WEBKIT_API gboolean
151webkit_settings_get_enable_plugins (WebKitSettings *settings);
152
153WEBKIT_API void
154webkit_settings_set_enable_plugins (WebKitSettings *settings,
155 gboolean enabled);
156
157WEBKIT_API gboolean
158webkit_settings_get_enable_java (WebKitSettings *settings);
159
160WEBKIT_API void
161webkit_settings_set_enable_java (WebKitSettings *settings,
162 gboolean enabled);
163
164WEBKIT_API gboolean
165webkit_settings_get_javascript_can_open_windows_automatically (WebKitSettings *settings);
166
167WEBKIT_API void
168webkit_settings_set_javascript_can_open_windows_automatically (WebKitSettings *settings,
169 gboolean enabled);
170
171WEBKIT_API gboolean
172webkit_settings_get_enable_hyperlink_auditing (WebKitSettings *settings);
173
174WEBKIT_API void
175webkit_settings_set_enable_hyperlink_auditing (WebKitSettings *settings,
176 gboolean enabled);
177
178WEBKIT_API const gchar *
179webkit_settings_get_default_font_family (WebKitSettings *settings);
180
181WEBKIT_API void
182webkit_settings_set_default_font_family (WebKitSettings *settings,
183 const gchar *default_font_family);
184
185WEBKIT_API const gchar *
186webkit_settings_get_monospace_font_family (WebKitSettings *settings);
187
188WEBKIT_API void
189webkit_settings_set_monospace_font_family (WebKitSettings *settings,
190 const gchar *monospace_font_family);
191
192WEBKIT_API const gchar *
193webkit_settings_get_serif_font_family (WebKitSettings *settings);
194
195WEBKIT_API void
196webkit_settings_set_serif_font_family (WebKitSettings *settings,
197 const gchar *serif_font_family);
198
199WEBKIT_API const gchar *
200webkit_settings_get_sans_serif_font_family (WebKitSettings *settings);
201
202WEBKIT_API void
203webkit_settings_set_sans_serif_font_family (WebKitSettings *settings,
204 const gchar *sans_serif_font_family);
205
206WEBKIT_API const gchar *
207webkit_settings_get_cursive_font_family (WebKitSettings *settings);
208
209WEBKIT_API void
210webkit_settings_set_cursive_font_family (WebKitSettings *settings,
211 const gchar *cursive_font_family);
212
213WEBKIT_API const gchar *
214webkit_settings_get_fantasy_font_family (WebKitSettings *settings);
215
216WEBKIT_API void
217webkit_settings_set_fantasy_font_family (WebKitSettings *settings,
218 const gchar *fantasy_font_family);
219
220WEBKIT_API const gchar *
221webkit_settings_get_pictograph_font_family (WebKitSettings *settings);
222
223WEBKIT_API void
224webkit_settings_set_pictograph_font_family (WebKitSettings *settings,
225 const gchar *pictograph_font_family);
226
227WEBKIT_API guint32
228webkit_settings_get_default_font_size (WebKitSettings *settings);
229
230WEBKIT_API void
231webkit_settings_set_default_font_size (WebKitSettings *settings,
232 guint32 font_size);
233
234WEBKIT_API guint32
235webkit_settings_get_default_monospace_font_size (WebKitSettings *settings);
236
237WEBKIT_API void
238webkit_settings_set_default_monospace_font_size (WebKitSettings *settings,
239 guint32 font_size);
240
241WEBKIT_API guint32
242webkit_settings_get_minimum_font_size (WebKitSettings *settings);
243
244WEBKIT_API void
245webkit_settings_set_minimum_font_size (WebKitSettings *settings,
246 guint32 font_size);
247
248WEBKIT_API const gchar *
249webkit_settings_get_default_charset (WebKitSettings *settings);
250
251WEBKIT_API void
252webkit_settings_set_default_charset (WebKitSettings *settings,
253 const gchar *default_charset);
254
255WEBKIT_DEPRECATED gboolean
256webkit_settings_get_enable_private_browsing (WebKitSettings *settings);
257
258WEBKIT_DEPRECATED void
259webkit_settings_set_enable_private_browsing (WebKitSettings *settings,
260 gboolean enabled);
261
262WEBKIT_API gboolean
263webkit_settings_get_enable_developer_extras (WebKitSettings *settings);
264
265WEBKIT_API void
266webkit_settings_set_enable_developer_extras (WebKitSettings *settings,
267 gboolean enabled);
268
269WEBKIT_API gboolean
270webkit_settings_get_enable_resizable_text_areas (WebKitSettings *settings);
271
272WEBKIT_API void
273webkit_settings_set_enable_resizable_text_areas (WebKitSettings *settings,
274 gboolean enabled);
275
276WEBKIT_API gboolean
277webkit_settings_get_enable_tabs_to_links (WebKitSettings *settings);
278
279WEBKIT_API void
280webkit_settings_set_enable_tabs_to_links (WebKitSettings *settings,
281 gboolean enabled);
282
283WEBKIT_API gboolean
284webkit_settings_get_enable_dns_prefetching (WebKitSettings *settings);
285
286WEBKIT_API void
287webkit_settings_set_enable_dns_prefetching (WebKitSettings *settings,
288 gboolean enabled);
289
290WEBKIT_API gboolean
291webkit_settings_get_enable_caret_browsing (WebKitSettings *settings);
292
293WEBKIT_API void
294webkit_settings_set_enable_caret_browsing (WebKitSettings *settings,
295 gboolean enabled);
296
297WEBKIT_API gboolean
298webkit_settings_get_enable_fullscreen (WebKitSettings *settings);
299
300WEBKIT_API void
301webkit_settings_set_enable_fullscreen (WebKitSettings *settings,
302 gboolean enabled);
303
304WEBKIT_API gboolean
305webkit_settings_get_print_backgrounds (WebKitSettings *settings);
306
307WEBKIT_API void
308webkit_settings_set_print_backgrounds (WebKitSettings *settings,
309 gboolean print_backgrounds);
310
311WEBKIT_API gboolean
312webkit_settings_get_enable_webaudio (WebKitSettings *settings);
313
314WEBKIT_API void
315webkit_settings_set_enable_webaudio (WebKitSettings *settings,
316 gboolean enabled);
317
318WEBKIT_API gboolean
319webkit_settings_get_enable_webgl (WebKitSettings *settings);
320
321WEBKIT_API void
322webkit_settings_set_enable_webgl (WebKitSettings *settings,
323 gboolean enabled);
324
325WEBKIT_API void
326webkit_settings_set_allow_modal_dialogs (WebKitSettings *settings,
327 gboolean allowed);
328
329WEBKIT_API gboolean
330webkit_settings_get_allow_modal_dialogs (WebKitSettings *settings);
331
332WEBKIT_API void
333webkit_settings_set_zoom_text_only (WebKitSettings *settings,
334 gboolean zoom_text_only);
335
336WEBKIT_API gboolean
337webkit_settings_get_zoom_text_only (WebKitSettings *settings);
338
339WEBKIT_API gboolean
340webkit_settings_get_javascript_can_access_clipboard (WebKitSettings *settings);
341
342WEBKIT_API void
343webkit_settings_set_javascript_can_access_clipboard (WebKitSettings *settings,
344 gboolean enabled);
345
346WEBKIT_API gboolean
347webkit_settings_get_media_playback_requires_user_gesture (WebKitSettings *settings);
348
349WEBKIT_API void
350webkit_settings_set_media_playback_requires_user_gesture (WebKitSettings *settings,
351 gboolean enabled);
352
353WEBKIT_API gboolean
354webkit_settings_get_media_playback_allows_inline (WebKitSettings *settings);
355
356WEBKIT_API void
357webkit_settings_set_media_playback_allows_inline (WebKitSettings *settings,
358 gboolean enabled);
359WEBKIT_API gboolean
360webkit_settings_get_draw_compositing_indicators (WebKitSettings *settings);
361
362WEBKIT_API void
363webkit_settings_set_draw_compositing_indicators (WebKitSettings *settings,
364 gboolean enabled);
365
366WEBKIT_API gboolean
367webkit_settings_get_enable_site_specific_quirks (WebKitSettings *settings);
368
369WEBKIT_API void
370webkit_settings_set_enable_site_specific_quirks (WebKitSettings *settings,
371 gboolean enabled);
372
373WEBKIT_API gboolean
374webkit_settings_get_enable_page_cache (WebKitSettings *settings);
375
376WEBKIT_API void
377webkit_settings_set_enable_page_cache (WebKitSettings *settings,
378 gboolean enabled);
379
380WEBKIT_API const gchar *
381webkit_settings_get_user_agent (WebKitSettings *settings);
382
383WEBKIT_API void
384webkit_settings_set_user_agent (WebKitSettings *settings,
385 const gchar *user_agent);
386WEBKIT_API void
387webkit_settings_set_user_agent_with_application_details (WebKitSettings *settings,
388 const gchar *application_name,
389 const gchar *application_version);
390
391WEBKIT_API gboolean
392webkit_settings_get_enable_smooth_scrolling (WebKitSettings *settings);
393
394WEBKIT_API void
395webkit_settings_set_enable_smooth_scrolling (WebKitSettings *settings,
396 gboolean enabled);
397
398WEBKIT_API gboolean
399webkit_settings_get_enable_accelerated_2d_canvas (WebKitSettings *settings);
400
401WEBKIT_API void
402webkit_settings_set_enable_accelerated_2d_canvas (WebKitSettings *settings,
403 gboolean enabled);
404
405WEBKIT_API gboolean
406webkit_settings_get_enable_write_console_messages_to_stdout (WebKitSettings *settings);
407
408WEBKIT_API void
409webkit_settings_set_enable_write_console_messages_to_stdout (WebKitSettings *settings,
410 gboolean enabled);
411
412WEBKIT_API gboolean
413webkit_settings_get_enable_media_stream (WebKitSettings *settings);
414
415WEBKIT_API void
416webkit_settings_set_enable_media_stream (WebKitSettings *settings,
417 gboolean enabled);
418
419WEBKIT_API gboolean
420webkit_settings_get_enable_mock_capture_devices (WebKitSettings *settings);
421
422WEBKIT_API void
423webkit_settings_set_enable_mock_capture_devices (WebKitSettings *settings,
424 gboolean enabled);
425
426WEBKIT_API gboolean
427webkit_settings_get_enable_spatial_navigation (WebKitSettings *settings);
428
429WEBKIT_API void
430webkit_settings_set_enable_spatial_navigation (WebKitSettings *settings,
431 gboolean enabled);
432
433WEBKIT_API gboolean
434webkit_settings_get_enable_mediasource (WebKitSettings *settings);
435
436WEBKIT_API void
437webkit_settings_set_enable_mediasource (WebKitSettings *settings,
438 gboolean enabled);
439
440WEBKIT_API gboolean
441webkit_settings_get_enable_encrypted_media (WebKitSettings *settings);
442
443WEBKIT_API void
444webkit_settings_set_enable_encrypted_media (WebKitSettings *settings,
445 gboolean enabled);
446
447WEBKIT_API gboolean
448webkit_settings_get_enable_media_capabilities (WebKitSettings *settings);
449
450WEBKIT_API void
451webkit_settings_set_enable_media_capabilities (WebKitSettings *settings,
452 gboolean enabled);
453
454WEBKIT_API gboolean
455webkit_settings_get_allow_file_access_from_file_urls (WebKitSettings *settings);
456
457WEBKIT_API void
458webkit_settings_set_allow_file_access_from_file_urls (WebKitSettings *settings,
459 gboolean allowed);
460
461WEBKIT_API gboolean
462webkit_settings_get_allow_universal_access_from_file_urls (WebKitSettings *settings);
463
464WEBKIT_API void
465webkit_settings_set_allow_universal_access_from_file_urls (WebKitSettings *settings,
466 gboolean allowed);
467
468WEBKIT_API WebKitHardwareAccelerationPolicy
469webkit_settings_get_hardware_acceleration_policy (WebKitSettings *settings);
470
471WEBKIT_API void
472webkit_settings_set_hardware_acceleration_policy (WebKitSettings *settings,
473 WebKitHardwareAccelerationPolicy policy);
474
475WEBKIT_API gboolean
476webkit_settings_get_enable_back_forward_navigation_gestures (WebKitSettings *settings);
477
478WEBKIT_API void
479webkit_settings_set_enable_back_forward_navigation_gestures (WebKitSettings *settings,
480 gboolean enabled);
481
482WEBKIT_API guint32
483webkit_settings_font_size_to_points (guint32 pixels);
484
485WEBKIT_API guint32
486webkit_settings_font_size_to_pixels (guint32 points);
487
488WEBKIT_API gboolean
489webkit_settings_get_enable_javascript_markup (WebKitSettings *settings);
490
491WEBKIT_API void
492webkit_settings_set_enable_javascript_markup (WebKitSettings *settings,
493 gboolean enabled);
494
495WEBKIT_API gboolean
496webkit_settings_get_enable_media (WebKitSettings *settings);
497
498WEBKIT_API void
499webkit_settings_set_enable_media (WebKitSettings *settings,
500 gboolean enabled);
501
502G_END_DECLS
503
504#endif /* WebKitSettings_h */
505