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