WEB SPEECH: need to identify the default voice per language
[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
265 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
266
267 typedef enum {
268     WKMediaUIPartFullscreenButton   = 0,
269     WKMediaUIPartMuteButton,
270     WKMediaUIPartPlayButton,
271     WKMediaUIPartSeekBackButton,
272     WKMediaUIPartSeekForwardButton,
273     WKMediaUIPartTimelineSlider,
274     WKMediaUIPartTimelineSliderThumb,
275     WKMediaUIPartRewindButton,
276     WKMediaUIPartSeekToRealtimeButton,
277     WKMediaUIPartShowClosedCaptionsButton,
278     WKMediaUIPartHideClosedCaptionsButton,
279     WKMediaUIPartUnMuteButton,
280     WKMediaUIPartPauseButton,
281     WKMediaUIPartBackground,
282     WKMediaUIPartCurrentTimeDisplay,
283     WKMediaUIPartTimeRemainingDisplay,
284     WKMediaUIPartStatusDisplay,
285     WKMediaUIPartControlsPanel,
286     WKMediaUIPartVolumeSliderContainer,
287     WKMediaUIPartVolumeSlider,
288     WKMediaUIPartVolumeSliderThumb,
289     WKMediaUIPartFullScreenVolumeSlider,
290     WKMediaUIPartFullScreenVolumeSliderThumb,
291     WKMediaUIPartVolumeSliderMuteButton,
292     WKMediaUIPartTextTrackDisplayContainer,
293     WKMediaUIPartTextTrackDisplay,
294     WKMediaUIPartExitFullscreenButton,
295 } WKMediaUIPart;
296
297 typedef enum {
298     WKMediaControllerThemeClassic   = 1,
299     WKMediaControllerThemeQuickTime = 2
300 } WKMediaControllerThemeStyle;
301
302 typedef enum {
303     WKMediaControllerFlagDisabled = 1 << 0,
304     WKMediaControllerFlagPressed = 1 << 1,
305     WKMediaControllerFlagDrawEndCaps = 1 << 3,
306     WKMediaControllerFlagFocused = 1 << 4
307 } WKMediaControllerThemeState;
308
309 BOOL WKMediaControllerThemeAvailable(int themeStyle);
310 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
311 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
312 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
313 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
314 NSView *WKCreateMediaUIBackgroundView(void);
315
316 typedef enum {
317     WKMediaUIControlTimeline,
318     WKMediaUIControlSlider,
319     WKMediaUIControlPlayPauseButton,
320     WKMediaUIControlExitFullscreenButton,
321     WKMediaUIControlRewindButton,
322     WKMediaUIControlFastForwardButton,
323     WKMediaUIControlVolumeUpButton,
324     WKMediaUIControlVolumeDownButton
325 } WKMediaUIControlType;
326     
327 NSControl *WKCreateMediaUIControl(int controlType);
328
329 NSArray *WKQTGetSitesInMediaDownloadCache();
330 void WKQTClearMediaDownloadCacheForSite(NSString *site);
331 void WKQTClearMediaDownloadCache();
332     
333 mach_port_t WKInitializeRenderServer(void);
334     
335 @class CALayer;
336
337 CALayer *WKMakeRenderLayer(uint32_t contextID);
338     
339 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
340
341 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
342 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
343 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
344
345 typedef struct __WKCAContextRef *WKCAContextRef;
346
347 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
348 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
349 void WKCAContextInvalidate(WKCAContextRef);
350 uint32_t WKCAContextGetContextId(WKCAContextRef);
351 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
352 CALayer *WKCAContextGetLayer(WKCAContextRef);
353 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
354 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
355 void WKDestroyRenderingResources(void);
356
357 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
358
359 @class CARenderer;
360
361 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
362 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
363
364 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
365
366 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
367 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
368 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
369
370 void WKWindowSetClipRect(NSWindow*, NSRect);
371
372 #if defined(__x86_64__)
373 #import <mach/mig.h>
374 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
375 #endif // defined(__x86_64__)
376
377 NSUInteger WKGetInputPanelWindowStyle(void);
378 UInt8 WKGetNSEventKeyChar(NSEvent *);
379
380 @class CAPropertyAnimation;
381 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
382
383 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
384 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
385 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
386 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
387 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
388
389 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
390 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
391 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
392
393 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
394 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
395
396 void WKSyncSurfaceToView(NSView *view);
397
398 void WKEnableSettingCursorWhenInBackground(void);
399
400 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
401 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
402
403 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
404 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
405
406 #ifndef __LP64__
407 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
408 #endif
409
410 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
411 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
412
413 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
414 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
415 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
416 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
417 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
418
419 CIFormat WKCIGetRGBA8Format(void);
420
421 typedef enum {
422     WKSandboxExtensionTypeReadOnly,
423     WKSandboxExtensionTypeReadWrite,
424 } WKSandboxExtensionType;
425 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
426
427 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
428 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
429
430 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
431 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
432
433 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
434 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
435
436 OSStatus WKEnableSandboxStyleFileQuarantine(void);
437
438 int WKRecommendedScrollerStyle(void);
439
440 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
441
442 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
443 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
444 void WKHideWordDefinitionWindow(void);
445
446 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
447
448 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
449
450 NSURL* WKAVAssetResolvedURL(AVAsset*);
451
452 NSCursor *WKCursor(const char *name);
453
454 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
455
456 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
457 bool WKExecutableWasLinkedOnOrBeforeLion(void);
458 #endif
459
460 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
461
462 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
463
464 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
465 @class WebFilterEvaluator;
466
467 BOOL WKFilterIsManagedSession(void);
468 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
469 BOOL WKFilterIsBuffering(WebFilterEvaluator *);
470 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
471 NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
472 NSData *WKFilterDataComplete(WebFilterEvaluator *);
473
474 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
475 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
476 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
477 #endif
478
479 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
480 typedef enum {
481     WKOcclusionNotificationTypeApplicationBecameVisible,
482     WKOcclusionNotificationTypeApplicationBecameOccluded,
483     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
484     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
485     WKOcclusionNotificationTypeWindowBecameVisible,
486     WKOcclusionNotificationTypeWindowBecameOccluded,
487 } WKOcclusionNotificationType;
488
489 typedef uint32_t WKWindowID;
490
491 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
492
493 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
494 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
495 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
496
497 extern const NSSystemBehaviors WKProcessSuppressionSystemBehaviors;
498 #endif
499
500 bool WKIsJavaPlugInActive(void);
501 void WKActivateJavaPlugIn(void);
502
503 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
504
505 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
506 bool WKIsPublicSuffix(NSString *domain);
507
508 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
509 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
510
511 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
512 CFStringRef WKCachePartitionKey(void);
513 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
514 #endif
515
516 #ifdef __cplusplus
517 }
518 #endif