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 const IHTMLEmbedElementVtbl *lpIHTMLEmbedElementVtbl;
41 #define HTMLEMBED(x) (&(x)->lpIHTMLEmbedElementVtbl)
43 #define HTMLEMBED_THIS(iface) DEFINE_THIS(HTMLEmbedElement, IHTMLEmbedElement, iface)
45 static HRESULT WINAPI HTMLEmbedElement_QueryInterface(IHTMLEmbedElement *iface,
46 REFIID riid, void **ppv)
48 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
50 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
53 static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
55 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
57 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
60 static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
62 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
64 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
67 static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
69 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
70 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
73 static HRESULT WINAPI HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement *iface, UINT iTInfo,
74 LCID lcid, ITypeInfo **ppTInfo)
76 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
77 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
81 static HRESULT WINAPI HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement *iface, REFIID riid,
82 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
84 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
85 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
86 cNames, lcid, rgDispId);
89 static HRESULT WINAPI HTMLEmbedElement_Invoke(IHTMLEmbedElement *iface, DISPID dispIdMember,
90 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
91 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
93 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
94 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
95 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
98 static HRESULT WINAPI HTMLEmbedElement_put_hidden(IHTMLEmbedElement *iface, BSTR v)
100 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
101 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
105 static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
107 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
108 FIXME("(%p)->(%p)\n", This, p);
112 static HRESULT WINAPI HTMLEmbedElement_get_palete(IHTMLEmbedElement *iface, BSTR *p)
114 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
115 FIXME("(%p)->(%p)\n", This, p);
119 static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
121 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
122 FIXME("(%p)->(%p)\n", This, p);
126 static HRESULT WINAPI HTMLEmbedElement_put_src(IHTMLEmbedElement *iface, BSTR v)
128 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
129 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
133 static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
135 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
136 FIXME("(%p)->(%p)\n", This, p);
140 static HRESULT WINAPI HTMLEmbedElement_put_units(IHTMLEmbedElement *iface, BSTR v)
142 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
143 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
147 static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
149 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, p);
154 static HRESULT WINAPI HTMLEmbedElement_put_name(IHTMLEmbedElement *iface, BSTR v)
156 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
157 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
161 static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
163 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
164 FIXME("(%p)->(%p)\n", This, p);
168 static HRESULT WINAPI HTMLEmbedElement_put_width(IHTMLEmbedElement *iface, VARIANT v)
170 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
171 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
175 static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
177 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
178 FIXME("(%p)->(%p)\n", This, p);
182 static HRESULT WINAPI HTMLEmbedElement_put_height(IHTMLEmbedElement *iface, VARIANT v)
184 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
185 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
189 static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
191 HTMLEmbedElement *This = HTMLEMBED_THIS(iface);
192 FIXME("(%p)->(%p)\n", This, p);
196 #undef HTMLEMBED_THIS
198 static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl = {
199 HTMLEmbedElement_QueryInterface,
200 HTMLEmbedElement_AddRef,
201 HTMLEmbedElement_Release,
202 HTMLEmbedElement_GetTypeInfoCount,
203 HTMLEmbedElement_GetTypeInfo,
204 HTMLEmbedElement_GetIDsOfNames,
205 HTMLEmbedElement_Invoke,
206 HTMLEmbedElement_put_hidden,
207 HTMLEmbedElement_get_hidden,
208 HTMLEmbedElement_get_palete,
209 HTMLEmbedElement_get_pluginspage,
210 HTMLEmbedElement_put_src,
211 HTMLEmbedElement_get_src,
212 HTMLEmbedElement_put_units,
213 HTMLEmbedElement_get_units,
214 HTMLEmbedElement_put_name,
215 HTMLEmbedElement_get_name,
216 HTMLEmbedElement_put_width,
217 HTMLEmbedElement_get_width,
218 HTMLEmbedElement_put_height,
219 HTMLEmbedElement_get_height
222 static inline HTMLEmbedElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
224 return CONTAINING_RECORD(iface, HTMLEmbedElement, element.node);
227 static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
229 HTMLEmbedElement *This = impl_from_HTMLDOMNode(iface);
231 if(IsEqualGUID(&IID_IUnknown, riid)) {
232 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
233 *ppv = HTMLEMBED(This);
234 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
235 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
236 *ppv = HTMLEMBED(This);
237 }else if(IsEqualGUID(&IID_IHTMLEmbedElement, riid)) {
238 TRACE("(%p)->(IID_IHTMLEmbedElement %p)\n", This, ppv);
239 *ppv = HTMLEMBED(This);
241 return HTMLElement_QI(&This->element.node, riid, ppv);
244 IUnknown_AddRef((IUnknown*)*ppv);
248 static void HTMLEmbedElement_destructor(HTMLDOMNode *iface)
250 HTMLEmbedElement *This = impl_from_HTMLDOMNode(iface);
252 HTMLElement_destructor(&This->element.node);
255 static const NodeImplVtbl HTMLEmbedElementImplVtbl = {
257 HTMLEmbedElement_destructor,
261 static const tid_t HTMLEmbedElement_iface_tids[] = {
263 IHTMLEmbedElement_tid,
266 static dispex_static_data_t HTMLEmbedElement_dispex = {
270 HTMLEmbedElement_iface_tids
273 HRESULT HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
275 HTMLEmbedElement *ret;
277 ret = heap_alloc_zero(sizeof(*ret));
279 return E_OUTOFMEMORY;
281 ret->lpIHTMLEmbedElementVtbl = &HTMLEmbedElementVtbl;
282 ret->element.node.vtbl = &HTMLEmbedElementImplVtbl;
284 HTMLElement_Init(&ret->element, doc, nselem, &HTMLEmbedElement_dispex);
285 *elem = &ret->element;