2 * Copyright (C) 2005, 2007, 2011 Apple Computer, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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 Computer, 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.
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.
29 #import <WebKit/WebPreferences.h>
30 #import <Quartz/Quartz.h>
33 WebKitEditableLinkDefaultBehavior,
34 WebKitEditableLinkAlwaysLive,
35 WebKitEditableLinkOnlyLiveWithShiftKey,
36 WebKitEditableLinkLiveWhenNotFocused,
37 WebKitEditableLinkNeverLive
38 } WebKitEditableLinkBehavior;
41 WebTextDirectionSubmenuNeverIncluded,
42 WebTextDirectionSubmenuAutomaticallyIncluded,
43 WebTextDirectionSubmenuAlwaysIncluded
44 } WebTextDirectionSubmenuInclusionBehavior;
47 WebKitEditingMacBehavior,
48 WebKitEditingWinBehavior,
49 WebKitEditingUnixBehavior
50 } WebKitEditingBehavior;
52 extern NSString *WebPreferencesChangedNotification;
53 extern NSString *WebPreferencesRemovedNotification;
54 extern NSString *WebPreferencesChangedInternalNotification;
56 @interface WebPreferences (WebPrivate)
58 // Preferences that might be public in a future release
60 - (BOOL)isDNSPrefetchingEnabled;
61 - (void)setDNSPrefetchingEnabled:(BOOL)flag;
63 - (BOOL)developerExtrasEnabled;
64 - (void)setDeveloperExtrasEnabled:(BOOL)flag;
66 - (BOOL)authorAndUserStylesEnabled;
67 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
69 - (BOOL)applicationChromeModeEnabled;
70 - (void)setApplicationChromeModeEnabled:(BOOL)flag;
72 - (BOOL)usesEncodingDetector;
73 - (void)setUsesEncodingDetector:(BOOL)flag;
75 - (BOOL)respectStandardStyleKeyEquivalents;
76 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
78 - (BOOL)showsURLsInToolTips;
79 - (void)setShowsURLsInToolTips:(BOOL)flag;
81 - (BOOL)showsToolTipOverTruncatedText;
82 - (void)setShowsToolTipOverTruncatedText:(BOOL)flag;
84 - (BOOL)textAreasAreResizable;
85 - (void)setTextAreasAreResizable:(BOOL)flag;
87 - (PDFDisplayMode)PDFDisplayMode;
88 - (void)setPDFDisplayMode:(PDFDisplayMode)mode;
90 - (BOOL)shrinksStandaloneImagesToFit;
91 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag;
93 - (BOOL)automaticallyDetectsCacheModel;
94 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
96 - (BOOL)webArchiveDebugModeEnabled;
97 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
99 - (BOOL)localFileContentSniffingEnabled;
100 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled;
102 - (BOOL)offlineWebApplicationCacheEnabled;
103 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
105 - (BOOL)databasesEnabled;
106 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
108 - (BOOL)localStorageEnabled;
109 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
111 - (BOOL)isWebSecurityEnabled;
112 - (void)setWebSecurityEnabled:(BOOL)flag;
114 - (BOOL)allowUniversalAccessFromFileURLs;
115 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
117 - (BOOL)allowFileAccessFromFileURLs;
118 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag;
120 - (BOOL)zoomsTextOnly;
121 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
123 - (BOOL)javaScriptCanAccessClipboard;
124 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag;
126 - (BOOL)isXSSAuditorEnabled;
127 - (void)setXSSAuditorEnabled:(BOOL)flag;
129 - (BOOL)experimentalNotificationsEnabled;
130 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled;
132 - (BOOL)isFrameFlatteningEnabled;
133 - (void)setFrameFlatteningEnabled:(BOOL)flag;
135 - (BOOL)isSpatialNavigationEnabled;
136 - (void)setSpatialNavigationEnabled:(BOOL)flag;
138 // zero means do AutoScale
139 - (float)PDFScaleFactor;
140 - (void)setPDFScaleFactor:(float)scale;
142 - (int64_t)applicationCacheTotalQuota;
143 - (void)setApplicationCacheTotalQuota:(int64_t)quota;
145 - (int64_t)applicationCacheDefaultOriginQuota;
146 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota;
148 - (WebKitEditableLinkBehavior)editableLinkBehavior;
149 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
151 - (WebKitEditingBehavior)editingBehavior;
152 - (void)setEditingBehavior:(WebKitEditingBehavior)behavior;
154 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
155 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
157 // Used to set preference specified in the test via LayoutTestController.overridePreference(..).
158 // For use with DumpRenderTree only.
159 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key;
161 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
162 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
163 // the future when there's no more need for it.
164 - (BOOL)_useSiteSpecificSpoofing;
165 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
167 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
168 - (BOOL)isDOMPasteAllowed;
169 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
171 - (NSString *)_ftpDirectoryTemplatePath;
172 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
174 - (void)_setForceFTPDirectoryListings:(BOOL)force;
175 - (BOOL)_forceFTPDirectoryListings;
177 - (NSString *)_localStorageDatabasePath;
178 - (void)_setLocalStorageDatabasePath:(NSString *)path;
180 - (BOOL)acceleratedDrawingEnabled;
181 - (void)setAcceleratedDrawingEnabled:(BOOL)enabled;
183 - (BOOL)canvasUsesAcceleratedDrawing;
184 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled;
186 - (BOOL)acceleratedCompositingEnabled;
187 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
189 - (BOOL)showDebugBorders;
190 - (void)setShowDebugBorders:(BOOL)show;
192 - (BOOL)showRepaintCounter;
193 - (void)setShowRepaintCounter:(BOOL)show;
195 - (BOOL)webAudioEnabled;
196 - (void)setWebAudioEnabled:(BOOL)enabled;
198 - (BOOL)webGLEnabled;
199 - (void)setWebGLEnabled:(BOOL)enabled;
201 - (BOOL)accelerated2dCanvasEnabled;
202 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
204 - (BOOL)paginateDuringLayoutEnabled;
205 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
207 - (BOOL)memoryInfoEnabled;
208 - (void)setMemoryInfoEnabled:(BOOL)enabled;
210 - (BOOL)hyperlinkAuditingEnabled;
211 - (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
213 - (void)setMediaPlaybackRequiresUserGesture:(BOOL)flag;
214 - (BOOL)mediaPlaybackRequiresUserGesture;
216 - (void)setMediaPlaybackAllowsInline:(BOOL)flag;
217 - (BOOL)mediaPlaybackAllowsInline;
219 - (NSString *)pictographFontFamily;
220 - (void)setPictographFontFamily:(NSString *)family;
222 // This is a global setting.
223 - (BOOL)mockScrollbarsEnabled;
224 - (void)setMockScrollbarsEnabled:(BOOL)flag;
226 // Other private methods
227 - (void)_postPreferencesChangedNotification;
228 - (void)_postPreferencesChangedAPINotification;
229 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
230 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
231 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
232 - (NSTimeInterval)_backForwardCacheExpirationInterval;
233 + (CFStringEncoding)_systemCFStringEncoding;
234 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
235 + (void)_setIBCreatorID:(NSString *)string;
236 + (void)_switchNetworkLoaderToNewTestingSession;
237 + (void)_setCurrentNetworkLoaderSessionCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)cookieAcceptPolicy;
239 + (void)setWebKitLinkTimeVersion:(int)version;
241 // For WebView's use only.
242 - (void)willAddToWebView;
243 - (void)didRemoveFromWebView;
245 // Full screen support is dependent on WebCore/WebKit being
246 // compiled with ENABLE_FULLSCREEN_API.
247 - (void)setFullScreenEnabled:(BOOL)flag;
248 - (BOOL)fullScreenEnabled;
250 - (void)setAsynchronousSpellCheckingEnabled:(BOOL)flag;
251 - (BOOL)asynchronousSpellCheckingEnabled;
253 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
254 - (BOOL)usePreHTML5ParserQuirks;
256 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag;
257 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
259 // AVFoundation support is dependent on WebCore/WebKit being
260 // compiled with USE_AVFOUNDATION.
261 - (void)setAVFoundationEnabled:(BOOL)flag;
262 - (BOOL)isAVFoundationEnabled;
264 // WebSocket support depends on ENABLE(WEB_SOCKETS).
265 - (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag;
266 - (BOOL)isHixie76WebSocketProtocolEnabled;
268 - (void)setSuppressIncrementalRendering:(BOOL)flag;
269 - (BOOL)suppressIncrementalRendering;
271 - (void)setBackspaceKeyNavigationEnabled:(BOOL)flag;
272 - (BOOL)backspaceKeyNavigationEnabled;