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