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
);
35 struct HTMLGenericElement
{
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(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
53 static ULONG WINAPI
HTMLGenericElement_AddRef(IHTMLGenericElement
*iface
)
55 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
57 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
60 static ULONG WINAPI
HTMLGenericElement_Release(IHTMLGenericElement
*iface
)
62 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
64 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
67 static HRESULT WINAPI
HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement
*iface
, UINT
*pctinfo
)
69 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
70 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, 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(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
81 static HRESULT WINAPI
HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement
*iface
, REFIID riid
,
82 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
84 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
85 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
86 cNames
, lcid
, rgDispId
);
89 static HRESULT WINAPI
HTMLGenericElement_Invoke(IHTMLGenericElement
*iface
, DISPID dispIdMember
,
90 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
91 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
93 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
94 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
95 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
98 static HRESULT WINAPI
HTMLGenericElement_get_recordset(IHTMLGenericElement
*iface
, IDispatch
**p
)
100 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
101 FIXME("(%p)->(%p)\n", This
, p
);
105 static HRESULT WINAPI
HTMLGenericElement_namedRecordset(IHTMLGenericElement
*iface
,
106 BSTR dataMember
, VARIANT
*hierarchy
, IDispatch
**ppRecordset
)
108 HTMLGenericElement
*This
= impl_from_IHTMLGenericElement(iface
);
109 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(dataMember
), hierarchy
, ppRecordset
);
113 static const IHTMLGenericElementVtbl HTMLGenericElementVtbl
= {
114 HTMLGenericElement_QueryInterface
,
115 HTMLGenericElement_AddRef
,
116 HTMLGenericElement_Release
,
117 HTMLGenericElement_GetTypeInfoCount
,
118 HTMLGenericElement_GetTypeInfo
,
119 HTMLGenericElement_GetIDsOfNames
,
120 HTMLGenericElement_Invoke
,
121 HTMLGenericElement_get_recordset
,
122 HTMLGenericElement_namedRecordset
125 static inline HTMLGenericElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
127 return CONTAINING_RECORD(iface
, HTMLGenericElement
, element
.node
);
130 static HRESULT
HTMLGenericElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
132 HTMLGenericElement
*This
= impl_from_HTMLDOMNode(iface
);
136 if(IsEqualGUID(&IID_IHTMLGenericElement
, riid
)) {
137 TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This
, ppv
);
138 *ppv
= &This
->IHTMLGenericElement_iface
;
140 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
143 IUnknown_AddRef((IUnknown
*)*ppv
);
147 static void HTMLGenericElement_destructor(HTMLDOMNode
*iface
)
149 HTMLGenericElement
*This
= impl_from_HTMLDOMNode(iface
);
151 HTMLElement_destructor(&This
->element
.node
);
154 static const NodeImplVtbl HTMLGenericElementImplVtbl
= {
155 &CLSID_HTMLGenericElement
,
156 HTMLGenericElement_QI
,
157 HTMLGenericElement_destructor
,
160 HTMLElement_handle_event
,
161 HTMLElement_get_attr_col
164 static const tid_t HTMLGenericElement_iface_tids
[] = {
166 IHTMLGenericElement_tid
,
170 static dispex_static_data_t HTMLGenericElement_dispex
= {
172 DispHTMLGenericElement_tid
,
173 HTMLGenericElement_iface_tids
,
174 HTMLElement_init_dispex_info
177 HRESULT
HTMLGenericElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
179 HTMLGenericElement
*ret
;
181 ret
= heap_alloc_zero(sizeof(HTMLGenericElement
));
183 return E_OUTOFMEMORY
;
185 ret
->IHTMLGenericElement_iface
.lpVtbl
= &HTMLGenericElementVtbl
;
186 ret
->element
.node
.vtbl
= &HTMLGenericElementImplVtbl
;
188 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLGenericElement_dispex
);
190 *elem
= &ret
->element
;