Switch to entering the sandbox directly from main(), rather than waiting for the...
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10
11 @class AVAsset;
12 @class QTMovie;
13 @class QTMovieView;
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 typedef struct _CFURLResponse* CFURLResponseRef;
20 typedef const struct _CFURLRequest* CFURLRequestRef;
21 typedef struct _CFURLRequest* CFMutableURLRequestRef;
22
23 typedef struct _CFURLCredential* WKCFURLCredentialRef;
24 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
25
26 typedef enum {
27     WKCertificateParseResultSucceeded  = 0,
28     WKCertificateParseResultFailed     = 1,
29     WKCertificateParseResultPKCS7      = 2,
30 } WKCertificateParseResult;
31
32 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
33 void WKSetDefaultLocalization(CFStringRef localization);
34
35 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
36 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
37
38 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
39 NSArray *WKGetExtensionsForMIMEType(NSString *type);
40 NSString *WKGetMIMETypeForExtension(NSString *extension);
41
42 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
43 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(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 typedef id WKNSURLConnectionDelegateProxyPtr;
63
64 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
65
66 void WKDisableCGDeferredUpdates(void);
67
68 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
69 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
70
71 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
72
73 unsigned WKGetNSAutoreleasePoolCount(void);
74
75 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
76
77 NSString *WKMouseMovedNotification(void);
78 NSString *WKWindowWillOrderOnScreenNotification(void);
79 NSString *WKWindowWillOrderOffScreenNotification(void);
80 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
81
82 CFTypeID WKGetAXTextMarkerTypeID(void);
83 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
84 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
85 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
86 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
87 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
88 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
89 void WKAccessibilityHandleFocusChanged(void);
90 AXUIElementRef WKCreateAXUIElementRef(id element);
91 void WKUnregisterUniqueIdForElement(id element);
92
93 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
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);
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 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
157 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
158
159 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
160 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
161 #endif
162
163 typedef enum {
164     WKPatternTilingNoDistortion,
165     WKPatternTilingConstantSpacingMinimalDistortion,
166     WKPatternTilingConstantSpacing
167 } WKPatternTiling;
168
169 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
170 void WKCGContextResetClip(CGContextRef);
171
172 #ifndef __LP64__
173 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
174 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
175 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
176 #endif
177
178 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
179 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
180
181 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
182
183 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
184 // use that enum directly).
185 typedef enum {
186     WKThemeScrollBarArrowsSingle     = 0,
187     WKThemeScrollBarArrowsLowerRight = 1,
188     WKThemeScrollBarArrowsDouble     = 2,
189     WKThemeScrollBarArrowsUpperLeft  = 3,
190 } WKThemeScrollBarArrowStyle;
191
192 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
193
194
195 BOOL WKCGContextIsBitmapContext(CGContextRef context);
196
197 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
198
199 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
200
201 typedef enum {
202     WKMovieTypeUnknown,
203     WKMovieTypeDownload,
204     WKMovieTypeStoredStream,
205     WKMovieTypeLiveStream
206 } WKMovieType;
207
208 int WKQTMovieGetType(QTMovie* movie);
209
210 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
211 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
212 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
213 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
214
215 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
216 int WKQTMovieDataRate(QTMovie* movie);
217 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
218 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
219 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
220 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
221 void WKQTMovieDisableComponent(uint32_t[5]);
222 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
223
224 CFStringRef WKCopyFoundationCacheDirectory(void);
225
226 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
227 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
228 #else
229 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
230 #endif
231 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
232 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
233 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
234 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
235
236 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
237 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
238 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
239 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
240 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
241 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
242 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
243
244 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
245 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
246 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
247 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
248 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
249
250 void WKSetVisibleApplicationName(CFStringRef);
251
252 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
253
254 typedef enum {
255     WKMediaUIPartFullscreenButton   = 0,
256     WKMediaUIPartMuteButton,
257     WKMediaUIPartPlayButton,
258     WKMediaUIPartSeekBackButton,
259     WKMediaUIPartSeekForwardButton,
260     WKMediaUIPartTimelineSlider,
261     WKMediaUIPartTimelineSliderThumb,
262     WKMediaUIPartRewindButton,
263     WKMediaUIPartSeekToRealtimeButton,
264     WKMediaUIPartShowClosedCaptionsButton,
265     WKMediaUIPartHideClosedCaptionsButton,
266     WKMediaUIPartUnMuteButton,
267     WKMediaUIPartPauseButton,
268     WKMediaUIPartBackground,
269     WKMediaUIPartCurrentTimeDisplay,
270     WKMediaUIPartTimeRemainingDisplay,
271     WKMediaUIPartStatusDisplay,
272     WKMediaUIPartControlsPanel,
273     WKMediaUIPartVolumeSliderContainer,
274     WKMediaUIPartVolumeSlider,
275     WKMediaUIPartVolumeSliderThumb,
276     WKMediaUIPartFullScreenVolumeSlider,
277     WKMediaUIPartFullScreenVolumeSliderThumb,
278     WKMediaUIPartVolumeSliderMuteButton,
279     WKMediaUIPartTextTrackDisplayContainer,
280     WKMediaUIPartTextTrackDisplay,
281     WKMediaUIPartExitFullscreenButton,
282 } WKMediaUIPart;
283
284 typedef enum {
285     WKMediaControllerThemeClassic   = 1,
286     WKMediaControllerThemeQuickTime = 2
287 } WKMediaControllerThemeStyle;
288
289 typedef enum {
290     WKMediaControllerFlagDisabled = 1 << 0,
291     WKMediaControllerFlagPressed = 1 << 1,
292     WKMediaControllerFlagDrawEndCaps = 1 << 3,
293     WKMediaControllerFlagFocused = 1 << 4
294 } WKMediaControllerThemeState;
295
296 BOOL WKMediaControllerThemeAvailable(int themeStyle);
297 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
298 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
299 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
300 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
301 NSView *WKCreateMediaUIBackgroundView(void);
302
303 typedef enum {
304     WKMediaUIControlTimeline,
305     WKMediaUIControlSlider,
306     WKMediaUIControlPlayPauseButton,
307     WKMediaUIControlExitFullscreenButton,
308     WKMediaUIControlRewindButton,
309     WKMediaUIControlFastForwardButton,
310     WKMediaUIControlVolumeUpButton,
311     WKMediaUIControlVolumeDownButton
312 } WKMediaUIControlType;
313     
314 NSControl *WKCreateMediaUIControl(int controlType);
315
316 NSArray *WKQTGetSitesInMediaDownloadCache();
317 void WKQTClearMediaDownloadCacheForSite(NSString *site);
318 void WKQTClearMediaDownloadCache();
319     
320 mach_port_t WKInitializeRenderServer(void);
321     
322 @class CALayer;
323
324 CALayer *WKMakeRenderLayer(uint32_t contextID);
325     
326 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
327
328 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
329 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
330 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
331
332 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
333
334 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
335 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
336 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
337 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
338 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
339
340 typedef struct __WKCAContextRef *WKCAContextRef;
341
342 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
343 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
344 void WKCAContextInvalidate(WKCAContextRef);
345 uint32_t WKCAContextGetContextId(WKCAContextRef);
346 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
347 CALayer *WKCAContextGetLayer(WKCAContextRef);
348 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
349 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
350
351 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
352 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
353 #endif
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);
388
389 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
390 typedef enum {
391     WKEventPhaseNone = 0,
392     WKEventPhaseBegan = 1,
393     WKEventPhaseChanged = 2,
394     WKEventPhaseEnded = 3,
395 } WKEventPhase;
396
397 int WKGetNSEventMomentumPhase(NSEvent *);
398 #endif
399
400 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
401 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
402
403 void WKSyncSurfaceToView(NSView *view);
404
405 void WKEnableSettingCursorWhenInBackground(void);
406
407 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
408 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
409
410 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
411 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
412
413 #ifndef __LP64__
414 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
415 #endif
416
417 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
418 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
419 #endif
420
421 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
422 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
423
424 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
425 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
426 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
427 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
428 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
429
430 CIFormat WKCIGetRGBA8Format(void);
431
432 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
433
434 typedef enum {
435     WKSandboxExtensionTypeReadOnly,
436     WKSandboxExtensionTypeWriteOnly,    
437     WKSandboxExtensionTypeReadWrite,
438 } WKSandboxExtensionType;
439 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
440
441 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
442 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
443
444 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
445 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
446
447 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
448 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
449
450 OSStatus WKEnableSandboxStyleFileQuarantine(void);
451
452 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
453
454 int WKRecommendedScrollerStyle(void);
455
456 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
457
458 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
459 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
460 void WKHideWordDefinitionWindow(void);
461
462 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
463
464 NSURL* WKAVAssetResolvedURL(AVAsset*);
465
466 NSCursor *WKCursor(const char *name);
467
468 #endif
469
470 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
471
472 #import <dispatch/dispatch.h>
473
474 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
475
476 #endif
477
478 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
479 NSString *WKGetMacOSXVersionString(void);
480 bool WKExecutableWasLinkedOnOrBeforeLion(void);
481 #endif
482
483 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
484 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
485 #endif
486
487 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
488 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
489 #endif
490
491 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
492 @class WebFilterEvaluator;
493
494 BOOL WKFilterIsManagedSession(void);
495 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
496 void WKFilterRelease(WebFilterEvaluator *);
497 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
498 const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
499 const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
500
501 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
502 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
503 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
504 #endif
505
506 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
507 Boolean WKJLIsRuntimeAndWebComponentsInstalled(void);
508 #endif
509
510 #ifdef __cplusplus
511 }
512 #endif