• 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 // zero means do AutoScale
111 - (float)PDFScaleFactor;
112 - (void)setPDFScaleFactor:(float)scale;
113 
114 - (WebKitEditableLinkBehavior)editableLinkBehavior;
115 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
116 
117 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
118 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
119 
120 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
121 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
122 // the future when there's no more need for it.
123 - (BOOL)_useSiteSpecificSpoofing;
124 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
125 
126 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
127 - (BOOL)isDOMPasteAllowed;
128 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
129 
130 - (NSString *)_ftpDirectoryTemplatePath;
131 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
132 
133 - (void)_setForceFTPDirectoryListings:(BOOL)force;
134 - (BOOL)_forceFTPDirectoryListings;
135 
136 - (NSString *)_localStorageDatabasePath;
137 - (void)_setLocalStorageDatabasePath:(NSString *)path;
138 
139 - (BOOL)acceleratedCompositingEnabled;
140 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
141 
142 // Other private methods
143 - (void)_postPreferencesChangesNotification;
144 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
145 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
146 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
147 - (NSTimeInterval)_backForwardCacheExpirationInterval;
148 + (CFStringEncoding)_systemCFStringEncoding;
149 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
150 + (void)_setIBCreatorID:(NSString *)string;
151 
152 // For WebView's use only.
153 - (void)willAddToWebView;
154 - (void)didRemoveFromWebView;
155 @end
156