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