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.

347 lines
12 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright 1997 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // Contents: IBasicIM and related interfaces
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifdef __MKTYPLIB__
  9. #define VARIANT_BOOL boolean
  10. #else // __MKTYPLIB__
  11. cpp_quote("//+-------------------------------------------------------------------------")
  12. cpp_quote("//")
  13. cpp_quote("// Microsoft Windows")
  14. cpp_quote("// Copyright 1997 Microsoft Corporation. All Rights Reserved.")
  15. cpp_quote("//")
  16. cpp_quote("// File: basicim.h")
  17. cpp_quote("//")
  18. cpp_quote("//--------------------------------------------------------------------------")
  19. import "objidl.idl";
  20. import "oleidl.idl";
  21. import "oaidl.idl";
  22. #endif // __MKTYPLIB__
  23. #include "mdispid.h"
  24. #define BASICIM_S(e) (0x01000300 + (e))
  25. #define BASICIM_E(e) (0x81000300 + (e))
  26. #define E_FAIL 0x80004005
  27. #define S_OK 0
  28. #ifdef __MKTYPLIB__
  29. //--------------------------------------------------------------------------
  30. // Type Library
  31. [
  32. uuid(566ACF67-6124-4812-9362-E6D0C431D6F5), // LIBID_BasicIM
  33. version(1.0),
  34. helpstring("Messenger Basic IM Type Library")
  35. ]
  36. library BasicIM
  37. {
  38. importlib("stdole32.tlb");
  39. #endif
  40. interface IBasicIMOld;
  41. interface IBasicIM;
  42. interface IBasicIMUser;
  43. interface IBasicIMUsers;
  44. #define DISPID_VALUE 0
  45. #define DISPID_NEWENUM -4
  46. typedef enum
  47. {
  48. BIMSTATE_UNKNOWN = 0x0000,
  49. BIMSTATE_OFFLINE = 0x0001,
  50. BIMSTATE_ONLINE = 0x0002,
  51. BIMSTATE_INVISIBLE = 0x0006,
  52. BIMSTATE_BUSY = 0x000A,
  53. BIMSTATE_BE_RIGHT_BACK = 0x000E,
  54. BIMSTATE_IDLE = 0x0012,
  55. BIMSTATE_AWAY = 0x0022,
  56. BIMSTATE_ON_THE_PHONE = 0x0032,
  57. BIMSTATE_OUT_TO_LUNCH = 0x0042,
  58. BIMSTATE_LOCAL_FINDING_SERVER = 0x0100,
  59. BIMSTATE_LOCAL_CONNECTING_TO_SERVER = 0x0200,
  60. BIMSTATE_LOCAL_SYNCHRONIZING_WITH_SERVER = 0x0300,
  61. BIMSTATE_LOCAL_DISCONNECTING_FROM_SERVER = 0x0400,
  62. }
  63. BIMSTATE;
  64. typedef enum
  65. {
  66. BASICIM_E_CONNECT = BASICIM_E(0x0001),
  67. BASICIM_E_INVALID_SERVER_NAME = BASICIM_E(0x0002),
  68. BASICIM_E_INVALID_PASSWORD = BASICIM_E(0x0003),
  69. BASICIM_E_ALREADY_LOGGED_ON = BASICIM_E(0x0004),
  70. BASICIM_E_SERVER_VERSION = BASICIM_E(0x0005),
  71. BASICIM_E_LOGON_TIMEOUT = BASICIM_E(0x0006),
  72. BASICIM_E_LIST_FULL = BASICIM_E(0x0007),
  73. BASICIM_E_AI_REJECT = BASICIM_E(0x0008),
  74. BASICIM_E_AI_REJECT_NOT_INST = BASICIM_E(0x0009),
  75. BASICIM_E_USER_NOT_FOUND = BASICIM_E(0x000A),
  76. BASICIM_E_ALREADY_IN_LIST = BASICIM_E(0x000B),
  77. BASICIM_E_DISCONNECTED = BASICIM_E(0x000C),
  78. BASICIM_E_UNEXPECTED = BASICIM_E(0x000D),
  79. BASICIM_E_SERVER_TOO_BUSY = BASICIM_E(0x000E),
  80. BASICIM_E_INVALID_AUTH_PACKAGES = BASICIM_E(0x000F),
  81. BASICIM_E_NEWER_CLIENT_AVAILABLE = BASICIM_E(0x0010),
  82. BASICIM_E_AI_TIMEOUT = BASICIM_E(0x0011),
  83. BASICIM_E_CANCEL = BASICIM_E(0x0012),
  84. BASICIM_E_TOO_MANY_MATCHES = BASICIM_E(0x0013),
  85. BASICIM_E_SERVER_UNAVAILABLE = BASICIM_E(0x0014),
  86. BASICIM_E_LOGON_UI_ACTIVE = BASICIM_E(0x0015),
  87. BASICIM_E_OPTION_UI_ACTIVE = BASICIM_E(0x0016),
  88. BASICIM_E_CONTACT_UI_ACTIVE = BASICIM_E(0x0017),
  89. BASICIM_E_PRIMARY_SERVICE_NOT_LOGGED_ON = BASICIM_E(0x0018),
  90. BASICIM_S_ASYNCRESULT = BASICIM_S(0x0000),
  91. BASICIM_E_FAIL = E_FAIL,
  92. BASICIM_S_OK = S_OK,
  93. }
  94. BASICIM_Constants;
  95. typedef enum
  96. {
  97. BIMUSERPROP_INVALID_PROPERTY = -1,
  98. BIMUSERPROP_HOME_PHONE_NUMBER = 0,
  99. BIMUSERPROP_WORK_PHONE_NUMBER = 1,
  100. BIMUSERPROP_MOBILE_PHONE_NUMBER = 2,
  101. BIMUSERPROP_NUMBER_OF_PROPERTIES,
  102. }
  103. BIMUSERPROPERTY;
  104. //--------------------------------------------------------------------------
  105. // IBasicIM Interface
  106. [
  107. uuid(59EC0340-7506-11d2-B05F-00C04F7F89FE), // IID_IBasicIMOld
  108. helpstring("Messenger Basic IM Object Interface - old version"),
  109. hidden,
  110. oleautomation
  111. ]
  112. interface IBasicIMOld : IUnknown
  113. {
  114. [id(100), helpstring("Creates a Basic IM user object.")]
  115. HRESULT CreateUser([in] BSTR bstrLogonName,
  116. [out, retval] IBasicIMUser** ppBIMUser);
  117. [id(105), helpstring("Initiates a logoff.")]
  118. HRESULT Logoff();
  119. [propget, helpstring("Returns the Contact list.")]
  120. HRESULT ContactList([out, retval] IBasicIMUsers** ppBIMUsers);
  121. [propget, helpstring("Logon name.")]
  122. HRESULT LocalLogonName([out, retval] BSTR* pbstrName);
  123. [propput, helpstring("Local state.")]
  124. HRESULT LocalState([in] BIMSTATE bimState);
  125. [propget]
  126. HRESULT LocalState([out, retval] BIMSTATE* pbimState);
  127. [id(222), helpstring("Initiates a Logon without UI if connected to the network and user saved the password.")]
  128. HRESULT AutoLogon();
  129. #ifdef __MKTYPLIB__
  130. [id(200), helpstring("Initiates Logon dialog.")]
  131. HRESULT LaunchLogonUI();
  132. [id(201), helpstring("Initiates Options dialog.")]
  133. HRESULT LaunchOptionsUI();
  134. [id(202), helpstring("Initiates Add Contact dialog.")]
  135. HRESULT LaunchAddContactUI([in] BSTR bstrEMail);
  136. [id(210), helpstring("Initiates IM Window.")]
  137. HRESULT LaunchIMUI([in] VARIANT vUser);
  138. #else
  139. [id(200), local, helpstring("Initiates Logon dialog.")]
  140. HRESULT LaunchLogonUI();
  141. [call_as(LaunchLogonUI)]
  142. HRESULT RemoteLaunchLogonUI();
  143. [id(201), local, helpstring("Initiates Options dialog.")]
  144. HRESULT LaunchOptionsUI();
  145. [call_as(LaunchOptionsUI)]
  146. HRESULT RemoteLaunchOptionsUI();
  147. [id(202), local, helpstring("Initiates Add Contact dialog.")]
  148. HRESULT LaunchAddContactUI([in] BSTR bstrEMail);
  149. [call_as(LaunchAddContactUI)]
  150. HRESULT RemoteLaunchAddContactUI([in] BSTR bstrEMail);
  151. [id(210), local, helpstring("Initiates IM Window.")]
  152. HRESULT LaunchIMUI([in] VARIANT vUser);
  153. [call_as(LaunchIMUI)]
  154. HRESULT RemoteLaunchIMUI([in] VARIANT vUser, [out] long *phwnd);
  155. #endif
  156. [id(501), helpstring("Establishes a connection between the IBasicIM object and the client's sink")]
  157. HRESULT AdviseOE([in] IUnknown *pUnk, //Pointer to the client's DMsgrObjectOEEvents sink
  158. [out, retval] long *plCookie); //Pointer to the connection point identifier used
  159. // by Unadvise
  160. [id(502), helpstring("Terminates a connection between the IBasicIM object and the client's sink")]
  161. HRESULT UnadviseOE([in] long lCookie); //Connection token
  162. }
  163. //--------------------------------------------------------------------------
  164. // IBasicIM Interface
  165. [
  166. uuid(936B70F8-75A1-455d-8F37-E211302D3B69), // IID_IBasicIM
  167. helpstring("Messenger Basic IM Object Interface"),
  168. hidden,
  169. oleautomation
  170. ]
  171. interface IBasicIM : IBasicIMOld
  172. {
  173. #ifdef __MKTYPLIB__
  174. [id(503), helpstring("Initiates the messenger phone dialer UI.")]
  175. HRESULT LaunchPhoneUI([in] BSTR bstrNumber);
  176. #else
  177. [local]
  178. HRESULT LaunchPhoneUI([in] BSTR bstrNumber);
  179. [call_as(LaunchPhoneUI)]
  180. HRESULT RemoteLaunchPhoneUI([in] BSTR bstrNumber, [out] long *phwnd);
  181. #endif
  182. }
  183. //--------------------------------------------------------------------------
  184. // DBasicIMEvents Interface
  185. [
  186. uuid(59EC0341-7506-11d2-B05F-00C04F7F89FE), // DIID_DBasicIMEvents
  187. helpstring("Messenger Events for OE Private Interface"),
  188. hidden
  189. ]
  190. dispinterface DBasicIMEvents
  191. {
  192. properties:
  193. methods:
  194. [id(DISPID_ONLOGONRESULT), helpstring("Logon attempt complete.")]
  195. void OnLogonResult([in] long hr);
  196. [id(DISPID_ONLOGOFF), helpstring("Logoff complete.")]
  197. void OnLogoff();
  198. [id(DISPID_ONLISTADDRESULT), helpstring("Result from list add request.")]
  199. void OnContactListAddResult([in] long hr,
  200. [in] IBasicIMUser* pBIMUser);
  201. [id(DISPID_ONLISTREMOVERESULT), helpstring("Result from list remove request.")]
  202. void OnContactListRemoveResult([in] long hr,
  203. [in] IBasicIMUser* pBIMUser);
  204. [id(DISPID_ONUSERFRIENDLYNAMECHANGERESULT), helpstring("Result from name change request.")]
  205. void OnUserFriendlyNameChangeResult([in] long hr,
  206. [in] IBasicIMUser* pBIMUser,
  207. [in] BSTR bstrPrevFriendlyName);
  208. [id(DISPID_ONUSERSTATECHANGED), helpstring("User state changed.")]
  209. void OnUserStateChanged([in] IBasicIMUser* pBIMUser,
  210. [in] BIMSTATE mPrevStateOE);
  211. [id(DISPID_ONLOCALSTATECHANGERESULT), helpstring("Result from local state request.")]
  212. void OnLocalStateChangeResult([in] long hr,
  213. [in] BIMSTATE mLocalStateOE);
  214. [id(DISPID_ONAPPSHUTDOWN), helpstring("Messenger is shutting down."), helpcontext(0x0000)]
  215. void OnAppShutdown();
  216. }
  217. //--------------------------------------------------------------------------
  218. // IBasicIMUser Interface
  219. [
  220. uuid(59EC0342-7506-11d2-B05F-00C04F7F89FE), // IID_IBasicIMUser
  221. helpstring("Messenger User for OE Private Interface"),
  222. hidden,
  223. oleautomation
  224. ]
  225. interface IBasicIMUser : IUnknown
  226. {
  227. [propget]
  228. HRESULT FriendlyName([out, retval] BSTR* pbstrFriendlyName);
  229. [propget, helpstring("State of the user.")]
  230. HRESULT State([out, retval] BIMSTATE* pbimState);
  231. [propget, helpstring("Logon Name of the user.")]
  232. HRESULT LogonName([out, retval] BSTR* pbstrLogonName);
  233. }
  234. //--------------------------------------------------------------------------
  235. // IBasicIMUser2 Interface
  236. [
  237. uuid(306C16F6-ECB9-4d60-9E48-84A01A25604F), // IID_IBasicIMUser2
  238. helpstring("Messenger User for IBasicIM Interface"),
  239. hidden,
  240. oleautomation
  241. ]
  242. interface IBasicIMUser2 : IBasicIMUser
  243. {
  244. [propget]
  245. HRESULT Property(
  246. [in] BIMUSERPROPERTY ePropType,
  247. [out, retval] VARIANT *pvPropVal);
  248. }
  249. //--------------------------------------------------------------------------
  250. // IBasicIMUsers Interface
  251. [
  252. uuid(59EC0343-7506-11d2-B05F-00C04F7F89FE), // IID_IBasicIMUsers
  253. helpstring("Messenger Users Collection for IBasicIM"),
  254. hidden,
  255. oleautomation
  256. ]
  257. interface IBasicIMUsers : IUnknown
  258. {
  259. [propget, helpstring("Number of users.")]
  260. HRESULT Count([out, retval] long* pcUsers);
  261. [id(DISPID_VALUE), helpstring("Retrieves a specific user by index.")]
  262. HRESULT Item([in] long Index,
  263. [out, retval] IBasicIMUser** ppBIMUser);
  264. [id(100), helpstring("Adds a user object to the collection.")]
  265. HRESULT Add([in] IBasicIMUser* pBIMUser);
  266. [id(101), helpstring("Removes a user object from the collection.")]
  267. HRESULT Remove([in] IBasicIMUser* pBIMUser);
  268. [propget, restricted, id(DISPID_NEWENUM), helpstring("Enumerates the users.")]
  269. HRESULT _NewEnum([out, retval] IUnknown **ppUnknown);
  270. }
  271. #ifndef __MKTYPLIB__
  272. //--------------------------------------------------------------------------
  273. // Type Library
  274. [
  275. uuid(566ACF67-6124-4812-9362-E6D0C431D6F5), // LIBID_BasicIM
  276. version(1.0),
  277. helpstring("Messenger Basic IM Type Library")
  278. ]
  279. library BasicIM
  280. {
  281. #endif __MKTYPLIB__
  282. //--------------------------------------------------------------------------
  283. // Messenger BasicIM object class definition
  284. [
  285. uuid(E0B8F398-BB08-4298-87F0-34502693902E), // CLSID_BasicIMObject
  286. helpstring("Messenger Basic IM Object")
  287. ]
  288. coclass BasicIMObject
  289. {
  290. [default] interface IBasicIM;
  291. [source] dispinterface DBasicIMEvents;
  292. };
  293. };