Add a WebKit1 preference for selection services
[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 extern NSString *WebPreferencesChangedNotification;
56 extern NSString *WebPreferencesRemovedNotification;
57 extern NSString *WebPreferencesChangedInternalNotification;
58 extern NSString *WebPreferencesCacheModelChangedInternalNotification;
59
60 @interface WebPreferences (WebPrivate)
61
62 // Preferences that might be public in a future release
63
64 - (BOOL)isDNSPrefetchingEnabled;
65 - (void)setDNSPrefetchingEnabled:(BOOL)flag;
66
67 - (BOOL)developerExtrasEnabled;
68 - (void)setDeveloperExtrasEnabled:(BOOL)flag;
69
70 - (BOOL)javaScriptExperimentsEnabled;
71 - (void)setJavaScriptExperimentsEnabled:(BOOL)flag;
72
73 - (BOOL)authorAndUserStylesEnabled;
74 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
75
76 - (BOOL)applicationChromeModeEnabled;
77 - (void)setApplicationChromeModeEnabled:(BOOL)flag;
78
79 - (BOOL)usesEncodingDetector;
80 - (void)setUsesEncodingDetector:(BOOL)flag;
81
82 #if !TARGET_OS_IPHONE
83 - (BOOL)respectStandardStyleKeyEquivalents;
84 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
85
86 - (BOOL)showsURLsInToolTips;
87 - (void)setShowsURLsInToolTips:(BOOL)flag;
88
89 - (BOOL)showsToolTipOverTruncatedText;
90 - (void)setShowsToolTipOverTruncatedText:(BOOL)flag;
91
92 - (BOOL)textAreasAreResizable;
93 - (void)setTextAreasAreResizable:(BOOL)flag;
94
95 - (PDFDisplayMode)PDFDisplayMode;
96 - (void)setPDFDisplayMode:(PDFDisplayMode)mode;
97 #endif
98
99 - (BOOL)shrinksStandaloneImagesToFit;
100 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag;
101
102 - (BOOL)automaticallyDetectsCacheModel;
103 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
104
105 - (BOOL)webArchiveDebugModeEnabled;
106 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
107
108 - (BOOL)localFileContentSniffingEnabled;
109 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled;
110
111 - (BOOL)offlineWebApplicationCacheEnabled;
112 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
113
114 - (BOOL)databasesEnabled;
115 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
116
117 #if TARGET_OS_IPHONE
118 - (BOOL)storageTrackerEnabled;
119 - (void)setStorageTrackerEnabled:(BOOL)storageTrackerEnabled;
120 #endif
121
122 - (BOOL)localStorageEnabled;
123 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
124
125 - (BOOL)isWebSecurityEnabled;
126 - (void)setWebSecurityEnabled:(BOOL)flag;
127
128 - (BOOL)allowUniversalAccessFromFileURLs;
129 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
130
131 - (BOOL)allowFileAccessFromFileURLs;
132 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag;
133
134 - (BOOL)zoomsTextOnly;
135 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
136
137 - (BOOL)javaScriptCanAccessClipboard;
138 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag;
139
140 - (BOOL)isXSSAuditorEnabled;
141 - (void)setXSSAuditorEnabled:(BOOL)flag;
142
143 - (BOOL)experimentalNotificationsEnabled;
144 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled;
145
146 - (BOOL)isFrameFlatteningEnabled;
147 - (void)setFrameFlatteningEnabled:(BOOL)flag;
148
149 - (BOOL)isSpatialNavigationEnabled;
150 - (void)setSpatialNavigationEnabled:(BOOL)flag;
151
152 #if !TARGET_OS_IPHONE
153 // zero means do AutoScale
154 - (float)PDFScaleFactor;
155 - (void)setPDFScaleFactor:(float)scale;
156 #endif
157
158 - (int64_t)applicationCacheTotalQuota;
159 - (void)setApplicationCacheTotalQuota:(int64_t)quota;
160
161 - (int64_t)applicationCacheDefaultOriginQuota;
162 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota;
163
164 - (WebKitEditableLinkBehavior)editableLinkBehavior;
165 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
166
167 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
168 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
169
170 // Used to set preference specified in the test via LayoutTestController.overridePreference(..).
171 // For use with DumpRenderTree only.
172 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key;
173
174 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
175 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
176 // the future when there's no more need for it.
177 - (BOOL)_useSiteSpecificSpoofing;
178 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
179
180 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
181 - (BOOL)isDOMPasteAllowed;
182 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
183
184 - (NSString *)_ftpDirectoryTemplatePath;
185 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
186
187 - (void)_setForceFTPDirectoryListings:(BOOL)force;
188 - (BOOL)_forceFTPDirectoryListings;
189
190 - (NSString *)_localStorageDatabasePath;
191 - (void)_setLocalStorageDatabasePath:(NSString *)path;
192
193 - (BOOL)acceleratedDrawingEnabled;
194 - (void)setAcceleratedDrawingEnabled:(BOOL)enabled;
195
196 - (BOOL)canvasUsesAcceleratedDrawing;
197 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled;
198
199 - (BOOL)acceleratedCompositingEnabled;
200 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
201
202 - (BOOL)cssRegionsEnabled;
203 - (void)setCSSRegionsEnabled:(BOOL)enabled;
204
205 - (BOOL)cssCompositingEnabled;
206 - (void)setCSSCompositingEnabled:(BOOL)enabled;
207
208 - (BOOL)showDebugBorders;
209 - (void)setShowDebugBorders:(BOOL)show;
210
211 - (BOOL)showRepaintCounter;
212 - (void)setShowRepaintCounter:(BOOL)show;
213
214 - (BOOL)webAudioEnabled;
215 - (void)setWebAudioEnabled:(BOOL)enabled;
216
217 - (BOOL)subpixelCSSOMElementMetricsEnabled;
218 - (void)setSubpixelCSSOMElementMetricsEnabled:(BOOL)enabled;
219
220 - (BOOL)webGLEnabled;
221 - (void)setWebGLEnabled:(BOOL)enabled;
222
223 - (BOOL)forceSoftwareWebGLRendering;
224 - (void)setForceSoftwareWebGLRendering:(BOOL)forced;
225
226 - (BOOL)accelerated2dCanvasEnabled;
227 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
228
229 - (BOOL)paginateDuringLayoutEnabled;
230 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
231
232 - (BOOL)hyperlinkAuditingEnabled;
233 - (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
234
235 - (void)setMediaPlaybackRequiresUserGesture:(BOOL)flag;
236 - (BOOL)mediaPlaybackRequiresUserGesture;
237
238 - (void)setMediaPlaybackAllowsInline:(BOOL)flag;
239 - (BOOL)mediaPlaybackAllowsInline;
240
241 - (NSString *)pictographFontFamily;
242 - (void)setPictographFontFamily:(NSString *)family;
243
244 - (BOOL)pageCacheSupportsPlugins;
245 - (void)setPageCacheSupportsPlugins:(BOOL)flag;
246
247 // This is a global setting.
248 - (BOOL)mockScrollbarsEnabled;
249 - (void)setMockScrollbarsEnabled:(BOOL)flag;
250
251 #if TARGET_OS_IPHONE
252 // This is a global setting.
253 - (unsigned)audioSessionCategoryOverride;
254 - (void)setAudioSessionCategoryOverride:(unsigned)override;
255
256 - (BOOL)avKitEnabled;
257 - (void)setAVKitEnabled:(bool)flag;
258
259 // WARNING: this affect network performance. This must not be enabled for production use.
260 // Enabling this makes WebCore reports the network data usage.
261 // This is a global setting.
262 - (void)setNetworkDataUsageTrackingEnabled:(bool)trackingEnabled;
263 - (BOOL)networkDataUsageTrackingEnabled;
264
265 - (void)setNetworkInterfaceName:(NSString *)name;
266 - (NSString *)networkInterfaceName;
267
268 - (void)_setMinimumZoomFontSize:(float)size;
269 - (float)_minimumZoomFontSize;
270
271 // Deprecated. Has no effect.
272 - (void)setDiskImageCacheEnabled:(BOOL)enabled;
273
274 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag;
275 - (BOOL)mediaPlaybackAllowsAirPlay;
276 #endif
277
278 - (BOOL)isInheritURIQueryComponentEnabled;
279 - (void)setEnableInheritURIQueryComponent:(BOOL)flag;
280
281 // Other private methods
282 #if TARGET_OS_IPHONE
283 - (BOOL)_standalone;
284 - (void)_setStandalone:(BOOL)flag;
285 - (void)_setTelephoneNumberParsingEnabled:(BOOL)flag;
286 - (BOOL)_telephoneNumberParsingEnabled;
287 - (void)_setAlwaysUseBaselineOfPrimaryFont:(BOOL)flag;
288 - (BOOL)_alwaysUseBaselineOfPrimaryFont;
289 - (void)_setAllowMultiElementImplicitFormSubmission:(BOOL)flag;
290 - (BOOL)_allowMultiElementImplicitFormSubmission;
291 - (void)_setAlwaysRequestGeolocationPermission:(BOOL)flag;
292 - (BOOL)_alwaysRequestGeolocationPermission;
293 - (void)_setAlwaysUseAcceleratedOverflowScroll:(BOOL)flag;
294 - (BOOL)_alwaysUseAcceleratedOverflowScroll;
295 - (void)_setLayoutInterval:(int)l;
296 - (int)_layoutInterval;
297 - (void)_setMaxParseDuration:(float)d;
298 - (float)_maxParseDuration;
299 - (void)_setInterpolationQuality:(int)quality;
300 - (int)_interpolationQuality;
301 - (BOOL)_allowPasswordEcho;
302 - (float)_passwordEchoDuration;
303 #endif
304 - (void)_postPreferencesChangedNotification;
305 - (void)_postPreferencesChangedAPINotification;
306 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
307 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
308 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
309 - (NSTimeInterval)_backForwardCacheExpirationInterval;
310 + (CFStringEncoding)_systemCFStringEncoding;
311 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
312 + (void)_setIBCreatorID:(NSString *)string;
313
314 // For DumpRenderTree use only.
315 + (void)_switchNetworkLoaderToNewTestingSession;
316 + (void)_setCurrentNetworkLoaderSessionCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)cookieAcceptPolicy;
317
318 + (void)setWebKitLinkTimeVersion:(int)version;
319
320 // For WebView's use only.
321 - (void)willAddToWebView;
322 - (void)didRemoveFromWebView;
323
324 // Full screen support is dependent on WebCore/WebKit being
325 // compiled with ENABLE_FULLSCREEN_API. 
326 - (void)setFullScreenEnabled:(BOOL)flag;
327 - (BOOL)fullScreenEnabled;
328
329 - (void)setAsynchronousSpellCheckingEnabled:(BOOL)flag;
330 - (BOOL)asynchronousSpellCheckingEnabled;
331
332 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
333 - (BOOL)usePreHTML5ParserQuirks;
334
335 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag;
336 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
337
338 // AVFoundation support is dependent on WebCore/WebKit being
339 // compiled with USE_AVFOUNDATION.
340 - (void)setAVFoundationEnabled:(BOOL)flag;
341 - (BOOL)isAVFoundationEnabled;
342
343 - (void)setQTKitEnabled:(BOOL)flag;
344 - (BOOL)isQTKitEnabled;
345
346 // Deprecated, has no effect.
347 - (void)setVideoPluginProxyEnabled:(BOOL)flag;
348 - (BOOL)isVideoPluginProxyEnabled;
349
350 // WebSocket support depends on ENABLE(WEB_SOCKETS).
351 - (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag;
352 - (BOOL)isHixie76WebSocketProtocolEnabled;
353
354 #if TARGET_OS_IPHONE
355 - (void)_invalidateCachedPreferences;
356 - (void)_synchronizeWebStoragePolicyWithCookiePolicy;
357 #endif
358
359 - (void)setBackspaceKeyNavigationEnabled:(BOOL)flag;
360 - (BOOL)backspaceKeyNavigationEnabled;
361
362 - (void)setWantsBalancedSetDefersLoadingBehavior:(BOOL)flag;
363 - (BOOL)wantsBalancedSetDefersLoadingBehavior;
364
365 - (void)setShouldDisplaySubtitles:(BOOL)flag;
366 - (BOOL)shouldDisplaySubtitles;
367
368 - (void)setShouldDisplayCaptions:(BOOL)flag;
369 - (BOOL)shouldDisplayCaptions;
370
371 - (void)setShouldDisplayTextDescriptions:(BOOL)flag;
372 - (BOOL)shouldDisplayTextDescriptions;
373
374 - (void)setNotificationsEnabled:(BOOL)flag;
375 - (BOOL)notificationsEnabled;
376
377 - (void)setShouldRespectImageOrientation:(BOOL)flag;
378 - (BOOL)shouldRespectImageOrientation;
379
380 - (BOOL)requestAnimationFrameEnabled;
381 - (void)setRequestAnimationFrameEnabled:(BOOL)enabled;
382
383 - (void)setIncrementalRenderingSuppressionTimeoutInSeconds:(NSTimeInterval)timeout;
384 - (NSTimeInterval)incrementalRenderingSuppressionTimeoutInSeconds;
385
386 - (BOOL)diagnosticLoggingEnabled;
387 - (void)setDiagnosticLoggingEnabled:(BOOL)enabled;
388
389 - (BOOL)screenFontSubstitutionEnabled;
390 - (void)setScreenFontSubstitutionEnabled:(BOOL)enabled;
391
392 - (void)setStorageBlockingPolicy:(WebStorageBlockingPolicy)storageBlockingPolicy;
393 - (WebStorageBlockingPolicy)storageBlockingPolicy;
394
395 - (BOOL)plugInSnapshottingEnabled;
396 - (void)setPlugInSnapshottingEnabled:(BOOL)enabled;
397
398 - (BOOL)hiddenPageDOMTimerThrottlingEnabled;
399 - (void)setHiddenPageDOMTimerThrottlingEnabled:(BOOL)flag;
400
401 - (BOOL)hiddenPageCSSAnimationSuspensionEnabled;
402 - (void)setHiddenPageCSSAnimationSuspensionEnabled:(BOOL)flag;
403
404 - (BOOL)lowPowerVideoAudioBufferSizeEnabled;
405 - (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled;
406
407 - (void)setUseLegacyTextAlignPositionedElementBehavior:(BOOL)flag;
408 - (BOOL)useLegacyTextAlignPositionedElementBehavior;
409
410 - (void)setMediaSourceEnabled:(BOOL)flag;
411 - (BOOL)mediaSourceEnabled;
412
413 - (void)setShouldConvertPositionStyleOnCopy:(BOOL)flag;
414 - (BOOL)shouldConvertPositionStyleOnCopy;
415
416 - (void)setImageControlsEnabled:(BOOL)flag;
417 - (BOOL)imageControlsEnabled;
418
419 - (void)setServiceControlsEnabled:(BOOL)flag;
420 - (BOOL)serviceControlsEnabled;
421
422 - (void)setGamepadsEnabled:(BOOL)flag;
423 - (BOOL)gamepadsEnabled;
424
425 #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
426 - (void)_setAllowCompositingLayerVisualDegradation:(BOOL)flag;
427 #endif
428
429 @end