bits.idl 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. /*
  2. * Background Intelligent Transfer Service (BITS) interface
  3. *
  4. * Copyright 2007 Google (Roy Shea)
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  19. *
  20. */
  21. #ifndef DO_NO_IMPORTS
  22. import "unknwn.idl";
  23. #endif
  24. cpp_quote("#include \"bitsmsg.h\"")
  25. cpp_quote("#define BG_SIZE_UNKNOWN (UINT64)(-1)")
  26. cpp_quote("#define BG_NOTIFY_JOB_TRANSFERRED 0x0001")
  27. cpp_quote("#define BG_NOTIFY_JOB_ERROR 0x0002")
  28. cpp_quote("#define BG_NOTIFY_DISABLE 0x0004")
  29. cpp_quote("#define BG_NOTIFY_JOB_MODIFICATION 0x0008")
  30. cpp_quote("#define BG_NOTIFY_FILE_TRANSFERRED 0x0010")
  31. cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
  32. cpp_quote("#undef EnumJobs")
  33. cpp_quote("#undef GetJob")
  34. cpp_quote("#endif")
  35. #define BG_ENUM_SIZEIS(maxcount) maxcount
  36. #define BG_ENUM_LENGTHIS(maxcount,lengthptr) lengthptr ? *lengthptr : maxcount
  37. [
  38. uuid(01b7bd23-fb88-4a77-8490-5891d3e4653a),
  39. odl
  40. ]
  41. interface IBackgroundCopyFile : IUnknown
  42. {
  43. typedef struct _BG_FILE_PROGRESS {
  44. UINT64 BytesTotal;
  45. UINT64 BytesTransferred;
  46. BOOL Completed;
  47. } BG_FILE_PROGRESS;
  48. HRESULT GetRemoteName(
  49. [out] LPWSTR *pVal
  50. );
  51. HRESULT GetLocalName(
  52. [out] LPWSTR *pVal
  53. );
  54. HRESULT GetProgress(
  55. [out] BG_FILE_PROGRESS *pVal
  56. );
  57. }
  58. [
  59. uuid(ca51e165-c365-424c-8d41-24aaa4ff3c40),
  60. odl
  61. ]
  62. interface IEnumBackgroundCopyFiles: IUnknown
  63. {
  64. HRESULT Next(
  65. [in] ULONG celt,
  66. [out,size_is(BG_ENUM_SIZEIS(celt)),length_is(BG_ENUM_LENGTHIS(celt,pceltFetched))] IBackgroundCopyFile **rgelt,
  67. [in,out,unique] ULONG *pceltFetched
  68. );
  69. HRESULT Skip(
  70. [in] ULONG celt
  71. );
  72. HRESULT Reset();
  73. HRESULT Clone(
  74. [out] IEnumBackgroundCopyFiles **ppenum
  75. );
  76. HRESULT GetCount(
  77. [out] ULONG *puCount
  78. );
  79. }
  80. [
  81. uuid(19c613a0-fcb8-4f28-81ae-897c3d078f81),
  82. odl
  83. ]
  84. interface IBackgroundCopyError : IUnknown
  85. {
  86. typedef enum {
  87. BG_ERROR_CONTEXT_NONE = 0,
  88. BG_ERROR_CONTEXT_UNKNOWN = 1,
  89. BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER = 2,
  90. BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION =3,
  91. BG_ERROR_CONTEXT_LOCAL_FILE = 4,
  92. BG_ERROR_CONTEXT_REMOTE_FILE = 5,
  93. BG_ERROR_CONTEXT_GENERAL_TRANSPORT = 6,
  94. BG_ERROR_CONTEXT_REMOTE_APPLICATION =7,
  95. } BG_ERROR_CONTEXT;
  96. HRESULT GetError(
  97. [out,ref] BG_ERROR_CONTEXT *pContext,
  98. [out,ref] HRESULT *pCode
  99. );
  100. HRESULT GetFile(
  101. [out] IBackgroundCopyFile **pVal
  102. );
  103. HRESULT GetErrorDescription(
  104. [in] DWORD LanguageId,
  105. [out,ref] LPWSTR *pErrorDescription
  106. );
  107. HRESULT GetErrorContextDescription(
  108. [in] DWORD LanguageId,
  109. [out,ref] LPWSTR *pContextDescription
  110. );
  111. HRESULT GetProtocol(
  112. [out,ref] LPWSTR *pProtocol
  113. );
  114. }
  115. [
  116. uuid(37668d37-507e-4160-9316-26306d150b12),
  117. odl
  118. ]
  119. interface IBackgroundCopyJob : IUnknown
  120. {
  121. typedef struct _BG_FILE_INFO {
  122. LPWSTR RemoteName;
  123. LPWSTR LocalName;
  124. } BG_FILE_INFO;
  125. typedef struct _BG_JOB_PROGRESS {
  126. UINT64 BytesTotal;
  127. UINT64 BytesTransferred;
  128. ULONG FilesTotal;
  129. ULONG FilesTransferred;
  130. } BG_JOB_PROGRESS;
  131. typedef struct _BG_JOB_TIMES {
  132. FILETIME CreationTime;
  133. FILETIME ModificationTime;
  134. FILETIME TransferCompletionTime;
  135. } BG_JOB_TIMES;
  136. typedef enum {
  137. BG_JOB_PRIORITY_FOREGROUND = 0,
  138. BG_JOB_PRIORITY_HIGH = 1,
  139. BG_JOB_PRIORITY_NORMAL = 2,
  140. BG_JOB_PRIORITY_LOW = 3
  141. } BG_JOB_PRIORITY;
  142. typedef enum {
  143. BG_JOB_STATE_QUEUED = 0,
  144. BG_JOB_STATE_CONNECTING = 1,
  145. BG_JOB_STATE_TRANSFERRING = 2,
  146. BG_JOB_STATE_SUSPENDED = 3,
  147. BG_JOB_STATE_ERROR = 4,
  148. BG_JOB_STATE_TRANSIENT_ERROR = 5,
  149. BG_JOB_STATE_TRANSFERRED = 6,
  150. BG_JOB_STATE_ACKNOWLEDGED = 7,
  151. BG_JOB_STATE_CANCELLED = 8
  152. } BG_JOB_STATE;
  153. typedef enum {
  154. BG_JOB_TYPE_DOWNLOAD = 0,
  155. BG_JOB_TYPE_UPLOAD = 1,
  156. BG_JOB_TYPE_UPLOAD_REPLY = 2
  157. } BG_JOB_TYPE;
  158. typedef enum {
  159. BG_JOB_PROXY_USAGE_PRECONFIG,
  160. BG_JOB_PROXY_USAGE_NO_PROXY,
  161. BG_JOB_PROXY_USAGE_OVERRIDE,
  162. BG_JOB_PROXY_USAGE_AUTODETECT
  163. } BG_JOB_PROXY_USAGE;
  164. HRESULT AddFileSet(
  165. [in] ULONG cFileCount,
  166. [in,size_is(cFileCount)] BG_FILE_INFO *pFileSet
  167. );
  168. HRESULT AddFile(
  169. [in] LPCWSTR RemoteUrl,
  170. [in] LPCWSTR LocalName
  171. );
  172. HRESULT EnumFiles(
  173. [out] IEnumBackgroundCopyFiles **pEnum
  174. );
  175. HRESULT Suspend();
  176. HRESULT Resume();
  177. HRESULT Cancel();
  178. HRESULT Complete();
  179. HRESULT GetId(
  180. [out] GUID *pVal
  181. );
  182. HRESULT GetType(
  183. [out] BG_JOB_TYPE *pVal
  184. );
  185. HRESULT GetProgress(
  186. [out] BG_JOB_PROGRESS *pVal
  187. );
  188. HRESULT GetTimes(
  189. [out] BG_JOB_TIMES *pVal
  190. );
  191. HRESULT GetState(
  192. [out] BG_JOB_STATE *pVal
  193. );
  194. HRESULT GetError(
  195. [out] IBackgroundCopyError **ppError
  196. );
  197. HRESULT GetOwner(
  198. [out] LPWSTR *pVal
  199. );
  200. HRESULT SetDisplayName(
  201. [in] LPCWSTR Val
  202. );
  203. HRESULT GetDisplayName(
  204. [out] LPWSTR *pVal
  205. );
  206. HRESULT SetDescription(
  207. [in] LPCWSTR Val
  208. );
  209. HRESULT GetDescription(
  210. [out] LPWSTR *pVal
  211. );
  212. HRESULT SetPriority(
  213. [in] BG_JOB_PRIORITY Val
  214. );
  215. HRESULT GetPriority(
  216. [out] BG_JOB_PRIORITY *pVal
  217. );
  218. HRESULT SetNotifyFlags(
  219. [in] ULONG Val
  220. );
  221. HRESULT GetNotifyFlags(
  222. [out] ULONG *pVal
  223. );
  224. HRESULT SetNotifyInterface(
  225. [in] IUnknown *Val
  226. );
  227. HRESULT GetNotifyInterface(
  228. [out] IUnknown ** pVal
  229. );
  230. HRESULT SetMinimumRetryDelay(
  231. [in] ULONG Seconds
  232. );
  233. HRESULT GetMinimumRetryDelay(
  234. [out] ULONG *Seconds
  235. );
  236. HRESULT SetNoProgressTimeout(
  237. [in] ULONG Seconds
  238. );
  239. HRESULT GetNoProgressTimeout(
  240. [out] ULONG *Seconds
  241. );
  242. HRESULT GetErrorCount(
  243. [out] ULONG *Errors
  244. );
  245. HRESULT SetProxySettings(
  246. [in] BG_JOB_PROXY_USAGE ProxyUsage,
  247. [in,string,unique] const WCHAR *ProxyList,
  248. [in,string,unique] const WCHAR *ProxyBypassList
  249. );
  250. HRESULT GetProxySettings(
  251. [out] BG_JOB_PROXY_USAGE *pProxyUsage,
  252. [out] LPWSTR *pProxyList,
  253. [out] LPWSTR *pProxyBypassList
  254. );
  255. HRESULT TakeOwnership();
  256. }
  257. [
  258. uuid(1af4f612-3b71-466f-8f58-7b6f73ac57ad),
  259. odl
  260. ]
  261. interface IEnumBackgroundCopyJobs : IUnknown
  262. {
  263. HRESULT Next(
  264. [in] ULONG celt,
  265. [out,size_is(BG_ENUM_SIZEIS(celt)),length_is(BG_ENUM_LENGTHIS(celt,pceltFetched))] IBackgroundCopyJob **rgelt,
  266. [in,out,unique] ULONG *pceltFetched
  267. );
  268. HRESULT Skip(
  269. [in] ULONG celt
  270. );
  271. HRESULT Reset();
  272. HRESULT Clone(
  273. [out] IEnumBackgroundCopyJobs **ppenum
  274. );
  275. HRESULT GetCount(
  276. [out] ULONG *puCount
  277. );
  278. }
  279. [
  280. uuid(97ea99c7-0186-4ad4-8df9-c5b4e0ed6b22),
  281. odl
  282. ]
  283. interface IBackgroundCopyCallback : IUnknown
  284. {
  285. HRESULT JobTransferred(
  286. [in] IBackgroundCopyJob *pJob
  287. );
  288. HRESULT JobError(
  289. [in] IBackgroundCopyJob *pJob,
  290. [in] IBackgroundCopyError *pError
  291. );
  292. HRESULT JobModification(
  293. [in] IBackgroundCopyJob *pJob,
  294. [in] DWORD dwReserved
  295. );
  296. }
  297. [
  298. uuid(5ce34c0d-0dc9-4c1f-897c-daa1b78cee7c),
  299. odl
  300. ]
  301. interface IBackgroundCopyManager : IUnknown
  302. {
  303. cpp_quote("#define BG_JOB_ENUM_ALL_USERS 0x0001")
  304. HRESULT CreateJob(
  305. [in] LPCWSTR DisplayName,
  306. [in] BG_JOB_TYPE Type,
  307. [out] GUID *pJobId,
  308. [out] IBackgroundCopyJob **ppJob
  309. );
  310. HRESULT GetJob(
  311. [in] REFGUID jobID,
  312. [out] IBackgroundCopyJob **ppJob
  313. );
  314. HRESULT EnumJobs(
  315. [in] DWORD dwFlags,
  316. [out] IEnumBackgroundCopyJobs **ppEnum
  317. );
  318. HRESULT GetErrorDescription(
  319. [in] HRESULT hResult,
  320. [in] DWORD LanguageId,
  321. [out] LPWSTR *pErrorDescription);
  322. }
  323. [
  324. uuid(1deeb74f-7915-4560-b558-918c83f176a6),
  325. version(1.0)
  326. ]
  327. library BackgroundCopyManager
  328. {
  329. [
  330. uuid(4991d34b-80a1-4291-83b6-3328366b9097),
  331. ]
  332. coclass BackgroundCopyManager
  333. {
  334. [default] interface IBackgroundCopyManager;
  335. };
  336. interface IBackgroundCopyCallback;
  337. }
  338. cpp_quote("#include \"bits1_5.h\"")