Update WebKitSystemInterface libraries and header.
[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 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 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
173 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
174 #endif
175
176 #ifndef __LP64__
177 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
178 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
179 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
180 #endif
181
182 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
183 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
184
185 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
186
187 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
188 // use that enum directly).
189 typedef enum {
190     WKThemeScrollBarArrowsSingle     = 0,
191     WKThemeScrollBarArrowsLowerRight = 1,
192     WKThemeScrollBarArrowsDouble     = 2,
193     WKThemeScrollBarArrowsUpperLeft  = 3,
194 } WKThemeScrollBarArrowStyle;
195
196 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
197
198
199 BOOL WKCGContextIsBitmapContext(CGContextRef context);
200
201 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
202
203 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
204
205 typedef enum {
206     WKMovieTypeUnknown,
207     WKMovieTypeDownload,
208     WKMovieTypeStoredStream,
209     WKMovieTypeLiveStream
210 } WKMovieType;
211
212 int WKQTMovieGetType(QTMovie* movie);
213
214 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
215 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
216 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
217 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
218
219 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
220 int WKQTMovieDataRate(QTMovie* movie);
221 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
222 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
223 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
224 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
225 void WKQTMovieDisableComponent(uint32_t[5]);
226 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
227
228 CFStringRef WKCopyFoundationCacheDirectory(void);
229
230 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
231 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
232 #else
233 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
234 #endif
235 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
236 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
237 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
238 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
239
240 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
241 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
242 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
243 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
244 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
245 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
246 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
247
248 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
249 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
250 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
251 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
252 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
253
254 void WKSetVisibleApplicationName(CFStringRef);
255
256 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
257
258 typedef enum {
259     WKMediaUIPartFullscreenButton   = 0,
260     WKMediaUIPartMuteButton,
261     WKMediaUIPartPlayButton,
262     WKMediaUIPartSeekBackButton,
263     WKMediaUIPartSeekForwardButton,
264     WKMediaUIPartTimelineSlider,
265     WKMediaUIPartTimelineSliderThumb,
266     WKMediaUIPartRewindButton,
267     WKMediaUIPartSeekToRealtimeButton,
268     WKMediaUIPartShowClosedCaptionsButton,
269     WKMediaUIPartHideClosedCaptionsButton,
270     WKMediaUIPartUnMuteButton,
271     WKMediaUIPartPauseButton,
272     WKMediaUIPartBackground,
273     WKMediaUIPartCurrentTimeDisplay,
274     WKMediaUIPartTimeRemainingDisplay,
275     WKMediaUIPartStatusDisplay,
276     WKMediaUIPartControlsPanel,
277     WKMediaUIPartVolumeSliderContainer,
278     WKMediaUIPartVolumeSlider,
279     WKMediaUIPartVolumeSliderThumb,
280     WKMediaUIPartFullScreenVolumeSlider,
281     WKMediaUIPartFullScreenVolumeSliderThumb,
282     WKMediaUIPartVolumeSliderMuteButton,
283     WKMediaUIPartTextTrackDisplayContainer,
284     WKMediaUIPartTextTrackDisplay,
285     WKMediaUIPartExitFullscreenButton,
286 } WKMediaUIPart;
287
288 typedef enum {
289     WKMediaControllerThemeClassic   = 1,
290     WKMediaControllerThemeQuickTime = 2
291 } WKMediaControllerThemeStyle;
292
293 typedef enum {
294     WKMediaControllerFlagDisabled = 1 << 0,
295     WKMediaControllerFlagPressed = 1 << 1,
296     WKMediaControllerFlagDrawEndCaps = 1 << 3,
297     WKMediaControllerFlagFocused = 1 << 4
298 } WKMediaControllerThemeState;
299
300 BOOL WKMediaControllerThemeAvailable(int themeStyle);
301 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
302 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
303 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
304 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
305 NSView *WKCreateMediaUIBackgroundView(void);
306
307 typedef enum {
308     WKMediaUIControlTimeline,
309     WKMediaUIControlSlider,
310     WKMediaUIControlPlayPauseButton,
311     WKMediaUIControlExitFullscreenButton,
312     WKMediaUIControlRewindButton,
313     WKMediaUIControlFastForwardButton,
314     WKMediaUIControlVolumeUpButton,
315     WKMediaUIControlVolumeDownButton
316 } WKMediaUIControlType;
317     
318 NSControl *WKCreateMediaUIControl(int controlType);
319
320 NSArray *WKQTGetSitesInMediaDownloadCache();
321 void WKQTClearMediaDownloadCacheForSite(NSString *site);
322 void WKQTClearMediaDownloadCache();
323     
324 mach_port_t WKInitializeRenderServer(void);
325     
326 @class CALayer;
327
328 CALayer *WKMakeRenderLayer(uint32_t contextID);
329     
330 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
331
332 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
333 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
334 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
335
336 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
337
338 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
339 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
340 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
341 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
342 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
343
344 typedef struct __WKCAContextRef *WKCAContextRef;
345
346 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
347 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
348 void WKCAContextInvalidate(WKCAContextRef);
349 uint32_t WKCAContextGetContextId(WKCAContextRef);
350 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
351 CALayer *WKCAContextGetLayer(WKCAContextRef);
352 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
353 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
354
355 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
356 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
357 #endif
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);
392
393 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
394 typedef enum {
395     WKEventPhaseNone = 0,
396     WKEventPhaseBegan = 1,
397     WKEventPhaseChanged = 2,
398     WKEventPhaseEnded = 3,
399 } WKEventPhase;
400
401 int WKGetNSEventMomentumPhase(NSEvent *);
402 #endif
403
404 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
405 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
406
407 void WKSyncSurfaceToView(NSView *view);
408
409 void WKEnableSettingCursorWhenInBackground(void);
410
411 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
412 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
413
414 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
415 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
416
417 #ifndef __LP64__
418 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
419 #endif
420
421 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
422 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
423 #endif
424
425 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
426 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
427
428 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
429 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
430 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
431 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
432 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
433
434 CIFormat WKCIGetRGBA8Format(void);
435
436 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
437
438 typedef enum {
439     WKSandboxExtensionTypeReadOnly,
440     WKSandboxExtensionTypeWriteOnly,    
441     WKSandboxExtensionTypeReadWrite,
442 } WKSandboxExtensionType;
443 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
444
445 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
446 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
447
448 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
449 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
450
451 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
452 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
453
454 OSStatus WKEnableSandboxStyleFileQuarantine(void);
455
456 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
457
458 int WKRecommendedScrollerStyle(void);
459
460 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
461
462 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
463 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
464 void WKHideWordDefinitionWindow(void);
465
466 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
467
468 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
469
470 NSURL* WKAVAssetResolvedURL(AVAsset*);
471
472 NSCursor *WKCursor(const char *name);
473
474 #endif
475
476 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
477
478 #import <dispatch/dispatch.h>
479
480 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
481
482 #endif
483
484 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
485 NSString *WKGetMacOSXVersionString(void);
486 bool WKExecutableWasLinkedOnOrBeforeLion(void);
487 #endif
488
489 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
490 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
491 #endif
492
493 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
494 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
495 #endif
496
497 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
498 @class WebFilterEvaluator;
499
500 BOOL WKFilterIsManagedSession(void);
501 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
502 void WKFilterRelease(WebFilterEvaluator *);
503 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
504 const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
505 const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
506
507 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
508 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
509 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
510 #endif
511
512 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
513 Boolean WKJLIsRuntimeAndWebComponentsInstalled(void);
514 #endif
515
516 typedef enum {
517     WKCaptionFontStyleDefault = 0,
518     WKCaptionFontStyleMonospacedWithSerif,
519     WKCaptionFontStyleProportionalWithSerif,
520     WKCaptionFontStyleMonospacedWithoutSerif,
521     WKCaptionFontStyleProportionalWithoutSerif,
522     WKCaptionFontStyleCasual,
523     WKCaptionFontStyleCursive,
524     WKCaptionFontStyleSmallCapital,
525     WKCaptionFontStyleMax
526 } WKCaptionFontStyle;
527
528 typedef enum {
529     WKCaptionTextEdgeStyleUndefined = 0,
530     WKCaptionTextEdgeStyleNone,
531     WKCaptionTextEdgeStyleRaised,
532     WKCaptionTextEdgeStyleDepressed,
533     WKCaptionTextEdgeStyleUniform,
534     WKCaptionTextEdgeStyleDropShadow,
535     WKCaptionTextEdgeStyleMax
536 } WKCaptionTextEdgeStyle;
537
538 bool WKCaptionAppearanceHasUserPreferences(void);
539 bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
540 CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
541 CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
542 CGColorRef WKCaptionAppearanceCopyWindowColor(void);
543 bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
544 bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
545 bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
546 CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
547 bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
548 int WKCaptionAppearanceGetTextEdgeStyle(void);
549 CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
550
551 #ifdef __cplusplus
552 }
553 #endif