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