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
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 IHTMLObjectElement IHTMLObjectElement_iface;
40 nsIDOMHTMLObjectElement *nsobject;
43 static inline HTMLObjectElement *impl_from_IHTMLObjectElement(IHTMLObjectElement *iface)
45 return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement_iface);
48 static HRESULT WINAPI HTMLObjectElement_QueryInterface(IHTMLObjectElement *iface,
49 REFIID riid, void **ppv)
51 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
53 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
56 static ULONG WINAPI HTMLObjectElement_AddRef(IHTMLObjectElement *iface)
58 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
60 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
63 static ULONG WINAPI HTMLObjectElement_Release(IHTMLObjectElement *iface)
65 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
67 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
70 static HRESULT WINAPI HTMLObjectElement_GetTypeInfoCount(IHTMLObjectElement *iface, UINT *pctinfo)
72 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
73 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
76 static HRESULT WINAPI HTMLObjectElement_GetTypeInfo(IHTMLObjectElement *iface, UINT iTInfo,
77 LCID lcid, ITypeInfo **ppTInfo)
79 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
80 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
83 static HRESULT WINAPI HTMLObjectElement_GetIDsOfNames(IHTMLObjectElement *iface, REFIID riid,
84 LPOLESTR *rgszNames, UINT cNames,
85 LCID lcid, DISPID *rgDispId)
87 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
88 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
91 static HRESULT WINAPI HTMLObjectElement_Invoke(IHTMLObjectElement *iface, DISPID dispIdMember,
92 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
93 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
95 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
96 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
97 pVarResult, pExcepInfo, puArgErr);
100 static HRESULT WINAPI HTMLObjectElement_get_object(IHTMLObjectElement *iface, IDispatch **p)
102 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
103 FIXME("(%p)->(%p)\n", This, p);
107 static HRESULT WINAPI HTMLObjectElement_get_classid(IHTMLObjectElement *iface, BSTR *p)
109 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
110 FIXME("(%p)->(%p)\n", This, p);
114 static HRESULT WINAPI HTMLObjectElement_get_data(IHTMLObjectElement *iface, BSTR *p)
116 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
117 FIXME("(%p)->(%p)\n", This, p);
121 static HRESULT WINAPI HTMLObjectElement_put_recordset(IHTMLObjectElement *iface, IDispatch *v)
123 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
124 FIXME("(%p)->(%p)\n", This, v);
128 static HRESULT WINAPI HTMLObjectElement_get_recordset(IHTMLObjectElement *iface, IDispatch **p)
130 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
131 FIXME("(%p)->(%p)\n", This, p);
135 static HRESULT WINAPI HTMLObjectElement_put_align(IHTMLObjectElement *iface, BSTR v)
137 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
138 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
142 static HRESULT WINAPI HTMLObjectElement_get_align(IHTMLObjectElement *iface, BSTR *p)
144 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
145 FIXME("(%p)->(%p)\n", This, p);
149 static HRESULT WINAPI HTMLObjectElement_put_name(IHTMLObjectElement *iface, BSTR v)
151 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
152 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
156 static HRESULT WINAPI HTMLObjectElement_get_name(IHTMLObjectElement *iface, BSTR *p)
158 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
159 FIXME("(%p)->(%p)\n", This, p);
163 static HRESULT WINAPI HTMLObjectElement_put_codeBase(IHTMLObjectElement *iface, BSTR v)
165 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
166 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
170 static HRESULT WINAPI HTMLObjectElement_get_codeBase(IHTMLObjectElement *iface, BSTR *p)
172 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
173 FIXME("(%p)->(%p)\n", This, p);
177 static HRESULT WINAPI HTMLObjectElement_put_codeType(IHTMLObjectElement *iface, BSTR v)
179 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
180 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
184 static HRESULT WINAPI HTMLObjectElement_get_codeType(IHTMLObjectElement *iface, BSTR *p)
186 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
187 FIXME("(%p)->(%p)\n", This, p);
191 static HRESULT WINAPI HTMLObjectElement_put_code(IHTMLObjectElement *iface, BSTR v)
193 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
194 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
198 static HRESULT WINAPI HTMLObjectElement_get_code(IHTMLObjectElement *iface, BSTR *p)
200 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
201 FIXME("(%p)->(%p)\n", This, p);
205 static HRESULT WINAPI HTMLObjectElement_get_BaseHref(IHTMLObjectElement *iface, BSTR *p)
207 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
208 FIXME("(%p)->(%p)\n", This, p);
212 static HRESULT WINAPI HTMLObjectElement_put_type(IHTMLObjectElement *iface, BSTR v)
214 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
215 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
219 static HRESULT WINAPI HTMLObjectElement_get_type(IHTMLObjectElement *iface, BSTR *p)
221 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
222 FIXME("(%p)->(%p)\n", This, p);
226 static HRESULT WINAPI HTMLObjectElement_get_form(IHTMLObjectElement *iface, IHTMLFormElement **p)
228 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
229 FIXME("(%p)->(%p)\n", This, p);
233 static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VARIANT v)
235 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
236 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
240 static HRESULT WINAPI HTMLObjectElement_get_width(IHTMLObjectElement *iface, VARIANT *p)
242 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
243 FIXME("(%p)->(%p)\n", This, p);
247 static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VARIANT v)
249 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
250 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
254 static HRESULT WINAPI HTMLObjectElement_get_height(IHTMLObjectElement *iface, VARIANT *p)
256 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
257 FIXME("(%p)->(%p)\n", This, p);
261 static HRESULT WINAPI HTMLObjectElement_get_readyState(IHTMLObjectElement *iface, LONG *p)
263 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
264 FIXME("(%p)->(%p)\n", This, p);
268 static HRESULT WINAPI HTMLObjectElement_put_onreadystatechange(IHTMLObjectElement *iface, VARIANT v)
270 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
271 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
275 static HRESULT WINAPI HTMLObjectElement_get_onreadystatechange(IHTMLObjectElement *iface, VARIANT *p)
277 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
278 FIXME("(%p)->(%p)\n", This, p);
282 static HRESULT WINAPI HTMLObjectElement_put_onerror(IHTMLObjectElement *iface, VARIANT v)
284 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
285 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
289 static HRESULT WINAPI HTMLObjectElement_get_onerror(IHTMLObjectElement *iface, VARIANT *p)
291 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
292 FIXME("(%p)->(%p)\n", This, p);
296 static HRESULT WINAPI HTMLObjectElement_put_altHtml(IHTMLObjectElement *iface, BSTR v)
298 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
299 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
303 static HRESULT WINAPI HTMLObjectElement_get_altHtml(IHTMLObjectElement *iface, BSTR *p)
305 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
306 FIXME("(%p)->(%p)\n", This, p);
310 static HRESULT WINAPI HTMLObjectElement_put_vspace(IHTMLObjectElement *iface, LONG v)
312 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
313 FIXME("(%p)->(%d)\n", This, v);
317 static HRESULT WINAPI HTMLObjectElement_get_vspace(IHTMLObjectElement *iface, LONG *p)
319 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
323 TRACE("(%p)->(%p)\n", This, p);
325 nsres = nsIDOMHTMLObjectElement_GetVspace(This->nsobject, &vspace);
326 if(NS_FAILED(nsres)) {
327 ERR("GetVspace failed: %08x\n", nsres);
335 static HRESULT WINAPI HTMLObjectElement_put_hspace(IHTMLObjectElement *iface, LONG v)
337 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
338 FIXME("(%p)->(%d)\n", This, v);
342 static HRESULT WINAPI HTMLObjectElement_get_hspace(IHTMLObjectElement *iface, LONG *p)
344 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
345 FIXME("(%p)->(%p)\n", This, p);
349 static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = {
350 HTMLObjectElement_QueryInterface,
351 HTMLObjectElement_AddRef,
352 HTMLObjectElement_Release,
353 HTMLObjectElement_GetTypeInfoCount,
354 HTMLObjectElement_GetTypeInfo,
355 HTMLObjectElement_GetIDsOfNames,
356 HTMLObjectElement_Invoke,
357 HTMLObjectElement_get_object,
358 HTMLObjectElement_get_classid,
359 HTMLObjectElement_get_data,
360 HTMLObjectElement_put_recordset,
361 HTMLObjectElement_get_recordset,
362 HTMLObjectElement_put_align,
363 HTMLObjectElement_get_align,
364 HTMLObjectElement_put_name,
365 HTMLObjectElement_get_name,
366 HTMLObjectElement_put_codeBase,
367 HTMLObjectElement_get_codeBase,
368 HTMLObjectElement_put_codeType,
369 HTMLObjectElement_get_codeType,
370 HTMLObjectElement_put_code,
371 HTMLObjectElement_get_code,
372 HTMLObjectElement_get_BaseHref,
373 HTMLObjectElement_put_type,
374 HTMLObjectElement_get_type,
375 HTMLObjectElement_get_form,
376 HTMLObjectElement_put_width,
377 HTMLObjectElement_get_width,
378 HTMLObjectElement_put_height,
379 HTMLObjectElement_get_height,
380 HTMLObjectElement_get_readyState,
381 HTMLObjectElement_put_onreadystatechange,
382 HTMLObjectElement_get_onreadystatechange,
383 HTMLObjectElement_put_onerror,
384 HTMLObjectElement_get_onerror,
385 HTMLObjectElement_put_altHtml,
386 HTMLObjectElement_get_altHtml,
387 HTMLObjectElement_put_vspace,
388 HTMLObjectElement_get_vspace,
389 HTMLObjectElement_put_hspace,
390 HTMLObjectElement_get_hspace
393 #define HTMLOBJECT_NODE_THIS(iface) DEFINE_THIS2(HTMLObjectElement, element.node, iface)
395 static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
397 HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface);
399 if(IsEqualGUID(&IID_IUnknown, riid)) {
400 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
401 *ppv = &This->IHTMLObjectElement_iface;
402 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
403 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
404 *ppv = &This->IHTMLObjectElement_iface;
405 }else if(IsEqualGUID(&IID_IHTMLObjectElement, riid)) {
406 TRACE("(%p)->(IID_IHTMLObjectElement %p)\n", This, ppv);
407 *ppv = &This->IHTMLObjectElement_iface;
409 return HTMLElement_QI(&This->element.node, riid, ppv);
412 IUnknown_AddRef((IUnknown*)*ppv);
416 static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
418 HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface);
421 nsIDOMHTMLObjectElement_Release(This->nsobject);
423 HTMLElement_destructor(&This->element.node);
426 static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
428 HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface);
429 FIXME("(%p)->(%p)\n", This, p);
433 #undef HTMLOBJECT_NODE_THIS
435 static const NodeImplVtbl HTMLObjectElementImplVtbl = {
436 HTMLObjectElement_QI,
437 HTMLObjectElement_destructor,
444 HTMLObjectElement_get_readystate
447 static const tid_t HTMLObjectElement_iface_tids[] = {
449 IHTMLObjectElement_tid,
452 static dispex_static_data_t HTMLObjectElement_dispex = {
454 DispHTMLObjectElement_tid,
456 HTMLObjectElement_iface_tids
459 HRESULT HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
461 HTMLObjectElement *ret;
464 ret = heap_alloc_zero(sizeof(*ret));
466 return E_OUTOFMEMORY;
468 ret->IHTMLObjectElement_iface.lpVtbl = &HTMLObjectElementVtbl;
469 ret->element.node.vtbl = &HTMLObjectElementImplVtbl;
471 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
472 if(NS_FAILED(nsres)) {
473 ERR("Could not get nsIDOMHTMLObjectElement iface: %08x\n", nsres);
478 HTMLElement_Init(&ret->element, doc, nselem, &HTMLObjectElement_dispex);
480 *elem = &ret->element;