Crash fix for Windows XP.
[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 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
45
46 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
47
48 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
49
50 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
51 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
52
53 void WKShowKeyAndMain(void);
54 #ifndef __LP64__
55 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
56 unsigned WKCarbonWindowMask(void);
57 void *WKGetNativeWindowFromWindowRef(WindowRef);
58 OSType WKCarbonWindowPropertyCreator(void);
59 OSType WKCarbonWindowPropertyTag(void);
60 #endif
61
62 void WKDisableCGDeferredUpdates(void);
63
64 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
65 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
66
67 #ifndef __LP64__
68 unsigned WKGetNSAutoreleasePoolCount(void);
69 #endif
70
71 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
72
73 NSString *WKMouseMovedNotification(void);
74 NSString *WKWindowWillOrderOnScreenNotification(void);
75 NSString *WKWindowWillOrderOffScreenNotification(void);
76 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
77
78 CFTypeID WKGetAXTextMarkerTypeID(void);
79 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
80 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
81 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
82 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
83 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
84 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
85 void WKAccessibilityHandleFocusChanged(void);
86 AXUIElementRef WKCreateAXUIElementRef(id element);
87 void WKUnregisterUniqueIdForElement(id element);
88     
89 NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
90 NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
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 CGSize WKCTRunGetInitialAdvance(CTRunRef);
171
172 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
173 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
174
175 typedef enum {
176     WKPatternTilingNoDistortion,
177     WKPatternTilingConstantSpacingMinimalDistortion,
178     WKPatternTilingConstantSpacing
179 } WKPatternTiling;
180
181 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
182 void WKCGContextResetClip(CGContextRef);
183
184 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
185 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
186 #endif
187
188 #ifndef __LP64__
189 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
190 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
191 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
192 #endif
193
194 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
195 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
196
197 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
198
199 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
200 // use that enum directly).
201 typedef enum {
202     WKThemeScrollBarArrowsSingle     = 0,
203     WKThemeScrollBarArrowsLowerRight = 1,
204     WKThemeScrollBarArrowsDouble     = 2,
205     WKThemeScrollBarArrowsUpperLeft  = 3,
206 } WKThemeScrollBarArrowStyle;
207
208 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
209
210
211 BOOL WKCGContextIsBitmapContext(CGContextRef context);
212 bool WKCGContextIsPDFContext(CGContextRef context);
213
214 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
215
216 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
217
218 typedef enum {
219     WKMovieTypeUnknown,
220     WKMovieTypeDownload,
221     WKMovieTypeStoredStream,
222     WKMovieTypeLiveStream
223 } WKMovieType;
224
225 int WKQTMovieGetType(QTMovie* movie);
226
227 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
228 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
229 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
230 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
231
232 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
233 int WKQTMovieDataRate(QTMovie* movie);
234 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
235 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
236 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
237 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
238 void WKQTMovieDisableComponent(uint32_t[5]);
239 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
240
241 CFStringRef WKCopyFoundationCacheDirectory(void);
242
243 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
244 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
245 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
246 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
247 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
248
249 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
250 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
251 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
252 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
253 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
254 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
255 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
256 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
257 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
258
259 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
260 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
261 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
262 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
263 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
264
265 void WKSetVisibleApplicationName(CFStringRef);
266 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
267
268 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
269
270 typedef enum {
271     WKMediaUIPartFullscreenButton   = 0,
272     WKMediaUIPartMuteButton,
273     WKMediaUIPartPlayButton,
274     WKMediaUIPartSeekBackButton,
275     WKMediaUIPartSeekForwardButton,
276     WKMediaUIPartTimelineSlider,
277     WKMediaUIPartTimelineSliderThumb,
278     WKMediaUIPartRewindButton,
279     WKMediaUIPartSeekToRealtimeButton,
280     WKMediaUIPartShowClosedCaptionsButton,
281     WKMediaUIPartHideClosedCaptionsButton,
282     WKMediaUIPartUnMuteButton,
283     WKMediaUIPartPauseButton,
284     WKMediaUIPartBackground,
285     WKMediaUIPartCurrentTimeDisplay,
286     WKMediaUIPartTimeRemainingDisplay,
287     WKMediaUIPartStatusDisplay,
288     WKMediaUIPartControlsPanel,
289     WKMediaUIPartVolumeSliderContainer,
290     WKMediaUIPartVolumeSlider,
291     WKMediaUIPartVolumeSliderThumb,
292     WKMediaUIPartFullScreenVolumeSlider,
293     WKMediaUIPartFullScreenVolumeSliderThumb,
294     WKMediaUIPartVolumeSliderMuteButton,
295     WKMediaUIPartTextTrackDisplayContainer,
296     WKMediaUIPartTextTrackDisplay,
297     WKMediaUIPartExitFullscreenButton,
298 } WKMediaUIPart;
299
300 typedef enum {
301     WKMediaControllerFlagDisabled = 1 << 0,
302     WKMediaControllerFlagPressed = 1 << 1,
303     WKMediaControllerFlagDrawEndCaps = 1 << 3,
304     WKMediaControllerFlagFocused = 1 << 4
305 } WKMediaControllerThemeState;
306
307 BOOL WKHitTestMediaUIPart(int part, CGRect bounds, CGPoint point);
308 void WKMeasureMediaUIPart(int part, CGRect *bounds, CGSize *naturalSize);
309 void WKDrawMediaUIPart(int part, CGContextRef context, CGRect rect, unsigned state);
310 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
311 NSView *WKCreateMediaUIBackgroundView(void);
312
313 typedef enum {
314     WKMediaUIControlTimeline,
315     WKMediaUIControlSlider,
316     WKMediaUIControlPlayPauseButton,
317     WKMediaUIControlExitFullscreenButton,
318     WKMediaUIControlRewindButton,
319     WKMediaUIControlFastForwardButton,
320     WKMediaUIControlVolumeUpButton,
321     WKMediaUIControlVolumeDownButton
322 } WKMediaUIControlType;
323     
324 NSControl *WKCreateMediaUIControl(int controlType);
325
326 NSArray *WKQTGetSitesInMediaDownloadCache();
327 void WKQTClearMediaDownloadCacheForSite(NSString *site);
328 void WKQTClearMediaDownloadCache();
329     
330 mach_port_t WKInitializeRenderServer(void);
331     
332 @class CALayer;
333
334 CALayer *WKMakeRenderLayer(uint32_t contextID);
335     
336 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
337
338 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
339 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
340 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
341
342 typedef struct __WKCAContextRef *WKCAContextRef;
343
344 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
345 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
346 void WKCAContextInvalidate(WKCAContextRef);
347 uint32_t WKCAContextGetContextId(WKCAContextRef);
348 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
349 CALayer *WKCAContextGetLayer(WKCAContextRef);
350 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
351 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
352 void WKDestroyRenderingResources(void);
353
354 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
355
356 @class CARenderer;
357
358 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
359 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
360
361 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
362
363 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
364 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
365 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
366
367 void WKWindowSetClipRect(NSWindow*, NSRect);
368
369 #if defined(__x86_64__)
370 #import <mach/mig.h>
371 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
372 #endif // defined(__x86_64__)
373
374 NSUInteger WKGetInputPanelWindowStyle(void);
375 UInt8 WKGetNSEventKeyChar(NSEvent *);
376
377 @class CAPropertyAnimation;
378 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
379
380 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
381 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
382 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
383 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
384 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
385
386 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
387 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
388 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
389
390 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
391 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
392
393 void WKSyncSurfaceToView(NSView *view);
394
395 void WKEnableSettingCursorWhenInBackground(void);
396
397 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
398 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
399
400 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
401 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
402
403 #ifndef __LP64__
404 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
405 #endif
406
407 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
408 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
409
410 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
411 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
412 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
413 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
414 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
415
416 CIFormat WKCIGetRGBA8Format(void);
417
418 typedef enum {
419     WKSandboxExtensionTypeReadOnly,
420     WKSandboxExtensionTypeReadWrite,
421 } WKSandboxExtensionType;
422 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
423
424 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
425 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
426
427 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
428 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
429
430 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
431 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
432
433 OSStatus WKEnableSandboxStyleFileQuarantine(void);
434
435 int WKRecommendedScrollerStyle(void);
436
437 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
438
439 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
440 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
441 void WKHideWordDefinitionWindow(void);
442
443 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
444
445 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
446
447 NSURL* WKAVAssetResolvedURL(AVAsset*);
448
449 NSCursor *WKCursor(const char *name);
450
451 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
452 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
453 dispatch_source_t WKCreateMemoryStatusPressureCriticalDispatchOnMainQueue(void);
454 #endif
455     
456 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
457 bool WKExecutableWasLinkedOnOrBeforeLion(void);
458 #endif
459
460 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
461 bool WKExecutableWasLinkedOnOrBeforeMountainLion(void);
462 #endif
463
464 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
465
466 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
467
468 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
469 @class WebFilterEvaluator;
470
471 BOOL WKFilterIsManagedSession(void);
472 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
473 BOOL WKFilterIsBuffering(WebFilterEvaluator *);
474 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
475 NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
476 NSData *WKFilterDataComplete(WebFilterEvaluator *);
477
478 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
479 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
480 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
481 #endif
482
483 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
484 typedef enum {
485     WKOcclusionNotificationTypeApplicationBecameVisible,
486     WKOcclusionNotificationTypeApplicationBecameOccluded,
487     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
488     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
489     WKOcclusionNotificationTypeWindowBecameVisible,
490     WKOcclusionNotificationTypeWindowBecameOccluded,
491 } WKOcclusionNotificationType;
492
493 typedef uint32_t WKWindowID;
494
495 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
496
497 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
498 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
499 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
500 #endif
501
502 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
503
504 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
505 bool WKIsPublicSuffix(NSString *domain);
506
507 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
508 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
509
510 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
511 CFStringRef WKCachePartitionKey(void);
512 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
513 #endif
514
515 #ifdef __cplusplus
516 }
517 #endif