ReactOS 0.4.15-dev-7674-gc0b4db1
htmlgeneric.c
Go to the documentation of this file.
1/*
2 * Copyright 2008 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include "mshtml_private.h"
20
21typedef struct {
23
24 IHTMLGenericElement IHTMLGenericElement_iface;
26
27static inline HTMLGenericElement *impl_from_IHTMLGenericElement(IHTMLGenericElement *iface)
28{
29 return CONTAINING_RECORD(iface, HTMLGenericElement, IHTMLGenericElement_iface);
30}
31
32static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
33{
35
36 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
37}
38
39static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
40{
42
43 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
44}
45
46static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
47{
49
50 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
51}
52
53static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
54{
56 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
57}
58
59static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
60 LCID lcid, ITypeInfo **ppTInfo)
61{
63 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
64 ppTInfo);
65}
66
67static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
68 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
69{
71 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
72 cNames, lcid, rgDispId);
73}
74
75static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember,
76 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
77 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
78{
80 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
81 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
82}
83
84static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
85{
87 FIXME("(%p)->(%p)\n", This, p);
88 return E_NOTIMPL;
89}
90
91static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface,
92 BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
93{
95 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
96 return E_NOTIMPL;
97}
98
99static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = {
109};
110
112{
113 return CONTAINING_RECORD(iface, HTMLGenericElement, element.node);
114}
115
117{
119
120 *ppv = NULL;
121
122 if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) {
123 TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv);
124 *ppv = &This->IHTMLGenericElement_iface;
125 }else {
126 return HTMLElement_QI(&This->element.node, riid, ppv);
127 }
128
129 IUnknown_AddRef((IUnknown*)*ppv);
130 return S_OK;
131}
132
134{
136
137 HTMLElement_destructor(&This->element.node);
138}
139
147};
148
151 IHTMLGenericElement_tid,
152 0
153};
154
156 NULL,
157 DispHTMLGenericElement_tid,
158 NULL,
160};
161
163{
165
166 ret = heap_alloc_zero(sizeof(HTMLGenericElement));
167 if(!ret)
168 return E_OUTOFMEMORY;
169
170 ret->IHTMLGenericElement_iface.lpVtbl = &HTMLGenericElementVtbl;
171 ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
172
173 HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);
174
175 *elem = &ret->element;
176 return S_OK;
177}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
OLECHAR * BSTR
Definition: compat.h:2293
unsigned short WORD
Definition: ntddk_ex.h:93
GLfloat GLfloat p
Definition: glext.h:8902
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlgeneric.c:67
static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlgeneric.c:116
static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface, BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
Definition: htmlgeneric.c:91
static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlgeneric.c:75
static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
Definition: htmlgeneric.c:84
static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
Definition: htmlgeneric.c:46
static const NodeImplVtbl HTMLGenericElementImplVtbl
Definition: htmlgeneric.c:140
static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
Definition: htmlgeneric.c:53
static const tid_t HTMLGenericElement_iface_tids[]
Definition: htmlgeneric.c:149
static dispex_static_data_t HTMLGenericElement_dispex
Definition: htmlgeneric.c:155
static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
Definition: htmlgeneric.c:32
static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlgeneric.c:59
static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
Definition: htmlgeneric.c:39
static HTMLGenericElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlgeneric.c:111
static const IHTMLGenericElementVtbl HTMLGenericElementVtbl
Definition: htmlgeneric.c:99
static void HTMLGenericElement_destructor(HTMLDOMNode *iface)
Definition: htmlgeneric.c:133
HRESULT HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlgeneric.c:162
static HTMLGenericElement * impl_from_IHTMLGenericElement(IHTMLGenericElement *iface)
Definition: htmlgeneric.c:27
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
static size_t elem
Definition: string.c:68
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
static const h_entry hierarchy[]
Definition: dialog.c:66
#define HTMLELEMENT_TIDS
unsigned int UINT
Definition: ndis.h:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
DWORD LCID
Definition: nls.h:13
#define TRACE(s)
Definition: solgame.cpp:4
IHTMLGenericElement IHTMLGenericElement_iface
Definition: htmlgeneric.c:24
HTMLElement element
Definition: htmlgeneric.c:22
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define WINAPI
Definition: msvc.h:6