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