2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
5 * Redistribution and use in source and binary forms, with or without
6 * 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.
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "AtomicString.h"
31 #include "FontDescription.h"
40 enum EditableLinkBehavior
{
41 EditableLinkDefaultBehavior
= 0,
42 EditableLinkAlwaysLive
,
43 EditableLinkOnlyLiveWithShiftKey
,
44 EditableLinkLiveWhenNotFocused
,
48 enum TextDirectionSubmenuInclusionBehavior
{
49 TextDirectionSubmenuNeverIncluded
,
50 TextDirectionSubmenuAutomaticallyIncluded
,
51 TextDirectionSubmenuAlwaysIncluded
58 void setStandardFontFamily(const AtomicString
&);
59 const AtomicString
& standardFontFamily() const { return m_standardFontFamily
; }
61 void setFixedFontFamily(const AtomicString
&);
62 const AtomicString
& fixedFontFamily() const { return m_fixedFontFamily
; }
64 void setSerifFontFamily(const AtomicString
&);
65 const AtomicString
& serifFontFamily() const { return m_serifFontFamily
; }
67 void setSansSerifFontFamily(const AtomicString
&);
68 const AtomicString
& sansSerifFontFamily() const { return m_sansSerifFontFamily
; }
70 void setCursiveFontFamily(const AtomicString
&);
71 const AtomicString
& cursiveFontFamily() const { return m_cursiveFontFamily
; }
73 void setFantasyFontFamily(const AtomicString
&);
74 const AtomicString
& fantasyFontFamily() const { return m_fantasyFontFamily
; }
76 void setMinimumFontSize(int);
77 int minimumFontSize() const { return m_minimumFontSize
; }
79 void setMinimumLogicalFontSize(int);
80 int minimumLogicalFontSize() const { return m_minimumLogicalFontSize
; }
82 void setDefaultFontSize(int);
83 int defaultFontSize() const { return m_defaultFontSize
; }
85 void setDefaultFixedFontSize(int);
86 int defaultFixedFontSize() const { return m_defaultFixedFontSize
; }
88 void setLoadsImagesAutomatically(bool);
89 bool loadsImagesAutomatically() const { return m_loadsImagesAutomatically
; }
91 void setJavaScriptEnabled(bool);
92 bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled
; }
94 void setJavaScriptCanOpenWindowsAutomatically(bool);
95 bool JavaScriptCanOpenWindowsAutomatically() const { return m_javaScriptCanOpenWindowsAutomatically
; }
97 void setJavaEnabled(bool);
98 bool isJavaEnabled() const { return m_isJavaEnabled
; }
100 void setPluginsEnabled(bool);
101 bool arePluginsEnabled() const { return m_arePluginsEnabled
; }
103 void setDatabasesEnabled(bool);
104 bool databasesEnabled() const { return m_databasesEnabled
; }
106 void setLocalStorageEnabled(bool);
107 bool localStorageEnabled() const { return m_localStorageEnabled
; }
109 void setPrivateBrowsingEnabled(bool);
110 bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled
; }
112 void setDefaultTextEncodingName(const String
&);
113 const String
& defaultTextEncodingName() const { return m_defaultTextEncodingName
; }
115 void setUserStyleSheetLocation(const KURL
&);
116 const KURL
& userStyleSheetLocation() const { return m_userStyleSheetLocation
; }
118 void setShouldPrintBackgrounds(bool);
119 bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds
; }
121 void setTextAreasAreResizable(bool);
122 bool textAreasAreResizable() const { return m_textAreasAreResizable
; }
124 void setEditableLinkBehavior(EditableLinkBehavior
);
125 EditableLinkBehavior
editableLinkBehavior() const { return m_editableLinkBehavior
; }
127 void setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior
);
128 TextDirectionSubmenuInclusionBehavior
textDirectionSubmenuInclusionBehavior() const { return m_textDirectionSubmenuInclusionBehavior
; }
130 #if ENABLE(DASHBOARD_SUPPORT)
131 void setUsesDashboardBackwardCompatibilityMode(bool);
132 bool usesDashboardBackwardCompatibilityMode() const { return m_usesDashboardBackwardCompatibilityMode
; }
135 void setNeedsAdobeFrameReloadingQuirk(bool);
136 bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk
; }
138 void setNeedsKeyboardEventDisambiguationQuirks(bool);
139 bool needsKeyboardEventDisambiguationQuirks() const { return m_needsKeyboardEventDisambiguationQuirks
; }
141 void setDOMPasteAllowed(bool);
142 bool isDOMPasteAllowed() const { return m_isDOMPasteAllowed
; }
144 void setUsesPageCache(bool);
145 bool usesPageCache() const { return m_usesPageCache
; }
147 void setShrinksStandaloneImagesToFit(bool);
148 bool shrinksStandaloneImagesToFit() const { return m_shrinksStandaloneImagesToFit
; }
150 void setShowsURLsInToolTips(bool);
151 bool showsURLsInToolTips() const { return m_showsURLsInToolTips
; }
153 void setFTPDirectoryTemplatePath(const String
&);
154 const String
& ftpDirectoryTemplatePath() const { return m_ftpDirectoryTemplatePath
; }
156 void setForceFTPDirectoryListings(bool);
157 bool forceFTPDirectoryListings() const { return m_forceFTPDirectoryListings
; }
159 void setDeveloperExtrasEnabled(bool);
160 bool developerExtrasEnabled() const { return m_developerExtrasEnabled
; }
162 void setFlatFrameSetLayoutEnabled(bool);
163 bool flatFrameSetLayoutEnabled() const { return m_flatFrameSetLayoutEnabled
; }
165 void setStandalone(bool flag
);
166 bool standalone() const { return m_standalone
; }
168 void setMaximumResourceDataLength(long long length
);
169 long long maximumResourceDataLength();
171 void setTelephoneNumberParsingEnabled(bool flag
) { m_telephoneNumberParsingEnabled
= flag
; }
172 bool telephoneNumberParsingEnabled() const { return m_telephoneNumberParsingEnabled
; }
174 void setMinimumZoomFontSize(float size
) { m_minimumZoomFontSize
= size
; }
175 float minimumZoomFontSize() const { return m_minimumZoomFontSize
; }
177 void setLayoutInterval(int t
) { m_layoutInterval
= t
< cLayoutScheduleThreshold
? cLayoutScheduleThreshold
: t
; }
178 int layoutInterval() const { return m_layoutInterval
; }
180 void setMaxParseDuration(double maxParseDuration
) { m_maxParseDuration
= maxParseDuration
; }
181 double maxParseDuration() const { return m_maxParseDuration
; }
183 void setAuthorAndUserStylesEnabled(bool);
184 bool authorAndUserStylesEnabled() const { return m_authorAndUserStylesEnabled
; }
186 void setFontRenderingMode(FontRenderingMode mode
);
187 FontRenderingMode
fontRenderingMode() const;
189 void setNeedsSiteSpecificQuirks(bool);
190 bool needsSiteSpecificQuirks() const { return m_needsSiteSpecificQuirks
; }
192 void setWebArchiveDebugModeEnabled(bool);
193 bool webArchiveDebugModeEnabled() const { return m_webArchiveDebugModeEnabled
; }
195 void setLocalStorageDatabasePath(const String
&);
196 const String
& localStorageDatabasePath() const { return m_localStorageDatabasePath
; }
198 void disableRangeMutationForOldAppleMail(bool);
199 bool rangeMutationDisabledForOldAppleMail() const { return m_rangeMutationDisabledForOldAppleMail
; }
201 void setApplicationChromeMode(bool);
202 bool inApplicationChromeMode() const { return m_inApplicationChromeMode
; }
204 void setOfflineWebApplicationCacheEnabled(bool);
205 bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled
; }
207 void setShouldPaintCustomScrollbars(bool);
208 bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars
; }
210 void setZoomsTextOnly(bool);
211 bool zoomsTextOnly() const { return m_zoomsTextOnly
; }
213 void setEnforceCSSMIMETypeInStrictMode(bool);
214 bool enforceCSSMIMETypeInStrictMode() { return m_enforceCSSMIMETypeInStrictMode
; }
216 void setMaximumDecodedImageSize(size_t size
) { m_maximumDecodedImageSize
= size
; }
217 size_t maximumDecodedImageSize() const { return m_maximumDecodedImageSize
; }
219 #if USE(SAFARI_THEME)
220 // Windows debugging pref (global) for switching between the Aqua look and a native windows look.
221 static void setShouldPaintNativeControls(bool);
222 static bool shouldPaintNativeControls() { return gShouldPaintNativeControls
; }
228 String m_defaultTextEncodingName
;
229 String m_ftpDirectoryTemplatePath
;
230 String m_localStorageDatabasePath
;
231 KURL m_userStyleSheetLocation
;
232 AtomicString m_standardFontFamily
;
233 AtomicString m_fixedFontFamily
;
234 AtomicString m_serifFontFamily
;
235 AtomicString m_sansSerifFontFamily
;
236 AtomicString m_cursiveFontFamily
;
237 AtomicString m_fantasyFontFamily
;
238 EditableLinkBehavior m_editableLinkBehavior
;
239 TextDirectionSubmenuInclusionBehavior m_textDirectionSubmenuInclusionBehavior
;
240 int m_minimumFontSize
;
241 int m_minimumLogicalFontSize
;
242 int m_defaultFontSize
;
243 int m_defaultFixedFontSize
;
244 bool m_isJavaEnabled
: 1;
245 bool m_loadsImagesAutomatically
: 1;
246 bool m_privateBrowsingEnabled
: 1;
247 bool m_arePluginsEnabled
: 1;
248 bool m_databasesEnabled
: 1;
249 bool m_localStorageEnabled
: 1;
250 bool m_isJavaScriptEnabled
: 1;
251 bool m_javaScriptCanOpenWindowsAutomatically
: 1;
252 bool m_shouldPrintBackgrounds
: 1;
253 bool m_textAreasAreResizable
: 1;
254 #if ENABLE(DASHBOARD_SUPPORT)
255 bool m_usesDashboardBackwardCompatibilityMode
: 1;
257 bool m_needsAdobeFrameReloadingQuirk
: 1;
258 bool m_needsKeyboardEventDisambiguationQuirks
: 1;
259 bool m_isDOMPasteAllowed
: 1;
260 bool m_shrinksStandaloneImagesToFit
: 1;
261 bool m_usesPageCache
: 1;
262 bool m_showsURLsInToolTips
: 1;
263 bool m_forceFTPDirectoryListings
: 1;
264 bool m_developerExtrasEnabled
: 1;
265 bool m_authorAndUserStylesEnabled
: 1;
266 bool m_needsSiteSpecificQuirks
: 1;
267 unsigned m_fontRenderingMode
: 1;
268 bool m_flatFrameSetLayoutEnabled
: 1;
269 bool m_standalone
: 1;
270 bool m_telephoneNumberParsingEnabled
: 1;
271 bool m_webArchiveDebugModeEnabled
: 1;
272 bool m_inApplicationChromeMode
: 1;
273 bool m_offlineWebApplicationCacheEnabled
: 1;
274 bool m_rangeMutationDisabledForOldAppleMail
: 1;
275 bool m_shouldPaintCustomScrollbars
: 1;
276 bool m_zoomsTextOnly
: 1;
277 bool m_enforceCSSMIMETypeInStrictMode
: 1;
278 size_t m_maximumDecodedImageSize
;
279 long long m_maximumResourceDataLength
;
280 float m_minimumZoomFontSize
;
281 int m_layoutInterval
;
282 double m_maxParseDuration
;
284 #if USE(SAFARI_THEME)
285 static bool gShouldPaintNativeControls
;
289 } // namespace WebCore