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