|
1 /* |
|
2 * Copyright (C) 2005, 2007 Apple Computer, 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 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. |
|
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 <WebKit/WebPreferences.h> |
|
30 #import <Quartz/Quartz.h> |
|
31 |
|
32 typedef enum { |
|
33 WebKitEditableLinkDefaultBehavior, |
|
34 WebKitEditableLinkAlwaysLive, |
|
35 WebKitEditableLinkOnlyLiveWithShiftKey, |
|
36 WebKitEditableLinkLiveWhenNotFocused, |
|
37 WebKitEditableLinkNeverLive |
|
38 } WebKitEditableLinkBehavior; |
|
39 |
|
40 typedef enum { |
|
41 WebTextDirectionSubmenuNeverIncluded, |
|
42 WebTextDirectionSubmenuAutomaticallyIncluded, |
|
43 WebTextDirectionSubmenuAlwaysIncluded |
|
44 } WebTextDirectionSubmenuInclusionBehavior; |
|
45 |
|
46 typedef enum { |
|
47 WebKitEditingMacBehavior, |
|
48 WebKitEditingWinBehavior |
|
49 } WebKitEditingBehavior; |
|
50 |
|
51 extern NSString *WebPreferencesChangedNotification; |
|
52 extern NSString *WebPreferencesRemovedNotification; |
|
53 |
|
54 @interface WebPreferences (WebPrivate) |
|
55 |
|
56 // Preferences that might be public in a future release |
|
57 |
|
58 - (BOOL)isDNSPrefetchingEnabled; |
|
59 - (void)setDNSPrefetchingEnabled:(BOOL)flag; |
|
60 |
|
61 - (BOOL)developerExtrasEnabled; |
|
62 - (void)setDeveloperExtrasEnabled:(BOOL)flag; |
|
63 |
|
64 - (BOOL)authorAndUserStylesEnabled; |
|
65 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag; |
|
66 |
|
67 - (BOOL)applicationChromeModeEnabled; |
|
68 - (void)setApplicationChromeModeEnabled:(BOOL)flag; |
|
69 |
|
70 - (BOOL)usesEncodingDetector; |
|
71 - (void)setUsesEncodingDetector:(BOOL)flag; |
|
72 |
|
73 - (BOOL)respectStandardStyleKeyEquivalents; |
|
74 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag; |
|
75 |
|
76 - (BOOL)showsURLsInToolTips; |
|
77 - (void)setShowsURLsInToolTips:(BOOL)flag; |
|
78 |
|
79 - (BOOL)textAreasAreResizable; |
|
80 - (void)setTextAreasAreResizable:(BOOL)flag; |
|
81 |
|
82 - (PDFDisplayMode)PDFDisplayMode; |
|
83 - (void)setPDFDisplayMode:(PDFDisplayMode)mode; |
|
84 |
|
85 - (BOOL)shrinksStandaloneImagesToFit; |
|
86 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag; |
|
87 |
|
88 - (BOOL)automaticallyDetectsCacheModel; |
|
89 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel; |
|
90 |
|
91 - (BOOL)webArchiveDebugModeEnabled; |
|
92 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled; |
|
93 |
|
94 - (BOOL)localFileContentSniffingEnabled; |
|
95 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled; |
|
96 |
|
97 - (BOOL)offlineWebApplicationCacheEnabled; |
|
98 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled; |
|
99 |
|
100 - (BOOL)databasesEnabled; |
|
101 - (void)setDatabasesEnabled:(BOOL)databasesEnabled; |
|
102 |
|
103 - (BOOL)localStorageEnabled; |
|
104 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled; |
|
105 |
|
106 - (BOOL)isWebSecurityEnabled; |
|
107 - (void)setWebSecurityEnabled:(BOOL)flag; |
|
108 |
|
109 - (BOOL)allowUniversalAccessFromFileURLs; |
|
110 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag; |
|
111 |
|
112 - (BOOL)allowFileAccessFromFileURLs; |
|
113 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag; |
|
114 |
|
115 - (BOOL)zoomsTextOnly; |
|
116 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly; |
|
117 |
|
118 - (BOOL)javaScriptCanAccessClipboard; |
|
119 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag; |
|
120 |
|
121 - (BOOL)isXSSAuditorEnabled; |
|
122 - (void)setXSSAuditorEnabled:(BOOL)flag; |
|
123 |
|
124 - (BOOL)experimentalNotificationsEnabled; |
|
125 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled; |
|
126 |
|
127 - (unsigned)pluginAllowedRunTime; |
|
128 - (void)setPluginAllowedRunTime:(unsigned)allowedRunTime; |
|
129 |
|
130 - (BOOL)isFrameFlatteningEnabled; |
|
131 - (void)setFrameFlatteningEnabled:(BOOL)flag; |
|
132 |
|
133 // zero means do AutoScale |
|
134 - (float)PDFScaleFactor; |
|
135 - (void)setPDFScaleFactor:(float)scale; |
|
136 |
|
137 - (WebKitEditableLinkBehavior)editableLinkBehavior; |
|
138 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior; |
|
139 |
|
140 - (WebKitEditingBehavior)editingBehavior; |
|
141 - (void)setEditingBehavior:(WebKitEditingBehavior)behavior; |
|
142 |
|
143 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior; |
|
144 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior; |
|
145 |
|
146 // Used to set preference specified in the test via LayoutTestController.overridePreference(..). |
|
147 // For use with DumpRenderTree only. |
|
148 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key; |
|
149 |
|
150 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be |
|
151 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in |
|
152 // the future when there's no more need for it. |
|
153 - (BOOL)_useSiteSpecificSpoofing; |
|
154 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue; |
|
155 |
|
156 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes. |
|
157 - (BOOL)isDOMPasteAllowed; |
|
158 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed; |
|
159 |
|
160 - (NSString *)_ftpDirectoryTemplatePath; |
|
161 - (void)_setFTPDirectoryTemplatePath:(NSString *)path; |
|
162 |
|
163 - (void)_setForceFTPDirectoryListings:(BOOL)force; |
|
164 - (BOOL)_forceFTPDirectoryListings; |
|
165 |
|
166 - (NSString *)_localStorageDatabasePath; |
|
167 - (void)_setLocalStorageDatabasePath:(NSString *)path; |
|
168 |
|
169 - (BOOL)acceleratedCompositingEnabled; |
|
170 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled; |
|
171 |
|
172 - (BOOL)showDebugBorders; |
|
173 - (void)setShowDebugBorders:(BOOL)show; |
|
174 |
|
175 - (BOOL)showRepaintCounter; |
|
176 - (void)setShowRepaintCounter:(BOOL)show; |
|
177 |
|
178 - (BOOL)webGLEnabled; |
|
179 - (void)setWebGLEnabled:(BOOL)enabled; |
|
180 |
|
181 - (BOOL)html5ParserEnabled; |
|
182 - (void)setHTML5ParserEnabled:(BOOL)flag; |
|
183 |
|
184 // Will be deleted soon, do not use. |
|
185 - (BOOL)html5TreeBuilderEnabled; |
|
186 - (void)setHTML5TreeBuilderEnabled:(BOOL)flag; |
|
187 |
|
188 - (BOOL)paginateDuringLayoutEnabled; |
|
189 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag; |
|
190 |
|
191 - (BOOL)usesProxiedOpenPanel; |
|
192 - (void)setUsesProxiedOpenPanel:(BOOL)enabled; |
|
193 |
|
194 - (BOOL)memoryInfoEnabled; |
|
195 - (void)setMemoryInfoEnabled:(BOOL)enabled; |
|
196 |
|
197 // Other private methods |
|
198 - (void)_postPreferencesChangesNotification; |
|
199 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier; |
|
200 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier; |
|
201 + (void)_removeReferenceForIdentifier:(NSString *)identifier; |
|
202 - (NSTimeInterval)_backForwardCacheExpirationInterval; |
|
203 + (CFStringEncoding)_systemCFStringEncoding; |
|
204 + (void)_setInitialDefaultTextEncodingToSystemEncoding; |
|
205 + (void)_setIBCreatorID:(NSString *)string; |
|
206 |
|
207 // For WebView's use only. |
|
208 - (void)willAddToWebView; |
|
209 - (void)didRemoveFromWebView; |
|
210 @end |