Get rid of setCookieStoragePrivateBrowsingEnabled.
[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 unsigned WKGetNSAutoreleasePoolCount(void);
72
73 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
74
75 NSString *WKMouseMovedNotification(void);
76 NSString *WKWindowWillOrderOnScreenNotification(void);
77 NSString *WKWindowWillOrderOffScreenNotification(void);
78 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
79
80 CFTypeID WKGetAXTextMarkerTypeID(void);
81 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
82 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
83 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
84 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
85 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
86 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
87 void WKAccessibilityHandleFocusChanged(void);
88 AXUIElementRef WKCreateAXUIElementRef(id element);
89 void WKUnregisterUniqueIdForElement(id element);
90
91 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
92
93 // Remote Accessibility API.
94 void WKAXRegisterRemoteApp(void);
95 void WKAXInitializeElementWithPresenterPid(id, pid_t);
96 NSData *WKAXRemoteTokenForElement(id);
97 id WKAXRemoteElementForToken(NSData *);
98 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
99 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
100 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
101
102 void WKSetUpFontCache(void);
103
104 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
105 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
106 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
107
108 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
109     void (*formFinalize)(CFReadStreamRef, void *), 
110     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
111     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
112     Boolean (*formCanRead)(CFReadStreamRef, void *), 
113     void (*formClose)(CFReadStreamRef, void *), 
114     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
115     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
116     void *context);
117
118 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
119
120 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
121     // The CG context's current path is the focus ring's path.
122     // A color of 0 means "use system focus ring color".
123     // A radius of 0 means "use default focus ring radius".
124
125 void WKSetDragImage(NSImage *image, NSPoint offset);
126
127 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
128 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
129 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
130 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
131 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
132 void WKSendUserChangeNotifications(void);
133 #ifndef __LP64__
134 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
135 void WKSendKeyEventToTSM(NSEvent *theEvent);
136 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
137 #endif
138
139 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
140 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
141 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
142 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
143 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
144
145
146 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
147 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
148 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
149
150 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
151 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
152
153 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
154
155 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
156 enum {
157     WKCTFontTransformApplyShaping = (1 << 0),
158     WKCTFontTransformApplyPositioning = (1 << 1)
159 };
160
161 typedef int WKCTFontTransformOptions;
162
163 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
164 #endif
165
166 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
167 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
168
169 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
170 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
171 #endif
172
173 typedef enum {
174     WKPatternTilingNoDistortion,
175     WKPatternTilingConstantSpacingMinimalDistortion,
176     WKPatternTilingConstantSpacing
177 } WKPatternTiling;
178
179 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
180 void WKCGContextResetClip(CGContextRef);
181
182 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
183 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
184 #endif
185
186 #ifndef __LP64__
187 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
188 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
189 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
190 #endif
191
192 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
193 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
194
195 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
196
197 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
198 // use that enum directly).
199 typedef enum {
200     WKThemeScrollBarArrowsSingle     = 0,
201     WKThemeScrollBarArrowsLowerRight = 1,
202     WKThemeScrollBarArrowsDouble     = 2,
203     WKThemeScrollBarArrowsUpperLeft  = 3,
204 } WKThemeScrollBarArrowStyle;
205
206 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
207
208
209 BOOL WKCGContextIsBitmapContext(CGContextRef context);
210
211 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
212
213 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
214
215 typedef enum {
216     WKMovieTypeUnknown,
217     WKMovieTypeDownload,
218     WKMovieTypeStoredStream,
219     WKMovieTypeLiveStream
220 } WKMovieType;
221
222 int WKQTMovieGetType(QTMovie* movie);
223
224 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
225 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
226 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
227 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
228
229 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
230 int WKQTMovieDataRate(QTMovie* movie);
231 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
232 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
233 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
234 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
235 void WKQTMovieDisableComponent(uint32_t[5]);
236 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
237
238 CFStringRef WKCopyFoundationCacheDirectory(void);
239
240 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
241 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
242 #else
243 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
244 #endif
245 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
246 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
247 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
248 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
249
250 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
251 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
252 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
253 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
254 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
255 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
256 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
257
258 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
259 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
260 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
261 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
262 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
263
264 void WKSetVisibleApplicationName(CFStringRef);
265
266 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
267
268 typedef enum {
269     WKMediaUIPartFullscreenButton   = 0,
270     WKMediaUIPartMuteButton,
271     WKMediaUIPartPlayButton,
272     WKMediaUIPartSeekBackButton,
273     WKMediaUIPartSeekForwardButton,
274     WKMediaUIPartTimelineSlider,
275     WKMediaUIPartTimelineSliderThumb,
276     WKMediaUIPartRewindButton,
277     WKMediaUIPartSeekToRealtimeButton,
278     WKMediaUIPartShowClosedCaptionsButton,
279     WKMediaUIPartHideClosedCaptionsButton,
280     WKMediaUIPartUnMuteButton,
281     WKMediaUIPartPauseButton,
282     WKMediaUIPartBackground,
283     WKMediaUIPartCurrentTimeDisplay,
284     WKMediaUIPartTimeRemainingDisplay,
285     WKMediaUIPartStatusDisplay,
286     WKMediaUIPartControlsPanel,
287     WKMediaUIPartVolumeSliderContainer,
288     WKMediaUIPartVolumeSlider,
289     WKMediaUIPartVolumeSliderThumb,
290     WKMediaUIPartFullScreenVolumeSlider,
291     WKMediaUIPartFullScreenVolumeSliderThumb,
292     WKMediaUIPartVolumeSliderMuteButton,
293     WKMediaUIPartTextTrackDisplayContainer,
294     WKMediaUIPartTextTrackDisplay,
295     WKMediaUIPartExitFullscreenButton,
296 } WKMediaUIPart;
297
298 typedef enum {
299     WKMediaControllerThemeClassic   = 1,
300     WKMediaControllerThemeQuickTime = 2
301 } WKMediaControllerThemeStyle;
302
303 typedef enum {
304     WKMediaControllerFlagDisabled = 1 << 0,
305     WKMediaControllerFlagPressed = 1 << 1,
306     WKMediaControllerFlagDrawEndCaps = 1 << 3,
307     WKMediaControllerFlagFocused = 1 << 4
308 } WKMediaControllerThemeState;
309
310 BOOL WKMediaControllerThemeAvailable(int themeStyle);
311 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
312 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
313 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
314 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
315 NSView *WKCreateMediaUIBackgroundView(void);
316
317 typedef enum {
318     WKMediaUIControlTimeline,
319     WKMediaUIControlSlider,
320     WKMediaUIControlPlayPauseButton,
321     WKMediaUIControlExitFullscreenButton,
322     WKMediaUIControlRewindButton,
323     WKMediaUIControlFastForwardButton,
324     WKMediaUIControlVolumeUpButton,
325     WKMediaUIControlVolumeDownButton
326 } WKMediaUIControlType;
327     
328 NSControl *WKCreateMediaUIControl(int controlType);
329
330 NSArray *WKQTGetSitesInMediaDownloadCache();
331 void WKQTClearMediaDownloadCacheForSite(NSString *site);
332 void WKQTClearMediaDownloadCache();
333     
334 mach_port_t WKInitializeRenderServer(void);
335     
336 @class CALayer;
337
338 CALayer *WKMakeRenderLayer(uint32_t contextID);
339     
340 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
341
342 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
343 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
344 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
345
346 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
347
348 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
349 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
350 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
351 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
352 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
353
354 typedef struct __WKCAContextRef *WKCAContextRef;
355
356 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
357 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
358 void WKCAContextInvalidate(WKCAContextRef);
359 uint32_t WKCAContextGetContextId(WKCAContextRef);
360 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
361 CALayer *WKCAContextGetLayer(WKCAContextRef);
362 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
363 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
364
365 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
366 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
367 #endif
368
369 @class CARenderer;
370
371 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
372 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
373
374 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
375
376 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
377 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
378 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
379
380 void WKWindowSetClipRect(NSWindow*, NSRect);
381
382 #if defined(__x86_64__)
383 #import <mach/mig.h>
384 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
385 #endif // defined(__x86_64__)
386
387 NSUInteger WKGetInputPanelWindowStyle(void);
388 UInt8 WKGetNSEventKeyChar(NSEvent *);
389
390 @class CAPropertyAnimation;
391 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
392
393 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
394 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
395 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
396 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
397 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
398
399 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
400 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
401 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
402
403 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
404 typedef enum {
405     WKEventPhaseNone = 0,
406     WKEventPhaseBegan = 1,
407     WKEventPhaseChanged = 2,
408     WKEventPhaseEnded = 3,
409 } WKEventPhase;
410
411 int WKGetNSEventMomentumPhase(NSEvent *);
412 #endif
413
414 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
415 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
416
417 void WKSyncSurfaceToView(NSView *view);
418
419 void WKEnableSettingCursorWhenInBackground(void);
420
421 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
422 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
423
424 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
425 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
426
427 #ifndef __LP64__
428 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
429 #endif
430
431 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
432 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
433 #endif
434
435 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
436 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
437
438 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
439 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
440 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
441 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
442 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
443
444 CIFormat WKCIGetRGBA8Format(void);
445
446 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
447
448 typedef enum {
449     WKSandboxExtensionTypeReadOnly,
450     WKSandboxExtensionTypeWriteOnly,    
451     WKSandboxExtensionTypeReadWrite,
452 } WKSandboxExtensionType;
453 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
454
455 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
456 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
457
458 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
459 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
460
461 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
462 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
463
464 OSStatus WKEnableSandboxStyleFileQuarantine(void);
465
466 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
467
468 int WKRecommendedScrollerStyle(void);
469
470 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
471
472 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
473 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
474 void WKHideWordDefinitionWindow(void);
475
476 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
477
478 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
479
480 NSURL* WKAVAssetResolvedURL(AVAsset*);
481
482 NSCursor *WKCursor(const char *name);
483
484 #endif
485
486 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
487
488 #import <dispatch/dispatch.h>
489
490 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
491
492 #endif
493
494 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
495 NSString *WKGetMacOSXVersionString(void);
496 bool WKExecutableWasLinkedOnOrBeforeLion(void);
497 #endif
498
499 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
500 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
501 #endif
502
503 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
504 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
505 #endif
506
507 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
508 @class WebFilterEvaluator;
509
510 BOOL WKFilterIsManagedSession(void);
511 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
512 void WKFilterRelease(WebFilterEvaluator *);
513 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
514 const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
515 const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
516
517 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
518 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
519 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
520 #endif
521
522 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
523 Boolean WKJLIsRuntimeAndWebComponentsInstalled(void);
524 void WKJLReportWebComponentsUsed(void);
525 #endif
526
527 typedef enum {
528     WKCaptionFontStyleDefault = 0,
529     WKCaptionFontStyleMonospacedWithSerif,
530     WKCaptionFontStyleProportionalWithSerif,
531     WKCaptionFontStyleMonospacedWithoutSerif,
532     WKCaptionFontStyleProportionalWithoutSerif,
533     WKCaptionFontStyleCasual,
534     WKCaptionFontStyleCursive,
535     WKCaptionFontStyleSmallCapital,
536     WKCaptionFontStyleMax
537 } WKCaptionFontStyle;
538
539 typedef enum {
540     WKCaptionTextEdgeStyleUndefined = 0,
541     WKCaptionTextEdgeStyleNone,
542     WKCaptionTextEdgeStyleRaised,
543     WKCaptionTextEdgeStyleDepressed,
544     WKCaptionTextEdgeStyleUniform,
545     WKCaptionTextEdgeStyleDropShadow,
546     WKCaptionTextEdgeStyleMax
547 } WKCaptionTextEdgeStyle;
548
549 bool WKCaptionAppearanceHasUserPreferences(void);
550 bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
551 CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
552 CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
553 CGColorRef WKCaptionAppearanceCopyWindowColor(void);
554 bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
555 bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
556 bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
557 CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
558 bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
559 int WKCaptionAppearanceGetTextEdgeStyle(void);
560 CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
561
562 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
563 typedef enum {
564     WKOcclusionNotificationTypeApplicationBecameVisible,
565     WKOcclusionNotificationTypeApplicationBecameOccluded
566 } WKOcclusionNotificationType;
567
568 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void*, uint32_t, void*, uint32_t);
569
570 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
571 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
572 #endif
573
574 #ifdef __cplusplus
575 }
576 #endif