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.

904 lines
33 KiB

  1. cpp_quote("//=--------------------------------------------------------------------------=")
  2. cpp_quote("// MSNotify.h")
  3. cpp_quote("//=--------------------------------------------------------------------------=")
  4. cpp_quote("// (C) Copyright 1995-1998 Microsoft Corporation. All Rights Reserved.")
  5. cpp_quote("//")
  6. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  7. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  8. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  9. cpp_quote("// PARTICULAR PURPOSE.")
  10. cpp_quote("//=--------------------------------------------------------------------------=")
  11. cpp_quote("")
  12. import "objidl.idl";
  13. import "oleidl.idl";
  14. import "ocidl.idl";
  15. import "mstask.idl";
  16. interface INotification;
  17. interface INotificationMgr;
  18. interface INotificationSink;
  19. interface IEnumScheduleGroup;
  20. interface IEnumNotification;
  21. interface IScheduleGroup;
  22. interface INotificationReport;
  23. typedef [unique] INotification *LPNOTIFICATION;
  24. typedef [unique] INotificationMgr *LPNOTIFICATIONMGR;
  25. typedef [unique] INotificationSink *LPNOTIFICATIONSINK;
  26. typedef [unique] IEnumNotification *LPENUMNOTIFICATION;
  27. typedef [unique] IEnumScheduleGroup *LPENUMSCHEDULEGROUP;
  28. typedef [unique] IScheduleGroup *LPSCHEDULEGROUP;
  29. typedef [unique] INotificationReport *LPNOTIFICATIONREPORT;
  30. typedef REFGUID REFNOTIFICATIONTYPE;
  31. typedef GUID NOTIFICATIONTYPE, *PNOTIFICATIONTYPE;
  32. // NOTIFICATIONCOOKIE:
  33. // The notification cookie is a GUID which is used to identify
  34. // a notification uniquely during the lifetime of a notification.
  35. // A notification can be persisted.
  36. typedef GUID NOTIFICATIONCOOKIE, *PNOTIFICATIONCOOKIE;
  37. typedef struct _tagTASKDATA
  38. {
  39. ULONG cbSize;
  40. DWORD dwReserved;
  41. DWORD dwTaskFlags;
  42. DWORD dwPriority;
  43. DWORD dwDuration;
  44. DWORD nParallelTasks;
  45. // ...
  46. } TASK_DATA, *PTASK_DATA;
  47. cpp_quote("")
  48. cpp_quote("////////////////////////////////////////////////////////////////////////////")
  49. cpp_quote("// Broadcast Destinations ")
  50. cpp_quote("EXTERN_C const CLSID CLSID_GLOBAL_BROADCAST ;")
  51. cpp_quote("EXTERN_C const CLSID CLSID_PROCESS_BROADCAST ;")
  52. cpp_quote("EXTERN_C const CLSID CLSID_THREAD_BROADCAST ;")
  53. cpp_quote("")
  54. cpp_quote("EXTERN_C const GUID CLSID_StdNotificationMgr ;")
  55. cpp_quote("")
  56. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_NULL ;")
  57. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_ANOUNCMENT ;")
  58. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASK ;")
  59. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_ALERT ;")
  60. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_INET_IDLE ;")
  61. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_INET_OFFLINE ;")
  62. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_INET_ONLINE ;")
  63. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_SUSPEND ;")
  64. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_RESUME ;")
  65. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_ABORT ;")
  66. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_COMPLETED ;")
  67. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_PROGRESS ;")
  68. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_AGENT_INIT ;")
  69. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_AGENT_START ;")
  70. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_BEGIN_REPORT ;")
  71. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_END_REPORT ;")
  72. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_CONNECT_TO_INTERNET;")
  73. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_DISCONNECT_FROM_INTERNET;")
  74. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_CONFIG_CHANGED ;")
  75. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_PROGRESS_REPORT ;")
  76. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_USER_IDLE_BEGIN ;")
  77. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_USER_IDLE_END ;")
  78. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_STARTED ;")
  79. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_TASKS_ERROR ;")
  80. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_d ;")
  81. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_e ;")
  82. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_f ;")
  83. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_11 ;")
  84. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_12 ;")
  85. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_13 ;")
  86. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_14 ;")
  87. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_ITEM_START ;")
  88. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_ITEM_RESTART ;")
  89. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_ITEM_DONE ;")
  90. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_GROUP_START ;")
  91. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_GROUP_RESTART ;")
  92. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_GROUP_DONE ;")
  93. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_0 ;")
  94. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_1 ;")
  95. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_2 ;")
  96. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_3 ;")
  97. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_4 ;")
  98. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_5 ;")
  99. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_6 ;")
  100. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_7 ;")
  101. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_8 ;")
  102. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_9 ;")
  103. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_A ;")
  104. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_B ;")
  105. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_C ;")
  106. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_D ;")
  107. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_E ;")
  108. cpp_quote("EXTERN_C const GUID NOTIFICATIONTYPE_START_F ;")
  109. cpp_quote("#define NOTIFICATIONTYPE_ALL NOTIFICATIONTYPE_NULL ")
  110. cpp_quote("EXTERN_C const GUID NOTFCOOKIE_SCHEDULE_GROUP_DAILY ;")
  111. cpp_quote("EXTERN_C const GUID NOTFCOOKIE_SCHEDULE_GROUP_WEEKLY ;")
  112. cpp_quote("EXTERN_C const GUID NOTFCOOKIE_SCHEDULE_GROUP_MONTHLY ;")
  113. cpp_quote("EXTERN_C const GUID NOTFCOOKIE_SCHEDULE_GROUP_MANUAL ;")
  114. cpp_quote("#ifndef _LPENUMPROPERTYMAP_DEFINED")
  115. cpp_quote("#define _LPENUMPROPERTYMAP_DEFINED")
  116. [
  117. local,
  118. object,
  119. uuid(c733e4a1-576e-11d0-b28c-00c04fd7cd22),
  120. pointer_default(unique)
  121. ]
  122. interface IEnumPropertyMap : IUnknown
  123. {
  124. typedef [unique] IEnumPropertyMap *LPENUMPROPERTYMAP;
  125. typedef struct _tagSTATPROPMAP
  126. {
  127. // extent this to use a variant
  128. LPOLESTR pstrName; // name
  129. DWORD dwFlags; // null for now
  130. VARIANT variantValue; // the variant value
  131. } STATPROPMAP, *LPSTATPROPMAP;
  132. [local]
  133. HRESULT Next(
  134. [in] ULONG celt,
  135. [out, size_is(celt), length_is(*pceltFetched)]
  136. STATPROPMAP *rgelt,
  137. [out] ULONG *pceltFetched);
  138. [call_as(Next)]
  139. HRESULT RemoteNext(
  140. [in] ULONG celt,
  141. [out, size_is(celt), length_is(*pceltFetched)]
  142. STATPROPMAP *rgelt,
  143. [out] ULONG *pceltFetched);
  144. HRESULT Skip(
  145. [in] ULONG celt);
  146. HRESULT Reset();
  147. HRESULT Clone(
  148. [out] IEnumPropertyMap **ppenum);
  149. }
  150. cpp_quote("#endif")
  151. cpp_quote("#ifndef _LPPROPERTYMAP")
  152. cpp_quote("#define _LPPROPERTYMAP")
  153. [
  154. local,
  155. object,
  156. uuid(c733e4a2-576e-11d0-b28c-00c04fd7cd22),
  157. pointer_default(unique)
  158. ]
  159. interface IPropertyMap : IUnknown
  160. {
  161. typedef [unique] IPropertyMap *LPPROPERTYMAP;
  162. HRESULT Write(
  163. [in] LPCWSTR pstrName, // name
  164. [in] VARIANT variantValue, // the variant value
  165. [in] DWORD dwFlags // null for now
  166. );
  167. HRESULT Read(
  168. [in] LPCWSTR pstrName, // name
  169. [out] VARIANT *pVariantValue // the variant value
  170. );
  171. HRESULT GetCount(
  172. [out] ULONG *pCount
  173. );
  174. HRESULT GetEnumMAP(
  175. [out] LPENUMPROPERTYMAP *ppEnumMap
  176. );
  177. }
  178. cpp_quote("#endif")
  179. //+---------------------------------------------------------------------------
  180. //
  181. // Copyright (C) Microsoft Corporation, 1995-1998.
  182. //
  183. // Contents: The notification description and INotification interface definition
  184. //
  185. // Description:
  186. //
  187. // Each notification (INotification) has an idendifier (ITEMID) which is a guid and
  188. // itentifies the notification type
  189. //
  190. // An notification is an object which can be send to a distination object via
  191. // a particular interface. The delivery mechanism can be a
  192. // scheduler or an advisor.
  193. //
  194. // The sources of an notification can be any any object or module.
  195. //
  196. // An notification can scheduled and delivered to the destination(s) according
  197. // the trigger time.
  198. //
  199. // An notification might be as simple as an alert or notification. It can
  200. // be a full object form the cache or the docfile. It can be an
  201. // announcment and data might not be available yet.
  202. //
  203. // Many notifications will in fact arrive with all data.
  204. //
  205. // The same object will expose I(Async)Moniker and the client
  206. // can call BindToXXX to bind to the object of the data.
  207. //
  208. //----------------------------------------------------------------------------
  209. //+---------------------------------------------------------------------------
  210. //
  211. // Copyright (C) Microsoft Corporation, 1995-1998.
  212. //
  213. // Contents: IEnumNotification interface definition
  214. //
  215. // Description:
  216. //
  217. // Enumerator overn Notifications.
  218. //
  219. //----------------------------------------------------------------------------
  220. cpp_quote("#define NOTF_E_NOTIFICATION_NOT_DELIVERED _HRESULT_TYPEDEF_(0x800C0F00L) ")
  221. cpp_quote("#ifndef _LPNOTIFICATION")
  222. cpp_quote("#define _LPNOTIFICATION")
  223. [
  224. local,
  225. object,
  226. uuid(c733e4a3-576e-11d0-b28c-00c04fd7cd22),
  227. pointer_default(unique)
  228. ]
  229. interface INotification : IPropertyMap
  230. {
  231. //typedef [unique] INotification *LPNOTIFICATION;
  232. typedef enum _tagNOTFSINKMODE
  233. {
  234. // exclusive means deliver only
  235. // notification of the registered type
  236. // NM_Exclusive = 0x00000001
  237. // launch me if an notification of
  238. // registered types arrives
  239. //,NM_Instantiate = 0x00000002
  240. // the sink wants to get completion reports
  241. //,NM_CompletionReport = 0x00000004
  242. // register permanently
  243. //
  244. NM_PERMANENT = 0x00000008
  245. //
  246. // also accept directed notifications
  247. ,NM_ACCEPT_DIRECTED_NOTIFICATION = 0x00000010
  248. } _NOTFSINKMODE;
  249. typedef DWORD NOTFSINKMODE;
  250. //
  251. // information about the notification itself
  252. // passed on by the creator of the notification to the scheduler
  253. // and to the advisor
  254. typedef DWORD NOTIFICATIONFLAGS;
  255. //
  256. // the adivse mode indicates how the adivse should be done
  257. //
  258. typedef enum _tagDELIVERMODE
  259. {
  260. // **** FLAGS HOW IT SHOULD BE DELIVERED ***
  261. //
  262. // the normal mode is to deliver imedialty
  263. // and async (postmessage to enter thread
  264. // of destination
  265. // deliver with high priority
  266. // (thread entered with SendNotifyMessage
  267. DM_DELIVER_PREFERED = 0x00000001
  268. // deliver delayed
  269. ,DM_DELIVER_DELAYED = 0x00000002
  270. // always deliver the notification
  271. // even on was transmited just imedialty before
  272. ,DM_DELIVER_LAST_DELAYED = 0x00000004
  273. // the notification should be delivered
  274. // imedialty and synchronouse
  275. //,DM_SYNCHRONOUS = 0x00000010
  276. // deliver notification only if class is registered
  277. ,DM_ONLY_IF_RUNNING = 0x00000020
  278. // notification is send input sync - meaning the
  279. // notification is dispatched before the call returns
  280. //,DM_INPUT_SYNCHRONOUS = 0x00000040
  281. // the notification might be suspended
  282. //
  283. ,DM_THROTTLE_MODE = 0x00000080
  284. // **** FLAGS ABOUT PROGRESS FROM THE NOTIFICATIONMGR ***
  285. // the sender want a completion report (notification)
  286. ,DM_NEED_COMPLETIONREPORT = 0x00000100
  287. // the send wants progress report
  288. // which means should be called the notification arrives
  289. // at the destination or gets triggered
  290. ,DM_NEED_PROGRESSREPORT = 0x00000200
  291. // deliver the notification if there is
  292. // no update notification pending from
  293. // the sender or receiver
  294. //,DM_ONLY_IF_NOT_PENDING = 0x00001000
  295. //
  296. // deliver to the default thread in this process
  297. // if not registered
  298. ,DM_DELIVER_DEFAULT_THREAD = 0x00000400
  299. // deliver to the default process if
  300. // registered
  301. ,DM_DELIVER_DEFAULT_PROCESS = 0x00000800
  302. // **** GROUP FLAGS ***
  303. // member of group - the notifications
  304. // are delivered sequentiall - meaning
  305. // a completion report is send by each one
  306. //,DM_GROUP_SEQUENTIAL = 0x00001000
  307. // member of group - the notifications
  308. // are delivered at the same time - DEFAULT
  309. //,DM_GROUP_PARALLEL = 0x00000040
  310. } _DELIVERMODE;
  311. typedef DWORD DELIVERMODE;
  312. // get the notification flags
  313. HRESULT GetNotificationInfo(
  314. [out] PNOTIFICATIONTYPE pNotificationType,
  315. [out] PNOTIFICATIONCOOKIE pNotificationCookie,
  316. [out] NOTIFICATIONFLAGS *pNotificationFlags,
  317. [out] DELIVERMODE *pDeliverMode,
  318. [in] DWORD dwReserved
  319. );
  320. HRESULT Clone(
  321. //clones a notification with a new type; the cloned notification has a new cookie
  322. [in] REFNOTIFICATIONTYPE rNotificationType,
  323. // the new object just created
  324. [out] LPNOTIFICATION *ppNotification,
  325. [in] DWORD dwReserved
  326. );
  327. }
  328. cpp_quote("#endif")
  329. cpp_quote("#ifndef _LPNOTIFICATIONMGR_DEFINED")
  330. cpp_quote("#define _LPNOTIFICATIONMGR_DEFINED")
  331. [
  332. local,
  333. object,
  334. uuid(c733e4a4-576e-11d0-b28c-00c04fd7cd22),
  335. pointer_default(unique)
  336. ]
  337. interface INotificationMgr : IUnknown
  338. {
  339. //typedef [unique] INotificationMgr *LPNOTIFICATIONMGR;
  340. typedef enum _tagGROUPMODE
  341. {
  342. // member of group - the notifications
  343. // are delivered sequentiall - meaning
  344. // a completion report is send by each one
  345. GM_GROUP_SEQUENTIAL = 0x00000001
  346. } _GROUPMODE;
  347. typedef DWORD GROUPMODE;
  348. typedef enum _tagENUM_FLAGS
  349. {
  350. //
  351. // HOW TO USES THIS FLAGS
  352. //
  353. // these flags allow to specify which items
  354. // and what should be in the item when
  355. // enumerating notification items
  356. //
  357. // default is all items with notification
  358. // object
  359. //
  360. // no notification object is returned
  361. EF_NOT_NOTIFICATION = 0x00000001
  362. // not item of scheduled groups
  363. ,EF_NOT_SCHEDULEGROUPITEM = 0x00000002
  364. //
  365. //
  366. ,EF_NOTIFICATION_INPROGRESS = 0x00000004
  367. //
  368. // get items which are throttled
  369. //
  370. ,EF_NOTIFICATION_THROTTLED = 0x00000008
  371. //
  372. ,EF_NOTIFICATION_SUSPENDED = 0x00000010
  373. } _ENUM_FLAGS;
  374. typedef DWORD ENUM_FLAGS;
  375. typedef struct _tagNotificationItem
  376. {
  377. ULONG cbSize;
  378. // the notification itself
  379. LPNOTIFICATION pNotification;
  380. // the notification type
  381. NOTIFICATIONTYPE NotificationType;
  382. // flags which go with the notification
  383. NOTIFICATIONFLAGS NotificationFlags;
  384. // flags passed on deliver/schedule
  385. DELIVERMODE DeliverMode;
  386. // the cookie of the notification
  387. NOTIFICATIONCOOKIE NotificationCookie;
  388. // the task trigger
  389. TASK_TRIGGER TaskTrigger;
  390. // the task data
  391. TASK_DATA TaskData;
  392. // group cookie if part of a group
  393. NOTIFICATIONCOOKIE groupCookie;
  394. // clsid of sender
  395. CLSID clsidSender;
  396. // clsid of destination
  397. CLSID clsidDest;
  398. // last run date
  399. FILETIME dateLastRun;
  400. // the next run date
  401. FILETIME dateNextRun;
  402. // state of the notification
  403. DWORD dwNotificationState;
  404. } NOTIFICATIONITEM, *PNOTIFICATIONITEM;
  405. HRESULT RegisterNotificationSink(
  406. [in] LPNOTIFICATIONSINK pNotfctnSink, // can be null - see mode
  407. [in] LPCLSID pNotificationDest,
  408. [in] NOTFSINKMODE NotfctnSinkMode,
  409. [in] ULONG cNotifications,
  410. [in] PNOTIFICATIONTYPE pNotificationIDs,
  411. [out] PNOTIFICATIONCOOKIE pRegisterCookie,
  412. [in] DWORD dwReserved
  413. );
  414. HRESULT UnregisterNotificationSink(
  415. [in] PNOTIFICATIONCOOKIE pRegisterCookie
  416. );
  417. HRESULT CreateNotification(
  418. // the type of notification
  419. [in] REFNOTIFICATIONTYPE rNotificationType,
  420. // creation flags
  421. [in] NOTIFICATIONFLAGS NotificationFlags,
  422. // the pUnkOuter for aggregation
  423. [in] LPUNKNOWN pUnkOuter,
  424. // the new object just created
  425. [out] LPNOTIFICATION *ppNotification,
  426. [in] DWORD dwReserved
  427. );
  428. // find a scheduled notification
  429. HRESULT FindNotification(
  430. // the notification cookie
  431. [in] PNOTIFICATIONCOOKIE pNotificatioCookie,
  432. // the new object just created
  433. [out] PNOTIFICATIONITEM pNotificationItem,
  434. [in] DWORD grfEnumMode
  435. );
  436. // deliver a notification
  437. HRESULT DeliverNotification(
  438. // the notificationid and object
  439. [in] LPNOTIFICATION pNotification,
  440. // destination
  441. [in] REFCLSID rNotificationDest,
  442. // deliver mode - group and schedule data
  443. [in] DELIVERMODE deliverMode,
  444. // info about who the sender
  445. [in] LPNOTIFICATIONSINK pReportNotfctnSink, // can be null - see mode
  446. // the notification update interface
  447. [out] LPNOTIFICATIONREPORT *ppNotfctnReport,
  448. // task data for notification
  449. [in] PTASK_DATA pTaskData
  450. );
  451. // add notification to scheduler
  452. HRESULT ScheduleNotification(
  453. // the notificationid and object
  454. [in] LPNOTIFICATION pNotification,
  455. // destination
  456. [in] REFCLSID rNotificationDest,
  457. // deliver mode - group and schedule data
  458. [in] PTASK_TRIGGER pTaskTrigger,
  459. // flags which go with the TaskTrigger
  460. [in] PTASK_DATA pTaskData,
  461. // the mode how it should be delivered
  462. [in] DELIVERMODE deliverMode,
  463. // info about who the sender
  464. [in] LPCLSID pClsidSender, // class of sender can be NULL
  465. // sink to which updates from the receiver should arrive
  466. [in] LPNOTIFICATIONSINK pReportNotfctnSink, // can be null - see mode
  467. // the notification update object - only if completion report was requested
  468. [out] LPNOTIFICATIONREPORT *ppNotfctnReport,
  469. //the cookie of the new notification
  470. [out] PNOTIFICATIONCOOKIE pNotificationCookie,
  471. // reserved dword
  472. [in] DWORD dwReserved
  473. );
  474. // add notification to scheduler
  475. HRESULT UpdateNotification(
  476. //the cookie of the new notification
  477. [in] PNOTIFICATIONCOOKIE pNotificationCookie,
  478. // deliver mode - group and schedule data
  479. [in] PTASK_TRIGGER pTaskTrigger,
  480. // flags which go with the TaskTrigger
  481. [in] PTASK_DATA pTaskData,
  482. // the mode how it should be delivered
  483. [in] DELIVERMODE deliverMode,
  484. // reserved dword
  485. [in] DWORD dwReserved
  486. );
  487. HRESULT RevokeNotification(
  488. [in] PNOTIFICATIONCOOKIE pnotificationCookie,
  489. [out] PNOTIFICATIONITEM pNotificationItem,
  490. [in] DWORD grfEnumMode
  491. );
  492. HRESULT GetEnumNotification(
  493. [in] DWORD grfEnumFlags,
  494. [out] LPENUMNOTIFICATION *ppEnumNotification
  495. );
  496. // creates a new group
  497. HRESULT CreateScheduleGroup(
  498. // the group creation flags
  499. [in] DWORD grfGroupCreateFlags,
  500. // the new group
  501. [out] LPSCHEDULEGROUP *ppSchGroup,
  502. // the cookie of the group
  503. [out] PNOTIFICATIONCOOKIE pGroupCookie,
  504. [in] DWORD dwReserved
  505. );
  506. // finds an existing group
  507. HRESULT FindScheduleGroup(
  508. [in] PNOTIFICATIONCOOKIE pGroupCookie,
  509. [out] LPSCHEDULEGROUP *ppSchGroup,
  510. // the cookie of the group
  511. [in] DWORD dwReserved
  512. );
  513. // revokes an entire group from the scheduler
  514. HRESULT RevokeScheduleGroup(
  515. // cookie of group to be revoked
  516. [in] PNOTIFICATIONCOOKIE pGroupCookie,
  517. [out] LPSCHEDULEGROUP *ppSchGroup,
  518. [in] DWORD dwReserved
  519. );
  520. // an enumerator over the groups in the scheduler
  521. HRESULT GetEnumScheduleGroup(
  522. [in] DWORD grfEnumFlags,
  523. [out] LPENUMSCHEDULEGROUP *ppEnumScheduleGroup
  524. );
  525. HRESULT DeliverReport(
  526. // the notification object itself
  527. [in] LPNOTIFICATION pNotification,
  528. // the cookie of the object the notification is targeted too
  529. [in] PNOTIFICATIONCOOKIE pRunningNotfCookie,
  530. [in] DWORD dwReserved
  531. );
  532. }
  533. cpp_quote("#endif")
  534. cpp_quote("#ifndef _LPNOTIFICATIONSINK_DEFINED")
  535. cpp_quote("#define _LPNOTIFICATIONSINK_DEFINED")
  536. [
  537. local,
  538. object,
  539. uuid(c733e4a5-576e-11d0-b28c-00c04fd7cd22),
  540. pointer_default(unique)
  541. ]
  542. interface INotificationSink : IUnknown
  543. {
  544. //typedef [unique] INotificationSink *LPNOTIFICATIONSINK;
  545. HRESULT OnNotification(
  546. // the notification object itself
  547. [in] LPNOTIFICATION pNotification,
  548. // the report sink if - can be NULL
  549. [in] LPNOTIFICATIONREPORT pNotfctnReport,
  550. [in] DWORD dwReserved
  551. );
  552. }
  553. cpp_quote("#endif")
  554. cpp_quote("#ifndef _LPGROUPMGR_DEFINED")
  555. cpp_quote("#define _LPGROUPMGR_DEFINED")
  556. [
  557. local,
  558. object,
  559. uuid(c733e4a6-576e-11d0-b28c-00c04fd7cd22),
  560. pointer_default(unique)
  561. ]
  562. interface IScheduleGroup : IUnknown
  563. {
  564. //typedef [unique] IScheduleGroup *LPSCHEDULEGROUP;
  565. typedef struct _tagGroupInfo
  566. {
  567. ULONG cbSize;
  568. LPWSTR pwzGroupname;
  569. } GROUPINFO, *PGROUPINFO;
  570. // change the group attributes such as task trigger
  571. // name and mode - see mode for parallel and sequential
  572. HRESULT SetAttributes(
  573. // new task trigger
  574. [in] PTASK_TRIGGER pTaskTrigger,
  575. // the flags which go with the TaskTrigger
  576. [in] PTASK_DATA pTaskData,
  577. // new group cookie if sequential
  578. [in] PNOTIFICATIONCOOKIE pGroupCookie,
  579. // group data
  580. [in] PGROUPINFO pGroupInfo,
  581. // sequential or parallel
  582. [in] GROUPMODE grfGroupMode
  583. );
  584. HRESULT GetAttributes(
  585. // new task trigger
  586. [out] PTASK_TRIGGER pTaskTrigger,
  587. // the flags which go with the TaskTrigger
  588. [out] PTASK_DATA pTaskData,
  589. // new group cookie if sequential
  590. [out] PNOTIFICATIONCOOKIE pGroupCookie,
  591. //group data info
  592. [out] PGROUPINFO pGroupInfo,
  593. // sequential or parallel
  594. [out] GROUPMODE *pgrfGroupMode,
  595. // number of elements in group
  596. [out] LONG *pElements
  597. );
  598. // add notification to this group
  599. HRESULT AddNotification(
  600. // the notificationid and object
  601. [in] LPNOTIFICATION pNotification,
  602. // destination
  603. [in] REFCLSID rNotificationDest,
  604. // deliver mode - group and schedule data
  605. [in] DELIVERMODE deliverMode,
  606. // info about who the sender
  607. [in] LPCLSID pClsidSender, // class of sender can be NULL
  608. // sink to which updates from the receiver should arrive
  609. [in] LPNOTIFICATIONSINK pReportNotfctnSink, // can be null - see mode
  610. // the notification update object - only if completion report was requested
  611. [out] LPNOTIFICATIONREPORT *ppNotfctnReport,
  612. //the cookie of the new notification
  613. [out] PNOTIFICATIONCOOKIE pNotificationCookie,
  614. // task data for notification
  615. [in] PTASK_DATA pTaskData
  616. );
  617. // find a notification in the group
  618. HRESULT FindNotification(
  619. // the notification cookie
  620. [in] PNOTIFICATIONCOOKIE pNotificatioCookie,
  621. // the new object just created
  622. [out] PNOTIFICATIONITEM pNotificationItem,
  623. [in] DWORD dwReserved
  624. );
  625. // only for completness
  626. HRESULT RevokeNotification(
  627. [in] PNOTIFICATIONCOOKIE pnotificationCookie,
  628. [out] PNOTIFICATIONITEM pschedulNotification,
  629. [in] DWORD dwReserved
  630. );
  631. // an enumerator over the items in this group
  632. HRESULT GetEnumNotification(
  633. // flags which items to enumerate
  634. [in] DWORD grfFlags,
  635. [out] LPENUMNOTIFICATION *ppEnumNotification
  636. );
  637. }
  638. cpp_quote("#endif")
  639. cpp_quote("#ifndef _LPENUMSCHEDULEGROUP_DEFINED")
  640. cpp_quote("#define _LPENUMSCHEDULEGROUP_DEFINED")
  641. [
  642. local,
  643. object,
  644. uuid(c733e4a9-576e-11d0-b28c-00c04fd7cd22),
  645. pointer_default(unique)
  646. ]
  647. interface IEnumScheduleGroup : IUnknown
  648. {
  649. //typedef [unique] IEnumScheduleGroup *LPENUMSCHEDULEGROUP;
  650. [local]
  651. HRESULT Next(
  652. [in] ULONG celt,
  653. [out, size_is(celt), length_is(*pceltFetched)]
  654. LPSCHEDULEGROUP *rgelt,
  655. [out] ULONG *pceltFetched);
  656. [call_as(Next)]
  657. HRESULT RemoteNext(
  658. [in] ULONG celt,
  659. [out, size_is(celt), length_is(*pceltFetched)]
  660. LPSCHEDULEGROUP *rgelt,
  661. [out] ULONG *pceltFetched);
  662. HRESULT Skip(
  663. [in] ULONG celt);
  664. HRESULT Reset();
  665. HRESULT Clone(
  666. [out] IEnumScheduleGroup **ppenum);
  667. }
  668. cpp_quote("#endif")
  669. cpp_quote("#ifndef _LPENUMNOTIFICATION_DEFINED")
  670. cpp_quote("#define _LPENUMNOTIFICATION_DEFINED")
  671. [
  672. local,
  673. object,
  674. uuid(c733e4a8-576e-11d0-b28c-00c04fd7cd22),
  675. pointer_default(unique)
  676. ]
  677. interface IEnumNotification : IUnknown
  678. {
  679. //typedef [unique] IEnumNotification *LPENUMNOTIFICATION;
  680. [local]
  681. HRESULT Next(
  682. [in] ULONG celt,
  683. [out, size_is(celt), length_is(*pceltFetched)]
  684. NOTIFICATIONITEM *rgelt,
  685. [out] ULONG *pceltFetched);
  686. [call_as(Next)]
  687. HRESULT RemoteNext(
  688. [in] ULONG celt,
  689. [out, size_is(celt), length_is(*pceltFetched)]
  690. NOTIFICATIONITEM *rgelt,
  691. [out] ULONG *pceltFetched);
  692. HRESULT Skip(
  693. [in] ULONG celt);
  694. HRESULT Reset();
  695. HRESULT Clone(
  696. [out] IEnumNotification **ppenum);
  697. }
  698. cpp_quote("#endif")
  699. ///
  700. cpp_quote("#ifndef _LPNOTIFICATIONREPORT_DEFINED")
  701. cpp_quote("#define _LPNOTIFICATIONREPORT_DEFINED")
  702. [
  703. local,
  704. object,
  705. uuid(c733e4a7-576e-11d0-b28c-00c04fd7cd22),
  706. pointer_default(unique)
  707. ]
  708. interface INotificationReport : IUnknown
  709. {
  710. //typedef [unique] INotificationReport *LPNOTIFICATIONREPORT;
  711. HRESULT DeliverUpdate(
  712. // the reply notification object itself
  713. [in] LPNOTIFICATION pNotification,
  714. // not completion report allowed here
  715. [in] DELIVERMODE deliverMode,
  716. // the cookie of the object the notification is targeted too
  717. [in] DWORD dwReserved
  718. );
  719. // get the original notification this report objet belongs too
  720. HRESULT GetOriginalNotification(
  721. [out] LPNOTIFICATION *ppNotification
  722. );
  723. // get the status of the the notification in progress
  724. // such as pending notification etc.
  725. HRESULT GetNotificationStatus(
  726. // what kind of status
  727. [in] DWORD dwStatusIn,
  728. // flags if update notification is pending etc.
  729. [out] DWORD *pdwStatusOut,
  730. [in] DWORD dwReserved
  731. );
  732. }
  733. cpp_quote("#endif")
  734. ///
  735. cpp_quote("#ifndef _NOTIFICAITON_HELPER_APIS_")
  736. cpp_quote("#define _NOTIFICAITON_HELPER_APIS_")
  737. cpp_quote("// ")
  738. cpp_quote("// HELPER APIS ")
  739. cpp_quote("// ")
  740. cpp_quote("STDAPI NotfDeliverNotification(REFNOTIFICATIONTYPE rNotificationType ")
  741. cpp_quote(" ,REFCLSID rClsidDest ")
  742. cpp_quote(" ,DELIVERMODE deliverMode ")
  743. cpp_quote(" ,DWORD dwReserved ")
  744. cpp_quote(" ); ")
  745. cpp_quote(" ")
  746. cpp_quote(" ")
  747. cpp_quote("#endif")