Clean up which storage cookie jar functions use
[WebKit-https.git] / Source / WebCore / platform / mac / WebCoreSystemInterface.mm
1 /*
2  * Copyright 2006, 2007, 2008, 2009, 2010 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  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #import "config.h"
27 #import "WebCoreSystemInterface.h"
28 #import <Foundation/Foundation.h>
29
30 void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
31 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
32 void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
33 #endif
34 BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
35 void (*wkCGContextResetClip)(CGContextRef);
36 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
37 bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef);
38 #endif
39 CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
40 CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef);
41 NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
42 NSString* (*wkCreateURLPasteboardFlavorTypeName)(void);
43 NSString* (*wkCreateURLNPasteboardFlavorTypeName)(void);
44 void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
45 void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect);
46 void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
47 void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
48 void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius);
49 NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
50 NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
51 BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
52 void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, 
53     float duration, unsigned state);
54 BOOL (*wkHitTestMediaUIPart)(int part, int themeStyle, CGRect bounds, CGPoint point);
55 void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
56 void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
57 NSView *(*wkCreateMediaUIBackgroundView)(void);
58 NSControl *(*wkCreateMediaUIControl)(int);
59 void (*wkWindowSetAlpha)(NSWindow *, float);
60 void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
61 BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
62 NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
63 CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
64 NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
65 NSString* (*wkGetMIMETypeForExtension)(NSString*);
66 NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
67 NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
68 BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
69 void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
70 UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
71 void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
72 unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
73 int (*wkQTMovieDataRate)(QTMovie*);
74 void (*wkQTMovieDisableComponent)(uint32_t[5]);
75 float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
76 NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
77 float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
78 int (*wkQTMovieGetType)(QTMovie*);
79 BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
80 NSURL *(*wkQTMovieResolvedURL)(QTMovie*);
81 void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
82 void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
83 void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
84 NSArray *(*wkQTGetSitesInMediaDownloadCache)();
85 void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
86 void (*wkQTClearMediaDownloadCache)();
87
88 void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
89 void (*wkSetDragImage)(NSImage*, NSPoint offset);
90 void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
91 void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
92 CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
93 void (*wkSetUpFontCache)();
94 void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
95 void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
96 void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
97 CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), 
98     void (*formFinalize)(CFReadStreamRef, void *), 
99     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
100     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
101     Boolean (*formCanRead)(CFReadStreamRef, void *), 
102     void (*formClose)(CFReadStreamRef, void *), 
103     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
104     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
105     void *context);
106 void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
107 void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
108 id (*wkCreateNSURLConnectionDelegateProxy)(void);
109 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
110 int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
111 void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
112 void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
113 void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
114 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
115 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
116 CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
117
118 #if USE(CFNETWORK)
119 CFHTTPCookieStorageRef (*wkGetDefaultHTTPCookieStorage)();
120 WKCFURLCredentialRef (*wkCopyCredentialFromCFPersistentStorage)(CFURLProtectionSpaceRef protectionSpace);
121 void (*wkSetCFURLRequestShouldContentSniff)(CFMutableURLRequestRef, bool);
122 CFArrayRef (*wkCFURLRequestCopyHTTPRequestBodyParts)(CFURLRequestRef);
123 void (*wkCFURLRequestSetHTTPRequestBodyParts)(CFMutableURLRequestRef, CFArrayRef bodyParts);
124 void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
125 #endif
126
127 void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
128 bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGlyph[], size_t);
129
130 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
131 void* wkGetHyphenationLocationBeforeIndex;
132 #else
133 CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
134 int (*wkGetNSEventMomentumPhase)(NSEvent *);
135 #endif
136
137 CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
138 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
139 bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options);
140 #endif
141
142 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
143 CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
144
145 CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
146 CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
147
148 int (*wkRecommendedScrollerStyle)(void);
149
150 bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
151
152 CFStringRef (*wkCopyDefaultSearchProviderDisplayName)(void);
153 void (*wkSetCrashReportApplicationSpecificInformation)(CFStringRef);
154
155 NSURL *(*wkAVAssetResolvedURL)(AVAsset*);
156
157 NSCursor *(*wkCursor)(const char*);
158
159 #endif
160
161 void (*wkUnregisterUniqueIdForElement)(id element);
162 void (*wkAccessibilityHandleFocusChanged)(void);
163 CFTypeID (*wkGetAXTextMarkerTypeID)(void);
164 CFTypeID (*wkGetAXTextMarkerRangeTypeID)(void);
165 CFTypeRef (*wkCreateAXTextMarkerRange)(CFTypeRef start, CFTypeRef end);
166 CFTypeRef (*wkCopyAXTextMarkerRangeStart)(CFTypeRef range);
167 CFTypeRef (*wkCopyAXTextMarkerRangeEnd)(CFTypeRef range);
168 CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
169 BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
170 AXUIElementRef (*wkCreateAXUIElementRef)(id element);
171
172 CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
173 NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
174 CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
175 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
176 void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
177 NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
178 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
179 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
180 void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
181 void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
182
183 CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
184 CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
185 CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
186 CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
187 void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
188 void (*wkSetMetadataURL)(NSString *urlString, NSString *referrer, NSString *path);
189
190 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
191 dispatch_source_t (*wkCreateVMPressureDispatchOnMainQueue)(void);
192 #endif
193
194 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
195 NSString *(*wkGetMacOSXVersionString)(void);
196 bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
197 #endif
198
199 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
200 void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
201 #endif
202
203 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
204 void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
205 #endif
206
207 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !PLATFORM(IOS)
208 BOOL (*wkFilterIsManagedSession)(void);
209 WebFilterEvaluator *(*wkFilterCreateInstance)(NSURLResponse *);
210 void (*wkFilterRelease)(WebFilterEvaluator *);
211 BOOL (*wkFilterWasBlocked)(WebFilterEvaluator *);
212 const char* (*wkFilterAddData)(WebFilterEvaluator *, const char* data, int* length);
213 const char* (*wkFilterDataComplete)(WebFilterEvaluator *, int* length);
214
215 CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
216 CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
217 CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
218 #endif
219
220 bool (*wkCaptionAppearanceHasUserPreferences)(void);
221 bool (*wkCaptionAppearanceShowCaptionsWhenAvailable)(void);
222 CGColorRef(*wkCaptionAppearanceCopyForegroundColor)(void);
223 CGColorRef(*wkCaptionAppearanceCopyBackgroundColor)(void);
224 CGColorRef(*wkCaptionAppearanceCopyWindowColor)(void);
225 bool(*wkCaptionAppearanceGetForegroundOpacity)(CGFloat*);
226 bool(*wkCaptionAppearanceGetBackgroundOpacity)(CGFloat*);
227 bool(*wkCaptionAppearanceGetWindowOpacity)(CGFloat*);
228 CGFontRef(*wkCaptionAppearanceCopyFontForStyle)(int);
229 bool(*wkCaptionAppearanceGetRelativeCharacterSize)(CGFloat*);
230 int(*wkCaptionAppearanceGetTextEdgeStyle)(void);
231 CFStringRef(*wkCaptionAppearanceGetSettingsChangedNotification)(void);