2009-03-26 Jungshik Shin <jshin@chromium.org>
[WebKit-https.git] / WebKit / mac / WebView / WebPreferencesPrivate.h
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)offlineWebApplicationCacheEnabled;
87 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
88
89 - (BOOL)databasesEnabled;
90 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
91
92 - (BOOL)localStorageEnabled;
93 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
94
95 - (BOOL)isWebSecurityEnabled;
96 - (void)setWebSecurityEnabled:(BOOL)flag;
97
98 - (BOOL)allowUniversalAccessFromFileURLs;
99 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
100
101 - (BOOL)zoomsTextOnly;
102 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
103
104 // zero means do AutoScale
105 - (float)PDFScaleFactor;
106 - (void)setPDFScaleFactor:(float)scale;
107
108 - (WebKitEditableLinkBehavior)editableLinkBehavior;
109 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
110
111 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
112 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
113
114 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
115 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
116 // the future when there's no more need for it.
117 - (BOOL)_useSiteSpecificSpoofing;
118 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
119
120 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
121 - (BOOL)isDOMPasteAllowed;
122 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
123
124 - (NSString *)_ftpDirectoryTemplatePath;
125 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
126 - (void)_setForceFTPDirectoryListings:(BOOL)force;
127 - (BOOL)_forceFTPDirectoryListings;
128 - (NSString *)_localStorageDatabasePath;
129 - (void)_setLocalStorageDatabasePath:(NSString *)path;
130
131 // Other private methods
132 - (void)_postPreferencesChangesNotification;
133 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
134 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
135 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
136 - (NSTimeInterval)_backForwardCacheExpirationInterval;
137 + (CFStringEncoding)_systemCFStringEncoding;
138 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
139 + (void)_setIBCreatorID:(NSString *)string;
140
141 // For WebView's use only.
142 - (void)willAddToWebView;
143 - (void)didRemoveFromWebView;
144
145 // Force document tear down at application quit
146 - (void)setFullDocumentTeardownEnabled:(BOOL)fullDocumentTeardownEnabled;
147 - (BOOL)fullDocumentTeardownEnabled;
148 @end