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