2011-04-20 Eric Carlson <eric.carlson@apple.com>
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 QTMovie;
12 @class QTMovieView;
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 typedef struct _CFURLResponse* CFURLResponseRef;
19
20 typedef enum {
21     WKCertificateParseResultSucceeded  = 0,
22     WKCertificateParseResultFailed     = 1,
23     WKCertificateParseResultPKCS7      = 2,
24 } WKCertificateParseResult;
25
26 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
27 void WKSetDefaultLocalization(CFStringRef localization);
28
29 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
30 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
31
32 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
33 NSArray *WKGetExtensionsForMIMEType(NSString *type);
34 NSString *WKGetMIMETypeForExtension(NSString *extension);
35
36 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
37 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
38 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
39
40 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
41 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
42 #endif
43
44 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
45
46 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
47 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
48
49 void WKShowKeyAndMain(void);
50 #ifndef __LP64__
51 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
52 unsigned WKCarbonWindowMask(void);
53 void *WKGetNativeWindowFromWindowRef(WindowRef);
54 OSType WKCarbonWindowPropertyCreator(void);
55 OSType WKCarbonWindowPropertyTag(void);
56 #endif
57
58 typedef id WKNSURLConnectionDelegateProxyPtr;
59
60 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
61
62 void WKDisableCGDeferredUpdates(void);
63
64 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
65 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
66
67 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
68
69 unsigned WKGetNSAutoreleasePoolCount(void);
70
71 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
72
73 NSString *WKMouseMovedNotification(void);
74 NSString *WKWindowWillOrderOnScreenNotification(void);
75 NSString *WKWindowWillOrderOffScreenNotification(void);
76 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
77
78 CFTypeID WKGetAXTextMarkerTypeID(void);
79 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
80 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
81 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
82 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
83 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
84 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
85 void WKAccessibilityHandleFocusChanged(void);
86 AXUIElementRef WKCreateAXUIElementRef(id element);
87 void WKUnregisterUniqueIdForElement(id element);
88
89
90 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
91 // Remote Accessibility API.
92 void WKAXRegisterRemoteApp(void);
93 void WKAXInitializeElementWithPresenterPid(id, pid_t);
94 NSData *WKAXRemoteTokenForElement(id);
95 id WKAXRemoteElementForToken(NSData *);
96 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
97 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
98 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
99 #endif
100
101 void WKSetUpFontCache(void);
102
103 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
104 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
105 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
106
107 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
108     void (*formFinalize)(CFReadStreamRef, void *), 
109     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
110     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
111     Boolean (*formCanRead)(CFReadStreamRef, void *), 
112     void (*formClose)(CFReadStreamRef, void *), 
113     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
114     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
115     void *context);
116
117 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
118
119 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
120     // The CG context's current path is the focus ring's path.
121     // A color of 0 means "use system focus ring color".
122     // A radius of 0 means "use default focus ring radius".
123
124 void WKSetDragImage(NSImage *image, NSPoint offset);
125
126 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
127 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
128 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
129 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
130 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
131 void WKSendUserChangeNotifications(void);
132 #ifndef __LP64__
133 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
134 void WKSendKeyEventToTSM(NSEvent *theEvent);
135 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
136 #endif
137
138 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
139 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
140 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
141 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
142 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
143
144 #ifdef BUILDING_ON_TIGER
145 // CGFontGetAscent, CGFontGetDescent, CGFontGetLeading and CGFontGetUnitsPerEm were not available until Leopard
146 void WKGetFontMetrics(CGFontRef font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
147 // CTFontCopyGraphicsFont was not available until Leopard
148 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
149 // CTFontGetPlatformFont was not available until Leopard
150 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
151 // CGFontCopyFullName was not available until Leopard
152 CFStringRef WKCopyFullFontName(CGFontRef font);
153 #endif
154
155 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
156 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
157 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
158
159 #ifndef BUILDING_ON_TIGER
160 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
161 #else
162 typedef void *WKGlyphVectorRef;
163 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar* characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
164 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
165 void WKReleaseStyleGroup(void *group);
166 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
167 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
168
169 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
170 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
171 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
172 #endif
173
174 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
175 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
176 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
177
178 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
179 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
180 #endif
181
182 #ifndef __LP64__
183 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
184 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
185 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
186 #endif
187
188 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
189 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
190
191 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
192
193 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
194 // use that enum directly).
195 typedef enum {
196     WKThemeScrollBarArrowsSingle     = 0,
197     WKThemeScrollBarArrowsLowerRight = 1,
198     WKThemeScrollBarArrowsDouble     = 2,
199     WKThemeScrollBarArrowsUpperLeft  = 3,
200 } WKThemeScrollBarArrowStyle;
201
202 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
203
204 #ifdef BUILDING_ON_TIGER
205 // WKSupportsMultipartXMixedReplace is not required on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest
206 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
207 #endif
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
237 CFStringRef WKCopyFoundationCacheDirectory(void);
238
239 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
240 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
241 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
242 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
243
244 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
245 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
246 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
247 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
248 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
249 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
250
251 void WKSetVisibleApplicationName(CFStringRef);
252
253 typedef enum {
254     WKMediaUIPartFullscreenButton   = 0,
255     WKMediaUIPartMuteButton,
256     WKMediaUIPartPlayButton,
257     WKMediaUIPartSeekBackButton,
258     WKMediaUIPartSeekForwardButton,
259     WKMediaUIPartTimelineSlider,
260     WKMediaUIPartTimelineSliderThumb,
261     WKMediaUIPartRewindButton,
262     WKMediaUIPartSeekToRealtimeButton,
263     WKMediaUIPartShowClosedCaptionsButton,
264     WKMediaUIPartHideClosedCaptionsButton,
265     WKMediaUIPartUnMuteButton,
266     WKMediaUIPartPauseButton,
267     WKMediaUIPartBackground,
268     WKMediaUIPartCurrentTimeDisplay,
269     WKMediaUIPartTimeRemainingDisplay,
270     WKMediaUIPartStatusDisplay,
271     WKMediaUIPartControlsPanel,
272     WKMediaUIPartVolumeSliderContainer,
273     WKMediaUIPartVolumeSlider,
274     WKMediaUIPartVolumeSliderThumb
275 } WKMediaUIPart;
276
277 typedef enum {
278     WKMediaControllerThemeClassic   = 1,
279     WKMediaControllerThemeQuickTime = 2
280 } WKMediaControllerThemeStyle;
281
282 typedef enum {
283     WKMediaControllerFlagDisabled = 1 << 0,
284     WKMediaControllerFlagPressed = 1 << 1,
285     WKMediaControllerFlagDrawEndCaps = 1 << 3,
286     WKMediaControllerFlagFocused = 1 << 4
287 } WKMediaControllerThemeState;
288
289 BOOL WKMediaControllerThemeAvailable(int themeStyle);
290 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
291 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
292 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
293 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
294 NSView *WKCreateMediaUIBackgroundView(void);
295
296 typedef enum {
297     WKMediaUIControlTimeline,
298     WKMediaUIControlSlider,
299     WKMediaUIControlPlayPauseButton,
300     WKMediaUIControlExitFullscreenButton,
301     WKMediaUIControlRewindButton,
302     WKMediaUIControlFastForwardButton,
303     WKMediaUIControlVolumeUpButton,
304     WKMediaUIControlVolumeDownButton
305 } WKMediaUIControlType;
306     
307 NSControl *WKCreateMediaUIControl(int controlType);
308
309 NSArray *WKQTGetSitesInMediaDownloadCache();
310 void WKQTClearMediaDownloadCacheForSite(NSString *site);
311 void WKQTClearMediaDownloadCache();
312     
313 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
314 mach_port_t WKInitializeRenderServer(void);
315     
316 @class CALayer;
317
318 CALayer *WKMakeRenderLayer(uint32_t contextID);
319     
320 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
321
322 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
323 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
324 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
325
326 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
327
328 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
329 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
330 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
331 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
332 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
333
334 @class CARenderer;
335
336 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
337 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
338
339 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
340
341 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
342 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
343 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
344
345 #if defined(__x86_64__)
346 #import <mach/mig.h>
347 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
348 #endif // defined(__x86_64__)
349
350 NSUInteger WKGetInputPanelWindowStyle(void);
351 UInt8 WKGetNSEventKeyChar(NSEvent *);
352 #endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
353
354 @class CAPropertyAnimation;
355 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
356
357 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
358 int WKGetHTTPPipeliningPriority(NSURLRequest *);
359 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
360 void WKSetHTTPPipeliningPriority(NSMutableURLRequest *, int priority);
361 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
362
363 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
364 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
365 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
366
367 #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
368 typedef enum {
369     WKEventPhaseNone = 0,
370     WKEventPhaseBegan = 1,
371     WKEventPhaseChanged = 2,
372     WKEventPhaseEnded = 3,
373 } WKEventPhase;
374
375 int WKGetNSEventMomentumPhase(NSEvent *);
376 #endif
377
378 #ifndef BUILDING_ON_TIGER
379 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
380 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
381 #endif
382
383 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
384 void WKSyncSurfaceToView(NSView *view);
385
386 void WKEnableSettingCursorWhenInBackground(void);
387
388 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
389 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
390
391 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
392 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
393
394 #ifndef __LP64__
395 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
396 #endif
397
398 #endif
399
400 #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
401 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
402 #endif
403
404 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
405 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
406
407 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
408 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
409 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
410 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
411 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
412
413 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
414 typedef enum {
415     WKSandboxExtensionTypeReadOnly,
416     WKSandboxExtensionTypeWriteOnly,    
417     WKSandboxExtensionTypeReadWrite,
418 } WKSandboxExtensionType;
419 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
420
421 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
422 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
423
424 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
425 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
426
427 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
428 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
429
430 typedef struct __WKScrollbarPainter *WKScrollbarPainterRef;
431 typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
432
433 WKScrollbarPainterRef WKMakeScrollbarPainter(int controlSize, bool isHorizontal);
434 WKScrollbarPainterRef WKMakeScrollbarReplacementPainter(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
435 void WKScrollbarPainterSetDelegate(WKScrollbarPainterRef, id scrollbarPainterDelegate);
436 void WKScrollbarPainterPaint(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
437 void WKScrollbarPainterForceFlashScrollers(WKScrollbarPainterControllerRef);
438 int WKScrollbarThickness(int controlSize);
439 int WKScrollbarMinimumThumbLength(WKScrollbarPainterRef);
440 int WKScrollbarMinimumTotalLengthNeededForThumb(WKScrollbarPainterRef);
441 CGFloat WKScrollbarPainterKnobAlpha(WKScrollbarPainterRef);
442 void WKSetScrollbarPainterKnobAlpha(WKScrollbarPainterRef, CGFloat);
443 CGFloat WKScrollbarPainterTrackAlpha(WKScrollbarPainterRef);
444 void WKSetScrollbarPainterTrackAlpha(WKScrollbarPainterRef, CGFloat);
445 bool WKScrollbarPainterIsHorizontal(WKScrollbarPainterRef);
446 void WKScrollbarPainterSetOverlayState(WKScrollbarPainterRef, int overlayScrollerState);
447
448 WKScrollbarPainterControllerRef WKMakeScrollbarPainterController(id painterControllerDelegate);
449 void WKSetPainterForPainterController(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
450 WKScrollbarPainterRef WKVerticalScrollbarPainterForController(WKScrollbarPainterControllerRef);
451 WKScrollbarPainterRef WKHorizontalScrollbarPainterForController(WKScrollbarPainterControllerRef);
452 void WKSetScrollbarPainterControllerStyle(WKScrollbarPainterControllerRef, int newStyle);
453 void WKContentAreaScrolled(WKScrollbarPainterControllerRef);
454 void WKContentAreaWillPaint(WKScrollbarPainterControllerRef);
455 void WKMouseEnteredContentArea(WKScrollbarPainterControllerRef);
456 void WKMouseExitedContentArea(WKScrollbarPainterControllerRef);
457 void WKMouseMovedInContentArea(WKScrollbarPainterControllerRef);
458 void WKWillStartLiveResize(WKScrollbarPainterControllerRef);
459 void WKContentAreaResized(WKScrollbarPainterControllerRef);
460 void WKWillEndLiveResize(WKScrollbarPainterControllerRef);
461 void WKContentAreaDidShow(WKScrollbarPainterControllerRef);
462 void WKContentAreaDidHide(WKScrollbarPainterControllerRef);
463 void WKDidBeginScrollGesture(WKScrollbarPainterControllerRef);
464 void WKDidEndScrollGesture(WKScrollbarPainterControllerRef);
465
466 bool WKScrollbarPainterUsesOverlayScrollers(void);
467
468 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
469 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
470 void WKHideWordDefinitionWindow(void);
471
472 #endif
473
474 #ifdef __cplusplus
475 }
476 #endif