fbd43dfb22d8bfff97db4f7ec07590a2b3431b0e
[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
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 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
47 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
48 #endif
49
50 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
51
52 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
53 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
54
55 void WKShowKeyAndMain(void);
56 #ifndef __LP64__
57 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
58 unsigned WKCarbonWindowMask(void);
59 void *WKGetNativeWindowFromWindowRef(WindowRef);
60 OSType WKCarbonWindowPropertyCreator(void);
61 OSType WKCarbonWindowPropertyTag(void);
62 #endif
63
64 typedef id WKNSURLConnectionDelegateProxyPtr;
65
66 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
67
68 void WKDisableCGDeferredUpdates(void);
69
70 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
71 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
72
73 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
74
75 unsigned WKGetNSAutoreleasePoolCount(void);
76
77 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
78
79 NSString *WKMouseMovedNotification(void);
80 NSString *WKWindowWillOrderOnScreenNotification(void);
81 NSString *WKWindowWillOrderOffScreenNotification(void);
82 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
83
84 CFTypeID WKGetAXTextMarkerTypeID(void);
85 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
86 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
87 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
88 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
89 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
90 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
91 void WKAccessibilityHandleFocusChanged(void);
92 AXUIElementRef WKCreateAXUIElementRef(id element);
93 void WKUnregisterUniqueIdForElement(id element);
94
95
96 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
97 // Remote Accessibility API.
98 void WKAXRegisterRemoteApp(void);
99 void WKAXInitializeElementWithPresenterPid(id, pid_t);
100 NSData *WKAXRemoteTokenForElement(id);
101 id WKAXRemoteElementForToken(NSData *);
102 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
103 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
104 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
105 #endif
106
107 void WKSetUpFontCache(void);
108
109 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
110 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
111 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
112
113 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
114     void (*formFinalize)(CFReadStreamRef, void *), 
115     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
116     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
117     Boolean (*formCanRead)(CFReadStreamRef, void *), 
118     void (*formClose)(CFReadStreamRef, void *), 
119     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
120     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
121     void *context);
122
123 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
124
125 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
126     // The CG context's current path is the focus ring's path.
127     // A color of 0 means "use system focus ring color".
128     // A radius of 0 means "use default focus ring radius".
129
130 void WKSetDragImage(NSImage *image, NSPoint offset);
131
132 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
133 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
134 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
135 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
136 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
137 void WKSendUserChangeNotifications(void);
138 #ifndef __LP64__
139 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
140 void WKSendKeyEventToTSM(NSEvent *theEvent);
141 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
142 #endif
143
144 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
145 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
146 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
147 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
148 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
149
150
151 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
152 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
153 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
154
155 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
156 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
157
158 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
159 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
160 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
161
162 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
163 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
164 #endif
165
166 typedef enum {
167     WKPatternTilingNoDistortion,
168     WKPatternTilingConstantSpacingMinimalDistortion,
169     WKPatternTilingConstantSpacing
170 } WKPatternTiling;
171
172 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
173 void WKCGContextResetClip(CGContextRef);
174
175 #ifndef __LP64__
176 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
177 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
178 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
179 #endif
180
181 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
182 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
183
184 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
185
186 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
187 // use that enum directly).
188 typedef enum {
189     WKThemeScrollBarArrowsSingle     = 0,
190     WKThemeScrollBarArrowsLowerRight = 1,
191     WKThemeScrollBarArrowsDouble     = 2,
192     WKThemeScrollBarArrowsUpperLeft  = 3,
193 } WKThemeScrollBarArrowStyle;
194
195 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
196
197
198 BOOL WKCGContextIsBitmapContext(CGContextRef context);
199
200 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
201
202 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
203
204 typedef enum {
205     WKMovieTypeUnknown,
206     WKMovieTypeDownload,
207     WKMovieTypeStoredStream,
208     WKMovieTypeLiveStream
209 } WKMovieType;
210
211 int WKQTMovieGetType(QTMovie* movie);
212
213 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
214 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
215 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
216 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
217
218 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
219 int WKQTMovieDataRate(QTMovie* movie);
220 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
221 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
222 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
223 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
224 void WKQTMovieDisableComponent(uint32_t[5]);
225 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
226
227 CFStringRef WKCopyFoundationCacheDirectory(void);
228
229 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
230 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
231 #else
232 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
233 #endif
234 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
235 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
236 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
237 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
238
239 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
240 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
241 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
242 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
243 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
244 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
245 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
246
247 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
248 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
249 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
250 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
251 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
252
253 void WKSetVisibleApplicationName(CFStringRef);
254
255 typedef enum {
256     WKMediaUIPartFullscreenButton   = 0,
257     WKMediaUIPartMuteButton,
258     WKMediaUIPartPlayButton,
259     WKMediaUIPartSeekBackButton,
260     WKMediaUIPartSeekForwardButton,
261     WKMediaUIPartTimelineSlider,
262     WKMediaUIPartTimelineSliderThumb,
263     WKMediaUIPartRewindButton,
264     WKMediaUIPartSeekToRealtimeButton,
265     WKMediaUIPartShowClosedCaptionsButton,
266     WKMediaUIPartHideClosedCaptionsButton,
267     WKMediaUIPartUnMuteButton,
268     WKMediaUIPartPauseButton,
269     WKMediaUIPartBackground,
270     WKMediaUIPartCurrentTimeDisplay,
271     WKMediaUIPartTimeRemainingDisplay,
272     WKMediaUIPartStatusDisplay,
273     WKMediaUIPartControlsPanel,
274     WKMediaUIPartVolumeSliderContainer,
275     WKMediaUIPartVolumeSlider,
276     WKMediaUIPartVolumeSliderThumb,
277     WKMediaUIPartFullScreenVolumeSlider,
278     WKMediaUIPartFullScreenVolumeSliderThumb,
279 } WKMediaUIPart;
280
281 typedef enum {
282     WKMediaControllerThemeClassic   = 1,
283     WKMediaControllerThemeQuickTime = 2
284 } WKMediaControllerThemeStyle;
285
286 typedef enum {
287     WKMediaControllerFlagDisabled = 1 << 0,
288     WKMediaControllerFlagPressed = 1 << 1,
289     WKMediaControllerFlagDrawEndCaps = 1 << 3,
290     WKMediaControllerFlagFocused = 1 << 4
291 } WKMediaControllerThemeState;
292
293 BOOL WKMediaControllerThemeAvailable(int themeStyle);
294 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
295 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
296 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
297 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
298 NSView *WKCreateMediaUIBackgroundView(void);
299
300 typedef enum {
301     WKMediaUIControlTimeline,
302     WKMediaUIControlSlider,
303     WKMediaUIControlPlayPauseButton,
304     WKMediaUIControlExitFullscreenButton,
305     WKMediaUIControlRewindButton,
306     WKMediaUIControlFastForwardButton,
307     WKMediaUIControlVolumeUpButton,
308     WKMediaUIControlVolumeDownButton
309 } WKMediaUIControlType;
310     
311 NSControl *WKCreateMediaUIControl(int controlType);
312
313 NSArray *WKQTGetSitesInMediaDownloadCache();
314 void WKQTClearMediaDownloadCacheForSite(NSString *site);
315 void WKQTClearMediaDownloadCache();
316     
317 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
318 mach_port_t WKInitializeRenderServer(void);
319     
320 @class CALayer;
321
322 CALayer *WKMakeRenderLayer(uint32_t contextID);
323     
324 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
325
326 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
327 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
328 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
329
330 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
331
332 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
333 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
334 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
335 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
336 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
337
338 typedef struct __WKCAContextRef *WKCAContextRef;
339
340 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
341 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
342 void WKCAContextInvalidate(WKCAContextRef);
343 uint32_t WKCAContextGetContextId(WKCAContextRef);
344 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
345 CALayer *WKCAContextGetLayer(WKCAContextRef);
346
347 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
348 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
349 #endif
350
351 @class CARenderer;
352
353 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
354 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
355
356 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
357
358 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
359 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
360 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
361
362 void WKWindowSetClipRect(NSWindow*, NSRect);
363
364 #if defined(__x86_64__)
365 #import <mach/mig.h>
366 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
367 #endif // defined(__x86_64__)
368
369 NSUInteger WKGetInputPanelWindowStyle(void);
370 UInt8 WKGetNSEventKeyChar(NSEvent *);
371 #endif // MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
372
373 @class CAPropertyAnimation;
374 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
375
376 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
377 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
378 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
379 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
380 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
381
382 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
383 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
384 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
385
386 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
387 typedef enum {
388     WKEventPhaseNone = 0,
389     WKEventPhaseBegan = 1,
390     WKEventPhaseChanged = 2,
391     WKEventPhaseEnded = 3,
392 } WKEventPhase;
393
394 int WKGetNSEventMomentumPhase(NSEvent *);
395 #endif
396
397 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
398 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
399
400 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
401 void WKSyncSurfaceToView(NSView *view);
402
403 void WKEnableSettingCursorWhenInBackground(void);
404
405 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
406 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
407
408 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
409 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
410
411 #ifndef __LP64__
412 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
413 #endif
414
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 #ifdef __cplusplus
488 }
489 #endif