• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
WKPreferencesGetTypeID()38 WKTypeID WKPreferencesGetTypeID()
39 {
40     return toAPI(WebPreferences::APIType);
41 }
42 
WKPreferencesCreate()43 WKPreferencesRef WKPreferencesCreate()
44 {
45     RefPtr<WebPreferences> preferences = WebPreferences::create();
46     return toAPI(preferences.release().leakRef());
47 }
48 
WKPreferencesCreateWithIdentifier(WKStringRef identifierRef)49 WKPreferencesRef WKPreferencesCreateWithIdentifier(WKStringRef identifierRef)
50 {
51     RefPtr<WebPreferences> preferences = WebPreferences::create(toWTFString(identifierRef));
52     return toAPI(preferences.release().releaseRef());
53 }
54 
WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef,bool javaScriptEnabled)55 void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled)
56 {
57     toImpl(preferencesRef)->setJavaScriptEnabled(javaScriptEnabled);
58 }
59 
WKPreferencesGetJavaScriptEnabled(WKPreferencesRef preferencesRef)60 bool WKPreferencesGetJavaScriptEnabled(WKPreferencesRef preferencesRef)
61 {
62     return toImpl(preferencesRef)->javaScriptEnabled();
63 }
64 
WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferencesRef,bool loadsImagesAutomatically)65 void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferencesRef, bool loadsImagesAutomatically)
66 {
67     toImpl(preferencesRef)->setLoadsImagesAutomatically(loadsImagesAutomatically);
68 }
69 
WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferencesRef)70 bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferencesRef)
71 {
72     return toImpl(preferencesRef)->loadsImagesAutomatically();
73 }
74 
WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef,bool loadsSiteIconsIgnoringImageLoadingPreference)75 void WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef, bool loadsSiteIconsIgnoringImageLoadingPreference)
76 {
77     toImpl(preferencesRef)->setLoadsSiteIconsIgnoringImageLoadingPreference(loadsSiteIconsIgnoringImageLoadingPreference);
78 }
79 
WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef)80 bool WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef)
81 {
82     return toImpl(preferencesRef)->loadsSiteIconsIgnoringImageLoadingPreference();
83 }
84 
WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef,bool offlineWebApplicationCacheEnabled)85 void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef, bool offlineWebApplicationCacheEnabled)
86 {
87     toImpl(preferencesRef)->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
88 }
89 
WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef)90 bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef)
91 {
92     return toImpl(preferencesRef)->offlineWebApplicationCacheEnabled();
93 }
94 
WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferencesRef,bool localStorageEnabled)95 void WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferencesRef, bool localStorageEnabled)
96 {
97     toImpl(preferencesRef)->setLocalStorageEnabled(localStorageEnabled);
98 }
99 
WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)100 bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)
101 {
102     return toImpl(preferencesRef)->localStorageEnabled();
103 }
104 
WKPreferencesSetDatabasesEnabled(WKPreferencesRef preferencesRef,bool databasesEnabled)105 void WKPreferencesSetDatabasesEnabled(WKPreferencesRef preferencesRef, bool databasesEnabled)
106 {
107     toImpl(preferencesRef)->setDatabasesEnabled(databasesEnabled);
108 }
109 
WKPreferencesGetDatabasesEnabled(WKPreferencesRef preferencesRef)110 bool WKPreferencesGetDatabasesEnabled(WKPreferencesRef preferencesRef)
111 {
112     return toImpl(preferencesRef)->databasesEnabled();
113 }
114 
WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferencesRef,bool xssAuditorEnabled)115 void WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferencesRef, bool xssAuditorEnabled)
116 {
117     toImpl(preferencesRef)->setXSSAuditorEnabled(xssAuditorEnabled);
118 }
119 
WKPreferencesGetXSSAuditorEnabled(WKPreferencesRef preferencesRef)120 bool WKPreferencesGetXSSAuditorEnabled(WKPreferencesRef preferencesRef)
121 {
122     return toImpl(preferencesRef)->xssAuditorEnabled();
123 }
124 
WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef,bool frameFlatteningEnabled)125 void WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef, bool frameFlatteningEnabled)
126 {
127     toImpl(preferencesRef)->setFrameFlatteningEnabled(frameFlatteningEnabled);
128 }
129 
WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)130 bool WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)
131 {
132     return toImpl(preferencesRef)->frameFlatteningEnabled();
133 }
134 
WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef,bool pluginsEnabled)135 void WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef, bool pluginsEnabled)
136 {
137     toImpl(preferencesRef)->setPluginsEnabled(pluginsEnabled);
138 }
139 
WKPreferencesGetPluginsEnabled(WKPreferencesRef preferencesRef)140 bool WKPreferencesGetPluginsEnabled(WKPreferencesRef preferencesRef)
141 {
142     return toImpl(preferencesRef)->pluginsEnabled();
143 }
144 
WKPreferencesSetJavaEnabled(WKPreferencesRef preferencesRef,bool javaEnabled)145 void WKPreferencesSetJavaEnabled(WKPreferencesRef preferencesRef, bool javaEnabled)
146 {
147     toImpl(preferencesRef)->setJavaEnabled(javaEnabled);
148 }
149 
WKPreferencesGetJavaEnabled(WKPreferencesRef preferencesRef)150 bool WKPreferencesGetJavaEnabled(WKPreferencesRef preferencesRef)
151 {
152     return toImpl(preferencesRef)->javaEnabled();
153 }
154 
WKPreferencesSetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef,bool javaScriptCanOpenWindowsAutomatically)155 void WKPreferencesSetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef, bool javaScriptCanOpenWindowsAutomatically)
156 {
157     toImpl(preferencesRef)->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
158 }
159 
WKPreferencesGetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef)160 bool WKPreferencesGetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef)
161 {
162     return toImpl(preferencesRef)->javaScriptCanOpenWindowsAutomatically();
163 }
164 
WKPreferencesSetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef,bool hyperlinkAuditingEnabled)165 void WKPreferencesSetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef, bool hyperlinkAuditingEnabled)
166 {
167     toImpl(preferencesRef)->setHyperlinkAuditingEnabled(hyperlinkAuditingEnabled);
168 }
169 
WKPreferencesGetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef)170 bool WKPreferencesGetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef)
171 {
172     return toImpl(preferencesRef)->hyperlinkAuditingEnabled();
173 }
174 
WKPreferencesSetStandardFontFamily(WKPreferencesRef preferencesRef,WKStringRef family)175 void WKPreferencesSetStandardFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
176 {
177     toImpl(preferencesRef)->setStandardFontFamily(toWTFString(family));
178 }
179 
WKPreferencesCopyStandardFontFamily(WKPreferencesRef preferencesRef)180 WKStringRef WKPreferencesCopyStandardFontFamily(WKPreferencesRef preferencesRef)
181 {
182     return toCopiedAPI(toImpl(preferencesRef)->standardFontFamily());
183 }
184 
WKPreferencesSetFixedFontFamily(WKPreferencesRef preferencesRef,WKStringRef family)185 void WKPreferencesSetFixedFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
186 {
187     toImpl(preferencesRef)->setFixedFontFamily(toWTFString(family));
188 }
189 
WKPreferencesCopyFixedFontFamily(WKPreferencesRef preferencesRef)190 WKStringRef WKPreferencesCopyFixedFontFamily(WKPreferencesRef preferencesRef)
191 {
192     return toCopiedAPI(toImpl(preferencesRef)->fixedFontFamily());
193 }
194 
WKPreferencesSetSerifFontFamily(WKPreferencesRef preferencesRef,WKStringRef family)195 void WKPreferencesSetSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
196 {
197     toImpl(preferencesRef)->setSerifFontFamily(toWTFString(family));
198 }
199 
WKPreferencesCopySerifFontFamily(WKPreferencesRef preferencesRef)200 WKStringRef WKPreferencesCopySerifFontFamily(WKPreferencesRef preferencesRef)
201 {
202     return toCopiedAPI(toImpl(preferencesRef)->serifFontFamily());
203 }
204 
WKPreferencesSetSansSerifFontFamily(WKPreferencesRef preferencesRef,WKStringRef family)205 void WKPreferencesSetSansSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
206 {
207     toImpl(preferencesRef)->setSansSerifFontFamily(toWTFString(family));
208 }
209 
WKPreferencesCopySansSerifFontFamily(WKPreferencesRef preferencesRef)210 WKStringRef WKPreferencesCopySansSerifFontFamily(WKPreferencesRef preferencesRef)
211 {
212     return toCopiedAPI(toImpl(preferencesRef)->sansSerifFontFamily());
213 }
214 
WKPreferencesSetCursiveFontFamily(WKPreferencesRef preferencesRef,WKStringRef family)215 void WKPreferencesSetCursiveFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
216 {
217     toImpl(preferencesRef)->setCursiveFontFamily(toWTFString(family));
218 }
219 
WKPreferencesCopyCursiveFontFamily(WKPreferencesRef preferencesRef)220 WKStringRef WKPreferencesCopyCursiveFontFamily(WKPreferencesRef preferencesRef)
221 {
222     return toCopiedAPI(toImpl(preferencesRef)->cursiveFontFamily());
223 }
224 
WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef,WKStringRef family)225 void WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
226 {
227     toImpl(preferencesRef)->setFantasyFontFamily(toWTFString(family));
228 }
229 
WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef)230 WKStringRef WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef)
231 {
232     return toCopiedAPI(toImpl(preferencesRef)->fantasyFontFamily());
233 }
234 
WKPreferencesSetDefaultFontSize(WKPreferencesRef preferencesRef,uint32_t size)235 void WKPreferencesSetDefaultFontSize(WKPreferencesRef preferencesRef, uint32_t size)
236 {
237     toImpl(preferencesRef)->setDefaultFontSize(size);
238 }
239 
WKPreferencesGetDefaultFontSize(WKPreferencesRef preferencesRef)240 uint32_t WKPreferencesGetDefaultFontSize(WKPreferencesRef preferencesRef)
241 {
242     return toImpl(preferencesRef)->defaultFontSize();
243 }
244 
WKPreferencesSetDefaultFixedFontSize(WKPreferencesRef preferencesRef,uint32_t size)245 void WKPreferencesSetDefaultFixedFontSize(WKPreferencesRef preferencesRef, uint32_t size)
246 {
247     toImpl(preferencesRef)->setDefaultFixedFontSize(size);
248 }
249 
WKPreferencesGetDefaultFixedFontSize(WKPreferencesRef preferencesRef)250 uint32_t WKPreferencesGetDefaultFixedFontSize(WKPreferencesRef preferencesRef)
251 {
252     return toImpl(preferencesRef)->defaultFixedFontSize();
253 }
254 
WKPreferencesSetMinimumFontSize(WKPreferencesRef preferencesRef,uint32_t size)255 void WKPreferencesSetMinimumFontSize(WKPreferencesRef preferencesRef, uint32_t size)
256 {
257     toImpl(preferencesRef)->setMinimumFontSize(size);
258 }
259 
WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)260 uint32_t WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)
261 {
262     return toImpl(preferencesRef)->minimumFontSize();
263 }
264 
WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef,WKEditableLinkBehavior wkBehavior)265 void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
266 {
267     toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior));
268 }
269 
WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef)270 WKEditableLinkBehavior WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef)
271 {
272     return toAPI(static_cast<WebCore::EditableLinkBehavior>(toImpl(preferencesRef)->editableLinkBehavior()));
273 }
274 
WKPreferencesSetDefaultTextEncodingName(WKPreferencesRef preferencesRef,WKStringRef name)275 void WKPreferencesSetDefaultTextEncodingName(WKPreferencesRef preferencesRef, WKStringRef name)
276 {
277     toImpl(preferencesRef)->setDefaultTextEncodingName(toWTFString(name));
278 }
279 
WKPreferencesCopyDefaultTextEncodingName(WKPreferencesRef preferencesRef)280 WKStringRef WKPreferencesCopyDefaultTextEncodingName(WKPreferencesRef preferencesRef)
281 {
282     return toCopiedAPI(toImpl(preferencesRef)->defaultTextEncodingName());
283 }
284 
WKPreferencesSetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef,bool enabled)285 void WKPreferencesSetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
286 {
287     toImpl(preferencesRef)->setPrivateBrowsingEnabled(enabled);
288 }
289 
WKPreferencesGetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef)290 bool WKPreferencesGetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef)
291 {
292     return toImpl(preferencesRef)->privateBrowsingEnabled();
293 }
294 
WKPreferencesSetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef,bool enabled)295 void WKPreferencesSetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef, bool enabled)
296 {
297     toImpl(preferencesRef)->setDeveloperExtrasEnabled(enabled);
298 }
299 
WKPreferencesGetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef)300 bool WKPreferencesGetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef)
301 {
302     return toImpl(preferencesRef)->developerExtrasEnabled();
303 }
304 
WKPreferencesSetTextAreasAreResizable(WKPreferencesRef preferencesRef,bool resizable)305 void WKPreferencesSetTextAreasAreResizable(WKPreferencesRef preferencesRef, bool resizable)
306 {
307     toImpl(preferencesRef)->setTextAreasAreResizable(resizable);
308 }
309 
WKPreferencesGetTextAreasAreResizable(WKPreferencesRef preferencesRef)310 bool WKPreferencesGetTextAreasAreResizable(WKPreferencesRef preferencesRef)
311 {
312     return toImpl(preferencesRef)->textAreasAreResizable();
313 }
314 
WKPreferencesSetFontSmoothingLevel(WKPreferencesRef preferencesRef,WKFontSmoothingLevel wkLevel)315 void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef preferencesRef, WKFontSmoothingLevel wkLevel)
316 {
317     toImpl(preferencesRef)->setFontSmoothingLevel(toFontSmoothingLevel(wkLevel));
318 }
319 
WKPreferencesGetFontSmoothingLevel(WKPreferencesRef preferencesRef)320 WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef preferencesRef)
321 {
322     return toAPI(static_cast<FontSmoothingLevel>(toImpl(preferencesRef)->fontSmoothingLevel()));
323 }
324 
WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef,bool flag)325 void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef, bool flag)
326 {
327     toImpl(preferencesRef)->setAcceleratedDrawingEnabled(flag);
328 }
329 
WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef)330 bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef)
331 {
332     return toImpl(preferencesRef)->acceleratedDrawingEnabled();
333 }
334 
WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef,bool flag)335 void WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef, bool flag)
336 {
337     toImpl(preferencesRef)->setCanvasUsesAcceleratedDrawing(flag);
338 }
339 
WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef)340 bool WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef)
341 {
342     return toImpl(preferencesRef)->canvasUsesAcceleratedDrawing();
343 }
344 
WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef,bool flag)345 void WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef, bool flag)
346 {
347     toImpl(preferencesRef)->setAcceleratedCompositingEnabled(flag);
348 }
349 
WKPreferencesGetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef)350 bool WKPreferencesGetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef)
351 {
352     return toImpl(preferencesRef)->acceleratedCompositingEnabled();
353 }
354 
WKPreferencesSetCompositingBordersVisible(WKPreferencesRef preferencesRef,bool flag)355 void WKPreferencesSetCompositingBordersVisible(WKPreferencesRef preferencesRef, bool flag)
356 {
357     toImpl(preferencesRef)->setCompositingBordersVisible(flag);
358 }
359 
WKPreferencesGetCompositingBordersVisible(WKPreferencesRef preferencesRef)360 bool WKPreferencesGetCompositingBordersVisible(WKPreferencesRef preferencesRef)
361 {
362     return toImpl(preferencesRef)->compositingBordersVisible();
363 }
364 
WKPreferencesSetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef,bool flag)365 void WKPreferencesSetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef, bool flag)
366 {
367     toImpl(preferencesRef)->setCompositingRepaintCountersVisible(flag);
368 }
369 
WKPreferencesGetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef)370 bool WKPreferencesGetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef)
371 {
372     return toImpl(preferencesRef)->compositingRepaintCountersVisible();
373 }
374 
WKPreferencesSetWebGLEnabled(WKPreferencesRef preferencesRef,bool flag)375 void WKPreferencesSetWebGLEnabled(WKPreferencesRef preferencesRef, bool flag)
376 {
377     toImpl(preferencesRef)->setWebGLEnabled(flag);
378 }
379 
WKPreferencesGetWebGLEnabled(WKPreferencesRef preferencesRef)380 bool WKPreferencesGetWebGLEnabled(WKPreferencesRef preferencesRef)
381 {
382     return toImpl(preferencesRef)->webGLEnabled();
383 }
384 
WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef,bool flag)385 void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
386 {
387     toImpl(preferencesRef)->setNeedsSiteSpecificQuirks(flag);
388 }
389 
WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef)390 bool WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef)
391 {
392     return toImpl(preferencesRef)->needsSiteSpecificQuirks();
393 }
394 
WKPreferencesSetForceFTPDirectoryListings(WKPreferencesRef preferencesRef,bool flag)395 void WKPreferencesSetForceFTPDirectoryListings(WKPreferencesRef preferencesRef, bool flag)
396 {
397     toImpl(preferencesRef)->setForceFTPDirectoryListings(flag);
398 }
399 
WKPreferencesGetForceFTPDirectoryListings(WKPreferencesRef preferencesRef)400 bool WKPreferencesGetForceFTPDirectoryListings(WKPreferencesRef preferencesRef)
401 {
402     return toImpl(preferencesRef)->forceFTPDirectoryListings();
403 }
404 
WKPreferencesSetFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef,WKStringRef pathRef)405 void WKPreferencesSetFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef, WKStringRef pathRef)
406 {
407     toImpl(preferencesRef)->setFTPDirectoryTemplatePath(toWTFString(pathRef));
408 }
409 
WKPreferencesCopyFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef)410 WKStringRef WKPreferencesCopyFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef)
411 {
412     return toCopiedAPI(toImpl(preferencesRef)->ftpDirectoryTemplatePath());
413 }
414 
WKPreferencesSetTabsToLinks(WKPreferencesRef preferencesRef,bool tabsToLinks)415 void WKPreferencesSetTabsToLinks(WKPreferencesRef preferencesRef, bool tabsToLinks)
416 {
417     toImpl(preferencesRef)->setTabsToLinks(tabsToLinks);
418 }
419 
WKPreferencesGetTabsToLinks(WKPreferencesRef preferencesRef)420 bool WKPreferencesGetTabsToLinks(WKPreferencesRef preferencesRef)
421 {
422     return toImpl(preferencesRef)->tabsToLinks();
423 }
424 
WKPreferencesSetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef,bool enabled)425 void WKPreferencesSetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef, bool enabled)
426 {
427     toImpl(preferencesRef)->setDNSPrefetchingEnabled(enabled);
428 }
429 
WKPreferencesGetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef)430 bool WKPreferencesGetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef)
431 {
432     return toImpl(preferencesRef)->dnsPrefetchingEnabled();
433 }
434 
WKPreferencesSetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef,bool enabled)435 void WKPreferencesSetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef, bool enabled)
436 {
437     toImpl(preferencesRef)->setAuthorAndUserStylesEnabled(enabled);
438 }
439 
WKPreferencesGetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef)440 bool WKPreferencesGetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef)
441 {
442     return toImpl(preferencesRef)->authorAndUserStylesEnabled();
443 }
444 
WKPreferencesSetShouldPrintBackgrounds(WKPreferencesRef preferencesRef,bool flag)445 void WKPreferencesSetShouldPrintBackgrounds(WKPreferencesRef preferencesRef, bool flag)
446 {
447     toImpl(preferencesRef)->setShouldPrintBackgrounds(flag);
448 }
449 
WKPreferencesGetShouldPrintBackgrounds(WKPreferencesRef preferencesRef)450 bool WKPreferencesGetShouldPrintBackgrounds(WKPreferencesRef preferencesRef)
451 {
452     return toImpl(preferencesRef)->shouldPrintBackgrounds();
453 }
454 
WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef,bool enabled)455 void WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef, bool enabled)
456 {
457     toImpl(preferencesRef)->setWebArchiveDebugModeEnabled(enabled);
458 }
459 
WKPreferencesGetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef)460 bool WKPreferencesGetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef)
461 {
462     return toImpl(preferencesRef)->webArchiveDebugModeEnabled();
463 }
464 
WKPreferencesSetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef,bool enabled)465 void WKPreferencesSetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef, bool enabled)
466 {
467     toImpl(preferencesRef)->setLocalFileContentSniffingEnabled(enabled);
468 }
469 
WKPreferencesGetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef)470 bool WKPreferencesGetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef)
471 {
472     return toImpl(preferencesRef)->localFileContentSniffingEnabled();
473 }
474 
WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferencesRef,bool enabled)475 void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferencesRef, bool enabled)
476 {
477     toImpl(preferencesRef)->setUsesPageCache(enabled);
478 }
479 
WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferencesRef)480 bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferencesRef)
481 {
482     return toImpl(preferencesRef)->usesPageCache();
483 }
484 
WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef,bool enabled)485 void WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef, bool enabled)
486 {
487     toImpl(preferencesRef)->setPaginateDuringLayoutEnabled(enabled);
488 }
489 
WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef)490 bool WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef)
491 {
492     return toImpl(preferencesRef)->paginateDuringLayoutEnabled();
493 }
494 
WKPreferencesSetDOMPasteAllowed(WKPreferencesRef preferencesRef,bool enabled)495 void WKPreferencesSetDOMPasteAllowed(WKPreferencesRef preferencesRef, bool enabled)
496 {
497     toImpl(preferencesRef)->setDOMPasteAllowed(enabled);
498 }
499 
WKPreferencesGetDOMPasteAllowed(WKPreferencesRef preferencesRef)500 bool WKPreferencesGetDOMPasteAllowed(WKPreferencesRef preferencesRef)
501 {
502     return toImpl(preferencesRef)->domPasteAllowed();
503 }
504 
WKPreferencesSetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef,bool enabled)505 void WKPreferencesSetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef, bool enabled)
506 {
507     toImpl(preferencesRef)->setJavaScriptCanAccessClipboard(enabled);
508 }
509 
WKPreferencesGetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef)510 bool WKPreferencesGetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef)
511 {
512     return toImpl(preferencesRef)->javaScriptCanAccessClipboard();
513 }
514 
WKPreferencesSetFullScreenEnabled(WKPreferencesRef preferencesRef,bool enabled)515 void WKPreferencesSetFullScreenEnabled(WKPreferencesRef preferencesRef, bool enabled)
516 {
517     toImpl(preferencesRef)->setFullScreenEnabled(enabled);
518 }
519 
WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef)520 bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef)
521 {
522     return toImpl(preferencesRef)->fullScreenEnabled();
523 }
524 
WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef,bool enabled)525 void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef, bool enabled)
526 {
527     toImpl(preferencesRef)->setWebSecurityEnabled(enabled);
528 }
529 
WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferencesRef)530 bool WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferencesRef)
531 {
532     return toImpl(preferencesRef)->webSecurityEnabled();
533 }
534 
WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef,bool allowed)535 void WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed)
536 {
537     toImpl(preferencesRef)->setAllowUniversalAccessFromFileURLs(allowed);
538 }
539 
WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)540 bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)
541 {
542     return toImpl(preferencesRef)->allowUniversalAccessFromFileURLs();
543 }
544 
WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef,bool allowed)545 void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed)
546 {
547     toImpl(preferencesRef)->setAllowFileAccessFromFileURLs(allowed);
548 }
549 
WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)550 bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)
551 {
552     return toImpl(preferencesRef)->allowFileAccessFromFileURLs();
553 }
554