winhttp/tests: Send a not empty payload in the server authorization response, check...
[wine/multimedia.git] / dlls / mshtml / binding.h
blobe1734310028dc2759401b231cc14f6d43fab147d
1 /*
2 * Copyright 2011 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 typedef struct nsWineURI nsWineURI;
21 /* Keep sync with request_method_strings in nsio.c */
22 typedef enum {
23 METHOD_GET,
24 METHOD_PUT,
25 METHOD_POST
26 } REQUEST_METHOD;
28 typedef enum {
29 BOM_NONE,
30 BOM_UTF8,
31 BOM_UTF16
32 } binding_bom_t;
34 typedef struct {
35 nsIHttpChannel nsIHttpChannel_iface;
36 nsIUploadChannel nsIUploadChannel_iface;
37 nsIHttpChannelInternal nsIHttpChannelInternal_iface;
39 LONG ref;
41 nsWineURI *uri;
42 nsIInputStream *post_data_stream;
43 BOOL post_data_contains_headers;
44 nsILoadGroup *load_group;
45 nsIInterfaceRequestor *notif_callback;
46 nsISupports *owner;
47 nsILoadInfo *load_info;
48 nsLoadFlags load_flags;
49 nsIURI *original_uri;
50 nsIURI *referrer;
51 char *content_type;
52 char *charset;
53 UINT32 response_status;
54 char *response_status_text;
55 REQUEST_METHOD request_method;
56 struct list response_headers;
57 struct list request_headers;
58 } nsChannel;
60 typedef struct {
61 nsIInputStream *post_stream;
62 WCHAR *headers;
63 HGLOBAL post_data;
64 ULONG post_data_len;
65 } request_data_t;
67 typedef struct BSCallbackVtbl BSCallbackVtbl;
69 struct BSCallback {
70 IBindStatusCallback IBindStatusCallback_iface;
71 IServiceProvider IServiceProvider_iface;
72 IHttpNegotiate2 IHttpNegotiate2_iface;
73 IInternetBindInfo IInternetBindInfo_iface;
75 const BSCallbackVtbl *vtbl;
77 LONG ref;
79 request_data_t request_data;
80 ULONG readed;
81 DWORD bindf;
82 BOOL bindinfo_ready;
83 binding_bom_t bom;
85 IMoniker *mon;
86 IBinding *binding;
88 HTMLInnerWindow *window;
90 struct list entry;
93 typedef struct nsProtocolStream nsProtocolStream;
95 struct nsChannelBSC {
96 BSCallback bsc;
98 nsChannel *nschannel;
99 nsIStreamListener *nslistener;
100 nsISupports *nscontext;
101 BOOL is_js;
102 BOOL is_doc_channel;
103 BOOL response_processed;
105 nsProtocolStream *nsstream;
108 struct BSCallbackVtbl {
109 void (*destroy)(BSCallback*);
110 HRESULT (*init_bindinfo)(BSCallback*);
111 HRESULT (*start_binding)(BSCallback*);
112 HRESULT (*stop_binding)(BSCallback*,HRESULT);
113 HRESULT (*read_data)(BSCallback*,IStream*);
114 HRESULT (*on_progress)(BSCallback*,ULONG,LPCWSTR);
115 HRESULT (*on_response)(BSCallback*,DWORD,LPCWSTR);
116 HRESULT (*beginning_transaction)(BSCallback*,WCHAR**);
119 typedef struct {
120 struct list entry;
121 WCHAR *header;
122 WCHAR *data;
123 } http_header_t;
125 #define BINDING_NAVIGATED 0x0001
126 #define BINDING_REPLACE 0x0002
127 #define BINDING_FROMHIST 0x0004
128 #define BINDING_REFRESH 0x0008
129 #define BINDING_SUBMIT 0x0010
130 #define BINDING_NOFRAG 0x0020
132 HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
133 HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
135 nsresult on_start_uri_open(NSContainer*,nsIURI*,cpp_bool*) DECLSPEC_HIDDEN;
136 HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN;
137 HRESULT create_doc_uri(HTMLOuterWindow*,IUri*,nsWineURI**) DECLSPEC_HIDDEN;
138 HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsIInputStream*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
139 HRESULT set_moniker(HTMLOuterWindow*,IMoniker*,IUri*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
140 void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
141 HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
142 HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
143 HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,request_data_t*,IHTMLWindow2**) DECLSPEC_HIDDEN;
144 HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*,DWORD) DECLSPEC_HIDDEN;
145 HRESULT submit_form(HTMLOuterWindow*,const WCHAR*,IUri*,nsIInputStream*) DECLSPEC_HIDDEN;
147 void init_bscallback(BSCallback*,const BSCallbackVtbl*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
148 HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
149 HRESULT channelbsc_load_stream(HTMLInnerWindow*,IMoniker*,IStream*) DECLSPEC_HIDDEN;
150 void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
151 IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
153 HRESULT read_stream(BSCallback*,IStream*,void*,DWORD,DWORD*) DECLSPEC_HIDDEN;
155 HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
156 HRESULT create_uri(const WCHAR*,DWORD,IUri**) DECLSPEC_HIDDEN;
157 IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN;
159 void set_current_mon(HTMLOuterWindow*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
160 void set_current_uri(HTMLOuterWindow*,IUri*) DECLSPEC_HIDDEN;