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