Don't instantiate the Java plug-in if it's inactive
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10
11 @class AVAsset;
12 @class QTMovie;
13 @class QTMovieView;
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 typedef struct _CFURLResponse* CFURLResponseRef;
20 typedef const struct _CFURLRequest* CFURLRequestRef;
21 typedef struct _CFURLRequest* CFMutableURLRequestRef;
22
23 typedef struct _CFURLCredential* WKCFURLCredentialRef;
24 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
25
26 typedef enum {
27     WKCertificateParseResultSucceeded  = 0,
28     WKCertificateParseResultFailed     = 1,
29     WKCertificateParseResultPKCS7      = 2,
30 } WKCertificateParseResult;
31
32 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
33 void WKSetDefaultLocalization(CFStringRef localization);
34
35 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
36 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
37
38 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
39 NSArray *WKGetExtensionsForMIMEType(NSString *type);
40 NSString *WKGetMIMETypeForExtension(NSString *extension);
41
42 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
43 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
44 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
45
46 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
47
48 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
49
50 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
51 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
52
53 void WKShowKeyAndMain(void);
54 #ifndef __LP64__
55 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
56 unsigned WKCarbonWindowMask(void);
57 void *WKGetNativeWindowFromWindowRef(WindowRef);
58 OSType WKCarbonWindowPropertyCreator(void);
59 OSType WKCarbonWindowPropertyTag(void);
60 #endif
61
62 typedef id WKNSURLConnectionDelegateProxyPtr;
63
64 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
65
66 void WKDisableCGDeferredUpdates(void);
67
68 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
69 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
70
71 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
72
73 unsigned WKGetNSAutoreleasePoolCount(void);
74
75 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
76
77 NSString *WKMouseMovedNotification(void);
78 NSString *WKWindowWillOrderOnScreenNotification(void);
79 NSString *WKWindowWillOrderOffScreenNotification(void);
80 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
81
82 CFTypeID WKGetAXTextMarkerTypeID(void);
83 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
84 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
85 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
86 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
87 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
88 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
89 void WKAccessibilityHandleFocusChanged(void);
90 AXUIElementRef WKCreateAXUIElementRef(id element);
91 void WKUnregisterUniqueIdForElement(id element);
92
93 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
94
95 // Remote Accessibility API.
96 void WKAXRegisterRemoteApp(void);
97 void WKAXInitializeElementWithPresenterPid(id, pid_t);
98 NSData *WKAXRemoteTokenForElement(id);
99 id WKAXRemoteElementForToken(NSData *);
100 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
101 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
102 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
103
104 void WKSetUpFontCache(void);
105
106 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
107 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
108 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
109
110 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
111     void (*formFinalize)(CFReadStreamRef, void *), 
112     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
113     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
114     Boolean (*formCanRead)(CFReadStreamRef, void *), 
115     void (*formClose)(CFReadStreamRef, void *), 
116     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
117     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
118     void *context);
119
120 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
121
122 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
123     // The CG context's current path is the focus ring's path.
124     // A color of 0 means "use system focus ring color".
125     // A radius of 0 means "use default focus ring radius".
126
127 void WKSetDragImage(NSImage *image, NSPoint offset);
128
129 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
130 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
131 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
132 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
133 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
134 void WKSendUserChangeNotifications(void);
135 #ifndef __LP64__
136 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
137 void WKSendKeyEventToTSM(NSEvent *theEvent);
138 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
139 #endif
140
141 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
142 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
143 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
144 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
145 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
146
147
148 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
149 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
150 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
151
152 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
153 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
154
155 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
156
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 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
169 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
170
171 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
172 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
173 #endif
174
175 typedef enum {
176     WKPatternTilingNoDistortion,
177     WKPatternTilingConstantSpacingMinimalDistortion,
178     WKPatternTilingConstantSpacing
179 } WKPatternTiling;
180
181 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
182 void WKCGContextResetClip(CGContextRef);
183
184 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
185 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
186 #endif
187
188 #ifndef __LP64__
189 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
190 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
191 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
192 #endif
193
194 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
195 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
196
197 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
198
199 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
200 // use that enum directly).
201 typedef enum {
202     WKThemeScrollBarArrowsSingle     = 0,
203     WKThemeScrollBarArrowsLowerRight = 1,
204     WKThemeScrollBarArrowsDouble     = 2,
205     WKThemeScrollBarArrowsUpperLeft  = 3,
206 } WKThemeScrollBarArrowStyle;
207
208 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
209
210
211 BOOL WKCGContextIsBitmapContext(CGContextRef context);
212
213 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
214
215 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
216
217 typedef enum {
218     WKMovieTypeUnknown,
219     WKMovieTypeDownload,
220     WKMovieTypeStoredStream,
221     WKMovieTypeLiveStream
222 } WKMovieType;
223
224 int WKQTMovieGetType(QTMovie* movie);
225
226 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
227 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
228 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
229 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
230
231 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
232 int WKQTMovieDataRate(QTMovie* movie);
233 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
234 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
235 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
236 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
237 void WKQTMovieDisableComponent(uint32_t[5]);
238 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
239
240 CFStringRef WKCopyFoundationCacheDirectory(void);
241
242 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
243 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
244 #else
245 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
246 #endif
247 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
248 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
249 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
250 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
251
252 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
253 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
254 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
255 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
256 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
257 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
258 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
259
260 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
261 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
262 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
263 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
264 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
265
266 void WKSetVisibleApplicationName(CFStringRef);
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 __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
349
350 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
351 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
352 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
353 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
354 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
355
356 typedef struct __WKCAContextRef *WKCAContextRef;
357
358 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
359 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
360 void WKCAContextInvalidate(WKCAContextRef);
361 uint32_t WKCAContextGetContextId(WKCAContextRef);
362 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
363 CALayer *WKCAContextGetLayer(WKCAContextRef);
364 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
365 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
366
367 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
368 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
369 #endif
370
371 @class CARenderer;
372
373 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
374 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
375
376 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
377
378 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
379 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
380 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
381
382 void WKWindowSetClipRect(NSWindow*, NSRect);
383
384 #if defined(__x86_64__)
385 #import <mach/mig.h>
386 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
387 #endif // defined(__x86_64__)
388
389 NSUInteger WKGetInputPanelWindowStyle(void);
390 UInt8 WKGetNSEventKeyChar(NSEvent *);
391
392 @class CAPropertyAnimation;
393 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
394
395 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
396 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
397 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
398 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
399 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
400
401 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
402 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
403 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
404
405 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
406 typedef enum {
407     WKEventPhaseNone = 0,
408     WKEventPhaseBegan = 1,
409     WKEventPhaseChanged = 2,
410     WKEventPhaseEnded = 3,
411 } WKEventPhase;
412
413 int WKGetNSEventMomentumPhase(NSEvent *);
414 #endif
415
416 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
417 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
418
419 void WKSyncSurfaceToView(NSView *view);
420
421 void WKEnableSettingCursorWhenInBackground(void);
422
423 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
424 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
425
426 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
427 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
428
429 #ifndef __LP64__
430 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
431 #endif
432
433 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
434 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
435 #endif
436
437 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
438 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
439
440 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
441 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
442 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
443 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
444 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
445
446 CIFormat WKCIGetRGBA8Format(void);
447
448 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
449
450 typedef enum {
451     WKSandboxExtensionTypeReadOnly,
452     WKSandboxExtensionTypeWriteOnly,    
453     WKSandboxExtensionTypeReadWrite,
454 } WKSandboxExtensionType;
455 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
456
457 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
458 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
459
460 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
461 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
462
463 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
464 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
465
466 OSStatus WKEnableSandboxStyleFileQuarantine(void);
467
468 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
469
470 int WKRecommendedScrollerStyle(void);
471
472 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
473
474 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
475 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
476 void WKHideWordDefinitionWindow(void);
477
478 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
479
480 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
481
482 NSURL* WKAVAssetResolvedURL(AVAsset*);
483
484 NSCursor *WKCursor(const char *name);
485
486 #endif
487
488 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
489
490 #import <dispatch/dispatch.h>
491
492 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
493
494 #endif
495
496 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
497 NSString *WKGetMacOSXVersionString(void);
498 bool WKExecutableWasLinkedOnOrBeforeLion(void);
499 #endif
500
501 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
502 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
503 #endif
504
505 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
506 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
507 #endif
508
509 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
510 @class WebFilterEvaluator;
511
512 BOOL WKFilterIsManagedSession(void);
513 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
514 void WKFilterRelease(WebFilterEvaluator *);
515 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
516 const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
517 const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
518
519 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
520 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
521 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
522 #endif
523
524 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
525 Boolean WKJLIsRuntimeAndWebComponentsInstalled(void);
526 void WKJLReportWebComponentsUsed(void);
527 #endif
528
529 typedef enum {
530     WKCaptionFontStyleDefault = 0,
531     WKCaptionFontStyleMonospacedWithSerif,
532     WKCaptionFontStyleProportionalWithSerif,
533     WKCaptionFontStyleMonospacedWithoutSerif,
534     WKCaptionFontStyleProportionalWithoutSerif,
535     WKCaptionFontStyleCasual,
536     WKCaptionFontStyleCursive,
537     WKCaptionFontStyleSmallCapital,
538     WKCaptionFontStyleMax
539 } WKCaptionFontStyle;
540
541 typedef enum {
542     WKCaptionTextEdgeStyleUndefined = 0,
543     WKCaptionTextEdgeStyleNone,
544     WKCaptionTextEdgeStyleRaised,
545     WKCaptionTextEdgeStyleDepressed,
546     WKCaptionTextEdgeStyleUniform,
547     WKCaptionTextEdgeStyleDropShadow,
548     WKCaptionTextEdgeStyleMax
549 } WKCaptionTextEdgeStyle;
550
551 bool WKCaptionAppearanceHasUserPreferences(void);
552 bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
553 CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
554 CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
555 CGColorRef WKCaptionAppearanceCopyWindowColor(void);
556 bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
557 bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
558 bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
559 CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
560 bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
561 int WKCaptionAppearanceGetTextEdgeStyle(void);
562 CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
563
564 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
565 typedef enum {
566     WKOcclusionNotificationTypeApplicationBecameVisible,
567     WKOcclusionNotificationTypeApplicationBecameOccluded
568 } WKOcclusionNotificationType;
569
570 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void*, uint32_t, void*, uint32_t);
571
572 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
573 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
574 #endif
575
576 #ifdef __cplusplus
577 }
578 #endif