WebKitSystemInterface.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. /*
  2. WebKitSystemInterface.h
  3. Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
  4. Public header file.
  5. */
  6. #import <Cocoa/Cocoa.h>
  7. #import <Carbon/Carbon.h>
  8. #import <dispatch/dispatch.h>
  9. @class AVAsset;
  10. @class QTMovie;
  11. @class QTMovieView;
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. typedef struct _CFURLResponse* CFURLResponseRef;
  16. typedef const struct _CFURLRequest* CFURLRequestRef;
  17. typedef struct _CFURLRequest* CFMutableURLRequestRef;
  18. typedef struct _CFURLCredential* WKCFURLCredentialRef;
  19. typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
  20. typedef enum {
  21. WKCertificateParseResultSucceeded = 0,
  22. WKCertificateParseResultFailed = 1,
  23. WKCertificateParseResultPKCS7 = 2,
  24. } WKCertificateParseResult;
  25. CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
  26. void WKSetDefaultLocalization(CFStringRef localization);
  27. CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
  28. WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
  29. NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
  30. NSArray *WKGetExtensionsForMIMEType(NSString *type);
  31. NSString *WKGetMIMETypeForExtension(NSString *extension);
  32. NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
  33. NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
  34. NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
  35. CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
  36. CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
  37. void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
  38. void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
  39. void WKShowKeyAndMain(void);
  40. #ifndef __LP64__
  41. OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
  42. unsigned WKCarbonWindowMask(void);
  43. void *WKGetNativeWindowFromWindowRef(WindowRef);
  44. OSType WKCarbonWindowPropertyCreator(void);
  45. OSType WKCarbonWindowPropertyTag(void);
  46. #endif
  47. void WKDisableCGDeferredUpdates(void);
  48. Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
  49. void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
  50. #ifndef __LP64__
  51. unsigned WKGetNSAutoreleasePoolCount(void);
  52. #endif
  53. void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
  54. NSString *WKMouseMovedNotification(void);
  55. NSString *WKWindowWillOrderOnScreenNotification(void);
  56. NSString *WKWindowWillOrderOffScreenNotification(void);
  57. void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
  58. CFTypeID WKGetAXTextMarkerTypeID(void);
  59. CFTypeID WKGetAXTextMarkerRangeTypeID(void);
  60. CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
  61. BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
  62. CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
  63. CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
  64. CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
  65. void WKAccessibilityHandleFocusChanged(void);
  66. AXUIElementRef WKCreateAXUIElementRef(id element);
  67. void WKUnregisterUniqueIdForElement(id element);
  68. NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
  69. NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
  70. BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
  71. BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
  72. // Remote Accessibility API.
  73. void WKAXRegisterRemoteApp(void);
  74. void WKAXInitializeElementWithPresenterPid(id, pid_t);
  75. NSData *WKAXRemoteTokenForElement(id);
  76. id WKAXRemoteElementForToken(NSData *);
  77. void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
  78. void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
  79. pid_t WKAXRemoteProcessIdentifier(id remoteElement);
  80. void WKSetUpFontCache(void);
  81. void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
  82. void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
  83. void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
  84. CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
  85. void (*formFinalize)(CFReadStreamRef, void *),
  86. Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
  87. CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
  88. Boolean (*formCanRead)(CFReadStreamRef, void *),
  89. void (*formClose)(CFReadStreamRef, void *),
  90. void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
  91. void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
  92. void *context);
  93. void WKDrawCapsLockIndicator(CGContextRef, CGRect);
  94. void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
  95. // The CG context's current path is the focus ring's path.
  96. // A color of 0 means "use system focus ring color".
  97. // A radius of 0 means "use default focus ring radius".
  98. void WKSetDragImage(NSImage *image, NSPoint offset);
  99. void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
  100. void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
  101. void WKDrawBezeledTextArea(NSRect, BOOL enabled);
  102. void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
  103. void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
  104. void WKSendUserChangeNotifications(void);
  105. #ifndef __LP64__
  106. BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
  107. void WKSendKeyEventToTSM(NSEvent *theEvent);
  108. void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
  109. #endif
  110. BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
  111. NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
  112. NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
  113. void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
  114. BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
  115. void WKSetBaseCTM(CGContextRef, CGAffineTransform);
  116. void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
  117. CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
  118. void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
  119. bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
  120. CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
  121. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  122. enum {
  123. WKCTFontTransformApplyShaping = (1 << 0),
  124. WKCTFontTransformApplyPositioning = (1 << 1)
  125. };
  126. typedef int WKCTFontTransformOptions;
  127. bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
  128. #endif
  129. CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
  130. CGSize WKCTRunGetInitialAdvance(CTRunRef);
  131. CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
  132. CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
  133. typedef enum {
  134. WKPatternTilingNoDistortion,
  135. WKPatternTilingConstantSpacingMinimalDistortion,
  136. WKPatternTilingConstantSpacing
  137. } WKPatternTiling;
  138. CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
  139. void WKCGContextResetClip(CGContextRef);
  140. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  141. bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
  142. #endif
  143. #ifndef __LP64__
  144. NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
  145. NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
  146. NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
  147. #endif
  148. CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
  149. void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
  150. void WKNSWindowMakeBottomCornersSquare(NSWindow *);
  151. // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
  152. // use that enum directly).
  153. typedef enum {
  154. WKThemeScrollBarArrowsSingle = 0,
  155. WKThemeScrollBarArrowsLowerRight = 1,
  156. WKThemeScrollBarArrowsDouble = 2,
  157. WKThemeScrollBarArrowsUpperLeft = 3,
  158. } WKThemeScrollBarArrowStyle;
  159. OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
  160. BOOL WKCGContextIsBitmapContext(CGContextRef context);
  161. bool WKCGContextIsPDFContext(CGContextRef context);
  162. void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
  163. BOOL WKAppVersionCheckLessThan(NSString *, int, double);
  164. typedef enum {
  165. WKMovieTypeUnknown,
  166. WKMovieTypeDownload,
  167. WKMovieTypeStoredStream,
  168. WKMovieTypeLiveStream
  169. } WKMovieType;
  170. int WKQTMovieGetType(QTMovie* movie);
  171. BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
  172. void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
  173. void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
  174. void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
  175. unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
  176. int WKQTMovieDataRate(QTMovie* movie);
  177. float WKQTMovieMaxTimeLoaded(QTMovie* movie);
  178. float WKQTMovieMaxTimeSeekable(QTMovie* movie);
  179. NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
  180. void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
  181. void WKQTMovieDisableComponent(uint32_t[5]);
  182. NSURL *WKQTMovieResolvedURL(QTMovie* movie);
  183. CFStringRef WKCopyFoundationCacheDirectory(void);
  184. typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
  185. CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
  186. NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
  187. NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
  188. void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
  189. typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
  190. CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
  191. unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
  192. void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
  193. NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
  194. NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
  195. void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
  196. void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
  197. void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
  198. CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
  199. WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
  200. void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
  201. CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
  202. void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
  203. void WKSetVisibleApplicationName(CFStringRef);
  204. void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
  205. CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
  206. typedef enum {
  207. WKMediaUIPartFullscreenButton = 0,
  208. WKMediaUIPartMuteButton,
  209. WKMediaUIPartPlayButton,
  210. WKMediaUIPartSeekBackButton,
  211. WKMediaUIPartSeekForwardButton,
  212. WKMediaUIPartTimelineSlider,
  213. WKMediaUIPartTimelineSliderThumb,
  214. WKMediaUIPartRewindButton,
  215. WKMediaUIPartSeekToRealtimeButton,
  216. WKMediaUIPartShowClosedCaptionsButton,
  217. WKMediaUIPartHideClosedCaptionsButton,
  218. WKMediaUIPartUnMuteButton,
  219. WKMediaUIPartPauseButton,
  220. WKMediaUIPartBackground,
  221. WKMediaUIPartCurrentTimeDisplay,
  222. WKMediaUIPartTimeRemainingDisplay,
  223. WKMediaUIPartStatusDisplay,
  224. WKMediaUIPartControlsPanel,
  225. WKMediaUIPartVolumeSliderContainer,
  226. WKMediaUIPartVolumeSlider,
  227. WKMediaUIPartVolumeSliderThumb,
  228. WKMediaUIPartFullScreenVolumeSlider,
  229. WKMediaUIPartFullScreenVolumeSliderThumb,
  230. WKMediaUIPartVolumeSliderMuteButton,
  231. WKMediaUIPartTextTrackDisplayContainer,
  232. WKMediaUIPartTextTrackDisplay,
  233. WKMediaUIPartExitFullscreenButton,
  234. } WKMediaUIPart;
  235. typedef enum {
  236. WKMediaControllerThemeClassic = 1,
  237. WKMediaControllerThemeQuickTime = 2
  238. } WKMediaControllerThemeStyle;
  239. typedef enum {
  240. WKMediaControllerFlagDisabled = 1 << 0,
  241. WKMediaControllerFlagPressed = 1 << 1,
  242. WKMediaControllerFlagDrawEndCaps = 1 << 3,
  243. WKMediaControllerFlagFocused = 1 << 4
  244. } WKMediaControllerThemeState;
  245. BOOL WKMediaControllerThemeAvailable(int themeStyle);
  246. BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
  247. void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
  248. void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
  249. void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
  250. NSView *WKCreateMediaUIBackgroundView(void);
  251. typedef enum {
  252. WKMediaUIControlTimeline,
  253. WKMediaUIControlSlider,
  254. WKMediaUIControlPlayPauseButton,
  255. WKMediaUIControlExitFullscreenButton,
  256. WKMediaUIControlRewindButton,
  257. WKMediaUIControlFastForwardButton,
  258. WKMediaUIControlVolumeUpButton,
  259. WKMediaUIControlVolumeDownButton
  260. } WKMediaUIControlType;
  261. NSControl *WKCreateMediaUIControl(int controlType);
  262. NSArray *WKQTGetSitesInMediaDownloadCache();
  263. void WKQTClearMediaDownloadCacheForSite(NSString *site);
  264. void WKQTClearMediaDownloadCache();
  265. mach_port_t WKInitializeRenderServer(void);
  266. @class CALayer;
  267. CALayer *WKMakeRenderLayer(uint32_t contextID);
  268. typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
  269. WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
  270. void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
  271. void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
  272. typedef struct __WKCAContextRef *WKCAContextRef;
  273. WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
  274. WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
  275. void WKCAContextInvalidate(WKCAContextRef);
  276. uint32_t WKCAContextGetContextId(WKCAContextRef);
  277. void WKCAContextSetLayer(WKCAContextRef, CALayer *);
  278. CALayer *WKCAContextGetLayer(WKCAContextRef);
  279. void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
  280. CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
  281. void WKDestroyRenderingResources(void);
  282. void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
  283. @class CARenderer;
  284. void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
  285. void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
  286. typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
  287. WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
  288. void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
  289. void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
  290. void WKWindowSetClipRect(NSWindow*, NSRect);
  291. #if defined(__x86_64__)
  292. #import <mach/mig.h>
  293. CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
  294. #endif // defined(__x86_64__)
  295. NSUInteger WKGetInputPanelWindowStyle(void);
  296. UInt8 WKGetNSEventKeyChar(NSEvent *);
  297. @class CAPropertyAnimation;
  298. void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
  299. unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
  300. int WKGetHTTPPipeliningPriority(CFURLRequestRef);
  301. void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
  302. void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
  303. void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
  304. void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
  305. void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
  306. CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
  307. void WKWindowSetAlpha(NSWindow *window, float alphaValue);
  308. void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
  309. void WKSyncSurfaceToView(NSView *view);
  310. void WKEnableSettingCursorWhenInBackground(void);
  311. CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
  312. NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
  313. CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
  314. NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
  315. #ifndef __LP64__
  316. ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
  317. #endif
  318. CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
  319. void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);
  320. CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
  321. CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
  322. CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
  323. CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
  324. void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
  325. CIFormat WKCIGetRGBA8Format(void);
  326. typedef enum {
  327. WKSandboxExtensionTypeReadOnly,
  328. WKSandboxExtensionTypeReadWrite,
  329. } WKSandboxExtensionType;
  330. typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
  331. WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
  332. void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
  333. bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
  334. bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
  335. const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
  336. WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
  337. OSStatus WKEnableSandboxStyleFileQuarantine(void);
  338. int WKRecommendedScrollerStyle(void);
  339. bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
  340. NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
  341. void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
  342. void WKHideWordDefinitionWindow(void);
  343. CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
  344. void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
  345. NSURL* WKAVAssetResolvedURL(AVAsset*);
  346. NSCursor *WKCursor(const char *name);
  347. dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
  348. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  349. bool WKExecutableWasLinkedOnOrBeforeLion(void);
  350. #endif
  351. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  352. bool WKExecutableWasLinkedOnOrBeforeMountainLion(void);
  353. #endif
  354. void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
  355. void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
  356. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  357. @class WebFilterEvaluator;
  358. BOOL WKFilterIsManagedSession(void);
  359. WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
  360. BOOL WKFilterIsBuffering(WebFilterEvaluator *);
  361. BOOL WKFilterWasBlocked(WebFilterEvaluator *);
  362. NSData *WKFilterAddData(WebFilterEvaluator *, NSData *);
  363. NSData *WKFilterDataComplete(WebFilterEvaluator *);
  364. CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
  365. CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
  366. CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
  367. #endif
  368. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  369. typedef enum {
  370. WKOcclusionNotificationTypeApplicationBecameVisible,
  371. WKOcclusionNotificationTypeApplicationBecameOccluded,
  372. WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
  373. WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
  374. WKOcclusionNotificationTypeWindowBecameVisible,
  375. WKOcclusionNotificationTypeWindowBecameOccluded,
  376. } WKOcclusionNotificationType;
  377. typedef uint32_t WKWindowID;
  378. typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
  379. bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
  380. bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
  381. bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
  382. #endif
  383. bool WKIsJavaPlugInActive(void);
  384. void WKActivateJavaPlugIn(void);
  385. void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
  386. #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  387. bool WKIsPublicSuffix(NSString *domain);
  388. CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
  389. typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
  390. void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
  391. CFStringRef WKCachePartitionKey(void);
  392. void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
  393. #endif
  394. #ifdef __cplusplus
  395. }
  396. #endif