[Mac] [iOS] Add support for CFHTTPCookieStorageAcceptPolicyExclusivelyFromMainDocumen...
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Foundation/Foundation.h>
9 #import <dispatch/dispatch.h>
10
11 #if !TARGET_OS_IPHONE
12 #import <AppKit/AppKit.h>
13 #import <Carbon/Carbon.h>
14 #else
15 #import <CoreImage/CoreImage.h>
16 #import <CoreText/CoreText.h>
17 #if !TARGET_IPHONE_SIMULATOR
18 #import <IOSurface/IOSurface.h>
19 #endif
20 #import <WebKitSystemInterfaceIOS.h>
21 #endif
22
23 @class AVAsset;
24 @class QTMovie;
25 @class QTMovieView;
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef struct _CFURLResponse* CFURLResponseRef;
32 typedef const struct _CFURLRequest* CFURLRequestRef;
33 typedef struct _CFURLRequest* CFMutableURLRequestRef;
34
35 typedef struct _CFURLCredential* WKCFURLCredentialRef;
36 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
37
38 typedef enum {
39     WKCertificateParseResultSucceeded  = 0,
40     WKCertificateParseResultFailed     = 1,
41     WKCertificateParseResultPKCS7      = 2,
42 } WKCertificateParseResult;
43
44 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
45 void WKSetDefaultLocalization(CFStringRef localization);
46
47 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
48 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
49
50 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
51 NSArray *WKGetExtensionsForMIMEType(NSString *type);
52 NSString *WKGetMIMETypeForExtension(NSString *extension);
53
54 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
55 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
56
57 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
58
59 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
60
61 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
62 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
63
64 #if !TARGET_OS_IPHONE
65 void WKShowKeyAndMain(void);
66 #ifndef __LP64__
67 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
68 unsigned WKCarbonWindowMask(void);
69 void *WKGetNativeWindowFromWindowRef(WindowRef);
70 OSType WKCarbonWindowPropertyCreator(void);
71 OSType WKCarbonWindowPropertyTag(void);
72 #endif
73
74 void WKDisableCGDeferredUpdates(void);
75 #endif
76
77 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
78 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
79
80 #if !TARGET_OS_IPHONE
81 #ifndef __LP64__
82 unsigned WKGetNSAutoreleasePoolCount(void);
83 #endif
84
85 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
86
87 NSString *WKMouseMovedNotification(void);
88 NSString *WKWindowWillOrderOnScreenNotification(void);
89 NSString *WKWindowWillOrderOffScreenNotification(void);
90 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
91
92 CFTypeID WKGetAXTextMarkerTypeID(void);
93 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
94 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
95 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
96 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
97 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
98 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
99 void WKAccessibilityHandleFocusChanged(void);
100 AXUIElementRef WKCreateAXUIElementRef(id element);
101 void WKUnregisterUniqueIdForElement(id element);
102     
103 NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
104 NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
105 #endif
106     
107 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
108 BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
109
110 // Remote Accessibility API.
111 void WKAXRegisterRemoteApp(void);
112 void WKAXInitializeElementWithPresenterPid(id, pid_t);
113 NSData *WKAXRemoteTokenForElement(id);
114 id WKAXRemoteElementForToken(NSData *);
115 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
116 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
117 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
118
119 void WKSetUpFontCache(void);
120
121 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
122 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
123 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
124
125 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
126     void (*formFinalize)(CFReadStreamRef, void *), 
127     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
128     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
129     Boolean (*formCanRead)(CFReadStreamRef, void *), 
130     void (*formClose)(CFReadStreamRef, void *), 
131     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
132     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
133     void *context);
134
135 #if !TARGET_OS_IPHONE
136 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
137
138 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
139     // The CG context's current path is the focus ring's path.
140     // A color of 0 means "use system focus ring color".
141     // A radius of 0 means "use default focus ring radius".
142
143 void WKSetDragImage(NSImage *image, NSPoint offset);
144
145 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
146 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
147 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
148 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
149 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
150 void WKSendUserChangeNotifications(void);
151 #ifndef __LP64__
152 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
153 void WKSendKeyEventToTSM(NSEvent *theEvent);
154 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
155 #endif
156
157 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
158 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
159 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
160 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
161 #endif
162
163 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
164
165
166 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
167 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
168 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
169
170 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
171 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
172
173 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
174
175 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
176 enum {
177     WKCTFontTransformApplyShaping = (1 << 0),
178     WKCTFontTransformApplyPositioning = (1 << 1)
179 };
180
181 typedef int WKCTFontTransformOptions;
182
183 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
184 #endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
185
186 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
187
188 CGSize WKCTRunGetInitialAdvance(CTRunRef);
189
190 #if (TARGET_OS_IPHONE && TARGET_OS_EMBEDDED) || MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
191 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
192 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
193 #endif
194
195 typedef enum {
196     WKPatternTilingNoDistortion,
197     WKPatternTilingConstantSpacingMinimalDistortion,
198     WKPatternTilingConstantSpacing
199 } WKPatternTiling;
200
201 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
202 void WKCGContextResetClip(CGContextRef);
203
204 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
205 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
206 #endif
207
208 #if !TARGET_OS_IPHONE
209 #ifndef __LP64__
210 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
211 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
212 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
213 #endif
214
215 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
216 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
217
218 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
219
220 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
221 // use that enum directly).
222 typedef enum {
223     WKThemeScrollBarArrowsSingle     = 0,
224     WKThemeScrollBarArrowsLowerRight = 1,
225     WKThemeScrollBarArrowsDouble     = 2,
226     WKThemeScrollBarArrowsUpperLeft  = 3,
227 } WKThemeScrollBarArrowStyle;
228
229 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
230 #endif
231
232
233 BOOL WKCGContextIsBitmapContext(CGContextRef context);
234 bool WKCGContextIsPDFContext(CGContextRef context);
235
236 #if !TARGET_OS_IPHONE
237 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
238
239 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
240
241 typedef enum {
242     WKMovieTypeUnknown,
243     WKMovieTypeDownload,
244     WKMovieTypeStoredStream,
245     WKMovieTypeLiveStream
246 } WKMovieType;
247
248 int WKQTMovieGetType(QTMovie* movie);
249
250 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
251 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
252 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
253 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
254
255 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
256 int WKQTMovieDataRate(QTMovie* movie);
257 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
258 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
259 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
260 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
261 void WKQTMovieDisableComponent(uint32_t[5]);
262 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
263 #endif
264
265 CFStringRef WKCopyFoundationCacheDirectory(void);
266
267 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
268 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
269 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
270 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
271 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
272
273 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
274 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
275 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
276 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
277 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
278 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *, NSURL *);
279 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
280 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
281 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
282
283 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
284 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
285 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
286 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
287 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
288
289 #if !TARGET_OS_IPHONE
290 void WKSetVisibleApplicationName(CFStringRef);
291 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
292 #endif
293
294 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
295
296 #if !TARGET_OS_IPHONE
297 typedef enum {
298     WKMediaUIPartFullscreenButton   = 0,
299     WKMediaUIPartMuteButton,
300     WKMediaUIPartPlayButton,
301     WKMediaUIPartSeekBackButton,
302     WKMediaUIPartSeekForwardButton,
303     WKMediaUIPartTimelineSlider,
304     WKMediaUIPartTimelineSliderThumb,
305     WKMediaUIPartRewindButton,
306     WKMediaUIPartSeekToRealtimeButton,
307     WKMediaUIPartShowClosedCaptionsButton,
308     WKMediaUIPartHideClosedCaptionsButton,
309     WKMediaUIPartUnMuteButton,
310     WKMediaUIPartPauseButton,
311     WKMediaUIPartBackground,
312     WKMediaUIPartCurrentTimeDisplay,
313     WKMediaUIPartTimeRemainingDisplay,
314     WKMediaUIPartStatusDisplay,
315     WKMediaUIPartControlsPanel,
316     WKMediaUIPartVolumeSliderContainer,
317     WKMediaUIPartVolumeSlider,
318     WKMediaUIPartVolumeSliderThumb,
319     WKMediaUIPartFullScreenVolumeSlider,
320     WKMediaUIPartFullScreenVolumeSliderThumb,
321     WKMediaUIPartVolumeSliderMuteButton,
322     WKMediaUIPartTextTrackDisplayContainer,
323     WKMediaUIPartTextTrackDisplay,
324     WKMediaUIPartExitFullscreenButton,
325 } WKMediaUIPart;
326
327 typedef enum {
328     WKMediaControllerFlagDisabled = 1 << 0,
329     WKMediaControllerFlagPressed = 1 << 1,
330     WKMediaControllerFlagDrawEndCaps = 1 << 3,
331     WKMediaControllerFlagFocused = 1 << 4
332 } WKMediaControllerThemeState;
333
334 BOOL WKHitTestMediaUIPart(int part, CGRect bounds, CGPoint point);
335 void WKMeasureMediaUIPart(int part, CGRect *bounds, CGSize *naturalSize);
336 void WKDrawMediaUIPart(int part, CGContextRef context, CGRect rect, unsigned state);
337 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
338 NSView *WKCreateMediaUIBackgroundView(void);
339
340 typedef enum {
341     WKMediaUIControlTimeline,
342     WKMediaUIControlSlider,
343     WKMediaUIControlPlayPauseButton,
344     WKMediaUIControlExitFullscreenButton,
345     WKMediaUIControlRewindButton,
346     WKMediaUIControlFastForwardButton,
347     WKMediaUIControlVolumeUpButton,
348     WKMediaUIControlVolumeDownButton
349 } WKMediaUIControlType;
350     
351 NSControl *WKCreateMediaUIControl(int controlType);
352
353 NSArray *WKQTGetSitesInMediaDownloadCache();
354 void WKQTClearMediaDownloadCacheForSite(NSString *site);
355 void WKQTClearMediaDownloadCache();
356     
357 mach_port_t WKInitializeRenderServer(void);
358 #endif
359
360 @class CALayer;
361
362 CALayer *WKMakeRenderLayer(uint32_t contextID);
363     
364 #if !TARGET_OS_IPHONE
365 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
366
367 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
368 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
369 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
370 #endif
371
372 typedef struct __WKCAContextRef *WKCAContextRef;
373
374 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
375 #if !TARGET_OS_IPHONE
376 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
377 #endif
378 void WKCAContextInvalidate(WKCAContextRef);
379 uint32_t WKCAContextGetContextId(WKCAContextRef);
380 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
381 CALayer *WKCAContextGetLayer(WKCAContextRef);
382 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
383 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
384 void WKDestroyRenderingResources(void);
385
386 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
387
388 @class CARenderer;
389
390 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
391 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
392
393 #if !TARGET_OS_IPHONE
394 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
395
396 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
397 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
398 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
399
400 void WKWindowSetClipRect(NSWindow*, NSRect);
401
402 #if defined(__x86_64__)
403 #import <mach/mig.h>
404 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
405 #endif
406
407 NSUInteger WKGetInputPanelWindowStyle(void);
408 UInt8 WKGetNSEventKeyChar(NSEvent *);
409 #endif
410
411 @class CAPropertyAnimation;
412 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
413
414 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
415 int WKGetHTTPRequestPriority(CFURLRequestRef);
416 void WKSetHTTPRequestMaximumPriority(int maximumPriority);
417 void WKSetHTTPRequestPriority(CFURLRequestRef, int priority);
418 void WKSetHTTPRequestMinimumFastLanePriority(int priority);
419 void WKHTTPRequestEnablePipelining(CFURLRequestRef);
420
421 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
422 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
423 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
424
425 #if !TARGET_OS_IPHONE
426 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
427 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
428
429 void WKSyncSurfaceToView(NSView *view);
430
431 void WKEnableSettingCursorWhenInBackground(void);
432 #endif
433
434 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
435 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
436
437 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
438 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
439
440 #if !TARGET_OS_IPHONE && !defined(__LP64__)
441 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
442 #endif
443
444 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
445 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
446
447 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
448 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
449 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
450 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
451 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
452
453 CIFormat WKCIGetRGBA8Format(void);
454
455 #if !TARGET_OS_IPHONE
456 typedef enum {
457     WKSandboxExtensionTypeReadOnly,
458     WKSandboxExtensionTypeReadWrite,
459 } WKSandboxExtensionType;
460 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
461
462 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
463 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
464
465 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
466 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
467
468 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
469 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
470
471 OSStatus WKEnableSandboxStyleFileQuarantine(void);
472
473 int WKRecommendedScrollerStyle(void);
474
475 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
476
477 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
478 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
479 void WKHideWordDefinitionWindow(void);
480 #endif
481
482 #if !TARGET_OS_IPHONE
483 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
484 #endif
485
486 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
487
488 NSURL* WKAVAssetResolvedURL(AVAsset*);
489
490 #if !TARGET_OS_IPHONE
491 NSCursor *WKCursor(const char *name);
492 #endif
493
494 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
495 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
496 dispatch_source_t WKCreateMemoryStatusPressureCriticalDispatchOnMainQueue(void);
497 #endif
498     
499 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
500 bool WKExecutableWasLinkedOnOrBeforeLion(void);
501 #endif
502
503 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
504 bool WKExecutableWasLinkedOnOrBeforeMountainLion(void);
505 #endif
506
507 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
508
509 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
510
511 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
512 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
513 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
514 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
515 #endif
516
517 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
518 typedef enum {
519     WKOcclusionNotificationTypeApplicationBecameVisible,
520     WKOcclusionNotificationTypeApplicationBecameOccluded,
521     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
522     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
523     WKOcclusionNotificationTypeWindowBecameVisible,
524     WKOcclusionNotificationTypeWindowBecameOccluded,
525 } WKOcclusionNotificationType;
526
527 typedef uint32_t WKWindowID;
528
529 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
530
531 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
532 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
533 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
534 #endif
535
536 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
537
538 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
539 bool WKIsPublicSuffix(NSString *domain);
540
541 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
542 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
543
544 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
545 CFStringRef WKCachePartitionKey(void);
546 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
547 #endif
548
549 #ifdef __cplusplus
550 }
551 #endif