Fixed naming of the A/W types.
[wine] / include / urlmon.idl
1 /*
2  * Copyright (C) 2000 Ulrich Czekalla
3  * Copyright (C) 2003 Alexandre Julliard
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 import "objidl.idl";
21 import "oleidl.idl";
22 import "servprov.idl";
23 /*import "msxml.idl";*/
24
25
26 /*****************************************************************************
27  * IBinding interface
28  */
29 [
30     object,
31     uuid(79eac9c0-baf9-11ce-8c82-00aa004ba90b),
32     pointer_default(unique)
33 ]
34 interface IBinding : IUnknown
35 {
36     typedef [unique] IBinding *LPBINDING;
37
38     HRESULT Abort();
39     HRESULT Suspend();
40     HRESULT Resume();
41
42     HRESULT SetPriority(
43         [in] LONG nPriority);
44
45     HRESULT GetPriority(
46         [out] LONG * pnPriority);
47
48     [local]
49     HRESULT GetBindResult(
50         [out] CLSID *pclsidProtocol,
51         [out] DWORD *pdwResult,
52         [out] LPOLESTR *pszResult,
53         [in, out] DWORD *pdwReserved);
54
55     [call_as(GetBindResult)]
56     HRESULT RemoteGetBindResult(
57         [out] CLSID *pclsidProtocol,
58         [out] DWORD *pdwResult,
59         [out] LPOLESTR *pszResult,
60         [in] DWORD dwReserved);
61 }
62
63
64 /*****************************************************************************
65  * IBindStatusCallback interface
66  */
67 [
68     object,
69     uuid(79eac9c1-baf9-11ce-8c82-00aa004ba90b),
70     pointer_default(unique)
71 ]
72 interface IBindStatusCallback : IUnknown
73 {
74     typedef [unique] IBindStatusCallback *LPBINDSTATUSCALLBACK;
75
76
77     typedef enum
78     {
79         BINDF_ASYNCHRONOUS = 0x00000001,
80         BINDF_ASYNCSTORAGE = 0x00000002,
81         BINDF_NOPROGRESSIVERENDERING = 0x00000004,
82         BINDF_OFFLINEOPERATION = 0x00000008,
83         BINDF_GETNEWESTVERSION = 0x00000010,
84         BINDF_NOWRITECACHE = 0x00000020,
85         BINDF_NEEDFILE = 0x00000040,
86         BINDF_PULLDATA = 0x00000080,
87         BINDF_IGNORESECURITYPROBLEM = 0x00000100,
88         BINDF_RESYNCHRONIZE = 0x00000200,
89         BINDF_HYPERLINK = 0x00000400,
90         BINDF_NO_UI = 0x00000800,
91         BINDF_SILENTOPERATION = 0x00001000,
92         BINDF_PRAGMA_NO_CACHE = 0x00002000,
93         BINDF_GETCLASSOBJECT = 0x00004000,
94         BINDF_RESERVED_1 = 0x00008000,
95         BINDF_FREE_THREADED = 0x00010000,
96         BINDF_DIRECT_READ = 0x00020000,
97         BINDF_FORMS_SUBMIT = 0x00040000,
98         BINDF_GETFROMCACHE_IF_NET_FAIL = 0x00080000,
99         BINDF_FROMURLMON = 0x00100000,
100         BINDF_FWD_BACK = 0x00200000,
101         BINDF_PREFERDEFAULTHANDLER = 0x00400000,
102         BINDF_ENFORCERESTRICTED = 0x00800000
103     } BINDF;
104
105     typedef struct _tagBINDINFO
106     {
107         ULONG cbSize;
108         LPWSTR szExtraInfo;
109         STGMEDIUM stgmedData;
110         DWORD grfBindInfoF;
111         DWORD dwBindVerb;
112         LPWSTR szCustomVerb;
113         DWORD cbStgmedData;
114         DWORD dwOptions;
115         DWORD dwOptionsFlags;
116         DWORD dwCodePage;
117         SECURITY_ATTRIBUTES securityAttributes;
118         IID iid;
119         IUnknown *pUnk;
120         DWORD dwReserved;
121     } BINDINFO;
122
123     typedef struct _REMSECURITY_ATTRIBUTES
124     {
125         DWORD nLength;
126         DWORD lpSecurityDescriptor;
127         BOOL bInheritHandle;
128     } REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES;
129
130     typedef struct _tagRemBINDINFO
131     {
132         ULONG cbSize;
133         LPWSTR szExtraInfo;
134         DWORD grfBindInfoF;
135         DWORD dwBindVerb;
136         LPWSTR szCustomVerb;
137         DWORD cbstgmedData;
138         DWORD dwOptions;
139         DWORD dwOptionsFlags;
140         DWORD dwCodePage;
141         REMSECURITY_ATTRIBUTES securityAttributes;
142         IID iid;
143         IUnknown *pUnk;
144         DWORD dwReserved;
145     } RemBINDINFO;
146
147     typedef struct tagRemFORMATETC
148     {
149         DWORD cfFormat;
150         DWORD ptd;
151         DWORD dwAspect;
152         LONG lindex;
153         DWORD tymed;
154     } RemFORMATETC, *LPREMFORMATETC;
155
156     typedef enum
157     {
158         BSCF_FIRSTDATANOTIFICATION = 0x01,
159         BSCF_INTERMEDIATEDATANOTIFICATION = 0x02,
160         BSCF_LASTDATANOTIFICATION = 0x04,
161         BSCF_DATAFULLYAVAILABLE = 0x08,
162         BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10
163     } BSCF;
164
165     typedef enum BINDSTATUS
166     {
167         BINDSTATUS_FINDINGRESOURCE = 1,
168         BINDSTATUS_CONNECTING,
169         BINDSTATUS_REDIRECTING,
170         BINDSTATUS_BEGINDOWNLOADDATA,
171         BINDSTATUS_DOWNLOADINGDATA,
172         BINDSTATUS_ENDDOWNLOADDATA,
173         BINDSTATUS_BEGINDOWNLOADCOMPONENTS,
174         BINDSTATUS_INSTALLINGCOMPONENTS,
175         BINDSTATUS_ENDDOWNLOADCOMPONENTS,
176         BINDSTATUS_USINGCACHEDCOPY,
177         BINDSTATUS_SENDINGREQUEST,
178         BINDSTATUS_CLASSIDAVAILABLE,
179         BINDSTATUS_MIMETYPEAVAILABLE,
180         BINDSTATUS_CACHEFILENAMEAVAILABLE,
181         BINDSTATUS_BEGINSYNCOPERATION,
182         BINDSTATUS_ENDSYNCOPERATION,
183         BINDSTATUS_BEGINUPLOADDATA,
184         BINDSTATUS_UPLOADINGDATA,
185         BINDSTATUS_ENDUPLOADINGDATA,
186         BINDSTATUS_PROTOCOLCLASSID,
187         BINDSTATUS_ENCODING,
188         BINDSTATUS_VERFIEDMIMETYPEAVAILABLE,
189         BINDSTATUS_CLASSINSTALLLOCATION,
190         BINDSTATUS_DECODING,
191         BINDSTATUS_LOADINGMIMEHANDLER,
192         BINDSTATUS_CONTENTDISPOSITIONATTACH,
193         BINDSTATUS_FILTERREPORTMIMETYPE,
194         BINDSTATUS_CLSIDCANINSTANTIATE,
195         BINDSTATUS_IUNKNOWNAVAILABLE,
196         BINDSTATUS_DIRECTBIND,
197         BINDSTATUS_RAWMIMETYPE,
198         BINDSTATUS_PROXYDETECTING,
199         BINDSTATUS_ACCEPTRANGES,
200         BINDSTATUS_COOKIE_SENT,
201         BINDSTATUS_COMPACT_POLICY_RECEIVED,
202         BINDSTATUS_COOKIE_SUPPRESSED,
203         BINDSTATUS_COOKIE_STATE_UNKNOWN,
204         BINDSTATUS_COOKIE_STATE_ACCEPT,
205         BINDSTATUS_COOKIE_STATE_REJECT,
206         BINDSTATUS_COOKIE_STATE_PROMPT,
207         BINDSTATUS_COOKIE_STATE_LEASH,
208         BINDSTATUS_COOKIE_STATE_DOWNGRADE,
209         BINDSTATUS_POLICY_HREF,
210         BINDSTATUS_P3P_HEADER,
211         BINDSTATUS_SESSION_COOKIE_RECEIVED,
212         BINDSTATUS_PERSISTENT_COOKIE_RECEIVED,
213         BINDSTATUS_SESSION_COOKIES_ALLOWED,
214         BINDSTATUS_CACHECONTROL
215     } BINDSTATUS;
216
217
218     HRESULT OnStartBinding(
219         [in] DWORD dwReserved,
220         [in] IBinding * pib);
221
222     HRESULT GetPriority(
223         [out] LONG * pnPriority);
224
225     HRESULT OnLowResource(
226         [in] DWORD reserved);
227
228     HRESULT OnProgress(
229         [in] ULONG ulProgress,
230         [in] ULONG ulProgressMax,
231         [in] ULONG ulStatusCode,
232         [in] LPCWSTR szStatusText);
233
234     HRESULT OnStopBinding(
235         [in] HRESULT hresult,
236         [in, unique] LPCWSTR szError);
237
238     [local]
239     HRESULT GetBindInfo(
240         [out] DWORD *grfBINDF,
241         [in, out, unique] BINDINFO * pbindinfo);
242
243     [call_as(GetBindInfo)]
244     HRESULT RemoteGetBindInfo(
245         [out] DWORD *grfBINDF,
246         [in, out, unique] RemBINDINFO * pbindinfo,
247         [in, out, unique] RemSTGMEDIUM* pstgmed);
248
249     [local]
250     HRESULT OnDataAvailable(
251         [in] DWORD grfBSCF,
252         [in] DWORD dwSize,
253         [in] FORMATETC* pformatetc,
254         [in] STGMEDIUM* pstgmed);
255
256     [call_as(OnDataAvailable)]
257     HRESULT RemoteOnDataAvailable(
258         [in] DWORD grfBSCF,
259         [in] DWORD dwSize,
260         [in] RemFORMATETC *pformatetc,
261         [in] RemSTGMEDIUM* pstgmed);
262
263     HRESULT OnObjectAvailable(
264         [in] REFIID riid,
265         [in, iid_is(riid)] IUnknown* punk);
266 }
267
268
269 /*****************************************************************************
270  * IBindHost interface
271  */
272 [
273     object,
274     uuid(fc4801a1-2ba9-11cf-a229-00aa003d7352),
275     pointer_default(unique)
276 ]
277 interface IBindHost : IUnknown
278 {
279     typedef [unique] IBindHost *LPBINDHOST;
280
281     HRESULT CreateMoniker(
282         [in] LPOLESTR szName,
283         [in] IBindCtx *pBC,
284         [out] IMoniker** ppmk,
285         [in] DWORD dwReserved);
286
287     [local]
288     HRESULT MonikerBindToStorage(
289         [in] IMoniker *pMk,
290         [in] IBindCtx *pBC,
291         [in] IBindStatusCallback *pBSC,
292         [in] REFIID riid,
293         [out] void **ppvObj);
294
295     [call_as(MonikerBindToStorage)]
296     HRESULT RemoteMonikerBindToStorage(
297         [in, unique] IMoniker *pMk,
298         [in, unique] IBindCtx *pBC,
299         [in, unique] IBindStatusCallback *pBSC,
300         [in] REFIID riid,
301         [out, iid_is(riid)] IUnknown **ppvObj);
302
303     [local]
304     HRESULT MonikerBindToObject(
305         [in] IMoniker *pMk,
306         [in] IBindCtx *pBC,
307         [in] IBindStatusCallback *pBSC,
308         [in] REFIID riid,
309         [out] void **ppvObj);
310
311     [call_as(MonikerBindToObject)]
312     HRESULT RemoteMonikerBindToObject(
313         [in, unique] IMoniker *pMk,
314         [in, unique] IBindCtx *pBC,
315         [in, unique] IBindStatusCallback *pBSC,
316         [in] REFIID riid,
317         [out, iid_is(riid)] IUnknown **ppvObj);
318 }
319
320
321 /*****************************************************************************
322  * IWinInetInfo interface
323  */
324 [
325     object,
326     uuid(79eac9d6-bafa-11ce-8c82-00aa004ba90b),
327     pointer_default(unique)
328 ]
329 interface IWinInetInfo : IUnknown
330 {
331     typedef [unique] IWinInetInfo *LPWININETINFO;
332
333     [local]
334     HRESULT QueryOption(
335         [in] DWORD dwOption,
336         [in, out, size_is(*pcbBuf)] LPVOID pBuffer,
337         [in, out] DWORD *pcbBuf);
338
339     [call_as(QueryOption)]
340     HRESULT RemoteQueryOption(
341         [in] DWORD  dwOption,
342         [in, out, size_is(*pcbBuf)] BYTE *pBuffer,
343         [in, out] DWORD *pcbBuf);
344 }
345
346
347
348 /*****************************************************************************
349  * IWinInetHttpInfo interface
350  */
351 [
352     object,
353     uuid(79eac9d8-bafa-11ce-8c82-00aa004ba90b),
354     pointer_default(unique)
355 ]
356 interface IWinInetHttpInfo : IWinInetInfo
357 {
358     typedef [unique] IWinInetHttpInfo *LPWININETHTTPINFO;
359
360     [local]
361     HRESULT QueryInfo(
362         [in] DWORD dwOption,
363         [in, out,size_is(*pcbBuf)] LPVOID pBuffer,
364         [in, out] DWORD *pcbBuf,
365         [in, out] DWORD *pdwFlags,
366         [in, out] DWORD *pdwReserved);
367
368     [call_as(QueryInfo)]
369     HRESULT RemoteQueryInfo(
370         [in] DWORD dwOption,
371         [in,out,size_is(*pcbBuf)] BYTE *pBuffer,
372         [in, out] DWORD *pcbBuf,
373         [in, out] DWORD *pdwFlags,
374         [in, out] DWORD *pdwReserved);
375 }
376
377
378
379 /*****************************************************************************
380  * IPersistMoniker interface
381  */
382 [
383     object,
384     uuid(79eac9c9-baf9-11ce-8c82-00aa004ba90b),
385     pointer_default(unique)
386 ]
387 interface IPersistMoniker : IUnknown
388 {
389     typedef [unique] IPersistMoniker *LPPERSISTMONIKER;
390
391     HRESULT GetClassID(
392         [out] CLSID *pClassID);
393
394     HRESULT IsDirty();
395
396     HRESULT Load(
397         [in] BOOL fFullyAvailable,
398         [in] IMoniker *pimkName,
399         [in] LPBC pibc,
400         [in] DWORD grfMode);
401
402     HRESULT Save(
403         [in] IMoniker *pimkName,
404         [in] LPBC pbc,
405         [in] BOOL fRemember);
406
407     HRESULT SaveCompleted(
408         [in] IMoniker *pimkName,
409         [in] LPBC pibc);
410
411     HRESULT GetCurMoniker(
412         [out] IMoniker **ppimkName);
413 }
414
415
416 /*****************************************************************************
417  * IInternetProtocolInfo interface
418  */
419 [
420     local,
421     object,
422     uuid(79eac9ec-baf9-11ce-8c82-00aa004ba90b),
423     pointer_default(unique)
424 ]
425 interface IInternetProtocolInfo : IUnknown
426 {
427     typedef [unique] IInternetProtocolInfo *LPIINTERNETPROTOCOLINFO;
428
429     typedef enum _tagPARSEACTION
430     {
431         PARSE_CANONICALIZE = 1,
432         PARSE_FRIENDLY,
433         PARSE_SECURITY_URL,
434         PARSE_ROOTDOCUMENT,
435         PARSE_DOCUMENT,
436         PARSE_ANCHOR,
437         PARSE_ENCODE,
438         PARSE_DECODE,
439         PARSE_PATH_FROM_URL,
440         PARSE_URL_FROM_PATH,
441         PARSE_MIME,
442         PARSE_SERVER,
443         PARSE_SCHEMA,
444         PARSE_SITE,
445         PARSE_DOMAIN,
446         PARSE_LOCATION,
447         PARSE_SECURITY_DOMAIN,
448         PARSE_ESCAPE,
449         PARSE_UNESCAPE
450     } PARSEACTION;
451
452     typedef enum _tagPSUACTION
453     {
454         PSU_DEFAULT = 1,
455         PSU_SECURITY_URL_ONLY
456     } PSUACTION;
457
458     typedef enum _tagQUERYOPTION
459     {
460         QUERY_EXPIRATION_DATE = 1,
461         QUERY_TIME_OF_LAST_CHANGE,
462         QUERY_CONTENT_ENCODING,
463         QUERY_CONTENT_TYPE,
464         QUERY_REFRESH,
465         QUERY_RECOMBINE,
466         QUERY_CAN_NAVIGATE,
467         QUERY_USES_NETWORK,
468         QUERY_IS_CACHED,
469         QUERY_IS_INSTALLEDENTRY,
470         QUERY_IS_CACHED_OR_MAPPED,
471         QUERY_USES_CACHE,
472         QUERY_IS_SECURE,
473         QUERY_IS_SAFE
474     } QUERYOPTION;
475
476     HRESULT ParseUrl(
477         [in] LPCWSTR pwzUrl,
478         [in] PARSEACTION ParseAction,
479         [in] DWORD dwParseFlags,
480         [out] LPWSTR pwzResult,
481         [in] DWORD cchResult,
482         [out] DWORD *pcchResult,
483         [in] DWORD dwReserved);
484
485     HRESULT CombineUrl(
486         [in] LPCWSTR pwzBaseUrl,
487         [in] LPCWSTR pwzRelativeUrl,
488         [in] DWORD dwCombineFlags,
489         [out] LPWSTR pwzResult,
490         [in] DWORD cchResult,
491         [out] DWORD *pcchResult,
492         [in] DWORD dwReserved);
493
494     HRESULT CompareUrl(
495         [in] LPCWSTR pwzUrl1,
496         [in] LPCWSTR pwzUrl2,
497         [in] DWORD dwCompareFlags);
498
499     HRESULT QueryInfo(
500         [in] LPCWSTR pwzUrl,
501         [in] QUERYOPTION OueryOption,
502         [in] DWORD dwQueryFlags,
503         [in, out,size_is(*pcbBuf)] LPVOID pBuffer,
504         [in] DWORD cbBuffer,
505         [in, out] DWORD *pcbBuf,
506         [in] DWORD dwReserved);
507 }
508
509
510 cpp_quote("#define MK_S_ASYNCHRONOUS                0x000401E8")
511 cpp_quote("#define S_ASYNCHRONOUS                   MK_S_ASYNCHRONOUS")
512
513 cpp_quote("#define INET_E_ERROR_FIRST               0x800C0002L")
514 cpp_quote("#define INET_E_INVALID_URL               0x800C0002L")
515 cpp_quote("#define INET_E_NO_SESSION                0x800C0003L")
516 cpp_quote("#define INET_E_CANNOT_CONNECT            0x800C0004L")
517 cpp_quote("#define INET_E_RESOURCE_NOT_FOUND        0x800C0005L")
518 cpp_quote("#define INET_E_OBJECT_NOT_FOUND          0x800C0006L")
519 cpp_quote("#define INET_E_DATA_NOT_AVAILABLE        0x800C0007L")
520 cpp_quote("#define INET_E_DOWNLOAD_FAILURE          0x800C0008L")
521 cpp_quote("#define INET_E_AUTHENTICATION_REQUIRED   0x800C0009L")
522 cpp_quote("#define INET_E_NO_VALID_MEDIA            0x800C000AL")
523 cpp_quote("#define INET_E_CONNECTION_TIMEOUT        0x800C000BL")
524 cpp_quote("#define INET_E_INVALID_REQUEST           0x800C000CL")
525 cpp_quote("#define INET_E_UNKNOWN_PROTOCOL          0x800C000DL")
526 cpp_quote("#define INET_E_SECURITY_PROBLEM          0x800C000EL")
527 cpp_quote("#define INET_E_CANNOT_LOAD_DATA          0x800C000FL")
528 cpp_quote("#define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L")
529 cpp_quote("#define INET_E_QUERYOPTION_UNKNOWN       0x800C0013L")
530 cpp_quote("#define INET_E_REDIRECT_FAILED           0x800C0014L")
531 cpp_quote("#define INET_E_REDIRECT_TO_DIR           0x800C0015L")
532 cpp_quote("#define INET_E_CANNOT_LOCK_REQUEST       0x800C0016L")
533 cpp_quote("#define INET_E_ERROR_LAST                INET_E_REDIRECT_TO_DIR")
534
535 cpp_quote("HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk);")
536 cpp_quote("HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbsc, DWORD dwReserved);")
537 cpp_quote("HRESULT WINAPI CompareSecurityIds(BYTE*,DWORD,BYTE*,DWORD,DWORD);")
538 cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN pCaller, LPCSTR szURL,  LPCSTR  szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")
539 cpp_quote("HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);")