2 WebKitSystemInterface.h
3 Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
12 WKCertificateParseResultSucceeded = 0,
13 WKCertificateParseResultFailed = 1,
14 WKCertificateParseResultPKCS7 = 2,
15 } WKCertificateParseResult;
17 NSString *WKCreateURLPasteboardFlavorTypeName(void);
18 NSString *WKCreateURLNPasteboardFlavorTypeName(void);
20 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
21 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
22 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
24 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
25 NSArray *WKGetExtensionsForMIMEType(NSString *type);
26 NSString *WKGetMIMETypeForExtension(NSString *extension);
28 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
29 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
30 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
31 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
33 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
35 float WKSecondsSinceLastInputEvent(void);
36 CFStringRef WKPreferRGB32Key(void);
38 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
39 float WKSecondsSinceLastInputEvent(void);
41 void WKShowKeyAndMain(void);
42 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
43 unsigned WKCarbonWindowMask(void);
44 void *WKGetNativeWindowFromWindowRef(WindowRef);
45 OSType WKCarbonWindowPropertyCreator(void);
46 OSType WKCarbonWindowPropertyTag(void);
48 typedef id WKNSURLConnectionDelegateProxyPtr;
50 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
52 void WKDisableCGDeferredUpdates(void);
54 void WKSetSecureEventInput(BOOL enable);
55 BOOL WKSecureEventInput(void);
57 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
59 unsigned WKGetNSAutoreleasePoolCount(void);
61 NSString *WKMouseMovedNotification(void);
62 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
64 CFTypeID WKGetAXTextMarkerTypeID(void);
65 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
66 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
67 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
68 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
69 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
70 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
71 void WKAccessibilityHandleFocusChanged(void);
72 AXUIElementRef WKCreateAXUIElementRef(id element);
73 void WKUnregisterUniqueIdForElement(id element);
75 BOOL WKFontSmoothingModeIsLCD(int mode);
76 void WKSetUpFontCache(size_t s);
78 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
79 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
80 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
82 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
83 void (*formFinalize)(CFReadStreamRef, void *),
84 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
85 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
86 Boolean (*formCanRead)(CFReadStreamRef, void *),
87 void (*formClose)(CFReadStreamRef, void *),
88 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
89 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
92 void WKDrawFocusRing(CGContextRef context, CGRect clipRect, CGColorRef color, int radius);
93 // Ignore the context's clipping.
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 WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
99 // Deprecated (even more than the rest of this file).
100 // Keeping this here until WebKit switches entirely to WKDrawFocusRing.
102 void WKSetDragImage(NSImage *image, NSPoint offset);
104 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
105 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
106 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
108 void WKSendUserChangeNotifications(void);
109 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
110 void WKSendKeyEventToTSM(NSEvent *theEvent);
111 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
113 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
114 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
115 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
116 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
117 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
118 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
119 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
120 void WKReleaseStyleGroup(void *group);
121 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
123 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
125 #define WKGlyphVectorSize (50 * 32)
127 typedef void *WKGlyphVectorRef;
128 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
129 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
130 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
131 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
133 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
134 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
135 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
136 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
138 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
139 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
140 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
142 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
143 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
145 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
146 NSString* WKPathFromFont(NSFont *font);