2 * Copyright 2008 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 IHTMLGenericElement IHTMLGenericElement_iface;
41 static inline HTMLGenericElement *impl_from_IHTMLGenericElement(IHTMLGenericElement *iface)
43 return CONTAINING_RECORD(iface, HTMLGenericElement, IHTMLGenericElement_iface);
46 static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
48 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
50 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
53 static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
55 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
57 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
60 static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
62 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
64 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
67 static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
69 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
70 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
73 static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
74 LCID lcid, ITypeInfo **ppTInfo)
76 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
77 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
80 static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
81 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
83 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
84 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
87 static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember,
88 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
89 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
91 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
92 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
93 pVarResult, pExcepInfo, puArgErr);
96 static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
98 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
99 FIXME("(%p)->(%p)\n", This, p);
103 static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface,
104 BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
106 HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
107 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
111 static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = {
112 HTMLGenericElement_QueryInterface,
113 HTMLGenericElement_AddRef,
114 HTMLGenericElement_Release,
115 HTMLGenericElement_GetTypeInfoCount,
116 HTMLGenericElement_GetTypeInfo,
117 HTMLGenericElement_GetIDsOfNames,
118 HTMLGenericElement_Invoke,
119 HTMLGenericElement_get_recordset,
120 HTMLGenericElement_namedRecordset
123 #define HTMLGENERIC_NODE_THIS(iface) DEFINE_THIS2(HTMLGenericElement, element.node, iface)
125 static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
127 HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface);
131 if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) {
132 TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv);
133 *ppv = &This->IHTMLGenericElement_iface;
135 return HTMLElement_QI(&This->element.node, riid, ppv);
138 IUnknown_AddRef((IUnknown*)*ppv);
142 static void HTMLGenericElement_destructor(HTMLDOMNode *iface)
144 HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface);
146 HTMLElement_destructor(&This->element.node);
149 #undef HTMLGENERIC_NODE_THIS
151 static const NodeImplVtbl HTMLGenericElementImplVtbl = {
152 HTMLGenericElement_QI,
153 HTMLGenericElement_destructor,
157 static const tid_t HTMLGenericElement_iface_tids[] = {
159 IHTMLGenericElement_tid,
163 static dispex_static_data_t HTMLGenericElement_dispex = {
165 DispHTMLGenericElement_tid,
167 HTMLGenericElement_iface_tids
170 HRESULT HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
172 HTMLGenericElement *ret;
174 ret = heap_alloc_zero(sizeof(HTMLGenericElement));
176 return E_OUTOFMEMORY;
178 ret->IHTMLGenericElement_iface.lpVtbl = &HTMLGenericElementVtbl;
179 ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
181 HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);
183 *elem = &ret->element;