Updated copies of WebKitSystemInterface.h and libWebKitSystemInterface.a that include...
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005 Apple Computer, Inc. All rights reserved.    
4     
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10
11 typedef enum {
12     WKCertificateParseResultSucceeded  = 0,
13     WKCertificateParseResultFailed     = 1,
14     WKCertificateParseResultPKCS7      = 2,
15 } WKCertificateParseResult;
16
17 NSString *WKCreateURLPasteboardFlavorTypeName(void);
18 NSString *WKCreateURLNPasteboardFlavorTypeName(void);
19
20 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
21 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
22 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
23
24 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
25 NSArray *WKGetExtensionsForMIMEType(NSString *type);
26 NSString *WKGetMIMETypeForExtension(NSString *extension);
27
28 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
29 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
30 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
31 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
32
33 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
34
35 float WKSecondsSinceLastInputEvent();
36 CGColorSpaceRef WKCreateUncorrectedRGBColorSpace();
37 CGColorSpaceRef WKCreateUncorrectedGrayColorSpace();
38 CFStringRef WKPreferRGB32Key();
39
40 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
41 float WKSecondsSinceLastInputEvent(void);
42
43 void WKShowKeyAndMain(void);
44 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
45 unsigned WKCarbonWindowMask(void);
46 void *WKGetNativeWindowFromWindowRef(WindowRef);
47 OSType WKCarbonWindowPropertyCreator(void);
48 OSType WKCarbonWindowPropertyTag(void);
49
50 typedef id WKNSURLConnectionDelegateProxyPtr;
51
52 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy();
53
54 void WKDisableCGDeferredUpdates();
55
56 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
57
58 unsigned WKGetNSAutoreleasePoolCount();
59
60 NSString *WKMouseMovedNotification();
61 BOOL WKMouseIsDown();
62 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
63
64 CFTypeID WKGetAXTextMarkerTypeID();
65 CFTypeID WKGetAXTextMarkerRangeTypeID();
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();
72 AXUIElementRef WKCreateAXUIElementRef(id element);
73 void WKUnregisterUniqueIdForElement(id element);
74
75 BOOL WKFontSmoothingModeIsLCD(int mode);
76 void WKSetUpFontCache(size_t s);
77
78 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
79 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
80 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
81
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 *),
90                                                                                    void *context);
91
92 void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
93 void WKSetDragImage(NSImage *image, NSPoint offset);
94
95 void WKSendUserChangeNotifications();
96 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
97 void WKSendKeyEventToTSM(NSEvent *theEvent);
98 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
99
100 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
101 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
102 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
103 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
104 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
105 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
106 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
107 void WKReleaseStyleGroup(void *group);
108 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
109
110 #define WKGlyphVectorSize (50 * 32)
111
112 typedef void *WKGlyphVectorRef;
113 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
114 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
115 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
116 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
117
118 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
119 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
120 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
121 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
122
123 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
124 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
125 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);