2011-05-24 Jer Noble <jer.noble@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 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
215 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
216 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
217 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
218
219 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
220 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
221 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
222 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
223 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
224 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
225
226 void WKSetVisibleApplicationName(CFStringRef);
227
228 typedef enum {
229     WKMediaUIPartFullscreenButton   = 0,
230     WKMediaUIPartMuteButton,
231     WKMediaUIPartPlayButton,
232     WKMediaUIPartSeekBackButton,
233     WKMediaUIPartSeekForwardButton,
234     WKMediaUIPartTimelineSlider,
235     WKMediaUIPartTimelineSliderThumb,
236     WKMediaUIPartRewindButton,
237     WKMediaUIPartSeekToRealtimeButton,
238     WKMediaUIPartShowClosedCaptionsButton,
239     WKMediaUIPartHideClosedCaptionsButton,
240     WKMediaUIPartUnMuteButton,
241     WKMediaUIPartPauseButton,
242     WKMediaUIPartBackground,
243     WKMediaUIPartCurrentTimeDisplay,
244     WKMediaUIPartTimeRemainingDisplay,
245     WKMediaUIPartStatusDisplay,
246     WKMediaUIPartControlsPanel,
247     WKMediaUIPartVolumeSliderContainer,
248     WKMediaUIPartVolumeSlider,
249     WKMediaUIPartVolumeSliderThumb
250 } WKMediaUIPart;
251
252 typedef enum {
253     WKMediaControllerThemeClassic   = 1,
254     WKMediaControllerThemeQuickTime = 2
255 } WKMediaControllerThemeStyle;
256
257 typedef enum {
258     WKMediaControllerFlagDisabled = 1 << 0,
259     WKMediaControllerFlagPressed = 1 << 1,
260     WKMediaControllerFlagDrawEndCaps = 1 << 3,
261     WKMediaControllerFlagFocused = 1 << 4
262 } WKMediaControllerThemeState;
263
264 BOOL WKMediaControllerThemeAvailable(int themeStyle);
265 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
266 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
267 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
268 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
269 NSView *WKCreateMediaUIBackgroundView(void);
270
271 typedef enum {
272     WKMediaUIControlTimeline,
273     WKMediaUIControlSlider,
274     WKMediaUIControlPlayPauseButton,
275     WKMediaUIControlExitFullscreenButton,
276     WKMediaUIControlRewindButton,
277     WKMediaUIControlFastForwardButton,
278     WKMediaUIControlVolumeUpButton,
279     WKMediaUIControlVolumeDownButton
280 } WKMediaUIControlType;
281     
282 NSControl *WKCreateMediaUIControl(int controlType);
283
284 NSArray *WKQTGetSitesInMediaDownloadCache();
285 void WKQTClearMediaDownloadCacheForSite(NSString *site);
286 void WKQTClearMediaDownloadCache();
287     
288 #ifndef BUILDING_ON_LEOPARD
289 mach_port_t WKInitializeRenderServer(void);
290     
291 @class CALayer;
292
293 CALayer *WKMakeRenderLayer(uint32_t contextID);
294     
295 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
296
297 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
298 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
299 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
300
301 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
302
303 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
304 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
305 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
306 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
307 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
308
309 @class CARenderer;
310
311 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
312 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
313
314 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
315
316 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
317 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
318 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
319
320 #if defined(__x86_64__)
321 #import <mach/mig.h>
322 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
323 #endif // defined(__x86_64__)
324
325 NSUInteger WKGetInputPanelWindowStyle(void);
326 UInt8 WKGetNSEventKeyChar(NSEvent *);
327 #endif // !defined(BUILDING_ON_LEOPARD)
328
329 @class CAPropertyAnimation;
330 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
331
332 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
333 int WKGetHTTPPipeliningPriority(NSURLRequest *);
334 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
335 void WKSetHTTPPipeliningPriority(NSMutableURLRequest *, int priority);
336 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
337
338 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
339 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
340 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
341
342 #if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
343 typedef enum {
344     WKEventPhaseNone = 0,
345     WKEventPhaseBegan = 1,
346     WKEventPhaseChanged = 2,
347     WKEventPhaseEnded = 3,
348 } WKEventPhase;
349
350 int WKGetNSEventMomentumPhase(NSEvent *);
351 #endif
352
353 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
354 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
355
356 #ifndef BUILDING_ON_LEOPARD
357 void WKSyncSurfaceToView(NSView *view);
358
359 void WKEnableSettingCursorWhenInBackground(void);
360
361 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
362 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
363
364 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
365 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
366
367 #ifndef __LP64__
368 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
369 #endif
370
371 #endif
372
373 #if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
374 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
375 #endif
376
377 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
378 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
379
380 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
381 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
382 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
383 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
384 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
385
386 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
387 typedef enum {
388     WKSandboxExtensionTypeReadOnly,
389     WKSandboxExtensionTypeWriteOnly,    
390     WKSandboxExtensionTypeReadWrite,
391 } WKSandboxExtensionType;
392 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
393
394 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
395 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
396
397 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
398 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
399
400 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
401 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
402
403 typedef struct __WKScrollbarPainter *WKScrollbarPainterRef;
404 typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
405
406 WKScrollbarPainterRef WKMakeScrollbarPainter(int controlSize, bool isHorizontal);
407 WKScrollbarPainterRef WKMakeScrollbarReplacementPainter(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
408 void WKScrollbarPainterSetDelegate(WKScrollbarPainterRef, id scrollbarPainterDelegate);
409 void WKScrollbarPainterPaint(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
410 void WKScrollbarPainterForceFlashScrollers(WKScrollbarPainterControllerRef);
411 int WKScrollbarThickness(int controlSize);
412 int WKScrollbarMinimumThumbLength(WKScrollbarPainterRef);
413 int WKScrollbarMinimumTotalLengthNeededForThumb(WKScrollbarPainterRef);
414 CGFloat WKScrollbarPainterKnobAlpha(WKScrollbarPainterRef);
415 void WKSetScrollbarPainterKnobAlpha(WKScrollbarPainterRef, CGFloat);
416 CGFloat WKScrollbarPainterTrackAlpha(WKScrollbarPainterRef);
417 void WKSetScrollbarPainterTrackAlpha(WKScrollbarPainterRef, CGFloat);
418 bool WKScrollbarPainterIsHorizontal(WKScrollbarPainterRef);
419 CGRect WKScrollbarPainterKnobRect(WKScrollbarPainterRef);
420 void WKScrollbarPainterSetOverlayState(WKScrollbarPainterRef, int overlayScrollerState);
421
422 // The wk* to WK* renaming does not apply to enums. The way to
423 // circumvent this is to define the enum anonymously twice using
424 // the two prefixes. (See WebCoreSystemInterface.h)
425 enum {
426     WKScrollerKnobStyleDefault = 0,
427     WKScrollerKnobStyleDark = 1,
428     WKScrollerKnobStyleLight = 2
429 };
430 typedef uint32 WKScrollerKnobStyle;
431 void WKSetScrollbarPainterKnobStyle(WKScrollbarPainterRef, WKScrollerKnobStyle);
432
433 WKScrollbarPainterControllerRef WKMakeScrollbarPainterController(id painterControllerDelegate);
434 void WKSetPainterForPainterController(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
435 WKScrollbarPainterRef WKVerticalScrollbarPainterForController(WKScrollbarPainterControllerRef);
436 WKScrollbarPainterRef WKHorizontalScrollbarPainterForController(WKScrollbarPainterControllerRef);
437 void WKSetScrollbarPainterControllerStyle(WKScrollbarPainterControllerRef, int newStyle);
438 void WKContentAreaScrolled(WKScrollbarPainterControllerRef);
439 void WKContentAreaWillPaint(WKScrollbarPainterControllerRef);
440 void WKMouseEnteredContentArea(WKScrollbarPainterControllerRef);
441 void WKMouseExitedContentArea(WKScrollbarPainterControllerRef);
442 void WKMouseMovedInContentArea(WKScrollbarPainterControllerRef);
443 void WKWillStartLiveResize(WKScrollbarPainterControllerRef);
444 void WKContentAreaResized(WKScrollbarPainterControllerRef);
445 void WKWillEndLiveResize(WKScrollbarPainterControllerRef);
446 void WKContentAreaDidShow(WKScrollbarPainterControllerRef);
447 void WKContentAreaDidHide(WKScrollbarPainterControllerRef);
448 void WKDidBeginScrollGesture(WKScrollbarPainterControllerRef);
449 void WKDidEndScrollGesture(WKScrollbarPainterControllerRef);
450
451 bool WKScrollbarPainterUsesOverlayScrollers(void);
452
453 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
454
455 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
456 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
457 void WKHideWordDefinitionWindow(void);
458
459 NSURL* WKAVAssetResolvedURL(AVAsset*);
460 #endif
461
462 #ifdef __cplusplus
463 }
464 #endif