2 * Copyright 2005 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
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
34 #include "htmlevent.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
38 #define HTMLDOC3_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument3, iface)
40 static HRESULT WINAPI
HTMLDocument3_QueryInterface(IHTMLDocument3
*iface
,
41 REFIID riid
, void **ppv
)
43 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
44 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
47 static ULONG WINAPI
HTMLDocument3_AddRef(IHTMLDocument3
*iface
)
49 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
50 return IHTMLDocument2_AddRef(HTMLDOC(This
));
53 static ULONG WINAPI
HTMLDocument3_Release(IHTMLDocument3
*iface
)
55 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
56 return IHTMLDocument2_Release(HTMLDOC(This
));
59 static HRESULT WINAPI
HTMLDocument3_GetTypeInfoCount(IHTMLDocument3
*iface
, UINT
*pctinfo
)
61 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
62 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This
), pctinfo
);
65 static HRESULT WINAPI
HTMLDocument3_GetTypeInfo(IHTMLDocument3
*iface
, UINT iTInfo
,
66 LCID lcid
, ITypeInfo
**ppTInfo
)
68 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
69 return IDispatchEx_GetTypeInfo(DISPATCHEX(This
), iTInfo
, lcid
, ppTInfo
);
72 static HRESULT WINAPI
HTMLDocument3_GetIDsOfNames(IHTMLDocument3
*iface
, REFIID riid
,
73 LPOLESTR
*rgszNames
, UINT cNames
,
74 LCID lcid
, DISPID
*rgDispId
)
76 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
77 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
80 static HRESULT WINAPI
HTMLDocument3_Invoke(IHTMLDocument3
*iface
, DISPID dispIdMember
,
81 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
82 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
84 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
85 return IDispatchEx_Invoke(DISPATCHEX(This
), dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
86 pVarResult
, pExcepInfo
, puArgErr
);
89 static HRESULT WINAPI
HTMLDocument3_releaseCapture(IHTMLDocument3
*iface
)
91 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
92 FIXME("(%p)\n", This
);
96 static HRESULT WINAPI
HTMLDocument3_recalc(IHTMLDocument3
*iface
, VARIANT_BOOL fForce
)
98 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
99 FIXME("(%p)->(%x)\n", This
, fForce
);
103 static HRESULT WINAPI
HTMLDocument3_createTextNode(IHTMLDocument3
*iface
, BSTR text
,
104 IHTMLDOMNode
**newTextNode
)
106 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
112 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(text
), newTextNode
);
114 if(!This
->doc_node
->nsdoc
) {
115 WARN("NULL nsdoc\n");
119 nsAString_InitDepend(&text_str
, text
);
120 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->doc_node
->nsdoc
, &text_str
, &nstext
);
121 nsAString_Finish(&text_str
);
122 if(NS_FAILED(nsres
)) {
123 ERR("CreateTextNode failed: %08x\n", nsres
);
127 node
= HTMLDOMTextNode_Create(This
->doc_node
, (nsIDOMNode
*)nstext
);
128 nsIDOMElement_Release(nstext
);
130 *newTextNode
= HTMLDOMNODE(node
);
131 IHTMLDOMNode_AddRef(HTMLDOMNODE(node
));
135 static HRESULT WINAPI
HTMLDocument3_get_documentElement(IHTMLDocument3
*iface
, IHTMLElement
**p
)
137 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
138 nsIDOMElement
*nselem
= NULL
;
142 TRACE("(%p)->(%p)\n", This
, p
);
144 if(This
->window
->readystate
== READYSTATE_UNINITIALIZED
) {
149 if(!This
->doc_node
->nsdoc
) {
150 WARN("NULL nsdoc\n");
154 nsres
= nsIDOMHTMLDocument_GetDocumentElement(This
->doc_node
->nsdoc
, &nselem
);
155 if(NS_FAILED(nsres
)) {
156 ERR("GetDocumentElement failed: %08x\n", nsres
);
161 node
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
);
162 nsIDOMElement_Release(nselem
);
163 IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node
), &IID_IHTMLElement
, (void**)p
);
171 static HRESULT WINAPI
HTMLDocument3_uniqueID(IHTMLDocument3
*iface
, BSTR
*p
)
173 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
174 FIXME("(%p)->(%p)\n", This
, p
);
178 static HRESULT WINAPI
HTMLDocument3_attachEvent(IHTMLDocument3
*iface
, BSTR event
,
179 IDispatch
* pDisp
, VARIANT_BOOL
*pfResult
)
181 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
183 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
185 return attach_event(&This
->doc_node
->node
.event_target
, This
->doc_node
->node
.nsnode
, This
, event
, pDisp
, pfResult
);
188 static HRESULT WINAPI
HTMLDocument3_detachEvent(IHTMLDocument3
*iface
, BSTR event
,
191 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
192 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
196 static HRESULT WINAPI
HTMLDocument3_put_onrowsdelete(IHTMLDocument3
*iface
, VARIANT v
)
198 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
199 FIXME("(%p)->()\n", This
);
203 static HRESULT WINAPI
HTMLDocument3_get_onrowsdelete(IHTMLDocument3
*iface
, VARIANT
*p
)
205 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
206 FIXME("(%p)->(%p)\n", This
, p
);
210 static HRESULT WINAPI
HTMLDocument3_put_onrowsinserted(IHTMLDocument3
*iface
, VARIANT v
)
212 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
213 FIXME("(%p)->()\n", This
);
217 static HRESULT WINAPI
HTMLDocument3_get_onrowsinserted(IHTMLDocument3
*iface
, VARIANT
*p
)
219 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
220 FIXME("(%p)->(%p)\n", This
, p
);
224 static HRESULT WINAPI
HTMLDocument3_put_oncellchange(IHTMLDocument3
*iface
, VARIANT v
)
226 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
227 FIXME("(%p)->()\n", This
);
231 static HRESULT WINAPI
HTMLDocument3_get_oncellchange(IHTMLDocument3
*iface
, VARIANT
*p
)
233 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
234 FIXME("(%p)->(%p)\n", This
, p
);
238 static HRESULT WINAPI
HTMLDocument3_put_ondatasetchanged(IHTMLDocument3
*iface
, VARIANT v
)
240 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
241 FIXME("(%p)->()\n", This
);
245 static HRESULT WINAPI
HTMLDocument3_get_ondatasetchanged(IHTMLDocument3
*iface
, VARIANT
*p
)
247 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
248 FIXME("(%p)->(%p)\n", This
, p
);
252 static HRESULT WINAPI
HTMLDocument3_put_ondataavailable(IHTMLDocument3
*iface
, VARIANT v
)
254 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
255 FIXME("(%p)->()\n", This
);
259 static HRESULT WINAPI
HTMLDocument3_get_ondataavailable(IHTMLDocument3
*iface
, VARIANT
*p
)
261 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
262 FIXME("(%p)->(%p)\n", This
, p
);
266 static HRESULT WINAPI
HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3
*iface
, VARIANT v
)
268 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
269 FIXME("(%p)->()\n", This
);
273 static HRESULT WINAPI
HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3
*iface
, VARIANT
*p
)
275 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
276 FIXME("(%p)->(%p)\n", This
, p
);
280 static HRESULT WINAPI
HTMLDocument3_put_onpropertychange(IHTMLDocument3
*iface
, VARIANT v
)
282 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
283 FIXME("(%p)->()\n", This
);
287 static HRESULT WINAPI
HTMLDocument3_get_onpropertychange(IHTMLDocument3
*iface
, VARIANT
*p
)
289 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
290 FIXME("(%p)->(%p)\n", This
, p
);
294 static HRESULT WINAPI
HTMLDocument3_put_dir(IHTMLDocument3
*iface
, BSTR v
)
296 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
297 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
301 static HRESULT WINAPI
HTMLDocument3_get_dir(IHTMLDocument3
*iface
, BSTR
*p
)
303 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
304 FIXME("(%p)->(%p)\n", This
, p
);
308 static HRESULT WINAPI
HTMLDocument3_put_oncontextmenu(IHTMLDocument3
*iface
, VARIANT v
)
310 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
312 TRACE("(%p)->()\n", This
);
314 return set_doc_event(This
, EVENTID_CONTEXTMENU
, &v
);
317 static HRESULT WINAPI
HTMLDocument3_get_oncontextmenu(IHTMLDocument3
*iface
, VARIANT
*p
)
319 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
321 TRACE("(%p)->(%p)\n", This
, p
);
323 return get_doc_event(This
, EVENTID_CONTEXTMENU
, p
);
326 static HRESULT WINAPI
HTMLDocument3_put_onstop(IHTMLDocument3
*iface
, VARIANT v
)
328 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
329 FIXME("(%p)->()\n", This
);
333 static HRESULT WINAPI
HTMLDocument3_get_onstop(IHTMLDocument3
*iface
, VARIANT
*p
)
335 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
336 FIXME("(%p)->(%p)\n", This
, p
);
340 static HRESULT WINAPI
HTMLDocument3_createDocumentFragment(IHTMLDocument3
*iface
,
341 IHTMLDocument2
**ppNewDoc
)
343 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
344 FIXME("(%p)->(%p)\n", This
, ppNewDoc
);
348 static HRESULT WINAPI
HTMLDocument3_get_parentDocument(IHTMLDocument3
*iface
,
351 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
352 FIXME("(%p)->(%p)\n", This
, p
);
356 static HRESULT WINAPI
HTMLDocument3_put_enableDownload(IHTMLDocument3
*iface
,
359 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
360 FIXME("(%p)->(%x)\n", This
, v
);
364 static HRESULT WINAPI
HTMLDocument3_get_enableDownload(IHTMLDocument3
*iface
,
367 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
368 FIXME("(%p)->(%p)\n", This
, p
);
372 static HRESULT WINAPI
HTMLDocument3_put_baseUrl(IHTMLDocument3
*iface
, BSTR v
)
374 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
375 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
379 static HRESULT WINAPI
HTMLDocument3_get_baseUrl(IHTMLDocument3
*iface
, BSTR
*p
)
381 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
382 FIXME("(%p)->(%p)\n", This
, p
);
386 static HRESULT WINAPI
HTMLDocument3_get_childNodes(IHTMLDocument3
*iface
, IDispatch
**p
)
388 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
389 FIXME("(%p)->(%p)\n", This
, p
);
393 static HRESULT WINAPI
HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3
*iface
,
396 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
397 FIXME("(%p)->()\n", This
);
401 static HRESULT WINAPI
HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3
*iface
,
404 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
405 FIXME("(%p)->(%p)\n", This
, p
);
409 static HRESULT WINAPI
HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3
*iface
, VARIANT v
)
411 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
412 FIXME("(%p)->()\n", This
);
416 static HRESULT WINAPI
HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3
*iface
, VARIANT
*p
)
418 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
419 FIXME("(%p)->(%p)\n", This
, p
);
423 static HRESULT WINAPI
HTMLDocument3_getElementsByName(IHTMLDocument3
*iface
, BSTR v
,
424 IHTMLElementCollection
**ppelColl
)
426 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
427 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), ppelColl
);
432 static HRESULT WINAPI
HTMLDocument3_getElementById(IHTMLDocument3
*iface
, BSTR v
,
435 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
436 nsIDOMElement
*nselem
;
438 nsIDOMNode
*nsnode
, *nsnode_by_id
, *nsnode_by_name
;
439 nsIDOMNodeList
*nsnode_list
;
443 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
445 if(!This
->doc_node
->nsdoc
) {
446 WARN("NULL nsdoc\n");
450 nsAString_InitDepend(&id_str
, v
);
451 /* get element by id attribute */
452 nsres
= nsIDOMHTMLDocument_GetElementById(This
->doc_node
->nsdoc
, &id_str
, &nselem
);
454 ERR("GetElementById failed: %08x\n", nsres
);
455 nsAString_Finish(&id_str
);
458 nsnode_by_id
= (nsIDOMNode
*)nselem
;
460 /* get first element by name attribute */
461 nsres
= nsIDOMHTMLDocument_GetElementsByName(This
->doc_node
->nsdoc
, &id_str
, &nsnode_list
);
462 nsAString_Finish(&id_str
);
464 ERR("getElementsByName failed: %08x\n", nsres
);
466 nsIDOMNode_Release(nsnode_by_id
);
469 nsIDOMNodeList_Item(nsnode_list
, 0, &nsnode_by_name
);
470 nsIDOMNodeList_Release(nsnode_list
);
473 if(nsnode_by_name
&& nsnode_by_id
) {
477 nsres
= nsIDOMNode_QueryInterface(nsnode_by_name
, &IID_nsIDOM3Node
, (void**)&node3
);
478 if(NS_FAILED(nsres
)) {
479 FIXME("failed to get nsIDOM3Node interface: 0x%08x\n", nsres
);
480 nsIDOMNode_Release(nsnode_by_name
);
481 nsIDOMNode_Release(nsnode_by_id
);
485 nsres
= nsIDOM3Node_CompareDocumentPosition(node3
, nsnode_by_id
, &pos
);
486 nsIDOM3Node_Release(node3
);
487 if(NS_FAILED(nsres
)) {
488 FIXME("nsIDOM3Node_CompareDocumentPosition failed: 0x%08x\n", nsres
);
489 nsIDOMNode_Release(nsnode_by_name
);
490 nsIDOMNode_Release(nsnode_by_id
);
494 TRACE("CompareDocumentPosition gave: 0x%x\n", pos
);
495 if(pos
& PRECEDING
|| pos
& CONTAINS
) {
496 nsnode
= nsnode_by_id
;
497 nsIDOMNode_Release(nsnode_by_name
);
499 nsnode
= nsnode_by_name
;
500 nsIDOMNode_Release(nsnode_by_id
);
503 nsnode
= nsnode_by_name
? nsnode_by_name
: nsnode_by_id
;
506 node
= get_node(This
->doc_node
, nsnode
, TRUE
);
507 nsIDOMNode_Release(nsnode
);
509 IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node
), &IID_IHTMLElement
, (void**)pel
);
518 static HRESULT WINAPI
HTMLDocument3_getElementsByTagName(IHTMLDocument3
*iface
, BSTR v
,
519 IHTMLElementCollection
**pelColl
)
521 HTMLDocument
*This
= HTMLDOC3_THIS(iface
);
522 nsIDOMNodeList
*nslist
;
523 nsAString id_str
, ns_str
;
525 static const WCHAR str
[] = {'*',0};
527 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
529 if(!This
->doc_node
->nsdoc
) {
530 WARN("NULL nsdoc\n");
534 nsAString_InitDepend(&id_str
, v
);
535 nsAString_InitDepend(&ns_str
, str
);
536 nsres
= nsIDOMHTMLDocument_GetElementsByTagNameNS(This
->doc_node
->nsdoc
, &ns_str
, &id_str
, &nslist
);
537 nsAString_Finish(&id_str
);
538 nsAString_Finish(&ns_str
);
540 ERR("GetElementByName failed: %08x\n", nsres
);
544 *pelColl
= (IHTMLElementCollection
*)create_collection_from_nodelist(This
->doc_node
, (IUnknown
*)HTMLDOC3(This
), nslist
);
545 nsIDOMNodeList_Release(nslist
);
552 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl
= {
553 HTMLDocument3_QueryInterface
,
554 HTMLDocument3_AddRef
,
555 HTMLDocument3_Release
,
556 HTMLDocument3_GetTypeInfoCount
,
557 HTMLDocument3_GetTypeInfo
,
558 HTMLDocument3_GetIDsOfNames
,
559 HTMLDocument3_Invoke
,
560 HTMLDocument3_releaseCapture
,
561 HTMLDocument3_recalc
,
562 HTMLDocument3_createTextNode
,
563 HTMLDocument3_get_documentElement
,
564 HTMLDocument3_uniqueID
,
565 HTMLDocument3_attachEvent
,
566 HTMLDocument3_detachEvent
,
567 HTMLDocument3_put_onrowsdelete
,
568 HTMLDocument3_get_onrowsdelete
,
569 HTMLDocument3_put_onrowsinserted
,
570 HTMLDocument3_get_onrowsinserted
,
571 HTMLDocument3_put_oncellchange
,
572 HTMLDocument3_get_oncellchange
,
573 HTMLDocument3_put_ondatasetchanged
,
574 HTMLDocument3_get_ondatasetchanged
,
575 HTMLDocument3_put_ondataavailable
,
576 HTMLDocument3_get_ondataavailable
,
577 HTMLDocument3_put_ondatasetcomplete
,
578 HTMLDocument3_get_ondatasetcomplete
,
579 HTMLDocument3_put_onpropertychange
,
580 HTMLDocument3_get_onpropertychange
,
581 HTMLDocument3_put_dir
,
582 HTMLDocument3_get_dir
,
583 HTMLDocument3_put_oncontextmenu
,
584 HTMLDocument3_get_oncontextmenu
,
585 HTMLDocument3_put_onstop
,
586 HTMLDocument3_get_onstop
,
587 HTMLDocument3_createDocumentFragment
,
588 HTMLDocument3_get_parentDocument
,
589 HTMLDocument3_put_enableDownload
,
590 HTMLDocument3_get_enableDownload
,
591 HTMLDocument3_put_baseUrl
,
592 HTMLDocument3_get_baseUrl
,
593 HTMLDocument3_get_childNodes
,
594 HTMLDocument3_put_inheritStyleSheets
,
595 HTMLDocument3_get_inheritStyleSheets
,
596 HTMLDocument3_put_onbeforeeditfocus
,
597 HTMLDocument3_get_onbeforeeditfocus
,
598 HTMLDocument3_getElementsByName
,
599 HTMLDocument3_getElementById
,
600 HTMLDocument3_getElementsByTagName
603 #define HTMLDOC4_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument4, iface)
605 static HRESULT WINAPI
HTMLDocument4_QueryInterface(IHTMLDocument4
*iface
,
606 REFIID riid
, void **ppv
)
608 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
609 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
612 static ULONG WINAPI
HTMLDocument4_AddRef(IHTMLDocument4
*iface
)
614 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
615 return IHTMLDocument2_AddRef(HTMLDOC(This
));
618 static ULONG WINAPI
HTMLDocument4_Release(IHTMLDocument4
*iface
)
620 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
621 return IHTMLDocument2_Release(HTMLDOC(This
));
624 static HRESULT WINAPI
HTMLDocument4_GetTypeInfoCount(IHTMLDocument4
*iface
, UINT
*pctinfo
)
626 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
627 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This
), pctinfo
);
630 static HRESULT WINAPI
HTMLDocument4_GetTypeInfo(IHTMLDocument4
*iface
, UINT iTInfo
,
631 LCID lcid
, ITypeInfo
**ppTInfo
)
633 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
634 return IDispatchEx_GetTypeInfo(DISPATCHEX(This
), iTInfo
, lcid
, ppTInfo
);
637 static HRESULT WINAPI
HTMLDocument4_GetIDsOfNames(IHTMLDocument4
*iface
, REFIID riid
,
638 LPOLESTR
*rgszNames
, UINT cNames
,
639 LCID lcid
, DISPID
*rgDispId
)
641 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
642 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
645 static HRESULT WINAPI
HTMLDocument4_Invoke(IHTMLDocument4
*iface
, DISPID dispIdMember
,
646 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
647 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
649 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
650 return IDispatchEx_Invoke(DISPATCHEX(This
), dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
651 pVarResult
, pExcepInfo
, puArgErr
);
654 static HRESULT WINAPI
HTMLDocument4_focus(IHTMLDocument4
*iface
)
656 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
657 nsIDOMNSHTMLElement
*nselem
;
658 nsIDOMHTMLElement
*nsbody
;
661 TRACE("(%p)->()\n", This
);
663 nsres
= nsIDOMHTMLDocument_GetBody(This
->doc_node
->nsdoc
, &nsbody
);
664 if(NS_FAILED(nsres
) || !nsbody
) {
665 ERR("GetBody failed: %08x\n", nsres
);
669 nsres
= nsIDOMHTMLElement_QueryInterface(nsbody
, &IID_nsIDOMNSHTMLElement
, (void**)&nselem
);
670 nsIDOMHTMLElement_Release(nsbody
);
671 if(NS_FAILED(nsres
)) {
672 ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres
);
676 nsres
= nsIDOMNSHTMLElement_Focus(nselem
);
677 nsIDOMNSHTMLElement_Release(nselem
);
678 if(NS_FAILED(nsres
)) {
679 ERR("Focus failed: %08x\n", nsres
);
686 static HRESULT WINAPI
HTMLDocument4_hasFocus(IHTMLDocument4
*iface
, VARIANT_BOOL
*pfFocus
)
688 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
689 FIXME("(%p)->(%p)\n", This
, pfFocus
);
693 static HRESULT WINAPI
HTMLDocument4_put_onselectionchange(IHTMLDocument4
*iface
, VARIANT v
)
695 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
696 FIXME("(%p)->(v)\n", This
);
700 static HRESULT WINAPI
HTMLDocument4_get_onselectionchange(IHTMLDocument4
*iface
, VARIANT
*p
)
702 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
703 FIXME("(%p)->(%p)\n", This
, p
);
707 static HRESULT WINAPI
HTMLDocument4_get_namespace(IHTMLDocument4
*iface
, IDispatch
**p
)
709 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
710 FIXME("(%p)->(%p)\n", This
, p
);
714 static HRESULT WINAPI
HTMLDocument4_createDocumentFromUrl(IHTMLDocument4
*iface
, BSTR bstrUrl
,
715 BSTR bstrOptions
, IHTMLDocument2
**newDoc
)
717 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
718 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrUrl
), debugstr_w(bstrOptions
), newDoc
);
722 static HRESULT WINAPI
HTMLDocument4_put_media(IHTMLDocument4
*iface
, BSTR v
)
724 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
725 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
729 static HRESULT WINAPI
HTMLDocument4_get_media(IHTMLDocument4
*iface
, BSTR
*p
)
731 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
732 FIXME("(%p)->(%p)\n", This
, p
);
736 static HRESULT WINAPI
HTMLDocument4_createEventObject(IHTMLDocument4
*iface
,
737 VARIANT
*pvarEventObject
, IHTMLEventObj
**ppEventObj
)
739 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
740 FIXME("(%p)->(%p %p)\n", This
, pvarEventObject
, ppEventObj
);
744 static HRESULT WINAPI
HTMLDocument4_fireEvent(IHTMLDocument4
*iface
, BSTR bstrEventName
,
745 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCanceled
)
747 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
748 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrEventName
), pvarEventObject
, pfCanceled
);
752 static HRESULT WINAPI
HTMLDocument4_createRenderStyle(IHTMLDocument4
*iface
, BSTR v
,
753 IHTMLRenderStyle
**ppIHTMLRenderStyle
)
755 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
756 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), ppIHTMLRenderStyle
);
760 static HRESULT WINAPI
HTMLDocument4_put_oncontrolselect(IHTMLDocument4
*iface
, VARIANT v
)
762 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
763 FIXME("(%p)->(v)\n", This
);
767 static HRESULT WINAPI
HTMLDocument4_get_oncontrolselect(IHTMLDocument4
*iface
, VARIANT
*p
)
769 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
770 FIXME("(%p)->(%p)\n", This
, p
);
774 static HRESULT WINAPI
HTMLDocument4_get_URLEncoded(IHTMLDocument4
*iface
, BSTR
*p
)
776 HTMLDocument
*This
= HTMLDOC4_THIS(iface
);
777 FIXME("(%p)->(%p)\n", This
, p
);
783 static const IHTMLDocument4Vtbl HTMLDocument4Vtbl
= {
784 HTMLDocument4_QueryInterface
,
785 HTMLDocument4_AddRef
,
786 HTMLDocument4_Release
,
787 HTMLDocument4_GetTypeInfoCount
,
788 HTMLDocument4_GetTypeInfo
,
789 HTMLDocument4_GetIDsOfNames
,
790 HTMLDocument4_Invoke
,
792 HTMLDocument4_hasFocus
,
793 HTMLDocument4_put_onselectionchange
,
794 HTMLDocument4_get_onselectionchange
,
795 HTMLDocument4_get_namespace
,
796 HTMLDocument4_createDocumentFromUrl
,
797 HTMLDocument4_put_media
,
798 HTMLDocument4_get_media
,
799 HTMLDocument4_createEventObject
,
800 HTMLDocument4_fireEvent
,
801 HTMLDocument4_createRenderStyle
,
802 HTMLDocument4_put_oncontrolselect
,
803 HTMLDocument4_get_oncontrolselect
,
804 HTMLDocument4_get_URLEncoded
807 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*This
)
809 This
->lpHTMLDocument3Vtbl
= &HTMLDocument3Vtbl
;
810 This
->lpHTMLDocument4Vtbl
= &HTMLDocument4Vtbl
;