Home | History | Annotate | Download | only in WebView
      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     WebKitEditingUnixBehavior
     50 } WebKitEditingBehavior;
     51 
     52 extern NSString *WebPreferencesChangedNotification;
     53 extern NSString *WebPreferencesRemovedNotification;
     54 extern NSString *WebPreferencesChangedInternalNotification;
     55 
     56 @interface WebPreferences (WebPrivate)
     57 
     58 // Preferences that might be public in a future release
     59 
     60 - (BOOL)isDNSPrefetchingEnabled;
     61 - (void)setDNSPrefetchingEnabled:(BOOL)flag;
     62 
     63 - (BOOL)developerExtrasEnabled;
     64 - (void)setDeveloperExtrasEnabled:(BOOL)flag;
     65 
     66 - (BOOL)authorAndUserStylesEnabled;
     67 - (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
     68 
     69 - (BOOL)applicationChromeModeEnabled;
     70 - (void)setApplicationChromeModeEnabled:(BOOL)flag;
     71 
     72 - (BOOL)usesEncodingDetector;
     73 - (void)setUsesEncodingDetector:(BOOL)flag;
     74 
     75 - (BOOL)respectStandardStyleKeyEquivalents;
     76 - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
     77 
     78 - (BOOL)showsURLsInToolTips;
     79 - (void)setShowsURLsInToolTips:(BOOL)flag;
     80 
     81 - (BOOL)textAreasAreResizable;
     82 - (void)setTextAreasAreResizable:(BOOL)flag;
     83 
     84 - (PDFDisplayMode)PDFDisplayMode;
     85 - (void)setPDFDisplayMode:(PDFDisplayMode)mode;
     86 
     87 - (BOOL)shrinksStandaloneImagesToFit;
     88 - (void)setShrinksStandaloneImagesToFit:(BOOL)flag;
     89 
     90 - (BOOL)automaticallyDetectsCacheModel;
     91 - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel;
     92 
     93 - (BOOL)webArchiveDebugModeEnabled;
     94 - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
     95 
     96 - (BOOL)localFileContentSniffingEnabled;
     97 - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled;
     98 
     99 - (BOOL)offlineWebApplicationCacheEnabled;
    100 - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
    101 
    102 - (BOOL)databasesEnabled;
    103 - (void)setDatabasesEnabled:(BOOL)databasesEnabled;
    104 
    105 - (BOOL)localStorageEnabled;
    106 - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled;
    107 
    108 - (BOOL)isWebSecurityEnabled;
    109 - (void)setWebSecurityEnabled:(BOOL)flag;
    110 
    111 - (BOOL)allowUniversalAccessFromFileURLs;
    112 - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag;
    113 
    114 - (BOOL)allowFileAccessFromFileURLs;
    115 - (void)setAllowFileAccessFromFileURLs:(BOOL)flag;
    116 
    117 - (BOOL)zoomsTextOnly;
    118 - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly;
    119 
    120 - (BOOL)javaScriptCanAccessClipboard;
    121 - (void)setJavaScriptCanAccessClipboard:(BOOL)flag;
    122 
    123 - (BOOL)isXSSAuditorEnabled;
    124 - (void)setXSSAuditorEnabled:(BOOL)flag;
    125 
    126 - (BOOL)experimentalNotificationsEnabled;
    127 - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled;
    128 
    129 - (unsigned)pluginAllowedRunTime;
    130 - (void)setPluginAllowedRunTime:(unsigned)allowedRunTime;
    131 
    132 - (BOOL)isFrameFlatteningEnabled;
    133 - (void)setFrameFlatteningEnabled:(BOOL)flag;
    134 
    135 - (BOOL)isSpatialNavigationEnabled;
    136 - (void)setSpatialNavigationEnabled:(BOOL)flag;
    137 
    138 // zero means do AutoScale
    139 - (float)PDFScaleFactor;
    140 - (void)setPDFScaleFactor:(float)scale;
    141 
    142 - (int64_t)applicationCacheTotalQuota;
    143 - (void)setApplicationCacheTotalQuota:(int64_t)quota;
    144 
    145 - (int64_t)applicationCacheDefaultOriginQuota;
    146 - (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota;
    147 
    148 - (WebKitEditableLinkBehavior)editableLinkBehavior;
    149 - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
    150 
    151 - (WebKitEditingBehavior)editingBehavior;
    152 - (void)setEditingBehavior:(WebKitEditingBehavior)behavior;
    153 
    154 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
    155 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
    156 
    157 // Used to set preference specified in the test via LayoutTestController.overridePreference(..).
    158 // For use with DumpRenderTree only.
    159 - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key;
    160 
    161 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
    162 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
    163 // the future when there's no more need for it.
    164 - (BOOL)_useSiteSpecificSpoofing;
    165 - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue;
    166 
    167 // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes.
    168 - (BOOL)isDOMPasteAllowed;
    169 - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed;
    170 
    171 - (NSString *)_ftpDirectoryTemplatePath;
    172 - (void)_setFTPDirectoryTemplatePath:(NSString *)path;
    173 
    174 - (void)_setForceFTPDirectoryListings:(BOOL)force;
    175 - (BOOL)_forceFTPDirectoryListings;
    176 
    177 - (NSString *)_localStorageDatabasePath;
    178 - (void)_setLocalStorageDatabasePath:(NSString *)path;
    179 
    180 - (BOOL)acceleratedDrawingEnabled;
    181 - (void)setAcceleratedDrawingEnabled:(BOOL)enabled;
    182 
    183 - (BOOL)canvasUsesAcceleratedDrawing;
    184 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled;
    185 
    186 - (BOOL)acceleratedCompositingEnabled;
    187 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
    188 
    189 - (BOOL)showDebugBorders;
    190 - (void)setShowDebugBorders:(BOOL)show;
    191 
    192 - (BOOL)showRepaintCounter;
    193 - (void)setShowRepaintCounter:(BOOL)show;
    194 
    195 - (BOOL)webAudioEnabled;
    196 - (void)setWebAudioEnabled:(BOOL)enabled;
    197 
    198 - (BOOL)webGLEnabled;
    199 - (void)setWebGLEnabled:(BOOL)enabled;
    200 
    201 - (BOOL)accelerated2dCanvasEnabled;
    202 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
    203 
    204 - (BOOL)paginateDuringLayoutEnabled;
    205 - (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
    206 
    207 - (BOOL)memoryInfoEnabled;
    208 - (void)setMemoryInfoEnabled:(BOOL)enabled;
    209 
    210 - (BOOL)hyperlinkAuditingEnabled;
    211 - (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
    212 
    213 // Other private methods
    214 - (void)_postPreferencesChangedNotification;
    215 - (void)_postPreferencesChangedAPINotification;
    216 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
    217 + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
    218 + (void)_removeReferenceForIdentifier:(NSString *)identifier;
    219 - (NSTimeInterval)_backForwardCacheExpirationInterval;
    220 + (CFStringEncoding)_systemCFStringEncoding;
    221 + (void)_setInitialDefaultTextEncodingToSystemEncoding;
    222 + (void)_setIBCreatorID:(NSString *)string;
    223 
    224 + (void)setWebKitLinkTimeVersion:(int)version;
    225 
    226 // For WebView's use only.
    227 - (void)willAddToWebView;
    228 - (void)didRemoveFromWebView;
    229 
    230 // Full screen support is dependent on WebCore/WebKit being
    231 // compiled with ENABLE_FULLSCREEN_API.
    232 - (void)setFullScreenEnabled:(BOOL)flag;
    233 - (BOOL)fullScreenEnabled;
    234 
    235 - (void)setAsynchronousSpellCheckingEnabled:(BOOL)flag;
    236 - (BOOL)asynchronousSpellCheckingEnabled;
    237 
    238 - (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
    239 - (BOOL)usePreHTML5ParserQuirks;
    240 
    241 - (BOOL)useQuickLookResourceCachingQuirks;
    242 
    243 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag;
    244 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
    245 
    246 @end
    247