* WebKitSystemInterface.h: Update to latest
[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(void);
36 CFStringRef WKPreferRGB32Key(void);
37
38 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
39 float WKSecondsSinceLastInputEvent(void);
40
41 void WKShowKeyAndMain(void);
42 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
43 unsigned WKCarbonWindowMask(void);
44 void *WKGetNativeWindowFromWindowRef(WindowRef);
45 OSType WKCarbonWindowPropertyCreator(void);
46 OSType WKCarbonWindowPropertyTag(void);
47
48 typedef id WKNSURLConnectionDelegateProxyPtr;
49
50 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
51
52 void WKDisableCGDeferredUpdates(void);
53
54 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
55
56 unsigned WKGetNSAutoreleasePoolCount(void);
57
58 NSString *WKMouseMovedNotification(void);
59 BOOL WKMouseIsDown(void);
60 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
61
62 CFTypeID WKGetAXTextMarkerTypeID(void);
63 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
64 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
65 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
66 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
67 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
68 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
69 void WKAccessibilityHandleFocusChanged(void);
70 AXUIElementRef WKCreateAXUIElementRef(id element);
71 void WKUnregisterUniqueIdForElement(id element);
72
73 BOOL WKFontSmoothingModeIsLCD(int mode);
74 void WKSetUpFontCache(size_t s);
75
76 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
77 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
78 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
79
80 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
81     void (*formFinalize)(CFReadStreamRef, void *), 
82     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
83     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
84     Boolean (*formCanRead)(CFReadStreamRef, void *), 
85     void (*formClose)(CFReadStreamRef, void *), 
86     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
87     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
88     void *context);
89
90 void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
91 void WKSetDragImage(NSImage *image, NSPoint offset);
92
93 void WKSendUserChangeNotifications(void);
94 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
95 void WKSendKeyEventToTSM(NSEvent *theEvent);
96 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
97
98 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
99 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
100 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
101 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
102 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
103 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
104 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
105 void WKReleaseStyleGroup(void *group);
106 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
107
108 #define WKGlyphVectorSize (50 * 32)
109
110 typedef void *WKGlyphVectorRef;
111 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
112 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
113 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
114 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
115
116 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
117 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
118 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
119 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
120
121 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
122 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
123 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
124
125 BOOL WKExecutableLinkedInTigerOrEarlier(void);
126
127 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
128 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
129
130 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);