2 * Copyright (C) 2005, 2007 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 } WebKitEditingBehavior;
51 extern NSString *WebPreferencesChangedNotification;
52 extern NSString *WebPreferencesRemovedNotification;
54 @interface WebPreferences (WebPrivate)
56 // Preferences that might be public in a future release
58 - (BOOL)isDNSPrefetchingEnabled;
59 - (void)setDNSPrefetchingEnabled:(BOOL)flag;
61 - (BOOL)developerExtrasEnabled;
62 - (void)setDeveloperExtrasEnabled:(BOOL)flag;
64 - (BOOL)authorAndUserStylesEnabled;
65 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
67 - (BOOL)applicationChromeModeEnabled;
68 - (void)setApplicationChromeModeEnabled:(BOOL)flag;
70 - (BOOL)usesEncodingDetector;
71 - (void)setUsesEncodingDetector:(BOOL)flag;
73 - (BOOL)respectStandardStyleKeyEquivalents;
74 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
76 - (BOOL)showsURLsInToolTips;
77 - (void)setShowsURLsInToolTips:(BOOL)flag;
79 - (BOOL)textAreasAreResizable;
80 - (void)setTextAreasAreResizable:(BOOL)flag;
82 - (PDFDisplayMode)PDFDisplayMode;
83 - (void)setPDFDisplayMode:(PDFDisplayMode)mode;
85 - (BOOL)shrinksStandaloneImagesToFit;
86 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag;
88 - (BOOL)automaticallyDetectsCacheModel;
89 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
91 - (BOOL)webArchiveDebugModeEnabled;
92 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
94 - (BOOL)localFileContentSniffingEnabled;
95 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled;
97 - (BOOL)offlineWebApplicationCacheEnabled;
98 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
100 - (BOOL)databasesEnabled;
101 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
103 - (BOOL)localStorageEnabled;
104 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
106 - (BOOL)isWebSecurityEnabled;
107 - (void)setWebSecurityEnabled:(BOOL)flag;
109 - (BOOL)allowUniversalAccessFromFileURLs;
110 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
112 - (BOOL)allowFileAccessFromFileURLs;
113 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag;
115 - (BOOL)zoomsTextOnly;
116 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
118 - (BOOL)javaScriptCanAccessClipboard;
119 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag;
121 - (BOOL)isXSSAuditorEnabled;
122 - (void)setXSSAuditorEnabled:(BOOL)flag;
124 - (BOOL)experimentalNotificationsEnabled;
125 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled;
127 - (unsigned)pluginAllowedRunTime;
128 - (void)setPluginAllowedRunTime:(unsigned)allowedRunTime;
130 - (BOOL)isFrameFlatteningEnabled;
131 - (void)setFrameFlatteningEnabled:(BOOL)flag;
133 - (BOOL)isSpatialNavigationEnabled;
134 - (void)setSpatialNavigationEnabled:(BOOL)flag;
136 // zero means do AutoScale
137 - (float)PDFScaleFactor;
138 - (void)setPDFScaleFactor:(float)scale;
140 - (int64_t)applicationCacheTotalQuota;
141 - (void)setApplicationCacheTotalQuota:(int64_t)quota;
143 - (int64_t)applicationCacheDefaultOriginQuota;
144 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota;
146 - (WebKitEditableLinkBehavior)editableLinkBehavior;
147 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
149 - (WebKitEditingBehavior)editingBehavior;
150 - (void)setEditingBehavior:(WebKitEditingBehavior)behavior;
152 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
153 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
155 // Used to set preference specified in the test via LayoutTestController.overridePreference(..).
156 // For use with DumpRenderTree only.
157 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key;
159 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
160 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
161 // the future when there's no more need for it.
162 - (BOOL)_useSiteSpecificSpoofing;
163 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
165 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
166 - (BOOL)isDOMPasteAllowed;
167 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
169 - (NSString *)_ftpDirectoryTemplatePath;
170 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
172 - (void)_setForceFTPDirectoryListings:(BOOL)force;
173 - (BOOL)_forceFTPDirectoryListings;
175 - (NSString *)_localStorageDatabasePath;
176 - (void)_setLocalStorageDatabasePath:(NSString *)path;
178 - (BOOL)acceleratedCompositingEnabled;
179 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
181 - (BOOL)showDebugBorders;
182 - (void)setShowDebugBorders:(BOOL)show;
184 - (BOOL)showRepaintCounter;
185 - (void)setShowRepaintCounter:(BOOL)show;
187 - (BOOL)webGLEnabled;
188 - (void)setWebGLEnabled:(BOOL)enabled;
190 - (BOOL)accelerated2dCanvasEnabled;
191 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
193 - (BOOL)paginateDuringLayoutEnabled;
194 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
196 - (BOOL)memoryInfoEnabled;
197 - (void)setMemoryInfoEnabled:(BOOL)enabled;
199 - (BOOL)hyperlinkAuditingEnabled;
200 - (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
202 // Other private methods
203 - (void)_postPreferencesChangesNotification;
204 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
205 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
206 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
207 - (NSTimeInterval)_backForwardCacheExpirationInterval;
208 + (CFStringEncoding)_systemCFStringEncoding;
209 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
210 + (void)_setIBCreatorID:(NSString *)string;
212 + (void)setWebKitLinkTimeVersion:(int)version;
214 // For WebView's use only.
215 - (void)willAddToWebView;
216 - (void)didRemoveFromWebView;
218 // Full screen support is dependent on WebCore/WebKit being
219 // compiled with ENABLE_FULLSCREEN_API.
220 - (void)setFullScreenEnabled:(BOOL)flag;
221 - (BOOL)fullScreenEnabled;
223 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
224 - (BOOL)usePreHTML5ParserQuirks;