|
1 /* |
|
2 * Copyright (C) 2006, 2007 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 cpp_quote("/*") |
|
27 cpp_quote(" * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.") |
|
28 cpp_quote(" *") |
|
29 cpp_quote(" * Redistribution and use in source and binary forms, with or without") |
|
30 cpp_quote(" * modification, are permitted provided that the following conditions") |
|
31 cpp_quote(" * are met:") |
|
32 cpp_quote(" * 1. Redistributions of source code must retain the above copyright") |
|
33 cpp_quote(" * notice, this list of conditions and the following disclaimer.") |
|
34 cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright") |
|
35 cpp_quote(" * notice, this list of conditions and the following disclaimer in the") |
|
36 cpp_quote(" * documentation and/or other materials provided with the distribution.") |
|
37 cpp_quote(" *") |
|
38 cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY") |
|
39 cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE") |
|
40 cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR") |
|
41 cpp_quote(" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR") |
|
42 cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,") |
|
43 cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,") |
|
44 cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR") |
|
45 cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY") |
|
46 cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT") |
|
47 cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE") |
|
48 cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ") |
|
49 cpp_quote(" */") |
|
50 |
|
51 import "oaidl.idl"; |
|
52 import "ocidl.idl"; |
|
53 import "IWebError.idl"; |
|
54 import "IWebURLResponse.idl"; |
|
55 |
|
56 interface IWebURLAuthenticationChallengeSender; |
|
57 interface IWebURLProtectionSpace; |
|
58 interface IWebURLCredential; |
|
59 |
|
60 typedef enum { |
|
61 WebURLCredentialPersistenceNone, |
|
62 WebURLCredentialPersistenceForSession, |
|
63 WebURLCredentialPersistencePermanent |
|
64 } WebURLCredentialPersistence; |
|
65 |
|
66 [ |
|
67 object, |
|
68 oleautomation, |
|
69 uuid(5382DABA-C3C3-40c5-AA40-04079F11A844), |
|
70 pointer_default(unique) |
|
71 ] |
|
72 interface IWebURLAuthenticationChallenge : IUnknown |
|
73 { |
|
74 /* |
|
75 - (NSError *)error |
|
76 */ |
|
77 HRESULT error([out, retval] IWebError** result); |
|
78 |
|
79 /* |
|
80 - (NSURLResponse *)failureResponse |
|
81 */ |
|
82 HRESULT failureResponse([out, retval] IWebURLResponse** result); |
|
83 |
|
84 /* |
|
85 - (id)initWithAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge sender:(id<NSURLAuthenticationChallengeSender>)sender |
|
86 */ |
|
87 HRESULT initWithAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge, [in] IWebURLAuthenticationChallengeSender* sender); |
|
88 |
|
89 /* |
|
90 - (id)initWithProtectionSpace:(NSURLProtectionSpace *)space proposedCredential:(NSURLCredential *)credential previousFailureCount:(int)count failureResponse:(NSURLResponse *)response error:(NSError *)error sender:(id <NSURLAuthenticationChallengeSender>)sender |
|
91 */ |
|
92 HRESULT initWithProtectionSpace([in] IWebURLProtectionSpace* space, [in] IWebURLCredential* proposedCredential, [in] int previousFailureCount, [in] IWebURLResponse* failureResponse, [in] IWebError* error, [in] IWebURLAuthenticationChallengeSender* sender); |
|
93 |
|
94 /* |
|
95 -(unsigned)previousFailureCount |
|
96 */ |
|
97 HRESULT previousFailureCount([out, retval] UINT* result); |
|
98 |
|
99 /* |
|
100 -(NSURLCredential *)proposedCredential |
|
101 */ |
|
102 HRESULT proposedCredential([out, retval] IWebURLCredential** result); |
|
103 |
|
104 /* |
|
105 - (NSURLProtectionSpace *)protectionSpace |
|
106 */ |
|
107 HRESULT protectionSpace([out, retval] IWebURLProtectionSpace** result); |
|
108 |
|
109 /* |
|
110 - (id<NSURLAuthenticationChallengeSender>)sender |
|
111 */ |
|
112 HRESULT sender([out, retval] IWebURLAuthenticationChallengeSender** sender); |
|
113 } |
|
114 |
|
115 [ |
|
116 object, |
|
117 oleautomation, |
|
118 uuid(9360D6FB-186C-4ff7-AE57-D1B973DA0D1C), |
|
119 pointer_default(unique) |
|
120 ] |
|
121 interface IWebURLAuthenticationChallengeSender : IUnknown |
|
122 { |
|
123 /* |
|
124 - (void)cancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge |
|
125 */ |
|
126 HRESULT cancelAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge); |
|
127 |
|
128 /* |
|
129 - (void)continueWithoutCredentialForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge |
|
130 */ |
|
131 HRESULT continueWithoutCredentialForAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge); |
|
132 |
|
133 /* |
|
134 - (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge |
|
135 */ |
|
136 HRESULT useCredential([in] IWebURLCredential* credential, [in] IWebURLAuthenticationChallenge* challenge); |
|
137 } |
|
138 |
|
139 cpp_quote("#define WebURLProtectionSpaceHTTP TEXT(\"http\")") |
|
140 cpp_quote("#define WebURLProtectionSpaceHTTPS TEXT(\"https\")") |
|
141 cpp_quote("#define WebURLProtectionSpaceFTP TEXT(\"ftp\")") |
|
142 cpp_quote("#define WebURLProtectionSpaceFTPS TEXT(\"ftps\")") |
|
143 cpp_quote("#define WebURLProtectionSpaceHTTPProxy TEXT(\"http\")") |
|
144 cpp_quote("#define WebURLProtectionSpaceHTTPSProxy TEXT(\"https\")") |
|
145 cpp_quote("#define WebURLProtectionSpaceFTPProxy TEXT(\"ftp\")") |
|
146 cpp_quote("#define WebURLProtectionSpaceSOCKSProxy TEXT(\"SOCKS\")") |
|
147 cpp_quote("#define WebURLAuthenticationMethodDefault TEXT(\"WebURLAuthenticationMethodDefault\")") |
|
148 cpp_quote("#define WebURLAuthenticationMethodHTTPBasic TEXT(\"WebURLAuthenticationMethodHTTPBasic\")") |
|
149 cpp_quote("#define WebURLAuthenticationMethodHTTPDigest TEXT(\"WebURLAuthenticationMethodHTTPDigest\")") |
|
150 cpp_quote("#define WebURLAuthenticationMethodHTMLForm TEXT(\"WebURLAuthenticationMethodHTMLForm\")") |
|
151 |
|
152 [ |
|
153 object, |
|
154 oleautomation, |
|
155 hidden, |
|
156 uuid(71D2622A-3FF2-404b-BD45-C60659C901AF), |
|
157 pointer_default(unique) |
|
158 ] |
|
159 interface IWebURLProtectionSpace : IUnknown |
|
160 { |
|
161 /* |
|
162 -(NSString *)authenticationMethod |
|
163 */ |
|
164 HRESULT authenticationMethod([out, retval] BSTR* result); |
|
165 |
|
166 /* |
|
167 -(NSString *)host |
|
168 */ |
|
169 HRESULT host([out, retval] BSTR* result); |
|
170 |
|
171 /* |
|
172 -(id)initWithHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod |
|
173 */ |
|
174 HRESULT initWithHost([in] BSTR host, [in] int port, [in] BSTR protocol, [in] BSTR realm, [in] BSTR authenticationMethod); |
|
175 |
|
176 /* |
|
177 -(id)initWithProxyHost:(NSString *)host port:(int)port type:(NSString *)proxyType realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod |
|
178 */ |
|
179 HRESULT initWithProxyHost([in] BSTR host, [in] int port, [in] BSTR proxyType, [in] BSTR realm, [in] BSTR authenticationMethod); |
|
180 |
|
181 /* |
|
182 -(BOOL)isProxy |
|
183 */ |
|
184 HRESULT isProxy([out, retval] BOOL* result); |
|
185 |
|
186 /* |
|
187 -(int)port |
|
188 */ |
|
189 HRESULT port([out, retval] int* result); |
|
190 |
|
191 /* |
|
192 -(NSString *)protocol |
|
193 */ |
|
194 HRESULT protocol([out, retval] BSTR* result); |
|
195 |
|
196 /* |
|
197 -(NSString *)proxyType |
|
198 */ |
|
199 HRESULT proxyType([out, retval] BSTR* result); |
|
200 |
|
201 /* |
|
202 -(NSString *)realm |
|
203 */ |
|
204 HRESULT realm([out, retval] BSTR* result); |
|
205 |
|
206 /* |
|
207 -(BOOL)receivesCredentialSecurely |
|
208 */ |
|
209 HRESULT receivesCredentialSecurely([out, retval] BOOL* result); |
|
210 } |
|
211 |
|
212 [ |
|
213 object, |
|
214 oleautomation, |
|
215 hidden, |
|
216 uuid(A1E9D765-FACE-4189-BBE3-AED7EBF65EBD), |
|
217 pointer_default(unique) |
|
218 ] |
|
219 interface IWebURLCredential : IUnknown |
|
220 { |
|
221 /* |
|
222 -(BOOL)hasPassword |
|
223 */ |
|
224 HRESULT hasPassword([out, retval] BOOL* result); |
|
225 |
|
226 /* |
|
227 -(id)initWithUser:(NSString *)user password:(NSString *)password persistence:(NSURLCredentialPersistence)persistence |
|
228 */ |
|
229 HRESULT initWithUser([in] BSTR user, [in] BSTR password, [in] WebURLCredentialPersistence persistence); |
|
230 |
|
231 /* |
|
232 -(NSString *)password |
|
233 */ |
|
234 HRESULT password([out, retval] BSTR* password); |
|
235 |
|
236 /* |
|
237 -(NSURLCredentialPersistence)persistence |
|
238 */ |
|
239 HRESULT persistence([out, retval] WebURLCredentialPersistence* result); |
|
240 |
|
241 /* |
|
242 -(NSString *)user |
|
243 */ |
|
244 HRESULT user([out, retval] BSTR* result); |
|
245 } |