2 WebKitSystemInterface.h
3 Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
18 WKCertificateParseResultSucceeded = 0,
19 WKCertificateParseResultFailed = 1,
20 WKCertificateParseResultPKCS7 = 2,
21 } WKCertificateParseResult;
23 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
24 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
25 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
27 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
28 NSArray *WKGetExtensionsForMIMEType(NSString *type);
29 NSString *WKGetMIMETypeForExtension(NSString *extension);
31 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
32 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
33 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
34 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
36 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
38 float WKSecondsSinceLastInputEvent(void);
39 CFStringRef WKPreferRGB32Key(void);
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, CGRect clipRect, CGColorRef color, int radius);
98 // Ignore the context's clipping.
99 // The CG context's current path is the focus ring's path.
100 // A color of 0 means "use system focus ring color".
101 // A radius of 0 means "use default focus ring radius".
103 void WKSetDragImage(NSImage *image, NSPoint offset);
105 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
106 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
107 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
108 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
110 void WKSendUserChangeNotifications(void);
112 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
113 void WKSendKeyEventToTSM(NSEvent *theEvent);
114 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
117 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
118 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
119 void WKGetFontMetrics(CGFontRef font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
120 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
121 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
122 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
123 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
124 void WKReleaseStyleGroup(void *group);
125 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
127 void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
128 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
130 typedef void *WKGlyphVectorRef;
131 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
132 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
133 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
134 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
136 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
137 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
138 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
139 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
142 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
143 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
144 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
147 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
148 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
150 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
151 NSString* WKPathFromFont(NSFont *font);
153 BOOL WKCGContextIsBitmapContext(CGContextRef context);
155 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
157 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
159 int WKQTMovieDataRate(QTMovie* movie);
160 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
162 CFStringRef WKCopyFoundationCacheDirectory(void);