[GTK] Add CSS Grid Layout as experimental feature
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / gtk / WebKitSettings.cpp
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 #include "config.h"
32 #include "WebKitSettings.h"
33
34 #include "ExperimentalFeatures.h"
35 #include "WebKitPrivate.h"
36 #include "WebKitSettingsPrivate.h"
37 #include <WebCore/UserAgentGtk.h>
38 #include <glib/gi18n-lib.h>
39 #include <wtf/text/CString.h>
40
41 using namespace WebKit;
42
43 struct _WebKitSettingsPrivate {
44     _WebKitSettingsPrivate()
45         : preferences(WebPreferences::create())
46     {
47         defaultFontFamily = preferences->standardFontFamily().utf8();
48         monospaceFontFamily = preferences->fixedFontFamily().utf8();
49         serifFontFamily = preferences->serifFontFamily().utf8();
50         sansSerifFontFamily = preferences->sansSerifFontFamily().utf8();
51         cursiveFontFamily = preferences->cursiveFontFamily().utf8();
52         fantasyFontFamily = preferences->fantasyFontFamily().utf8();
53         pictographFontFamily = preferences->pictographFontFamily().utf8();
54         defaultCharset = preferences->defaultTextEncodingName().utf8();
55     }
56
57     RefPtr<WebPreferences> preferences;
58     CString defaultFontFamily;
59     CString monospaceFontFamily;
60     CString serifFontFamily;
61     CString sansSerifFontFamily;
62     CString cursiveFontFamily;
63     CString fantasyFontFamily;
64     CString pictographFontFamily;
65     CString defaultCharset;
66     CString userAgent;
67     bool allowModalDialogs;
68     bool zoomTextOnly;
69 };
70
71 /**
72  * SECTION:WebKitSettings
73  * @short_description: Control the behaviour of #WebKitWebView<!-- -->s
74  * @see_also: #WebKitWebViewGroup, #WebKitWebView
75  *
76  * #WebKitSettings can be applied to a #WebKitWebViewGroup to control text charset,
77  * color, font sizes, printing mode, script support, loading of images and various
78  * other things on the #WebKitWebView<!-- -->s of the group.
79  * After creation, a #WebKitSettings object contains default settings.
80  *
81  * <informalexample><programlisting>
82  * /<!-- -->* Disable JavaScript. *<!-- -->/
83  * WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
84  * webkit_settings_set_enable_javascript (settings, FALSE);
85  *
86  * </programlisting></informalexample>
87  */
88
89 WEBKIT_DEFINE_TYPE(WebKitSettings, webkit_settings, G_TYPE_OBJECT)
90
91 enum {
92     PROP_0,
93
94     PROP_ENABLE_JAVASCRIPT,
95     PROP_AUTO_LOAD_IMAGES,
96     PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING,
97     PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
98     PROP_ENABLE_HTML5_LOCAL_STORAGE,
99     PROP_ENABLE_HTML5_DATABASE,
100     PROP_ENABLE_XSS_AUDITOR,
101     PROP_ENABLE_FRAME_FLATTENING,
102     PROP_ENABLE_PLUGINS,
103     PROP_ENABLE_JAVA,
104     PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
105     PROP_ENABLE_HYPERLINK_AUDITING,
106     PROP_DEFAULT_FONT_FAMILY,
107     PROP_MONOSPACE_FONT_FAMILY,
108     PROP_SERIF_FONT_FAMILY,
109     PROP_SANS_SERIF_FONT_FAMILY,
110     PROP_CURSIVE_FONT_FAMILY,
111     PROP_FANTASY_FONT_FAMILY,
112     PROP_PICTOGRAPH_FONT_FAMILY,
113     PROP_DEFAULT_FONT_SIZE,
114     PROP_DEFAULT_MONOSPACE_FONT_SIZE,
115     PROP_MINIMUM_FONT_SIZE,
116     PROP_DEFAULT_CHARSET,
117     PROP_ENABLE_PRIVATE_BROWSING,
118     PROP_ENABLE_DEVELOPER_EXTRAS,
119     PROP_ENABLE_RESIZABLE_TEXT_AREAS,
120     PROP_ENABLE_TABS_TO_LINKS,
121     PROP_ENABLE_DNS_PREFETCHING,
122     PROP_ENABLE_CARET_BROWSING,
123     PROP_ENABLE_FULLSCREEN,
124     PROP_PRINT_BACKGROUNDS,
125     PROP_ENABLE_WEBAUDIO,
126     PROP_ENABLE_WEBGL,
127     PROP_ALLOW_MODAL_DIALOGS,
128     PROP_ZOOM_TEXT_ONLY,
129     PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
130     PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
131     PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
132     PROP_DRAW_COMPOSITING_INDICATORS,
133     PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
134     PROP_ENABLE_PAGE_CACHE,
135     PROP_USER_AGENT,
136     PROP_ENABLE_SMOOTH_SCROLLING,
137     PROP_ENABLE_ACCELERATED_2D_CANVAS,
138     PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
139     PROP_ENABLE_MEDIA_STREAM,
140     PROP_ENABLE_SPATIAL_NAVIGATION,
141     PROP_ENABLE_MEDIASOURCE
142 };
143
144 static void webKitSettingsConstructed(GObject* object)
145 {
146     G_OBJECT_CLASS(webkit_settings_parent_class)->constructed(object);
147
148     WebPreferences* prefs = WEBKIT_SETTINGS(object)->priv->preferences.get();
149     ExperimentalFeatures features;
150     bool cssGridLayoutEnabled = features.isEnabled(ExperimentalFeatures::CSSGridLayout);
151     if (prefs->cssGridLayoutEnabled() != cssGridLayoutEnabled)
152         prefs->setCSSGridLayoutEnabled(cssGridLayoutEnabled);
153     bool regionBasedColumnsEnabled = features.isEnabled(ExperimentalFeatures::RegionBasedColumns);
154     if (prefs->regionBasedColumnsEnabled() != regionBasedColumnsEnabled)
155         prefs->setRegionBasedColumnsEnabled(regionBasedColumnsEnabled);
156
157     prefs->setShouldRespectImageOrientation(true);
158 }
159
160 static void webKitSettingsSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
161 {
162     WebKitSettings* settings = WEBKIT_SETTINGS(object);
163
164     switch (propId) {
165     case PROP_ENABLE_JAVASCRIPT:
166         webkit_settings_set_enable_javascript(settings, g_value_get_boolean(value));
167         break;
168     case PROP_AUTO_LOAD_IMAGES:
169         webkit_settings_set_auto_load_images(settings, g_value_get_boolean(value));
170         break;
171     case PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING:
172         webkit_settings_set_load_icons_ignoring_image_load_setting(settings, g_value_get_boolean(value));
173         break;
174     case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
175         webkit_settings_set_enable_offline_web_application_cache(settings, g_value_get_boolean(value));
176         break;
177     case PROP_ENABLE_HTML5_LOCAL_STORAGE:
178         webkit_settings_set_enable_html5_local_storage(settings, g_value_get_boolean(value));
179         break;
180     case PROP_ENABLE_HTML5_DATABASE:
181         webkit_settings_set_enable_html5_database(settings, g_value_get_boolean(value));
182         break;
183     case PROP_ENABLE_XSS_AUDITOR:
184         webkit_settings_set_enable_xss_auditor(settings, g_value_get_boolean(value));
185         break;
186     case PROP_ENABLE_FRAME_FLATTENING:
187         webkit_settings_set_enable_frame_flattening(settings, g_value_get_boolean(value));
188         break;
189     case PROP_ENABLE_PLUGINS:
190         webkit_settings_set_enable_plugins(settings, g_value_get_boolean(value));
191         break;
192     case PROP_ENABLE_JAVA:
193         webkit_settings_set_enable_java(settings, g_value_get_boolean(value));
194         break;
195     case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
196         webkit_settings_set_javascript_can_open_windows_automatically(settings, g_value_get_boolean(value));
197         break;
198     case PROP_ENABLE_HYPERLINK_AUDITING:
199         webkit_settings_set_enable_hyperlink_auditing(settings, g_value_get_boolean(value));
200         break;
201     case PROP_DEFAULT_FONT_FAMILY:
202         webkit_settings_set_default_font_family(settings, g_value_get_string(value));
203         break;
204     case PROP_MONOSPACE_FONT_FAMILY:
205         webkit_settings_set_monospace_font_family(settings, g_value_get_string(value));
206         break;
207     case PROP_SERIF_FONT_FAMILY:
208         webkit_settings_set_serif_font_family(settings, g_value_get_string(value));
209         break;
210     case PROP_SANS_SERIF_FONT_FAMILY:
211         webkit_settings_set_sans_serif_font_family(settings, g_value_get_string(value));
212         break;
213     case PROP_CURSIVE_FONT_FAMILY:
214         webkit_settings_set_cursive_font_family(settings, g_value_get_string(value));
215         break;
216     case PROP_FANTASY_FONT_FAMILY:
217         webkit_settings_set_fantasy_font_family(settings, g_value_get_string(value));
218         break;
219     case PROP_PICTOGRAPH_FONT_FAMILY:
220         webkit_settings_set_pictograph_font_family(settings, g_value_get_string(value));
221         break;
222     case PROP_DEFAULT_FONT_SIZE:
223         webkit_settings_set_default_font_size(settings, g_value_get_uint(value));
224         break;
225     case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
226         webkit_settings_set_default_monospace_font_size(settings, g_value_get_uint(value));
227         break;
228     case PROP_MINIMUM_FONT_SIZE:
229         webkit_settings_set_minimum_font_size(settings, g_value_get_uint(value));
230         break;
231     case PROP_DEFAULT_CHARSET:
232         webkit_settings_set_default_charset(settings, g_value_get_string(value));
233         break;
234     case PROP_ENABLE_PRIVATE_BROWSING:
235         webkit_settings_set_enable_private_browsing(settings, g_value_get_boolean(value));
236         break;
237     case PROP_ENABLE_DEVELOPER_EXTRAS:
238         webkit_settings_set_enable_developer_extras(settings, g_value_get_boolean(value));
239         break;
240     case PROP_ENABLE_RESIZABLE_TEXT_AREAS:
241         webkit_settings_set_enable_resizable_text_areas(settings, g_value_get_boolean(value));
242         break;
243     case PROP_ENABLE_TABS_TO_LINKS:
244         webkit_settings_set_enable_tabs_to_links(settings, g_value_get_boolean(value));
245         break;
246     case PROP_ENABLE_DNS_PREFETCHING:
247         webkit_settings_set_enable_dns_prefetching(settings, g_value_get_boolean(value));
248         break;
249     case PROP_ENABLE_CARET_BROWSING:
250         webkit_settings_set_enable_caret_browsing(settings, g_value_get_boolean(value));
251         break;
252     case PROP_ENABLE_FULLSCREEN:
253         webkit_settings_set_enable_fullscreen(settings, g_value_get_boolean(value));
254         break;
255     case PROP_PRINT_BACKGROUNDS:
256         webkit_settings_set_print_backgrounds(settings, g_value_get_boolean(value));
257         break;
258     case PROP_ENABLE_WEBAUDIO:
259         webkit_settings_set_enable_webaudio(settings, g_value_get_boolean(value));
260         break;
261     case PROP_ENABLE_WEBGL:
262         webkit_settings_set_enable_webgl(settings, g_value_get_boolean(value));
263         break;
264     case PROP_ALLOW_MODAL_DIALOGS:
265         webkit_settings_set_allow_modal_dialogs(settings, g_value_get_boolean(value));
266         break;
267     case PROP_ZOOM_TEXT_ONLY:
268         webkit_settings_set_zoom_text_only(settings, g_value_get_boolean(value));
269         break;
270     case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
271         webkit_settings_set_javascript_can_access_clipboard(settings, g_value_get_boolean(value));
272         break;
273     case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
274         webkit_settings_set_media_playback_requires_user_gesture(settings, g_value_get_boolean(value));
275         break;
276     case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
277         webkit_settings_set_media_playback_allows_inline(settings, g_value_get_boolean(value));
278         break;
279     case PROP_DRAW_COMPOSITING_INDICATORS:
280         if (g_value_get_boolean(value))
281             webkit_settings_set_draw_compositing_indicators(settings, g_value_get_boolean(value));
282         else {
283             char* debugVisualsEnvironment = getenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS");
284             bool showDebugVisuals = debugVisualsEnvironment && !strcmp(debugVisualsEnvironment, "1");
285             webkit_settings_set_draw_compositing_indicators(settings, showDebugVisuals);
286         }
287         break;
288     case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
289         webkit_settings_set_enable_site_specific_quirks(settings, g_value_get_boolean(value));
290         break;
291     case PROP_ENABLE_PAGE_CACHE:
292         webkit_settings_set_enable_page_cache(settings, g_value_get_boolean(value));
293         break;
294     case PROP_USER_AGENT:
295         webkit_settings_set_user_agent(settings, g_value_get_string(value));
296         break;
297     case PROP_ENABLE_SMOOTH_SCROLLING:
298         webkit_settings_set_enable_smooth_scrolling(settings, g_value_get_boolean(value));
299         break;
300     case PROP_ENABLE_ACCELERATED_2D_CANVAS:
301         webkit_settings_set_enable_accelerated_2d_canvas(settings, g_value_get_boolean(value));
302         break;
303     case PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT:
304         webkit_settings_set_enable_write_console_messages_to_stdout(settings, g_value_get_boolean(value));
305         break;
306     case PROP_ENABLE_MEDIA_STREAM:
307         webkit_settings_set_enable_media_stream(settings, g_value_get_boolean(value));
308         break;
309     case PROP_ENABLE_SPATIAL_NAVIGATION:
310         webkit_settings_set_enable_spatial_navigation(settings, g_value_get_boolean(value));
311         break;
312     case PROP_ENABLE_MEDIASOURCE:
313         webkit_settings_set_enable_mediasource(settings, g_value_get_boolean(value));
314         break;
315     default:
316         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
317         break;
318     }
319 }
320
321 static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
322 {
323     WebKitSettings* settings = WEBKIT_SETTINGS(object);
324
325     switch (propId) {
326     case PROP_ENABLE_JAVASCRIPT:
327         g_value_set_boolean(value, webkit_settings_get_enable_javascript(settings));
328         break;
329     case PROP_AUTO_LOAD_IMAGES:
330         g_value_set_boolean(value, webkit_settings_get_auto_load_images(settings));
331         break;
332     case PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING:
333         g_value_set_boolean(value, webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
334         break;
335     case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
336         g_value_set_boolean(value, webkit_settings_get_enable_offline_web_application_cache(settings));
337         break;
338     case PROP_ENABLE_HTML5_LOCAL_STORAGE:
339         g_value_set_boolean(value, webkit_settings_get_enable_html5_local_storage(settings));
340         break;
341     case PROP_ENABLE_HTML5_DATABASE:
342         g_value_set_boolean(value, webkit_settings_get_enable_html5_database(settings));
343         break;
344     case PROP_ENABLE_XSS_AUDITOR:
345         g_value_set_boolean(value, webkit_settings_get_enable_xss_auditor(settings));
346         break;
347     case PROP_ENABLE_FRAME_FLATTENING:
348         g_value_set_boolean(value, webkit_settings_get_enable_frame_flattening(settings));
349         break;
350     case PROP_ENABLE_PLUGINS:
351         g_value_set_boolean(value, webkit_settings_get_enable_plugins(settings));
352         break;
353     case PROP_ENABLE_JAVA:
354         g_value_set_boolean(value, webkit_settings_get_enable_java(settings));
355         break;
356     case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
357         g_value_set_boolean(value, webkit_settings_get_javascript_can_open_windows_automatically(settings));
358         break;
359     case PROP_ENABLE_HYPERLINK_AUDITING:
360         g_value_set_boolean(value, webkit_settings_get_enable_hyperlink_auditing(settings));
361         break;
362     case PROP_DEFAULT_FONT_FAMILY:
363         g_value_set_string(value, webkit_settings_get_default_font_family(settings));
364         break;
365     case PROP_MONOSPACE_FONT_FAMILY:
366         g_value_set_string(value, webkit_settings_get_monospace_font_family(settings));
367         break;
368     case PROP_SERIF_FONT_FAMILY:
369         g_value_set_string(value, webkit_settings_get_serif_font_family(settings));
370         break;
371     case PROP_SANS_SERIF_FONT_FAMILY:
372         g_value_set_string(value, webkit_settings_get_sans_serif_font_family(settings));
373         break;
374     case PROP_CURSIVE_FONT_FAMILY:
375         g_value_set_string(value, webkit_settings_get_cursive_font_family(settings));
376         break;
377     case PROP_FANTASY_FONT_FAMILY:
378         g_value_set_string(value, webkit_settings_get_fantasy_font_family(settings));
379         break;
380     case PROP_PICTOGRAPH_FONT_FAMILY:
381         g_value_set_string(value, webkit_settings_get_pictograph_font_family(settings));
382         break;
383     case PROP_DEFAULT_FONT_SIZE:
384         g_value_set_uint(value, webkit_settings_get_default_font_size(settings));
385         break;
386     case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
387         g_value_set_uint(value, webkit_settings_get_default_monospace_font_size(settings));
388         break;
389     case PROP_MINIMUM_FONT_SIZE:
390         g_value_set_uint(value, webkit_settings_get_minimum_font_size(settings));
391         break;
392     case PROP_DEFAULT_CHARSET:
393         g_value_set_string(value, webkit_settings_get_default_charset(settings));
394         break;
395     case PROP_ENABLE_PRIVATE_BROWSING:
396         g_value_set_boolean(value, webkit_settings_get_enable_private_browsing(settings));
397         break;
398     case PROP_ENABLE_DEVELOPER_EXTRAS:
399         g_value_set_boolean(value, webkit_settings_get_enable_developer_extras(settings));
400         break;
401     case PROP_ENABLE_RESIZABLE_TEXT_AREAS:
402         g_value_set_boolean(value, webkit_settings_get_enable_resizable_text_areas(settings));
403         break;
404     case PROP_ENABLE_TABS_TO_LINKS:
405         g_value_set_boolean(value, webkit_settings_get_enable_tabs_to_links(settings));
406         break;
407     case PROP_ENABLE_DNS_PREFETCHING:
408         g_value_set_boolean(value, webkit_settings_get_enable_dns_prefetching(settings));
409         break;
410     case PROP_ENABLE_CARET_BROWSING:
411         g_value_set_boolean(value, webkit_settings_get_enable_caret_browsing(settings));
412         break;
413     case PROP_ENABLE_FULLSCREEN:
414         g_value_set_boolean(value, webkit_settings_get_enable_fullscreen(settings));
415         break;
416     case PROP_PRINT_BACKGROUNDS:
417         g_value_set_boolean(value, webkit_settings_get_print_backgrounds(settings));
418         break;
419     case PROP_ENABLE_WEBAUDIO:
420         g_value_set_boolean(value, webkit_settings_get_enable_webaudio(settings));
421         break;
422     case PROP_ENABLE_WEBGL:
423         g_value_set_boolean(value, webkit_settings_get_enable_webgl(settings));
424         break;
425     case PROP_ALLOW_MODAL_DIALOGS:
426         g_value_set_boolean(value, webkit_settings_get_allow_modal_dialogs(settings));
427         break;
428     case PROP_ZOOM_TEXT_ONLY:
429         g_value_set_boolean(value, webkit_settings_get_zoom_text_only(settings));
430         break;
431     case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
432         g_value_set_boolean(value, webkit_settings_get_javascript_can_access_clipboard(settings));
433         break;
434     case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
435         g_value_set_boolean(value, webkit_settings_get_media_playback_requires_user_gesture(settings));
436         break;
437     case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
438         g_value_set_boolean(value, webkit_settings_get_media_playback_allows_inline(settings));
439         break;
440     case PROP_DRAW_COMPOSITING_INDICATORS:
441         g_value_set_boolean(value, webkit_settings_get_draw_compositing_indicators(settings));
442         break;
443     case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
444         g_value_set_boolean(value, webkit_settings_get_enable_site_specific_quirks(settings));
445         break;
446     case PROP_ENABLE_PAGE_CACHE:
447         g_value_set_boolean(value, webkit_settings_get_enable_page_cache(settings));
448         break;
449     case PROP_USER_AGENT:
450         g_value_set_string(value, webkit_settings_get_user_agent(settings));
451         break;
452     case PROP_ENABLE_SMOOTH_SCROLLING:
453         g_value_set_boolean(value, webkit_settings_get_enable_smooth_scrolling(settings));
454         break;
455     case PROP_ENABLE_ACCELERATED_2D_CANVAS:
456         g_value_set_boolean(value, webkit_settings_get_enable_accelerated_2d_canvas(settings));
457         break;
458     case PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT:
459         g_value_set_boolean(value, webkit_settings_get_enable_write_console_messages_to_stdout(settings));
460         break;
461     case PROP_ENABLE_MEDIA_STREAM:
462         g_value_set_boolean(value, webkit_settings_get_enable_media_stream(settings));
463         break;
464     case PROP_ENABLE_SPATIAL_NAVIGATION:
465         g_value_set_boolean(value, webkit_settings_get_enable_spatial_navigation(settings));
466         break;
467     case PROP_ENABLE_MEDIASOURCE:
468         g_value_set_boolean(value, webkit_settings_get_enable_mediasource(settings));
469         break;
470
471     default:
472         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
473         break;
474     }
475 }
476
477 static void webkit_settings_class_init(WebKitSettingsClass* klass)
478 {
479     GObjectClass* gObjectClass = G_OBJECT_CLASS(klass);
480     gObjectClass->constructed = webKitSettingsConstructed;
481     gObjectClass->set_property = webKitSettingsSetProperty;
482     gObjectClass->get_property = webKitSettingsGetProperty;
483
484     GParamFlags readWriteConstructParamFlags = static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
485
486     /**
487      * WebKitSettings:enable-javascript:
488      *
489      * Determines whether or not JavaScript executes within a page.
490      */
491     g_object_class_install_property(gObjectClass,
492                                     PROP_ENABLE_JAVASCRIPT,
493                                     g_param_spec_boolean("enable-javascript",
494                                                          _("Enable JavaScript"),
495                                                          _("Enable JavaScript."),
496                                                          TRUE,
497                                                          readWriteConstructParamFlags));
498
499     /**
500      * WebKitSettings:auto-load-images:
501      *
502      * Determines whether images should be automatically loaded or not.
503      * On devices where network bandwidth is of concern, it might be
504      * useful to turn this property off.
505      */
506     g_object_class_install_property(gObjectClass,
507                                     PROP_AUTO_LOAD_IMAGES,
508                                     g_param_spec_boolean("auto-load-images",
509                                                          _("Auto load images"),
510                                                          _("Load images automatically."),
511                                                          TRUE,
512                                                          readWriteConstructParamFlags));
513
514     /**
515      * WebKitSettings:load-icons-ignoring-image-load-setting:
516      *
517      * Determines whether a site can load favicons irrespective
518      * of the value of #WebKitSettings:auto-load-images.
519      */
520     g_object_class_install_property(gObjectClass,
521                                     PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING,
522                                     g_param_spec_boolean("load-icons-ignoring-image-load-setting",
523                                                          _("Load icons ignoring image load setting"),
524                                                          _("Whether to load site icons ignoring image load setting."),
525                                                          FALSE,
526                                                          readWriteConstructParamFlags));
527
528     /**
529      * WebKitSettings:enable-offline-web-application-cache:
530      *
531      * Whether to enable HTML5 offline web application cache support. Offline
532      * web application cache allows web applications to run even when
533      * the user is not connected to the network.
534      *
535      * HTML5 offline web application specification is available at
536      * http://dev.w3.org/html5/spec/offline.html.
537      */
538     g_object_class_install_property(gObjectClass,
539                                     PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
540                                     g_param_spec_boolean("enable-offline-web-application-cache",
541                                                          _("Enable offline web application cache"),
542                                                          _("Whether to enable offline web application cache."),
543                                                          TRUE,
544                                                          readWriteConstructParamFlags));
545
546     /**
547      * WebKitSettings:enable-html5-local-storage:
548      *
549      * Whether to enable HTML5 local storage support. Local storage provides
550      * simple synchronous storage access.
551      *
552      * HTML5 local storage specification is available at
553      * http://dev.w3.org/html5/webstorage/.
554      */
555     g_object_class_install_property(gObjectClass,
556                                     PROP_ENABLE_HTML5_LOCAL_STORAGE,
557                                     g_param_spec_boolean("enable-html5-local-storage",
558                                                          _("Enable HTML5 local storage"),
559                                                          _("Whether to enable HTML5 Local Storage support."),
560                                                          TRUE,
561                                                          readWriteConstructParamFlags));
562
563     /**
564      * WebKitSettings:enable-html5-database:
565      *
566      * Whether to enable HTML5 client-side SQL database support. Client-side
567      * SQL database allows web pages to store structured data and be able to
568      * use SQL to manipulate that data asynchronously.
569      *
570      * HTML5 database specification is available at
571      * http://www.w3.org/TR/webdatabase/.
572      */
573     g_object_class_install_property(gObjectClass,
574                                     PROP_ENABLE_HTML5_DATABASE,
575                                     g_param_spec_boolean("enable-html5-database",
576                                                          _("Enable HTML5 database"),
577                                                          _("Whether to enable HTML5 database support."),
578                                                          TRUE,
579                                                          readWriteConstructParamFlags));
580
581     /**
582      * WebKitSettings:enable-xss-auditor:
583      *
584      * Whether to enable the XSS auditor. This feature filters some kinds of
585      * reflective XSS attacks on vulnerable web sites.
586      */
587     g_object_class_install_property(gObjectClass,
588                                     PROP_ENABLE_XSS_AUDITOR,
589                                     g_param_spec_boolean("enable-xss-auditor",
590                                                          _("Enable XSS auditor"),
591                                                          _("Whether to enable the XSS auditor."),
592                                                          TRUE,
593                                                          readWriteConstructParamFlags));
594
595
596     /**
597      * WebKitSettings:enable-frame-flattening:
598      *
599      * Whether to enable the frame flattening. With this setting each subframe is expanded
600      * to its contents, which will flatten all the frames to become one scrollable page.
601      * On touch devices scrollable subframes on a page can result in a confusing user experience.
602      */
603     g_object_class_install_property(gObjectClass,
604                                     PROP_ENABLE_FRAME_FLATTENING,
605                                     g_param_spec_boolean("enable-frame-flattening",
606                                                          _("Enable frame flattening"),
607                                                          _("Whether to enable frame flattening."),
608                                                          FALSE,
609                                                          readWriteConstructParamFlags));
610
611     /**
612      * WebKitSettings:enable-plugins:
613      *
614      * Determines whether or not plugins on the page are enabled.
615      */
616     g_object_class_install_property(gObjectClass,
617                                     PROP_ENABLE_PLUGINS,
618                                     g_param_spec_boolean("enable-plugins",
619                                                          _("Enable plugins"),
620                                                          _("Enable embedded plugin objects."),
621                                                          TRUE,
622                                                          readWriteConstructParamFlags));
623
624     /**
625      * WebKitSettings:enable-java:
626      *
627      * Determines whether or not Java is enabled on the page.
628      */
629     g_object_class_install_property(gObjectClass,
630                                     PROP_ENABLE_JAVA,
631                                     g_param_spec_boolean("enable-java",
632                                                          _("Enable Java"),
633                                                          _("Whether Java support should be enabled."),
634                                                          TRUE,
635                                                          readWriteConstructParamFlags));
636
637     /**
638      * WebKitSettings:javascript-can-open-windows-automatically:
639      *
640      * Whether JavaScript can open popup windows automatically without user
641      * intervention.
642      */
643     g_object_class_install_property(gObjectClass,
644                                     PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
645                                     g_param_spec_boolean("javascript-can-open-windows-automatically",
646                                                          _("JavaScript can open windows automatically"),
647                                                          _("Whether JavaScript can open windows automatically."),
648                                                          FALSE,
649                                                          readWriteConstructParamFlags));
650
651     /**
652      * WebKitSettings:enable-hyperlink-auditing:
653      *
654      * Determines whether or not hyperlink auditing is enabled.
655      *
656      * The hyperlink auditing specification is available at
657      * http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing.
658      */
659     g_object_class_install_property(gObjectClass,
660                                     PROP_ENABLE_HYPERLINK_AUDITING,
661                                     g_param_spec_boolean("enable-hyperlink-auditing",
662                                                          _("Enable hyperlink auditing"),
663                                                          _("Whether <a ping> should be able to send pings."),
664                                                          FALSE,
665                                                          readWriteConstructParamFlags));
666
667     /**
668      * WebKitWebSettings:default-font-family:
669      *
670      * The font family to use as the default for content that does not specify a font.
671      */
672     g_object_class_install_property(gObjectClass,
673                                     PROP_DEFAULT_FONT_FAMILY,
674                                     g_param_spec_string("default-font-family",
675                                                         _("Default font family"),
676                                                         _("The font family to use as the default for content that does not specify a font."),
677                                                         "sans-serif",
678                                                         readWriteConstructParamFlags));
679
680     /**
681      * WebKitWebSettings:monospace-font-family:
682      *
683      * The font family used as the default for content using a monospace font.
684      *
685      */
686     g_object_class_install_property(gObjectClass,
687                                     PROP_MONOSPACE_FONT_FAMILY,
688                                     g_param_spec_string("monospace-font-family",
689                                                         _("Monospace font family"),
690                                                         _("The font family used as the default for content using monospace font."),
691                                                         "monospace",
692                                                         readWriteConstructParamFlags));
693
694     /**
695      * WebKitWebSettings:serif-font-family:
696      *
697      * The font family used as the default for content using a serif font.
698      */
699     g_object_class_install_property(gObjectClass,
700                                     PROP_SERIF_FONT_FAMILY,
701                                     g_param_spec_string("serif-font-family",
702                                                         _("Serif font family"),
703                                                         _("The font family used as the default for content using serif font."),
704                                                         "serif",
705                                                         readWriteConstructParamFlags));
706
707     /**
708      * WebKitWebSettings:sans-serif-font-family:
709      *
710      * The font family used as the default for content using a sans-serif font.
711      */
712     g_object_class_install_property(gObjectClass,
713                                     PROP_SANS_SERIF_FONT_FAMILY,
714                                     g_param_spec_string("sans-serif-font-family",
715                                                         _("Sans-serif font family"),
716                                                         _("The font family used as the default for content using sans-serif font."),
717                                                         "sans-serif",
718                                                         readWriteConstructParamFlags));
719
720     /**
721      * WebKitWebSettings:cursive-font-family:
722      *
723      * The font family used as the default for content using a cursive font.
724      */
725     g_object_class_install_property(gObjectClass,
726                                     PROP_CURSIVE_FONT_FAMILY,
727                                     g_param_spec_string("cursive-font-family",
728                                                         _("Cursive font family"),
729                                                         _("The font family used as the default for content using cursive font."),
730                                                         "serif",
731                                                         readWriteConstructParamFlags));
732
733     /**
734      * WebKitWebSettings:fantasy-font-family:
735      *
736      * The font family used as the default for content using a fantasy font.
737      */
738     g_object_class_install_property(gObjectClass,
739                                     PROP_FANTASY_FONT_FAMILY,
740                                     g_param_spec_string("fantasy-font-family",
741                                                         _("Fantasy font family"),
742                                                         _("The font family used as the default for content using fantasy font."),
743                                                         "serif",
744                                                         readWriteConstructParamFlags));
745
746     /**
747      * WebKitWebSettings:pictograph-font-family:
748      *
749      * The font family used as the default for content using a pictograph font.
750      */
751     g_object_class_install_property(gObjectClass,
752                                     PROP_PICTOGRAPH_FONT_FAMILY,
753                                     g_param_spec_string("pictograph-font-family",
754                                                         _("Pictograph font family"),
755                                                         _("The font family used as the default for content using pictograph font."),
756                                                         "serif",
757                                                         readWriteConstructParamFlags));
758
759     /**
760      * WebKitWebSettings:default-font-size:
761      *
762      * The default font size in pixels to use for content displayed if
763      * no font size is specified.
764      */
765     g_object_class_install_property(gObjectClass,
766                                     PROP_DEFAULT_FONT_SIZE,
767                                     g_param_spec_uint("default-font-size",
768                                                       _("Default font size"),
769                                                       _("The default font size used to display text."),
770                                                       0, G_MAXUINT, 16,
771                                                       readWriteConstructParamFlags));
772
773     /**
774      * WebKitWebSettings:default-monospace-font-size:
775      *
776      * The default font size in pixels to use for content displayed in
777      * monospace font if no font size is specified.
778      */
779     g_object_class_install_property(gObjectClass,
780                                     PROP_DEFAULT_MONOSPACE_FONT_SIZE,
781                                     g_param_spec_uint("default-monospace-font-size",
782                                                       _("Default monospace font size"),
783                                                       _("The default font size used to display monospace text."),
784                                                       0, G_MAXUINT, 13,
785                                                       readWriteConstructParamFlags));
786
787     /**
788      * WebKitWebSettings:minimum-font-size:
789      *
790      * The minimum font size in points used to display text. This setting
791      * controls the absolute smallest size. Values other than 0 can
792      * potentially break page layouts.
793      */
794     g_object_class_install_property(gObjectClass,
795                                     PROP_MINIMUM_FONT_SIZE,
796                                     g_param_spec_uint("minimum-font-size",
797                                                       _("Minimum font size"),
798                                                       _("The minimum font size used to display text."),
799                                                       0, G_MAXUINT, 0,
800                                                       readWriteConstructParamFlags));
801
802     /**
803      * WebKitSettings:default-charset:
804      *
805      * The default text charset used when interpreting content with an unspecified charset.
806      */
807     g_object_class_install_property(gObjectClass,
808                                     PROP_DEFAULT_CHARSET,
809                                     g_param_spec_string("default-charset",
810                                                         _("Default charset"),
811                                                         _("The default text charset used when interpreting content with unspecified charset."),
812                                                         "iso-8859-1",
813                                                         readWriteConstructParamFlags));
814
815     /**
816      * WebKitSettings:enable-private-browsing:
817      *
818      * Determines whether or not private browsing is enabled. Private browsing
819      * will disable history, cache and form auto-fill for any pages visited.
820      */
821     g_object_class_install_property(gObjectClass,
822                                     PROP_ENABLE_PRIVATE_BROWSING,
823                                     g_param_spec_boolean("enable-private-browsing",
824                                                          _("Enable private browsing"),
825                                                          _("Whether to enable private browsing"),
826                                                          FALSE,
827                                                          readWriteConstructParamFlags));
828
829     /**
830      * WebKitSettings:enable-developer-extras:
831      *
832      * Determines whether or not developer tools, such as the Web Inspector, are enabled.
833      */
834     g_object_class_install_property(gObjectClass,
835                                     PROP_ENABLE_DEVELOPER_EXTRAS,
836                                     g_param_spec_boolean("enable-developer-extras",
837                                                          _("Enable developer extras"),
838                                                          _("Whether to enable developer extras"),
839                                                          FALSE,
840                                                          readWriteConstructParamFlags));
841
842     /**
843      * WebKitSettings:enable-resizable-text-areas:
844      *
845      * Determines whether or not text areas can be resized.
846      */
847     g_object_class_install_property(gObjectClass,
848                                     PROP_ENABLE_RESIZABLE_TEXT_AREAS,
849                                     g_param_spec_boolean("enable-resizable-text-areas",
850                                                          _("Enable resizable text areas"),
851                                                          _("Whether to enable resizable text areas"),
852                                                          TRUE,
853                                                          readWriteConstructParamFlags));
854
855     /**
856      * WebKitSettings:enable-tabs-to-links:
857      *
858      * Determines whether the tab key cycles through the elements on the page.
859      * When this setting is enabled, users will be able to focus the next element
860      * in the page by pressing the tab key. If the selected element is editable,
861      * then pressing tab key will insert the tab character.
862      */
863     g_object_class_install_property(gObjectClass,
864                                     PROP_ENABLE_TABS_TO_LINKS,
865                                     g_param_spec_boolean("enable-tabs-to-links",
866                                                          _("Enable tabs to links"),
867                                                          _("Whether to enable tabs to links"),
868                                                          TRUE,
869                                                          readWriteConstructParamFlags));
870
871     /**
872      * WebKitSettings:enable-dns-prefetching:
873      *
874      * Determines whether or not to prefetch domain names. DNS prefetching attempts
875      * to resolve domain names before a user tries to follow a link.
876      */
877     g_object_class_install_property(gObjectClass,
878                                     PROP_ENABLE_DNS_PREFETCHING,
879                                     g_param_spec_boolean("enable-dns-prefetching",
880                                                          _("Enable DNS prefetching"),
881                                                          _("Whether to enable DNS prefetching"),
882                                                          FALSE,
883                                                          readWriteConstructParamFlags));
884
885     /**
886      * WebKitSettings:enable-caret-browsing:
887      *
888      * Whether to enable accessibility enhanced keyboard navigation.
889      */
890     g_object_class_install_property(gObjectClass,
891                                     PROP_ENABLE_CARET_BROWSING,
892                                     g_param_spec_boolean("enable-caret-browsing",
893                                                          _("Enable Caret Browsing"),
894                                                          _("Whether to enable accessibility enhanced keyboard navigation"),
895                                                          FALSE,
896                                                          readWriteConstructParamFlags));
897
898     /**
899      * WebKitSettings:enable-fullscreen:
900      *
901      * Whether to enable the Javascript Fullscreen API. The API
902      * allows any HTML element to request fullscreen display. See also
903      * the current draft of the spec:
904      * http://www.w3.org/TR/fullscreen/
905      */
906     g_object_class_install_property(gObjectClass,
907         PROP_ENABLE_FULLSCREEN,
908         g_param_spec_boolean("enable-fullscreen",
909             _("Enable Fullscreen"),
910             _("Whether to enable the Javascript Fullscreen API"),
911             TRUE,
912             readWriteConstructParamFlags));
913
914     /**
915      * WebKitSettings:print-backgrounds:
916      *
917      * Whether background images should be drawn during printing.
918      */
919     g_object_class_install_property(gObjectClass,
920                                     PROP_PRINT_BACKGROUNDS,
921                                     g_param_spec_boolean("print-backgrounds",
922                                                          _("Print Backgrounds"),
923                                                          _("Whether background images should be drawn during printing"),
924                                                          TRUE,
925                                                          readWriteConstructParamFlags));
926
927     /**
928      * WebKitSettings:enable-webaudio:
929      *
930      *
931      * Enable or disable support for WebAudio on pages. WebAudio is an
932      * experimental proposal for allowing web pages to generate Audio
933      * WAVE data from JavaScript. The standard is currently a
934      * work-in-progress by the W3C Audio Working Group.
935      *
936      * See also https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
937      */
938     g_object_class_install_property(gObjectClass,
939                                     PROP_ENABLE_WEBAUDIO,
940                                     g_param_spec_boolean("enable-webaudio",
941                                                          _("Enable WebAudio"),
942                                                          _("Whether WebAudio content should be handled"),
943                                                          FALSE,
944                                                          readWriteConstructParamFlags));
945
946     /**
947     * WebKitSettings:enable-webgl:
948     *
949     * Enable or disable support for WebGL on pages. WebGL is an experimental
950     * proposal for allowing web pages to use OpenGL ES-like calls directly. The
951     * standard is currently a work-in-progress by the Khronos Group.
952     */
953     g_object_class_install_property(gObjectClass,
954                                     PROP_ENABLE_WEBGL,
955                                     g_param_spec_boolean("enable-webgl",
956                                                          _("Enable WebGL"),
957                                                          _("Whether WebGL content should be rendered"),
958                                                          FALSE,
959                                                          readWriteConstructParamFlags));
960
961     /**
962      * WebKitSettings:allow-modal-dialogs:
963      *
964      * Determine whether it's allowed to create and run modal dialogs
965      * from a #WebKitWebView through JavaScript with
966      * <function>window.showModalDialog</function>. If it's set to
967      * %FALSE, the associated #WebKitWebView won't be able to create
968      * new modal dialogs, so not even the #WebKitWebView::create
969      * signal will be emitted.
970      */
971     g_object_class_install_property(gObjectClass,
972                                     PROP_ALLOW_MODAL_DIALOGS,
973                                     g_param_spec_boolean("allow-modal-dialogs",
974                                                          _("Allow modal dialogs"),
975                                                          _("Whether it is possible to create modal dialogs"),
976                                                          FALSE,
977                                                          readWriteConstructParamFlags));
978
979     /**
980      * WebKitSettings:zoom-text-only:
981      *
982      * Whether #WebKitWebView:zoom-level affects only the
983      * text of the page or all the contents. Other contents containing text
984      * like form controls will be also affected by zoom factor when
985      * this property is enabled.
986      */
987     g_object_class_install_property(gObjectClass,
988                                     PROP_ZOOM_TEXT_ONLY,
989                                     g_param_spec_boolean("zoom-text-only",
990                                                          _("Zoom Text Only"),
991                                                          _("Whether zoom level of web view changes only the text size"),
992                                                          FALSE,
993                                                          readWriteConstructParamFlags));
994
995     /**
996      * WebKitSettings:javascript-can-access-clipboard:
997      *
998      * Whether JavaScript can access the clipboard. The default value is %FALSE. If
999      * set to %TRUE, document.execCommand() allows cut, copy and paste commands.
1000      *
1001      */
1002     g_object_class_install_property(gObjectClass,
1003                                     PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
1004                                     g_param_spec_boolean("javascript-can-access-clipboard",
1005                                                          _("JavaScript can access clipboard"),
1006                                                          _("Whether JavaScript can access Clipboard"),
1007                                                          FALSE,
1008                                                          readWriteConstructParamFlags));
1009
1010     /**
1011      * WebKitSettings:media-playback-requires-user-gesture:
1012      *
1013      * Whether a user gesture (such as clicking the play button)
1014      * would be required to start media playback or load media. This is off
1015      * by default, so media playback could start automatically.
1016      * Setting it on requires a gesture by the user to start playback, or to
1017      * load the media.
1018      */
1019     g_object_class_install_property(gObjectClass,
1020                                     PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
1021                                     g_param_spec_boolean("media-playback-requires-user-gesture",
1022                                                          _("Media playback requires user gesture"),
1023                                                          _("Whether media playback requires user gesture"),
1024                                                          FALSE,
1025                                                          readWriteConstructParamFlags));
1026
1027     /**
1028      * WebKitSettings:media-playback-allows-inline:
1029      *
1030      * Whether media playback is full-screen only or inline playback is allowed.
1031      * This is %TRUE by default, so media playback can be inline. Setting it to
1032      * %FALSE allows specifying that media playback should be always fullscreen.
1033      */
1034     g_object_class_install_property(gObjectClass,
1035                                     PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
1036                                     g_param_spec_boolean("media-playback-allows-inline",
1037                                                          _("Media playback allows inline"),
1038                                                          _("Whether media playback allows inline"),
1039                                                          TRUE,
1040                                                          readWriteConstructParamFlags));
1041
1042     /**
1043      * WebKitSettings:draw-compositing-indicators:
1044      *
1045      * Whether to draw compositing borders and repaint counters on layers drawn
1046      * with accelerated compositing. This is useful for debugging issues related
1047      * to web content that is composited with the GPU.
1048      */
1049     g_object_class_install_property(gObjectClass,
1050                                     PROP_DRAW_COMPOSITING_INDICATORS,
1051                                     g_param_spec_boolean("draw-compositing-indicators",
1052                                                          _("Draw compositing indicators"),
1053                                                          _("Whether to draw compositing borders and repaint counters"),
1054                                                          FALSE,
1055                                                          readWriteConstructParamFlags));
1056
1057     /**
1058      * WebKitSettings:enable-site-specific-quirks:
1059      *
1060      * Whether to turn on site-specific quirks. Turning this on will
1061      * tell WebKit to use some site-specific workarounds for
1062      * better web compatibility. For example, older versions of
1063      * MediaWiki will incorrectly send to WebKit a css file with KHTML
1064      * workarounds. By turning on site-specific quirks, WebKit will
1065      * special-case this and other cases to make some specific sites work.
1066      */
1067     g_object_class_install_property(gObjectClass,
1068                                     PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
1069                                     g_param_spec_boolean("enable-site-specific-quirks",
1070                                                          _("Enable Site Specific Quirks"),
1071                                                          _("Enables the site-specific compatibility workarounds"),
1072                                                          FALSE,
1073                                                          readWriteConstructParamFlags));
1074
1075     /**
1076      * WebKitSettings:enable-page-cache:
1077      *
1078      * Enable or disable the page cache. Disabling the page cache is
1079      * generally only useful for special circumstances like low-memory
1080      * scenarios or special purpose applications like static HTML
1081      * viewers. This setting only controls the Page Cache, this cache
1082      * is different than the disk-based or memory-based traditional
1083      * resource caches, its point is to make going back and forth
1084      * between pages much faster. For details about the different types
1085      * of caches and their purposes see:
1086      * http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
1087      */
1088     g_object_class_install_property(gObjectClass,
1089                                     PROP_ENABLE_PAGE_CACHE,
1090                                     g_param_spec_boolean("enable-page-cache",
1091                                                          _("Enable page cache"),
1092                                                          _("Whether the page cache should be used"),
1093                                                          TRUE,
1094                                                          readWriteConstructParamFlags));
1095
1096     /**
1097      * WebKitSettings:user-agent:
1098      *
1099      * The user-agent string used by WebKit. Unusual user-agent strings may cause web
1100      * content to render incorrectly or fail to run, as many web pages are written to
1101      * parse the user-agent strings of only the most popular browsers. Therefore, it's
1102      * typically better to not completely override the standard user-agent, but to use
1103      * webkit_settings_set_user_agent_with_application_details() instead.
1104      *
1105      * If this property is set to the empty string or %NULL, it will revert to the standard
1106      * user-agent.
1107      */
1108     g_object_class_install_property(gObjectClass,
1109                                     PROP_USER_AGENT,
1110                                     g_param_spec_string("user-agent",
1111                                                         _("User agent string"),
1112                                                         _("The user agent string"),
1113                                                         0, // A null string forces the standard user agent.
1114                                                         readWriteConstructParamFlags));
1115
1116     /**
1117      * WebKitSettings:enable-smooth-scrolling:
1118      *
1119      * Enable or disable smooth scrolling.
1120      */
1121     g_object_class_install_property(gObjectClass,
1122                                     PROP_ENABLE_SMOOTH_SCROLLING,
1123                                     g_param_spec_boolean("enable-smooth-scrolling",
1124                                                          _("Enable smooth scrolling"),
1125                                                          _("Whether to enable smooth scrolling"),
1126                                                          FALSE,
1127                                                          readWriteConstructParamFlags));
1128
1129     /**
1130      * WebKitSettings:enable-accelerated-2d-canvas:
1131      *
1132      * Enable or disable accelerated 2D canvas. Accelerated 2D canvas is only available
1133      * if WebKitGTK+ was compiled with a version of Cairo including the unstable CairoGL API.
1134      * When accelerated 2D canvas is enabled, WebKit may render some 2D canvas content
1135      * using hardware accelerated drawing operations.
1136      *
1137      * Since: 2.2
1138      */
1139     g_object_class_install_property(gObjectClass,
1140         PROP_ENABLE_ACCELERATED_2D_CANVAS,
1141         g_param_spec_boolean("enable-accelerated-2d-canvas",
1142             _("Enable accelerated 2D canvas"),
1143             _("Whether to enable accelerated 2D canvas"),
1144             FALSE,
1145             readWriteConstructParamFlags));
1146
1147     /**
1148      * WebKitSettings:enable-write-console-messages-to-stdout:
1149      *
1150      * Enable or disable writing console messages to stdout. These are messages
1151      * sent to the console with console.log and related methods.
1152      *
1153      * Since: 2.2
1154      */
1155     g_object_class_install_property(gObjectClass,
1156         PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
1157         g_param_spec_boolean("enable-write-console-messages-to-stdout",
1158             _("Write console messages on stdout"),
1159             _("Whether to write console messages on stdout"),
1160             FALSE,
1161             readWriteConstructParamFlags));
1162
1163     /**
1164      * WebKitSettings:enable-media-stream:
1165      *
1166      * Enable or disable support for MediaStream on pages. MediaStream
1167      * is an experimental proposal for allowing web pages to access
1168      * audio and video devices for capture.
1169      *
1170      * See also http://dev.w3.org/2011/webrtc/editor/getusermedia.html
1171      *
1172      * Since: 2.4
1173      */
1174     g_object_class_install_property(gObjectClass,
1175         PROP_ENABLE_MEDIA_STREAM,
1176         g_param_spec_boolean("enable-media-stream",
1177             _("Enable MediaStream"),
1178             _("Whether MediaStream content should be handled"),
1179             FALSE,
1180             readWriteConstructParamFlags));
1181
1182    /**
1183      * WebKitSettings:enable-spatial-navigation:
1184      *
1185      * Whether to enable Spatial Navigation. This feature consists in the ability
1186      * to navigate between focusable elements in a Web page, such as hyperlinks
1187      * and form controls, by using Left, Right, Up and Down arrow keys.
1188      * For example, if an user presses the Right key, heuristics determine whether
1189      * there is an element they might be trying to reach towards the right, and if
1190      * there are multiple elements, which element they probably wants.
1191      *
1192      * Since: 2.3
1193      */
1194     g_object_class_install_property(gObjectClass,
1195         PROP_ENABLE_SPATIAL_NAVIGATION,
1196         g_param_spec_boolean("enable-spatial-navigation",
1197             _("Enable Spatial Navigation"),
1198             _("Whether to enable Spatial Navigation support."),
1199             FALSE,
1200             readWriteConstructParamFlags));
1201
1202     /**
1203      * WebKitSettings:enable-mediasource:
1204      *
1205      * Enable or disable support for MediaSource on pages. MediaSource is an
1206      * experimental proposal which extends HTMLMediaElement to allow
1207      * JavaScript to generate media streams for playback.  The standard is
1208      * currently a work-in-progress by the W3C HTML Media Task Force.
1209      *
1210      * See also http://www.w3.org/TR/media-source/
1211      *
1212      * Since: 2.4
1213      */
1214     g_object_class_install_property(gObjectClass,
1215         PROP_ENABLE_MEDIASOURCE,
1216         g_param_spec_boolean("enable-mediasource",
1217             _("Enable MediaSource"),
1218             _("Whether MediaSource should be enabled."),
1219             FALSE,
1220             readWriteConstructParamFlags));
1221 }
1222
1223 WebPreferences* webkitSettingsGetPreferences(WebKitSettings* settings)
1224 {
1225     return settings->priv->preferences.get();
1226 }
1227
1228 /**
1229  * webkit_settings_new:
1230  *
1231  * Creates a new #WebKitSettings instance with default values. It must
1232  * be manually attached to a #WebKitWebViewGroup.
1233  * See also webkit_settings_new_with_settings().
1234  *
1235  * Returns: a new #WebKitSettings instance.
1236  */
1237 WebKitSettings* webkit_settings_new()
1238 {
1239     return WEBKIT_SETTINGS(g_object_new(WEBKIT_TYPE_SETTINGS, NULL));
1240 }
1241
1242 /**
1243  * webkit_settings_new_with_settings:
1244  * @first_setting_name: name of first setting to set
1245  * @...: value of first setting, followed by more settings,
1246  *    %NULL-terminated
1247  *
1248  * Creates a new #WebKitSettings instance with the given settings. It must
1249  * be manually attached to a #WebKitWebViewGroup.
1250  *
1251  * Returns: a new #WebKitSettings instance.
1252  */
1253 WebKitSettings* webkit_settings_new_with_settings(const gchar* firstSettingName, ...)
1254 {
1255     va_list args;
1256     va_start(args, firstSettingName);
1257     WebKitSettings* settings = WEBKIT_SETTINGS(g_object_new_valist(WEBKIT_TYPE_SETTINGS, firstSettingName, args));
1258     va_end(args);
1259     return settings;
1260 }
1261
1262 /**
1263  * webkit_settings_get_enable_javascript:
1264  * @settings: a #WebKitSettings
1265  *
1266  * Get the #WebKitSettings:enable-javascript property.
1267  *
1268  * Returns: %TRUE If JavaScript is enabled or %FALSE otherwise.
1269  */
1270 gboolean webkit_settings_get_enable_javascript(WebKitSettings* settings)
1271 {
1272     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1273
1274     return settings->priv->preferences->javaScriptEnabled();
1275 }
1276
1277 /**
1278  * webkit_settings_set_enable_javascript:
1279  * @settings: a #WebKitSettings
1280  * @enabled: Value to be set
1281  *
1282  * Set the #WebKitSettings:enable-javascript property.
1283  */
1284 void webkit_settings_set_enable_javascript(WebKitSettings* settings, gboolean enabled)
1285 {
1286     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1287
1288     WebKitSettingsPrivate* priv = settings->priv;
1289     bool currentValue = priv->preferences->javaScriptEnabled();
1290     if (currentValue == enabled)
1291         return;
1292
1293     priv->preferences->setJavaScriptEnabled(enabled);
1294     g_object_notify(G_OBJECT(settings), "enable-javascript");
1295 }
1296
1297 /**
1298  * webkit_settings_get_auto_load_images:
1299  * @settings: a #WebKitSettings
1300  *
1301  * Get the #WebKitSettings:auto-load-images property.
1302  *
1303  * Returns: %TRUE If auto loading of images is enabled or %FALSE otherwise.
1304  */
1305 gboolean webkit_settings_get_auto_load_images(WebKitSettings* settings)
1306 {
1307     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1308
1309     return settings->priv->preferences->loadsImagesAutomatically();
1310 }
1311
1312 /**
1313  * webkit_settings_set_auto_load_images:
1314  * @settings: a #WebKitSettings
1315  * @enabled: Value to be set
1316  *
1317  * Set the #WebKitSettings:auto-load-images property.
1318  */
1319 void webkit_settings_set_auto_load_images(WebKitSettings* settings, gboolean enabled)
1320 {
1321     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1322
1323     WebKitSettingsPrivate* priv = settings->priv;
1324     bool currentValue = priv->preferences->loadsImagesAutomatically();
1325     if (currentValue == enabled)
1326         return;
1327
1328     priv->preferences->setLoadsImagesAutomatically(enabled);
1329     g_object_notify(G_OBJECT(settings), "auto-load-images");
1330 }
1331
1332 /**
1333  * webkit_settings_get_load_icons_ignoring_image_load_setting:
1334  * @settings: a #WebKitSettings
1335  *
1336  * Get the #WebKitSettings:load-icons-ignoring-image-load-setting property.
1337  *
1338  * Returns: %TRUE If site icon can be loaded irrespective of image loading preference or %FALSE otherwise.
1339  */
1340 gboolean webkit_settings_get_load_icons_ignoring_image_load_setting(WebKitSettings* settings)
1341 {
1342     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1343
1344     return settings->priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
1345 }
1346
1347 /**
1348  * webkit_settings_set_load_icons_ignoring_image_load_setting:
1349  * @settings: a #WebKitSettings
1350  * @enabled: Value to be set
1351  *
1352  * Set the #WebKitSettings:load-icons-ignoring-image-load-setting property.
1353  */
1354 void webkit_settings_set_load_icons_ignoring_image_load_setting(WebKitSettings* settings, gboolean enabled)
1355 {
1356     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1357
1358     WebKitSettingsPrivate* priv = settings->priv;
1359     bool currentValue = priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
1360     if (currentValue == enabled)
1361         return;
1362
1363     priv->preferences->setLoadsSiteIconsIgnoringImageLoadingPreference(enabled);
1364     g_object_notify(G_OBJECT(settings), "load-icons-ignoring-image-load-setting");
1365 }
1366
1367 /**
1368  * webkit_settings_get_enable_offline_web_application_cache:
1369  * @settings: a #WebKitSettings
1370  *
1371  * Get the #WebKitSettings:enable-offline-web-application-cache property.
1372  *
1373  * Returns: %TRUE If HTML5 offline web application cache support is enabled or %FALSE otherwise.
1374  */
1375 gboolean webkit_settings_get_enable_offline_web_application_cache(WebKitSettings* settings)
1376 {
1377     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1378
1379     return settings->priv->preferences->offlineWebApplicationCacheEnabled();
1380 }
1381
1382 /**
1383  * webkit_settings_set_enable_offline_web_application_cache:
1384  * @settings: a #WebKitSettings
1385  * @enabled: Value to be set
1386  *
1387  * Set the #WebKitSettings:enable-offline-web-application-cache property.
1388  */
1389 void webkit_settings_set_enable_offline_web_application_cache(WebKitSettings* settings, gboolean enabled)
1390 {
1391     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1392
1393     WebKitSettingsPrivate* priv = settings->priv;
1394     bool currentValue = priv->preferences->offlineWebApplicationCacheEnabled();
1395     if (currentValue == enabled)
1396         return;
1397
1398     priv->preferences->setOfflineWebApplicationCacheEnabled(enabled);
1399     g_object_notify(G_OBJECT(settings), "enable-offline-web-application-cache");
1400 }
1401
1402 /**
1403  * webkit_settings_get_enable_html5_local_storage:
1404  * @settings: a #WebKitSettings
1405  *
1406  * Get the #WebKitSettings:enable-html5-local-storage property.
1407  *
1408  * Returns: %TRUE If HTML5 local storage support is enabled or %FALSE otherwise.
1409  */
1410 gboolean webkit_settings_get_enable_html5_local_storage(WebKitSettings* settings)
1411 {
1412     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1413
1414     return settings->priv->preferences->localStorageEnabled();
1415 }
1416
1417 /**
1418  * webkit_settings_set_enable_html5_local_storage:
1419  * @settings: a #WebKitSettings
1420  * @enabled: Value to be set
1421  *
1422  * Set the #WebKitSettings:enable-html5-local-storage property.
1423  */
1424 void webkit_settings_set_enable_html5_local_storage(WebKitSettings* settings, gboolean enabled)
1425 {
1426     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1427
1428     WebKitSettingsPrivate* priv = settings->priv;
1429     bool currentValue = priv->preferences->localStorageEnabled();
1430     if (currentValue == enabled)
1431         return;
1432
1433     priv->preferences->setLocalStorageEnabled(enabled);
1434     g_object_notify(G_OBJECT(settings), "enable-html5-local-storage");
1435 }
1436
1437 /**
1438  * webkit_settings_get_enable_html5_database:
1439  * @settings: a #WebKitSettings
1440  *
1441  * Get the #WebKitSettings:enable-html5-database property.
1442  *
1443  * Returns: %TRUE If HTML5 database support is enabled or %FALSE otherwise.
1444  */
1445 gboolean webkit_settings_get_enable_html5_database(WebKitSettings* settings)
1446 {
1447     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1448
1449     return settings->priv->preferences->databasesEnabled();
1450 }
1451
1452 /**
1453  * webkit_settings_set_enable_html5_database:
1454  * @settings: a #WebKitSettings
1455  * @enabled: Value to be set
1456  *
1457  * Set the #WebKitSettings:enable-html5-database property.
1458  */
1459 void webkit_settings_set_enable_html5_database(WebKitSettings* settings, gboolean enabled)
1460 {
1461     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1462
1463     WebKitSettingsPrivate* priv = settings->priv;
1464     bool currentValue = priv->preferences->databasesEnabled();
1465     if (currentValue == enabled)
1466         return;
1467
1468     priv->preferences->setDatabasesEnabled(enabled);
1469     g_object_notify(G_OBJECT(settings), "enable-html5-database");
1470 }
1471
1472 /**
1473  * webkit_settings_get_enable_xss_auditor:
1474  * @settings: a #WebKitSettings
1475  *
1476  * Get the #WebKitSettings:enable-xss-auditor property.
1477  *
1478  * Returns: %TRUE If XSS auditing is enabled or %FALSE otherwise.
1479  */
1480 gboolean webkit_settings_get_enable_xss_auditor(WebKitSettings* settings)
1481 {
1482     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1483
1484     return settings->priv->preferences->xssAuditorEnabled();
1485 }
1486
1487 /**
1488  * webkit_settings_set_enable_xss_auditor:
1489  * @settings: a #WebKitSettings
1490  * @enabled: Value to be set
1491  *
1492  * Set the #WebKitSettings:enable-xss-auditor property.
1493  */
1494 void webkit_settings_set_enable_xss_auditor(WebKitSettings* settings, gboolean enabled)
1495 {
1496     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1497
1498     WebKitSettingsPrivate* priv = settings->priv;
1499     bool currentValue = priv->preferences->xssAuditorEnabled();
1500     if (currentValue == enabled)
1501         return;
1502
1503     priv->preferences->setXSSAuditorEnabled(enabled);
1504     g_object_notify(G_OBJECT(settings), "enable-xss-auditor");
1505 }
1506
1507 /**
1508  * webkit_settings_get_enable_frame_flattening:
1509  * @settings: a #WebKitSettings
1510  *
1511  * Get the #WebKitSettings:enable-frame-flattening property.
1512  *
1513  * Returns: %TRUE If frame flattening is enabled or %FALSE otherwise.
1514  *
1515  **/
1516 gboolean webkit_settings_get_enable_frame_flattening(WebKitSettings* settings)
1517 {
1518     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1519
1520     return settings->priv->preferences->frameFlatteningEnabled();
1521 }
1522
1523 /**
1524  * webkit_settings_set_enable_frame_flattening:
1525  * @settings: a #WebKitSettings
1526  * @enabled: Value to be set
1527  *
1528  * Set the #WebKitSettings:enable-frame-flattening property.
1529  */
1530 void webkit_settings_set_enable_frame_flattening(WebKitSettings* settings, gboolean enabled)
1531 {
1532     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1533
1534     WebKitSettingsPrivate* priv = settings->priv;
1535     bool currentValue = priv->preferences->frameFlatteningEnabled();
1536     if (currentValue == enabled)
1537         return;
1538
1539     priv->preferences->setFrameFlatteningEnabled(enabled);
1540     g_object_notify(G_OBJECT(settings), "enable-frame-flattening");
1541 }
1542
1543 /**
1544  * webkit_settings_get_enable_plugins:
1545  * @settings: a #WebKitSettings
1546  *
1547  * Get the #WebKitSettings:enable-plugins property.
1548  *
1549  * Returns: %TRUE If plugins are enabled or %FALSE otherwise.
1550  */
1551 gboolean webkit_settings_get_enable_plugins(WebKitSettings* settings)
1552 {
1553     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1554
1555     return settings->priv->preferences->pluginsEnabled();
1556 }
1557
1558 /**
1559  * webkit_settings_set_enable_plugins:
1560  * @settings: a #WebKitSettings
1561  * @enabled: Value to be set
1562  *
1563  * Set the #WebKitSettings:enable-plugins property.
1564  */
1565 void webkit_settings_set_enable_plugins(WebKitSettings* settings, gboolean enabled)
1566 {
1567     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1568
1569     WebKitSettingsPrivate* priv = settings->priv;
1570     bool currentValue = priv->preferences->pluginsEnabled();
1571     if (currentValue == enabled)
1572         return;
1573
1574     priv->preferences->setPluginsEnabled(enabled);
1575     g_object_notify(G_OBJECT(settings), "enable-plugins");
1576 }
1577
1578 /**
1579  * webkit_settings_get_enable_java:
1580  * @settings: a #WebKitSettings
1581  *
1582  * Get the #WebKitSettings:enable-java property.
1583  *
1584  * Returns: %TRUE If Java is enabled or %FALSE otherwise.
1585  */
1586 gboolean webkit_settings_get_enable_java(WebKitSettings* settings)
1587 {
1588     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1589
1590     return settings->priv->preferences->javaEnabled();
1591 }
1592
1593 /**
1594  * webkit_settings_set_enable_java:
1595  * @settings: a #WebKitSettings
1596  * @enabled: Value to be set
1597  *
1598  * Set the #WebKitSettings:enable-java property.
1599  */
1600 void webkit_settings_set_enable_java(WebKitSettings* settings, gboolean enabled)
1601 {
1602     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1603
1604     WebKitSettingsPrivate* priv = settings->priv;
1605     bool currentValue = priv->preferences->javaEnabled();
1606     if (currentValue == enabled)
1607         return;
1608
1609     priv->preferences->setJavaEnabled(enabled);
1610     g_object_notify(G_OBJECT(settings), "enable-java");
1611 }
1612
1613 /**
1614  * webkit_settings_get_javascript_can_open_windows_automatically:
1615  * @settings: a #WebKitSettings
1616  *
1617  * Get the #WebKitSettings:javascript-can-open-windows-automatically property.
1618  *
1619  * Returns: %TRUE If JavaScript can open window automatically or %FALSE otherwise.
1620  */
1621 gboolean webkit_settings_get_javascript_can_open_windows_automatically(WebKitSettings* settings)
1622 {
1623     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1624
1625     return settings->priv->preferences->javaScriptCanOpenWindowsAutomatically();
1626 }
1627
1628 /**
1629  * webkit_settings_set_javascript_can_open_windows_automatically:
1630  * @settings: a #WebKitSettings
1631  * @enabled: Value to be set
1632  *
1633  * Set the #WebKitSettings:javascript-can-open-windows-automatically property.
1634  */
1635 void webkit_settings_set_javascript_can_open_windows_automatically(WebKitSettings* settings, gboolean enabled)
1636 {
1637     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1638
1639     WebKitSettingsPrivate* priv = settings->priv;
1640     bool currentValue = priv->preferences->javaScriptCanOpenWindowsAutomatically();
1641     if (currentValue == enabled)
1642         return;
1643
1644     priv->preferences->setJavaScriptCanOpenWindowsAutomatically(enabled);
1645     g_object_notify(G_OBJECT(settings), "javascript-can-open-windows-automatically");
1646 }
1647
1648 /**
1649  * webkit_settings_get_enable_hyperlink_auditing:
1650  * @settings: a #WebKitSettings
1651  *
1652  * Get the #WebKitSettings:enable-hyperlink-auditing property.
1653  *
1654  * Returns: %TRUE If hyper link auditing is enabled or %FALSE otherwise.
1655  */
1656 gboolean webkit_settings_get_enable_hyperlink_auditing(WebKitSettings* settings)
1657 {
1658     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1659
1660     return settings->priv->preferences->hyperlinkAuditingEnabled();
1661 }
1662
1663 /**
1664  * webkit_settings_set_enable_hyperlink_auditing:
1665  * @settings: a #WebKitSettings
1666  * @enabled: Value to be set
1667  *
1668  * Set the #WebKitSettings:enable-hyperlink-auditing property.
1669  */
1670 void webkit_settings_set_enable_hyperlink_auditing(WebKitSettings* settings, gboolean enabled)
1671 {
1672     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1673
1674     WebKitSettingsPrivate* priv = settings->priv;
1675     bool currentValue = priv->preferences->hyperlinkAuditingEnabled();
1676     if (currentValue == enabled)
1677         return;
1678
1679     priv->preferences->setHyperlinkAuditingEnabled(enabled);
1680     g_object_notify(G_OBJECT(settings), "enable-hyperlink-auditing");
1681 }
1682
1683 /**
1684  * webkit_web_settings_get_default_font_family:
1685  * @settings: a #WebKitSettings
1686  *
1687  * Gets the #WebKitSettings:default-font-family property.
1688  *
1689  * Returns: The default font family used to display content that does not specify a font.
1690  */
1691 const gchar* webkit_settings_get_default_font_family(WebKitSettings* settings)
1692 {
1693     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1694
1695     return settings->priv->defaultFontFamily.data();
1696 }
1697
1698 /**
1699  * webkit_settings_set_default_font_family:
1700  * @settings: a #WebKitSettings
1701  * @default_font_family: the new default font family
1702  *
1703  * Set the #WebKitSettings:default-font-family property.
1704  */
1705 void webkit_settings_set_default_font_family(WebKitSettings* settings, const gchar* defaultFontFamily)
1706 {
1707     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1708     g_return_if_fail(defaultFontFamily);
1709
1710     WebKitSettingsPrivate* priv = settings->priv;
1711     if (!g_strcmp0(priv->defaultFontFamily.data(), defaultFontFamily))
1712         return;
1713
1714     String standardFontFamily = String::fromUTF8(defaultFontFamily);
1715     priv->preferences->setStandardFontFamily(standardFontFamily);
1716     priv->defaultFontFamily = standardFontFamily.utf8();
1717     g_object_notify(G_OBJECT(settings), "default-font-family");
1718 }
1719
1720 /**
1721  * webkit_settings_get_monospace_font_family:
1722  * @settings: a #WebKitSettings
1723  *
1724  * Gets the #WebKitSettings:monospace-font-family property.
1725  *
1726  * Returns: Default font family used to display content marked with monospace font.
1727  */
1728 const gchar* webkit_settings_get_monospace_font_family(WebKitSettings* settings)
1729 {
1730     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1731
1732     return settings->priv->monospaceFontFamily.data();
1733 }
1734
1735 /**
1736  * webkit_settings_set_monospace_font_family:
1737  * @settings: a #WebKitSettings
1738  * @monospace_font_family: the new default monospace font family
1739  *
1740  * Set the #WebKitSettings:monospace-font-family property.
1741  */
1742 void webkit_settings_set_monospace_font_family(WebKitSettings* settings, const gchar* monospaceFontFamily)
1743 {
1744     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1745     g_return_if_fail(monospaceFontFamily);
1746
1747     WebKitSettingsPrivate* priv = settings->priv;
1748     if (!g_strcmp0(priv->monospaceFontFamily.data(), monospaceFontFamily))
1749         return;
1750
1751     String fixedFontFamily = String::fromUTF8(monospaceFontFamily);
1752     priv->preferences->setFixedFontFamily(fixedFontFamily);
1753     priv->monospaceFontFamily = fixedFontFamily.utf8();
1754     g_object_notify(G_OBJECT(settings), "monospace-font-family");
1755 }
1756
1757 /**
1758  * webkit_settings_get_serif_font_family:
1759  * @settings: a #WebKitSettings
1760  *
1761  * Gets the #WebKitSettings:serif-font-family property.
1762  *
1763  * Returns: The default font family used to display content marked with serif font.
1764  */
1765 const gchar* webkit_settings_get_serif_font_family(WebKitSettings* settings)
1766 {
1767     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1768
1769     return settings->priv->serifFontFamily.data();
1770 }
1771
1772 /**
1773  * webkit_settings_set_serif_font_family:
1774  * @settings: a #WebKitSettings
1775  * @serif_font_family: the new default serif font family
1776  *
1777  * Set the #WebKitSettings:serif-font-family property.
1778  */
1779 void webkit_settings_set_serif_font_family(WebKitSettings* settings, const gchar* serifFontFamily)
1780 {
1781     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1782     g_return_if_fail(serifFontFamily);
1783
1784     WebKitSettingsPrivate* priv = settings->priv;
1785     if (!g_strcmp0(priv->serifFontFamily.data(), serifFontFamily))
1786         return;
1787
1788     String serifFontFamilyString = String::fromUTF8(serifFontFamily);
1789     priv->preferences->setSerifFontFamily(serifFontFamilyString);
1790     priv->serifFontFamily = serifFontFamilyString.utf8();
1791     g_object_notify(G_OBJECT(settings), "serif-font-family");
1792 }
1793
1794 /**
1795  * webkit_settings_get_sans_serif_font_family:
1796  * @settings: a #WebKitSettings
1797  *
1798  * Gets the #WebKitSettings:sans-serif-font-family property.
1799  *
1800  * Returns: The default font family used to display content marked with sans-serif font.
1801  */
1802 const gchar* webkit_settings_get_sans_serif_font_family(WebKitSettings* settings)
1803 {
1804     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1805
1806     return settings->priv->sansSerifFontFamily.data();
1807 }
1808
1809 /**
1810  * webkit_settings_set_sans_serif_font_family:
1811  * @settings: a #WebKitSettings
1812  * @sans_serif_font_family: the new default sans-serif font family
1813  *
1814  * Set the #WebKitSettings:sans-serif-font-family property.
1815  */
1816 void webkit_settings_set_sans_serif_font_family(WebKitSettings* settings, const gchar* sansSerifFontFamily)
1817 {
1818     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1819     g_return_if_fail(sansSerifFontFamily);
1820
1821     WebKitSettingsPrivate* priv = settings->priv;
1822     if (!g_strcmp0(priv->sansSerifFontFamily.data(), sansSerifFontFamily))
1823         return;
1824
1825     String sansSerifFontFamilyString = String::fromUTF8(sansSerifFontFamily);
1826     priv->preferences->setSansSerifFontFamily(sansSerifFontFamilyString);
1827     priv->sansSerifFontFamily = sansSerifFontFamilyString.utf8();
1828     g_object_notify(G_OBJECT(settings), "sans-serif-font-family");
1829 }
1830
1831 /**
1832  * webkit_settings_get_cursive_font_family:
1833  * @settings: a #WebKitSettings
1834  *
1835  * Gets the #WebKitSettings:cursive-font-family property.
1836  *
1837  * Returns: The default font family used to display content marked with cursive font.
1838  */
1839 const gchar* webkit_settings_get_cursive_font_family(WebKitSettings* settings)
1840 {
1841     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1842
1843     return settings->priv->cursiveFontFamily.data();
1844 }
1845
1846 /**
1847  * webkit_settings_set_cursive_font_family:
1848  * @settings: a #WebKitSettings
1849  * @cursive_font_family: the new default cursive font family
1850  *
1851  * Set the #WebKitSettings:cursive-font-family property.
1852  */
1853 void webkit_settings_set_cursive_font_family(WebKitSettings* settings, const gchar* cursiveFontFamily)
1854 {
1855     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1856     g_return_if_fail(cursiveFontFamily);
1857
1858     WebKitSettingsPrivate* priv = settings->priv;
1859     if (!g_strcmp0(priv->cursiveFontFamily.data(), cursiveFontFamily))
1860         return;
1861
1862     String cursiveFontFamilyString = String::fromUTF8(cursiveFontFamily);
1863     priv->preferences->setCursiveFontFamily(cursiveFontFamilyString);
1864     priv->cursiveFontFamily = cursiveFontFamilyString.utf8();
1865     g_object_notify(G_OBJECT(settings), "cursive-font-family");
1866 }
1867
1868 /**
1869  * webkit_settings_get_fantasy_font_family:
1870  * @settings: a #WebKitSettings
1871  *
1872  * Gets the #WebKitSettings:fantasy-font-family property.
1873  *
1874  * Returns: The default font family used to display content marked with fantasy font.
1875  */
1876 const gchar* webkit_settings_get_fantasy_font_family(WebKitSettings* settings)
1877 {
1878     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1879
1880     return settings->priv->fantasyFontFamily.data();
1881 }
1882
1883 /**
1884  * webkit_settings_set_fantasy_font_family:
1885  * @settings: a #WebKitSettings
1886  * @fantasy_font_family: the new default fantasy font family
1887  *
1888  * Set the #WebKitSettings:fantasy-font-family property.
1889  */
1890 void webkit_settings_set_fantasy_font_family(WebKitSettings* settings, const gchar* fantasyFontFamily)
1891 {
1892     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1893     g_return_if_fail(fantasyFontFamily);
1894
1895     WebKitSettingsPrivate* priv = settings->priv;
1896     if (!g_strcmp0(priv->fantasyFontFamily.data(), fantasyFontFamily))
1897         return;
1898
1899     String fantasyFontFamilyString = String::fromUTF8(fantasyFontFamily);
1900     priv->preferences->setFantasyFontFamily(fantasyFontFamilyString);
1901     priv->fantasyFontFamily = fantasyFontFamilyString.utf8();
1902     g_object_notify(G_OBJECT(settings), "fantasy-font-family");
1903 }
1904
1905 /**
1906  * webkit_settings_get_pictograph_font_family:
1907  * @settings: a #WebKitSettings
1908  *
1909  * Gets the #WebKitSettings:pictograph-font-family property.
1910  *
1911  * Returns: The default font family used to display content marked with pictograph font.
1912  */
1913 const gchar* webkit_settings_get_pictograph_font_family(WebKitSettings* settings)
1914 {
1915     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1916
1917     return settings->priv->pictographFontFamily.data();
1918 }
1919
1920 /**
1921  * webkit_settings_set_pictograph_font_family:
1922  * @settings: a #WebKitSettings
1923  * @pictograph_font_family: the new default pictograph font family
1924  *
1925  * Set the #WebKitSettings:pictograph-font-family property.
1926  */
1927 void webkit_settings_set_pictograph_font_family(WebKitSettings* settings, const gchar* pictographFontFamily)
1928 {
1929     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1930     g_return_if_fail(pictographFontFamily);
1931
1932     WebKitSettingsPrivate* priv = settings->priv;
1933     if (!g_strcmp0(priv->pictographFontFamily.data(), pictographFontFamily))
1934         return;
1935
1936     String pictographFontFamilyString = String::fromUTF8(pictographFontFamily);
1937     priv->preferences->setPictographFontFamily(pictographFontFamilyString);
1938     priv->pictographFontFamily = pictographFontFamilyString.utf8();
1939     g_object_notify(G_OBJECT(settings), "pictograph-font-family");
1940 }
1941
1942 /**
1943  * webkit_settings_get_default_font_size:
1944  * @settings: a #WebKitSettings
1945  *
1946  * Gets the #WebKitSettings:default-font-size property.
1947  *
1948  * Returns: The default font size.
1949  */
1950 guint32 webkit_settings_get_default_font_size(WebKitSettings* settings)
1951 {
1952     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1953
1954     return settings->priv->preferences->defaultFontSize();
1955 }
1956
1957 /**
1958  * webkit_settings_set_default_font_size:
1959  * @settings: a #WebKitSettings
1960  * @font_size: default font size to be set in pixels
1961  *
1962  * Set the #WebKitSettings:default-font-size property.
1963  */
1964 void webkit_settings_set_default_font_size(WebKitSettings* settings, guint32 fontSize)
1965 {
1966     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1967
1968     WebKitSettingsPrivate* priv = settings->priv;
1969     uint32_t currentSize = priv->preferences->defaultFontSize();
1970     if (currentSize == fontSize)
1971         return;
1972
1973     priv->preferences->setDefaultFontSize(fontSize);
1974     g_object_notify(G_OBJECT(settings), "default-font-size");
1975 }
1976
1977 /**
1978  * webkit_settings_get_default_monospace_font_size:
1979  * @settings: a #WebKitSettings
1980  *
1981  * Gets the #WebKitSettings:default-monospace-font-size property.
1982  *
1983  * Returns: Default monospace font size.
1984  */
1985 guint32 webkit_settings_get_default_monospace_font_size(WebKitSettings* settings)
1986 {
1987     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1988
1989     return settings->priv->preferences->defaultFixedFontSize();
1990 }
1991
1992 /**
1993  * webkit_settings_set_default_monospace_font_size:
1994  * @settings: a #WebKitSettings
1995  * @font_size: default monospace font size to be set in pixels
1996  *
1997  * Set the #WebKitSettings:default-monospace-font-size property.
1998  */
1999 void webkit_settings_set_default_monospace_font_size(WebKitSettings* settings, guint32 fontSize)
2000 {
2001     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2002
2003     WebKitSettingsPrivate* priv = settings->priv;
2004     uint32_t currentSize = priv->preferences->defaultFixedFontSize();
2005     if (currentSize == fontSize)
2006         return;
2007
2008     priv->preferences->setDefaultFixedFontSize(fontSize);
2009     g_object_notify(G_OBJECT(settings), "default-monospace-font-size");
2010 }
2011
2012 /**
2013  * webkit_settings_get_minimum_font_size:
2014  * @settings: a #WebKitSettings
2015  *
2016  * Gets the #WebKitSettings:minimum-font-size property.
2017  *
2018  * Returns: Minimum font size.
2019  */
2020 guint32 webkit_settings_get_minimum_font_size(WebKitSettings* settings)
2021 {
2022     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2023
2024     return settings->priv->preferences->minimumFontSize();
2025 }
2026
2027 /**
2028  * webkit_settings_set_minimum_font_size:
2029  * @settings: a #WebKitSettings
2030  * @font_size: minimum font size to be set in points
2031  *
2032  * Set the #WebKitSettings:minimum-font-size property.
2033  */
2034 void webkit_settings_set_minimum_font_size(WebKitSettings* settings, guint32 fontSize)
2035 {
2036     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2037
2038     WebKitSettingsPrivate* priv = settings->priv;
2039     uint32_t currentSize = priv->preferences->minimumFontSize();
2040     if (currentSize == fontSize)
2041         return;
2042
2043     priv->preferences->setMinimumFontSize(fontSize);
2044     g_object_notify(G_OBJECT(settings), "minimum-font-size");
2045 }
2046
2047 /**
2048  * webkit_settings_get_default_charset:
2049  * @settings: a #WebKitSettings
2050  *
2051  * Gets the #WebKitSettings:default-charset property.
2052  *
2053  * Returns: Default charset.
2054  */
2055 const gchar* webkit_settings_get_default_charset(WebKitSettings* settings)
2056 {
2057     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2058
2059     return settings->priv->defaultCharset.data();
2060 }
2061
2062 /**
2063  * webkit_settings_set_default_charset:
2064  * @settings: a #WebKitSettings
2065  * @default_charset: default charset to be set
2066  *
2067  * Set the #WebKitSettings:default-charset property.
2068  */
2069 void webkit_settings_set_default_charset(WebKitSettings* settings, const gchar* defaultCharset)
2070 {
2071     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2072     g_return_if_fail(defaultCharset);
2073
2074     WebKitSettingsPrivate* priv = settings->priv;
2075     if (!g_strcmp0(priv->defaultCharset.data(), defaultCharset))
2076         return;
2077
2078     String defaultCharsetString = String::fromUTF8(defaultCharset);
2079     priv->preferences->setDefaultTextEncodingName(defaultCharsetString);
2080     priv->defaultCharset = defaultCharsetString.utf8();
2081     g_object_notify(G_OBJECT(settings), "default-charset");
2082 }
2083
2084 /**
2085  * webkit_settings_get_enable_private_browsing:
2086  * @settings: a #WebKitSettings
2087  *
2088  * Get the #WebKitSettings:enable-private-browsing property.
2089  *
2090  * Returns: %TRUE If private browsing is enabled or %FALSE otherwise.
2091  */
2092 gboolean webkit_settings_get_enable_private_browsing(WebKitSettings* settings)
2093 {
2094     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2095
2096     return settings->priv->preferences->privateBrowsingEnabled();
2097 }
2098
2099 /**
2100  * webkit_settings_set_private_caret_browsing:
2101  * @settings: a #WebKitSettings
2102  * @enabled: Value to be set
2103  *
2104  * Set the #WebKitSettings:enable-private-browsing property.
2105  */
2106 void webkit_settings_set_enable_private_browsing(WebKitSettings* settings, gboolean enabled)
2107 {
2108     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2109
2110     WebKitSettingsPrivate* priv = settings->priv;
2111     bool currentValue = priv->preferences->privateBrowsingEnabled();
2112     if (currentValue == enabled)
2113         return;
2114
2115     priv->preferences->setPrivateBrowsingEnabled(enabled);
2116     g_object_notify(G_OBJECT(settings), "enable-private-browsing");
2117 }
2118
2119 /**
2120  * webkit_settings_get_enable_developer_extras:
2121  * @settings: a #WebKitSettings
2122  *
2123  * Get the #WebKitSettings:enable-developer-extras property.
2124  *
2125  * Returns: %TRUE If developer extras is enabled or %FALSE otherwise.
2126  */
2127 gboolean webkit_settings_get_enable_developer_extras(WebKitSettings* settings)
2128 {
2129     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2130
2131     return settings->priv->preferences->developerExtrasEnabled();
2132 }
2133
2134 /**
2135  * webkit_settings_set_enable_developer_extras:
2136  * @settings: a #WebKitSettings
2137  * @enabled: Value to be set
2138  *
2139  * Set the #WebKitSettings:enable-developer-extras property.
2140  */
2141 void webkit_settings_set_enable_developer_extras(WebKitSettings* settings, gboolean enabled)
2142 {
2143     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2144
2145     WebKitSettingsPrivate* priv = settings->priv;
2146     bool currentValue = priv->preferences->developerExtrasEnabled();
2147     if (currentValue == enabled)
2148         return;
2149
2150     priv->preferences->setDeveloperExtrasEnabled(enabled);
2151     g_object_notify(G_OBJECT(settings), "enable-developer-extras");
2152 }
2153
2154 /**
2155  * webkit_settings_get_enable_resizable_text_areas:
2156  * @settings: a #WebKitSettings
2157  *
2158  * Get the #WebKitSettings:enable-resizable-text-areas property.
2159  *
2160  * Returns: %TRUE If text areas can be resized or %FALSE otherwise.
2161  */
2162 gboolean webkit_settings_get_enable_resizable_text_areas(WebKitSettings* settings)
2163 {
2164     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2165
2166     return settings->priv->preferences->textAreasAreResizable();
2167 }
2168
2169 /**
2170  * webkit_settings_set_enable_resizable_text_areas:
2171  * @settings: a #WebKitSettings
2172  * @enabled: Value to be set
2173  *
2174  * Set the #WebKitSettings:enable-resizable-text-areas property.
2175  */
2176 void webkit_settings_set_enable_resizable_text_areas(WebKitSettings* settings, gboolean enabled)
2177 {
2178     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2179
2180     WebKitSettingsPrivate* priv = settings->priv;
2181     bool currentValue = priv->preferences->textAreasAreResizable();
2182     if (currentValue == enabled)
2183         return;
2184
2185     priv->preferences->setTextAreasAreResizable(enabled);
2186     g_object_notify(G_OBJECT(settings), "enable-resizable-text-areas");
2187 }
2188
2189 /**
2190  * webkit_settings_get_enable_tabs_to_links:
2191  * @settings: a #WebKitSettings
2192  *
2193  * Get the #WebKitSettings:enable-tabs-to-links property.
2194  *
2195  * Returns: %TRUE If tabs to link is enabled or %FALSE otherwise.
2196  */
2197 gboolean webkit_settings_get_enable_tabs_to_links(WebKitSettings* settings)
2198 {
2199     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2200
2201     return settings->priv->preferences->tabsToLinks();
2202 }
2203
2204 /**
2205  * webkit_settings_set_enable_tabs_to_links:
2206  * @settings: a #WebKitSettings
2207  * @enabled: Value to be set
2208  *
2209  * Set the #WebKitSettings:enable-tabs-to-links property.
2210  */
2211 void webkit_settings_set_enable_tabs_to_links(WebKitSettings* settings, gboolean enabled)
2212 {
2213     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2214
2215     WebKitSettingsPrivate* priv = settings->priv;
2216     bool currentValue = priv->preferences->tabsToLinks();
2217     if (currentValue == enabled)
2218         return;
2219
2220     priv->preferences->setTabsToLinks(enabled);
2221     g_object_notify(G_OBJECT(settings), "enable-tabs-to-links");
2222 }
2223
2224 /**
2225  * webkit_settings_get_enable_dns_prefetching:
2226  * @settings: a #WebKitSettings
2227  *
2228  * Get the #WebKitSettings:enable-dns-prefetching property.
2229  *
2230  * Returns: %TRUE If DNS prefetching is enabled or %FALSE otherwise.
2231  */
2232 gboolean webkit_settings_get_enable_dns_prefetching(WebKitSettings* settings)
2233 {
2234     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2235
2236     return settings->priv->preferences->dnsPrefetchingEnabled();
2237 }
2238
2239 /**
2240  * webkit_settings_set_enable_dns_prefetching:
2241  * @settings: a #WebKitSettings
2242  * @enabled: Value to be set
2243  *
2244  * Set the #WebKitSettings:enable-dns-prefetching property.
2245  */
2246 void webkit_settings_set_enable_dns_prefetching(WebKitSettings* settings, gboolean enabled)
2247 {
2248     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2249
2250     WebKitSettingsPrivate* priv = settings->priv;
2251     bool currentValue = priv->preferences->dnsPrefetchingEnabled();
2252     if (currentValue == enabled)
2253         return;
2254
2255     priv->preferences->setDNSPrefetchingEnabled(enabled);
2256     g_object_notify(G_OBJECT(settings), "enable-dns-prefetching");
2257 }
2258
2259 /**
2260  * webkit_settings_get_enable_caret_browsing:
2261  * @settings: a #WebKitSettings
2262  *
2263  * Get the #WebKitSettings:enable-caret-browsing property.
2264  *
2265  * Returns: %TRUE If caret browsing is enabled or %FALSE otherwise.
2266  */
2267 gboolean webkit_settings_get_enable_caret_browsing(WebKitSettings* settings)
2268 {
2269     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2270
2271     return settings->priv->preferences->caretBrowsingEnabled();
2272 }
2273
2274 /**
2275  * webkit_settings_set_enable_caret_browsing:
2276  * @settings: a #WebKitSettings
2277  * @enabled: Value to be set
2278  *
2279  * Set the #WebKitSettings:enable-caret-browsing property.
2280  */
2281 void webkit_settings_set_enable_caret_browsing(WebKitSettings* settings, gboolean enabled)
2282 {
2283     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2284
2285     WebKitSettingsPrivate* priv = settings->priv;
2286     bool currentValue = priv->preferences->caretBrowsingEnabled();
2287     if (currentValue == enabled)
2288         return;
2289
2290     priv->preferences->setCaretBrowsingEnabled(enabled);
2291     g_object_notify(G_OBJECT(settings), "enable-caret-browsing");
2292 }
2293
2294 /**
2295  * webkit_settings_get_enable_fullscreen:
2296  * @settings: a #WebKitSettings
2297  *
2298  * Get the #WebKitSettings:enable-fullscreen property.
2299  *
2300  * Returns: %TRUE If fullscreen support is enabled or %FALSE otherwise.
2301  */
2302 gboolean webkit_settings_get_enable_fullscreen(WebKitSettings* settings)
2303 {
2304     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2305
2306     return settings->priv->preferences->fullScreenEnabled();
2307 }
2308
2309 /**
2310  * webkit_settings_set_enable_fullscreen:
2311  * @settings: a #WebKitSettings
2312  * @enabled: Value to be set
2313  *
2314  * Set the #WebKitSettings:enable-fullscreen property.
2315  */
2316 void webkit_settings_set_enable_fullscreen(WebKitSettings* settings, gboolean enabled)
2317 {
2318     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2319
2320     WebKitSettingsPrivate* priv = settings->priv;
2321     bool currentValue = priv->preferences->fullScreenEnabled();
2322     if (currentValue == enabled)
2323         return;
2324
2325     priv->preferences->setFullScreenEnabled(enabled);
2326     g_object_notify(G_OBJECT(settings), "enable-fullscreen");
2327 }
2328
2329 /**
2330  * webkit_settings_get_print_backgrounds:
2331  * @settings: a #WebKitSettings
2332  *
2333  * Get the #WebKitSettings:print-backgrounds property.
2334  *
2335  * Returns: %TRUE If background images should be printed or %FALSE otherwise.
2336  */
2337 gboolean webkit_settings_get_print_backgrounds(WebKitSettings* settings)
2338 {
2339     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2340
2341     return settings->priv->preferences->shouldPrintBackgrounds();
2342 }
2343
2344 /**
2345  * webkit_settings_set_print_backgrounds:
2346  * @settings: a #WebKitSettings
2347  * @print_backgrounds: Value to be set
2348  *
2349  * Set the #WebKitSettings:print-backgrounds property.
2350  */
2351 void webkit_settings_set_print_backgrounds(WebKitSettings* settings, gboolean printBackgrounds)
2352 {
2353     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2354
2355     WebKitSettingsPrivate* priv = settings->priv;
2356     bool currentValue = priv->preferences->shouldPrintBackgrounds();
2357     if (currentValue == printBackgrounds)
2358         return;
2359
2360     priv->preferences->setShouldPrintBackgrounds(printBackgrounds);
2361     g_object_notify(G_OBJECT(settings), "print-backgrounds");
2362 }
2363
2364 /**
2365  * webkit_settings_get_enable_webaudio:
2366  * @settings: a #WebKitSettings
2367  *
2368  * Get the #WebKitSettings:enable-webaudio property.
2369  *
2370  * Returns: %TRUE If webaudio support is enabled or %FALSE otherwise.
2371  */
2372 gboolean webkit_settings_get_enable_webaudio(WebKitSettings* settings)
2373 {
2374     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2375
2376     return settings->priv->preferences->webAudioEnabled();
2377 }
2378
2379 /**
2380  * webkit_settings_set_enable_webaudio:
2381  * @settings: a #WebKitSettings
2382  * @enabled: Value to be set
2383  *
2384  * Set the #WebKitSettings:enable-webaudio property.
2385  */
2386 void webkit_settings_set_enable_webaudio(WebKitSettings* settings, gboolean enabled)
2387 {
2388     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2389
2390     WebKitSettingsPrivate* priv = settings->priv;
2391     bool currentValue = priv->preferences->webAudioEnabled();
2392     if (currentValue == enabled)
2393         return;
2394
2395     priv->preferences->setWebAudioEnabled(enabled);
2396     g_object_notify(G_OBJECT(settings), "enable-webaudio");
2397 }
2398
2399 /**
2400  * webkit_settings_get_enable_webgl:
2401  * @settings: a #WebKitSettings
2402  *
2403  * Get the #WebKitSettings:enable-webgl property.
2404  *
2405  * Returns: %TRUE If webgl support is enabled or %FALSE otherwise.
2406  */
2407 gboolean webkit_settings_get_enable_webgl(WebKitSettings* settings)
2408 {
2409     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2410
2411     return settings->priv->preferences->webGLEnabled();
2412 }
2413
2414 /**
2415  * webkit_settings_set_enable_webgl:
2416  * @settings: a #WebKitSettings
2417  * @enabled: Value to be set
2418  *
2419  * Set the #WebKitSettings:enable-webgl property.
2420  */
2421 void webkit_settings_set_enable_webgl(WebKitSettings* settings, gboolean enabled)
2422 {
2423     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2424
2425     WebKitSettingsPrivate* priv = settings->priv;
2426     bool currentValue = priv->preferences->webGLEnabled();
2427     if (currentValue == enabled)
2428         return;
2429
2430     priv->preferences->setWebGLEnabled(enabled);
2431     g_object_notify(G_OBJECT(settings), "enable-webgl");
2432 }
2433
2434 /**
2435  * webkit_settings_get_allow_modal_dialogs:
2436  * @settings: a #WebKitSettings
2437  *
2438  * Get the #WebKitSettings:allow-modal-dialogs property.
2439  *
2440  * Returns: %TRUE if it's allowed to create and run modal dialogs or %FALSE otherwise.
2441  */
2442 gboolean webkit_settings_get_allow_modal_dialogs(WebKitSettings* settings)
2443 {
2444     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2445     return settings->priv->allowModalDialogs;
2446 }
2447
2448 /**
2449  * webkit_settings_set_allow_modal_dialogs:
2450  * @settings: a #WebKitSettings
2451  * @allowed: Value to be set
2452  *
2453  * Set the #WebKitSettings:allow-modal-dialogs property.
2454  */
2455 void webkit_settings_set_allow_modal_dialogs(WebKitSettings* settings, gboolean allowed)
2456 {
2457     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2458
2459     WebKitSettingsPrivate* priv = settings->priv;
2460     if (priv->allowModalDialogs == allowed)
2461         return;
2462
2463     priv->allowModalDialogs = allowed;
2464     g_object_notify(G_OBJECT(settings), "allow-modal-dialogs");
2465 }
2466
2467 /**
2468  * webkit_settings_get_zoom_text_only:
2469  * @settings: a #WebKitSettings
2470  *
2471  * Get the #WebKitSettings:zoom-text-only property.
2472  *
2473  * Returns: %TRUE If zoom level of the view should only affect the text
2474  *    or %FALSE if all view contents should be scaled.
2475  */
2476 gboolean webkit_settings_get_zoom_text_only(WebKitSettings* settings)
2477 {
2478     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2479
2480     return settings->priv->zoomTextOnly;
2481 }
2482
2483 /**
2484  * webkit_settings_set_zoom_text_only:
2485  * @settings: a #WebKitSettings
2486  * @zoom_text_only: Value to be set
2487  *
2488  * Set the #WebKitSettings:zoom-text-only property.
2489  */
2490 void webkit_settings_set_zoom_text_only(WebKitSettings* settings, gboolean zoomTextOnly)
2491 {
2492     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2493
2494     WebKitSettingsPrivate* priv = settings->priv;
2495     if (priv->zoomTextOnly == zoomTextOnly)
2496         return;
2497
2498     priv->zoomTextOnly = zoomTextOnly;
2499     g_object_notify(G_OBJECT(settings), "zoom-text-only");
2500 }
2501
2502 /**
2503  * webkit_settings_get_javascript_can_access_clipboard:
2504  * @settings: a #WebKitSettings
2505  *
2506  * Get the #WebKitSettings:javascript-can-access-clipboard property.
2507  *
2508  * Returns: %TRUE If javascript-can-access-clipboard is enabled or %FALSE otherwise.
2509  */
2510 gboolean webkit_settings_get_javascript_can_access_clipboard(WebKitSettings* settings)
2511 {
2512     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2513
2514     return settings->priv->preferences->javaScriptCanAccessClipboard()
2515         && settings->priv->preferences->domPasteAllowed();
2516 }
2517
2518 /**
2519  * webkit_settings_set_javascript_can_access_clipboard:
2520  * @settings: a #WebKitSettings
2521  * @enabled: Value to be set
2522  *
2523  * Set the #WebKitSettings:javascript-can-access-clipboard property.
2524  */
2525 void webkit_settings_set_javascript_can_access_clipboard(WebKitSettings* settings, gboolean enabled)
2526 {
2527     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2528
2529     WebKitSettingsPrivate* priv = settings->priv;
2530     bool currentValue = priv->preferences->javaScriptCanAccessClipboard() && priv->preferences->domPasteAllowed();
2531     if (currentValue == enabled)
2532         return;
2533
2534     priv->preferences->setJavaScriptCanAccessClipboard(enabled);
2535     priv->preferences->setDOMPasteAllowed(enabled);
2536     g_object_notify(G_OBJECT(settings), "javascript-can-access-clipboard");
2537 }
2538
2539 /**
2540  * webkit_settings_get_media_playback_requires_user_gesture:
2541  * @settings: a #WebKitSettings
2542  *
2543  * Get the #WebKitSettings:media-playback-requires-user-gesture property.
2544  *
2545  * Returns: %TRUE If an user gesture is needed to play or load media
2546  *    or %FALSE if no user gesture is needed.
2547  */
2548 gboolean webkit_settings_get_media_playback_requires_user_gesture(WebKitSettings* settings)
2549 {
2550     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2551
2552     return settings->priv->preferences->mediaPlaybackRequiresUserGesture();
2553 }
2554
2555 /**
2556  * webkit_settings_set_media_playback_requires_user_gesture:
2557  * @settings: a #WebKitSettings
2558  * @enabled: Value to be set
2559  *
2560  * Set the #WebKitSettings:media-playback-requires-user-gesture property.
2561  */
2562 void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* settings, gboolean enabled)
2563 {
2564     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2565
2566     WebKitSettingsPrivate* priv = settings->priv;
2567     bool currentValue = priv->preferences->mediaPlaybackRequiresUserGesture();
2568     if (currentValue == enabled)
2569         return;
2570
2571     priv->preferences->setMediaPlaybackRequiresUserGesture(enabled);
2572     g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
2573 }
2574
2575 /**
2576  * webkit_settings_get_media_playback_allows_inline:
2577  * @settings: a #WebKitSettings
2578  *
2579  * Get the #WebKitSettings:media-playback-allows-inline property.
2580  *
2581  * Returns: %TRUE If inline playback is allowed for media
2582  *    or %FALSE if only fullscreen playback is allowed.
2583  */
2584 gboolean webkit_settings_get_media_playback_allows_inline(WebKitSettings* settings)
2585 {
2586     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), TRUE);
2587
2588     return settings->priv->preferences->mediaPlaybackAllowsInline();
2589 }
2590
2591 /**
2592  * webkit_settings_set_media_playback_allows_inline:
2593  * @settings: a #WebKitSettings
2594  * @enabled: Value to be set
2595  *
2596  * Set the #WebKitSettings:media-playback-allows-inline property.
2597  */
2598 void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings, gboolean enabled)
2599 {
2600     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2601
2602     WebKitSettingsPrivate* priv = settings->priv;
2603     bool currentValue = priv->preferences->mediaPlaybackAllowsInline();
2604     if (currentValue == enabled)
2605         return;
2606
2607     priv->preferences->setMediaPlaybackAllowsInline(enabled);
2608     g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
2609 }
2610
2611 /**
2612  * webkit_settings_get_draw_compositing_indicators:
2613  * @settings: a #WebKitSettings
2614  *
2615  * Get the #WebKitSettings:draw-compositing-indicators property.
2616  *
2617  * Returns: %TRUE If compositing borders are drawn or %FALSE otherwise.
2618  */
2619 gboolean webkit_settings_get_draw_compositing_indicators(WebKitSettings* settings)
2620 {
2621     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2622     return settings->priv->preferences->compositingBordersVisible()
2623         && settings->priv->preferences->compositingRepaintCountersVisible();
2624 }
2625
2626 /**
2627  * webkit_settings_set_draw_compositing_indicators:
2628  * @settings: a #WebKitSettings
2629  * @enabled: Value to be set
2630  *
2631  * Set the #WebKitSettings:draw-compositing-indicators property.
2632  */
2633 void webkit_settings_set_draw_compositing_indicators(WebKitSettings* settings, gboolean enabled)
2634 {
2635     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2636
2637     WebKitSettingsPrivate* priv = settings->priv;
2638     if (priv->preferences->compositingBordersVisible() == enabled
2639         && priv->preferences->compositingRepaintCountersVisible() == enabled)
2640         return;
2641
2642     priv->preferences->setCompositingBordersVisible(enabled);
2643     priv->preferences->setCompositingRepaintCountersVisible(enabled);
2644     g_object_notify(G_OBJECT(settings), "draw-compositing-indicators");
2645 }
2646
2647 /**
2648  * webkit_settings_get_enable_site_specific_quirks:
2649  * @settings: a #WebKitSettings
2650  *
2651  * Get the #WebKitSettings:enable-site-specific-quirks property.
2652  *
2653  * Returns: %TRUE if site specific quirks are enabled or %FALSE otherwise.
2654  */
2655 gboolean webkit_settings_get_enable_site_specific_quirks(WebKitSettings* settings)
2656 {
2657     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2658
2659     return settings->priv->preferences->needsSiteSpecificQuirks();
2660 }
2661
2662 /**
2663  * webkit_settings_set_enable_site_specific_quirks:
2664  * @settings: a #WebKitSettings
2665  * @enabled: Value to be set
2666  *
2667  * Set the #WebKitSettings:enable-site-specific-quirks property.
2668  */
2669 void webkit_settings_set_enable_site_specific_quirks(WebKitSettings* settings, gboolean enabled)
2670 {
2671     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2672
2673     WebKitSettingsPrivate* priv = settings->priv;
2674     bool currentValue = priv->preferences->needsSiteSpecificQuirks();
2675     if (currentValue == enabled)
2676         return;
2677
2678     priv->preferences->setNeedsSiteSpecificQuirks(enabled);
2679     g_object_notify(G_OBJECT(settings), "enable-site-specific-quirks");
2680 }
2681
2682 /**
2683  * webkit_settings_get_enable_page_cache:
2684  * @settings: a #WebKitSettings
2685  *
2686  * Get the #WebKitSettings:enable-page-cache property.
2687  *
2688  * Returns: %TRUE if page cache enabled or %FALSE otherwise.
2689  */
2690 gboolean webkit_settings_get_enable_page_cache(WebKitSettings* settings)
2691 {
2692     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2693
2694     return settings->priv->preferences->usesPageCache();
2695 }
2696
2697 /**
2698  * webkit_settings_set_enable_page_cache:
2699  * @settings: a #WebKitSettings
2700  * @enabled: Value to be set
2701  *
2702  * Set the #WebKitSettings:enable-page-cache property.
2703  */
2704 void webkit_settings_set_enable_page_cache(WebKitSettings* settings, gboolean enabled)
2705 {
2706     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2707
2708     WebKitSettingsPrivate* priv = settings->priv;
2709     bool currentValue = priv->preferences->usesPageCache();
2710     if (currentValue == enabled)
2711         return;
2712
2713     priv->preferences->setUsesPageCache(enabled);
2714     g_object_notify(G_OBJECT(settings), "enable-page-cache");
2715 }
2716
2717 /**
2718  * webkit_settings_get_user_agent:
2719  * @settings: a #WebKitSettings
2720  *
2721  * Get the #WebKitSettings:user-agent property.
2722  *
2723  * Returns: The current value of the user-agent property.
2724  */
2725 const char* webkit_settings_get_user_agent(WebKitSettings* settings)
2726 {
2727     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2728
2729     WebKitSettingsPrivate* priv = settings->priv;
2730     ASSERT(!priv->userAgent.isNull());
2731     return priv->userAgent.data();
2732 }
2733
2734 /**
2735  * webkit_settings_set_user_agent:
2736  * @settings: a #WebKitSettings
2737  * @user_agent: (allow-none): The new custom user agent string or %NULL to use the default user agent
2738  *
2739  * Set the #WebKitSettings:user-agent property.
2740  */
2741 void webkit_settings_set_user_agent(WebKitSettings* settings, const char* userAgent)
2742 {
2743     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2744
2745     WebKitSettingsPrivate* priv = settings->priv;
2746     CString newUserAgent = (!userAgent || !strlen(userAgent)) ? WebCore::standardUserAgent("").utf8() : userAgent;
2747     if (newUserAgent == priv->userAgent)
2748         return;
2749
2750     priv->userAgent = newUserAgent;
2751     g_object_notify(G_OBJECT(settings), "user-agent");
2752 }
2753
2754 /**
2755  * webkit_settings_set_user_agent_with_application_details:
2756  * @settings: a #WebKitSettings
2757  * @application_name: (allow-none): The application name used for the user agent or %NULL to use the default user agent.
2758  * @application_version: (allow-none): The application version for the user agent or %NULL to user the default version.
2759  *
2760  * Set the #WebKitSettings:user-agent property by appending the application details to the default user
2761  * agent. If no application name or version is given, the default user agent used will be used. If only
2762  * the version is given, the default engine version is used with the given application name.
2763  */
2764 void webkit_settings_set_user_agent_with_application_details(WebKitSettings* settings, const char* applicationName, const char* applicationVersion)
2765 {
2766     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2767
2768     CString newUserAgent = WebCore::standardUserAgent(String::fromUTF8(applicationName), String::fromUTF8(applicationVersion)).utf8();
2769     webkit_settings_set_user_agent(settings, newUserAgent.data());
2770 }
2771
2772 /**
2773  * webkit_settings_get_enable_smooth_scrolling:
2774  * @settings: a #WebKitSettings
2775  *
2776  * Get the #WebKitSettings:enable-smooth-scrolling property.
2777  *
2778  * Returns: %TRUE if smooth scrolling is enabled or %FALSE otherwise.
2779  */
2780 gboolean webkit_settings_get_enable_smooth_scrolling(WebKitSettings* settings)
2781 {
2782     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2783
2784     return settings->priv->preferences->scrollAnimatorEnabled();
2785 }
2786
2787 /**
2788  * webkit_settings_set_enable_smooth_scrolling:
2789  * @settings: a #WebKitSettings
2790  * @enabled: Value to be set
2791  *
2792  * Set the #WebKitSettings:enable-smooth-scrolling property.
2793  */
2794 void webkit_settings_set_enable_smooth_scrolling(WebKitSettings* settings, gboolean enabled)
2795 {
2796     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2797
2798     WebKitSettingsPrivate* priv = settings->priv;
2799     bool currentValue = priv->preferences->scrollAnimatorEnabled();
2800     if (currentValue == enabled)
2801         return;
2802
2803     priv->preferences->setScrollAnimatorEnabled(enabled);
2804     g_object_notify(G_OBJECT(settings), "enable-smooth-scrolling");
2805 }
2806
2807 /**
2808  * webkit_settings_get_enable_accelerated_2d_canvas:
2809  * @settings: a #WebKitSettings
2810  *
2811  * Get the #WebKitSettings:enable-accelerated-2d-canvas property.
2812  *
2813  * Returns: %TRUE if accelerated 2D canvas is enabled or %FALSE otherwise.
2814  *
2815  * Since: 2.2
2816  */
2817 gboolean webkit_settings_get_enable_accelerated_2d_canvas(WebKitSettings* settings)
2818 {
2819     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2820
2821     return settings->priv->preferences->accelerated2dCanvasEnabled();
2822 }
2823
2824 /**
2825  * webkit_settings_set_enable_accelerated_2d_canvas:
2826  * @settings: a #WebKitSettings
2827  * @enabled: Value to be set
2828  *
2829  * Set the #WebKitSettings:enable-accelerated-2d-canvas property.
2830  *
2831  * Since: 2.2
2832  */
2833 void webkit_settings_set_enable_accelerated_2d_canvas(WebKitSettings* settings, gboolean enabled)
2834 {
2835     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2836
2837     WebKitSettingsPrivate* priv = settings->priv;
2838     if (priv->preferences->accelerated2dCanvasEnabled() == enabled)
2839         return;
2840
2841     priv->preferences->setAccelerated2dCanvasEnabled(enabled);
2842     g_object_notify(G_OBJECT(settings), "enable-accelerated-2d-canvas");
2843 }
2844
2845 /**
2846  * webkit_settings_get_enable_write_console_messages_to_stdout:
2847  * @settings: a #WebKitSettings
2848  *
2849  * Get the #WebKitSettings:enable-write-console-messages-to-stdout property.
2850  *
2851  * Returns: %TRUE if writing console messages to stdout is enabled or %FALSE
2852  * otherwise.
2853  *
2854  * Since: 2.2
2855  */
2856 gboolean webkit_settings_get_enable_write_console_messages_to_stdout(WebKitSettings* settings)
2857 {
2858     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2859
2860     return settings->priv->preferences->logsPageMessagesToSystemConsoleEnabled();
2861 }
2862
2863 /**
2864  * webkit_settings_set_enable_write_console_messages_to_stdout:
2865  * @settings: a #WebKitSettings
2866  * @enabled: Value to be set
2867  *
2868  * Set the #WebKitSettings:enable-write-console-messages-to-stdout property.
2869  *
2870  * Since: 2.2
2871  */
2872 void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings* settings, gboolean enabled)
2873 {
2874     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2875
2876     WebKitSettingsPrivate* priv = settings->priv;
2877     bool currentValue = priv->preferences->logsPageMessagesToSystemConsoleEnabled();
2878     if (currentValue == enabled)
2879         return;
2880
2881     priv->preferences->setLogsPageMessagesToSystemConsoleEnabled(enabled);
2882     g_object_notify(G_OBJECT(settings), "enable-write-console-messages-to-stdout");
2883 }
2884
2885 /**
2886  * webkit_settings_get_enable_media_stream:
2887  * @settings: a #WebKitSettings
2888  *
2889  * Get the #WebKitSettings:enable-media-stream property.
2890  *
2891  * Returns: %TRUE If mediastream support is enabled or %FALSE otherwise.
2892  *
2893  * Since: 2.4
2894  */
2895 gboolean webkit_settings_get_enable_media_stream(WebKitSettings* settings)
2896 {
2897     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2898
2899     return settings->priv->preferences->mediaStreamEnabled();
2900 }
2901
2902 /**
2903  * webkit_settings_set_enable_media_stream:
2904  * @settings: a #WebKitSettings
2905  * @enabled: Value to be set
2906  *
2907  * Set the #WebKitSettings:enable-media-stream property.
2908  *
2909  * Since: 2.4
2910  */
2911 void webkit_settings_set_enable_media_stream(WebKitSettings* settings, gboolean enabled)
2912 {
2913     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2914
2915     WebKitSettingsPrivate* priv = settings->priv;
2916     bool currentValue = priv->preferences->mediaStreamEnabled();
2917     if (currentValue == enabled)
2918         return;
2919
2920     priv->preferences->setMediaStreamEnabled(enabled);
2921     g_object_notify(G_OBJECT(settings), "enable-media-stream");
2922 }
2923
2924 /**
2925  * webkit_settings_set_enable_spatial_navigation:
2926  * @settings: a #WebKitSettings
2927  * @enabled: Value to be set
2928  *
2929  * Set the #WebKitSettings:enable-spatial-navigation property.
2930  *
2931  * Since: 2.2
2932  */
2933 void webkit_settings_set_enable_spatial_navigation(WebKitSettings* settings, gboolean enabled)
2934 {
2935     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2936
2937     WebKitSettingsPrivate* priv = settings->priv;
2938     bool currentValue = priv->preferences->spatialNavigationEnabled();
2939
2940     if (currentValue == enabled)
2941         return;
2942
2943     priv->preferences->setSpatialNavigationEnabled(enabled);
2944     g_object_notify(G_OBJECT(settings), "enable-spatial-navigation");
2945 }
2946
2947
2948 /**
2949  * webkit_settings_get_enable_spatial_navigation:
2950  * @settings: a #WebKitSettings
2951  *
2952  * Get the #WebKitSettings:enable-spatial-navigation property.
2953  *
2954  * Returns: %TRUE If HTML5 spatial navigation support is enabled or %FALSE otherwise.
2955  *
2956  * Since: 2.2
2957  */
2958 gboolean webkit_settings_get_enable_spatial_navigation(WebKitSettings* settings)
2959 {
2960     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2961
2962     return settings->priv->preferences->spatialNavigationEnabled();
2963 }
2964
2965 /**
2966  * webkit_settings_get_enable_mediasource:
2967  * @settings: a #WebKitSettings
2968  *
2969  * Get the #WebKitSettings:enable-mediasource property.
2970  *
2971  * Returns: %TRUE If MediaSource support is enabled or %FALSE otherwise.
2972  *
2973  * Since: 2.4
2974  */
2975 gboolean webkit_settings_get_enable_mediasource(WebKitSettings* settings)
2976 {
2977     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2978
2979     return settings->priv->preferences->mediaSourceEnabled();
2980 }
2981
2982 /**
2983  * webkit_settings_set_enable_mediasource:
2984  * @settings: a #WebKitSettings
2985  * @enabled: Value to be set
2986  *
2987  * Set the #WebKitSettings:enable-mediasource property.
2988  *
2989  * Since: 2.4
2990  */
2991 void webkit_settings_set_enable_mediasource(WebKitSettings* settings, gboolean enabled)
2992 {
2993     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2994
2995     WebKitSettingsPrivate* priv = settings->priv;
2996     bool currentValue = priv->preferences->mediaSourceEnabled();
2997     if (currentValue == enabled)
2998         return;
2999
3000     priv->preferences->setMediaSourceEnabled(enabled);
3001     g_object_notify(G_OBJECT(settings), "enable-mediasource");
3002 }