• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 extern NSString *WebPreferencesChangedNotification;
47 extern NSString *WebPreferencesRemovedNotification;
48 
49 @interface WebPreferences (WebPrivate)
50 
51 // Preferences that might be public in a future release
52 
53 - (BOOL)developerExtrasEnabled;
54 - (void)setDeveloperExtrasEnabled:(BOOL)flag;
55 
56 - (BOOL)authorAndUserStylesEnabled;
57 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
58 
59 - (BOOL)applicationChromeModeEnabled;
60 - (void)setApplicationChromeModeEnabled:(BOOL)flag;
61 
62 - (BOOL)usesEncodingDetector;
63 - (void)setUsesEncodingDetector:(BOOL)flag;
64 
65 - (BOOL)respectStandardStyleKeyEquivalents;
66 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
67 
68 - (BOOL)showsURLsInToolTips;
69 - (void)setShowsURLsInToolTips:(BOOL)flag;
70 
71 - (BOOL)textAreasAreResizable;
72 - (void)setTextAreasAreResizable:(BOOL)flag;
73 
74 - (PDFDisplayMode)PDFDisplayMode;
75 - (void)setPDFDisplayMode:(PDFDisplayMode)mode;
76 
77 - (BOOL)shrinksStandaloneImagesToFit;
78 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag;
79 
80 - (BOOL)automaticallyDetectsCacheModel;
81 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
82 
83 - (BOOL)webArchiveDebugModeEnabled;
84 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
85 
86 - (BOOL)localFileContentSniffingEnabled;
87 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled;
88 
89 - (BOOL)offlineWebApplicationCacheEnabled;
90 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
91 
92 - (BOOL)databasesEnabled;
93 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
94 
95 - (BOOL)localStorageEnabled;
96 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
97 
98 - (BOOL)isWebSecurityEnabled;
99 - (void)setWebSecurityEnabled:(BOOL)flag;
100 
101 - (BOOL)allowUniversalAccessFromFileURLs;
102 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
103 
104 - (BOOL)zoomsTextOnly;
105 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
106 
107 - (BOOL)isXSSAuditorEnabled;
108 - (void)setXSSAuditorEnabled:(BOOL)flag;
109 
110 - (BOOL)experimentalNotificationsEnabled;
111 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled;
112 
113 - (unsigned)pluginAllowedRunTime;
114 - (void)setPluginAllowedRunTime:(unsigned)allowedRunTime;
115 
116 - (BOOL)isFrameSetFlatteningEnabled;
117 - (void)setFrameSetFlatteningEnabled:(BOOL)flag;
118 
119 // zero means do AutoScale
120 - (float)PDFScaleFactor;
121 - (void)setPDFScaleFactor:(float)scale;
122 
123 - (WebKitEditableLinkBehavior)editableLinkBehavior;
124 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
125 
126 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
127 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
128 
129 // Used to set preference specified in the test via LayoutTestController.overridePreference(..).
130 // For use with DumpRenderTree only.
131 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key;
132 
133 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
134 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
135 // the future when there's no more need for it.
136 - (BOOL)_useSiteSpecificSpoofing;
137 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
138 
139 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
140 - (BOOL)isDOMPasteAllowed;
141 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
142 
143 - (NSString *)_ftpDirectoryTemplatePath;
144 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
145 
146 - (void)_setForceFTPDirectoryListings:(BOOL)force;
147 - (BOOL)_forceFTPDirectoryListings;
148 
149 - (NSString *)_localStorageDatabasePath;
150 - (void)_setLocalStorageDatabasePath:(NSString *)path;
151 
152 - (BOOL)acceleratedCompositingEnabled;
153 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
154 
155 - (BOOL)showDebugBorders;
156 - (void)setShowDebugBorders:(BOOL)show;
157 
158 - (BOOL)showRepaintCounter;
159 - (void)setShowRepaintCounter:(BOOL)show;
160 
161 - (BOOL)webGLEnabled;
162 - (void)setWebGLEnabled:(BOOL)enabled;
163 
164 - (BOOL)usesProxiedOpenPanel;
165 - (void)setUsesProxiedOpenPanel:(BOOL)enabled;
166 
167 // Other private methods
168 - (void)_postPreferencesChangesNotification;
169 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
170 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
171 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
172 - (NSTimeInterval)_backForwardCacheExpirationInterval;
173 + (CFStringEncoding)_systemCFStringEncoding;
174 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
175 + (void)_setIBCreatorID:(NSString *)string;
176 
177 // For WebView's use only.
178 - (void)willAddToWebView;
179 - (void)didRemoveFromWebView;
180 @end
181