Add WKContextIsPlugInUpdateAvailable
[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 #import <dispatch/dispatch.h>
11
12 @class AVAsset;
13 @class QTMovie;
14 @class QTMovieView;
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 typedef struct _CFURLResponse* CFURLResponseRef;
21 typedef const struct _CFURLRequest* CFURLRequestRef;
22 typedef struct _CFURLRequest* CFMutableURLRequestRef;
23
24 typedef struct _CFURLCredential* WKCFURLCredentialRef;
25 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
26
27 typedef enum {
28     WKCertificateParseResultSucceeded  = 0,
29     WKCertificateParseResultFailed     = 1,
30     WKCertificateParseResultPKCS7      = 2,
31 } WKCertificateParseResult;
32
33 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
34 void WKSetDefaultLocalization(CFStringRef localization);
35
36 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
37 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
38
39 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
40 NSArray *WKGetExtensionsForMIMEType(NSString *type);
41 NSString *WKGetMIMETypeForExtension(NSString *extension);
42
43 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
44 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
45 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
46
47 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
48
49 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
50
51 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
52 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
53
54 void WKShowKeyAndMain(void);
55 #ifndef __LP64__
56 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
57 unsigned WKCarbonWindowMask(void);
58 void *WKGetNativeWindowFromWindowRef(WindowRef);
59 OSType WKCarbonWindowPropertyCreator(void);
60 OSType WKCarbonWindowPropertyTag(void);
61 #endif
62
63 typedef id WKNSURLConnectionDelegateProxyPtr;
64
65 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
66
67 void WKDisableCGDeferredUpdates(void);
68
69 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
70 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
71
72 unsigned WKGetNSAutoreleasePoolCount(void);
73
74 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
75
76 NSString *WKMouseMovedNotification(void);
77 NSString *WKWindowWillOrderOnScreenNotification(void);
78 NSString *WKWindowWillOrderOffScreenNotification(void);
79 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
80
81 CFTypeID WKGetAXTextMarkerTypeID(void);
82 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
83 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
84 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
85 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
86 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
87 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
88 void WKAccessibilityHandleFocusChanged(void);
89 AXUIElementRef WKCreateAXUIElementRef(id element);
90 void WKUnregisterUniqueIdForElement(id element);
91
92 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
93 BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
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, BOOL shouldSubpixelQuantize);
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
157 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
158 enum {
159     WKCTFontTransformApplyShaping = (1 << 0),
160     WKCTFontTransformApplyPositioning = (1 << 1)
161 };
162
163 typedef int WKCTFontTransformOptions;
164
165 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
166 #endif
167
168 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
169
170 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
171 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
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 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
241 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
242 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
243 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
244 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
245
246 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
247 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
248 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
249 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
250 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
251 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
252 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
253 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
254 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
255
256 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
257 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
258 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
259 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
260 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
261
262 void WKSetVisibleApplicationName(CFStringRef);
263
264 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
265
266 typedef enum {
267     WKMediaUIPartFullscreenButton   = 0,
268     WKMediaUIPartMuteButton,
269     WKMediaUIPartPlayButton,
270     WKMediaUIPartSeekBackButton,
271     WKMediaUIPartSeekForwardButton,
272     WKMediaUIPartTimelineSlider,
273     WKMediaUIPartTimelineSliderThumb,
274     WKMediaUIPartRewindButton,
275     WKMediaUIPartSeekToRealtimeButton,
276     WKMediaUIPartShowClosedCaptionsButton,
277     WKMediaUIPartHideClosedCaptionsButton,
278     WKMediaUIPartUnMuteButton,
279     WKMediaUIPartPauseButton,
280     WKMediaUIPartBackground,
281     WKMediaUIPartCurrentTimeDisplay,
282     WKMediaUIPartTimeRemainingDisplay,
283     WKMediaUIPartStatusDisplay,
284     WKMediaUIPartControlsPanel,
285     WKMediaUIPartVolumeSliderContainer,
286     WKMediaUIPartVolumeSlider,
287     WKMediaUIPartVolumeSliderThumb,
288     WKMediaUIPartFullScreenVolumeSlider,
289     WKMediaUIPartFullScreenVolumeSliderThumb,
290     WKMediaUIPartVolumeSliderMuteButton,
291     WKMediaUIPartTextTrackDisplayContainer,
292     WKMediaUIPartTextTrackDisplay,
293     WKMediaUIPartExitFullscreenButton,
294 } WKMediaUIPart;
295
296 typedef enum {
297     WKMediaControllerThemeClassic   = 1,
298     WKMediaControllerThemeQuickTime = 2
299 } WKMediaControllerThemeStyle;
300
301 typedef enum {
302     WKMediaControllerFlagDisabled = 1 << 0,
303     WKMediaControllerFlagPressed = 1 << 1,
304     WKMediaControllerFlagDrawEndCaps = 1 << 3,
305     WKMediaControllerFlagFocused = 1 << 4
306 } WKMediaControllerThemeState;
307
308 BOOL WKMediaControllerThemeAvailable(int themeStyle);
309 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
310 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
311 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
312 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
313 NSView *WKCreateMediaUIBackgroundView(void);
314
315 typedef enum {
316     WKMediaUIControlTimeline,
317     WKMediaUIControlSlider,
318     WKMediaUIControlPlayPauseButton,
319     WKMediaUIControlExitFullscreenButton,
320     WKMediaUIControlRewindButton,
321     WKMediaUIControlFastForwardButton,
322     WKMediaUIControlVolumeUpButton,
323     WKMediaUIControlVolumeDownButton
324 } WKMediaUIControlType;
325     
326 NSControl *WKCreateMediaUIControl(int controlType);
327
328 NSArray *WKQTGetSitesInMediaDownloadCache();
329 void WKQTClearMediaDownloadCacheForSite(NSString *site);
330 void WKQTClearMediaDownloadCache();
331     
332 mach_port_t WKInitializeRenderServer(void);
333     
334 @class CALayer;
335
336 CALayer *WKMakeRenderLayer(uint32_t contextID);
337     
338 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
339
340 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
341 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
342 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
343
344 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
345
346 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
347 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
348 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
349 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
350 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
351
352 typedef struct __WKCAContextRef *WKCAContextRef;
353
354 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
355 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
356 void WKCAContextInvalidate(WKCAContextRef);
357 uint32_t WKCAContextGetContextId(WKCAContextRef);
358 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
359 CALayer *WKCAContextGetLayer(WKCAContextRef);
360 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
361 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
362 void WKCABackingStoreCollectBlocking(void);
363
364 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
365
366 @class CARenderer;
367
368 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
369 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
370
371 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
372
373 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
374 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
375 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
376
377 void WKWindowSetClipRect(NSWindow*, NSRect);
378
379 #if defined(__x86_64__)
380 #import <mach/mig.h>
381 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
382 #endif // defined(__x86_64__)
383
384 NSUInteger WKGetInputPanelWindowStyle(void);
385 UInt8 WKGetNSEventKeyChar(NSEvent *);
386
387 @class CAPropertyAnimation;
388 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
389
390 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
391 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
392 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
393 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
394 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
395
396 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
397 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
398 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
399
400 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
401 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
402
403 void WKSyncSurfaceToView(NSView *view);
404
405 void WKEnableSettingCursorWhenInBackground(void);
406
407 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
408 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
409
410 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
411 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
412
413 #ifndef __LP64__
414 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
415 #endif
416
417 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
418 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
419
420 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
421 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
422 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
423 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
424 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
425
426 CIFormat WKCIGetRGBA8Format(void);
427
428 typedef enum {
429     WKSandboxExtensionTypeReadOnly,
430     WKSandboxExtensionTypeReadWrite,
431 } WKSandboxExtensionType;
432 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
433
434 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
435 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
436
437 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
438 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
439
440 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
441 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
442
443 OSStatus WKEnableSandboxStyleFileQuarantine(void);
444
445 int WKRecommendedScrollerStyle(void);
446
447 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
448
449 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
450 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
451 void WKHideWordDefinitionWindow(void);
452
453 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
454
455 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
456
457 NSURL* WKAVAssetResolvedURL(AVAsset*);
458
459 NSCursor *WKCursor(const char *name);
460
461 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
462
463 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
464 bool WKExecutableWasLinkedOnOrBeforeLion(void);
465 #endif
466
467 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
468
469 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
470
471 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
472 @class WebFilterEvaluator;
473
474 BOOL WKFilterIsManagedSession(void);
475 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
476 BOOL WKFilterIsBuffering(WebFilterEvaluator *);
477 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
478 NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
479 NSData *WKFilterDataComplete(WebFilterEvaluator *);
480
481 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
482 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
483 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
484 #endif
485
486 typedef enum {
487     WKCaptionFontStyleDefault = 0,
488     WKCaptionFontStyleMonospacedWithSerif,
489     WKCaptionFontStyleProportionalWithSerif,
490     WKCaptionFontStyleMonospacedWithoutSerif,
491     WKCaptionFontStyleProportionalWithoutSerif,
492     WKCaptionFontStyleCasual,
493     WKCaptionFontStyleCursive,
494     WKCaptionFontStyleSmallCapital,
495     WKCaptionFontStyleMax
496 } WKCaptionFontStyle;
497
498 typedef enum {
499     WKCaptionTextEdgeStyleUndefined = 0,
500     WKCaptionTextEdgeStyleNone,
501     WKCaptionTextEdgeStyleRaised,
502     WKCaptionTextEdgeStyleDepressed,
503     WKCaptionTextEdgeStyleUniform,
504     WKCaptionTextEdgeStyleDropShadow,
505     WKCaptionTextEdgeStyleMax
506 } WKCaptionTextEdgeStyle;
507
508 bool WKCaptionAppearanceHasUserPreferences(void);
509 bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
510 CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
511 CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
512 CGColorRef WKCaptionAppearanceCopyWindowColor(void);
513 bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
514 bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
515 bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
516 CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
517 bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
518 int WKCaptionAppearanceGetTextEdgeStyle(void);
519 CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
520
521 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
522 typedef enum {
523     WKOcclusionNotificationTypeApplicationBecameVisible,
524     WKOcclusionNotificationTypeApplicationBecameOccluded,
525     WKOcclusionNotificationTypeWindowBecameVisible,
526     WKOcclusionNotificationTypeWindowBecameOccluded
527 } WKOcclusionNotificationType;
528
529 typedef uint32_t WKWindowID;
530
531 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
532
533 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
534 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
535 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
536
537 enum {
538     WKProcessAssertionTypeVisible = (1UL << 10)
539 };
540
541 typedef NSUInteger WKProcessAssertionTypes;
542 id WKNSProcessInfoProcessAssertionWithTypes(WKProcessAssertionTypes);
543 #endif
544
545 bool WKIsJavaPlugInActive(void);
546 void WKActivateJavaPlugIn(void);
547
548 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
549
550 #ifdef __cplusplus
551 }
552 #endif