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 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
56 unsigned WKGetNSAutoreleasePoolCount(void);
58 NSString *WKMouseMovedNotification(void);
59 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
61 CFTypeID WKGetAXTextMarkerTypeID(void);
62 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
63 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
64 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
65 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
66 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
67 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
68 void WKAccessibilityHandleFocusChanged(void);
69 AXUIElementRef WKCreateAXUIElementRef(id element);
70 void WKUnregisterUniqueIdForElement(id element);
72 BOOL WKFontSmoothingModeIsLCD(int mode);
73 void WKSetUpFontCache(size_t s);
75 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
76 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
77 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
79 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
80 void (*formFinalize)(CFReadStreamRef, void *),
81 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
82 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
83 Boolean (*formCanRead)(CFReadStreamRef, void *),
84 void (*formClose)(CFReadStreamRef, void *),
85 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
86 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
89 void WKDrawFocusRing(CGContextRef context, CGRect clipRect, CGColorRef color, int radius);
90 // Ignore the context's clipping.
91 // The CG context's current path is the focus ring's path.
92 // A color of 0 means "use system focus ring color".
93 // A radius of 0 means "use default focus ring radius".
95 void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
96 // Deprecated (even more than the rest of this file).
97 // Keeping this here until WebKit switches entirely to WKDrawFocusRing.
99 void WKSetDragImage(NSImage *image, NSPoint offset);
101 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
102 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
103 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
105 void WKSendUserChangeNotifications(void);
106 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
107 void WKSendKeyEventToTSM(NSEvent *theEvent);
108 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
110 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
111 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
112 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
113 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
114 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
115 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
116 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
117 void WKReleaseStyleGroup(void *group);
118 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
120 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
122 #define WKGlyphVectorSize (50 * 32)
124 typedef void *WKGlyphVectorRef;
125 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
126 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
127 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
128 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
130 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
131 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
132 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
133 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
135 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
136 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
137 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
139 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
140 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
142 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);