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