Pass the right color space over to the web process so we can set it on our CA context
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10
11 @class AVAsset;
12 @class QTMovie;
13 @class QTMovieView;
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 typedef struct _CFURLResponse* CFURLResponseRef;
20 typedef const struct _CFURLRequest* CFURLRequestRef;
21 typedef struct _CFURLRequest* CFMutableURLRequestRef;
22
23 typedef struct _CFURLCredential* WKCFURLCredentialRef;
24 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
25
26 typedef enum {
27     WKCertificateParseResultSucceeded  = 0,
28     WKCertificateParseResultFailed     = 1,
29     WKCertificateParseResultPKCS7      = 2,
30 } WKCertificateParseResult;
31
32 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
33 void WKSetDefaultLocalization(CFStringRef localization);
34
35 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
36 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
37
38 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
39 NSArray *WKGetExtensionsForMIMEType(NSString *type);
40 NSString *WKGetMIMETypeForExtension(NSString *extension);
41
42 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
43 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
44 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
45
46 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
47 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
48 #endif
49
50 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
51
52 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
53 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
54
55 void WKShowKeyAndMain(void);
56 #ifndef __LP64__
57 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
58 unsigned WKCarbonWindowMask(void);
59 void *WKGetNativeWindowFromWindowRef(WindowRef);
60 OSType WKCarbonWindowPropertyCreator(void);
61 OSType WKCarbonWindowPropertyTag(void);
62 #endif
63
64 typedef id WKNSURLConnectionDelegateProxyPtr;
65
66 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
67
68 void WKDisableCGDeferredUpdates(void);
69
70 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
71 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
72
73 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
74
75 unsigned WKGetNSAutoreleasePoolCount(void);
76
77 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
78
79 NSString *WKMouseMovedNotification(void);
80 NSString *WKWindowWillOrderOnScreenNotification(void);
81 NSString *WKWindowWillOrderOffScreenNotification(void);
82 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
83
84 CFTypeID WKGetAXTextMarkerTypeID(void);
85 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
86 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
87 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
88 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
89 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
90 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
91 void WKAccessibilityHandleFocusChanged(void);
92 AXUIElementRef WKCreateAXUIElementRef(id element);
93 void WKUnregisterUniqueIdForElement(id element);
94
95 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
96
97 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
98 // Remote Accessibility API.
99 void WKAXRegisterRemoteApp(void);
100 void WKAXInitializeElementWithPresenterPid(id, pid_t);
101 NSData *WKAXRemoteTokenForElement(id);
102 id WKAXRemoteElementForToken(NSData *);
103 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
104 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
105 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
106 #endif
107
108 void WKSetUpFontCache(void);
109
110 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
111 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
112 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
113
114 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
115     void (*formFinalize)(CFReadStreamRef, void *), 
116     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
117     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
118     Boolean (*formCanRead)(CFReadStreamRef, void *), 
119     void (*formClose)(CFReadStreamRef, void *), 
120     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
121     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
122     void *context);
123
124 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
125
126 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
127     // The CG context's current path is the focus ring's path.
128     // A color of 0 means "use system focus ring color".
129     // A radius of 0 means "use default focus ring radius".
130
131 void WKSetDragImage(NSImage *image, NSPoint offset);
132
133 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
134 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
135 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
136 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
137 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
138 void WKSendUserChangeNotifications(void);
139 #ifndef __LP64__
140 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
141 void WKSendKeyEventToTSM(NSEvent *theEvent);
142 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
143 #endif
144
145 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
146 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
147 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
148 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
149 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
150
151
152 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
153 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
154 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
155
156 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
157 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
158
159 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
160 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
161 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
162
163 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
164 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
165 #endif
166
167 typedef enum {
168     WKPatternTilingNoDistortion,
169     WKPatternTilingConstantSpacingMinimalDistortion,
170     WKPatternTilingConstantSpacing
171 } WKPatternTiling;
172
173 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
174 void WKCGContextResetClip(CGContextRef);
175
176 #ifndef __LP64__
177 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
178 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
179 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
180 #endif
181
182 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
183 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
184
185 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
186
187 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
188 // use that enum directly).
189 typedef enum {
190     WKThemeScrollBarArrowsSingle     = 0,
191     WKThemeScrollBarArrowsLowerRight = 1,
192     WKThemeScrollBarArrowsDouble     = 2,
193     WKThemeScrollBarArrowsUpperLeft  = 3,
194 } WKThemeScrollBarArrowStyle;
195
196 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
197
198
199 BOOL WKCGContextIsBitmapContext(CGContextRef context);
200
201 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
202
203 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
204
205 typedef enum {
206     WKMovieTypeUnknown,
207     WKMovieTypeDownload,
208     WKMovieTypeStoredStream,
209     WKMovieTypeLiveStream
210 } WKMovieType;
211
212 int WKQTMovieGetType(QTMovie* movie);
213
214 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
215 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
216 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
217 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
218
219 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
220 int WKQTMovieDataRate(QTMovie* movie);
221 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
222 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
223 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
224 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
225 void WKQTMovieDisableComponent(uint32_t[5]);
226 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
227
228 CFStringRef WKCopyFoundationCacheDirectory(void);
229
230 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
231 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
232 #else
233 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
234 #endif
235 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
236 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
237 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
238 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
239
240 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
241 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
242 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
243 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
244 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
245 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
246 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
247
248 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
249 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
250 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
251 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
252 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
253
254 void WKSetVisibleApplicationName(CFStringRef);
255
256 typedef enum {
257     WKMediaUIPartFullscreenButton   = 0,
258     WKMediaUIPartMuteButton,
259     WKMediaUIPartPlayButton,
260     WKMediaUIPartSeekBackButton,
261     WKMediaUIPartSeekForwardButton,
262     WKMediaUIPartTimelineSlider,
263     WKMediaUIPartTimelineSliderThumb,
264     WKMediaUIPartRewindButton,
265     WKMediaUIPartSeekToRealtimeButton,
266     WKMediaUIPartShowClosedCaptionsButton,
267     WKMediaUIPartHideClosedCaptionsButton,
268     WKMediaUIPartUnMuteButton,
269     WKMediaUIPartPauseButton,
270     WKMediaUIPartBackground,
271     WKMediaUIPartCurrentTimeDisplay,
272     WKMediaUIPartTimeRemainingDisplay,
273     WKMediaUIPartStatusDisplay,
274     WKMediaUIPartControlsPanel,
275     WKMediaUIPartVolumeSliderContainer,
276     WKMediaUIPartVolumeSlider,
277     WKMediaUIPartVolumeSliderThumb,
278     WKMediaUIPartFullScreenVolumeSlider,
279     WKMediaUIPartFullScreenVolumeSliderThumb,
280     WKMediaUIPartVolumeSliderMuteButton,
281     WKMediaUIPartTextTrackDisplayContainer,
282     WKMediaUIPartTextTrackDisplay,
283     WKMediaUIPartExitFullscreenButton,
284 } WKMediaUIPart;
285
286 typedef enum {
287     WKMediaControllerThemeClassic   = 1,
288     WKMediaControllerThemeQuickTime = 2
289 } WKMediaControllerThemeStyle;
290
291 typedef enum {
292     WKMediaControllerFlagDisabled = 1 << 0,
293     WKMediaControllerFlagPressed = 1 << 1,
294     WKMediaControllerFlagDrawEndCaps = 1 << 3,
295     WKMediaControllerFlagFocused = 1 << 4
296 } WKMediaControllerThemeState;
297
298 BOOL WKMediaControllerThemeAvailable(int themeStyle);
299 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
300 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
301 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
302 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
303 NSView *WKCreateMediaUIBackgroundView(void);
304
305 typedef enum {
306     WKMediaUIControlTimeline,
307     WKMediaUIControlSlider,
308     WKMediaUIControlPlayPauseButton,
309     WKMediaUIControlExitFullscreenButton,
310     WKMediaUIControlRewindButton,
311     WKMediaUIControlFastForwardButton,
312     WKMediaUIControlVolumeUpButton,
313     WKMediaUIControlVolumeDownButton
314 } WKMediaUIControlType;
315     
316 NSControl *WKCreateMediaUIControl(int controlType);
317
318 NSArray *WKQTGetSitesInMediaDownloadCache();
319 void WKQTClearMediaDownloadCacheForSite(NSString *site);
320 void WKQTClearMediaDownloadCache();
321     
322 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
323 mach_port_t WKInitializeRenderServer(void);
324     
325 @class CALayer;
326
327 CALayer *WKMakeRenderLayer(uint32_t contextID);
328     
329 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
330
331 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
332 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
333 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
334
335 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
336
337 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
338 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
339 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
340 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
341 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
342
343 typedef struct __WKCAContextRef *WKCAContextRef;
344
345 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
346 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
347 void WKCAContextInvalidate(WKCAContextRef);
348 uint32_t WKCAContextGetContextId(WKCAContextRef);
349 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
350 CALayer *WKCAContextGetLayer(WKCAContextRef);
351 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
352 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
353
354 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
355 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
356 #endif
357
358 @class CARenderer;
359
360 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
361 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
362
363 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
364
365 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
366 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
367 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
368
369 void WKWindowSetClipRect(NSWindow*, NSRect);
370
371 #if defined(__x86_64__)
372 #import <mach/mig.h>
373 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
374 #endif // defined(__x86_64__)
375
376 NSUInteger WKGetInputPanelWindowStyle(void);
377 UInt8 WKGetNSEventKeyChar(NSEvent *);
378 #endif // MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
379
380 @class CAPropertyAnimation;
381 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
382
383 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
384 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
385 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
386 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
387 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
388
389 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
390 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
391 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
392
393 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
394 typedef enum {
395     WKEventPhaseNone = 0,
396     WKEventPhaseBegan = 1,
397     WKEventPhaseChanged = 2,
398     WKEventPhaseEnded = 3,
399 } WKEventPhase;
400
401 int WKGetNSEventMomentumPhase(NSEvent *);
402 #endif
403
404 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
405 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
406
407 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
408 void WKSyncSurfaceToView(NSView *view);
409
410 void WKEnableSettingCursorWhenInBackground(void);
411
412 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
413 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
414
415 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
416 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
417
418 #ifndef __LP64__
419 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
420 #endif
421
422 #endif
423
424 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
425 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
426 #endif
427
428 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
429 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
430
431 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
432 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
433 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
434 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
435 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
436
437 CIFormat WKCIGetRGBA8Format(void);
438
439 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
440
441 typedef enum {
442     WKSandboxExtensionTypeReadOnly,
443     WKSandboxExtensionTypeWriteOnly,    
444     WKSandboxExtensionTypeReadWrite,
445 } WKSandboxExtensionType;
446 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
447
448 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
449 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
450
451 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
452 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
453
454 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
455 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
456
457 OSStatus WKEnableSandboxStyleFileQuarantine(void);
458
459 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
460
461 int WKRecommendedScrollerStyle(void);
462
463 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
464
465 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
466 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
467 void WKHideWordDefinitionWindow(void);
468
469 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
470
471 NSURL* WKAVAssetResolvedURL(AVAsset*);
472
473 NSCursor *WKCursor(const char *name);
474
475 #endif
476
477 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
478
479 #import <dispatch/dispatch.h>
480
481 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
482
483 #endif
484
485 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
486 NSString *WKGetMacOSXVersionString(void);
487 bool WKExecutableWasLinkedOnOrBeforeLion(void);
488 #endif
489
490 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
491 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
492 #endif
493
494 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
495 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
496 #endif
497
498 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
499 @class WebFilterEvaluator;
500
501 BOOL WKFilterIsManagedSession(void);
502 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
503 void WKFilterRelease(WebFilterEvaluator *);
504 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
505 const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
506 const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
507
508 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
509 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
510 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
511 #endif
512
513 #ifdef __cplusplus
514 }
515 #endif