Initial advance of text runs should be taken into account
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10 #import <dispatch/dispatch.h>
11
12 @class AVAsset;
13 @class QTMovie;
14 @class QTMovieView;
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 typedef struct _CFURLResponse* CFURLResponseRef;
21 typedef const struct _CFURLRequest* CFURLRequestRef;
22 typedef struct _CFURLRequest* CFMutableURLRequestRef;
23
24 typedef struct _CFURLCredential* WKCFURLCredentialRef;
25 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
26
27 typedef enum {
28     WKCertificateParseResultSucceeded  = 0,
29     WKCertificateParseResultFailed     = 1,
30     WKCertificateParseResultPKCS7      = 2,
31 } WKCertificateParseResult;
32
33 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
34 void WKSetDefaultLocalization(CFStringRef localization);
35
36 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
37 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
38
39 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
40 NSArray *WKGetExtensionsForMIMEType(NSString *type);
41 NSString *WKGetMIMETypeForExtension(NSString *extension);
42
43 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
44 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
45 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
46
47 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
48
49 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
50
51 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
52 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
53
54 void WKShowKeyAndMain(void);
55 #ifndef __LP64__
56 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
57 unsigned WKCarbonWindowMask(void);
58 void *WKGetNativeWindowFromWindowRef(WindowRef);
59 OSType WKCarbonWindowPropertyCreator(void);
60 OSType WKCarbonWindowPropertyTag(void);
61 #endif
62
63 void WKDisableCGDeferredUpdates(void);
64
65 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
66 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
67
68 unsigned WKGetNSAutoreleasePoolCount(void);
69
70 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
71
72 NSString *WKMouseMovedNotification(void);
73 NSString *WKWindowWillOrderOnScreenNotification(void);
74 NSString *WKWindowWillOrderOffScreenNotification(void);
75 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
76
77 CFTypeID WKGetAXTextMarkerTypeID(void);
78 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
79 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
80 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
81 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
82 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
83 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
84 void WKAccessibilityHandleFocusChanged(void);
85 AXUIElementRef WKCreateAXUIElementRef(id element);
86 void WKUnregisterUniqueIdForElement(id element);
87
88 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
89 BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
90
91 // Remote Accessibility API.
92 void WKAXRegisterRemoteApp(void);
93 void WKAXInitializeElementWithPresenterPid(id, pid_t);
94 NSData *WKAXRemoteTokenForElement(id);
95 id WKAXRemoteElementForToken(NSData *);
96 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
97 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
98 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
99
100 void WKSetUpFontCache(void);
101
102 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
103 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
104 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
105
106 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
107     void (*formFinalize)(CFReadStreamRef, void *), 
108     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
109     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
110     Boolean (*formCanRead)(CFReadStreamRef, void *), 
111     void (*formClose)(CFReadStreamRef, void *), 
112     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
113     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
114     void *context);
115
116 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
117
118 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
119     // The CG context's current path is the focus ring's path.
120     // A color of 0 means "use system focus ring color".
121     // A radius of 0 means "use default focus ring radius".
122
123 void WKSetDragImage(NSImage *image, NSPoint offset);
124
125 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
126 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
127 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
128 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
129 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
130 void WKSendUserChangeNotifications(void);
131 #ifndef __LP64__
132 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
133 void WKSendKeyEventToTSM(NSEvent *theEvent);
134 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
135 #endif
136
137 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
138 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
139 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
140 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
141 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
142
143
144 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
145 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
146 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
147
148 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
149 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
150
151 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
152
153 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
154 enum {
155     WKCTFontTransformApplyShaping = (1 << 0),
156     WKCTFontTransformApplyPositioning = (1 << 1)
157 };
158
159 typedef int WKCTFontTransformOptions;
160
161 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
162 #endif
163
164 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
165
166 CGSize WKCTRunGetInitialAdvance(CTRunRef);
167
168 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
169 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
170
171 typedef enum {
172     WKPatternTilingNoDistortion,
173     WKPatternTilingConstantSpacingMinimalDistortion,
174     WKPatternTilingConstantSpacing
175 } WKPatternTiling;
176
177 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
178 void WKCGContextResetClip(CGContextRef);
179
180 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
181 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
182 #endif
183
184 #ifndef __LP64__
185 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
186 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
187 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
188 #endif
189
190 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
191 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
192
193 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
194
195 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
196 // use that enum directly).
197 typedef enum {
198     WKThemeScrollBarArrowsSingle     = 0,
199     WKThemeScrollBarArrowsLowerRight = 1,
200     WKThemeScrollBarArrowsDouble     = 2,
201     WKThemeScrollBarArrowsUpperLeft  = 3,
202 } WKThemeScrollBarArrowStyle;
203
204 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
205
206
207 BOOL WKCGContextIsBitmapContext(CGContextRef context);
208
209 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
210
211 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
212
213 typedef enum {
214     WKMovieTypeUnknown,
215     WKMovieTypeDownload,
216     WKMovieTypeStoredStream,
217     WKMovieTypeLiveStream
218 } WKMovieType;
219
220 int WKQTMovieGetType(QTMovie* movie);
221
222 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
223 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
224 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
225 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
226
227 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
228 int WKQTMovieDataRate(QTMovie* movie);
229 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
230 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
231 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
232 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
233 void WKQTMovieDisableComponent(uint32_t[5]);
234 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
235
236 CFStringRef WKCopyFoundationCacheDirectory(void);
237
238 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
239 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
240 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
241 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
242 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
243
244 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
245 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
246 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
247 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
248 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
249 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
250 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
251 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
252 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
253
254 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
255 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
256 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
257 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
258 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
259
260 void WKSetVisibleApplicationName(CFStringRef);
261
262 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
263
264 typedef enum {
265     WKMediaUIPartFullscreenButton   = 0,
266     WKMediaUIPartMuteButton,
267     WKMediaUIPartPlayButton,
268     WKMediaUIPartSeekBackButton,
269     WKMediaUIPartSeekForwardButton,
270     WKMediaUIPartTimelineSlider,
271     WKMediaUIPartTimelineSliderThumb,
272     WKMediaUIPartRewindButton,
273     WKMediaUIPartSeekToRealtimeButton,
274     WKMediaUIPartShowClosedCaptionsButton,
275     WKMediaUIPartHideClosedCaptionsButton,
276     WKMediaUIPartUnMuteButton,
277     WKMediaUIPartPauseButton,
278     WKMediaUIPartBackground,
279     WKMediaUIPartCurrentTimeDisplay,
280     WKMediaUIPartTimeRemainingDisplay,
281     WKMediaUIPartStatusDisplay,
282     WKMediaUIPartControlsPanel,
283     WKMediaUIPartVolumeSliderContainer,
284     WKMediaUIPartVolumeSlider,
285     WKMediaUIPartVolumeSliderThumb,
286     WKMediaUIPartFullScreenVolumeSlider,
287     WKMediaUIPartFullScreenVolumeSliderThumb,
288     WKMediaUIPartVolumeSliderMuteButton,
289     WKMediaUIPartTextTrackDisplayContainer,
290     WKMediaUIPartTextTrackDisplay,
291     WKMediaUIPartExitFullscreenButton,
292 } WKMediaUIPart;
293
294 typedef enum {
295     WKMediaControllerThemeClassic   = 1,
296     WKMediaControllerThemeQuickTime = 2
297 } WKMediaControllerThemeStyle;
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 WKMediaControllerThemeAvailable(int themeStyle);
307 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
308 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
309 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
310 void WKDrawMediaSliderTrack(int themeStyle, 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
453 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
454 bool WKExecutableWasLinkedOnOrBeforeLion(void);
455 #endif
456
457 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
458
459 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
460
461 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
462 @class WebFilterEvaluator;
463
464 BOOL WKFilterIsManagedSession(void);
465 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
466 BOOL WKFilterIsBuffering(WebFilterEvaluator *);
467 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
468 NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
469 NSData *WKFilterDataComplete(WebFilterEvaluator *);
470
471 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
472 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
473 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
474 #endif
475
476 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
477 typedef enum {
478     WKOcclusionNotificationTypeApplicationBecameVisible,
479     WKOcclusionNotificationTypeApplicationBecameOccluded,
480     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
481     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
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 extern const NSSystemBehaviors WKProcessSuppressionSystemBehaviors;
495 #endif
496
497 bool WKIsJavaPlugInActive(void);
498 void WKActivateJavaPlugIn(void);
499
500 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
501
502 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
503 bool WKIsPublicSuffix(NSString *domain);
504
505 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
506 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
507
508 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
509 CFStringRef WKCachePartitionKey(void);
510 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
511 #endif
512
513 #ifdef __cplusplus
514 }
515 #endif