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
19 #include "mshtml_private.h"
22 HTMLPluginContainer plugin_container
;
24 IHTMLObjectElement IHTMLObjectElement_iface
;
25 IHTMLObjectElement2 IHTMLObjectElement2_iface
;
27 nsIDOMHTMLObjectElement
*nsobject
;
30 static inline HTMLObjectElement
*impl_from_IHTMLObjectElement(IHTMLObjectElement
*iface
)
32 return CONTAINING_RECORD(iface
, HTMLObjectElement
, IHTMLObjectElement_iface
);
35 static HRESULT WINAPI
HTMLObjectElement_QueryInterface(IHTMLObjectElement
*iface
,
36 REFIID riid
, void **ppv
)
38 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
40 return IHTMLDOMNode_QueryInterface(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
,
44 static ULONG WINAPI
HTMLObjectElement_AddRef(IHTMLObjectElement
*iface
)
46 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
48 return IHTMLDOMNode_AddRef(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
);
51 static ULONG WINAPI
HTMLObjectElement_Release(IHTMLObjectElement
*iface
)
53 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
55 return IHTMLDOMNode_Release(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
);
58 static HRESULT WINAPI
HTMLObjectElement_GetTypeInfoCount(IHTMLObjectElement
*iface
, UINT
*pctinfo
)
60 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
61 return IDispatchEx_GetTypeInfoCount(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
65 static HRESULT WINAPI
HTMLObjectElement_GetTypeInfo(IHTMLObjectElement
*iface
, UINT iTInfo
,
66 LCID lcid
, ITypeInfo
**ppTInfo
)
68 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
69 return IDispatchEx_GetTypeInfo(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
70 iTInfo
, lcid
, ppTInfo
);
73 static HRESULT WINAPI
HTMLObjectElement_GetIDsOfNames(IHTMLObjectElement
*iface
, REFIID riid
,
74 LPOLESTR
*rgszNames
, UINT cNames
,
75 LCID lcid
, DISPID
*rgDispId
)
77 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
78 return IDispatchEx_GetIDsOfNames(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
79 riid
, rgszNames
, cNames
, lcid
, rgDispId
);
82 static HRESULT WINAPI
HTMLObjectElement_Invoke(IHTMLObjectElement
*iface
, DISPID dispIdMember
,
83 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
84 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
86 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
87 return IDispatchEx_Invoke(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
88 dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
91 static HRESULT WINAPI
HTMLObjectElement_get_object(IHTMLObjectElement
*iface
, IDispatch
**p
)
93 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
95 TRACE("(%p)->(%p)\n", This
, p
);
97 return get_plugin_disp(&This
->plugin_container
, p
);
100 static HRESULT WINAPI
HTMLObjectElement_get_classid(IHTMLObjectElement
*iface
, BSTR
*p
)
102 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
104 TRACE("(%p)->(%p)\n", This
, p
);
106 return IHTMLObjectElement2_get_classid(&This
->IHTMLObjectElement2_iface
, p
);
109 static HRESULT WINAPI
HTMLObjectElement_get_data(IHTMLObjectElement
*iface
, BSTR
*p
)
111 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
113 TRACE("(%p)->(%p)\n", This
, p
);
115 return IHTMLObjectElement2_get_data(&This
->IHTMLObjectElement2_iface
, p
);
118 static HRESULT WINAPI
HTMLObjectElement_put_recordset(IHTMLObjectElement
*iface
, IDispatch
*v
)
120 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
121 FIXME("(%p)->(%p)\n", This
, v
);
125 static HRESULT WINAPI
HTMLObjectElement_get_recordset(IHTMLObjectElement
*iface
, IDispatch
**p
)
127 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
128 FIXME("(%p)->(%p)\n", This
, p
);
132 static HRESULT WINAPI
HTMLObjectElement_put_align(IHTMLObjectElement
*iface
, BSTR v
)
134 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
135 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
139 static HRESULT WINAPI
HTMLObjectElement_get_align(IHTMLObjectElement
*iface
, BSTR
*p
)
141 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
142 FIXME("(%p)->(%p)\n", This
, p
);
146 static HRESULT WINAPI
HTMLObjectElement_put_name(IHTMLObjectElement
*iface
, BSTR v
)
148 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
152 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
154 nsAString_InitDepend(&nsstr
, v
);
155 nsres
= nsIDOMHTMLObjectElement_SetName(This
->nsobject
, &nsstr
);
156 nsAString_Finish(&nsstr
);
157 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
160 static HRESULT WINAPI
HTMLObjectElement_get_name(IHTMLObjectElement
*iface
, BSTR
*p
)
162 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
166 TRACE("(%p)->(%p)\n", This
, p
);
168 nsAString_Init(&nsstr
, NULL
);
169 nsres
= nsIDOMHTMLObjectElement_GetName(This
->nsobject
, &nsstr
);
170 return return_nsstr(nsres
, &nsstr
, p
);
173 static HRESULT WINAPI
HTMLObjectElement_put_codeBase(IHTMLObjectElement
*iface
, BSTR v
)
175 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
176 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
180 static HRESULT WINAPI
HTMLObjectElement_get_codeBase(IHTMLObjectElement
*iface
, BSTR
*p
)
182 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
183 FIXME("(%p)->(%p)\n", This
, p
);
187 static HRESULT WINAPI
HTMLObjectElement_put_codeType(IHTMLObjectElement
*iface
, BSTR v
)
189 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
190 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
194 static HRESULT WINAPI
HTMLObjectElement_get_codeType(IHTMLObjectElement
*iface
, BSTR
*p
)
196 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
197 FIXME("(%p)->(%p)\n", This
, p
);
201 static HRESULT WINAPI
HTMLObjectElement_put_code(IHTMLObjectElement
*iface
, BSTR v
)
203 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
204 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
208 static HRESULT WINAPI
HTMLObjectElement_get_code(IHTMLObjectElement
*iface
, BSTR
*p
)
210 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
211 FIXME("(%p)->(%p)\n", This
, p
);
215 static HRESULT WINAPI
HTMLObjectElement_get_BaseHref(IHTMLObjectElement
*iface
, BSTR
*p
)
217 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
218 FIXME("(%p)->(%p)\n", This
, p
);
222 static HRESULT WINAPI
HTMLObjectElement_put_type(IHTMLObjectElement
*iface
, BSTR v
)
224 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
225 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
229 static HRESULT WINAPI
HTMLObjectElement_get_type(IHTMLObjectElement
*iface
, BSTR
*p
)
231 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
232 FIXME("(%p)->(%p)\n", This
, p
);
236 static HRESULT WINAPI
HTMLObjectElement_get_form(IHTMLObjectElement
*iface
, IHTMLFormElement
**p
)
238 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
239 FIXME("(%p)->(%p)\n", This
, p
);
243 static HRESULT WINAPI
HTMLObjectElement_put_width(IHTMLObjectElement
*iface
, VARIANT v
)
245 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
250 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
254 static const WCHAR formatW
[] = {'%','d',0};
255 sprintfW(buf
, formatW
, V_I4(&v
));
259 FIXME("unimplemented for arg %s\n", debugstr_variant(&v
));
263 nsAString_InitDepend(&width_str
, buf
);
264 nsres
= nsIDOMHTMLObjectElement_SetWidth(This
->nsobject
, &width_str
);
265 nsAString_Finish(&width_str
);
266 if(NS_FAILED(nsres
)) {
267 FIXME("SetWidth failed: %08x\n", nsres
);
271 notif_container_change(&This
->plugin_container
, DISPID_UNKNOWN
);
275 static HRESULT WINAPI
HTMLObjectElement_get_width(IHTMLObjectElement
*iface
, VARIANT
*p
)
277 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
282 TRACE("(%p)->(%p)\n", This
, p
);
284 nsAString_Init(&width_str
, NULL
);
285 nsres
= nsIDOMHTMLObjectElement_GetWidth(This
->nsobject
, &width_str
);
286 if(NS_SUCCEEDED(nsres
)) {
287 const PRUnichar
*width
;
289 nsAString_GetData(&width_str
, &width
);
291 V_BSTR(p
) = SysAllocString(width
);
292 hres
= V_BSTR(p
) ? S_OK
: E_OUTOFMEMORY
;
294 ERR("GetWidth failed: %08x\n", nsres
);
298 nsAString_Finish(&width_str
);
302 static HRESULT WINAPI
HTMLObjectElement_put_height(IHTMLObjectElement
*iface
, VARIANT v
)
304 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
305 nsAString height_str
;
309 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
313 static const WCHAR formatW
[] = {'%','d',0};
314 sprintfW(buf
, formatW
, V_I4(&v
));
318 FIXME("unimplemented for arg %s\n", debugstr_variant(&v
));
322 nsAString_InitDepend(&height_str
, buf
);
323 nsres
= nsIDOMHTMLObjectElement_SetHeight(This
->nsobject
, &height_str
);
324 nsAString_Finish(&height_str
);
325 if(NS_FAILED(nsres
)) {
326 FIXME("SetHeight failed: %08x\n", nsres
);
330 notif_container_change(&This
->plugin_container
, DISPID_UNKNOWN
);
334 static HRESULT WINAPI
HTMLObjectElement_get_height(IHTMLObjectElement
*iface
, VARIANT
*p
)
336 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
337 nsAString height_str
;
341 TRACE("(%p)->(%p)\n", This
, p
);
343 nsAString_Init(&height_str
, NULL
);
344 nsres
= nsIDOMHTMLObjectElement_GetHeight(This
->nsobject
, &height_str
);
345 if(NS_SUCCEEDED(nsres
)) {
346 const PRUnichar
*height
;
348 nsAString_GetData(&height_str
, &height
);
350 V_BSTR(p
) = SysAllocString(height
);
351 hres
= V_BSTR(p
) ? S_OK
: E_OUTOFMEMORY
;
353 ERR("GetHeight failed: %08x\n", nsres
);
357 nsAString_Finish(&height_str
);
361 static HRESULT WINAPI
HTMLObjectElement_get_readyState(IHTMLObjectElement
*iface
, LONG
*p
)
363 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
364 FIXME("(%p)->(%p)\n", This
, p
);
368 static HRESULT WINAPI
HTMLObjectElement_put_onreadystatechange(IHTMLObjectElement
*iface
, VARIANT v
)
370 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
371 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
375 static HRESULT WINAPI
HTMLObjectElement_get_onreadystatechange(IHTMLObjectElement
*iface
, VARIANT
*p
)
377 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
378 FIXME("(%p)->(%p)\n", This
, p
);
382 static HRESULT WINAPI
HTMLObjectElement_put_onerror(IHTMLObjectElement
*iface
, VARIANT v
)
384 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
385 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
389 static HRESULT WINAPI
HTMLObjectElement_get_onerror(IHTMLObjectElement
*iface
, VARIANT
*p
)
391 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
392 FIXME("(%p)->(%p)\n", This
, p
);
396 static HRESULT WINAPI
HTMLObjectElement_put_altHtml(IHTMLObjectElement
*iface
, BSTR v
)
398 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
399 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
403 static HRESULT WINAPI
HTMLObjectElement_get_altHtml(IHTMLObjectElement
*iface
, BSTR
*p
)
405 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
406 FIXME("(%p)->(%p)\n", This
, p
);
410 static HRESULT WINAPI
HTMLObjectElement_put_vspace(IHTMLObjectElement
*iface
, LONG v
)
412 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
413 FIXME("(%p)->(%d)\n", This
, v
);
417 static HRESULT WINAPI
HTMLObjectElement_get_vspace(IHTMLObjectElement
*iface
, LONG
*p
)
419 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
422 TRACE("(%p)->(%p)\n", This
, p
);
424 nsres
= nsIDOMHTMLObjectElement_GetVspace(This
->nsobject
, p
);
425 if(NS_FAILED(nsres
)) {
426 ERR("GetVspace failed: %08x\n", nsres
);
433 static HRESULT WINAPI
HTMLObjectElement_put_hspace(IHTMLObjectElement
*iface
, LONG v
)
435 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
436 FIXME("(%p)->(%d)\n", This
, v
);
440 static HRESULT WINAPI
HTMLObjectElement_get_hspace(IHTMLObjectElement
*iface
, LONG
*p
)
442 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
443 FIXME("(%p)->(%p)\n", This
, p
);
447 static const IHTMLObjectElementVtbl HTMLObjectElementVtbl
= {
448 HTMLObjectElement_QueryInterface
,
449 HTMLObjectElement_AddRef
,
450 HTMLObjectElement_Release
,
451 HTMLObjectElement_GetTypeInfoCount
,
452 HTMLObjectElement_GetTypeInfo
,
453 HTMLObjectElement_GetIDsOfNames
,
454 HTMLObjectElement_Invoke
,
455 HTMLObjectElement_get_object
,
456 HTMLObjectElement_get_classid
,
457 HTMLObjectElement_get_data
,
458 HTMLObjectElement_put_recordset
,
459 HTMLObjectElement_get_recordset
,
460 HTMLObjectElement_put_align
,
461 HTMLObjectElement_get_align
,
462 HTMLObjectElement_put_name
,
463 HTMLObjectElement_get_name
,
464 HTMLObjectElement_put_codeBase
,
465 HTMLObjectElement_get_codeBase
,
466 HTMLObjectElement_put_codeType
,
467 HTMLObjectElement_get_codeType
,
468 HTMLObjectElement_put_code
,
469 HTMLObjectElement_get_code
,
470 HTMLObjectElement_get_BaseHref
,
471 HTMLObjectElement_put_type
,
472 HTMLObjectElement_get_type
,
473 HTMLObjectElement_get_form
,
474 HTMLObjectElement_put_width
,
475 HTMLObjectElement_get_width
,
476 HTMLObjectElement_put_height
,
477 HTMLObjectElement_get_height
,
478 HTMLObjectElement_get_readyState
,
479 HTMLObjectElement_put_onreadystatechange
,
480 HTMLObjectElement_get_onreadystatechange
,
481 HTMLObjectElement_put_onerror
,
482 HTMLObjectElement_get_onerror
,
483 HTMLObjectElement_put_altHtml
,
484 HTMLObjectElement_get_altHtml
,
485 HTMLObjectElement_put_vspace
,
486 HTMLObjectElement_get_vspace
,
487 HTMLObjectElement_put_hspace
,
488 HTMLObjectElement_get_hspace
491 static inline HTMLObjectElement
*impl_from_IHTMLObjectElement2(IHTMLObjectElement2
*iface
)
493 return CONTAINING_RECORD(iface
, HTMLObjectElement
, IHTMLObjectElement2_iface
);
496 static HRESULT WINAPI
HTMLObjectElement2_QueryInterface(IHTMLObjectElement2
*iface
,
497 REFIID riid
, void **ppv
)
499 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
501 return IHTMLDOMNode_QueryInterface(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
,
505 static ULONG WINAPI
HTMLObjectElement2_AddRef(IHTMLObjectElement2
*iface
)
507 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
509 return IHTMLDOMNode_AddRef(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
);
512 static ULONG WINAPI
HTMLObjectElement2_Release(IHTMLObjectElement2
*iface
)
514 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
516 return IHTMLDOMNode_Release(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
);
519 static HRESULT WINAPI
HTMLObjectElement2_GetTypeInfoCount(IHTMLObjectElement2
*iface
, UINT
*pctinfo
)
521 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
522 return IDispatchEx_GetTypeInfoCount(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
526 static HRESULT WINAPI
HTMLObjectElement2_GetTypeInfo(IHTMLObjectElement2
*iface
, UINT iTInfo
,
527 LCID lcid
, ITypeInfo
**ppTInfo
)
529 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
530 return IDispatchEx_GetTypeInfo(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
531 iTInfo
, lcid
, ppTInfo
);
534 static HRESULT WINAPI
HTMLObjectElement2_GetIDsOfNames(IHTMLObjectElement2
*iface
, REFIID riid
,
535 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
537 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
538 return IDispatchEx_GetIDsOfNames(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
539 riid
, rgszNames
, cNames
, lcid
, rgDispId
);
542 static HRESULT WINAPI
HTMLObjectElement2_Invoke(IHTMLObjectElement2
*iface
, DISPID dispIdMember
,
543 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
544 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
546 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
547 return IDispatchEx_Invoke(&This
->plugin_container
.element
.node
.dispex
.IDispatchEx_iface
,
548 dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
551 static HRESULT WINAPI
HTMLObjectElement2_namedRecordset(IHTMLObjectElement2
*iface
, BSTR dataMember
,
552 VARIANT
*hierarchy
, IDispatch
**ppRecordset
)
554 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
555 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(dataMember
), hierarchy
, ppRecordset
);
559 static HRESULT WINAPI
HTMLObjectElement2_put_classid(IHTMLObjectElement2
*iface
, BSTR v
)
561 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
562 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
566 static HRESULT WINAPI
HTMLObjectElement2_get_classid(IHTMLObjectElement2
*iface
, BSTR
*p
)
568 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
569 FIXME("(%p)->(%p)\n", This
, p
);
573 static HRESULT WINAPI
HTMLObjectElement2_put_data(IHTMLObjectElement2
*iface
, BSTR v
)
575 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
576 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
580 static HRESULT WINAPI
HTMLObjectElement2_get_data(IHTMLObjectElement2
*iface
, BSTR
*p
)
582 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
583 FIXME("(%p)->(%p)\n", This
, p
);
587 static const IHTMLObjectElement2Vtbl HTMLObjectElement2Vtbl
= {
588 HTMLObjectElement2_QueryInterface
,
589 HTMLObjectElement2_AddRef
,
590 HTMLObjectElement2_Release
,
591 HTMLObjectElement2_GetTypeInfoCount
,
592 HTMLObjectElement2_GetTypeInfo
,
593 HTMLObjectElement2_GetIDsOfNames
,
594 HTMLObjectElement2_Invoke
,
595 HTMLObjectElement2_namedRecordset
,
596 HTMLObjectElement2_put_classid
,
597 HTMLObjectElement2_get_classid
,
598 HTMLObjectElement2_put_data
,
599 HTMLObjectElement2_get_data
602 static inline HTMLObjectElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
604 return CONTAINING_RECORD(iface
, HTMLObjectElement
, plugin_container
.element
.node
);
607 static HRESULT
HTMLObjectElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
609 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
611 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
612 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
613 *ppv
= &This
->IHTMLObjectElement_iface
;
614 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
615 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
616 *ppv
= &This
->IHTMLObjectElement_iface
;
617 }else if(IsEqualGUID(&IID_IHTMLObjectElement
, riid
)) {
618 TRACE("(%p)->(IID_IHTMLObjectElement %p)\n", This
, ppv
);
619 *ppv
= &This
->IHTMLObjectElement_iface
;
620 }else if(IsEqualGUID(&IID_IHTMLObjectElement2
, riid
)) {
621 TRACE("(%p)->(IID_IHTMLObjectElement2 %p)\n", This
, ppv
);
622 *ppv
= &This
->IHTMLObjectElement2_iface
;
623 }else if(IsEqualGUID(&IID_HTMLPluginContainer
, riid
)) {
624 TRACE("(%p)->(IID_HTMLPluginContainer %p)\n", This
, ppv
);
625 *ppv
= &This
->plugin_container
;
630 hres
= HTMLElement_QI(&This
->plugin_container
.element
.node
, riid
, ppv
);
631 if(hres
== E_NOINTERFACE
&& This
->plugin_container
.plugin_host
&& This
->plugin_container
.plugin_host
->plugin_unk
) {
632 IUnknown
*plugin_iface
, *ret
;
634 hres
= IUnknown_QueryInterface(This
->plugin_container
.plugin_host
->plugin_unk
, riid
, (void**)&plugin_iface
);
636 hres
= wrap_iface(plugin_iface
, (IUnknown
*)&This
->IHTMLObjectElement_iface
, &ret
);
637 IUnknown_Release(plugin_iface
);
641 TRACE("returning plugin iface %p wrapped to %p\n", plugin_iface
, ret
);
650 IUnknown_AddRef((IUnknown
*)*ppv
);
654 static void HTMLObjectElement_destructor(HTMLDOMNode
*iface
)
656 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
658 if(This
->plugin_container
.plugin_host
)
659 detach_plugin_host(This
->plugin_container
.plugin_host
);
661 HTMLElement_destructor(&This
->plugin_container
.element
.node
);
664 static HRESULT
HTMLObjectElement_get_readystate(HTMLDOMNode
*iface
, BSTR
*p
)
666 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
667 FIXME("(%p)->(%p)\n", This
, p
);
671 static HRESULT
HTMLObjectElement_get_dispid(HTMLDOMNode
*iface
, BSTR name
,
672 DWORD grfdex
, DISPID
*pid
)
674 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
676 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(name
), grfdex
, pid
);
678 return get_plugin_dispid(&This
->plugin_container
, name
, pid
);
681 static HRESULT
HTMLObjectElement_invoke(HTMLDOMNode
*iface
, DISPID id
, LCID lcid
,
682 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
684 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
686 TRACE("(%p)->(%d)\n", This
, id
);
688 return invoke_plugin_prop(&This
->plugin_container
, id
, lcid
, flags
, params
, res
, ei
);
691 static const NodeImplVtbl HTMLObjectElementImplVtbl
= {
692 HTMLObjectElement_QI
,
693 HTMLObjectElement_destructor
,
696 HTMLElement_handle_event
,
697 HTMLElement_get_attr_col
,
703 HTMLObjectElement_get_readystate
,
704 HTMLObjectElement_get_dispid
,
705 HTMLObjectElement_invoke
708 static const tid_t HTMLObjectElement_iface_tids
[] = {
710 IHTMLObjectElement_tid
,
711 IHTMLObjectElement2_tid
,
714 static dispex_static_data_t HTMLObjectElement_dispex
= {
716 DispHTMLObjectElement_tid
,
718 HTMLObjectElement_iface_tids
721 HRESULT
HTMLObjectElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
723 HTMLObjectElement
*ret
;
726 ret
= heap_alloc_zero(sizeof(*ret
));
728 return E_OUTOFMEMORY
;
730 ret
->IHTMLObjectElement_iface
.lpVtbl
= &HTMLObjectElementVtbl
;
731 ret
->IHTMLObjectElement2_iface
.lpVtbl
= &HTMLObjectElement2Vtbl
;
732 ret
->plugin_container
.element
.node
.vtbl
= &HTMLObjectElementImplVtbl
;
734 HTMLElement_Init(&ret
->plugin_container
.element
, doc
, nselem
, &HTMLObjectElement_dispex
);
736 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLObjectElement
, (void**)&ret
->nsobject
);
738 /* Share nsobject reference with nsnode */
739 assert(nsres
== NS_OK
&& (nsIDOMNode
*)ret
->nsobject
== ret
->plugin_container
.element
.node
.nsnode
);
740 nsIDOMNode_Release(ret
->plugin_container
.element
.node
.nsnode
);
742 *elem
= &ret
->plugin_container
.element
;