Update AVKit usage of pip
[WebKit-https.git] / Source / WebKit / mac / WebView / WebPreferencesPrivate.h
1 /*
2  * Copyright (C) 2005, 2007, 2011, 2012 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  *
8  * 1.  Redistributions of source code must retain the above copyright
9  *     notice, this list of conditions and the following disclaimer. 
10  * 2.  Redistributions in binary form must reproduce the above copyright
11  *     notice, this list of conditions and the following disclaimer in the
12  *     documentation and/or other materials provided with the distribution. 
13  * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
14  *     its contributors may be used to endorse or promote products derived
15  *     from this software without specific prior written permission. 
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 #import <WebKitLegacy/WebPreferences.h>
30
31 #if !TARGET_OS_IPHONE
32 #import <Quartz/Quartz.h>
33 #endif
34
35 typedef enum {
36     WebKitEditableLinkDefaultBehavior,
37     WebKitEditableLinkAlwaysLive,
38     WebKitEditableLinkOnlyLiveWithShiftKey,
39     WebKitEditableLinkLiveWhenNotFocused,
40     WebKitEditableLinkNeverLive
41 } WebKitEditableLinkBehavior;
42
43 typedef enum {
44     WebTextDirectionSubmenuNeverIncluded,
45     WebTextDirectionSubmenuAutomaticallyIncluded,
46     WebTextDirectionSubmenuAlwaysIncluded
47 } WebTextDirectionSubmenuInclusionBehavior;
48
49 typedef enum {
50     WebAllowAllStorage = 0,
51     WebBlockThirdPartyStorage,
52     WebBlockAllStorage
53 } WebStorageBlockingPolicy;
54
55 typedef enum {
56     WebKitJavaScriptRuntimeFlagsSymbolDisabled = 1u << 0,
57     WebKitJavaScriptRuntimeFlagsPromiseDisabled = 1u << 1,
58     WebKitJavaScriptRuntimeFlagsAllEnabled = 0
59 } WebKitJavaScriptRuntimeFlags;
60
61 extern NSString *WebPreferencesChangedNotification;
62 extern NSString *WebPreferencesRemovedNotification;
63 extern NSString *WebPreferencesChangedInternalNotification;
64 extern NSString *WebPreferencesCacheModelChangedInternalNotification;
65
66 @interface WebPreferences (WebPrivate)
67
68 // Preferences that might be public in a future release
69
70 - (BOOL)isDNSPrefetchingEnabled;
71 - (void)setDNSPrefetchingEnabled:(BOOL)flag;
72
73 - (BOOL)developerExtrasEnabled;
74 - (void)setDeveloperExtrasEnabled:(BOOL)flag;
75
76 - (WebKitJavaScriptRuntimeFlags)javaScriptRuntimeFlags;
77 - (void)setJavaScriptRuntimeFlags:(WebKitJavaScriptRuntimeFlags)flags;
78
79 - (BOOL)authorAndUserStylesEnabled;
80 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
81
82 - (BOOL)applicationChromeModeEnabled;
83 - (void)setApplicationChromeModeEnabled:(BOOL)flag;
84
85 - (BOOL)usesEncodingDetector;
86 - (void)setUsesEncodingDetector:(BOOL)flag;
87
88 #if !TARGET_OS_IPHONE
89 - (BOOL)respectStandardStyleKeyEquivalents;
90 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
91
92 - (BOOL)showsURLsInToolTips;
93 - (void)setShowsURLsInToolTips:(BOOL)flag;
94
95 - (BOOL)showsToolTipOverTruncatedText;
96 - (void)setShowsToolTipOverTruncatedText:(BOOL)flag;
97
98 - (BOOL)textAreasAreResizable;
99 - (void)setTextAreasAreResizable:(BOOL)flag;
100
101 - (PDFDisplayMode)PDFDisplayMode;
102 - (void)setPDFDisplayMode:(PDFDisplayMode)mode;
103 #endif
104
105 - (BOOL)shrinksStandaloneImagesToFit;
106 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag;
107
108 - (BOOL)automaticallyDetectsCacheModel;
109 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
110
111 - (BOOL)domTimersThrottlingEnabled;
112 - (void)setDOMTimersThrottlingEnabled:(BOOL)domTimersThrottlingEnabled;
113
114 - (BOOL)webArchiveDebugModeEnabled;
115 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
116
117 - (BOOL)localFileContentSniffingEnabled;
118 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled;
119
120 - (BOOL)offlineWebApplicationCacheEnabled;
121 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
122
123 - (BOOL)databasesEnabled;
124 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
125
126 #if TARGET_OS_IPHONE
127 - (BOOL)storageTrackerEnabled;
128 - (void)setStorageTrackerEnabled:(BOOL)storageTrackerEnabled;
129 #endif
130
131 - (BOOL)localStorageEnabled;
132 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
133
134 - (BOOL)isWebSecurityEnabled;
135 - (void)setWebSecurityEnabled:(BOOL)flag;
136
137 - (BOOL)allowUniversalAccessFromFileURLs;
138 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
139
140 - (BOOL)allowFileAccessFromFileURLs;
141 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag;
142
143 - (BOOL)zoomsTextOnly;
144 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
145
146 - (BOOL)javaScriptCanAccessClipboard;
147 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag;
148
149 - (BOOL)isXSSAuditorEnabled;
150 - (void)setXSSAuditorEnabled:(BOOL)flag;
151
152 - (BOOL)experimentalNotificationsEnabled;
153 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled;
154
155 - (BOOL)isFrameFlatteningEnabled;
156 - (void)setFrameFlatteningEnabled:(BOOL)flag;
157
158 - (BOOL)isSpatialNavigationEnabled;
159 - (void)setSpatialNavigationEnabled:(BOOL)flag;
160
161 #if !TARGET_OS_IPHONE
162 // zero means do AutoScale
163 - (float)PDFScaleFactor;
164 - (void)setPDFScaleFactor:(float)scale;
165 #endif
166
167 - (int64_t)applicationCacheTotalQuota;
168 - (void)setApplicationCacheTotalQuota:(int64_t)quota;
169
170 - (int64_t)applicationCacheDefaultOriginQuota;
171 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota;
172
173 - (WebKitEditableLinkBehavior)editableLinkBehavior;
174 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
175
176 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
177 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
178
179 // Used to set preference specified in the test via LayoutTestController.overridePreference(..).
180 // For use with DumpRenderTree only.
181 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key;
182
183 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
184 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
185 // the future when there's no more need for it.
186 - (BOOL)_useSiteSpecificSpoofing;
187 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
188
189 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
190 - (BOOL)isDOMPasteAllowed;
191 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
192
193 - (NSString *)_ftpDirectoryTemplatePath;
194 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
195
196 - (void)_setForceFTPDirectoryListings:(BOOL)force;
197 - (BOOL)_forceFTPDirectoryListings;
198
199 - (NSString *)_localStorageDatabasePath;
200 - (void)_setLocalStorageDatabasePath:(NSString *)path;
201
202 - (BOOL)acceleratedDrawingEnabled;
203 - (void)setAcceleratedDrawingEnabled:(BOOL)enabled;
204
205 - (BOOL)canvasUsesAcceleratedDrawing;
206 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled;
207
208 - (BOOL)acceleratedCompositingEnabled;
209 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
210
211 - (BOOL)cssRegionsEnabled;
212 - (void)setCSSRegionsEnabled:(BOOL)enabled;
213
214 - (BOOL)cssCompositingEnabled;
215 - (void)setCSSCompositingEnabled:(BOOL)enabled;
216
217 - (BOOL)showDebugBorders;
218 - (void)setShowDebugBorders:(BOOL)show;
219
220 - (BOOL)simpleLineLayoutDebugBordersEnabled;
221 - (void)setSimpleLineLayoutDebugBordersEnabled:(BOOL)enabled;
222
223 - (BOOL)showRepaintCounter;
224 - (void)setShowRepaintCounter:(BOOL)show;
225
226 - (BOOL)webAudioEnabled;
227 - (void)setWebAudioEnabled:(BOOL)enabled;
228
229 - (BOOL)subpixelCSSOMElementMetricsEnabled;
230 - (void)setSubpixelCSSOMElementMetricsEnabled:(BOOL)enabled;
231
232 - (BOOL)webGLEnabled;
233 - (void)setWebGLEnabled:(BOOL)enabled;
234
235 - (BOOL)forceSoftwareWebGLRendering;
236 - (void)setForceSoftwareWebGLRendering:(BOOL)forced;
237
238 - (BOOL)accelerated2dCanvasEnabled;
239 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
240
241 - (BOOL)paginateDuringLayoutEnabled;
242 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
243
244 - (BOOL)hyperlinkAuditingEnabled;
245 - (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
246
247 - (void)setMediaPlaybackRequiresUserGesture:(BOOL)flag;
248 - (BOOL)mediaPlaybackRequiresUserGesture;
249
250 - (void)setMediaPlaybackAllowsInline:(BOOL)flag;
251 - (BOOL)mediaPlaybackAllowsInline;
252
253 - (void)setAllowsAlternateFullscreen:(BOOL)flag;
254 - (BOOL)allowsAlternateFullscreen;
255
256 - (void)setAllowsPictureInPictureMediaPlayback:(BOOL)flag;
257 - (BOOL)allowsPictureInPictureMediaPlayback;
258
259 - (NSString *)pictographFontFamily;
260 - (void)setPictographFontFamily:(NSString *)family;
261
262 - (BOOL)pageCacheSupportsPlugins;
263 - (void)setPageCacheSupportsPlugins:(BOOL)flag;
264
265 // This is a global setting.
266 - (BOOL)mockScrollbarsEnabled;
267 - (void)setMockScrollbarsEnabled:(BOOL)flag;
268
269 #if TARGET_OS_IPHONE
270 // This is a global setting.
271 - (unsigned)audioSessionCategoryOverride;
272 - (void)setAudioSessionCategoryOverride:(unsigned)override;
273
274 - (BOOL)avKitEnabled;
275 - (void)setAVKitEnabled:(bool)flag;
276
277 // WARNING: this affect network performance. This must not be enabled for production use.
278 // Enabling this makes WebCore reports the network data usage.
279 // This is a global setting.
280 - (void)setNetworkDataUsageTrackingEnabled:(bool)trackingEnabled;
281 - (BOOL)networkDataUsageTrackingEnabled;
282
283 - (void)setNetworkInterfaceName:(NSString *)name;
284 - (NSString *)networkInterfaceName;
285
286 - (void)_setMinimumZoomFontSize:(float)size;
287 - (float)_minimumZoomFontSize;
288
289 // Deprecated. Has no effect.
290 - (void)setDiskImageCacheEnabled:(BOOL)enabled;
291
292 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag;
293 - (BOOL)mediaPlaybackAllowsAirPlay;
294 #endif
295
296 - (BOOL)isInheritURIQueryComponentEnabled;
297 - (void)setEnableInheritURIQueryComponent:(BOOL)flag;
298
299 // Other private methods
300 #if TARGET_OS_IPHONE
301 - (BOOL)_standalone;
302 - (void)_setStandalone:(BOOL)flag;
303 - (void)_setTelephoneNumberParsingEnabled:(BOOL)flag;
304 - (BOOL)_telephoneNumberParsingEnabled;
305 - (void)_setAllowMultiElementImplicitFormSubmission:(BOOL)flag;
306 - (BOOL)_allowMultiElementImplicitFormSubmission;
307 - (void)_setAlwaysRequestGeolocationPermission:(BOOL)flag;
308 - (BOOL)_alwaysRequestGeolocationPermission;
309 - (void)_setAlwaysUseAcceleratedOverflowScroll:(BOOL)flag;
310 - (BOOL)_alwaysUseAcceleratedOverflowScroll;
311 - (void)_setLayoutInterval:(int)l;
312 - (int)_layoutInterval;
313 - (void)_setMaxParseDuration:(float)d;
314 - (float)_maxParseDuration;
315 - (void)_setInterpolationQuality:(int)quality;
316 - (int)_interpolationQuality;
317 - (BOOL)_allowPasswordEcho;
318 - (float)_passwordEchoDuration;
319 #endif
320 - (void)_postPreferencesChangedNotification;
321 - (void)_postPreferencesChangedAPINotification;
322 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
323 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
324 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
325 - (NSTimeInterval)_backForwardCacheExpirationInterval;
326 + (CFStringEncoding)_systemCFStringEncoding;
327 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
328 + (void)_setIBCreatorID:(NSString *)string;
329
330 // For DumpRenderTree use only.
331 + (void)_switchNetworkLoaderToNewTestingSession;
332 + (void)_setCurrentNetworkLoaderSessionCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)cookieAcceptPolicy;
333 + (void)_clearNetworkLoaderSession;
334
335 + (void)setWebKitLinkTimeVersion:(int)version;
336
337 // For WebView's use only.
338 - (void)willAddToWebView;
339 - (void)didRemoveFromWebView;
340
341 // Full screen support is dependent on WebCore/WebKit being
342 // compiled with ENABLE_FULLSCREEN_API. 
343 - (void)setFullScreenEnabled:(BOOL)flag;
344 - (BOOL)fullScreenEnabled;
345
346 - (void)setAsynchronousSpellCheckingEnabled:(BOOL)flag;
347 - (BOOL)asynchronousSpellCheckingEnabled;
348
349 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
350 - (BOOL)usePreHTML5ParserQuirks;
351
352 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag;
353 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
354
355 // AVFoundation support is dependent on WebCore/WebKit being
356 // compiled with USE_AVFOUNDATION.
357 - (void)setAVFoundationEnabled:(BOOL)flag;
358 - (BOOL)isAVFoundationEnabled;
359
360 - (void)setQTKitEnabled:(BOOL)flag;
361 - (BOOL)isQTKitEnabled;
362
363 // Deprecated, has no effect.
364 - (void)setVideoPluginProxyEnabled:(BOOL)flag;
365 - (BOOL)isVideoPluginProxyEnabled;
366
367 // WebSocket support depends on ENABLE(WEB_SOCKETS).
368 - (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag;
369 - (BOOL)isHixie76WebSocketProtocolEnabled;
370
371 #if TARGET_OS_IPHONE
372 - (void)_invalidateCachedPreferences;
373 - (void)_synchronizeWebStoragePolicyWithCookiePolicy;
374 #endif
375
376 - (void)setBackspaceKeyNavigationEnabled:(BOOL)flag;
377 - (BOOL)backspaceKeyNavigationEnabled;
378
379 - (void)setWantsBalancedSetDefersLoadingBehavior:(BOOL)flag;
380 - (BOOL)wantsBalancedSetDefersLoadingBehavior;
381
382 - (void)setShouldDisplaySubtitles:(BOOL)flag;
383 - (BOOL)shouldDisplaySubtitles;
384
385 - (void)setShouldDisplayCaptions:(BOOL)flag;
386 - (BOOL)shouldDisplayCaptions;
387
388 - (void)setShouldDisplayTextDescriptions:(BOOL)flag;
389 - (BOOL)shouldDisplayTextDescriptions;
390
391 - (void)setNotificationsEnabled:(BOOL)flag;
392 - (BOOL)notificationsEnabled;
393
394 - (void)setShouldRespectImageOrientation:(BOOL)flag;
395 - (BOOL)shouldRespectImageOrientation;
396
397 - (BOOL)requestAnimationFrameEnabled;
398 - (void)setRequestAnimationFrameEnabled:(BOOL)enabled;
399
400 - (void)setIncrementalRenderingSuppressionTimeoutInSeconds:(NSTimeInterval)timeout;
401 - (NSTimeInterval)incrementalRenderingSuppressionTimeoutInSeconds;
402
403 - (BOOL)diagnosticLoggingEnabled;
404 - (void)setDiagnosticLoggingEnabled:(BOOL)enabled;
405
406 - (void)setStorageBlockingPolicy:(WebStorageBlockingPolicy)storageBlockingPolicy;
407 - (WebStorageBlockingPolicy)storageBlockingPolicy;
408
409 - (BOOL)plugInSnapshottingEnabled;
410 - (void)setPlugInSnapshottingEnabled:(BOOL)enabled;
411
412 - (BOOL)hiddenPageDOMTimerThrottlingEnabled;
413 - (void)setHiddenPageDOMTimerThrottlingEnabled:(BOOL)flag;
414
415 - (BOOL)hiddenPageCSSAnimationSuspensionEnabled;
416 - (void)setHiddenPageCSSAnimationSuspensionEnabled:(BOOL)flag;
417
418 - (BOOL)lowPowerVideoAudioBufferSizeEnabled;
419 - (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled;
420
421 - (void)setUseLegacyTextAlignPositionedElementBehavior:(BOOL)flag;
422 - (BOOL)useLegacyTextAlignPositionedElementBehavior;
423
424 - (void)setMediaSourceEnabled:(BOOL)flag;
425 - (BOOL)mediaSourceEnabled;
426
427 - (void)setShouldConvertPositionStyleOnCopy:(BOOL)flag;
428 - (BOOL)shouldConvertPositionStyleOnCopy;
429
430 - (void)setImageControlsEnabled:(BOOL)flag;
431 - (BOOL)imageControlsEnabled;
432
433 - (void)setServiceControlsEnabled:(BOOL)flag;
434 - (BOOL)serviceControlsEnabled;
435
436 - (void)setGamepadsEnabled:(BOOL)flag;
437 - (BOOL)gamepadsEnabled;
438
439 - (void)setMediaKeysStorageDirectory:(NSString *)directory;
440 - (NSString *)mediaKeysStorageDirectory;
441
442 - (void)setAntialiasedFontDilationEnabled:(BOOL)flag;
443 - (BOOL)antialiasedFontDilationEnabled;
444
445 - (void)setMetaRefreshEnabled:(BOOL)flag;
446 - (BOOL)metaRefreshEnabled;
447
448 @property (nonatomic) BOOL javaScriptMarkupEnabled;
449
450 #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
451 - (void)_setAllowCompositingLayerVisualDegradation:(BOOL)flag;
452 #endif
453
454 @end