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 WKCopyNSURLResponsePeerCertificates(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 unsigned WKGetNSAutoreleasePoolCount(void);
65 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
67 NSString *WKMouseMovedNotification(void);
68 NSString *WKWindowWillOrderOnScreenNotification(void);
69 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
71 CFTypeID WKGetAXTextMarkerTypeID(void);
72 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
73 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
74 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
75 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
76 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
77 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
78 void WKAccessibilityHandleFocusChanged(void);
79 AXUIElementRef WKCreateAXUIElementRef(id element);
80 void WKUnregisterUniqueIdForElement(id element);
82 void WKSetUpFontCache(void);
84 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
85 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
86 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
88 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
89 void (*formFinalize)(CFReadStreamRef, void *),
90 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
91 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
92 Boolean (*formCanRead)(CFReadStreamRef, void *),
93 void (*formClose)(CFReadStreamRef, void *),
94 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
95 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
98 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
100 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
101 // The CG context's current path is the focus ring's path.
102 // A color of 0 means "use system focus ring color".
103 // A radius of 0 means "use default focus ring radius".
105 void WKSetDragImage(NSImage *image, NSPoint offset);
107 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
108 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
109 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
110 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
112 void WKSendUserChangeNotifications(void);
114 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
115 void WKSendKeyEventToTSM(NSEvent *theEvent);
116 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
119 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
120 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
121 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
122 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
123 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
125 #ifdef BUILDING_ON_TIGER
126 // CGFontGetAscent, CGFontGetDescent, CGFontGetLeading and CGFontGetUnitsPerEm were not available until Leopard
127 void WKGetFontMetrics(CGFontRef font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
128 // CTFontCopyGraphicsFont was not available until Leopard
129 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
130 // CTFontGetPlatformFont was not available until Leopard
131 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
132 // CGFontCopyFullName was not available until Leopard
133 CFStringRef WKCopyFullFontName(CGFontRef font);
136 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
137 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
138 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
140 #ifndef BUILDING_ON_TIGER
141 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
143 typedef void *WKGlyphVectorRef;
144 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
145 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
146 void WKReleaseStyleGroup(void *group);
147 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
148 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
150 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
151 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
152 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
156 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
157 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
158 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
161 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
162 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
164 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
166 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
167 // use that enum directly).
169 WKThemeScrollBarArrowsSingle = 0,
170 WKThemeScrollBarArrowsLowerRight = 1,
171 WKThemeScrollBarArrowsDouble = 2,
172 WKThemeScrollBarArrowsUpperLeft = 3,
173 } WKThemeScrollBarArrowStyle;
175 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
177 #ifdef BUILDING_ON_TIGER
178 // WKSupportsMultipartXMixedReplace is not required on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest
179 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
182 BOOL WKCGContextIsBitmapContext(CGContextRef context);
184 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
186 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
191 WKMovieTypeStoredStream,
192 WKMovieTypeLiveStream
195 int WKQTMovieGetType(QTMovie* movie);
197 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
198 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
199 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
200 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
202 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
203 int WKQTMovieDataRate(QTMovie* movie);
204 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
205 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
206 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
207 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
208 void WKQTMovieDisableComponent(uint32_t[5]);
210 CFStringRef WKCopyFoundationCacheDirectory(void);
212 void WKSetVisibleApplicationName(CFStringRef);
215 WKMediaUIPartFullscreenButton = 0,
216 WKMediaUIPartMuteButton,
217 WKMediaUIPartPlayButton,
218 WKMediaUIPartSeekBackButton,
219 WKMediaUIPartSeekForwardButton,
220 WKMediaUIPartTimelineSlider,
221 WKMediaUIPartTimelineSliderThumb,
222 WKMediaUIPartRewindButton,
223 WKMediaUIPartSeekToRealtimeButton,
224 WKMediaUIPartShowClosedCaptionsButton,
225 WKMediaUIPartHideClosedCaptionsButton,
226 WKMediaUIPartUnMuteButton,
227 WKMediaUIPartPauseButton,
228 WKMediaUIPartBackground,
229 WKMediaUIPartCurrentTimeDisplay,
230 WKMediaUIPartTimeRemainingDisplay,
231 WKMediaUIPartStatusDisplay,
232 WKMediaUIPartControlsPanel,
233 WKMediaUIPartVolumeSliderContainer,
234 WKMediaUIPartVolumeSlider,
235 WKMediaUIPartVolumeSliderThumb
239 WKMediaControllerThemeClassic = 1,
240 WKMediaControllerThemeQuickTime = 2
241 } WKMediaControllerThemeStyle;
244 WKMediaControllerFlagDisabled = 1 << 0,
245 WKMediaControllerFlagPressed = 1 << 1,
246 WKMediaControllerFlagDrawEndCaps = 1 << 3,
247 WKMediaControllerFlagFocused = 1 << 4
248 } WKMediaControllerThemeState;
250 BOOL WKMediaControllerThemeAvailable(int themeStyle);
251 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
252 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
253 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
254 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
255 NSView *WKCreateMediaUIBackgroundView(void);
258 WKMediaUIControlTimeline,
259 WKMediaUIControlSlider,
260 WKMediaUIControlPlayPauseButton,
261 WKMediaUIControlExitFullscreenButton,
262 WKMediaUIControlRewindButton,
263 WKMediaUIControlFastForwardButton,
264 WKMediaUIControlVolumeUpButton,
265 WKMediaUIControlVolumeDownButton
266 } WKMediaUIControlType;
268 NSControl *WKCreateMediaUIControl(int controlType);
270 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
271 mach_port_t WKInitializeRenderServer(void);
275 CALayer *WKMakeRenderLayer(uint32_t contextID);
277 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
279 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
280 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
281 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
283 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
285 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
286 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
287 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
288 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
289 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
291 #if defined(__x86_64__)
294 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
296 NSUInteger WKGetInputPanelWindowStyle(void);
298 UInt8 WKGetNSEventKeyChar(NSEvent *);
299 #endif // defined(__x86_64__)
300 #endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
302 @class CAPropertyAnimation;
303 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
305 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
307 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
308 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
309 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
311 BOOL WKIsLatchingWheelEvent(NSEvent *);
313 #ifndef BUILDING_ON_TIGER
314 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
315 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
318 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
319 NSMutableArray *WKNoteOpenPanelFiles(NSArray *paths);
320 void WKSyncSurfaceToView(NSView *view);
323 #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
324 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);