iapplet.idl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. //+---------------------------------------------------------------------------
  2. //
  3. // Contents: NetMeeting Applet interfaces
  4. //
  5. // Copyright 1999-2002 Microsoft Corporation. All Rights Reserved.
  6. //
  7. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  8. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  9. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  10. // PARTICULAR PURPOSE.
  11. //----------------------------------------------------------------------------
  12. import "oaidl.idl";
  13. import "ocidl.idl";
  14. #define UUID_IAppletSession e65dc590-a4d9-11d2-b724-00104bc51339
  15. #define UUID_IAppletSessionNotify f7c10ec0-a4d9-11d2-b724-00104bc51339
  16. #define UUID_IApplet 07970b30-a4da-11d2-b724-00104bc51339
  17. #define UUID_IAppletNotify 16153670-a4da-11d2-b724-00104bc51339
  18. #include "nmapptyp.h"
  19. /* ------ octet string ------ */
  20. typedef struct tagAppletOctetString
  21. {
  22. ULONG cbStrSize;
  23. [size_is(cbStrSize)] BYTE* pbValue;
  24. }
  25. AppletOctetString;
  26. typedef struct tagAppletLongString
  27. {
  28. ULONG nStrLen;
  29. [size_is(nStrLen)] ULONG *pnValue;
  30. }
  31. AppletLongString;
  32. /* ------ object, session, and registry keys ------ */
  33. typedef struct tagAppletObjectKey
  34. {
  35. AppletKeyType eType;
  36. AppletLongString lstrObjectID;
  37. AppletOctetString ostrH221NonStdID;
  38. }
  39. AppletObjectKey;
  40. typedef struct tagAppletSessionKey
  41. {
  42. AppletObjectKey AppletProtocolKey;
  43. AppletSessionID nSessionID;
  44. }
  45. AppletSessionKey;
  46. typedef struct tagAppletRegistryKey
  47. {
  48. AppletSessionKey SessionKey;
  49. AppletOctetString ostrResourceID;
  50. }
  51. AppletRegistryKey;
  52. /* ------ registry request ------ */
  53. typedef struct tagAppletRegistryRequest
  54. {
  55. AppletRegistryCommand eCommand;
  56. AppletRegistryKey RegistryKey;
  57. // register channel
  58. AppletChannelID nChannelID;
  59. // set parameter
  60. AppletOctetString ostrParamValue;
  61. AppletModificationRights eParamModifyRights;
  62. // allocate handle
  63. ULONG cHandles;
  64. }
  65. AppletRegistryRequest;
  66. /* ------ channel request ------ */
  67. typedef struct tagAppletChannelRequest
  68. {
  69. AppletChannelCommand eCommand;
  70. AppletChannelID nChannelID;
  71. ULONG cUsers;
  72. [size_is(cUsers)] AppletUserID *aUsers;
  73. }
  74. AppletChannelRequest;
  75. /* ------ token request ------ */
  76. typedef struct tagAppletTokenRequest
  77. {
  78. AppletTokenCommand eCommand;
  79. AppletTokenID nTokenID;
  80. AppletUserID uidGiveTo;
  81. HRESULT hrGiveResponse;
  82. }
  83. AppletTokenRequest;
  84. /* ------ capability ------ */
  85. typedef struct tagAppletCapabilityID
  86. {
  87. AppletCapIDType eType;
  88. AppletObjectKey nNonStdCap;
  89. ULONG nStdCap;
  90. }
  91. AppletCapabilityID;
  92. typedef struct tagAppletCapability
  93. {
  94. AppletCapabilityID CapID;
  95. AppletCapabilityClass CapClass;
  96. ULONG cEntities;
  97. }
  98. AppletCapability;
  99. typedef struct tagAppletCapability2
  100. {
  101. AppletCapabilityID CapID;
  102. AppletOctetString *pCapData;
  103. }
  104. AppletCapability2;
  105. typedef struct tagAppletProtocolEntity
  106. {
  107. AppletSessionKey SessionKey;
  108. AppletChannelType eStartupChannelType;
  109. BOOL fMustBeInvoked;
  110. ULONG cExpectedCapabilities;
  111. [size_is(cExpectedCapabilities)] AppletCapability **apExpectedCapabilities;
  112. }
  113. AppletProtocolEntity;
  114. //
  115. // T120 Applet Session Callback
  116. //
  117. typedef struct tagAppletRecord
  118. {
  119. AppletNodeID nNodeID;
  120. AppletEntityID nEntityID;
  121. BOOL fEnrolledActively;
  122. BOOL fConductingCapable;
  123. AppletChannelType eStartupChannelType;
  124. AppletUserID nAppletUserID;
  125. ULONG cCapabilities;
  126. [size_is(cCapabilities)] AppletCapability2 **apCapabilities;
  127. }
  128. AppletRecord;
  129. typedef struct tagAppletRoster
  130. {
  131. AppletSessionKey SessionKey;
  132. BOOL fRosterChanged;
  133. ULONG nInstanceNumber;
  134. BOOL fNodesAdded;
  135. BOOL fNodesRemoved;
  136. BOOL fCapabilitiesChanged;
  137. ULONG cRecords;
  138. [size_is(cRecords)] AppletRecord **apAppletRecords;
  139. ULONG cCapabilities;
  140. [size_is(cCapabilities)] AppletCapability **apCapabilities;
  141. }
  142. AppletRoster;
  143. typedef struct tagAppletRegistryItem
  144. {
  145. AppletRegistryItemType ItemType;
  146. // channel
  147. AppletChannelID nChannelID;
  148. // token
  149. AppletTokenID nTokenID;
  150. // parameter
  151. AppletOctetString ostrParamValue;
  152. }
  153. AppletRegistryItem;
  154. typedef struct tagAppletRegistryEntryOwner
  155. {
  156. BOOL fEntryOwned;
  157. AppletNodeID nOwnerNodeID;
  158. AppletEntityID nOwnerEntityID;
  159. }
  160. AppletRegistryEntryOwner;
  161. typedef struct tagAppletSessionRequest
  162. {
  163. // session specific
  164. AppletSessionKey SessionKey;
  165. // applet enroll
  166. AppletChannelType nStartupChannelType;
  167. // collapsed capability
  168. ULONG cCollapsedCaps;
  169. [size_is(cCollapsedCaps)] AppletCapability **apCollapsedCaps;
  170. // non-collapsing capability
  171. ULONG cNonCollapsedCaps;
  172. [size_is(cNonCollapsedCaps)] AppletCapability2 **apNonCollapsedCaps;
  173. // static channels
  174. ULONG cStaticChannels;
  175. [size_is(cStaticChannels)] AppletChannelID *aStaticChannels;
  176. // dynamic channels
  177. ULONG cDynamicChannels;
  178. [size_is(cDynamicChannels)] AppletRegistryKey *aChannelRegistryKeys;
  179. }
  180. AppletSessionRequest;
  181. [
  182. object,
  183. uuid(UUID_IAppletSessionNotify),
  184. pointer_default(unique)
  185. ]
  186. interface IAppletSessionNotify : IUnknown
  187. {
  188. HRESULT JoinSessionConfirm(
  189. [in] HRESULT hrResult,
  190. [in] AppletUserID uidMyself,
  191. [in] AppletNodeID nidMyself,
  192. [in] AppletSessionID sidMyself,
  193. [in] AppletEntityID eidMyself,
  194. [in] ULONG cDynamicChannels,
  195. [in,size_is(cDynamicChannels)] AppletChannelID aDynamicChannels[]);
  196. HRESULT LeaveSessionIndication(
  197. [in] AppletReason eReason,
  198. [in] AppletUserID uidLeave);
  199. HRESULT SendDataIndication(
  200. [in] BOOL fUniformSend,
  201. [in] AppletUserID uidInitiator,
  202. [in] AppletChannelID nChannelID,
  203. [in] AppletPriority eDataPriority,
  204. [in] AppletOctetString Data);
  205. HRESULT RosterReportIndication(
  206. [in] ULONG cRosters,
  207. [in,size_is(cRosters)] AppletRoster **apAppRosters);
  208. HRESULT InquireRosterConfirm(
  209. [in] HRESULT hrResult,
  210. [in] ULONG cRosters,
  211. [in,size_is(cRosters)] AppletRoster **apAppRosters);
  212. HRESULT InvokeAppletConfirm(
  213. [in] AppletRequestTag nReqTag,
  214. [in] HRESULT hrResult);
  215. HRESULT RegistryConfirm(
  216. [in] AppletRegistryCommand eCommand,
  217. [in] HRESULT hrResult,
  218. [in] AppletRegistryKey *pRegistryKey,
  219. [in] AppletRegistryItem *pRegistryItem,
  220. [in] AppletRegistryEntryOwner *pEntryOwner,
  221. [in] AppletModificationRights eRights);
  222. HRESULT AllocateHandleConfirm(
  223. [in] HRESULT hrResult,
  224. [in] ULONG nFirstHandle,
  225. [in] ULONG cHandles);
  226. HRESULT ChannelConfirm(
  227. [in] AppletChannelCommand eCommand,
  228. [in] HRESULT hrResult,
  229. [in] AppletChannelID nChannelID);
  230. HRESULT ChannelIndication(
  231. [in] AppletChannelCommand eCommand,
  232. [in] AppletChannelID nChannelID,
  233. [in] AppletReason eReason,
  234. [in] AppletUserID uidManager);
  235. HRESULT TokenConfirm(
  236. [in] AppletTokenCommand eCommand,
  237. [in] HRESULT hrResult,
  238. [in] AppletTokenID nTokenID);
  239. HRESULT TestTokenConfirm(
  240. [in] AppletTokenID nTokenID,
  241. [in] AppletTokenStatus eStatus);
  242. HRESULT TokenIndication(
  243. [in] AppletTokenCommand eCommand,
  244. [in] AppletReason eReason,
  245. [in] AppletTokenID nTokenID,
  246. [in] AppletUserID uidInitiator);
  247. };
  248. [
  249. object,
  250. uuid(UUID_IAppletSession),
  251. pointer_default(unique)
  252. ]
  253. interface IAppletSession : IUnknown
  254. {
  255. /* ------ Basic Info ------ */
  256. HRESULT GetConfID([out] AppletConfID *pnConfID);
  257. HRESULT IsThisNodeTopProvider([out] BOOL *pfTopProvider);
  258. /* ------ Join Conference ------ */
  259. HRESULT Join([in] AppletSessionRequest *pRequest);
  260. HRESULT Leave(void);
  261. /* ------ Send Data ------ */
  262. HRESULT SendData(
  263. [in] BOOL fUniformSend,
  264. [in] AppletChannelID nChannelID,
  265. [in] AppletPriority ePriority,
  266. [in] ULONG cbBufSize,
  267. [in,size_is(cbBufSize)] BYTE *pBuffer);
  268. /* ------ Invoke Applet ------ */
  269. HRESULT InvokeApplet(
  270. [out] AppletRequestTag *pnReqTag,
  271. [in] AppletProtocolEntity *pAPE,
  272. [in] ULONG cNodes,
  273. [in,size_is(cNodes)] AppletNodeID aNodeIDs[]);
  274. /* ------ Inquiry ------ */
  275. HRESULT InquireRoster([in] AppletSessionKey *pSessionKey);
  276. /* ------ Registry Services ------ */
  277. HRESULT RegistryRequest([in] AppletRegistryRequest *pRequest);
  278. /* ------ Channel Services ------ */
  279. HRESULT ChannelRequest([in] AppletChannelRequest *pRequest);
  280. /* ------ Token Services ------ */
  281. HRESULT TokenRequest([in] AppletTokenRequest *pRequest);
  282. /* ------ Notification registration / unregistration------ */
  283. HRESULT Advise( [in] IAppletSessionNotify *pNotify,
  284. [out] DWORD *pdwCookie);
  285. HRESULT UnAdvise([in] DWORD dwCookie);
  286. };
  287. [
  288. object,
  289. uuid(UUID_IAppletNotify),
  290. pointer_default(unique)
  291. ]
  292. interface IAppletNotify : IUnknown
  293. {
  294. HRESULT PermitToJoinSessionIndication(
  295. [in] AppletConfID nConfID,
  296. [in] BOOL fPermissionGranted);
  297. HRESULT AutoJoinSessionIndication(
  298. [in] IAppletSession *pSession,
  299. [in] HRESULT hrResult,
  300. [in] AppletUserID uidMyself,
  301. [in] AppletNodeID nidMyself,
  302. [in] AppletSessionID sidMyself,
  303. [in] AppletEntityID eidMyself,
  304. [in] ULONG cDynamicChannels,
  305. [in,size_is(cDynamicChannels)] AppletChannelID aDynamicChannels[]);
  306. };
  307. [
  308. object,
  309. uuid(UUID_IApplet),
  310. pointer_default(unique)
  311. ]
  312. interface IApplet : IUnknown
  313. {
  314. /* ------ Initialization ------ */
  315. HRESULT Initialize(void);
  316. /* ------ Auto Join ------ */
  317. HRESULT RegisterAutoJoin([in] AppletSessionRequest *pRequest);
  318. HRESULT UnregisterAutoJoin(void);
  319. /* ------ Session ------ */
  320. HRESULT CreateSession(
  321. [out] IAppletSession **ppSession,
  322. [in] AppletConfID nConfID);
  323. /* ------ Notification registration / unregistration------ */
  324. HRESULT Advise( [in] IAppletNotify *pNotify,
  325. [out] DWORD *pdwCookie);
  326. HRESULT UnAdvise([in] DWORD dwCookie);
  327. };
  328. // These version numbers should match the version attribute in the library definitoen below
  329. cpp_quote("enum { NmApplet_Ver_Major = 1};")
  330. cpp_quote("enum { NmApplet_Ver_Minor = 0};")
  331. [
  332. uuid(8C3ADF96-CCFE-11d2-AD10-00C04F72DD47),
  333. version(1.0),
  334. helpstring("NmApplet 1.0 Type Library")
  335. ]
  336. library NmApplet
  337. {
  338. importlib("stdole32.tlb");
  339. importlib("stdole2.tlb");
  340. [
  341. uuid(8C3ADF99-CCFE-11d2-AD10-00C04F72DD47),
  342. helpstring("NetMeeting Applet")
  343. ]
  344. coclass NmApplet
  345. {
  346. [default] interface IApplet;
  347. };
  348. };