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