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 float WKSecondsSinceLastInputEvent(void);
38 CFStringRef WKPreferRGB32Key(void);
40 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
41 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
42 float WKSecondsSinceLastInputEvent(void);
44 void WKShowKeyAndMain(void);
46 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
47 unsigned WKCarbonWindowMask(void);
48 void *WKGetNativeWindowFromWindowRef(WindowRef);
49 OSType WKCarbonWindowPropertyCreator(void);
50 OSType WKCarbonWindowPropertyTag(void);
53 typedef id WKNSURLConnectionDelegateProxyPtr;
55 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
57 void WKDisableCGDeferredUpdates(void);
59 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
60 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
62 unsigned WKGetNSAutoreleasePoolCount(void);
64 NSString *WKMouseMovedNotification(void);
65 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
67 CFTypeID WKGetAXTextMarkerTypeID(void);
68 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
69 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
70 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
71 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
72 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
73 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
74 void WKAccessibilityHandleFocusChanged(void);
75 AXUIElementRef WKCreateAXUIElementRef(id element);
76 void WKUnregisterUniqueIdForElement(id element);
78 BOOL WKFontSmoothingModeIsLCD(int mode);
79 void WKSetUpFontCache(size_t s);
81 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
82 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
83 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
85 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
86 void (*formFinalize)(CFReadStreamRef, void *),
87 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
88 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
89 Boolean (*formCanRead)(CFReadStreamRef, void *),
90 void (*formClose)(CFReadStreamRef, void *),
91 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
92 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
95 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
97 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
98 // The CG context's current path is the focus ring's path.
99 // A color of 0 means "use system focus ring color".
100 // A radius of 0 means "use default focus ring radius".
102 void WKSetDragImage(NSImage *image, NSPoint offset);
104 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
105 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
106 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
107 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
109 void WKSendUserChangeNotifications(void);
111 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
112 void WKSendKeyEventToTSM(NSEvent *theEvent);
113 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
116 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
117 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
118 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
119 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
120 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
121 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
122 void WKReleaseStyleGroup(void *group);
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);
130 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
131 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
133 typedef void *WKGlyphVectorRef;
134 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
135 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
136 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
137 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
139 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
140 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
141 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
142 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
145 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
146 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
147 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
150 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
151 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
153 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
155 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
156 NSString* WKPathFromFont(NSFont *font);
158 BOOL WKCGContextIsBitmapContext(CGContextRef context);
160 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
162 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
164 int WKQTMovieDataRate(QTMovie* movie);
165 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
166 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
168 CFStringRef WKCopyFoundationCacheDirectory(void);
170 void WKDrawMediaFullscreenButton(CGContextRef context, CGRect rect, BOOL active);
171 void WKDrawMediaMuteButton(CGContextRef context, CGRect rect, BOOL active);
172 void WKDrawMediaPauseButton(CGContextRef context, CGRect rect, BOOL active);
173 void WKDrawMediaPlayButton(CGContextRef context, CGRect rect, BOOL active);
174 void WKDrawMediaSeekBackButton(CGContextRef context, CGRect rect, BOOL active);
175 void WKDrawMediaSeekForwardButton(CGContextRef context, CGRect rect, BOOL active);
176 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float percentLoaded);
177 void WKDrawMediaSliderThumb(CGContextRef context, CGRect rect, BOOL active);
178 void WKDrawMediaUnMuteButton(CGContextRef context, CGRect rect, BOOL active);