[Mac] [iOS] Add support for CFHTTPCookieStorageAcceptPolicyExclusivelyFromMainDocumen...
[WebKit-https.git] / Source / WebCore / platform / ios / WebCoreSystemInterfaceIOS.mm
1 /*
2  * Copyright 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #import "config.h"
27 #import "WebCoreSystemInterface.h"
28
29 void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
30 BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
31 CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
32 void (*wkCGContextResetClip)(CGContextRef); 
33 CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef);
34 void (*wkClearGlyphVector)(void* glyphs);
35 OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
36 NSString* (*wkGetMIMETypeForExtension)(NSString*);
37 NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
38 void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
39 void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
40 CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
41 bool (*wkCGContextIsPDFContext)(CGContextRef);
42 void (*wkSetUpFontCache)();
43 void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
44 void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
45 void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
46 CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), 
47     void (*formFinalize)(CFReadStreamRef, void *), 
48     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
49     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
50     Boolean (*formCanRead)(CFReadStreamRef, void *), 
51     void (*formClose)(CFReadStreamRef, void *), 
52     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
53     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
54     void *context);
55 NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
56 void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
57 void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
58 id (*wkCreateNSURLConnectionDelegateProxy)(void);
59 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
60 int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
61 void (*wkSetHTTPRequestMaximumPriority)(int priority);
62 void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
63 void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
64 void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
65 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
66 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
67 void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
68 CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
69 bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
70 int (*wkGetDeviceClass)(void);
71 CGSize (*wkGetViewportScreenSize)(void);
72 void (*wkSetLayerContentsScale)(CALayer *);
73 float (*wkGetScreenScaleFactor)(void);
74 bool (*wkIsGB18030ComplianceRequired)(void);
75 void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight); 
76 void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
77 CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
78
79 #if USE(CFNETWORK)
80 CFHTTPCookieStorageRef (*wkGetDefaultHTTPCookieStorage)();
81 WKCFURLCredentialRef (*wkCopyCredentialFromCFPersistentStorage)(CFURLProtectionSpaceRef protectionSpace);
82 void (*wkSetCFURLRequestShouldContentSniff)(CFMutableURLRequestRef, bool);
83 CFArrayRef (*wkCFURLRequestCopyHTTPRequestBodyParts)(CFURLRequestRef);
84 void (*wkCFURLRequestSetHTTPRequestBodyParts)(CFMutableURLRequestRef, CFArrayRef bodyParts);
85 void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
86 #endif
87
88 bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGlyph[], size_t);
89 CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
90 bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options);
91
92 CGSize (*wkCTRunGetInitialAdvance)(CTRunRef);
93
94 CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
95
96 #if !PLATFORM(IOS_SIMULATOR)
97 CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
98 CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
99 #endif // !PLATFORM(IOS_SIMULATOR)
100
101 CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
102 NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
103 CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
104 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
105 void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
106 NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
107 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
108 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
109 void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
110 void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
111
112 CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
113 CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
114 CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
115 CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
116 void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
117
118 void(*wkDestroyRenderingResources)(void);
119
120 bool (*wkCaptionAppearanceHasUserPreferences)(void);
121 bool (*wkCaptionAppearanceShowCaptionsWhenAvailable)(void);
122 CGColorRef(*wkCaptionAppearanceCopyForegroundColor)(void);
123 CGColorRef(*wkCaptionAppearanceCopyBackgroundColor)(void);
124 CGColorRef(*wkCaptionAppearanceCopyWindowColor)(void);
125 bool(*wkCaptionAppearanceGetForegroundOpacity)(CGFloat*);
126 bool(*wkCaptionAppearanceGetBackgroundOpacity)(CGFloat*);
127 bool(*wkCaptionAppearanceGetWindowOpacity)(CGFloat*);
128 CGFontRef(*wkCaptionAppearanceCopyFontForStyle)(int);
129 bool(*wkCaptionAppearanceGetRelativeCharacterSize)(CGFloat*);
130 int(*wkCaptionAppearanceGetTextEdgeStyle)(void);
131 CFStringRef(*wkCaptionAppearanceGetSettingsChangedNotification)(void);
132
133 #if ENABLE(PUBLIC_SUFFIX_LIST)
134 bool (*wkIsPublicSuffix)(NSString *host);
135 #endif
136
137 #if ENABLE(CACHE_PARTITIONING)
138 CFStringRef (*wkCachePartitionKey)(void);
139 #endif
140
141 CFStringRef (*wkGetUserAgent)(void);
142 CFStringRef (*wkGetDeviceName)(void);
143 CFStringRef (*wkGetOSNameForUserAgent)(void);
144 CFStringRef (*wkGetPlatformNameForNavigator)(void);
145 CFStringRef (*wkGetVendorNameForNavigator)(void);