2 * Copyright 2010 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
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "pluginhost.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 HTMLPluginContainer plugin_container;
40 IHTMLObjectElement IHTMLObjectElement_iface;
41 IHTMLObjectElement2 IHTMLObjectElement2_iface;
43 nsIDOMHTMLObjectElement *nsobject;
46 static inline HTMLObjectElement *impl_from_IHTMLObjectElement(IHTMLObjectElement *iface)
48 return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement_iface);
51 static HRESULT WINAPI HTMLObjectElement_QueryInterface(IHTMLObjectElement *iface,
52 REFIID riid, void **ppv)
54 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
56 return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
60 static ULONG WINAPI HTMLObjectElement_AddRef(IHTMLObjectElement *iface)
62 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
64 return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
67 static ULONG WINAPI HTMLObjectElement_Release(IHTMLObjectElement *iface)
69 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
71 return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
74 static HRESULT WINAPI HTMLObjectElement_GetTypeInfoCount(IHTMLObjectElement *iface, UINT *pctinfo)
76 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
77 return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
81 static HRESULT WINAPI HTMLObjectElement_GetTypeInfo(IHTMLObjectElement *iface, UINT iTInfo,
82 LCID lcid, ITypeInfo **ppTInfo)
84 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
85 return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
86 iTInfo, lcid, ppTInfo);
89 static HRESULT WINAPI HTMLObjectElement_GetIDsOfNames(IHTMLObjectElement *iface, REFIID riid,
90 LPOLESTR *rgszNames, UINT cNames,
91 LCID lcid, DISPID *rgDispId)
93 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
94 return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
95 riid, rgszNames, cNames, lcid, rgDispId);
98 static HRESULT WINAPI HTMLObjectElement_Invoke(IHTMLObjectElement *iface, DISPID dispIdMember,
99 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
100 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
102 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
103 return IDispatchEx_Invoke(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
104 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
107 static HRESULT WINAPI HTMLObjectElement_get_object(IHTMLObjectElement *iface, IDispatch **p)
109 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
111 TRACE("(%p)->(%p)\n", This, p);
113 return get_plugin_disp(&This->plugin_container, p);
116 static HRESULT WINAPI HTMLObjectElement_get_classid(IHTMLObjectElement *iface, BSTR *p)
118 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
120 TRACE("(%p)->(%p)\n", This, p);
122 return IHTMLObjectElement2_get_classid(&This->IHTMLObjectElement2_iface, p);
125 static HRESULT WINAPI HTMLObjectElement_get_data(IHTMLObjectElement *iface, BSTR *p)
127 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
129 TRACE("(%p)->(%p)\n", This, p);
131 return IHTMLObjectElement2_get_data(&This->IHTMLObjectElement2_iface, p);
134 static HRESULT WINAPI HTMLObjectElement_put_recordset(IHTMLObjectElement *iface, IDispatch *v)
136 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
137 FIXME("(%p)->(%p)\n", This, v);
141 static HRESULT WINAPI HTMLObjectElement_get_recordset(IHTMLObjectElement *iface, IDispatch **p)
143 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
144 FIXME("(%p)->(%p)\n", This, p);
148 static HRESULT WINAPI HTMLObjectElement_put_align(IHTMLObjectElement *iface, BSTR v)
150 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
151 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
155 static HRESULT WINAPI HTMLObjectElement_get_align(IHTMLObjectElement *iface, BSTR *p)
157 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
158 FIXME("(%p)->(%p)\n", This, p);
162 static HRESULT WINAPI HTMLObjectElement_put_name(IHTMLObjectElement *iface, BSTR v)
164 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
165 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
169 static HRESULT WINAPI HTMLObjectElement_get_name(IHTMLObjectElement *iface, BSTR *p)
171 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
172 FIXME("(%p)->(%p)\n", This, p);
176 static HRESULT WINAPI HTMLObjectElement_put_codeBase(IHTMLObjectElement *iface, BSTR v)
178 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
179 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
183 static HRESULT WINAPI HTMLObjectElement_get_codeBase(IHTMLObjectElement *iface, BSTR *p)
185 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
186 FIXME("(%p)->(%p)\n", This, p);
190 static HRESULT WINAPI HTMLObjectElement_put_codeType(IHTMLObjectElement *iface, BSTR v)
192 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
193 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
197 static HRESULT WINAPI HTMLObjectElement_get_codeType(IHTMLObjectElement *iface, BSTR *p)
199 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
200 FIXME("(%p)->(%p)\n", This, p);
204 static HRESULT WINAPI HTMLObjectElement_put_code(IHTMLObjectElement *iface, BSTR v)
206 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
207 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
211 static HRESULT WINAPI HTMLObjectElement_get_code(IHTMLObjectElement *iface, BSTR *p)
213 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
214 FIXME("(%p)->(%p)\n", This, p);
218 static HRESULT WINAPI HTMLObjectElement_get_BaseHref(IHTMLObjectElement *iface, BSTR *p)
220 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
221 FIXME("(%p)->(%p)\n", This, p);
225 static HRESULT WINAPI HTMLObjectElement_put_type(IHTMLObjectElement *iface, BSTR v)
227 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
228 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
232 static HRESULT WINAPI HTMLObjectElement_get_type(IHTMLObjectElement *iface, BSTR *p)
234 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
235 FIXME("(%p)->(%p)\n", This, p);
239 static HRESULT WINAPI HTMLObjectElement_get_form(IHTMLObjectElement *iface, IHTMLFormElement **p)
241 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
242 FIXME("(%p)->(%p)\n", This, p);
246 static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VARIANT v)
248 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
253 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
257 static const WCHAR formatW[] = {'%','d',0};
258 sprintfW(buf, formatW, V_I4(&v));
262 FIXME("unimplemented for arg %s\n", debugstr_variant(&v));
266 nsAString_InitDepend(&width_str, buf);
267 nsres = nsIDOMHTMLObjectElement_SetWidth(This->nsobject, &width_str);
268 nsAString_Finish(&width_str);
269 if(NS_FAILED(nsres)) {
270 FIXME("SetWidth failed: %08x\n", nsres);
274 notif_container_change(&This->plugin_container, DISPID_UNKNOWN);
278 static HRESULT WINAPI HTMLObjectElement_get_width(IHTMLObjectElement *iface, VARIANT *p)
280 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
285 TRACE("(%p)->(%p)\n", This, p);
287 nsAString_Init(&width_str, NULL);
288 nsres = nsIDOMHTMLObjectElement_GetWidth(This->nsobject, &width_str);
289 if(NS_SUCCEEDED(nsres)) {
290 const PRUnichar *width;
292 nsAString_GetData(&width_str, &width);
294 V_BSTR(p) = SysAllocString(width);
295 hres = V_BSTR(p) ? S_OK : E_OUTOFMEMORY;
297 ERR("GetWidth failed: %08x\n", nsres);
301 nsAString_Finish(&width_str);
305 static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VARIANT v)
307 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
308 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
312 static HRESULT WINAPI HTMLObjectElement_get_height(IHTMLObjectElement *iface, VARIANT *p)
314 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
315 FIXME("(%p)->(%p)\n", This, p);
319 static HRESULT WINAPI HTMLObjectElement_get_readyState(IHTMLObjectElement *iface, LONG *p)
321 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
322 FIXME("(%p)->(%p)\n", This, p);
326 static HRESULT WINAPI HTMLObjectElement_put_onreadystatechange(IHTMLObjectElement *iface, VARIANT v)
328 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
329 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
333 static HRESULT WINAPI HTMLObjectElement_get_onreadystatechange(IHTMLObjectElement *iface, VARIANT *p)
335 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
336 FIXME("(%p)->(%p)\n", This, p);
340 static HRESULT WINAPI HTMLObjectElement_put_onerror(IHTMLObjectElement *iface, VARIANT v)
342 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
343 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
347 static HRESULT WINAPI HTMLObjectElement_get_onerror(IHTMLObjectElement *iface, VARIANT *p)
349 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
350 FIXME("(%p)->(%p)\n", This, p);
354 static HRESULT WINAPI HTMLObjectElement_put_altHtml(IHTMLObjectElement *iface, BSTR v)
356 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
357 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
361 static HRESULT WINAPI HTMLObjectElement_get_altHtml(IHTMLObjectElement *iface, BSTR *p)
363 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
364 FIXME("(%p)->(%p)\n", This, p);
368 static HRESULT WINAPI HTMLObjectElement_put_vspace(IHTMLObjectElement *iface, LONG v)
370 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
371 FIXME("(%p)->(%d)\n", This, v);
375 static HRESULT WINAPI HTMLObjectElement_get_vspace(IHTMLObjectElement *iface, LONG *p)
377 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
381 TRACE("(%p)->(%p)\n", This, p);
383 nsres = nsIDOMHTMLObjectElement_GetVspace(This->nsobject, &vspace);
384 if(NS_FAILED(nsres)) {
385 ERR("GetVspace failed: %08x\n", nsres);
393 static HRESULT WINAPI HTMLObjectElement_put_hspace(IHTMLObjectElement *iface, LONG v)
395 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
396 FIXME("(%p)->(%d)\n", This, v);
400 static HRESULT WINAPI HTMLObjectElement_get_hspace(IHTMLObjectElement *iface, LONG *p)
402 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
403 FIXME("(%p)->(%p)\n", This, p);
407 static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = {
408 HTMLObjectElement_QueryInterface,
409 HTMLObjectElement_AddRef,
410 HTMLObjectElement_Release,
411 HTMLObjectElement_GetTypeInfoCount,
412 HTMLObjectElement_GetTypeInfo,
413 HTMLObjectElement_GetIDsOfNames,
414 HTMLObjectElement_Invoke,
415 HTMLObjectElement_get_object,
416 HTMLObjectElement_get_classid,
417 HTMLObjectElement_get_data,
418 HTMLObjectElement_put_recordset,
419 HTMLObjectElement_get_recordset,
420 HTMLObjectElement_put_align,
421 HTMLObjectElement_get_align,
422 HTMLObjectElement_put_name,
423 HTMLObjectElement_get_name,
424 HTMLObjectElement_put_codeBase,
425 HTMLObjectElement_get_codeBase,
426 HTMLObjectElement_put_codeType,
427 HTMLObjectElement_get_codeType,
428 HTMLObjectElement_put_code,
429 HTMLObjectElement_get_code,
430 HTMLObjectElement_get_BaseHref,
431 HTMLObjectElement_put_type,
432 HTMLObjectElement_get_type,
433 HTMLObjectElement_get_form,
434 HTMLObjectElement_put_width,
435 HTMLObjectElement_get_width,
436 HTMLObjectElement_put_height,
437 HTMLObjectElement_get_height,
438 HTMLObjectElement_get_readyState,
439 HTMLObjectElement_put_onreadystatechange,
440 HTMLObjectElement_get_onreadystatechange,
441 HTMLObjectElement_put_onerror,
442 HTMLObjectElement_get_onerror,
443 HTMLObjectElement_put_altHtml,
444 HTMLObjectElement_get_altHtml,
445 HTMLObjectElement_put_vspace,
446 HTMLObjectElement_get_vspace,
447 HTMLObjectElement_put_hspace,
448 HTMLObjectElement_get_hspace
451 static inline HTMLObjectElement *impl_from_IHTMLObjectElement2(IHTMLObjectElement2 *iface)
453 return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement2_iface);
456 static HRESULT WINAPI HTMLObjectElement2_QueryInterface(IHTMLObjectElement2 *iface,
457 REFIID riid, void **ppv)
459 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
461 return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
465 static ULONG WINAPI HTMLObjectElement2_AddRef(IHTMLObjectElement2 *iface)
467 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
469 return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
472 static ULONG WINAPI HTMLObjectElement2_Release(IHTMLObjectElement2 *iface)
474 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
476 return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
479 static HRESULT WINAPI HTMLObjectElement2_GetTypeInfoCount(IHTMLObjectElement2 *iface, UINT *pctinfo)
481 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
482 return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
486 static HRESULT WINAPI HTMLObjectElement2_GetTypeInfo(IHTMLObjectElement2 *iface, UINT iTInfo,
487 LCID lcid, ITypeInfo **ppTInfo)
489 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
490 return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
491 iTInfo, lcid, ppTInfo);
494 static HRESULT WINAPI HTMLObjectElement2_GetIDsOfNames(IHTMLObjectElement2 *iface, REFIID riid,
495 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
497 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
498 return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
499 riid, rgszNames, cNames, lcid, rgDispId);
502 static HRESULT WINAPI HTMLObjectElement2_Invoke(IHTMLObjectElement2 *iface, DISPID dispIdMember,
503 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
504 EXCEPINFO *pExcepInfo, UINT *puArgErr)
506 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
507 return IDispatchEx_Invoke(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
508 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
511 static HRESULT WINAPI HTMLObjectElement2_namedRecordset(IHTMLObjectElement2 *iface, BSTR dataMember,
512 VARIANT *hierarchy, IDispatch **ppRecordset)
514 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
515 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
519 static HRESULT WINAPI HTMLObjectElement2_put_classid(IHTMLObjectElement2 *iface, BSTR v)
521 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
522 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
526 static HRESULT WINAPI HTMLObjectElement2_get_classid(IHTMLObjectElement2 *iface, BSTR *p)
528 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
529 FIXME("(%p)->(%p)\n", This, p);
533 static HRESULT WINAPI HTMLObjectElement2_put_data(IHTMLObjectElement2 *iface, BSTR v)
535 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
536 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
540 static HRESULT WINAPI HTMLObjectElement2_get_data(IHTMLObjectElement2 *iface, BSTR *p)
542 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
543 FIXME("(%p)->(%p)\n", This, p);
547 static const IHTMLObjectElement2Vtbl HTMLObjectElement2Vtbl = {
548 HTMLObjectElement2_QueryInterface,
549 HTMLObjectElement2_AddRef,
550 HTMLObjectElement2_Release,
551 HTMLObjectElement2_GetTypeInfoCount,
552 HTMLObjectElement2_GetTypeInfo,
553 HTMLObjectElement2_GetIDsOfNames,
554 HTMLObjectElement2_Invoke,
555 HTMLObjectElement2_namedRecordset,
556 HTMLObjectElement2_put_classid,
557 HTMLObjectElement2_get_classid,
558 HTMLObjectElement2_put_data,
559 HTMLObjectElement2_get_data
562 static inline HTMLObjectElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
564 return CONTAINING_RECORD(iface, HTMLObjectElement, plugin_container.element.node);
567 static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
569 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
571 if(IsEqualGUID(&IID_IUnknown, riid)) {
572 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
573 *ppv = &This->IHTMLObjectElement_iface;
574 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
575 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
576 *ppv = &This->IHTMLObjectElement_iface;
577 }else if(IsEqualGUID(&IID_IHTMLObjectElement, riid)) {
578 TRACE("(%p)->(IID_IHTMLObjectElement %p)\n", This, ppv);
579 *ppv = &This->IHTMLObjectElement_iface;
580 }else if(IsEqualGUID(&IID_IHTMLObjectElement2, riid)) {
581 TRACE("(%p)->(IID_IHTMLObjectElement2 %p)\n", This, ppv);
582 *ppv = &This->IHTMLObjectElement2_iface;
583 }else if(IsEqualGUID(&IID_HTMLPluginContainer, riid)) {
584 TRACE("(%p)->(IID_HTMLPluginContainer %p)\n", This, ppv);
585 *ppv = &This->plugin_container;
590 hres = HTMLElement_QI(&This->plugin_container.element.node, riid, ppv);
591 if(hres == E_NOINTERFACE && This->plugin_container.plugin_host && This->plugin_container.plugin_host->plugin_unk) {
592 IUnknown *plugin_iface, *ret;
594 hres = IUnknown_QueryInterface(This->plugin_container.plugin_host->plugin_unk, riid, (void**)&plugin_iface);
596 hres = wrap_iface(plugin_iface, (IUnknown*)&This->IHTMLObjectElement_iface, &ret);
597 IUnknown_Release(plugin_iface);
601 TRACE("returning plugin iface %p wrapped to %p\n", plugin_iface, ret);
610 IUnknown_AddRef((IUnknown*)*ppv);
614 static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
616 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
618 if(This->plugin_container.plugin_host)
619 detach_plugin_host(This->plugin_container.plugin_host);
621 HTMLElement_destructor(&This->plugin_container.element.node);
624 static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
626 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
627 FIXME("(%p)->(%p)\n", This, p);
631 static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name,
632 DWORD grfdex, DISPID *pid)
634 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
636 TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(name), grfdex, pid);
638 return get_plugin_dispid(&This->plugin_container, name, pid);
641 static HRESULT HTMLObjectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
642 WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
644 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
646 TRACE("(%p)->(%d)\n", This, id);
648 return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei);
651 static const NodeImplVtbl HTMLObjectElementImplVtbl = {
652 HTMLObjectElement_QI,
653 HTMLObjectElement_destructor,
655 HTMLElement_get_attr_col,
662 HTMLObjectElement_get_readystate,
663 HTMLObjectElement_get_dispid,
664 HTMLObjectElement_invoke
667 static const tid_t HTMLObjectElement_iface_tids[] = {
669 IHTMLObjectElement_tid,
670 IHTMLObjectElement2_tid,
673 static dispex_static_data_t HTMLObjectElement_dispex = {
675 DispHTMLObjectElement_tid,
677 HTMLObjectElement_iface_tids
680 HRESULT HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
682 HTMLObjectElement *ret;
685 ret = heap_alloc_zero(sizeof(*ret));
687 return E_OUTOFMEMORY;
689 ret->IHTMLObjectElement_iface.lpVtbl = &HTMLObjectElementVtbl;
690 ret->IHTMLObjectElement2_iface.lpVtbl = &HTMLObjectElement2Vtbl;
691 ret->plugin_container.element.node.vtbl = &HTMLObjectElementImplVtbl;
693 HTMLElement_Init(&ret->plugin_container.element, doc, nselem, &HTMLObjectElement_dispex);
695 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
697 /* Share nsobject reference with nsnode */
698 assert(nsres == NS_OK && (nsIDOMNode*)ret->nsobject == ret->plugin_container.element.node.nsnode);
699 nsIDOMNode_Release(ret->plugin_container.element.node.nsnode);
701 *elem = &ret->plugin_container.element;