rpcrt4: Use rpcrt4_conn_read in RPCRT4_OpenBinding.
[wine] / dlls / mshtml / htmldoc3.c
1 /*
2  * Copyright 2005 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30
31 #include "wine/debug.h"
32
33 #include "mshtml_private.h"
34
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36
37 #define HTMLDOC3_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument3, iface)
38
39 static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
40                                                   REFIID riid, void **ppv)
41 {
42     HTMLDocument *This = HTMLDOC3_THIS(iface);
43     return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
44 }
45
46 static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
47 {
48     HTMLDocument *This = HTMLDOC3_THIS(iface);
49     return IHTMLDocument2_AddRef(HTMLDOC(This));
50 }
51
52 static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
53 {
54     HTMLDocument *This = HTMLDOC3_THIS(iface);
55     return IHTMLDocument2_Release(HTMLDOC(This));
56 }
57
58 static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
59 {
60     HTMLDocument *This = HTMLDOC3_THIS(iface);
61     FIXME("(%p)->(%p)\n", This, pctinfo);
62     return E_NOTIMPL;
63 }
64
65 static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
66                                                 LCID lcid, ITypeInfo **ppTInfo)
67 {
68     HTMLDocument *This = HTMLDOC3_THIS(iface);
69     FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
70     return E_NOTIMPL;
71 }
72
73 static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
74                                                 LPOLESTR *rgszNames, UINT cNames,
75                                                 LCID lcid, DISPID *rgDispId)
76 {
77     HTMLDocument *This = HTMLDOC3_THIS(iface);
78     FIXME("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
79                                         lcid, rgDispId);
80     return E_NOTIMPL;
81 }
82
83 static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
84                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
85                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
86 {
87     HTMLDocument *This = HTMLDOC3_THIS(iface);
88     FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
89             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
90     return E_NOTIMPL;
91 }
92
93 static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
94 {
95     HTMLDocument *This = HTMLDOC3_THIS(iface);
96     FIXME("(%p)\n", This);
97     return E_NOTIMPL;
98 }
99
100 static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
101 {
102     HTMLDocument *This = HTMLDOC3_THIS(iface);
103     FIXME("(%p)->(%x)\n", This, fForce);
104     return E_NOTIMPL;
105 }
106
107 static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
108                                                    IHTMLDOMNode **newTextNode)
109 {
110     HTMLDocument *This = HTMLDOC3_THIS(iface);
111     FIXME("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
112     return E_NOTIMPL;
113 }
114
115 static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
116 {
117     HTMLDocument *This = HTMLDOC3_THIS(iface);
118     nsIDOMDocument *nsdoc;
119     HTMLDOMNode *node;
120     nsresult nsres;
121
122     TRACE("(%p)->(%p)\n", This, p);
123
124     if(!This->nscontainer) {
125         *p = NULL;
126         return S_OK;
127     }
128
129     nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
130     if(NS_FAILED(nsres))
131         ERR("GetDocument failed: %08lx\n", nsres);
132
133     if(nsdoc) {
134         node = get_node(This, (nsIDOMNode*)nsdoc);
135         nsIDOMDocument_Release(nsdoc);
136
137         IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
138     }else {
139         *p = NULL;
140     }
141
142     return S_OK;
143 }
144
145 static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
146 {
147     HTMLDocument *This = HTMLDOC3_THIS(iface);
148     FIXME("(%p)->(%p)\n", This, p);
149     return E_NOTIMPL;
150 }
151
152 static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
153                                                 IDispatch* pDisp, VARIANT_BOOL *pfResult)
154 {
155     HTMLDocument *This = HTMLDOC3_THIS(iface);
156     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
157     return E_NOTIMPL;
158 }
159
160 static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
161                                                 IDispatch *pDisp)
162 {
163     HTMLDocument *This = HTMLDOC3_THIS(iface);
164     FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
165     return E_NOTIMPL;
166 }
167
168 static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
169 {
170     HTMLDocument *This = HTMLDOC3_THIS(iface);
171     FIXME("(%p)->()\n", This);
172     return E_NOTIMPL;
173 }
174
175 static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
176 {
177     HTMLDocument *This = HTMLDOC3_THIS(iface);
178     FIXME("(%p)->(%p)\n", This, p);
179     return E_NOTIMPL;
180 }
181
182 static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
183 {
184     HTMLDocument *This = HTMLDOC3_THIS(iface);
185     FIXME("(%p)->()\n", This);
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
190 {
191     HTMLDocument *This = HTMLDOC3_THIS(iface);
192     FIXME("(%p)->(%p)\n", This, p);
193     return E_NOTIMPL;
194 }
195
196 static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
197 {
198     HTMLDocument *This = HTMLDOC3_THIS(iface);
199     FIXME("(%p)->()\n", This);
200     return E_NOTIMPL;
201 }
202
203 static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
204 {
205     HTMLDocument *This = HTMLDOC3_THIS(iface);
206     FIXME("(%p)->(%p)\n", This, p);
207     return E_NOTIMPL;
208 }
209
210 static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
211 {
212     HTMLDocument *This = HTMLDOC3_THIS(iface);
213     FIXME("(%p)->()\n", This);
214     return E_NOTIMPL;
215 }
216
217 static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
218 {
219     HTMLDocument *This = HTMLDOC3_THIS(iface);
220     FIXME("(%p)->(%p)\n", This, p);
221     return E_NOTIMPL;
222 }
223
224 static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
225 {
226     HTMLDocument *This = HTMLDOC3_THIS(iface);
227     FIXME("(%p)->()\n", This);
228     return E_NOTIMPL;
229 }
230
231 static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
232 {
233     HTMLDocument *This = HTMLDOC3_THIS(iface);
234     FIXME("(%p)->(%p)\n", This, p);
235     return E_NOTIMPL;
236 }
237
238 static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
239 {
240     HTMLDocument *This = HTMLDOC3_THIS(iface);
241     FIXME("(%p)->()\n", This);
242     return E_NOTIMPL;
243 }
244
245 static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
246 {
247     HTMLDocument *This = HTMLDOC3_THIS(iface);
248     FIXME("(%p)->(%p)\n", This, p);
249     return E_NOTIMPL;
250 }
251
252 static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
253 {
254     HTMLDocument *This = HTMLDOC3_THIS(iface);
255     FIXME("(%p)->()\n", This);
256     return E_NOTIMPL;
257 }
258
259 static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
260 {
261     HTMLDocument *This = HTMLDOC3_THIS(iface);
262     FIXME("(%p)->(%p)\n", This, p);
263     return E_NOTIMPL;
264 }
265
266 static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
267 {
268     HTMLDocument *This = HTMLDOC3_THIS(iface);
269     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
270     return E_NOTIMPL;
271 }
272
273 static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
274 {
275     HTMLDocument *This = HTMLDOC3_THIS(iface);
276     FIXME("(%p)->(%p)\n", This, p);
277     return E_NOTIMPL;
278 }
279
280 static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
281 {
282     HTMLDocument *This = HTMLDOC3_THIS(iface);
283     FIXME("(%p)->()\n", This);
284     return E_NOTIMPL;
285 }
286
287 static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
288 {
289     HTMLDocument *This = HTMLDOC3_THIS(iface);
290     FIXME("(%p)->(%p)\n", This, p);
291     return E_NOTIMPL;
292 }
293
294 static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
295 {
296     HTMLDocument *This = HTMLDOC3_THIS(iface);
297     FIXME("(%p)->()\n", This);
298     return E_NOTIMPL;
299 }
300
301 static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
302 {
303     HTMLDocument *This = HTMLDOC3_THIS(iface);
304     FIXME("(%p)->(%p)\n", This, p);
305     return E_NOTIMPL;
306 }
307
308 static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
309                                                            IHTMLDocument2 **ppNewDoc)
310 {
311     HTMLDocument *This = HTMLDOC3_THIS(iface);
312     FIXME("(%p)->(%p)\n", This, ppNewDoc);
313     return E_NOTIMPL;
314 }
315
316 static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
317                                                        IHTMLDocument2 **p)
318 {
319     HTMLDocument *This = HTMLDOC3_THIS(iface);
320     FIXME("(%p)->(%p)\n", This, p);
321     return E_NOTIMPL;
322 }
323
324 static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
325                                                        VARIANT_BOOL v)
326 {
327     HTMLDocument *This = HTMLDOC3_THIS(iface);
328     FIXME("(%p)->(%x)\n", This, v);
329     return E_NOTIMPL;
330 }
331
332 static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
333                                                        VARIANT_BOOL *p)
334 {
335     HTMLDocument *This = HTMLDOC3_THIS(iface);
336     FIXME("(%p)->(%p)\n", This, p);
337     return E_NOTIMPL;
338 }
339
340 static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
341 {
342     HTMLDocument *This = HTMLDOC3_THIS(iface);
343     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
344     return E_NOTIMPL;
345 }
346
347 static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
348 {
349     HTMLDocument *This = HTMLDOC3_THIS(iface);
350     FIXME("(%p)->(%p)\n", This, p);
351     return E_NOTIMPL;
352 }
353
354 static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
355 {
356     HTMLDocument *This = HTMLDOC3_THIS(iface);
357     FIXME("(%p)->(%p)\n", This, p);
358     return E_NOTIMPL;
359 }
360
361 static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
362                                                            VARIANT_BOOL v)
363 {
364     HTMLDocument *This = HTMLDOC3_THIS(iface);
365     FIXME("(%p)->()\n", This);
366     return E_NOTIMPL;
367 }
368
369 static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
370                                                            VARIANT_BOOL *p)
371 {
372     HTMLDocument *This = HTMLDOC3_THIS(iface);
373     FIXME("(%p)->(%p)\n", This, p);
374     return E_NOTIMPL;
375 }
376
377 static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
378 {
379     HTMLDocument *This = HTMLDOC3_THIS(iface);
380     FIXME("(%p)->()\n", This);
381     return E_NOTIMPL;
382 }
383
384 static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
385 {
386     HTMLDocument *This = HTMLDOC3_THIS(iface);
387     FIXME("(%p)->(%p)\n", This, p);
388     return E_NOTIMPL;
389 }
390
391 static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
392                                                       IHTMLElementCollection **ppelColl)
393 {
394     HTMLDocument *This = HTMLDOC3_THIS(iface);
395     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
396     return E_NOTIMPL;
397 }
398
399
400 static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
401                                                    IHTMLElement **pel)
402 {
403     HTMLDocument *This = HTMLDOC3_THIS(iface);
404     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
405     return E_NOTIMPL;
406 }
407
408
409 static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
410                                                          IHTMLElementCollection **pelColl)
411 {
412     HTMLDocument *This = HTMLDOC3_THIS(iface);
413     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
414     return E_NOTIMPL;
415 }
416
417 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
418     HTMLDocument3_QueryInterface,
419     HTMLDocument3_AddRef,
420     HTMLDocument3_Release,
421     HTMLDocument3_GetTypeInfoCount,
422     HTMLDocument3_GetTypeInfo,
423     HTMLDocument3_GetIDsOfNames,
424     HTMLDocument3_Invoke,
425     HTMLDocument3_releaseCapture,
426     HTMLDocument3_recalc,
427     HTMLDocument3_createTextNode,
428     HTMLDocument3_get_documentElement,
429     HTMLDocument3_uniqueID,
430     HTMLDocument3_attachEvent,
431     HTMLDocument3_detachEvent,
432     HTMLDocument3_put_onrowsdelete,
433     HTMLDocument3_get_onrowsdelete,
434     HTMLDocument3_put_onrowsinserted,
435     HTMLDocument3_get_onrowsinserted,
436     HTMLDocument3_put_oncellchange,
437     HTMLDocument3_get_oncellchange,
438     HTMLDocument3_put_ondatasetchanged,
439     HTMLDocument3_get_ondatasetchanged,
440     HTMLDocument3_put_ondataavailable,
441     HTMLDocument3_get_ondataavailable,
442     HTMLDocument3_put_ondatasetcomplete,
443     HTMLDocument3_get_ondatasetcomplete,
444     HTMLDocument3_put_onpropertychange,
445     HTMLDocument3_get_onpropertychange,
446     HTMLDocument3_put_dir,
447     HTMLDocument3_get_dir,
448     HTMLDocument3_put_oncontextmenu,
449     HTMLDocument3_get_oncontextmenu,
450     HTMLDocument3_put_onstop,
451     HTMLDocument3_get_onstop,
452     HTMLDocument3_createDocumentFragment,
453     HTMLDocument3_get_parentDocument,
454     HTMLDocument3_put_enableDownload,
455     HTMLDocument3_get_enableDownload,
456     HTMLDocument3_put_baseUrl,
457     HTMLDocument3_get_baseUrl,
458     HTMLDocument3_get_childNodes,
459     HTMLDocument3_put_inheritStyleSheets,
460     HTMLDocument3_get_inheritStyleSheets,
461     HTMLDocument3_put_onbeforeeditfocus,
462     HTMLDocument3_get_onbeforeeditfocus,
463     HTMLDocument3_getElementsByName,
464     HTMLDocument3_getElementById,
465     HTMLDocument3_getElementsByTagName
466 };
467
468 void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
469 {
470     This->lpHTMLDocument3Vtbl = &HTMLDocument3Vtbl;
471 }