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 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
153 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
154 void WKSendUserChangeNotifications(void);
155 #ifndef __LP64__
156 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
157 void WKSendKeyEventToTSM(NSEvent *theEvent);
158 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
159 #endif
160
161 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
162 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
163 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
164 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
165 #endif
166
167 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
168
169
170 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
171 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
172 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
173
174 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
175 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
176
177 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
178
179 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
180 enum {
181     WKCTFontTransformApplyShaping = (1 << 0),
182     WKCTFontTransformApplyPositioning = (1 << 1)
183 };
184
185 typedef int WKCTFontTransformOptions;
186
187 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
188 #endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
189
190 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
191
192 CGSize WKCTRunGetInitialAdvance(CTRunRef);
193
194 #if (TARGET_OS_IPHONE && TARGET_OS_EMBEDDED) || MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
195 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
196 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
197 #endif
198
199 typedef enum {
200     WKPatternTilingNoDistortion,
201     WKPatternTilingConstantSpacingMinimalDistortion,
202     WKPatternTilingConstantSpacing
203 } WKPatternTiling;
204
205 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
206 void WKCGContextResetClip(CGContextRef);
207
208 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
209 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
210 #endif
211
212 #if !TARGET_OS_IPHONE
213 #ifndef __LP64__
214 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
215 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
216 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
217 #endif
218
219 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
220 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
221
222 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
223
224 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
225 // use that enum directly).
226 typedef enum {
227     WKThemeScrollBarArrowsSingle     = 0,
228     WKThemeScrollBarArrowsLowerRight = 1,
229     WKThemeScrollBarArrowsDouble     = 2,
230     WKThemeScrollBarArrowsUpperLeft  = 3,
231 } WKThemeScrollBarArrowStyle;
232
233 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
234 #endif
235
236
237 BOOL WKCGContextIsBitmapContext(CGContextRef context);
238 bool WKCGContextIsPDFContext(CGContextRef context);
239
240 #if !TARGET_OS_IPHONE
241 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
242
243 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
244
245 typedef enum {
246     WKMovieTypeUnknown,
247     WKMovieTypeDownload,
248     WKMovieTypeStoredStream,
249     WKMovieTypeLiveStream
250 } WKMovieType;
251
252 int WKQTMovieGetType(QTMovie* movie);
253
254 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
255 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
256 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
257 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
258
259 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
260 int WKQTMovieDataRate(QTMovie* movie);
261 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
262 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
263 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
264 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
265 void WKQTMovieDisableComponent(uint32_t[5]);
266 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
267 #endif
268
269 CFStringRef WKCopyFoundationCacheDirectory(void);
270
271 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
272 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
273 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
274 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
275 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
276
277 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
278 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
279 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
280 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
281 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
282 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *, NSURL *);
283 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
284 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
285 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
286
287 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
288 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
289 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
290
291 #if !TARGET_OS_IPHONE
292 void WKSetVisibleApplicationName(CFStringRef);
293 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
294 #endif
295
296 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
297
298 #if !TARGET_OS_IPHONE
299 typedef enum {
300     WKMediaUIPartFullscreenButton   = 0,
301     WKMediaUIPartMuteButton,
302     WKMediaUIPartPlayButton,
303     WKMediaUIPartSeekBackButton,
304     WKMediaUIPartSeekForwardButton,
305     WKMediaUIPartTimelineSlider,
306     WKMediaUIPartTimelineSliderThumb,
307     WKMediaUIPartRewindButton,
308     WKMediaUIPartSeekToRealtimeButton,
309     WKMediaUIPartShowClosedCaptionsButton,
310     WKMediaUIPartHideClosedCaptionsButton,
311     WKMediaUIPartUnMuteButton,
312     WKMediaUIPartPauseButton,
313     WKMediaUIPartBackground,
314     WKMediaUIPartCurrentTimeDisplay,
315     WKMediaUIPartTimeRemainingDisplay,
316     WKMediaUIPartStatusDisplay,
317     WKMediaUIPartControlsPanel,
318     WKMediaUIPartVolumeSliderContainer,
319     WKMediaUIPartVolumeSlider,
320     WKMediaUIPartVolumeSliderThumb,
321     WKMediaUIPartFullScreenVolumeSlider,
322     WKMediaUIPartFullScreenVolumeSliderThumb,
323     WKMediaUIPartVolumeSliderMuteButton,
324     WKMediaUIPartTextTrackDisplayContainer,
325     WKMediaUIPartTextTrackDisplay,
326     WKMediaUIPartExitFullscreenButton,
327 } WKMediaUIPart;
328
329 typedef enum {
330     WKMediaControllerFlagDisabled = 1 << 0,
331     WKMediaControllerFlagPressed = 1 << 1,
332     WKMediaControllerFlagDrawEndCaps = 1 << 3,
333     WKMediaControllerFlagFocused = 1 << 4
334 } WKMediaControllerThemeState;
335
336 BOOL WKHitTestMediaUIPart(int part, CGRect bounds, CGPoint point);
337 void WKMeasureMediaUIPart(int part, CGRect *bounds, CGSize *naturalSize);
338 void WKDrawMediaUIPart(int part, CGContextRef context, CGRect rect, unsigned state);
339 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
340 NSView *WKCreateMediaUIBackgroundView(void);
341
342 typedef enum {
343     WKMediaUIControlTimeline,
344     WKMediaUIControlSlider,
345     WKMediaUIControlPlayPauseButton,
346     WKMediaUIControlExitFullscreenButton,
347     WKMediaUIControlRewindButton,
348     WKMediaUIControlFastForwardButton,
349     WKMediaUIControlVolumeUpButton,
350     WKMediaUIControlVolumeDownButton
351 } WKMediaUIControlType;
352     
353 NSControl *WKCreateMediaUIControl(int controlType);
354
355 NSArray *WKQTGetSitesInMediaDownloadCache();
356 void WKQTClearMediaDownloadCacheForSite(NSString *site);
357 void WKQTClearMediaDownloadCache();
358     
359 mach_port_t WKInitializeRenderServer(void);
360 #endif
361
362 @class CALayer;
363
364 CALayer *WKMakeRenderLayer(uint32_t contextID);
365     
366 #if !TARGET_OS_IPHONE
367 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
368
369 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
370 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
371 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
372 #endif
373
374 typedef struct __WKCAContextRef *WKCAContextRef;
375
376 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
377 #if !TARGET_OS_IPHONE
378 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
379 #endif
380 void WKCAContextInvalidate(WKCAContextRef);
381 uint32_t WKCAContextGetContextId(WKCAContextRef);
382 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
383 CALayer *WKCAContextGetLayer(WKCAContextRef);
384 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
385 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
386 void WKDestroyRenderingResources(void);
387
388 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
389
390 @class CARenderer;
391
392 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
393 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
394
395 #if !TARGET_OS_IPHONE
396 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
397
398 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
399 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
400 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
401
402 void WKWindowSetClipRect(NSWindow*, NSRect);
403
404 #if defined(__x86_64__)
405 #import <mach/mig.h>
406 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
407 #endif
408
409 NSUInteger WKGetInputPanelWindowStyle(void);
410 UInt8 WKGetNSEventKeyChar(NSEvent *);
411 #endif
412
413 @class CAPropertyAnimation;
414 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
415
416 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
417 int WKGetHTTPRequestPriority(CFURLRequestRef);
418 void WKSetHTTPRequestMaximumPriority(int maximumPriority);
419 void WKSetHTTPRequestPriority(CFURLRequestRef, int priority);
420 void WKSetHTTPRequestMinimumFastLanePriority(int priority);
421 void WKHTTPRequestEnablePipelining(CFURLRequestRef);
422
423 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
424 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
425 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
426
427 #if !TARGET_OS_IPHONE
428 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
429 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
430
431 void WKSyncSurfaceToView(NSView *view);
432
433 void WKEnableSettingCursorWhenInBackground(void);
434 #endif
435
436 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
437 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
438
439 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
440 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
441
442 #if !TARGET_OS_IPHONE && !defined(__LP64__)
443 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
444 #endif
445
446 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
447 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
448
449 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
450 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
451 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
452 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
453 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
454
455 #if !TARGET_OS_IPHONE
456 typedef enum {
457     WKSandboxExtensionTypeReadOnly,
458     WKSandboxExtensionTypeReadWrite,
459 } WKSandboxExtensionType;
460 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
461
462 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
463 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
464
465 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
466 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
467
468 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
469 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
470
471 OSStatus WKEnableSandboxStyleFileQuarantine(void);
472
473 int WKRecommendedScrollerStyle(void);
474
475 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
476
477 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
478 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
479 void WKHideWordDefinitionWindow(void);
480 #endif
481
482 #if !TARGET_OS_IPHONE
483 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
484 #endif
485
486 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
487
488 NSURL* WKAVAssetResolvedURL(AVAsset*);
489
490 #if !TARGET_OS_IPHONE
491 NSCursor *WKCursor(const char *name);
492 #endif
493
494 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
495 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
496 dispatch_source_t WKCreateMemoryStatusPressureCriticalDispatchOnMainQueue(void);
497 #endif
498     
499 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
500 bool WKExecutableWasLinkedOnOrBeforeLion(void);
501 #endif
502
503 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
504 bool WKExecutableWasLinkedOnOrBeforeMountainLion(void);
505 #endif
506
507 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
508
509 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
510
511 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
512 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
513 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
514 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
515 #endif
516
517 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
518 typedef enum {
519     WKOcclusionNotificationTypeApplicationBecameVisible,
520     WKOcclusionNotificationTypeApplicationBecameOccluded,
521     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
522     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
523     WKOcclusionNotificationTypeWindowBecameVisible,
524     WKOcclusionNotificationTypeWindowBecameOccluded,
525 } WKOcclusionNotificationType;
526
527 typedef uint32_t WKWindowID;
528
529 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
530
531 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
532 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
533 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
534 #endif
535
536 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
537
538 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
539 bool WKIsPublicSuffix(NSString *domain);
540
541 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
542 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
543
544 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
545 CFStringRef WKCachePartitionKey(void);
546 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
547 #endif
548
549 typedef enum {
550     WKExternalPlaybackTypeNone,
551     WKExternalPlaybackTypeAirPlay,
552     WKExternalPlaybackTypeTVOut,
553 } WKExternalPlaybackType;
554
555 int WKExernalDeviceTypeForPlayer(AVPlayer *);
556 NSString *WKExernalDeviceDisplayNameForPlayer(AVPlayer *);
557
558 bool WKQueryDecoderAvailability(void);
559
560 #ifdef __cplusplus
561 }
562 #endif