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