2 WebKitSystemInterface.h
3 Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
19 WKCertificateParseResultSucceeded = 0,
20 WKCertificateParseResultFailed = 1,
21 WKCertificateParseResultPKCS7 = 2,
22 } WKCertificateParseResult;
24 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
25 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
26 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
28 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
29 NSArray *WKGetExtensionsForMIMEType(NSString *type);
30 NSString *WKGetMIMETypeForExtension(NSString *extension);
32 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
33 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
34 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
36 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
37 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
40 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
42 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
43 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
45 void WKShowKeyAndMain(void);
47 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
48 unsigned WKCarbonWindowMask(void);
49 void *WKGetNativeWindowFromWindowRef(WindowRef);
50 OSType WKCarbonWindowPropertyCreator(void);
51 OSType WKCarbonWindowPropertyTag(void);
54 typedef id WKNSURLConnectionDelegateProxyPtr;
56 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
58 void WKDisableCGDeferredUpdates(void);
60 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
61 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
63 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
65 unsigned WKGetNSAutoreleasePoolCount(void);
67 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
69 NSString *WKMouseMovedNotification(void);
70 NSString *WKWindowWillOrderOnScreenNotification(void);
71 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
73 CFTypeID WKGetAXTextMarkerTypeID(void);
74 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
75 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
76 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
77 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
78 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
79 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
80 void WKAccessibilityHandleFocusChanged(void);
81 AXUIElementRef WKCreateAXUIElementRef(id element);
82 void WKUnregisterUniqueIdForElement(id element);
84 void WKSetUpFontCache(void);
86 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
87 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
88 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
90 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
91 void (*formFinalize)(CFReadStreamRef, void *),
92 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
93 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
94 Boolean (*formCanRead)(CFReadStreamRef, void *),
95 void (*formClose)(CFReadStreamRef, void *),
96 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
97 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
100 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
102 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
103 // The CG context's current path is the focus ring's path.
104 // A color of 0 means "use system focus ring color".
105 // A radius of 0 means "use default focus ring radius".
107 void WKSetDragImage(NSImage *image, NSPoint offset);
109 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
110 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
111 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
112 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
114 void WKSendUserChangeNotifications(void);
116 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
117 void WKSendKeyEventToTSM(NSEvent *theEvent);
118 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
121 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
122 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
123 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
124 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
125 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
127 #ifdef BUILDING_ON_TIGER
128 // CGFontGetAscent, CGFontGetDescent, CGFontGetLeading and CGFontGetUnitsPerEm were not available until Leopard
129 void WKGetFontMetrics(CGFontRef font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
130 // CTFontCopyGraphicsFont was not available until Leopard
131 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
132 // CTFontGetPlatformFont was not available until Leopard
133 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
134 // CGFontCopyFullName was not available until Leopard
135 CFStringRef WKCopyFullFontName(CGFontRef font);
138 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
139 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
140 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
142 #ifndef BUILDING_ON_TIGER
143 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
145 typedef void *WKGlyphVectorRef;
146 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
147 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
148 void WKReleaseStyleGroup(void *group);
149 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
150 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
152 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
153 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
154 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
157 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
158 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
159 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
163 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
164 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
165 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
168 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
169 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
171 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
173 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
174 // use that enum directly).
176 WKThemeScrollBarArrowsSingle = 0,
177 WKThemeScrollBarArrowsLowerRight = 1,
178 WKThemeScrollBarArrowsDouble = 2,
179 WKThemeScrollBarArrowsUpperLeft = 3,
180 } WKThemeScrollBarArrowStyle;
182 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
184 #ifdef BUILDING_ON_TIGER
185 // WKSupportsMultipartXMixedReplace is not required on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest
186 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
189 BOOL WKCGContextIsBitmapContext(CGContextRef context);
191 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
193 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
198 WKMovieTypeStoredStream,
199 WKMovieTypeLiveStream
202 int WKQTMovieGetType(QTMovie* movie);
204 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
205 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
206 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
207 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
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]);
217 CFStringRef WKCopyFoundationCacheDirectory(void);
219 void WKSetVisibleApplicationName(CFStringRef);
222 WKMediaUIPartFullscreenButton = 0,
223 WKMediaUIPartMuteButton,
224 WKMediaUIPartPlayButton,
225 WKMediaUIPartSeekBackButton,
226 WKMediaUIPartSeekForwardButton,
227 WKMediaUIPartTimelineSlider,
228 WKMediaUIPartTimelineSliderThumb,
229 WKMediaUIPartRewindButton,
230 WKMediaUIPartSeekToRealtimeButton,
231 WKMediaUIPartShowClosedCaptionsButton,
232 WKMediaUIPartHideClosedCaptionsButton,
233 WKMediaUIPartUnMuteButton,
234 WKMediaUIPartPauseButton,
235 WKMediaUIPartBackground,
236 WKMediaUIPartCurrentTimeDisplay,
237 WKMediaUIPartTimeRemainingDisplay,
238 WKMediaUIPartStatusDisplay,
239 WKMediaUIPartControlsPanel,
240 WKMediaUIPartVolumeSliderContainer,
241 WKMediaUIPartVolumeSlider,
242 WKMediaUIPartVolumeSliderThumb
246 WKMediaControllerThemeClassic = 1,
247 WKMediaControllerThemeQuickTime = 2
248 } WKMediaControllerThemeStyle;
251 WKMediaControllerFlagDisabled = 1 << 0,
252 WKMediaControllerFlagPressed = 1 << 1,
253 WKMediaControllerFlagDrawEndCaps = 1 << 3,
254 WKMediaControllerFlagFocused = 1 << 4
255 } WKMediaControllerThemeState;
257 BOOL WKMediaControllerThemeAvailable(int themeStyle);
258 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
259 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
260 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
261 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
262 NSView *WKCreateMediaUIBackgroundView(void);
265 WKMediaUIControlTimeline,
266 WKMediaUIControlSlider,
267 WKMediaUIControlPlayPauseButton,
268 WKMediaUIControlExitFullscreenButton,
269 WKMediaUIControlRewindButton,
270 WKMediaUIControlFastForwardButton,
271 WKMediaUIControlVolumeUpButton,
272 WKMediaUIControlVolumeDownButton
273 } WKMediaUIControlType;
275 NSControl *WKCreateMediaUIControl(int controlType);
277 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
278 mach_port_t WKInitializeRenderServer(void);
282 CALayer *WKMakeRenderLayer(uint32_t contextID);
284 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
286 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
287 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
288 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
290 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
292 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
293 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
294 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
295 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
296 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
298 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
300 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
301 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
302 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
304 #if defined(__x86_64__)
307 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
309 NSUInteger WKGetInputPanelWindowStyle(void);
311 UInt8 WKGetNSEventKeyChar(NSEvent *);
312 #endif // defined(__x86_64__)
313 #endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
315 @class CAPropertyAnimation;
316 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
318 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
320 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
321 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
322 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
324 BOOL WKIsLatchingWheelEvent(NSEvent *);
326 #ifndef BUILDING_ON_TIGER
327 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
328 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
331 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
332 void WKSyncSurfaceToView(NSView *view);
335 #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
336 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);