wer: Add new stubbed wer.dll.
[wine/hramrach.git] / dlls / mshtml / htmlgeneric.c
blob82075b8d325331c259fec5180bcf61637531337f
1 /*
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
20 #include <stdarg.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 typedef struct {
36 HTMLElement element;
38 const IHTMLGenericElementVtbl *lpHTMLGenericElementVtbl;
39 } HTMLGenericElement;
41 #define HTMLGENERIC(x) (&(x)->lpHTMLGenericElementVtbl)
43 #define HTMLGENERIC_THIS(iface) DEFINE_THIS(HTMLGenericElement, HTMLGenericElement, iface)
45 static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
47 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
49 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
52 static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
54 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
56 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
59 static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
61 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
63 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
66 static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
68 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
69 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
72 static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
73 LCID lcid, ITypeInfo **ppTInfo)
75 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
76 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
79 static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
80 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
82 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
83 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
86 static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember,
87 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
88 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
90 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
91 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
92 pVarResult, pExcepInfo, puArgErr);
95 static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
97 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
98 FIXME("(%p)->(%p)\n", This, p);
99 return E_NOTIMPL;
102 static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface,
103 BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
105 HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
106 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
107 return E_NOTIMPL;
110 static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = {
111 HTMLGenericElement_QueryInterface,
112 HTMLGenericElement_AddRef,
113 HTMLGenericElement_Release,
114 HTMLGenericElement_GetTypeInfoCount,
115 HTMLGenericElement_GetTypeInfo,
116 HTMLGenericElement_GetIDsOfNames,
117 HTMLGenericElement_Invoke,
118 HTMLGenericElement_get_recordset,
119 HTMLGenericElement_namedRecordset
122 #define HTMLGENERIC_NODE_THIS(iface) DEFINE_THIS2(HTMLGenericElement, element.node, iface)
124 static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
126 HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface);
128 *ppv = NULL;
130 if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) {
131 TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv);
132 *ppv = HTMLGENERIC(This);
133 }else {
134 return HTMLElement_QI(&This->element.node, riid, ppv);
137 IUnknown_AddRef((IUnknown*)*ppv);
138 return S_OK;
141 static void HTMLGenericElement_destructor(HTMLDOMNode *iface)
143 HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface);
145 HTMLElement_destructor(&This->element.node);
148 #undef HTMLGENERIC_NODE_THIS
150 static const NodeImplVtbl HTMLGenericElementImplVtbl = {
151 HTMLGenericElement_QI,
152 HTMLGenericElement_destructor
155 static const tid_t HTMLGenericElement_iface_tids[] = {
156 HTMLELEMENT_TIDS,
157 IHTMLGenericElement_tid,
161 static dispex_static_data_t HTMLGenericElement_dispex = {
162 NULL,
163 DispHTMLGenericElement_tid,
164 NULL,
165 HTMLGenericElement_iface_tids
168 HTMLElement *HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
170 HTMLGenericElement *ret;
172 ret = heap_alloc_zero(sizeof(HTMLGenericElement));
174 ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl;
175 ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
177 HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);
179 return &ret->element;