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