2 WebKitSystemInterface.h
3 Copyright (C) 2005, 2006, 2007, 2008, 2009 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);
35 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
37 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
38 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
40 void WKShowKeyAndMain(void);
42 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
43 unsigned WKCarbonWindowMask(void);
44 void *WKGetNativeWindowFromWindowRef(WindowRef);
45 OSType WKCarbonWindowPropertyCreator(void);
46 OSType WKCarbonWindowPropertyTag(void);
49 typedef id WKNSURLConnectionDelegateProxyPtr;
51 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
53 void WKDisableCGDeferredUpdates(void);
55 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
56 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
58 unsigned WKGetNSAutoreleasePoolCount(void);
60 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
62 NSString *WKMouseMovedNotification(void);
63 NSString *WKWindowWillOrderOnScreenNotification(void);
64 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
66 CFTypeID WKGetAXTextMarkerTypeID(void);
67 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
68 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
69 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
70 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
71 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
72 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
73 void WKAccessibilityHandleFocusChanged(void);
74 AXUIElementRef WKCreateAXUIElementRef(id element);
75 void WKUnregisterUniqueIdForElement(id element);
77 void WKSetUpFontCache(void);
79 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
80 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
81 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
83 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
84 void (*formFinalize)(CFReadStreamRef, void *),
85 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
86 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
87 Boolean (*formCanRead)(CFReadStreamRef, void *),
88 void (*formClose)(CFReadStreamRef, void *),
89 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
90 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
93 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
95 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
96 // The CG context's current path is the focus ring's path.
97 // A color of 0 means "use system focus ring color".
98 // A radius of 0 means "use default focus ring radius".
100 void WKSetDragImage(NSImage *image, NSPoint offset);
102 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
103 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
104 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
105 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
107 void WKSendUserChangeNotifications(void);
109 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
110 void WKSendKeyEventToTSM(NSEvent *theEvent);
111 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
114 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
115 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
116 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
117 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
118 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
120 #ifdef BUILDING_ON_TIGER
121 // CGFontGetAscent, CGFontGetDescent, CGFontGetLeading and CGFontGetUnitsPerEm were not available until Leopard
122 void WKGetFontMetrics(CGFontRef font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
123 // CTFontCopyGraphicsFont was not available until Leopard
124 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
125 // CTFontGetPlatformFont was not available until Leopard
126 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
127 // CGFontCopyFullName was not available until Leopard
128 CFStringRef WKCopyFullFontName(CGFontRef font);
131 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
132 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
133 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
135 #ifndef BUILDING_ON_TIGER
136 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
138 typedef void *WKGlyphVectorRef;
139 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
140 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
141 void WKReleaseStyleGroup(void *group);
142 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
143 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
145 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
146 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
147 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
151 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
152 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
153 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
156 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
157 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
159 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
161 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
162 // use that enum directly).
164 WKThemeScrollBarArrowsSingle = 0,
165 WKThemeScrollBarArrowsLowerRight = 1,
166 WKThemeScrollBarArrowsDouble = 2,
167 WKThemeScrollBarArrowsUpperLeft = 3,
168 } WKThemeScrollBarArrowStyle;
170 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
172 #ifdef BUILDING_ON_TIGER
173 // WKSupportsMultipartXMixedReplace is not required on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest
174 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
177 BOOL WKCGContextIsBitmapContext(CGContextRef context);
179 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
181 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
186 WKMovieTypeStoredStream,
187 WKMovieTypeLiveStream
190 int WKQTMovieGetType(QTMovie* movie);
192 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
193 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
195 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
196 int WKQTMovieDataRate(QTMovie* movie);
197 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
198 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
199 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
200 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
202 CFStringRef WKCopyFoundationCacheDirectory(void);
205 WKMediaUIPartFullscreenButton = 0,
206 WKMediaUIPartMuteButton,
207 WKMediaUIPartPlayButton,
208 WKMediaUIPartSeekBackButton,
209 WKMediaUIPartSeekForwardButton,
211 WKMediaUIPartSliderThumb,
212 WKMediaUIPartRewindButton,
213 WKMediaUIPartSeekToRealtimeButton,
214 WKMediaUIPartShowClosedCaptionsButton,
215 WKMediaUIPartHideClosedCaptionsButton,
216 WKMediaUIPartUnMuteButton,
217 WKMediaUIPartPauseButton,
218 WKMediaUIPartBackground,
219 WKMediaUIPartCurrentTimeDisplay,
220 WKMediaUIPartTimeRemainingDisplay
224 WKMediaControllerThemeClassic = 1,
225 WKMediaControllerThemeQuickTime = 2
226 } WKMediaControllerThemeStyle;
229 WKMediaControllerFlagDisabled = 1 << 0,
230 WKMediaControllerFlagPressed = 1 << 1,
231 WKMediaControllerFlagDrawEndCaps = 1 << 3,
232 WKMediaControllerFlagFocused = 1 << 4
233 } WKMediaControllerThemeState;
235 BOOL WKMediaControllerThemeAvailable(int themeStyle);
236 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
237 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
238 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
239 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
240 NSView *WKCreateMediaUIBackgroundView(void);
243 WKMediaUIControlTimeline,
244 WKMediaUIControlSlider,
245 WKMediaUIControlPlayPauseButton,
246 WKMediaUIControlExitFullscreenButton,
247 WKMediaUIControlRewindButton,
248 WKMediaUIControlFastForwardButton,
249 WKMediaUIControlVolumeUpButton,
250 WKMediaUIControlVolumeDownButton
252 } WKMediaUIControlType;
254 NSControl *WKCreateMediaUIControl(int controlType);
256 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && defined(__x86_64__)
257 mach_port_t WKInitializeRenderServer(void);
261 CALayer *WKMakeRenderLayer(uint32_t contextID);
263 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
265 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
266 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
267 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
271 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
273 NSUInteger WKGetInputPanelWindowStyle(void);
275 UInt8 WKGetNSEventKeyChar(NSEvent *);
279 @class CAPropertyAnimation;
280 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
282 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
284 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
285 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
286 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
288 BOOL WKIsLatchingWheelEvent(NSEvent *);
290 #ifndef BUILDING_ON_TIGER
291 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
292 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
295 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
296 NSMutableArray *WKNoteOpenPanelFiles(NSArray *paths);