[Mac] Remove "legacy" media UI
[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
213 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
214
215 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
216
217 typedef enum {
218     WKMovieTypeUnknown,
219     WKMovieTypeDownload,
220     WKMovieTypeStoredStream,
221     WKMovieTypeLiveStream
222 } WKMovieType;
223
224 int WKQTMovieGetType(QTMovie* movie);
225
226 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
227 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
228 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
229 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
230
231 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
232 int WKQTMovieDataRate(QTMovie* movie);
233 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
234 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
235 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
236 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
237 void WKQTMovieDisableComponent(uint32_t[5]);
238 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
239
240 CFStringRef WKCopyFoundationCacheDirectory(void);
241
242 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
243 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
244 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
245 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
246 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
247
248 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
249 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
250 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
251 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
252 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
253 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
254 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
255 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
256 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
257
258 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
259 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
260 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
261 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
262 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
263
264 void WKSetVisibleApplicationName(CFStringRef);
265 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
266
267 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
268
269 typedef enum {
270     WKMediaUIPartFullscreenButton   = 0,
271     WKMediaUIPartMuteButton,
272     WKMediaUIPartPlayButton,
273     WKMediaUIPartSeekBackButton,
274     WKMediaUIPartSeekForwardButton,
275     WKMediaUIPartTimelineSlider,
276     WKMediaUIPartTimelineSliderThumb,
277     WKMediaUIPartRewindButton,
278     WKMediaUIPartSeekToRealtimeButton,
279     WKMediaUIPartShowClosedCaptionsButton,
280     WKMediaUIPartHideClosedCaptionsButton,
281     WKMediaUIPartUnMuteButton,
282     WKMediaUIPartPauseButton,
283     WKMediaUIPartBackground,
284     WKMediaUIPartCurrentTimeDisplay,
285     WKMediaUIPartTimeRemainingDisplay,
286     WKMediaUIPartStatusDisplay,
287     WKMediaUIPartControlsPanel,
288     WKMediaUIPartVolumeSliderContainer,
289     WKMediaUIPartVolumeSlider,
290     WKMediaUIPartVolumeSliderThumb,
291     WKMediaUIPartFullScreenVolumeSlider,
292     WKMediaUIPartFullScreenVolumeSliderThumb,
293     WKMediaUIPartVolumeSliderMuteButton,
294     WKMediaUIPartTextTrackDisplayContainer,
295     WKMediaUIPartTextTrackDisplay,
296     WKMediaUIPartExitFullscreenButton,
297 } WKMediaUIPart;
298
299 typedef enum {
300     WKMediaControllerFlagDisabled = 1 << 0,
301     WKMediaControllerFlagPressed = 1 << 1,
302     WKMediaControllerFlagDrawEndCaps = 1 << 3,
303     WKMediaControllerFlagFocused = 1 << 4
304 } WKMediaControllerThemeState;
305
306 BOOL WKHitTestMediaUIPart(int part, CGRect bounds, CGPoint point);
307 void WKMeasureMediaUIPart(int part, CGRect *bounds, CGSize *naturalSize);
308 void WKDrawMediaUIPart(int part, CGContextRef context, CGRect rect, unsigned state);
309 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
310 NSView *WKCreateMediaUIBackgroundView(void);
311
312 typedef enum {
313     WKMediaUIControlTimeline,
314     WKMediaUIControlSlider,
315     WKMediaUIControlPlayPauseButton,
316     WKMediaUIControlExitFullscreenButton,
317     WKMediaUIControlRewindButton,
318     WKMediaUIControlFastForwardButton,
319     WKMediaUIControlVolumeUpButton,
320     WKMediaUIControlVolumeDownButton
321 } WKMediaUIControlType;
322     
323 NSControl *WKCreateMediaUIControl(int controlType);
324
325 NSArray *WKQTGetSitesInMediaDownloadCache();
326 void WKQTClearMediaDownloadCacheForSite(NSString *site);
327 void WKQTClearMediaDownloadCache();
328     
329 mach_port_t WKInitializeRenderServer(void);
330     
331 @class CALayer;
332
333 CALayer *WKMakeRenderLayer(uint32_t contextID);
334     
335 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
336
337 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
338 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
339 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
340
341 typedef struct __WKCAContextRef *WKCAContextRef;
342
343 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
344 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
345 void WKCAContextInvalidate(WKCAContextRef);
346 uint32_t WKCAContextGetContextId(WKCAContextRef);
347 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
348 CALayer *WKCAContextGetLayer(WKCAContextRef);
349 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
350 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
351 void WKDestroyRenderingResources(void);
352
353 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
354
355 @class CARenderer;
356
357 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
358 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
359
360 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
361
362 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
363 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
364 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
365
366 void WKWindowSetClipRect(NSWindow*, NSRect);
367
368 #if defined(__x86_64__)
369 #import <mach/mig.h>
370 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
371 #endif // defined(__x86_64__)
372
373 NSUInteger WKGetInputPanelWindowStyle(void);
374 UInt8 WKGetNSEventKeyChar(NSEvent *);
375
376 @class CAPropertyAnimation;
377 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
378
379 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
380 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
381 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
382 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
383 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
384
385 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
386 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
387 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
388
389 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
390 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
391
392 void WKSyncSurfaceToView(NSView *view);
393
394 void WKEnableSettingCursorWhenInBackground(void);
395
396 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
397 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
398
399 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
400 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
401
402 #ifndef __LP64__
403 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
404 #endif
405
406 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
407 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
408
409 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
410 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
411 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
412 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
413 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
414
415 CIFormat WKCIGetRGBA8Format(void);
416
417 typedef enum {
418     WKSandboxExtensionTypeReadOnly,
419     WKSandboxExtensionTypeReadWrite,
420 } WKSandboxExtensionType;
421 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
422
423 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
424 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
425
426 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
427 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
428
429 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
430 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
431
432 OSStatus WKEnableSandboxStyleFileQuarantine(void);
433
434 int WKRecommendedScrollerStyle(void);
435
436 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
437
438 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
439 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
440 void WKHideWordDefinitionWindow(void);
441
442 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
443
444 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
445
446 NSURL* WKAVAssetResolvedURL(AVAsset*);
447
448 NSCursor *WKCursor(const char *name);
449
450 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
451 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
452 dispatch_source_t WKCreateMemoryStatusPressureCriticalDispatchOnMainQueue(void);
453 #endif
454     
455 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
456 bool WKExecutableWasLinkedOnOrBeforeLion(void);
457 #endif
458
459 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
460 bool WKExecutableWasLinkedOnOrBeforeMountainLion(void);
461 #endif
462
463 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
464
465 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
466
467 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
468 @class WebFilterEvaluator;
469
470 BOOL WKFilterIsManagedSession(void);
471 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
472 BOOL WKFilterIsBuffering(WebFilterEvaluator *);
473 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
474 NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
475 NSData *WKFilterDataComplete(WebFilterEvaluator *);
476
477 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
478 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
479 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
480 #endif
481
482 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
483 typedef enum {
484     WKOcclusionNotificationTypeApplicationBecameVisible,
485     WKOcclusionNotificationTypeApplicationBecameOccluded,
486     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
487     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
488     WKOcclusionNotificationTypeWindowBecameVisible,
489     WKOcclusionNotificationTypeWindowBecameOccluded,
490 } WKOcclusionNotificationType;
491
492 typedef uint32_t WKWindowID;
493
494 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
495
496 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
497 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
498 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
499 #endif
500
501 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
502
503 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
504 bool WKIsPublicSuffix(NSString *domain);
505
506 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
507 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
508
509 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
510 CFStringRef WKCachePartitionKey(void);
511 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
512 #endif
513
514 #ifdef __cplusplus
515 }
516 #endif