229a84a7121e64ab2215138d61f26c393c6d530a
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / C / WKPreferences.cpp
1 /*
2  * Copyright (C) 2010 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #include "config.h"
27 #include "WKPreferences.h"
28 #include "WKPreferencesPrivate.h"
29
30 #include "WKAPICast.h"
31 #include "WebPreferences.h"
32 #include <WebCore/Settings.h>
33 #include <wtf/PassRefPtr.h>
34 #include <wtf/RefPtr.h>
35
36 using namespace WebKit;
37
38 WKTypeID WKPreferencesGetTypeID()
39 {
40     return toAPI(WebPreferences::APIType);
41 }
42
43 WKPreferencesRef WKPreferencesCreate()
44 {
45     RefPtr<WebPreferences> preferences = WebPreferences::create();
46     return toAPI(preferences.release().leakRef());
47 }
48
49 WKPreferencesRef WKPreferencesCreateWithIdentifier(WKStringRef identifierRef)
50 {
51     RefPtr<WebPreferences> preferences = WebPreferences::create(toWTFString(identifierRef));
52     return toAPI(preferences.release().leakRef());
53 }
54
55 WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
56 {
57     RefPtr<WebPreferences> preferences = WebPreferences::create(*toImpl(preferencesRef));
58     return toAPI(preferences.release().leakRef());
59 }
60
61 void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled)
62 {
63     toImpl(preferencesRef)->setJavaScriptEnabled(javaScriptEnabled);
64 }
65
66 bool WKPreferencesGetJavaScriptEnabled(WKPreferencesRef preferencesRef)
67 {
68     return toImpl(preferencesRef)->javaScriptEnabled();
69 }
70
71 void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferencesRef, bool loadsImagesAutomatically)
72 {
73     toImpl(preferencesRef)->setLoadsImagesAutomatically(loadsImagesAutomatically);
74 }
75
76 bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferencesRef)
77 {
78     return toImpl(preferencesRef)->loadsImagesAutomatically();
79 }
80
81 void WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef, bool loadsSiteIconsIgnoringImageLoadingPreference)
82 {
83     toImpl(preferencesRef)->setLoadsSiteIconsIgnoringImageLoadingPreference(loadsSiteIconsIgnoringImageLoadingPreference);
84 }
85
86 bool WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef)
87 {
88     return toImpl(preferencesRef)->loadsSiteIconsIgnoringImageLoadingPreference();
89 }
90
91 void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef, bool offlineWebApplicationCacheEnabled)
92 {
93     toImpl(preferencesRef)->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
94 }
95
96 bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef)
97 {
98     return toImpl(preferencesRef)->offlineWebApplicationCacheEnabled();
99 }
100
101 void WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferencesRef, bool localStorageEnabled)
102 {
103     toImpl(preferencesRef)->setLocalStorageEnabled(localStorageEnabled);
104 }
105
106 bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)
107 {
108     return toImpl(preferencesRef)->localStorageEnabled();
109 }
110
111 void WKPreferencesSetDatabasesEnabled(WKPreferencesRef preferencesRef, bool databasesEnabled)
112 {
113     toImpl(preferencesRef)->setDatabasesEnabled(databasesEnabled);
114 }
115
116 bool WKPreferencesGetDatabasesEnabled(WKPreferencesRef preferencesRef)
117 {
118     return toImpl(preferencesRef)->databasesEnabled();
119 }
120
121 void WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferencesRef, bool xssAuditorEnabled)
122 {
123     toImpl(preferencesRef)->setXSSAuditorEnabled(xssAuditorEnabled);
124 }
125
126 bool WKPreferencesGetXSSAuditorEnabled(WKPreferencesRef preferencesRef)
127 {
128     return toImpl(preferencesRef)->xssAuditorEnabled();
129 }
130
131 void WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef, bool frameFlatteningEnabled)
132 {
133     toImpl(preferencesRef)->setFrameFlatteningEnabled(frameFlatteningEnabled);
134 }
135
136 bool WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)
137 {
138     return toImpl(preferencesRef)->frameFlatteningEnabled();
139 }
140
141 void WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef, bool pluginsEnabled)
142 {
143     toImpl(preferencesRef)->setPluginsEnabled(pluginsEnabled);
144 }
145
146 bool WKPreferencesGetPluginsEnabled(WKPreferencesRef preferencesRef)
147 {
148     return toImpl(preferencesRef)->pluginsEnabled();
149 }
150
151 void WKPreferencesSetJavaEnabled(WKPreferencesRef preferencesRef, bool javaEnabled)
152 {
153     toImpl(preferencesRef)->setJavaEnabled(javaEnabled);
154 }
155
156 bool WKPreferencesGetJavaEnabled(WKPreferencesRef preferencesRef)
157 {
158     return toImpl(preferencesRef)->javaEnabled();
159 }
160
161 void WKPreferencesSetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef, bool javaScriptCanOpenWindowsAutomatically)
162 {
163     toImpl(preferencesRef)->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
164 }
165
166 bool WKPreferencesGetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef)
167 {
168     return toImpl(preferencesRef)->javaScriptCanOpenWindowsAutomatically();
169 }
170
171 void WKPreferencesSetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef, bool hyperlinkAuditingEnabled)
172 {
173     toImpl(preferencesRef)->setHyperlinkAuditingEnabled(hyperlinkAuditingEnabled);
174 }
175
176 bool WKPreferencesGetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef)
177 {
178     return toImpl(preferencesRef)->hyperlinkAuditingEnabled();
179 }
180
181 void WKPreferencesSetStandardFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
182 {
183     toImpl(preferencesRef)->setStandardFontFamily(toWTFString(family));
184 }
185
186 WKStringRef WKPreferencesCopyStandardFontFamily(WKPreferencesRef preferencesRef)
187 {
188     return toCopiedAPI(toImpl(preferencesRef)->standardFontFamily());
189 }
190
191 void WKPreferencesSetFixedFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
192 {
193     toImpl(preferencesRef)->setFixedFontFamily(toWTFString(family));
194 }
195
196 WKStringRef WKPreferencesCopyFixedFontFamily(WKPreferencesRef preferencesRef)
197 {
198     return toCopiedAPI(toImpl(preferencesRef)->fixedFontFamily());
199 }
200
201 void WKPreferencesSetSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
202 {
203     toImpl(preferencesRef)->setSerifFontFamily(toWTFString(family));
204 }
205
206 WKStringRef WKPreferencesCopySerifFontFamily(WKPreferencesRef preferencesRef)
207 {
208     return toCopiedAPI(toImpl(preferencesRef)->serifFontFamily());
209 }
210
211 void WKPreferencesSetSansSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
212 {
213     toImpl(preferencesRef)->setSansSerifFontFamily(toWTFString(family));
214 }
215
216 WKStringRef WKPreferencesCopySansSerifFontFamily(WKPreferencesRef preferencesRef)
217 {
218     return toCopiedAPI(toImpl(preferencesRef)->sansSerifFontFamily());
219 }
220
221 void WKPreferencesSetCursiveFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
222 {
223     toImpl(preferencesRef)->setCursiveFontFamily(toWTFString(family));
224 }
225
226 WKStringRef WKPreferencesCopyCursiveFontFamily(WKPreferencesRef preferencesRef)
227 {
228     return toCopiedAPI(toImpl(preferencesRef)->cursiveFontFamily());
229 }
230
231 void WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
232 {
233     toImpl(preferencesRef)->setFantasyFontFamily(toWTFString(family));
234 }
235
236 WKStringRef WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef)
237 {
238     return toCopiedAPI(toImpl(preferencesRef)->fantasyFontFamily());
239 }
240
241 void WKPreferencesSetPictographFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
242 {
243     toImpl(preferencesRef)->setPictographFontFamily(toWTFString(family));
244 }
245
246 WKStringRef WKPreferencesCopyPictographFontFamily(WKPreferencesRef preferencesRef)
247 {
248     return toCopiedAPI(toImpl(preferencesRef)->pictographFontFamily());
249 }
250
251 void WKPreferencesSetDefaultFontSize(WKPreferencesRef preferencesRef, uint32_t size)
252 {
253     toImpl(preferencesRef)->setDefaultFontSize(size);
254 }
255
256 uint32_t WKPreferencesGetDefaultFontSize(WKPreferencesRef preferencesRef)
257 {
258     return toImpl(preferencesRef)->defaultFontSize();
259 }
260
261 void WKPreferencesSetDefaultFixedFontSize(WKPreferencesRef preferencesRef, uint32_t size)
262 {
263     toImpl(preferencesRef)->setDefaultFixedFontSize(size);
264 }
265
266 uint32_t WKPreferencesGetDefaultFixedFontSize(WKPreferencesRef preferencesRef)
267 {
268     return toImpl(preferencesRef)->defaultFixedFontSize();
269 }
270
271 void WKPreferencesSetMinimumFontSize(WKPreferencesRef preferencesRef, uint32_t size)
272 {
273     toImpl(preferencesRef)->setMinimumFontSize(size);
274 }
275
276 uint32_t WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)
277 {
278     return toImpl(preferencesRef)->minimumFontSize();
279 }
280
281 void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
282 {
283     toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior));
284 }
285
286 WKEditableLinkBehavior WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef)
287 {
288     return toAPI(static_cast<WebCore::EditableLinkBehavior>(toImpl(preferencesRef)->editableLinkBehavior()));
289 }
290
291 void WKPreferencesSetDefaultTextEncodingName(WKPreferencesRef preferencesRef, WKStringRef name)
292 {
293     toImpl(preferencesRef)->setDefaultTextEncodingName(toWTFString(name));
294 }
295
296 WKStringRef WKPreferencesCopyDefaultTextEncodingName(WKPreferencesRef preferencesRef)
297 {
298     return toCopiedAPI(toImpl(preferencesRef)->defaultTextEncodingName());
299 }
300
301 void WKPreferencesSetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
302 {
303     toImpl(preferencesRef)->setPrivateBrowsingEnabled(enabled);
304 }
305
306 bool WKPreferencesGetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef)
307 {
308     return toImpl(preferencesRef)->privateBrowsingEnabled();
309 }
310
311 void WKPreferencesSetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef, bool enabled)
312 {
313     toImpl(preferencesRef)->setDeveloperExtrasEnabled(enabled);
314 }
315
316 bool WKPreferencesGetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef)
317 {
318     return toImpl(preferencesRef)->developerExtrasEnabled();
319 }
320
321 void WKPreferencesSetTextAreasAreResizable(WKPreferencesRef preferencesRef, bool resizable)
322 {
323     toImpl(preferencesRef)->setTextAreasAreResizable(resizable);
324 }
325
326 bool WKPreferencesGetTextAreasAreResizable(WKPreferencesRef preferencesRef)
327 {
328     return toImpl(preferencesRef)->textAreasAreResizable();
329 }
330
331 void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef preferencesRef, WKFontSmoothingLevel wkLevel)
332 {
333     toImpl(preferencesRef)->setFontSmoothingLevel(toFontSmoothingLevel(wkLevel));
334 }
335
336 WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef preferencesRef)
337 {
338     return toAPI(static_cast<FontSmoothingLevel>(toImpl(preferencesRef)->fontSmoothingLevel()));
339 }
340
341 void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef, bool flag)
342 {
343     toImpl(preferencesRef)->setAcceleratedDrawingEnabled(flag);
344 }
345
346 bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef)
347 {
348     return toImpl(preferencesRef)->acceleratedDrawingEnabled();
349 }
350
351 void WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef, bool flag)
352 {
353     toImpl(preferencesRef)->setCanvasUsesAcceleratedDrawing(flag);
354 }
355
356 bool WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef)
357 {
358     return toImpl(preferencesRef)->canvasUsesAcceleratedDrawing();
359 }
360
361 void WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef, bool flag)
362 {
363     toImpl(preferencesRef)->setAcceleratedCompositingEnabled(flag);
364 }
365
366 bool WKPreferencesGetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef)
367 {
368     return toImpl(preferencesRef)->acceleratedCompositingEnabled();
369 }
370
371 void WKPreferencesSetCompositingBordersVisible(WKPreferencesRef preferencesRef, bool flag)
372 {
373     toImpl(preferencesRef)->setCompositingBordersVisible(flag);
374 }
375
376 bool WKPreferencesGetCompositingBordersVisible(WKPreferencesRef preferencesRef)
377 {
378     return toImpl(preferencesRef)->compositingBordersVisible();
379 }
380
381 void WKPreferencesSetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef, bool flag)
382 {
383     toImpl(preferencesRef)->setCompositingRepaintCountersVisible(flag);
384 }
385
386 bool WKPreferencesGetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef)
387 {
388     return toImpl(preferencesRef)->compositingRepaintCountersVisible();
389 }
390
391 void WKPreferencesSetCSSCustomFilterEnabled(WKPreferencesRef preferencesRef, bool flag)
392 {
393     toImpl(preferencesRef)->setCSSCustomFilterEnabled(flag);
394 }
395
396 bool WKPreferencesGetCSSCustomFilterEnabled(WKPreferencesRef preferencesRef)
397 {
398     return toImpl(preferencesRef)->cssCustomFilterEnabled();
399 }
400
401 void WKPreferencesSetWebGLEnabled(WKPreferencesRef preferencesRef, bool flag)
402 {
403     toImpl(preferencesRef)->setWebGLEnabled(flag);
404 }
405
406 bool WKPreferencesGetWebGLEnabled(WKPreferencesRef preferencesRef)
407 {
408     return toImpl(preferencesRef)->webGLEnabled();
409 }
410
411 void WKPreferencesSetCSSRegionsEnabled(WKPreferencesRef preferencesRef, bool flag)
412 {
413     toImpl(preferencesRef)->setCSSRegionsEnabled(flag);
414 }
415
416 bool WKPreferencesGetCSSRegionsEnabled(WKPreferencesRef preferencesRef)
417 {
418     return toImpl(preferencesRef)->cssRegionsEnabled();
419 }
420
421 void WKPreferencesSetRegionBasedColumnsEnabled(WKPreferencesRef preferencesRef, bool flag)
422 {
423     toImpl(preferencesRef)->setRegionBasedColumnsEnabled(flag);
424 }
425
426 bool WKPreferencesGetRegionBasedColumnsEnabled(WKPreferencesRef preferencesRef)
427 {
428     return toImpl(preferencesRef)->regionBasedColumnsEnabled();
429 }
430
431 void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
432 {
433     toImpl(preferencesRef)->setNeedsSiteSpecificQuirks(flag);
434 }
435
436 bool WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef)
437 {
438     return toImpl(preferencesRef)->needsSiteSpecificQuirks();
439 }
440
441 void WKPreferencesSetForceFTPDirectoryListings(WKPreferencesRef preferencesRef, bool flag)
442 {
443     toImpl(preferencesRef)->setForceFTPDirectoryListings(flag);
444 }
445
446 bool WKPreferencesGetForceFTPDirectoryListings(WKPreferencesRef preferencesRef)
447 {
448     return toImpl(preferencesRef)->forceFTPDirectoryListings();
449 }
450
451 void WKPreferencesSetFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef, WKStringRef pathRef)
452 {
453     toImpl(preferencesRef)->setFTPDirectoryTemplatePath(toWTFString(pathRef));
454 }
455
456 WKStringRef WKPreferencesCopyFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef)
457 {
458     return toCopiedAPI(toImpl(preferencesRef)->ftpDirectoryTemplatePath());
459 }
460
461 void WKPreferencesSetTabsToLinks(WKPreferencesRef preferencesRef, bool tabsToLinks)
462 {
463     toImpl(preferencesRef)->setTabsToLinks(tabsToLinks);
464 }
465
466 bool WKPreferencesGetTabsToLinks(WKPreferencesRef preferencesRef)
467 {
468     return toImpl(preferencesRef)->tabsToLinks();
469 }
470
471 void WKPreferencesSetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef, bool enabled)
472 {
473     toImpl(preferencesRef)->setDNSPrefetchingEnabled(enabled);
474 }
475
476 bool WKPreferencesGetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef)
477 {
478     return toImpl(preferencesRef)->dnsPrefetchingEnabled();
479 }
480
481 void WKPreferencesSetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef, bool enabled)
482 {
483     toImpl(preferencesRef)->setAuthorAndUserStylesEnabled(enabled);
484 }
485
486 bool WKPreferencesGetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef)
487 {
488     return toImpl(preferencesRef)->authorAndUserStylesEnabled();
489 }
490
491 void WKPreferencesSetShouldPrintBackgrounds(WKPreferencesRef preferencesRef, bool flag)
492 {
493     toImpl(preferencesRef)->setShouldPrintBackgrounds(flag);
494 }
495
496 bool WKPreferencesGetShouldPrintBackgrounds(WKPreferencesRef preferencesRef)
497 {
498     return toImpl(preferencesRef)->shouldPrintBackgrounds();
499 }
500
501 void WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef, bool enabled)
502 {
503     toImpl(preferencesRef)->setWebArchiveDebugModeEnabled(enabled);
504 }
505
506 bool WKPreferencesGetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef)
507 {
508     return toImpl(preferencesRef)->webArchiveDebugModeEnabled();
509 }
510
511 void WKPreferencesSetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef, bool enabled)
512 {
513     toImpl(preferencesRef)->setLocalFileContentSniffingEnabled(enabled);
514 }
515
516 bool WKPreferencesGetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef)
517 {
518     return toImpl(preferencesRef)->localFileContentSniffingEnabled();
519 }
520
521 void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferencesRef, bool enabled)
522 {
523     toImpl(preferencesRef)->setUsesPageCache(enabled);
524 }
525
526 bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferencesRef)
527 {
528     return toImpl(preferencesRef)->usesPageCache();
529 }
530
531 void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool pageCacheSupportsPlugins)
532 {
533     toImpl(preferencesRef)->setPageCacheSupportsPlugins(pageCacheSupportsPlugins);
534 }
535
536 bool WKPreferencesGetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef)
537 {
538     return toImpl(preferencesRef)->pageCacheSupportsPlugins();
539 }
540
541 void WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef, bool enabled)
542 {
543     toImpl(preferencesRef)->setPaginateDuringLayoutEnabled(enabled);
544 }
545
546 bool WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef)
547 {
548     return toImpl(preferencesRef)->paginateDuringLayoutEnabled();
549 }
550
551 void WKPreferencesSetDOMPasteAllowed(WKPreferencesRef preferencesRef, bool enabled)
552 {
553     toImpl(preferencesRef)->setDOMPasteAllowed(enabled);
554 }
555
556 bool WKPreferencesGetDOMPasteAllowed(WKPreferencesRef preferencesRef)
557 {
558     return toImpl(preferencesRef)->domPasteAllowed();
559 }
560
561 void WKPreferencesSetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef, bool enabled)
562 {
563     toImpl(preferencesRef)->setJavaScriptCanAccessClipboard(enabled);
564 }
565
566 bool WKPreferencesGetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef)
567 {
568     return toImpl(preferencesRef)->javaScriptCanAccessClipboard();
569 }
570
571 void WKPreferencesSetFullScreenEnabled(WKPreferencesRef preferencesRef, bool enabled)
572 {
573     toImpl(preferencesRef)->setFullScreenEnabled(enabled);
574 }
575
576 bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef)
577 {
578     return toImpl(preferencesRef)->fullScreenEnabled();
579 }
580
581 void WKPreferencesSetAVFoundationEnabled(WKPreferencesRef preferencesRef, bool enabled)
582 {
583     toImpl(preferencesRef)->setAVFoundationEnabled(enabled);
584 }
585
586 bool WKPreferencesGetAVFoundationEnabled(WKPreferencesRef preferencesRef)
587 {
588     return toImpl(preferencesRef)->isAVFoundationEnabled();
589 }
590
591 void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef, bool enabled)
592 {
593     toImpl(preferencesRef)->setWebSecurityEnabled(enabled);
594 }
595
596 bool WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferencesRef)
597 {
598     return toImpl(preferencesRef)->webSecurityEnabled();
599 }
600
601 void WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed)
602 {
603     toImpl(preferencesRef)->setAllowUniversalAccessFromFileURLs(allowed);
604 }
605
606 bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)
607 {
608     return toImpl(preferencesRef)->allowUniversalAccessFromFileURLs();
609 }
610
611 void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed)
612 {
613     toImpl(preferencesRef)->setAllowFileAccessFromFileURLs(allowed);
614 }
615
616 bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)
617 {
618     return toImpl(preferencesRef)->allowFileAccessFromFileURLs();
619 }
620
621 void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef, bool enabled)
622 {
623     toImpl(preferencesRef)->setHixie76WebSocketProtocolEnabled(enabled);
624 }
625
626 bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef)
627 {
628     return toImpl(preferencesRef)->hixie76WebSocketProtocolEnabled();
629 }
630
631 void WKPreferencesSetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
632 {
633     toImpl(preferencesRef)->setMediaPlaybackRequiresUserGesture(flag);
634 }
635
636 bool WKPreferencesGetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
637 {
638     return toImpl(preferencesRef)->mediaPlaybackRequiresUserGesture();
639 }
640
641 void WKPreferencesSetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef, bool flag)
642 {
643     toImpl(preferencesRef)->setMediaPlaybackAllowsInline(flag);
644 }
645
646 bool WKPreferencesGetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef)
647 {
648     return toImpl(preferencesRef)->mediaPlaybackAllowsInline();
649 }
650
651 void WKPreferencesSetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef, bool flag)
652 {
653     toImpl(preferencesRef)->setShowsToolTipOverTruncatedText(flag);
654 }
655
656 bool WKPreferencesGetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef)
657 {
658     return toImpl(preferencesRef)->showsToolTipOverTruncatedText();
659 }
660
661 void WKPreferencesSetMockScrollbarsEnabled(WKPreferencesRef preferencesRef, bool flag)
662 {
663     toImpl(preferencesRef)->setMockScrollbarsEnabled(flag);
664 }
665
666 bool WKPreferencesGetMockScrollbarsEnabled(WKPreferencesRef preferencesRef)
667 {
668     return toImpl(preferencesRef)->mockScrollbarsEnabled();
669 }
670
671 void WKPreferencesSetWebAudioEnabled(WKPreferencesRef preferencesRef, bool enabled)
672 {
673     toImpl(preferencesRef)->setWebAudioEnabled(enabled);
674 }
675
676 bool WKPreferencesGetWebAudioEnabled(WKPreferencesRef preferencesRef)
677 {
678     return toImpl(preferencesRef)->webAudioEnabled();
679 }
680
681 void WKPreferencesSetApplicationChromeModeEnabled(WKPreferencesRef preferencesRef, bool enabled)
682 {
683     toImpl(preferencesRef)->setApplicationChromeModeEnabled(enabled);
684 }
685
686 bool WKPreferencesGetApplicationChromeModeEnabled(WKPreferencesRef preferencesRef)
687 {
688     return toImpl(preferencesRef)->applicationChromeMode();
689 }
690
691 void WKPreferencesSetInspectorUsesWebKitUserInterface(WKPreferencesRef preferencesRef, bool enabled)
692 {
693     toImpl(preferencesRef)->setInspectorUsesWebKitUserInterface(enabled);
694 }
695
696 bool WKPreferencesGetInspectorUsesWebKitUserInterface(WKPreferencesRef preferencesRef)
697 {
698     return toImpl(preferencesRef)->inspectorUsesWebKitUserInterface();
699 }
700
701 void WKPreferencesSetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled)
702 {
703     toImpl(preferencesRef)->setSuppressesIncrementalRendering(enabled);
704 }
705
706 bool WKPreferencesGetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef)
707 {
708     return toImpl(preferencesRef)->suppressesIncrementalRendering();
709 }
710
711 void WKPreferencesSetSuppressIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled)
712 {
713     WKPreferencesSetSuppressesIncrementalRendering(preferencesRef, enabled);
714 }
715
716 bool WKPreferencesGetSuppressIncrementalRendering(WKPreferencesRef preferencesRef)
717 {
718     return WKPreferencesGetSuppressesIncrementalRendering(preferencesRef);
719 }
720
721 void WKPreferencesSetBackspaceKeyNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
722 {
723     toImpl(preferencesRef)->setBackspaceKeyNavigationEnabled(enabled);
724 }
725
726 bool WKPreferencesGetBackspaceKeyNavigationEnabled(WKPreferencesRef preferencesRef)
727 {
728     return toImpl(preferencesRef)->backspaceKeyNavigationEnabled();
729 }
730
731 void WKPreferencesSetCaretBrowsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
732 {
733     toImpl(preferencesRef)->setCaretBrowsingEnabled(enabled);
734 }
735
736 bool WKPreferencesGetCaretBrowsingEnabled(WKPreferencesRef preferencesRef)
737 {
738     return toImpl(preferencesRef)->caretBrowsingEnabled();
739 }
740
741 void WKPreferencesSetShouldDisplaySubtitles(WKPreferencesRef preferencesRef, bool enabled)
742 {
743     toImpl(preferencesRef)->setShouldDisplaySubtitles(enabled);
744 }
745
746 bool WKPreferencesGetShouldDisplaySubtitles(WKPreferencesRef preferencesRef)
747 {
748     return toImpl(preferencesRef)->shouldDisplaySubtitles();
749 }
750
751 void WKPreferencesSetShouldDisplayCaptions(WKPreferencesRef preferencesRef, bool enabled)
752 {
753     toImpl(preferencesRef)->setShouldDisplayCaptions(enabled);
754 }
755
756 bool WKPreferencesGetShouldDisplayCaptions(WKPreferencesRef preferencesRef)
757 {
758     return toImpl(preferencesRef)->shouldDisplayCaptions();
759 }
760
761 void WKPreferencesSetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef, bool enabled)
762 {
763     toImpl(preferencesRef)->setShouldDisplayTextDescriptions(enabled);
764 }
765
766 bool WKPreferencesGetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef)
767 {
768     return toImpl(preferencesRef)->shouldDisplayTextDescriptions();
769 }
770
771 void WKPreferencesSetNotificationsEnabled(WKPreferencesRef preferencesRef, bool enabled)
772 {
773     toImpl(preferencesRef)->setNotificationsEnabled(enabled);
774 }
775
776 bool WKPreferencesGetNotificationsEnabled(WKPreferencesRef preferencesRef)
777 {
778     return toImpl(preferencesRef)->notificationsEnabled();
779 }
780
781 void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef)
782 {
783     // Currently we reset the overrides on the web process when preferencesDidChange() is called. Since WTR preferences
784     // are usually always the same (in the UI process), they are not sent to web process, not triggering the reset.
785     toImpl(preferencesRef)->forceUpdate();
786 }