Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

390 lines
22 KiB

  1. /**************************************************************************\
  2. FILE: AutoDiscovery.idl
  3. DATE: 1/19/2000
  4. DESCRIPTION:
  5. AutoDiscovery API (Object Model).
  6. Copyright 1999-2000 Microsoft Corporation. All Rights Reserved.
  7. \**************************************************************************/
  8. cpp_quote("#ifndef _AUTODISCOVERY_IDL_H_")
  9. cpp_quote("#define _AUTODISCOVERY_IDL_H_")
  10. cpp_quote("// This API started shipping in IE 6")
  11. cpp_quote("#if (_WIN32_IE >= 0x0600)")
  12. midl_pragma warning( disable: 2400 )
  13. //--------------------------------------------------------------------------
  14. //
  15. //--------------------------------------------------------------------------
  16. import "oaidl.idl";
  17. import "ocidl.idl";
  18. import "objidl.idl";
  19. #include <olectl.h>
  20. //--------------------------------------------------------------------------
  21. // Includes
  22. //--------------------------------------------------------------------------
  23. #include "AutoDiscoveryID.h"
  24. //--------------------------------------------------------------------------
  25. // Dependencies
  26. //--------------------------------------------------------------------------
  27. //--------------------------------------------------------------------------
  28. // Interfaces
  29. //--------------------------------------------------------------------------
  30. //--------------------------------------------------------------------------
  31. // Script Interfaces
  32. //--------------------------------------------------------------------------
  33. //--------------------------------------------------------------------------
  34. // Apps Type Library
  35. //--------------------------------------------------------------------------
  36. [
  37. uuid(4EAFB888-81CB-4eba-BAC9-DA254E5721F1), // LIBID_AutoDiscovery
  38. helpstring("Microsoft AutoDiscovery Type Library"),
  39. version(1.0)
  40. ]
  41. library AutoDiscovery
  42. {
  43. //----------------------------------------------------------------------
  44. // Standard Type Library Stuff
  45. //----------------------------------------------------------------------
  46. importlib("stdole2.tlb");
  47. interface IAutoDiscoveryProvider;
  48. cpp_quote("#ifndef __LPAUTODISCOVERYPROVIDER_DEFINED")
  49. cpp_quote("#define __LPAUTODISCOVERYPROVIDER_DEFINED")
  50. cpp_quote("//===================================================================")
  51. cpp_quote("//DESCRIPTION:")
  52. cpp_quote("// This object will list the servers that will be tried when attempting")
  53. cpp_quote("//to download results.")
  54. cpp_quote("//")
  55. cpp_quote("//METHODS:")
  56. cpp_quote("//length: The number of servers.")
  57. cpp_quote("//item: Fetch the host name of the server that will be contacted.")
  58. cpp_quote("//===================================================================")
  59. [
  60. object,
  61. oleautomation,
  62. dual,
  63. nonextensible,
  64. uuid(9DCF4A37-01DE-4549-A9CB-3AC31EC23C4F), // IID_IAutoDiscoveryProvider
  65. ]
  66. interface IAutoDiscoveryProvider : IDispatch
  67. {
  68. //------------------------------------------------------------------
  69. // Pointer to an interface of this type
  70. //------------------------------------------------------------------
  71. typedef [unique] IAutoDiscoveryProvider *LPAUTODISCOVERYPROVIDER; // For C callers
  72. //------------------------------------------------------------------
  73. // Properties
  74. //------------------------------------------------------------------
  75. [id(DISPIDADMP_PROTOCOL), propget, SZ_DISPIDAD_PROTOCOL, displaybind, bindable] HRESULT length([retval, out] long * pnLength);
  76. [id(DISPIDADMP_SERVERNAME), propget, SZ_DISPIDAD_SERVERNAME, displaybind, bindable] HRESULT item([in] VARIANT varIndex,[retval, out] BSTR * pbstr);
  77. //------------------------------------------------------------------
  78. // Methods
  79. //------------------------------------------------------------------
  80. }
  81. //----------------------------------------------------------------------
  82. // AutoDiscovery Provider Class
  83. //----------------------------------------------------------------------
  84. [
  85. uuid(C4F3D5BF-4809-44e3-84A4-368B6B33B0B4), // CLSID_AutoDiscoveryProvider
  86. helpstring("Mail AutoDiscovery Provider Class"),
  87. ]
  88. coclass AutoDiscoveryProvider
  89. {
  90. [default] interface IAutoDiscoveryProvider;
  91. };
  92. cpp_quote("#endif // __LPAUTODISCOVERYPROVIDER_DEFINED")
  93. //======================================================================
  94. // AutoDiscovery features
  95. //======================================================================
  96. interface IMailAutoDiscovery;
  97. cpp_quote("#ifndef __LPACCOUNTDISCOVERY_DEFINED")
  98. cpp_quote("#define __LPACCOUNTDISCOVERY_DEFINED")
  99. cpp_quote("//===================================================================")
  100. cpp_quote("//DESCRIPTION:")
  101. cpp_quote("// This interface can be used by simply calling ::DiscoverNow(). It")
  102. cpp_quote("//will synchronously:")
  103. cpp_quote("//1. use bstrEmailAddress to find the domain name to contact. For example")
  104. cpp_quote("// for [email protected], it will contact http://_AutoDiscovery.yahoo.com/_AutoDiscovery/default.asp")
  105. cpp_quote("// and that fails, it will contact then http://yahoo.com/_AutoDiscovery/default.asp.")
  106. cpp_quote("//2. The bstrXMLRequest XML will be put into the HTTP headers so it can")
  107. cpp_quote("// be parsed by the server.")
  108. cpp_quote("//3. The response from the server will be returned in ppXMLResponse")
  109. cpp_quote("//")
  110. cpp_quote("//METHODS:")
  111. cpp_quote("//If you want the operation to happen asynchronously, first call")
  112. cpp_quote("//::WorkAsync(). A subsequent call to ::DiscoverNow() will start the operation and return")
  113. cpp_quote("// immediately and ppXMLResponse will be NULL. The wMsg passed to WorkAsync() will allow")
  114. cpp_quote("// the async thread to send status to the forground window/thread. AutoDiscovery is allowed")
  115. cpp_quote("// to send messages with ID wMsg through wMsg+10. Callers normally will want to pass")
  116. cpp_quote("// (WM_USER + n) for this message ID. These are the messages that the async thread will send:")
  117. cpp_quote("// [wMsg+0]: Means AutoDiscovery ended. The LPARAM will contain the XML normally returned in ppXMLResponse,")
  118. cpp_quote("// except it will be in a BSTR. The wndproc needs to free the LPARAM with SysFreeString()")
  119. cpp_quote("// if it isn't NULL. The WPARAM will contain the HRESULT error value.")
  120. cpp_quote("// [wMsg+1]: Status String. The WPARAM will contain a UNICODE string containing status that can be displayed")
  121. cpp_quote("// to the user. The wndproc needs to call LocalFree() on the WPARAM when done using it. The LPARAM will be NULL.")
  122. cpp_quote("// Calling ::WorkAsync() with a NULL hwnd will indicate that the call should be synchronous,")
  123. cpp_quote("// which is also the default behavior.")
  124. cpp_quote("//===================================================================")
  125. [
  126. object,
  127. oleautomation,
  128. dual,
  129. nonextensible,
  130. uuid(FA202BBC-6ABE-4c17-B184-570B6CF256A6), // IID_IAccountDiscovery
  131. ]
  132. interface IAccountDiscovery : IDispatch
  133. {
  134. //------------------------------------------------------------------
  135. // Pointer to an interface of this type
  136. //------------------------------------------------------------------
  137. typedef [unique] IAccountDiscovery *LPACCOUNTDISCOVERY; // For C callers
  138. cpp_quote("// IAccountDiscovery::DiscoverNow() flags")
  139. cpp_quote("#define ADDN_DEFAULT 0x00000000")
  140. cpp_quote("#define ADDN_CONFIGURE_EMAIL_FALLBACK 0x00000001 // We are attempting to configure an email account so contact public servers offering email settings.")
  141. cpp_quote(" // For Example, Microsoft may provide _AutoDiscovery.microsoft.com that can provide email configuration settings for common servers.")
  142. cpp_quote("#define ADDN_SKIP_CACHEDRESULTS 0x00000002 // Download the settings, even if they are already cached.")
  143. cpp_quote("#define ADDN_FILTER_EMAIL 0x00000100 // Some users may want the username part of the email address removed if we need to fall")
  144. cpp_quote(" // back to a public service to get the settings to protect their privacy.")
  145. //------------------------------------------------------------------
  146. // Properties
  147. //------------------------------------------------------------------
  148. //------------------------------------------------------------------
  149. // Methods
  150. //------------------------------------------------------------------
  151. [id(DISPIDAD_DISCOVERNOW), SZ_DISPIDAD_DISCOVERNOW, displaybind] HRESULT DiscoverNow([in] BSTR bstrEmailAddress, [in] DWORD dwFlags, [in] BSTR bstrXMLRequest, [retval, out] IXMLDOMDocument ** ppXMLResponse);
  152. [id(DISPIDAD_WORKASYNC), SZ_DISPIDAD_WORKASYNC, displaybind] HRESULT WorkAsync([in] HWND hwnd, [in] UINT wMsg);
  153. }
  154. cpp_quote("#endif // __LPACCOUNTDISCOVERY_DEFINED")
  155. //----------------------------------------------------------------------
  156. // AutoDiscover Accounts Class
  157. //----------------------------------------------------------------------
  158. [
  159. uuid(3DAB30ED-8132-40bf-A8BA-7B5057F0CD10), // CLSID_AccountDiscovery
  160. helpstring("AutoDiscover Accounts Class"),
  161. ]
  162. coclass AccountDiscovery
  163. {
  164. [default] interface IAccountDiscovery;
  165. };
  166. interface IMailProtocolADEntry;
  167. cpp_quote("#ifndef __LPMAILPROTOCOLADENTRY_DEFINED")
  168. cpp_quote("#define __LPMAILPROTOCOLADENTRY_DEFINED")
  169. cpp_quote("//===================================================================")
  170. cpp_quote("//DESCRIPTION:")
  171. cpp_quote("// Methods will return HRESULT_FROM_WIN32(ERROR_NOT_FOUND) if the")
  172. cpp_quote("//information could not be found in the XML results. This will")
  173. cpp_quote("//very often happen with LoginName() and ServerPort().")
  174. cpp_quote("//")
  175. cpp_quote("//METHODS:")
  176. cpp_quote("//Protocol: The name of this protocol. See STR_PT_*.")
  177. cpp_quote("//ServerName: This will be the name of the server to contact.")
  178. cpp_quote("// For DAVMail and WEB, this will be an URL.")
  179. cpp_quote("// For most other protocols, this will be an IP address")
  180. cpp_quote("// or the hostname of the server.")
  181. cpp_quote("//ServerPort: This is the port number on the server to use.")
  182. cpp_quote("//LoginName: The username to log into the email server if a username")
  183. cpp_quote("// other than the username in the email address (<username>@<domainname>)")
  184. cpp_quote("// is needed.")
  185. cpp_quote("//PostHTML: Reserved for future use.")
  186. cpp_quote("//UseSSL: If TRUE, use SSL when connecting to ServerName.")
  187. cpp_quote("//UseSPA: If TRUE, SPA (Secure Password Authenication) should")
  188. cpp_quote("// be used when contacting the server.")
  189. cpp_quote("//IsAuthRequired: This is only applicable to the SMTP protocol.")
  190. cpp_quote("// If TRUE, the SMTP server requires the client to authenticate")
  191. cpp_quote("// when logging in.")
  192. cpp_quote("//SMTPUsesPOP3Auth: This is only applicable to the SMTP protocol.")
  193. cpp_quote("// If TRUE, the login name and password for the POP3 or IMAP")
  194. cpp_quote("// server can be used to log into the SMTP server.")
  195. cpp_quote("//===================================================================")
  196. [
  197. object,
  198. oleautomation,
  199. dual,
  200. nonextensible,
  201. uuid(40EF8C68-D554-47ed-AA37-E5FB6BC91075), // IID_IMailProtocolADEntry
  202. ]
  203. interface IMailProtocolADEntry : IDispatch
  204. {
  205. //------------------------------------------------------------------
  206. // Pointer to an interface of this type
  207. //------------------------------------------------------------------
  208. typedef [unique] IMailProtocolADEntry *LPMAILPROTOCOLADENTRY; // For C callers
  209. //------------------------------------------------------------------
  210. // Properties
  211. //------------------------------------------------------------------
  212. [id(DISPIDADMP_PROTOCOL), propget, SZ_DISPIDAD_PROTOCOL, displaybind, bindable] HRESULT Protocol([retval, out] BSTR * pbstr);
  213. [id(DISPIDADMP_SERVERNAME), propget, SZ_DISPIDAD_SERVERNAME, displaybind, bindable] HRESULT ServerName([retval, out] BSTR * pbstr);
  214. [id(DISPIDADMP_SERVERPORTNUM), propget, SZ_DISPIDAD_SERVERPORTNUM, displaybind, bindable] HRESULT ServerPort([retval, out] BSTR * pbstr);
  215. [id(DISPIDADMP_LOGIN_NAME), propget, SZ_DISPIDAD_LOGIN_NAME, displaybind, bindable] HRESULT LoginName([retval, out] BSTR * pbstr);
  216. [id(DISPIDADMP_POST_HTML), propget, SZ_DISPIDAD_POST_HTML, displaybind, bindable] HRESULT PostHTML([retval, out] BSTR * pbstr);
  217. [id(DISPIDADMP_USE_SSL), propget, SZ_DISPIDAD_USE_SSL, displaybind, bindable] HRESULT UseSSL([retval, out] VARIANT_BOOL * pfUseSSL);
  218. [id(DISPIDADMP_ISAUTHREQ), propget, SZ_DISPIDAD_ISAUTHREQ, displaybind, bindable] HRESULT IsAuthRequired([retval, out] VARIANT_BOOL * pfIsAuthRequired);
  219. [id(DISPIDADMP_USESPA), propget, SZ_DISPIDAD_USESPA, displaybind, bindable] HRESULT UseSPA([retval, out] VARIANT_BOOL * pfUseSPA);
  220. [id(DISPIDADMP_SMTPUSESPOP3AUTH), propget, SZ_DISPIDAD_SMTPUSESPOP3AUTH, displaybind, bindable] HRESULT SMTPUsesPOP3Auth([retval, out] VARIANT_BOOL * pfUsePOP3Auth);
  221. //------------------------------------------------------------------
  222. // Methods
  223. //------------------------------------------------------------------
  224. }
  225. cpp_quote("#endif // __LPMAILPROTOCOLADENTRY_DEFINED")
  226. //----------------------------------------------------------------------
  227. // AutoDiscover Accounts Class
  228. //----------------------------------------------------------------------
  229. [
  230. uuid(61A5D6F3-C131-4c35-BF40-90A50F214122), // CLSID_MailProtocolADEntry
  231. helpstring("Mail AutoDiscovery Class"),
  232. ]
  233. coclass MailProtocolADEntry
  234. {
  235. [default] interface IMailProtocolADEntry;
  236. };
  237. interface IMailAutoDiscovery;
  238. cpp_quote("#ifndef __LPMAILAUTODISCOVERY_DEFINED")
  239. cpp_quote("#define __LPMAILAUTODISCOVERY_DEFINED")
  240. cpp_quote("//===================================================================")
  241. cpp_quote("//DESCRIPTION:")
  242. cpp_quote("// Methods will return HRESULT_FROM_WIN32(ERROR_NOT_FOUND) if the")
  243. cpp_quote("//information could not be found in the XML results. This will")
  244. cpp_quote("//very often happen with DisplayName() and ServerPort().")
  245. cpp_quote("//")
  246. cpp_quote("//METHODS:")
  247. cpp_quote("//DisplayName: This is the display name or the user's full name that")
  248. cpp_quote("// may or may not be specified by the server.")
  249. cpp_quote("//InfoURL: This is an URL that the server or service can provide")
  250. cpp_quote("// for the user to learn more about the email service")
  251. cpp_quote("// or how to access their email. Email clients that don't")
  252. cpp_quote("// support any of the protocols offered by the server can")
  253. cpp_quote("// launch this URL. The URL can then tell users which")
  254. cpp_quote("// email clients to use or how to configure the email client.")
  255. cpp_quote("// email clients to use or how to configure the email client.")
  256. cpp_quote("//PreferedProtocolType: This will return the server's prefered protocol.")
  257. cpp_quote("// The string will be one of STR_PT_* and can be passed to.")
  258. cpp_quote("// item() to get more information.")
  259. cpp_quote("//length: The number of protocols the server supports.")
  260. cpp_quote("//item: The caller can pass the index of the protocol to access or")
  261. cpp_quote("// ask for a particular protocol (by STR_PT_*).")
  262. cpp_quote("//xml: The caller can get the AutoDiscovery XML from the server.")
  263. cpp_quote("// This will allow email clients to get properties not currently")
  264. cpp_quote("// exposed throught this interface.")
  265. cpp_quote("//PrimaryProviders: Get the list of primary servers that will be")
  266. cpp_quote("// contacted in order to download the results. This will")
  267. cpp_quote("// allow the application to display this list to the user.")
  268. cpp_quote("// The full email password will be uploaded to these servers")
  269. cpp_quote("// in some cases.")
  270. cpp_quote("//SecondaryProviders: This will also list servers that will be contacted")
  271. cpp_quote("// except, as secondary servers, only the user's email hostname")
  272. cpp_quote("// will be uploaded (not the username part of the email address.")
  273. cpp_quote("//")
  274. cpp_quote("//DiscoverMail: Use the email address provided to download the ")
  275. cpp_quote("// AutoDiscovery XML file. This object can then be used to")
  276. cpp_quote("// get information from that XML file.")
  277. cpp_quote("//PurgeCache: If the downloaded settings are cached, purge the")
  278. cpp_quote("// cache so the next call to DiscoverMail() is guaranteed")
  279. cpp_quote("// to get the most current settings from the server.")
  280. cpp_quote("//WorkAsync: See WorkAsync's documentation in IAutoDiscovery.")
  281. cpp_quote("//===================================================================")
  282. [
  283. object,
  284. oleautomation,
  285. dual,
  286. nonextensible,
  287. uuid(80402DEE-B114-4d32-B44E-82FD8234C92A), // IID_IMailAutoDiscovery
  288. ]
  289. interface IMailAutoDiscovery : IDispatch
  290. {
  291. //------------------------------------------------------------------
  292. // Pointer to an interface of this type
  293. //------------------------------------------------------------------
  294. typedef [unique] IMailAutoDiscovery *LPMAILAUTODISCOVERY; // For C callers
  295. cpp_quote("// Protocol Types for ServerName(bstrServerType))")
  296. cpp_quote("#define STR_PT_POP L\"POP3\"")
  297. cpp_quote("#define STR_PT_SMTP L\"SMTP\"")
  298. cpp_quote("#define STR_PT_IMAP L\"IMAP\"")
  299. cpp_quote("#define STR_PT_MAPI L\"MAPI\"")
  300. cpp_quote("#define STR_PT_DAVMAIL L\"DAVMail\"")
  301. cpp_quote("#define STR_PT_SMTP L\"SMTP\"")
  302. cpp_quote("#define STR_PT_WEBBASED L\"WEB\" // Web pages are used to receive and send mail.")
  303. //------------------------------------------------------------------
  304. // Properties
  305. //------------------------------------------------------------------
  306. [id(DISPIDAD_DISPLAYNAME), propget, SZ_DISPIDAD_DISPLAYNAME, displaybind, bindable] HRESULT DisplayName([retval, out] BSTR * pbstr);
  307. [id(DISPIDAD_INFOURL), propget, SZ_DISPIDAD_INFOURL, displaybind, bindable] HRESULT InfoURL([retval, out] BSTR * pbstrURL);
  308. [id(DISPIDAD_PREFEREDPROTOCOL), propget, SZ_DISPIDAD_PREFEREDPROTOCOL, displaybind, bindable] HRESULT PreferedProtocolType([retval, out] BSTR * pbstrProtocolType);
  309. [id(DISPIDAD_LENGTH), propget, SZ_DISPIDAD_GETLENGTH, displaybind, bindable] HRESULT length([retval, out] long * pnLength);
  310. [id(DISPIDAD_ITEM), propget, SZ_DISPIDAD_GETITEM, displaybind, bindable] HRESULT item([in] VARIANT varIndex,[retval, out] IMailProtocolADEntry ** ppMailProtocol);
  311. [id(DISPIDAD_XML), propget, SZ_DISPIDAD_GETXML, displaybind, bindable] HRESULT XML([retval, out] IXMLDOMDocument ** ppXMLDoc);
  312. [id(DISPIDAD_XML), propput, SZ_DISPIDAD_PUTXML, displaybind, bindable] HRESULT XML([in] IXMLDOMDocument * pXMLDoc);
  313. //------------------------------------------------------------------
  314. // Methods
  315. //------------------------------------------------------------------
  316. [id(DISPIDADMP_PRIMARYPROVIDERS), SZ_DISPIDAD_PRIMARYPROVIDERS, displaybind] HRESULT getPrimaryProviders([in] BSTR bstrEmailAddress, [retval, out] IAutoDiscoveryProvider ** ppProviders);
  317. [id(DISPIDADMP_SECONDARYPROVIDERS), SZ_DISPIDAD_SECONDARYPROVIDERS, displaybind] HRESULT getSecondaryProviders([in] BSTR bstrEmailAddress, [retval, out] IAutoDiscoveryProvider ** ppProviders);
  318. [id(DISPIDAD_DISCOVERMAIL), SZ_DISPIDAD_DISCOVERMAIL, displaybind] HRESULT DiscoverMail([in] BSTR bstrEmailAddress);
  319. [id(DISPIDAD_PURGE), SZ_DISPIDAD_PURGE, displaybind] HRESULT PurgeCache(void);
  320. [id(DISPIDMAD_WORKASYNC), SZ_DISPIDAD_WORKASYNC, displaybind] HRESULT WorkAsync([in] HWND hwnd, [in] UINT wMsg);
  321. }
  322. cpp_quote("#endif // __LPMAILAUTODISCOVERY_DEFINED")
  323. //----------------------------------------------------------------------
  324. // AutoDiscover Accounts Class
  325. //----------------------------------------------------------------------
  326. [
  327. uuid(008FD5DD-6DBB-48e3-991B-2D3ED658516A), // CLSID_MailAutoDiscovery
  328. helpstring("Mail AutoDiscovery Class"),
  329. ]
  330. coclass MailAutoDiscovery
  331. {
  332. [default] interface IMailAutoDiscovery;
  333. };
  334. } // AutoDiscovery Library Object Definition
  335. cpp_quote("#endif // (_WIN32_IE >= 0x0600)")
  336. cpp_quote("#endif // _AUTODISCOVERY_IDL_H_")