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
);
37 struct HTMLObjectElement
{
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
.event_target
.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
.event_target
.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
.event_target
.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
.event_target
.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
);
168 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
170 nsAString_InitDepend(&nsstr
, v
);
171 nsres
= nsIDOMHTMLObjectElement_SetName(This
->nsobject
, &nsstr
);
172 nsAString_Finish(&nsstr
);
173 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
176 static HRESULT WINAPI
HTMLObjectElement_get_name(IHTMLObjectElement
*iface
, BSTR
*p
)
178 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
182 TRACE("(%p)->(%p)\n", This
, p
);
184 nsAString_Init(&nsstr
, NULL
);
185 nsres
= nsIDOMHTMLObjectElement_GetName(This
->nsobject
, &nsstr
);
186 return return_nsstr(nsres
, &nsstr
, p
);
189 static HRESULT WINAPI
HTMLObjectElement_put_codeBase(IHTMLObjectElement
*iface
, BSTR v
)
191 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
192 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
196 static HRESULT WINAPI
HTMLObjectElement_get_codeBase(IHTMLObjectElement
*iface
, BSTR
*p
)
198 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
199 FIXME("(%p)->(%p)\n", This
, p
);
203 static HRESULT WINAPI
HTMLObjectElement_put_codeType(IHTMLObjectElement
*iface
, BSTR v
)
205 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
206 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
210 static HRESULT WINAPI
HTMLObjectElement_get_codeType(IHTMLObjectElement
*iface
, BSTR
*p
)
212 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
213 FIXME("(%p)->(%p)\n", This
, p
);
217 static HRESULT WINAPI
HTMLObjectElement_put_code(IHTMLObjectElement
*iface
, BSTR v
)
219 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
220 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
224 static HRESULT WINAPI
HTMLObjectElement_get_code(IHTMLObjectElement
*iface
, BSTR
*p
)
226 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
227 FIXME("(%p)->(%p)\n", This
, p
);
231 static HRESULT WINAPI
HTMLObjectElement_get_BaseHref(IHTMLObjectElement
*iface
, BSTR
*p
)
233 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
234 FIXME("(%p)->(%p)\n", This
, p
);
238 static HRESULT WINAPI
HTMLObjectElement_put_type(IHTMLObjectElement
*iface
, BSTR v
)
240 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
241 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
245 static HRESULT WINAPI
HTMLObjectElement_get_type(IHTMLObjectElement
*iface
, BSTR
*p
)
247 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
248 FIXME("(%p)->(%p)\n", This
, p
);
252 static HRESULT WINAPI
HTMLObjectElement_get_form(IHTMLObjectElement
*iface
, IHTMLFormElement
**p
)
254 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
255 FIXME("(%p)->(%p)\n", This
, p
);
259 static HRESULT WINAPI
HTMLObjectElement_put_width(IHTMLObjectElement
*iface
, VARIANT v
)
261 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
266 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
270 swprintf(buf
, ARRAY_SIZE(buf
), L
"%d", V_I4(&v
));
274 FIXME("unimplemented for arg %s\n", debugstr_variant(&v
));
278 nsAString_InitDepend(&width_str
, buf
);
279 nsres
= nsIDOMHTMLObjectElement_SetWidth(This
->nsobject
, &width_str
);
280 nsAString_Finish(&width_str
);
281 if(NS_FAILED(nsres
)) {
282 FIXME("SetWidth failed: %08x\n", nsres
);
286 notif_container_change(&This
->plugin_container
, DISPID_UNKNOWN
);
290 static HRESULT WINAPI
HTMLObjectElement_get_width(IHTMLObjectElement
*iface
, VARIANT
*p
)
292 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
297 TRACE("(%p)->(%p)\n", This
, p
);
299 nsAString_Init(&width_str
, NULL
);
300 nsres
= nsIDOMHTMLObjectElement_GetWidth(This
->nsobject
, &width_str
);
301 if(NS_SUCCEEDED(nsres
)) {
302 const PRUnichar
*width
;
304 nsAString_GetData(&width_str
, &width
);
306 V_BSTR(p
) = SysAllocString(width
);
307 hres
= V_BSTR(p
) ? S_OK
: E_OUTOFMEMORY
;
309 ERR("GetWidth failed: %08x\n", nsres
);
313 nsAString_Finish(&width_str
);
317 static HRESULT WINAPI
HTMLObjectElement_put_height(IHTMLObjectElement
*iface
, VARIANT v
)
319 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
320 nsAString height_str
;
324 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
328 swprintf(buf
, ARRAY_SIZE(buf
), L
"%d", V_I4(&v
));
332 FIXME("unimplemented for arg %s\n", debugstr_variant(&v
));
336 nsAString_InitDepend(&height_str
, buf
);
337 nsres
= nsIDOMHTMLObjectElement_SetHeight(This
->nsobject
, &height_str
);
338 nsAString_Finish(&height_str
);
339 if(NS_FAILED(nsres
)) {
340 FIXME("SetHeight failed: %08x\n", nsres
);
344 notif_container_change(&This
->plugin_container
, DISPID_UNKNOWN
);
348 static HRESULT WINAPI
HTMLObjectElement_get_height(IHTMLObjectElement
*iface
, VARIANT
*p
)
350 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
351 nsAString height_str
;
355 TRACE("(%p)->(%p)\n", This
, p
);
357 nsAString_Init(&height_str
, NULL
);
358 nsres
= nsIDOMHTMLObjectElement_GetHeight(This
->nsobject
, &height_str
);
359 if(NS_SUCCEEDED(nsres
)) {
360 const PRUnichar
*height
;
362 nsAString_GetData(&height_str
, &height
);
364 V_BSTR(p
) = SysAllocString(height
);
365 hres
= V_BSTR(p
) ? S_OK
: E_OUTOFMEMORY
;
367 ERR("GetHeight failed: %08x\n", nsres
);
371 nsAString_Finish(&height_str
);
375 static HRESULT WINAPI
HTMLObjectElement_get_readyState(IHTMLObjectElement
*iface
, LONG
*p
)
377 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
378 FIXME("(%p)->(%p)\n", This
, p
);
382 static HRESULT WINAPI
HTMLObjectElement_put_onreadystatechange(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_onreadystatechange(IHTMLObjectElement
*iface
, VARIANT
*p
)
391 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
392 FIXME("(%p)->(%p)\n", This
, p
);
396 static HRESULT WINAPI
HTMLObjectElement_put_onerror(IHTMLObjectElement
*iface
, VARIANT v
)
398 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
399 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
403 static HRESULT WINAPI
HTMLObjectElement_get_onerror(IHTMLObjectElement
*iface
, VARIANT
*p
)
405 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
406 FIXME("(%p)->(%p)\n", This
, p
);
410 static HRESULT WINAPI
HTMLObjectElement_put_altHtml(IHTMLObjectElement
*iface
, BSTR v
)
412 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
413 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
417 static HRESULT WINAPI
HTMLObjectElement_get_altHtml(IHTMLObjectElement
*iface
, BSTR
*p
)
419 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
420 FIXME("(%p)->(%p)\n", This
, p
);
424 static HRESULT WINAPI
HTMLObjectElement_put_vspace(IHTMLObjectElement
*iface
, LONG v
)
426 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
427 FIXME("(%p)->(%d)\n", This
, v
);
431 static HRESULT WINAPI
HTMLObjectElement_get_vspace(IHTMLObjectElement
*iface
, LONG
*p
)
433 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
436 TRACE("(%p)->(%p)\n", This
, p
);
438 nsres
= nsIDOMHTMLObjectElement_GetVspace(This
->nsobject
, p
);
439 if(NS_FAILED(nsres
)) {
440 ERR("GetVspace failed: %08x\n", nsres
);
447 static HRESULT WINAPI
HTMLObjectElement_put_hspace(IHTMLObjectElement
*iface
, LONG v
)
449 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
450 FIXME("(%p)->(%d)\n", This
, v
);
454 static HRESULT WINAPI
HTMLObjectElement_get_hspace(IHTMLObjectElement
*iface
, LONG
*p
)
456 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement(iface
);
457 FIXME("(%p)->(%p)\n", This
, p
);
461 static const IHTMLObjectElementVtbl HTMLObjectElementVtbl
= {
462 HTMLObjectElement_QueryInterface
,
463 HTMLObjectElement_AddRef
,
464 HTMLObjectElement_Release
,
465 HTMLObjectElement_GetTypeInfoCount
,
466 HTMLObjectElement_GetTypeInfo
,
467 HTMLObjectElement_GetIDsOfNames
,
468 HTMLObjectElement_Invoke
,
469 HTMLObjectElement_get_object
,
470 HTMLObjectElement_get_classid
,
471 HTMLObjectElement_get_data
,
472 HTMLObjectElement_put_recordset
,
473 HTMLObjectElement_get_recordset
,
474 HTMLObjectElement_put_align
,
475 HTMLObjectElement_get_align
,
476 HTMLObjectElement_put_name
,
477 HTMLObjectElement_get_name
,
478 HTMLObjectElement_put_codeBase
,
479 HTMLObjectElement_get_codeBase
,
480 HTMLObjectElement_put_codeType
,
481 HTMLObjectElement_get_codeType
,
482 HTMLObjectElement_put_code
,
483 HTMLObjectElement_get_code
,
484 HTMLObjectElement_get_BaseHref
,
485 HTMLObjectElement_put_type
,
486 HTMLObjectElement_get_type
,
487 HTMLObjectElement_get_form
,
488 HTMLObjectElement_put_width
,
489 HTMLObjectElement_get_width
,
490 HTMLObjectElement_put_height
,
491 HTMLObjectElement_get_height
,
492 HTMLObjectElement_get_readyState
,
493 HTMLObjectElement_put_onreadystatechange
,
494 HTMLObjectElement_get_onreadystatechange
,
495 HTMLObjectElement_put_onerror
,
496 HTMLObjectElement_get_onerror
,
497 HTMLObjectElement_put_altHtml
,
498 HTMLObjectElement_get_altHtml
,
499 HTMLObjectElement_put_vspace
,
500 HTMLObjectElement_get_vspace
,
501 HTMLObjectElement_put_hspace
,
502 HTMLObjectElement_get_hspace
505 static inline HTMLObjectElement
*impl_from_IHTMLObjectElement2(IHTMLObjectElement2
*iface
)
507 return CONTAINING_RECORD(iface
, HTMLObjectElement
, IHTMLObjectElement2_iface
);
510 static HRESULT WINAPI
HTMLObjectElement2_QueryInterface(IHTMLObjectElement2
*iface
,
511 REFIID riid
, void **ppv
)
513 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
515 return IHTMLDOMNode_QueryInterface(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
,
519 static ULONG WINAPI
HTMLObjectElement2_AddRef(IHTMLObjectElement2
*iface
)
521 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
523 return IHTMLDOMNode_AddRef(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
);
526 static ULONG WINAPI
HTMLObjectElement2_Release(IHTMLObjectElement2
*iface
)
528 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
530 return IHTMLDOMNode_Release(&This
->plugin_container
.element
.node
.IHTMLDOMNode_iface
);
533 static HRESULT WINAPI
HTMLObjectElement2_GetTypeInfoCount(IHTMLObjectElement2
*iface
, UINT
*pctinfo
)
535 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
536 return IDispatchEx_GetTypeInfoCount(&This
->plugin_container
.element
.node
.event_target
.dispex
.IDispatchEx_iface
,
540 static HRESULT WINAPI
HTMLObjectElement2_GetTypeInfo(IHTMLObjectElement2
*iface
, UINT iTInfo
,
541 LCID lcid
, ITypeInfo
**ppTInfo
)
543 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
544 return IDispatchEx_GetTypeInfo(&This
->plugin_container
.element
.node
.event_target
.dispex
.IDispatchEx_iface
,
545 iTInfo
, lcid
, ppTInfo
);
548 static HRESULT WINAPI
HTMLObjectElement2_GetIDsOfNames(IHTMLObjectElement2
*iface
, REFIID riid
,
549 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
551 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
552 return IDispatchEx_GetIDsOfNames(&This
->plugin_container
.element
.node
.event_target
.dispex
.IDispatchEx_iface
,
553 riid
, rgszNames
, cNames
, lcid
, rgDispId
);
556 static HRESULT WINAPI
HTMLObjectElement2_Invoke(IHTMLObjectElement2
*iface
, DISPID dispIdMember
,
557 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
558 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
560 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
561 return IDispatchEx_Invoke(&This
->plugin_container
.element
.node
.event_target
.dispex
.IDispatchEx_iface
,
562 dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
565 static HRESULT WINAPI
HTMLObjectElement2_namedRecordset(IHTMLObjectElement2
*iface
, BSTR dataMember
,
566 VARIANT
*hierarchy
, IDispatch
**ppRecordset
)
568 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
569 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(dataMember
), hierarchy
, ppRecordset
);
573 static HRESULT WINAPI
HTMLObjectElement2_put_classid(IHTMLObjectElement2
*iface
, BSTR v
)
575 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
578 FIXME("(%p)->(%s) semi-stub\n", This
, debugstr_w(v
));
580 hres
= elem_string_attr_setter(&This
->plugin_container
.element
, L
"classid", v
);
584 if(This
->plugin_container
.plugin_host
) {
585 FIXME("Host already associated.\n");
591 * If the element is not yet in DOM tree, we should embed it as soon as it's added.
592 * However, Gecko for some reason decides not to create NP plugin in this case,
593 * so this won't work.
596 return create_plugin_host(This
->plugin_container
.element
.node
.doc
, &This
->plugin_container
);
599 static HRESULT WINAPI
HTMLObjectElement2_get_classid(IHTMLObjectElement2
*iface
, BSTR
*p
)
601 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
602 FIXME("(%p)->(%p)\n", This
, p
);
606 static HRESULT WINAPI
HTMLObjectElement2_put_data(IHTMLObjectElement2
*iface
, BSTR v
)
608 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
609 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
613 static HRESULT WINAPI
HTMLObjectElement2_get_data(IHTMLObjectElement2
*iface
, BSTR
*p
)
615 HTMLObjectElement
*This
= impl_from_IHTMLObjectElement2(iface
);
616 FIXME("(%p)->(%p)\n", This
, p
);
620 static const IHTMLObjectElement2Vtbl HTMLObjectElement2Vtbl
= {
621 HTMLObjectElement2_QueryInterface
,
622 HTMLObjectElement2_AddRef
,
623 HTMLObjectElement2_Release
,
624 HTMLObjectElement2_GetTypeInfoCount
,
625 HTMLObjectElement2_GetTypeInfo
,
626 HTMLObjectElement2_GetIDsOfNames
,
627 HTMLObjectElement2_Invoke
,
628 HTMLObjectElement2_namedRecordset
,
629 HTMLObjectElement2_put_classid
,
630 HTMLObjectElement2_get_classid
,
631 HTMLObjectElement2_put_data
,
632 HTMLObjectElement2_get_data
635 static inline HTMLObjectElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
637 return CONTAINING_RECORD(iface
, HTMLObjectElement
, plugin_container
.element
.node
);
640 static HRESULT
HTMLObjectElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
642 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
644 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
646 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
647 *ppv
= &This
->IHTMLObjectElement_iface
;
648 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
649 *ppv
= &This
->IHTMLObjectElement_iface
;
650 }else if(IsEqualGUID(&IID_IHTMLObjectElement
, riid
)) {
651 *ppv
= &This
->IHTMLObjectElement_iface
;
652 }else if(IsEqualGUID(&IID_IHTMLObjectElement2
, riid
)) {
653 *ppv
= &This
->IHTMLObjectElement2_iface
;
654 }else if(IsEqualGUID(&IID_HTMLPluginContainer
, riid
)) {
655 /* Special pseudo-interface returning HTMLPluginContainse struct. */
656 *ppv
= &This
->plugin_container
;
657 node_addref(&This
->plugin_container
.element
.node
);
662 hres
= HTMLElement_QI(&This
->plugin_container
.element
.node
, riid
, ppv
);
663 if(hres
== E_NOINTERFACE
&& This
->plugin_container
.plugin_host
&& This
->plugin_container
.plugin_host
->plugin_unk
) {
664 IUnknown
*plugin_iface
, *ret
;
666 hres
= IUnknown_QueryInterface(This
->plugin_container
.plugin_host
->plugin_unk
, riid
, (void**)&plugin_iface
);
668 hres
= wrap_iface(plugin_iface
, (IUnknown
*)&This
->IHTMLObjectElement_iface
, &ret
);
669 IUnknown_Release(plugin_iface
);
673 TRACE("returning plugin iface %p wrapped to %p\n", plugin_iface
, ret
);
682 IUnknown_AddRef((IUnknown
*)*ppv
);
686 static void HTMLObjectElement_destructor(HTMLDOMNode
*iface
)
688 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
690 if(This
->plugin_container
.plugin_host
)
691 detach_plugin_host(This
->plugin_container
.plugin_host
);
693 HTMLElement_destructor(&This
->plugin_container
.element
.node
);
696 static HRESULT
HTMLObjectElement_get_readystate(HTMLDOMNode
*iface
, BSTR
*p
)
698 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
699 FIXME("(%p)->(%p)\n", This
, p
);
703 static HRESULT
HTMLObjectElement_get_dispid(HTMLDOMNode
*iface
, BSTR name
,
704 DWORD grfdex
, DISPID
*pid
)
706 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
708 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(name
), grfdex
, pid
);
710 return get_plugin_dispid(&This
->plugin_container
, name
, pid
);
713 static HRESULT
HTMLObjectElement_invoke(HTMLDOMNode
*iface
, DISPID id
, LCID lcid
,
714 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
716 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
718 TRACE("(%p)->(%d)\n", This
, id
);
720 return invoke_plugin_prop(&This
->plugin_container
, id
, lcid
, flags
, params
, res
, ei
);
723 static void HTMLObjectElement_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
725 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
728 note_cc_edge((nsISupports
*)This
->nsobject
, "This->nsobject", cb
);
731 static void HTMLObjectElement_unlink(HTMLDOMNode
*iface
)
733 HTMLObjectElement
*This
= impl_from_HTMLDOMNode(iface
);
736 nsIDOMHTMLObjectElement
*nsobject
= This
->nsobject
;
738 This
->nsobject
= NULL
;
739 nsIDOMHTMLObjectElement_Release(nsobject
);
743 static const NodeImplVtbl HTMLObjectElementImplVtbl
= {
744 &CLSID_HTMLObjectElement
,
745 HTMLObjectElement_QI
,
746 HTMLObjectElement_destructor
,
749 HTMLElement_handle_event
,
750 HTMLElement_get_attr_col
,
755 HTMLObjectElement_get_readystate
,
756 HTMLObjectElement_get_dispid
,
757 HTMLObjectElement_invoke
,
759 HTMLObjectElement_traverse
,
760 HTMLObjectElement_unlink
763 static const tid_t HTMLObjectElement_iface_tids
[] = {
764 IHTMLObjectElement2_tid
,
765 IHTMLObjectElement_tid
,
769 static dispex_static_data_t HTMLObjectElement_dispex
= {
771 DispHTMLObjectElement_tid
,
772 HTMLObjectElement_iface_tids
,
773 HTMLElement_init_dispex_info
776 HRESULT
HTMLObjectElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
778 HTMLObjectElement
*ret
;
781 ret
= heap_alloc_zero(sizeof(*ret
));
783 return E_OUTOFMEMORY
;
785 ret
->IHTMLObjectElement_iface
.lpVtbl
= &HTMLObjectElementVtbl
;
786 ret
->IHTMLObjectElement2_iface
.lpVtbl
= &HTMLObjectElement2Vtbl
;
787 ret
->plugin_container
.element
.node
.vtbl
= &HTMLObjectElementImplVtbl
;
789 HTMLElement_Init(&ret
->plugin_container
.element
, doc
, nselem
, &HTMLObjectElement_dispex
);
791 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLObjectElement
, (void**)&ret
->nsobject
);
792 assert(nsres
== NS_OK
);
794 *elem
= &ret
->plugin_container
.element
;
801 IHTMLEmbedElement IHTMLEmbedElement_iface
;
804 static inline HTMLEmbed
*impl_from_IHTMLEmbedElement(IHTMLEmbedElement
*iface
)
806 return CONTAINING_RECORD(iface
, HTMLEmbed
, IHTMLEmbedElement_iface
);
809 static HRESULT WINAPI
HTMLEmbedElement_QueryInterface(IHTMLEmbedElement
*iface
,
810 REFIID riid
, void **ppv
)
812 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
814 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
817 static ULONG WINAPI
HTMLEmbedElement_AddRef(IHTMLEmbedElement
*iface
)
819 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
821 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
824 static ULONG WINAPI
HTMLEmbedElement_Release(IHTMLEmbedElement
*iface
)
826 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
828 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
831 static HRESULT WINAPI
HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement
*iface
, UINT
*pctinfo
)
833 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
834 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
837 static HRESULT WINAPI
HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement
*iface
, UINT iTInfo
,
838 LCID lcid
, ITypeInfo
**ppTInfo
)
840 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
841 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
845 static HRESULT WINAPI
HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement
*iface
, REFIID riid
,
846 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
848 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
849 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
850 cNames
, lcid
, rgDispId
);
853 static HRESULT WINAPI
HTMLEmbedElement_Invoke(IHTMLEmbedElement
*iface
, DISPID dispIdMember
,
854 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
855 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
857 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
858 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
859 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
862 static HRESULT WINAPI
HTMLEmbedElement_put_hidden(IHTMLEmbedElement
*iface
, BSTR v
)
864 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
865 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
869 static HRESULT WINAPI
HTMLEmbedElement_get_hidden(IHTMLEmbedElement
*iface
, BSTR
*p
)
871 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
872 FIXME("(%p)->(%p)\n", This
, p
);
876 static HRESULT WINAPI
HTMLEmbedElement_get_palette(IHTMLEmbedElement
*iface
, BSTR
*p
)
878 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
879 FIXME("(%p)->(%p)\n", This
, p
);
883 static HRESULT WINAPI
HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement
*iface
, BSTR
*p
)
885 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
886 FIXME("(%p)->(%p)\n", This
, p
);
890 static HRESULT WINAPI
HTMLEmbedElement_put_src(IHTMLEmbedElement
*iface
, BSTR v
)
892 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
893 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
897 static HRESULT WINAPI
HTMLEmbedElement_get_src(IHTMLEmbedElement
*iface
, BSTR
*p
)
899 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
900 FIXME("(%p)->(%p)\n", This
, p
);
904 static HRESULT WINAPI
HTMLEmbedElement_put_units(IHTMLEmbedElement
*iface
, BSTR v
)
906 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
907 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
911 static HRESULT WINAPI
HTMLEmbedElement_get_units(IHTMLEmbedElement
*iface
, BSTR
*p
)
913 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
914 FIXME("(%p)->(%p)\n", This
, p
);
918 static HRESULT WINAPI
HTMLEmbedElement_put_name(IHTMLEmbedElement
*iface
, BSTR v
)
920 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
921 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
925 static HRESULT WINAPI
HTMLEmbedElement_get_name(IHTMLEmbedElement
*iface
, BSTR
*p
)
927 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
928 FIXME("(%p)->(%p)\n", This
, p
);
932 static HRESULT WINAPI
HTMLEmbedElement_put_width(IHTMLEmbedElement
*iface
, VARIANT v
)
934 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
935 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
939 static HRESULT WINAPI
HTMLEmbedElement_get_width(IHTMLEmbedElement
*iface
, VARIANT
*p
)
941 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
942 FIXME("(%p)->(%p)\n", This
, p
);
946 static HRESULT WINAPI
HTMLEmbedElement_put_height(IHTMLEmbedElement
*iface
, VARIANT v
)
948 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
949 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
953 static HRESULT WINAPI
HTMLEmbedElement_get_height(IHTMLEmbedElement
*iface
, VARIANT
*p
)
955 HTMLEmbed
*This
= impl_from_IHTMLEmbedElement(iface
);
956 FIXME("(%p)->(%p)\n", This
, p
);
960 static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl
= {
961 HTMLEmbedElement_QueryInterface
,
962 HTMLEmbedElement_AddRef
,
963 HTMLEmbedElement_Release
,
964 HTMLEmbedElement_GetTypeInfoCount
,
965 HTMLEmbedElement_GetTypeInfo
,
966 HTMLEmbedElement_GetIDsOfNames
,
967 HTMLEmbedElement_Invoke
,
968 HTMLEmbedElement_put_hidden
,
969 HTMLEmbedElement_get_hidden
,
970 HTMLEmbedElement_get_palette
,
971 HTMLEmbedElement_get_pluginspage
,
972 HTMLEmbedElement_put_src
,
973 HTMLEmbedElement_get_src
,
974 HTMLEmbedElement_put_units
,
975 HTMLEmbedElement_get_units
,
976 HTMLEmbedElement_put_name
,
977 HTMLEmbedElement_get_name
,
978 HTMLEmbedElement_put_width
,
979 HTMLEmbedElement_get_width
,
980 HTMLEmbedElement_put_height
,
981 HTMLEmbedElement_get_height
984 static inline HTMLEmbed
*embed_from_HTMLDOMNode(HTMLDOMNode
*iface
)
986 return CONTAINING_RECORD(iface
, HTMLEmbed
, element
.node
);
989 static HRESULT
HTMLEmbedElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
991 HTMLEmbed
*This
= embed_from_HTMLDOMNode(iface
);
993 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
995 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
996 *ppv
= &This
->IHTMLEmbedElement_iface
;
997 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
998 *ppv
= &This
->IHTMLEmbedElement_iface
;
999 }else if(IsEqualGUID(&IID_IHTMLEmbedElement
, riid
)) {
1000 *ppv
= &This
->IHTMLEmbedElement_iface
;
1002 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1005 IUnknown_AddRef((IUnknown
*)*ppv
);
1009 static void HTMLEmbedElement_destructor(HTMLDOMNode
*iface
)
1011 HTMLEmbed
*This
= embed_from_HTMLDOMNode(iface
);
1013 HTMLElement_destructor(&This
->element
.node
);
1016 static const NodeImplVtbl HTMLEmbedElementImplVtbl
= {
1018 HTMLEmbedElement_QI
,
1019 HTMLEmbedElement_destructor
,
1022 HTMLElement_handle_event
,
1023 HTMLElement_get_attr_col
1026 static const tid_t HTMLEmbedElement_iface_tids
[] = {
1028 IHTMLEmbedElement_tid
,
1031 static dispex_static_data_t HTMLEmbedElement_dispex
= {
1034 HTMLEmbedElement_iface_tids
,
1035 HTMLElement_init_dispex_info
1038 HRESULT
HTMLEmbedElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
1042 ret
= heap_alloc_zero(sizeof(*ret
));
1044 return E_OUTOFMEMORY
;
1046 ret
->IHTMLEmbedElement_iface
.lpVtbl
= &HTMLEmbedElementVtbl
;
1047 ret
->element
.node
.vtbl
= &HTMLEmbedElementImplVtbl
;
1049 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLEmbedElement_dispex
);
1050 *elem
= &ret
->element
;