Sync with trunk (r48545)
[reactos.git] / include / psdk / bits.idl
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
22 #ifndef DO_NO_IMPORTS
23 import "unknwn.idl";
24 #endif
25
26 cpp_quote("#include \"bitsmsg.h\"")
27 cpp_quote("#define BG_SIZE_UNKNOWN (UINT64)(-1)")
28 cpp_quote("#define BG_NOTIFY_JOB_TRANSFERRED 0x0001")
29 cpp_quote("#define BG_NOTIFY_JOB_ERROR 0x0002")
30 cpp_quote("#define BG_NOTIFY_DISABLE 0x0004")
31 cpp_quote("#define BG_NOTIFY_JOB_MODIFICATION 0x0008")
32
33 cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
34 cpp_quote("#undef EnumJobs")
35 cpp_quote("#undef GetJob")
36 cpp_quote("#endif")
37
38 #define BG_ENUM_SIZEIS(maxcount) maxcount
39 #define BG_ENUM_LENGTHIS(maxcount,lengthptr) lengthptr ? *lengthptr : maxcount
40
41 [
42 uuid(01b7bd23-fb88-4a77-8490-5891d3e4653a),
43 odl
44 ]
45 interface IBackgroundCopyFile : IUnknown
46 {
47 typedef struct _BG_FILE_PROGRESS {
48 UINT64 BytesTotal;
49 UINT64 BytesTransferred;
50 BOOL Completed;
51 } BG_FILE_PROGRESS;
52
53 HRESULT GetRemoteName(
54 [out] LPWSTR *pVal
55 );
56
57 HRESULT GetLocalName(
58 [out] LPWSTR *pVal
59 );
60
61 HRESULT GetProgress(
62 [out] BG_FILE_PROGRESS *pVal
63 );
64 }
65
66
67 [
68 uuid(ca51e165-c365-424c-8d41-24aaa4ff3c40),
69 odl
70 ]
71 interface IEnumBackgroundCopyFiles: IUnknown
72 {
73 HRESULT Next(
74 [in] ULONG celt,
75 [out,size_is(BG_ENUM_SIZEIS(celt)),length_is(BG_ENUM_LENGTHIS(celt,pceltFetched))] IBackgroundCopyFile **rgelt,
76 [in,out,unique] ULONG *pceltFetched
77 );
78
79 HRESULT Skip(
80 [in] ULONG celt
81 );
82
83 HRESULT Reset();
84
85 HRESULT Clone(
86 [out] IEnumBackgroundCopyFiles **ppenum
87 );
88
89 HRESULT GetCount(
90 [out] ULONG *puCount
91 );
92 }
93
94
95 [
96 uuid(19c613a0-fcb8-4f28-81ae-897c3d078f81),
97 odl
98 ]
99 interface IBackgroundCopyError : IUnknown
100 {
101 typedef enum {
102 BG_ERROR_CONTEXT_NONE = 0,
103 BG_ERROR_CONTEXT_UNKNOWN = 1,
104 BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER = 2,
105 BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION =3,
106 BG_ERROR_CONTEXT_LOCAL_FILE = 4,
107 BG_ERROR_CONTEXT_REMOTE_FILE = 5,
108 BG_ERROR_CONTEXT_GENERAL_TRANSPORT = 6,
109 BG_ERROR_CONTEXT_REMOTE_APPLICATION =7,
110 } BG_ERROR_CONTEXT;
111
112 HRESULT GetError(
113 [out,ref] BG_ERROR_CONTEXT *pContext,
114 [out,ref] HRESULT *pCode
115 );
116
117 HRESULT GetFile(
118 [out] IBackgroundCopyFile **pVal
119 );
120
121 HRESULT GetErrorDescription(
122 [in] DWORD LanguageId,
123 [out,ref] LPWSTR *pErrorDescription
124 );
125
126 HRESULT GetErrorContextDescription(
127 [in] DWORD LanguageId,
128 [out,ref] LPWSTR *pContextDescription
129 );
130
131 HRESULT GetProtocol(
132 [out,ref] LPWSTR *pProtocol
133 );
134 }
135
136
137
138 [
139 uuid(37668d37-507e-4160-9316-26306d150b12),
140 odl
141 ]
142 interface IBackgroundCopyJob : IUnknown
143 {
144 typedef struct _BG_FILE_INFO {
145 LPWSTR RemoteName;
146 LPWSTR LocalName;
147 } BG_FILE_INFO;
148
149 typedef struct _BG_JOB_PROGRESS {
150 UINT64 BytesTotal;
151 UINT64 BytesTransferred;
152 ULONG FilesTotal;
153 ULONG FilesTransferred;
154 } BG_JOB_PROGRESS;
155
156 typedef struct _BG_JOB_TIMES {
157 FILETIME CreationTime;
158 FILETIME ModificationTime;
159 FILETIME TransferCompletionTime;
160 } BG_JOB_TIMES;
161
162 typedef enum {
163 BG_JOB_PRIORITY_FOREGROUND = 0,
164 BG_JOB_PRIORITY_HIGH = 1,
165 BG_JOB_PRIORITY_NORMAL = 2,
166 BG_JOB_PRIORITY_LOW = 3
167 } BG_JOB_PRIORITY;
168
169 typedef enum {
170 BG_JOB_STATE_QUEUED = 0,
171 BG_JOB_STATE_CONNECTING = 1,
172 BG_JOB_STATE_TRANSFERRING = 2,
173 BG_JOB_STATE_SUSPENDED = 3,
174 BG_JOB_STATE_ERROR = 4,
175 BG_JOB_STATE_TRANSIENT_ERROR = 5,
176 BG_JOB_STATE_TRANSFERRED = 6,
177 BG_JOB_STATE_ACKNOWLEDGED = 7,
178 BG_JOB_STATE_CANCELLED = 8
179 } BG_JOB_STATE;
180
181 typedef enum {
182 BG_JOB_TYPE_DOWNLOAD = 0,
183 BG_JOB_TYPE_UPLOAD = 1,
184 BG_JOB_TYPE_UPLOAD_REPLY = 2
185 } BG_JOB_TYPE;
186
187 typedef enum {
188 BG_JOB_PROXY_USAGE_PRECONFIG,
189 BG_JOB_PROXY_USAGE_NO_PROXY,
190 BG_JOB_PROXY_USAGE_OVERRIDE,
191 BG_JOB_PROXY_USAGE_AUTODETECT
192 } BG_JOB_PROXY_USAGE;
193
194
195 HRESULT AddFileSet(
196 [in] ULONG cFileCount,
197 [in,size_is(cFileCount)] BG_FILE_INFO *pFileSet
198 );
199
200 HRESULT AddFile(
201 [in] LPCWSTR RemoteUrl,
202 [in] LPCWSTR LocalName
203 );
204
205 HRESULT EnumFiles(
206 [out] IEnumBackgroundCopyFiles **pEnum
207 );
208
209 HRESULT Suspend();
210
211 HRESULT Resume();
212
213 HRESULT Cancel();
214
215 HRESULT Complete();
216
217 HRESULT GetId(
218 [out] GUID *pVal
219 );
220
221 HRESULT GetType(
222 [out] BG_JOB_TYPE *pVal
223 );
224
225 HRESULT GetProgress(
226 [out] BG_JOB_PROGRESS *pVal
227 );
228
229 HRESULT GetTimes(
230 [out] BG_JOB_TIMES *pVal
231 );
232
233 HRESULT GetState(
234 [out] BG_JOB_STATE *pVal
235 );
236
237 HRESULT GetError(
238 [out] IBackgroundCopyError **ppError
239 );
240
241 HRESULT GetOwner(
242 [out] LPWSTR *pVal
243 );
244
245 HRESULT SetDisplayName(
246 [in] LPCWSTR Val
247 );
248
249 HRESULT GetDisplayName(
250 [out] LPWSTR *pVal
251 );
252
253 HRESULT SetDescription(
254 [in] LPCWSTR Val
255 );
256
257 HRESULT GetDescription(
258 [out] LPWSTR *pVal
259 );
260
261 HRESULT SetPriority(
262 [in] BG_JOB_PRIORITY Val
263 );
264
265 HRESULT GetPriority(
266 [out] BG_JOB_PRIORITY *pVal
267 );
268
269 HRESULT SetNotifyFlags(
270 [in] ULONG Val
271 );
272
273 HRESULT GetNotifyFlags(
274 [out] ULONG *pVal
275 );
276
277 HRESULT SetNotifyInterface(
278 [in] IUnknown *Val
279 );
280
281 HRESULT GetNotifyInterface(
282 [out] IUnknown ** pVal
283 );
284
285 HRESULT SetMinimumRetryDelay(
286 [in] ULONG Seconds
287 );
288
289 HRESULT GetMinimumRetryDelay(
290 [out] ULONG *Seconds
291 );
292
293 HRESULT SetNoProgressTimeout(
294 [in] ULONG Seconds
295 );
296
297 HRESULT GetNoProgressTimeout(
298 [out] ULONG *Seconds
299 );
300
301 HRESULT GetErrorCount(
302 [out] ULONG *Errors
303 );
304
305 HRESULT SetProxySettings(
306 [in] BG_JOB_PROXY_USAGE ProxyUsage,
307 [in,string,unique] const WCHAR *ProxyList,
308 [in,string,unique] const WCHAR *ProxyBypassList
309 );
310
311 HRESULT GetProxySettings(
312 [out] BG_JOB_PROXY_USAGE *pProxyUsage,
313 [out] LPWSTR *pProxyList,
314 [out] LPWSTR *pProxyBypassList
315 );
316
317 HRESULT TakeOwnership();
318 }
319
320 [
321 uuid(1af4f612-3b71-466f-8f58-7b6f73ac57ad),
322 odl
323 ]
324 interface IEnumBackgroundCopyJobs : IUnknown
325 {
326 HRESULT Next(
327 [in] ULONG celt,
328 [out,size_is(BG_ENUM_SIZEIS(celt)),length_is(BG_ENUM_LENGTHIS(celt,pceltFetched))] IBackgroundCopyJob **rgelt,
329 [in,out,unique] ULONG *pceltFetched
330 );
331
332 HRESULT Skip(
333 [in] ULONG celt
334 );
335
336 HRESULT Reset();
337
338 HRESULT Clone(
339 [out] IEnumBackgroundCopyJobs **ppenum
340 );
341
342 HRESULT GetCount(
343 [out] ULONG *puCount
344 );
345 }
346
347
348 [
349 uuid(97ea99c7-0186-4ad4-8df9-c5b4e0ed6b22),
350 odl
351 ]
352 interface IBackgroundCopyCallback : IUnknown
353 {
354 HRESULT JobTransferred(
355 [in] IBackgroundCopyJob *pJob
356 );
357
358 HRESULT JobError(
359 [in] IBackgroundCopyJob *pJob,
360 [in] IBackgroundCopyError *pError
361 );
362
363 HRESULT JobModification(
364 [in] IBackgroundCopyJob *pJob,
365 [in] DWORD dwReserved
366 );
367 }
368
369 [
370 uuid(5ce34c0d-0dc9-4c1f-897c-daa1b78cee7c),
371 odl
372 ]
373 interface IBackgroundCopyManager : IUnknown
374 {
375 cpp_quote("#define BG_JOB_ENUM_ALL_USERS 0x0001")
376
377 HRESULT CreateJob(
378 [in] LPCWSTR DisplayName,
379 [in] BG_JOB_TYPE Type,
380 [out] GUID *pJobId,
381 [out] IBackgroundCopyJob **ppJob
382 );
383
384 HRESULT GetJob(
385 [in] REFGUID jobID,
386 [out] IBackgroundCopyJob **ppJob
387 );
388
389 HRESULT EnumJobs(
390 [in] DWORD dwFlags,
391 [out] IEnumBackgroundCopyJobs **ppEnum
392 );
393 HRESULT GetErrorDescription(
394 [in] HRESULT hResult,
395 [in] DWORD LanguageId,
396 [out] LPWSTR *pErrorDescription);
397 }
398
399
400 [
401 uuid(1deeb74f-7915-4560-b558-918c83f176a6),
402 version(1.0)
403 ]
404 library BackgroundCopyManager
405 {
406 [
407 uuid(4991d34b-80a1-4291-83b6-3328366b9097),
408 ]
409 coclass BackgroundCopyManager
410 {
411 [default] interface IBackgroundCopyManager;
412 };
413
414 interface IBackgroundCopyCallback;
415 }