- updated
[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 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
18 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
19 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
20
21 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
22 NSArray *WKGetExtensionsForMIMEType(NSString *type);
23 NSString *WKGetMIMETypeForExtension(NSString *extension);
24
25 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
26 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
27 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
28 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
29
30 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
31
32 float WKSecondsSinceLastInputEvent();
33 CGColorSpaceRef WKCreateUncorrectedRGBColorSpace();
34 CGColorSpaceRef WKCreateUncorrectedGrayColorSpace();
35 CFStringRef WKPreferRGB32Key();
36
37 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
38 float WKSecondsSinceLastInputEvent(void);
39
40 void WKShowKeyAndMain(void);
41 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
42 unsigned WKCarbonWindowMask(void);
43 void *WKGetNativeWindowFromWindowRef(WindowRef);
44 OSType WKCarbonWindowPropertyCreator(void);
45 OSType WKCarbonWindowPropertyTag(void);
46
47 typedef id WKNSURLConnectionDelegateProxyPtr;
48
49 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy();
50
51 void WKDisableCGDeferredUpdates();
52
53 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
54
55 unsigned WKGetNSAutoreleasePoolCount();
56
57 NSString *WKMouseMovedNotification();
58 BOOL WKMouseIsDown();
59 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
60
61 CFTypeID WKGetAXTextMarkerTypeID();
62 CFTypeID WKGetAXTextMarkerRangeTypeID();
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();
69 AXUIElementRef WKCreateAXUIElementRef(id element);
70 void WKUnregisterUniqueIdForElement(id element);
71
72 BOOL WKFontSmoothingModeIsLCD(int mode);
73 void WKSetUpFontCache(size_t s);
74
75 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
76 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
77 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
78
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 *),
87                                                                                    void *context);
88
89 void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
90 void WKSetDragImage(NSImage *image, NSPoint offset);
91
92 void WKSendUserChangeNotifications();
93 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
94 void WKSendKeyEventToTSM(NSEvent *theEvent);
95 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
96