AX: Support IOS Accessibility in WK2
[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 QTMovie;
25 @class QTMovieView;
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef struct _CFURLResponse* CFURLResponseRef;
32 typedef const struct _CFURLRequest* CFURLRequestRef;
33 typedef struct _CFURLRequest* CFMutableURLRequestRef;
34
35 typedef struct _CFURLCredential* WKCFURLCredentialRef;
36 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
37
38 typedef enum {
39     WKCertificateParseResultSucceeded  = 0,
40     WKCertificateParseResultFailed     = 1,
41     WKCertificateParseResultPKCS7      = 2,
42 } WKCertificateParseResult;
43
44 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
45 void WKSetDefaultLocalization(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 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
78 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
79
80 #if !TARGET_OS_IPHONE
81 #ifndef __LP64__
82 unsigned WKGetNSAutoreleasePoolCount(void);
83 #endif
84
85 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
86
87 NSString *WKMouseMovedNotification(void);
88 NSString *WKWindowWillOrderOnScreenNotification(void);
89 NSString *WKWindowWillOrderOffScreenNotification(void);
90 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
91
92 CFTypeID WKGetAXTextMarkerTypeID(void);
93 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
94 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
95 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
96 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
97 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
98 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
99 void WKAccessibilityHandleFocusChanged(void);
100 AXUIElementRef WKCreateAXUIElementRef(id element);
101 void WKUnregisterUniqueIdForElement(id element);
102     
103 NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
104 NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
105 #endif
106     
107 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
108 BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
109
110 // Remote Accessibility API.
111 #if !TARGET_OS_IPHONE
112 void WKAXRegisterRemoteApp(void);
113 void WKAXInitializeElementWithPresenterPid(id, pid_t);
114 NSData *WKAXRemoteTokenForElement(id);
115 id WKAXRemoteElementForToken(NSData *);
116 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
117 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
118 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
119 #endif
120
121 void WKSetUpFontCache(void);
122
123 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
124 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
125 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
126
127 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
128     void (*formFinalize)(CFReadStreamRef, void *), 
129     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
130     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
131     Boolean (*formCanRead)(CFReadStreamRef, void *), 
132     void (*formClose)(CFReadStreamRef, void *), 
133     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
134     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
135     void *context);
136
137 #if !TARGET_OS_IPHONE
138 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
139
140 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
141     // The CG context's current path is the focus ring's path.
142     // A color of 0 means "use system focus ring color".
143     // A radius of 0 means "use default focus ring radius".
144
145 void WKSetDragImage(NSImage *image, NSPoint offset);
146
147 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
148 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
149 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
150 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
151 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
152 void WKSendUserChangeNotifications(void);
153 #ifndef __LP64__
154 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
155 void WKSendKeyEventToTSM(NSEvent *theEvent);
156 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
157 #endif
158
159 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
160 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
161 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
162 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
163 #endif
164
165 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
166
167
168 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
169 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
170 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
171
172 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
173 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
174
175 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
176
177 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
178 enum {
179     WKCTFontTransformApplyShaping = (1 << 0),
180     WKCTFontTransformApplyPositioning = (1 << 1)
181 };
182
183 typedef int WKCTFontTransformOptions;
184
185 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
186 #endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
187
188 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
189
190 CGSize WKCTRunGetInitialAdvance(CTRunRef);
191
192 #if (TARGET_OS_IPHONE && TARGET_OS_EMBEDDED) || MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
193 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
194 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
195 #endif
196
197 typedef enum {
198     WKPatternTilingNoDistortion,
199     WKPatternTilingConstantSpacingMinimalDistortion,
200     WKPatternTilingConstantSpacing
201 } WKPatternTiling;
202
203 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
204 void WKCGContextResetClip(CGContextRef);
205
206 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
207 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
208 #endif
209
210 #if !TARGET_OS_IPHONE
211 #ifndef __LP64__
212 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
213 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
214 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
215 #endif
216
217 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
218 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
219
220 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
221
222 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
223 // use that enum directly).
224 typedef enum {
225     WKThemeScrollBarArrowsSingle     = 0,
226     WKThemeScrollBarArrowsLowerRight = 1,
227     WKThemeScrollBarArrowsDouble     = 2,
228     WKThemeScrollBarArrowsUpperLeft  = 3,
229 } WKThemeScrollBarArrowStyle;
230
231 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
232 #endif
233
234
235 BOOL WKCGContextIsBitmapContext(CGContextRef context);
236 bool WKCGContextIsPDFContext(CGContextRef context);
237
238 #if !TARGET_OS_IPHONE
239 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
240
241 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
242
243 typedef enum {
244     WKMovieTypeUnknown,
245     WKMovieTypeDownload,
246     WKMovieTypeStoredStream,
247     WKMovieTypeLiveStream
248 } WKMovieType;
249
250 int WKQTMovieGetType(QTMovie* movie);
251
252 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
253 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
254 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
255 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
256
257 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
258 int WKQTMovieDataRate(QTMovie* movie);
259 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
260 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
261 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
262 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
263 void WKQTMovieDisableComponent(uint32_t[5]);
264 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
265 #endif
266
267 CFStringRef WKCopyFoundationCacheDirectory(void);
268
269 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
270 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
271 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
272 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
273 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
274
275 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
276 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
277 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
278 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
279 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
280 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *, NSURL *);
281 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
282 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
283 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
284
285 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
286 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
287 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
288 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
289 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
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 CIFormat WKCIGetRGBA8Format(void);
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 #ifdef __cplusplus
552 }
553 #endif