mshtml: Added IHTMLWindow2::get_self implementation.
[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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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 %u %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 %u %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)->(%d %s %d %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     nsIDOMDocument *nsdoc;
112     nsIDOMText *nstext;
113     HTMLDOMNode *node;
114     nsAString text_str;
115     nsresult nsres;
116
117     TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
118
119     nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
120
121     nsAString_Init(&text_str, text);
122     nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &nstext);
123     nsAString_Finish(&text_str);
124     nsIDOMDocument_Release(nsdoc);
125     if(NS_FAILED(nsres)) {
126         ERR("CreateTextNode failed: %08x\n", nsres);
127         return E_FAIL;
128     }
129
130     node = HTMLDOMTextNode_Create(This, (nsIDOMNode*)nstext);
131     nsIDOMElement_Release(nstext);
132
133     *newTextNode = HTMLDOMNODE(node);
134     IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
135     return S_OK;
136 }
137
138 static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
139 {
140     HTMLDocument *This = HTMLDOC3_THIS(iface);
141     nsIDOMDocument *nsdoc;
142     HTMLDOMNode *node;
143     nsIDOMElement *nselem = NULL;
144     nsresult nsres;
145
146     TRACE("(%p)->(%p)\n", This, p);
147
148     if(!This->nscontainer) {
149         *p = NULL;
150         return S_OK;
151     }
152
153     nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
154     if(NS_FAILED(nsres))
155         ERR("GetDocument failed: %08x\n", nsres);
156
157     if(nsdoc) {
158         nsres = nsIDOMHTMLDocument_GetDocumentElement(nsdoc, &nselem);
159         if(NS_FAILED(nsres))
160             ERR("GetDocumentElement failed: %08x\n", nsres);
161     }
162     if(nselem) {
163         node = get_node(This, (nsIDOMNode *)nselem, TRUE);
164         nsIDOMDocument_Release(nsdoc);
165
166         IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
167     }else {
168         *p = NULL;
169     }
170
171     return S_OK;
172 }
173
174 static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
175 {
176     HTMLDocument *This = HTMLDOC3_THIS(iface);
177     FIXME("(%p)->(%p)\n", This, p);
178     return E_NOTIMPL;
179 }
180
181 static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
182                                                 IDispatch* pDisp, VARIANT_BOOL *pfResult)
183 {
184     HTMLDocument *This = HTMLDOC3_THIS(iface);
185     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
190                                                 IDispatch *pDisp)
191 {
192     HTMLDocument *This = HTMLDOC3_THIS(iface);
193     FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
194     return E_NOTIMPL;
195 }
196
197 static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
198 {
199     HTMLDocument *This = HTMLDOC3_THIS(iface);
200     FIXME("(%p)->()\n", This);
201     return E_NOTIMPL;
202 }
203
204 static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
205 {
206     HTMLDocument *This = HTMLDOC3_THIS(iface);
207     FIXME("(%p)->(%p)\n", This, p);
208     return E_NOTIMPL;
209 }
210
211 static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
212 {
213     HTMLDocument *This = HTMLDOC3_THIS(iface);
214     FIXME("(%p)->()\n", This);
215     return E_NOTIMPL;
216 }
217
218 static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
219 {
220     HTMLDocument *This = HTMLDOC3_THIS(iface);
221     FIXME("(%p)->(%p)\n", This, p);
222     return E_NOTIMPL;
223 }
224
225 static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
226 {
227     HTMLDocument *This = HTMLDOC3_THIS(iface);
228     FIXME("(%p)->()\n", This);
229     return E_NOTIMPL;
230 }
231
232 static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
233 {
234     HTMLDocument *This = HTMLDOC3_THIS(iface);
235     FIXME("(%p)->(%p)\n", This, p);
236     return E_NOTIMPL;
237 }
238
239 static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
240 {
241     HTMLDocument *This = HTMLDOC3_THIS(iface);
242     FIXME("(%p)->()\n", This);
243     return E_NOTIMPL;
244 }
245
246 static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
247 {
248     HTMLDocument *This = HTMLDOC3_THIS(iface);
249     FIXME("(%p)->(%p)\n", This, p);
250     return E_NOTIMPL;
251 }
252
253 static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
254 {
255     HTMLDocument *This = HTMLDOC3_THIS(iface);
256     FIXME("(%p)->()\n", This);
257     return E_NOTIMPL;
258 }
259
260 static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
261 {
262     HTMLDocument *This = HTMLDOC3_THIS(iface);
263     FIXME("(%p)->(%p)\n", This, p);
264     return E_NOTIMPL;
265 }
266
267 static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
268 {
269     HTMLDocument *This = HTMLDOC3_THIS(iface);
270     FIXME("(%p)->()\n", This);
271     return E_NOTIMPL;
272 }
273
274 static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
275 {
276     HTMLDocument *This = HTMLDOC3_THIS(iface);
277     FIXME("(%p)->(%p)\n", This, p);
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
282 {
283     HTMLDocument *This = HTMLDOC3_THIS(iface);
284     FIXME("(%p)->()\n", This);
285     return E_NOTIMPL;
286 }
287
288 static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
289 {
290     HTMLDocument *This = HTMLDOC3_THIS(iface);
291     FIXME("(%p)->(%p)\n", This, p);
292     return E_NOTIMPL;
293 }
294
295 static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
296 {
297     HTMLDocument *This = HTMLDOC3_THIS(iface);
298     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
299     return E_NOTIMPL;
300 }
301
302 static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
303 {
304     HTMLDocument *This = HTMLDOC3_THIS(iface);
305     FIXME("(%p)->(%p)\n", This, p);
306     return E_NOTIMPL;
307 }
308
309 static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
310 {
311     HTMLDocument *This = HTMLDOC3_THIS(iface);
312     FIXME("(%p)->()\n", This);
313     return E_NOTIMPL;
314 }
315
316 static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
317 {
318     HTMLDocument *This = HTMLDOC3_THIS(iface);
319     FIXME("(%p)->(%p)\n", This, p);
320     return E_NOTIMPL;
321 }
322
323 static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
324 {
325     HTMLDocument *This = HTMLDOC3_THIS(iface);
326     FIXME("(%p)->()\n", This);
327     return E_NOTIMPL;
328 }
329
330 static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
331 {
332     HTMLDocument *This = HTMLDOC3_THIS(iface);
333     FIXME("(%p)->(%p)\n", This, p);
334     return E_NOTIMPL;
335 }
336
337 static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
338                                                            IHTMLDocument2 **ppNewDoc)
339 {
340     HTMLDocument *This = HTMLDOC3_THIS(iface);
341     FIXME("(%p)->(%p)\n", This, ppNewDoc);
342     return E_NOTIMPL;
343 }
344
345 static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
346                                                        IHTMLDocument2 **p)
347 {
348     HTMLDocument *This = HTMLDOC3_THIS(iface);
349     FIXME("(%p)->(%p)\n", This, p);
350     return E_NOTIMPL;
351 }
352
353 static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
354                                                        VARIANT_BOOL v)
355 {
356     HTMLDocument *This = HTMLDOC3_THIS(iface);
357     FIXME("(%p)->(%x)\n", This, v);
358     return E_NOTIMPL;
359 }
360
361 static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
362                                                        VARIANT_BOOL *p)
363 {
364     HTMLDocument *This = HTMLDOC3_THIS(iface);
365     FIXME("(%p)->(%p)\n", This, p);
366     return E_NOTIMPL;
367 }
368
369 static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
370 {
371     HTMLDocument *This = HTMLDOC3_THIS(iface);
372     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
373     return E_NOTIMPL;
374 }
375
376 static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
377 {
378     HTMLDocument *This = HTMLDOC3_THIS(iface);
379     FIXME("(%p)->(%p)\n", This, p);
380     return E_NOTIMPL;
381 }
382
383 static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
384 {
385     HTMLDocument *This = HTMLDOC3_THIS(iface);
386     FIXME("(%p)->(%p)\n", This, p);
387     return E_NOTIMPL;
388 }
389
390 static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
391                                                            VARIANT_BOOL v)
392 {
393     HTMLDocument *This = HTMLDOC3_THIS(iface);
394     FIXME("(%p)->()\n", This);
395     return E_NOTIMPL;
396 }
397
398 static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
399                                                            VARIANT_BOOL *p)
400 {
401     HTMLDocument *This = HTMLDOC3_THIS(iface);
402     FIXME("(%p)->(%p)\n", This, p);
403     return E_NOTIMPL;
404 }
405
406 static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
407 {
408     HTMLDocument *This = HTMLDOC3_THIS(iface);
409     FIXME("(%p)->()\n", This);
410     return E_NOTIMPL;
411 }
412
413 static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
414 {
415     HTMLDocument *This = HTMLDOC3_THIS(iface);
416     FIXME("(%p)->(%p)\n", This, p);
417     return E_NOTIMPL;
418 }
419
420 static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
421                                                       IHTMLElementCollection **ppelColl)
422 {
423     HTMLDocument *This = HTMLDOC3_THIS(iface);
424     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
425     return E_NOTIMPL;
426 }
427
428
429 static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
430                                                    IHTMLElement **pel)
431 {
432     HTMLDocument *This = HTMLDOC3_THIS(iface);
433     nsIDOMDocument *nsdoc = NULL;
434     nsIDOMElement *nselem = NULL;
435     HTMLDOMNode *node;
436     nsAString id_str;
437     nsresult nsres;
438
439     TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
440
441     *pel = NULL;
442
443     if(!This->nscontainer)
444         return S_OK;
445
446     nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
447     if(NS_FAILED(nsres) || !nsdoc)
448         return S_OK;
449
450     nsAString_Init(&id_str, v);
451     nsIDOMDocument_GetElementById(nsdoc, &id_str, &nselem);
452     nsIDOMDocument_Release(nsdoc);
453     nsAString_Finish(&id_str);
454
455     if(!nselem) {
456         *pel = NULL;
457         return S_OK;
458     }
459
460     node = get_node(This, (nsIDOMNode*)nselem, TRUE);
461     nsIDOMElement_Release(nselem);
462
463     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)pel);
464 }
465
466
467 static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
468                                                          IHTMLElementCollection **pelColl)
469 {
470     HTMLDocument *This = HTMLDOC3_THIS(iface);
471     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
472     return E_NOTIMPL;
473 }
474
475 #undef HTMLDOC3_THIS
476
477 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
478     HTMLDocument3_QueryInterface,
479     HTMLDocument3_AddRef,
480     HTMLDocument3_Release,
481     HTMLDocument3_GetTypeInfoCount,
482     HTMLDocument3_GetTypeInfo,
483     HTMLDocument3_GetIDsOfNames,
484     HTMLDocument3_Invoke,
485     HTMLDocument3_releaseCapture,
486     HTMLDocument3_recalc,
487     HTMLDocument3_createTextNode,
488     HTMLDocument3_get_documentElement,
489     HTMLDocument3_uniqueID,
490     HTMLDocument3_attachEvent,
491     HTMLDocument3_detachEvent,
492     HTMLDocument3_put_onrowsdelete,
493     HTMLDocument3_get_onrowsdelete,
494     HTMLDocument3_put_onrowsinserted,
495     HTMLDocument3_get_onrowsinserted,
496     HTMLDocument3_put_oncellchange,
497     HTMLDocument3_get_oncellchange,
498     HTMLDocument3_put_ondatasetchanged,
499     HTMLDocument3_get_ondatasetchanged,
500     HTMLDocument3_put_ondataavailable,
501     HTMLDocument3_get_ondataavailable,
502     HTMLDocument3_put_ondatasetcomplete,
503     HTMLDocument3_get_ondatasetcomplete,
504     HTMLDocument3_put_onpropertychange,
505     HTMLDocument3_get_onpropertychange,
506     HTMLDocument3_put_dir,
507     HTMLDocument3_get_dir,
508     HTMLDocument3_put_oncontextmenu,
509     HTMLDocument3_get_oncontextmenu,
510     HTMLDocument3_put_onstop,
511     HTMLDocument3_get_onstop,
512     HTMLDocument3_createDocumentFragment,
513     HTMLDocument3_get_parentDocument,
514     HTMLDocument3_put_enableDownload,
515     HTMLDocument3_get_enableDownload,
516     HTMLDocument3_put_baseUrl,
517     HTMLDocument3_get_baseUrl,
518     HTMLDocument3_get_childNodes,
519     HTMLDocument3_put_inheritStyleSheets,
520     HTMLDocument3_get_inheritStyleSheets,
521     HTMLDocument3_put_onbeforeeditfocus,
522     HTMLDocument3_get_onbeforeeditfocus,
523     HTMLDocument3_getElementsByName,
524     HTMLDocument3_getElementById,
525     HTMLDocument3_getElementsByTagName
526 };
527
528 #define HTMLDOC4_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument4, iface)
529
530 static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
531                                                    REFIID riid, void **ppv)
532 {
533     HTMLDocument *This = HTMLDOC4_THIS(iface);
534     return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
535 }
536
537 static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
538 {
539     HTMLDocument *This = HTMLDOC4_THIS(iface);
540     return IHTMLDocument2_AddRef(HTMLDOC(This));
541 }
542
543 static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
544 {
545     HTMLDocument *This = HTMLDOC4_THIS(iface);
546     return IHTMLDocument2_Release(HTMLDOC(This));
547 }
548
549 static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
550 {
551     HTMLDocument *This = HTMLDOC4_THIS(iface);
552     FIXME("(%p)->(%p)\n", This, pctinfo);
553     return E_NOTIMPL;
554 }
555
556 static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
557                                                 LCID lcid, ITypeInfo **ppTInfo)
558 {
559     HTMLDocument *This = HTMLDOC4_THIS(iface);
560     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
561     return E_NOTIMPL;
562 }
563
564 static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
565                                                 LPOLESTR *rgszNames, UINT cNames,
566                                                 LCID lcid, DISPID *rgDispId)
567 {
568     HTMLDocument *This = HTMLDOC4_THIS(iface);
569     FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
570                                         lcid, rgDispId);
571     return E_NOTIMPL;
572 }
573
574 static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
575                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
576                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
577 {
578     HTMLDocument *This = HTMLDOC4_THIS(iface);
579     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
580             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
581     return E_NOTIMPL;
582 }
583
584 static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
585 {
586     HTMLDocument *This = HTMLDOC4_THIS(iface);
587     FIXME("(%p)->()\n", This);
588     return E_NOTIMPL;
589 }
590
591 static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
592 {
593     HTMLDocument *This = HTMLDOC4_THIS(iface);
594     FIXME("(%p)->(%p)\n", This, pfFocus);
595     return E_NOTIMPL;
596 }
597
598 static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
599 {
600     HTMLDocument *This = HTMLDOC4_THIS(iface);
601     FIXME("(%p)->(v)\n", This);
602     return E_NOTIMPL;
603 }
604
605 static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
606 {
607     HTMLDocument *This = HTMLDOC4_THIS(iface);
608     FIXME("(%p)->(%p)\n", This, p);
609     return E_NOTIMPL;
610 }
611
612 static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
613 {
614     HTMLDocument *This = HTMLDOC4_THIS(iface);
615     FIXME("(%p)->(%p)\n", This, p);
616     return E_NOTIMPL;
617 }
618
619 static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
620         BSTR bstrOptions, IHTMLDocument2 **newDoc)
621 {
622     HTMLDocument *This = HTMLDOC4_THIS(iface);
623     FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
624     return E_NOTIMPL;
625 }
626
627 static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
628 {
629     HTMLDocument *This = HTMLDOC4_THIS(iface);
630     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
631     return E_NOTIMPL;
632 }
633
634 static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
635 {
636     HTMLDocument *This = HTMLDOC4_THIS(iface);
637     FIXME("(%p)->(%p)\n", This, p);
638     return E_NOTIMPL;
639 }
640
641 static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
642         VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
643 {
644     HTMLDocument *This = HTMLDOC4_THIS(iface);
645     FIXME("(%p)->(%p %p)\n", This, pvarEventObject, ppEventObj);
646     return E_NOTIMPL;
647 }
648
649 static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
650         VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
651 {
652     HTMLDocument *This = HTMLDOC4_THIS(iface);
653     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
654     return E_NOTIMPL;
655 }
656
657 static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
658         IHTMLRenderStyle **ppIHTMLRenderStyle)
659 {
660     HTMLDocument *This = HTMLDOC4_THIS(iface);
661     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
662     return E_NOTIMPL;
663 }
664
665 static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
666 {
667     HTMLDocument *This = HTMLDOC4_THIS(iface);
668     FIXME("(%p)->(v)\n", This);
669     return E_NOTIMPL;
670 }
671
672 static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
673 {
674     HTMLDocument *This = HTMLDOC4_THIS(iface);
675     FIXME("(%p)->(%p)\n", This, p);
676     return E_NOTIMPL;
677 }
678
679 static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
680 {
681     HTMLDocument *This = HTMLDOC4_THIS(iface);
682     FIXME("(%p)->(%p)\n", This, p);
683     return E_NOTIMPL;
684 }
685
686 #undef HTMLDOC4_THIS
687
688 static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
689     HTMLDocument4_QueryInterface,
690     HTMLDocument4_AddRef,
691     HTMLDocument4_Release,
692     HTMLDocument4_GetTypeInfoCount,
693     HTMLDocument4_GetTypeInfo,
694     HTMLDocument4_GetIDsOfNames,
695     HTMLDocument4_Invoke,
696     HTMLDocument4_focus,
697     HTMLDocument4_hasFocus,
698     HTMLDocument4_put_onselectionchange,
699     HTMLDocument4_get_onselectionchange,
700     HTMLDocument4_get_namespace,
701     HTMLDocument4_createDocumentFromUrl,
702     HTMLDocument4_put_media,
703     HTMLDocument4_get_media,
704     HTMLDocument4_createEventObject,
705     HTMLDocument4_fireEvent,
706     HTMLDocument4_createRenderStyle,
707     HTMLDocument4_put_oncontrolselect,
708     HTMLDocument4_get_oncontrolselect,
709     HTMLDocument4_get_URLEncoded
710 };
711
712 void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
713 {
714     This->lpHTMLDocument3Vtbl = &HTMLDocument3Vtbl;
715     This->lpHTMLDocument4Vtbl = &HTMLDocument4Vtbl;
716 }