2 WebKitSystemInterface.h
3 Copyright (C) 2005, 2006, 2007, 2008 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 WKNSURLProtocolClassForReqest(NSURLRequest *request);
56 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
58 unsigned WKGetNSAutoreleasePoolCount(void);
60 NSString *WKMouseMovedNotification(void);
61 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
63 CFTypeID WKGetAXTextMarkerTypeID(void);
64 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
65 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
66 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
67 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
68 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
69 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
70 void WKAccessibilityHandleFocusChanged(void);
71 AXUIElementRef WKCreateAXUIElementRef(id element);
72 void WKUnregisterUniqueIdForElement(id element);
74 BOOL WKFontSmoothingModeIsLCD(int mode);
75 void WKSetUpFontCache(size_t s);
77 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
78 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
79 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
81 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
82 void (*formFinalize)(CFReadStreamRef, void *),
83 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
84 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
85 Boolean (*formCanRead)(CFReadStreamRef, void *),
86 void (*formClose)(CFReadStreamRef, void *),
87 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
88 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
91 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
93 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
94 // The CG context's current path is the focus ring's path.
95 // A color of 0 means "use system focus ring color".
96 // A radius of 0 means "use default focus ring radius".
98 void WKSetDragImage(NSImage *image, NSPoint offset);
100 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
101 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
102 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
103 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
105 void WKSendUserChangeNotifications(void);
107 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
108 void WKSendKeyEventToTSM(NSEvent *theEvent);
109 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
112 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
113 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
114 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
115 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
116 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
117 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
118 void WKReleaseStyleGroup(void *group);
119 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
121 #ifdef BUILDING_ON_TIGER
122 // CGFontGetAscent, CGFontGetDescent, CGFontGetLeading and CGFontGetUnitsPerEm were not available until Leopard
123 void WKGetFontMetrics(CGFontRef font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
126 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
127 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
129 typedef void *WKGlyphVectorRef;
130 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
131 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
132 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
133 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
135 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
136 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
137 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
140 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
141 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
142 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
145 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
146 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
148 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
150 #ifdef BUILDING_ON_TIGER
151 // WKSupportsMultipartXMixedReplace is not required on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest
152 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
155 NSString* WKPathFromFont(NSFont *font);
157 BOOL WKCGContextIsBitmapContext(CGContextRef context);
159 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
161 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
163 int WKQTMovieDataRate(QTMovie* movie);
164 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
165 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
167 CFStringRef WKCopyFoundationCacheDirectory(void);
169 void WKDrawMediaFullscreenButton(CGContextRef context, CGRect rect, BOOL active);
170 void WKDrawMediaMuteButton(CGContextRef context, CGRect rect, BOOL active);
171 void WKDrawMediaPauseButton(CGContextRef context, CGRect rect, BOOL active);
172 void WKDrawMediaPlayButton(CGContextRef context, CGRect rect, BOOL active);
173 void WKDrawMediaSeekBackButton(CGContextRef context, CGRect rect, BOOL active);
174 void WKDrawMediaSeekForwardButton(CGContextRef context, CGRect rect, BOOL active);
175 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float percentLoaded);
176 void WKDrawMediaSliderThumb(CGContextRef context, CGRect rect, BOOL active);
177 void WKDrawMediaUnMuteButton(CGContextRef context, CGRect rect, BOOL active);