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