2008-06-19 21:14:57 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2017-04-13 14:05:01 +00:00
|
|
|
struct HTMLGenericElement {
|
2008-06-19 21:14:57 +00:00
|
|
|
HTMLElement element;
|
|
|
|
|
2010-12-06 22:31:29 +00:00
|
|
|
IHTMLGenericElement IHTMLGenericElement_iface;
|
2017-04-13 14:05:01 +00:00
|
|
|
};
|
2008-06-19 21:14:57 +00:00
|
|
|
|
2010-12-06 22:31:29 +00:00
|
|
|
static inline HTMLGenericElement *impl_from_IHTMLGenericElement(IHTMLGenericElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLGenericElement, IHTMLGenericElement_iface);
|
|
|
|
}
|
2008-06-19 21:14:57 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
|
2010-12-30 00:39:16 +00:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
|
2010-12-30 00:39:16 +00:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
|
2010-12-30 00:39:16 +00:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2015-05-14 11:24:19 +00:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2015-05-14 11:24:19 +00:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
2010-12-31 10:07:33 +00:00
|
|
|
ppTInfo);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2015-05-14 11:24:19 +00:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
2010-12-31 10:07:33 +00:00
|
|
|
cNames, lcid, rgDispId);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2015-05-14 11:24:19 +00:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
2010-12-31 10:07:33 +00:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface,
|
|
|
|
BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
|
|
|
|
{
|
2010-12-06 22:31:29 +00:00
|
|
|
HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = {
|
|
|
|
HTMLGenericElement_QueryInterface,
|
|
|
|
HTMLGenericElement_AddRef,
|
|
|
|
HTMLGenericElement_Release,
|
|
|
|
HTMLGenericElement_GetTypeInfoCount,
|
|
|
|
HTMLGenericElement_GetTypeInfo,
|
|
|
|
HTMLGenericElement_GetIDsOfNames,
|
|
|
|
HTMLGenericElement_Invoke,
|
|
|
|
HTMLGenericElement_get_recordset,
|
|
|
|
HTMLGenericElement_namedRecordset
|
|
|
|
};
|
|
|
|
|
2010-12-27 19:13:09 +00:00
|
|
|
static inline HTMLGenericElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLGenericElement, element.node);
|
|
|
|
}
|
2008-06-19 21:14:57 +00:00
|
|
|
|
|
|
|
static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLGenericElement *This = impl_from_HTMLDOMNode(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv);
|
2010-12-06 22:31:29 +00:00
|
|
|
*ppv = &This->IHTMLGenericElement_iface;
|
2008-06-19 21:14:57 +00:00
|
|
|
}else {
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLGenericElement_destructor(HTMLDOMNode *iface)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLGenericElement *This = impl_from_HTMLDOMNode(iface);
|
2008-06-19 21:14:57 +00:00
|
|
|
|
|
|
|
HTMLElement_destructor(&This->element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const NodeImplVtbl HTMLGenericElementImplVtbl = {
|
|
|
|
HTMLGenericElement_QI,
|
2010-11-14 13:41:39 +00:00
|
|
|
HTMLGenericElement_destructor,
|
2013-03-15 14:01:53 +00:00
|
|
|
HTMLElement_cpc,
|
2011-08-25 13:23:35 +00:00
|
|
|
HTMLElement_clone,
|
2012-09-04 11:58:58 +00:00
|
|
|
HTMLElement_handle_event,
|
2011-08-25 13:23:35 +00:00
|
|
|
HTMLElement_get_attr_col
|
2008-06-19 21:14:57 +00:00
|
|
|
};
|
|
|
|
|
2008-06-19 21:15:37 +00:00
|
|
|
static const tid_t HTMLGenericElement_iface_tids[] = {
|
2010-01-28 01:09:02 +00:00
|
|
|
HTMLELEMENT_TIDS,
|
2008-06-19 21:15:37 +00:00
|
|
|
IHTMLGenericElement_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
static dispex_static_data_t HTMLGenericElement_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLGenericElement_tid,
|
2016-07-07 10:50:18 +00:00
|
|
|
HTMLGenericElement_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
2008-06-19 21:15:37 +00:00
|
|
|
};
|
|
|
|
|
2010-12-01 21:42:51 +00:00
|
|
|
HRESULT HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
2008-06-19 21:14:57 +00:00
|
|
|
{
|
|
|
|
HTMLGenericElement *ret;
|
|
|
|
|
|
|
|
ret = heap_alloc_zero(sizeof(HTMLGenericElement));
|
2010-12-01 21:42:51 +00:00
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
2008-06-19 21:14:57 +00:00
|
|
|
|
2010-12-06 22:31:29 +00:00
|
|
|
ret->IHTMLGenericElement_iface.lpVtbl = &HTMLGenericElementVtbl;
|
2008-06-19 21:14:57 +00:00
|
|
|
ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
|
|
|
|
|
2009-11-01 18:16:48 +00:00
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);
|
2008-06-19 21:14:57 +00:00
|
|
|
|
2010-12-01 21:42:51 +00:00
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
2008-06-19 21:14:57 +00:00
|
|
|
}
|