Source code of Windows XP (NT5)
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.

445 lines
12 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: qmgr.idl
  6. //
  7. // Description:
  8. // Declares the QMgr COM interface
  9. //
  10. //=======================================================================
  11. #ifndef DO_NO_IMPORTS
  12. import "unknwn.idl";
  13. import "ocidl.idl";
  14. import "oleidl.idl";
  15. import "oaidl.idl";
  16. import "docobj.idl";
  17. #endif
  18. cpp_quote("// Background Copy QMgr Public Interface")
  19. //various events and flags
  20. /*************Notify flags**************/
  21. cpp_quote("#define QM_NOTIFY_FILE_DONE 0x00000001")
  22. cpp_quote("#define QM_NOTIFY_JOB_DONE 0x00000002")
  23. cpp_quote("#define QM_NOTIFY_GROUP_DONE 0x00000004")
  24. cpp_quote("#define QM_NOTIFY_DISABLE_NOTIFY 0x00000040")
  25. cpp_quote("#define QM_NOTIFY_USE_PROGRESSEX 0x00000080")
  26. /*************Status flags**************/
  27. cpp_quote("#define QM_STATUS_FILE_COMPLETE 0x00000001")
  28. cpp_quote("#define QM_STATUS_FILE_INCOMPLETE 0x00000002")
  29. cpp_quote("#define QM_STATUS_JOB_COMPLETE 0x00000004")
  30. cpp_quote("#define QM_STATUS_JOB_INCOMPLETE 0x00000008")
  31. cpp_quote("#define QM_STATUS_JOB_ERROR 0x00000010")
  32. cpp_quote("#define QM_STATUS_JOB_FOREGROUND 0x00000020")
  33. cpp_quote("#define QM_STATUS_GROUP_COMPLETE 0x00000040")
  34. cpp_quote("#define QM_STATUS_GROUP_INCOMPLETE 0x00000080")
  35. cpp_quote("#define QM_STATUS_GROUP_SUSPENDED 0x00000100")
  36. cpp_quote("#define QM_STATUS_GROUP_ERROR 0x00000200")
  37. cpp_quote("#define QM_STATUS_GROUP_FOREGROUND 0x00000400")
  38. /*************Protocol flags***************/
  39. cpp_quote("#define QM_PROTOCOL_HTTP 1")
  40. cpp_quote("#define QM_PROTOCOL_FTP 2")
  41. cpp_quote("#define QM_PROTOCOL_SMB 3")
  42. cpp_quote("#define QM_PROTOCOL_CUSTOM 4")
  43. /**************Progress Flags**************/
  44. cpp_quote("#define QM_PROGRESS_PERCENT_DONE 1")
  45. cpp_quote("#define QM_PROGRESS_TIME_DONE 2")
  46. cpp_quote("#define QM_PROGRESS_SIZE_DONE 3")
  47. /**************Error Codes****************/
  48. cpp_quote("#define QM_E_INVALID_STATE 0x81001001")
  49. cpp_quote("#define QM_E_SERVICE_UNAVAILABLE 0x81001002")
  50. cpp_quote("#define QM_E_DOWNLOADER_UNAVAILABLE 0x81001003")
  51. cpp_quote("#define QM_E_ITEM_NOT_FOUND 0x81001004")
  52. #if defined(TEST_TIMES)
  53. typedef struct _BACKGROUND_COPY_TIMES
  54. {
  55. FILETIME ftCreationTime;
  56. FILETIME ftModificationTime;
  57. FILETIME ftCompletionTime;
  58. } BACKGROUND_COPY_TIMES;
  59. #endif
  60. //
  61. // =============================
  62. // Marshalled interfaces
  63. // =============================
  64. // ==============================================
  65. // IJob Interface
  66. // The IJob interface is the management layer for a file (or set of files)
  67. // to be transferred.
  68. [
  69. uuid(59f5553c-2031-4629-bb18-2645a6970947),
  70. helpstring("IBackgroundCopyJob Interface"),
  71. odl
  72. ]
  73. interface IBackgroundCopyJob1 : IUnknown
  74. {
  75. typedef struct _FILESETINFO
  76. {
  77. BSTR bstrRemoteFile;
  78. BSTR bstrLocalFile;
  79. DWORD dwSizeHint;
  80. } FILESETINFO;
  81. HRESULT CancelJob();
  82. /*
  83. return Job2::Cancel();
  84. */
  85. HRESULT GetProgress([in] DWORD dwFlags, [out] DWORD *pdwProgress);
  86. /*
  87. flags == TIME_DONE:
  88. return E_NOTIMPL
  89. flags == SIZE_DONE:
  90. return BYTES_DOWNLOADED property
  91. flags == PERCENT_DONE:
  92. return 100 * (BYTES_DOWNLOADED property) / (BYTES_TOTAL property)
  93. */
  94. HRESULT GetStatus( [out] DWORD *pdwStatus,
  95. [out] DWORD *pdwWin32Result,
  96. [out] DWORD *pdwTransportResult,
  97. [out] DWORD *pdwNumOfRetries );
  98. /*
  99. dwStatus:
  100. if (foreground priority)
  101. set QM_STATUS_JOB_FOREGROUND
  102. get JOBPROP_STATUS_FLAGS
  103. if flags & QM_STATUS_COMPLETE
  104. set QM_JOB_STATUS_COMPLETE
  105. else
  106. set QM_JOB_STATUS_INCOMPLETE
  107. if flags & QM_STATUS_ERROR
  108. set QM_JOB_STATUS_ERROR
  109. dwWin32Result:
  110. return JOBPROP_LAST_LOCAL_STATUS
  111. dwTransportResult:
  112. return JOBPROP_LAST_TRANSPORT_STATUS
  113. dwNumOfRetries:
  114. return JOBPROP_RETRY_COUNT
  115. */
  116. HRESULT AddFiles([in] ULONG cFileCount, [in, size_is(cFileCount)] FILESETINFO **ppFileSet);
  117. /*
  118. return Job2::AddFiles( cFileCount, ppFileSet );
  119. */
  120. HRESULT GetFile([in] ULONG cFileIndex, [out] FILESETINFO *pFileInfo);
  121. /*
  122. allocate FILESETINFO struct
  123. Job2::GetFile( cFileIndex, &pInterface )
  124. fill in struct from interface calls
  125. */
  126. HRESULT GetFileCount([out] DWORD *pdwFileCount);
  127. /*
  128. return JOBPROP_FILES_TOTAL;
  129. */
  130. HRESULT SwitchToForeground();
  131. /*
  132. set JOBPROP_PRIORITY = PRIORITY_FOREGROUND
  133. */
  134. HRESULT get_JobID([out] GUID *pguidJobID); // used to a identify a job when enumerating jobs
  135. /*
  136. return JOBPROP_ID
  137. */
  138. #if defined(TEST_TIMES)
  139. HRESULT GetTimes( [out,ref] BACKGROUND_COPY_TIMES *pTimes );
  140. #endif
  141. }
  142. // ==============================================
  143. // IEnumJobs Interface
  144. // This interface allows enumerating the jobs under a Group
  145. [
  146. uuid(8baeba9d-8f1c-42c4-b82c-09ae79980d25),
  147. helpstring("IEnumBackgroundCopyJobs Interface"),
  148. odl
  149. ]
  150. interface IEnumBackgroundCopyJobs1 : IUnknown
  151. {
  152. /*
  153. constructor creates an EnumJobs2 interface
  154. */
  155. HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] GUID *rgelt, [out] ULONG *pceltFetched);
  156. /*
  157. IJob2 * Array[ celt ];
  158. pInterface->Next( celt, Array, *count );
  159. for (i=0; i < count; ++i)
  160. rgelt = Array[i]->JOBPROP_ID;
  161. */
  162. HRESULT Skip([in] ULONG celt);
  163. HRESULT Reset();
  164. HRESULT Clone([out] IEnumBackgroundCopyJobs1 **ppenum);
  165. HRESULT GetCount([out] ULONG *puCount);
  166. /*
  167. pass all four to pInterface
  168. */
  169. }
  170. // ==============================================
  171. // IGroup Interface
  172. // This interface is the base unit of management for a Job or Set of Jobs
  173. [
  174. uuid(1ded80a7-53ea-424f-8a04-17fea9adc4f5),
  175. helpstring("IBackgroundCopyGroup Interface"),
  176. odl
  177. ]
  178. interface IBackgroundCopyGroup : IUnknown
  179. {
  180. typedef enum GROUPPROP {
  181. GROUPPROP_PRIORITY = 0, // DWORD Priority Level for this Group
  182. GROUPPROP_REMOTEUSERID = 1, // User Credentials for Remote Server
  183. GROUPPROP_REMOTEUSERPWD = 2,
  184. GROUPPROP_LOCALUSERID = 3, // User Credentials for Local Machine, or flag for system credentials on NT,
  185. GROUPPROP_LOCALUSERPWD = 4,
  186. GROUPPROP_PROTOCOLFLAGS = 5, // specifies the protocol information about the server, HTTP, SSL, SMB, DAV
  187. GROUPPROP_NOTIFYFLAGS = 6, // Notification Type/Frequency Flags (per Job, per Group, progress and error notifications)
  188. GROUPPROP_NOTIFYCLSID = 7, // CLSID that implements the IBackgroundCallback interface for notifications, we'll create this to do callbacks
  189. GROUPPROP_PROGRESSSIZE = 8, // Turns on Progress Notifications for Size Values (e.g. notify every 4k, 8k, etc..)
  190. GROUPPROP_PROGRESSPERCENT = 9, // Turns on Progress Notifications for Percent Value (e.g. Notify every 10%, 5%, etc..)
  191. GROUPPROP_PROGRESSTIME = 10, // Turns on Progress Notifications for Time
  192. GROUPPROP_DISPLAYNAME = 11, // friendly display name of the group (something we can display in a future UI
  193. GROUPPROP_DESCRIPTION = 12
  194. } GROUPPROP;
  195. HRESULT GetProp([in] GROUPPROP propID, [out] VARIANT *pvarVal);
  196. [local] HRESULT SetProp([in] GROUPPROP propID, [in] VARIANT *pvarVal);
  197. [call_as(SetProp)] HRESULT InternalSetProp([in] GROUPPROP propID, [in] VARIANT *pvarVal);
  198. HRESULT GetProgress([in] DWORD dwFlags, [out] DWORD *pdwProgress);
  199. HRESULT GetStatus([out] DWORD *pdwStatus, [out] DWORD *pdwJobIndex);
  200. /*
  201. translate into Group2 properties
  202. */
  203. HRESULT GetJob([in] GUID jobID, [out] IBackgroundCopyJob1 **ppJob);
  204. HRESULT SuspendGroup();
  205. HRESULT ResumeGroup(); // New groups are by default suspended, when all jobs are initialized call resumegroup to enable the group
  206. HRESULT CancelGroup();
  207. HRESULT get_Size([out] DWORD *pdwSize); // gets the calculated size of the jobs in this group
  208. HRESULT get_GroupID([out] GUID *pguidGroupID); // used to identify a group when enumerating groups
  209. /*
  210. pass to Group2 interface
  211. */
  212. HRESULT CreateJob([in] GUID guidJobID, [out] IBackgroundCopyJob1 **ppJob);
  213. /*
  214. create a Job2 and a wrapper Job
  215. */
  216. HRESULT EnumJobs([in] DWORD dwFlags, [out] IEnumBackgroundCopyJobs1 **ppEnumJobs);
  217. /*
  218. create an EnumJobs which will wrap around an EnumJobs2
  219. */
  220. HRESULT SwitchToForeground();
  221. // end of the original Mars interface is here
  222. HRESULT QueryNewJobInterface( [in] REFIID iid, [out, iid_is(iid)] IUnknown ** pUnk );
  223. HRESULT SetNotificationPointer( [in] REFIID iid, [in] IUnknown * pUnk );
  224. }
  225. // ==============================================
  226. // IEnumGroups Interface
  227. [
  228. uuid(d993e603-4aa4-47c5-8665-c20d39c2ba4f),
  229. helpstring("IEnumBackgroundCopyGroups Interface"),
  230. odl
  231. ]
  232. interface IEnumBackgroundCopyGroups : IUnknown
  233. {
  234. /*
  235. analagous to EnumJobs interface
  236. */
  237. HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] GUID *rgelt, [out] ULONG *pceltFetched);
  238. HRESULT Skip([in] ULONG celt);
  239. HRESULT Reset();
  240. HRESULT Clone([out] IEnumBackgroundCopyGroups **ppenum);
  241. HRESULT GetCount([out] ULONG *puCount);
  242. }
  243. // ==============================================
  244. // IBackgroundCallback Interface
  245. // This interface is implemented by the client and is used by the queue manager to supply status and
  246. // progress information to the client.
  247. [
  248. uuid(084f6593-3800-4e08-9b59-99fa59addf82),
  249. helpstring("IBackgroundCopyCallback Interface"),
  250. odl
  251. ]
  252. interface IBackgroundCopyCallback1 : IUnknown
  253. {
  254. HRESULT OnStatus( [in] IBackgroundCopyGroup *pGroup,
  255. [in] IBackgroundCopyJob1 *pJob,
  256. [in] DWORD dwFileIndex,
  257. [in] DWORD dwStatus,
  258. [in] DWORD dwNumOfRetries,
  259. [in] DWORD dwWin32Result,
  260. [in] DWORD dwTransportResult );
  261. /*
  262. return corresponding properties from active Job2
  263. */
  264. HRESULT OnProgress( [in] DWORD ProgressType,
  265. [in] IBackgroundCopyGroup *pGroup,
  266. [in] IBackgroundCopyJob1 *pJob,
  267. [in] DWORD dwFileIndex,
  268. [in] DWORD dwProgressValue );
  269. HRESULT OnProgressEx( [in] DWORD ProgressType,
  270. [in] IBackgroundCopyGroup *pGroup,
  271. [in] IBackgroundCopyJob1 *pJob,
  272. [in] DWORD dwFileIndex,
  273. [in] DWORD dwProgressValue,
  274. [in] DWORD dwByteArraySize,
  275. [in, size_is(dwByteArraySize)] BYTE *pByte );
  276. /*
  277. see which features are actually in use; translate into Job2 properties.
  278. BUGBUG need to decide whether to implement ProgressEx (streaming)
  279. */
  280. }
  281. [
  282. uuid(16f41c69-09f5-41d2-8cd8-3c08c47bc8a8), // IID_IQMgr
  283. helpstring("Background Copy QMgr interface"),
  284. odl
  285. ]
  286. interface IBackgroundCopyQMgr : IUnknown
  287. {
  288. // Group Interface Methods (Groups contain sets of related Jobs)
  289. HRESULT CreateGroup([in] GUID guidGroupID, [out] IBackgroundCopyGroup **ppGroup);
  290. HRESULT GetGroup([in] GUID groupID, [out] IBackgroundCopyGroup **ppGroup);
  291. HRESULT EnumGroups([in] DWORD dwFlags, [out] IEnumBackgroundCopyGroups **ppEnumGroups);
  292. /*
  293. direct translation into Group2 etc.
  294. */
  295. }
  296. //---------------------------------------------------------------------------
  297. // IQMgr
  298. [
  299. uuid(f5b26dcb-b37e-4d7c-ae7a-1cb3fbeb183e), // LIBID_QMgr
  300. helpstring("Microsoft Background Copy Queue Manager 1.0"),
  301. lcid(0x0000),
  302. version(1.0)
  303. ]
  304. library BackgroundCopyQMgr
  305. {
  306. //-------------------------------------------------------------
  307. // QMgr
  308. //-------------------------------------------------------------
  309. [
  310. uuid(69AD4AEE-51BE-439b-A92C-86AE490E8B30),
  311. helpstring("Background Copy QMgr Class")
  312. ]
  313. coclass BackgroundCopyQMgr
  314. {
  315. [default] interface IBackgroundCopyQMgr;
  316. };
  317. }