427b2575cb24baf6d0dd3326af41337c279bc41d
[WebKit-https.git] / WebKitLibraries / win / include / WebKitSystemInterface / WebKitSystemInterface.h
1 /*
2  * Copyright (C) 2007, 2008, 2009 Apple 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 #ifndef WebKitSystemInterface_h
27 #define WebKitSystemInterface_h
28
29 struct CGAffineTransform;
30 struct CGPoint;
31 struct CGRect;
32 struct CGSize;
33
34 typedef const struct __CFData* CFDataRef;
35 typedef const struct __CFString* CFStringRef;
36 typedef struct CGColor* CGColorRef;
37 typedef struct CGContext* CGContextRef;
38 typedef unsigned short CGFontIndex;
39 typedef struct CGFont* CGFontRef;
40 typedef CGFontIndex CGGlyph;
41 typedef wchar_t UChar;
42 typedef struct _CFURLResponse* CFURLResponseRef;
43 typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
44 typedef struct _CFURLRequest* CFMutableURLRequestRef;
45 typedef const struct _CFURLRequest* CFURLRequestRef;
46 typedef struct _CFURLCredential* CFURLCredentialRef;
47 typedef struct __CFHTTPMessage* CFHTTPMessageRef;
48 typedef const struct __CFNumber* CFNumberRef;
49 typedef struct __CFReadStream* CFReadStreamRef;
50 typedef const struct __CFURL* CFURLRef;
51 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
52 typedef struct tagLOGFONTW LOGFONTW;
53 typedef LOGFONTW LOGFONT;
54
55 void wkSetFontSmoothingLevel(int type);
56 int wkGetFontSmoothingLevel();
57 void wkSetFontSmoothingContrast(CGFloat);
58 CGFloat wkGetFontSmoothingContrast();
59 void wkSystemFontSmoothingChanged();
60 uint32_t wkSetFontSmoothingStyle(CGContextRef cg, bool fontAllowsSmoothing);
61 void wkRestoreFontSmoothingStyle(CGContextRef cg, uint32_t oldStyle);
62 void wkSetCGContextFontRenderingStyle(CGContextRef, bool isSystemFont, bool isPrinterFont, bool usePlatformNativeGlyphs);
63 void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance);
64 void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count);
65 void wkSetUpFontCache(size_t s);
66
67 void wkSetPatternBaseCTM(CGContextRef, CGAffineTransform);
68 void wkSetPatternPhaseInUserSpace(CGContextRef, CGPoint phasePoint);
69 CGAffineTransform wkGetUserToBaseCTM(CGContextRef);
70
71 void wkDrawFocusRing(CGContextRef, CGColorRef, float radius);
72
73 CFDictionaryRef wkGetSSLCertificateInfo(CFURLResponseRef);
74 void* wkGetSSLPeerCertificateData(CFDictionaryRef);
75 void* wkGetSSLCertificateChainContext(CFDictionaryRef);
76 CFHTTPCookieStorageRef wkGetDefaultHTTPCookieStorage();
77 void wkSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool);
78 CFStringRef wkCopyFoundationCacheDirectory();
79 void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef);
80
81 CFArrayRef wkCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
82 void wkCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
83
84 unsigned wkInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
85
86 void wkSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
87 void wkSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
88 CFHTTPMessageRef wkCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
89
90 CFURLCredentialRef wkCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef protectionSpace);
91
92 CFStringRef wkCFNetworkErrorGetLocalizedDescription(CFIndex errorCode);
93
94 typedef enum {
95     WKMediaUIPartFullscreenButton   = 0,
96     WKMediaUIPartMuteButton,
97     WKMediaUIPartPlayButton,
98     WKMediaUIPartSeekBackButton,
99     WKMediaUIPartSeekForwardButton,
100     WKMediaUIPartTimelineSlider,
101     WKMediaUIPartTimelineSliderThumb,
102     WKMediaUIPartRewindButton,
103     WKMediaUIPartSeekToRealtimeButton,
104     WKMediaUIPartShowClosedCaptionsButton,
105     WKMediaUIPartHideClosedCaptionsButton,
106     WKMediaUIPartUnMuteButton,
107     WKMediaUIPartPauseButton,
108     WKMediaUIPartBackground,
109     WKMediaUIPartCurrentTimeDisplay,
110     WKMediaUIPartTimeRemainingDisplay,
111     WKMediaUIPartStatusDisplay,
112     WKMediaUIPartControlsPanel,
113     WKMediaUIPartVolumeSliderContainer,
114     WKMediaUIPartVolumeSlider,
115     WKMediaUIPartVolumeSliderThumb
116 } WKMediaUIPart;
117
118 typedef enum {
119     WKMediaControllerThemeClassic   = 1,
120     WKMediaControllerThemeQuickTime = 2
121 } WKMediaControllerThemeStyle;
122
123 typedef enum {
124     WKMediaControllerFlagDisabled = 1 << 0,
125     WKMediaControllerFlagPressed = 1 << 1,
126     WKMediaControllerFlagDrawEndCaps = 1 << 3,
127     WKMediaControllerFlagFocused = 1 << 4
128 } WKMediaControllerThemeState;
129
130 bool WKMediaControllerThemeAvailable(int themeStyle);
131 bool WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
132 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
133 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
134 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
135
136 #endif // WebKitSystemInterface_h