mshtml: Added noscript tag handling tests.
[wine] / dlls / mshtml / binding.h
1 /*
2  * Copyright 2011 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 typedef struct nsWineURI nsWineURI;
20
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;
27
28 typedef struct {
29     nsIHttpChannel         nsIHttpChannel_iface;
30     nsIUploadChannel       nsIUploadChannel_iface;
31     nsIHttpChannelInternal nsIHttpChannelInternal_iface;
32
33     LONG ref;
34
35     nsWineURI *uri;
36     nsIInputStream *post_data_stream;
37     BOOL post_data_contains_headers;
38     nsILoadGroup *load_group;
39     nsIInterfaceRequestor *notif_callback;
40     nsISupports *owner;
41     nsLoadFlags load_flags;
42     nsIURI *original_uri;
43     nsIURI *referrer;
44     char *content_type;
45     char *charset;
46     PRUint32 response_status;
47     REQUEST_METHOD request_method;
48     struct list response_headers;
49     struct list request_headers;
50 } nsChannel;
51
52 typedef struct BSCallbackVtbl BSCallbackVtbl;
53
54 struct BSCallback {
55     IBindStatusCallback IBindStatusCallback_iface;
56     IServiceProvider    IServiceProvider_iface;
57     IHttpNegotiate2     IHttpNegotiate2_iface;
58     IInternetBindInfo   IInternetBindInfo_iface;
59
60     const BSCallbackVtbl          *vtbl;
61
62     LONG ref;
63
64     LPWSTR headers;
65     HGLOBAL post_data;
66     ULONG post_data_len;
67     ULONG readed;
68     DWORD bindf;
69     BOOL bindinfo_ready;
70     int bom;
71
72     IMoniker *mon;
73     IBinding *binding;
74
75     HTMLInnerWindow *window;
76
77     struct list entry;
78 };
79
80 typedef struct nsProtocolStream nsProtocolStream;
81
82 struct nsChannelBSC {
83     BSCallback bsc;
84
85     nsChannel *nschannel;
86     nsIStreamListener *nslistener;
87     nsISupports *nscontext;
88     BOOL is_js;
89     BOOL is_doc_channel;
90     BOOL response_processed;
91
92     nsProtocolStream *nsstream;
93 };
94
95 typedef struct {
96     struct list entry;
97     WCHAR *header;
98     WCHAR *data;
99 } http_header_t;
100
101 HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
102 HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
103
104 nsresult on_start_uri_open(NSContainer*,nsIURI*,cpp_bool*) DECLSPEC_HIDDEN;
105 HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN;
106 HRESULT create_doc_uri(HTMLOuterWindow*,const WCHAR*,nsWineURI**) DECLSPEC_HIDDEN;
107 HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
108 HRESULT set_moniker(HTMLDocument*,IMoniker*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
109 void prepare_for_binding(HTMLDocument*,IMoniker*,BOOL) DECLSPEC_HIDDEN;
110 HRESULT super_navigate(HTMLOuterWindow*,IUri*,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
111 HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
112
113 HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
114 HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN;
115 void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
116 IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
117 HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
118
119 HRESULT bind_mon_to_wstr(HTMLInnerWindow*,IMoniker*,WCHAR**) DECLSPEC_HIDDEN;