IWebURLAuthenticationChallenge.idl 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. * Copyright (C) 2006, 2007, 2008 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. #ifndef DO_NO_IMPORTS
  26. import "oaidl.idl";
  27. import "ocidl.idl";
  28. import "IWebError.idl";
  29. import "IWebURLResponse.idl";
  30. #endif
  31. interface IWebError;
  32. interface IWebURLAuthenticationChallengeSender;
  33. interface IWebURLCredential;
  34. interface IWebURLProtectionSpace;
  35. interface IWebURLResponse;
  36. typedef enum {
  37. WebURLCredentialPersistenceNone,
  38. WebURLCredentialPersistenceForSession,
  39. WebURLCredentialPersistencePermanent
  40. } WebURLCredentialPersistence;
  41. [
  42. object,
  43. oleautomation,
  44. uuid(5382DABA-C3C3-40c5-AA40-04079F11A844),
  45. pointer_default(unique)
  46. ]
  47. interface IWebURLAuthenticationChallenge : IUnknown
  48. {
  49. /*
  50. - (NSError *)error
  51. */
  52. HRESULT error([out, retval] IWebError** result);
  53. /*
  54. - (NSURLResponse *)failureResponse
  55. */
  56. HRESULT failureResponse([out, retval] IWebURLResponse** result);
  57. /*
  58. - (id)initWithAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge sender:(id<NSURLAuthenticationChallengeSender>)sender
  59. */
  60. HRESULT initWithAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge, [in] IWebURLAuthenticationChallengeSender* sender);
  61. /*
  62. - (id)initWithProtectionSpace:(NSURLProtectionSpace *)space proposedCredential:(NSURLCredential *)credential previousFailureCount:(int)count failureResponse:(NSURLResponse *)response error:(NSError *)error sender:(id <NSURLAuthenticationChallengeSender>)sender
  63. */
  64. HRESULT initWithProtectionSpace([in] IWebURLProtectionSpace* space, [in] IWebURLCredential* proposedCredential, [in] int previousFailureCount, [in] IWebURLResponse* failureResponse, [in] IWebError* error, [in] IWebURLAuthenticationChallengeSender* sender);
  65. /*
  66. -(unsigned)previousFailureCount
  67. */
  68. HRESULT previousFailureCount([out, retval] UINT* result);
  69. /*
  70. -(NSURLCredential *)proposedCredential
  71. */
  72. HRESULT proposedCredential([out, retval] IWebURLCredential** result);
  73. /*
  74. - (NSURLProtectionSpace *)protectionSpace
  75. */
  76. HRESULT protectionSpace([out, retval] IWebURLProtectionSpace** result);
  77. /*
  78. - (id<NSURLAuthenticationChallengeSender>)sender
  79. */
  80. HRESULT sender([out, retval] IWebURLAuthenticationChallengeSender** sender);
  81. }
  82. [
  83. object,
  84. oleautomation,
  85. uuid(9360D6FB-186C-4ff7-AE57-D1B973DA0D1C),
  86. pointer_default(unique)
  87. ]
  88. interface IWebURLAuthenticationChallengeSender : IUnknown
  89. {
  90. /*
  91. - (void)cancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
  92. */
  93. HRESULT cancelAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge);
  94. /*
  95. - (void)continueWithoutCredentialForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
  96. */
  97. HRESULT continueWithoutCredentialForAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge);
  98. /*
  99. - (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
  100. */
  101. HRESULT useCredential([in] IWebURLCredential* credential, [in] IWebURLAuthenticationChallenge* challenge);
  102. }
  103. cpp_quote("#define WebURLProtectionSpaceHTTP TEXT(\"http\")")
  104. cpp_quote("#define WebURLProtectionSpaceHTTPS TEXT(\"https\")")
  105. cpp_quote("#define WebURLProtectionSpaceFTP TEXT(\"ftp\")")
  106. cpp_quote("#define WebURLProtectionSpaceFTPS TEXT(\"ftps\")")
  107. cpp_quote("#define WebURLProtectionSpaceHTTPProxy TEXT(\"http\")")
  108. cpp_quote("#define WebURLProtectionSpaceHTTPSProxy TEXT(\"https\")")
  109. cpp_quote("#define WebURLProtectionSpaceFTPProxy TEXT(\"ftp\")")
  110. cpp_quote("#define WebURLProtectionSpaceSOCKSProxy TEXT(\"SOCKS\")")
  111. cpp_quote("#define WebURLAuthenticationMethodDefault TEXT(\"WebURLAuthenticationMethodDefault\")")
  112. cpp_quote("#define WebURLAuthenticationMethodHTTPBasic TEXT(\"WebURLAuthenticationMethodHTTPBasic\")")
  113. cpp_quote("#define WebURLAuthenticationMethodHTTPDigest TEXT(\"WebURLAuthenticationMethodHTTPDigest\")")
  114. cpp_quote("#define WebURLAuthenticationMethodHTMLForm TEXT(\"WebURLAuthenticationMethodHTMLForm\")")
  115. [
  116. object,
  117. oleautomation,
  118. hidden,
  119. uuid(71D2622A-3FF2-404b-BD45-C60659C901AF),
  120. pointer_default(unique)
  121. ]
  122. interface IWebURLProtectionSpace : IUnknown
  123. {
  124. /*
  125. -(NSString *)authenticationMethod
  126. */
  127. HRESULT authenticationMethod([out, retval] BSTR* result);
  128. /*
  129. -(NSString *)host
  130. */
  131. HRESULT host([out, retval] BSTR* result);
  132. /*
  133. -(id)initWithHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod
  134. */
  135. HRESULT initWithHost([in] BSTR host, [in] int port, [in] BSTR protocol, [in] BSTR realm, [in] BSTR authenticationMethod);
  136. /*
  137. -(id)initWithProxyHost:(NSString *)host port:(int)port type:(NSString *)proxyType realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod
  138. */
  139. HRESULT initWithProxyHost([in] BSTR host, [in] int port, [in] BSTR proxyType, [in] BSTR realm, [in] BSTR authenticationMethod);
  140. /*
  141. -(BOOL)isProxy
  142. */
  143. HRESULT isProxy([out, retval] BOOL* result);
  144. /*
  145. -(int)port
  146. */
  147. HRESULT port([out, retval] int* result);
  148. /*
  149. -(NSString *)protocol
  150. */
  151. HRESULT protocol([out, retval] BSTR* result);
  152. /*
  153. -(NSString *)proxyType
  154. */
  155. HRESULT proxyType([out, retval] BSTR* result);
  156. /*
  157. -(NSString *)realm
  158. */
  159. HRESULT realm([out, retval] BSTR* result);
  160. /*
  161. -(BOOL)receivesCredentialSecurely
  162. */
  163. HRESULT receivesCredentialSecurely([out, retval] BOOL* result);
  164. }
  165. [
  166. object,
  167. oleautomation,
  168. hidden,
  169. uuid(A1E9D765-FACE-4189-BBE3-AED7EBF65EBD),
  170. pointer_default(unique)
  171. ]
  172. interface IWebURLCredential : IUnknown
  173. {
  174. /*
  175. -(BOOL)hasPassword
  176. */
  177. HRESULT hasPassword([out, retval] BOOL* result);
  178. /*
  179. -(id)initWithUser:(NSString *)user password:(NSString *)password persistence:(NSURLCredentialPersistence)persistence
  180. */
  181. HRESULT initWithUser([in] BSTR user, [in] BSTR password, [in] WebURLCredentialPersistence persistence);
  182. /*
  183. -(NSString *)password
  184. */
  185. HRESULT password([out, retval] BSTR* password);
  186. /*
  187. -(NSURLCredentialPersistence)persistence
  188. */
  189. HRESULT persistence([out, retval] WebURLCredentialPersistence* result);
  190. /*
  191. -(NSString *)user
  192. */
  193. HRESULT user([out, retval] BSTR* result);
  194. }