fffafc239bd742b2f80359c37f0707f1dc970fea
[WebKit-https.git] / Source / WebCore / platform / mac / WebCoreSystemInterface.mm
1 /*
2  * Copyright 2006, 2007, 2008, 2009, 2010 Apple 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 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 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 #pragma GCC visibility push(default)
28 #import "WebCoreSystemInterface.h"
29 #pragma GCC visibility pop
30
31 #import <Foundation/Foundation.h>
32
33 void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
34 void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
35 BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
36 bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef);
37 CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
38 NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
39 CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
40 CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void);
41 void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
42 void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
43 void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int);
44 bool (*wkDrawFocusRingAtTime)(CGContextRef, NSTimeInterval);
45 bool (*wkDrawCellFocusRingWithFrameAtTime)(NSCell*, NSRect, NSView*, NSTimeInterval);
46 void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
47     float duration, unsigned state);
48 BOOL (*wkHitTestMediaUIPart)(int part, CGRect bounds, CGPoint point);
49 void (*wkDrawMediaUIPart)(int part, CGContextRef context, CGRect rect, unsigned state);
50 void (*wkMeasureMediaUIPart)(int part, CGRect *bounds, CGSize *naturalSize);
51 NSView *(*wkCreateMediaUIBackgroundView)(void);
52 NSControl *(*wkCreateMediaUIControl)(int);
53 void (*wkWindowSetAlpha)(NSWindow *, float);
54 void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
55 CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
56 NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
57 NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
58 BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
59 void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
60 UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
61 void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool usesCustomAppearance);
62 unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
63 void (*wkQTMovieDisableComponent)(uint32_t[5]);
64 float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
65 NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
66 float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
67 int (*wkQTMovieGetType)(QTMovie*);
68 BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
69 NSURL *(*wkQTMovieResolvedURL)(QTMovie*);
70 void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
71 void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
72 void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
73 NSArray *(*wkQTGetSitesInMediaDownloadCache)();
74 void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
75 void (*wkQTClearMediaDownloadCache)();
76
77 void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*, BOOL);
78 void (*wkSetDragImage)(NSImage*, NSPoint offset);
79 void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
80 CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
81 bool (*wkCGContextIsPDFContext)(CGContextRef);
82 void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
83 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
84 int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
85 void (*wkSetHTTPRequestMaximumPriority)(int priority);
86 void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
87 void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
88 void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
89 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
90 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
91 CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
92
93 #if USE(CFNETWORK)
94 CFHTTPCookieStorageRef (*wkGetDefaultHTTPCookieStorage)();
95 WKCFURLCredentialRef (*wkCopyCredentialFromCFPersistentStorage)(CFURLProtectionSpaceRef protectionSpace);
96 void (*wkSetCFURLRequestShouldContentSniff)(CFMutableURLRequestRef, bool);
97 void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
98 #endif
99
100 void* wkGetHyphenationLocationBeforeIndex;
101
102 bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
103
104 CFStringRef (*wkCopyDefaultSearchProviderDisplayName)(void);
105
106 NSCursor *(*wkCursor)(const char*);
107
108 NSArray *(*wkSpeechSynthesisGetVoiceIdentifiers)(void);
109 NSString *(*wkSpeechSynthesisGetDefaultVoiceIdentifierForLocale)(NSLocale *);
110
111 void (*wkUnregisterUniqueIdForElement)(id element);
112 void (*wkAccessibilityHandleFocusChanged)(void);
113 CFTypeID (*wkGetAXTextMarkerTypeID)(void);
114 CFTypeID (*wkGetAXTextMarkerRangeTypeID)(void);
115 CFTypeRef (*wkCreateAXTextMarkerRange)(CFTypeRef start, CFTypeRef end);
116 CFTypeRef (*wkCopyAXTextMarkerRangeStart)(CFTypeRef range);
117 CFTypeRef (*wkCopyAXTextMarkerRangeEnd)(CFTypeRef range);
118 CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
119 BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
120 AXUIElementRef (*wkCreateAXUIElementRef)(id element);
121
122 CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
123 NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
124 CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
125 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
126 void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
127 NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
128 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
129 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
130 void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
131 void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
132
133 CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
134 CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
135 CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
136 CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
137 void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
138 void (*wkSetMetadataURL)(NSString *urlString, NSString *referrer, NSString *path);
139
140 void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
141
142 #if !PLATFORM(IOS)
143 CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
144 CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
145 CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
146 #endif
147
148 #if ENABLE(PUBLIC_SUFFIX_LIST)
149 bool (*wkIsPublicSuffix)(NSString *host);
150 #endif
151
152 #if ENABLE(CACHE_PARTITIONING)
153 CFStringRef (*wkCachePartitionKey)(void);
154 #endif
155
156 int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
157 NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
158
159 bool (*wkQueryDecoderAvailability)(void);