ReactOS 0.4.15-dev-7907-g95bf896
htmlembed.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 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 IHTMLEmbedElement IHTMLEmbedElement_iface;
26
27static inline HTMLEmbedElement *impl_from_IHTMLEmbedElement(IHTMLEmbedElement *iface)
28{
29 return CONTAINING_RECORD(iface, HTMLEmbedElement, IHTMLEmbedElement_iface);
30}
31
32static HRESULT WINAPI HTMLEmbedElement_QueryInterface(IHTMLEmbedElement *iface,
33 REFIID riid, void **ppv)
34{
36
37 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
38}
39
40static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
41{
43
44 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
45}
46
47static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
48{
50
51 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
52}
53
54static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
55{
57 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
58}
59
60static HRESULT WINAPI HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement *iface, UINT iTInfo,
61 LCID lcid, ITypeInfo **ppTInfo)
62{
64 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
65 ppTInfo);
66}
67
68static HRESULT WINAPI HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement *iface, REFIID riid,
69 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
70{
72 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
73 cNames, lcid, rgDispId);
74}
75
76static HRESULT WINAPI HTMLEmbedElement_Invoke(IHTMLEmbedElement *iface, DISPID dispIdMember,
77 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
78 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
79{
81 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
82 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
83}
84
85static HRESULT WINAPI HTMLEmbedElement_put_hidden(IHTMLEmbedElement *iface, BSTR v)
86{
88 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
89 return E_NOTIMPL;
90}
91
92static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
93{
95 FIXME("(%p)->(%p)\n", This, p);
96 return E_NOTIMPL;
97}
98
99static HRESULT WINAPI HTMLEmbedElement_get_palete(IHTMLEmbedElement *iface, BSTR *p)
100{
102 FIXME("(%p)->(%p)\n", This, p);
103 return E_NOTIMPL;
104}
105
106static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
107{
109 FIXME("(%p)->(%p)\n", This, p);
110 return E_NOTIMPL;
111}
112
113static HRESULT WINAPI HTMLEmbedElement_put_src(IHTMLEmbedElement *iface, BSTR v)
114{
116 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
117 return E_NOTIMPL;
118}
119
120static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
121{
123 FIXME("(%p)->(%p)\n", This, p);
124 return E_NOTIMPL;
125}
126
127static HRESULT WINAPI HTMLEmbedElement_put_units(IHTMLEmbedElement *iface, BSTR v)
128{
130 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
131 return E_NOTIMPL;
132}
133
134static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
135{
137 FIXME("(%p)->(%p)\n", This, p);
138 return E_NOTIMPL;
139}
140
141static HRESULT WINAPI HTMLEmbedElement_put_name(IHTMLEmbedElement *iface, BSTR v)
142{
144 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
145 return E_NOTIMPL;
146}
147
148static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
149{
151 FIXME("(%p)->(%p)\n", This, p);
152 return E_NOTIMPL;
153}
154
155static HRESULT WINAPI HTMLEmbedElement_put_width(IHTMLEmbedElement *iface, VARIANT v)
156{
158 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
159 return E_NOTIMPL;
160}
161
162static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
163{
165 FIXME("(%p)->(%p)\n", This, p);
166 return E_NOTIMPL;
167}
168
169static HRESULT WINAPI HTMLEmbedElement_put_height(IHTMLEmbedElement *iface, VARIANT v)
170{
172 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
173 return E_NOTIMPL;
174}
175
176static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
177{
179 FIXME("(%p)->(%p)\n", This, p);
180 return E_NOTIMPL;
181}
182
183static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl = {
205};
206
208{
209 return CONTAINING_RECORD(iface, HTMLEmbedElement, element.node);
210}
211
213{
215
216 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
217
219 *ppv = &This->IHTMLEmbedElement_iface;
220 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
221 *ppv = &This->IHTMLEmbedElement_iface;
222 }else if(IsEqualGUID(&IID_IHTMLEmbedElement, riid)) {
223 *ppv = &This->IHTMLEmbedElement_iface;
224 }else {
225 return HTMLElement_QI(&This->element.node, riid, ppv);
226 }
227
228 IUnknown_AddRef((IUnknown*)*ppv);
229 return S_OK;
230}
231
233{
235
236 HTMLElement_destructor(&This->element.node);
237}
238
246};
247
250 IHTMLEmbedElement_tid,
251 0
252};
254 NULL,
255 DispHTMLEmbed_tid,
256 NULL,
258};
259
261{
263
264 ret = heap_alloc_zero(sizeof(*ret));
265 if(!ret)
266 return E_OUTOFMEMORY;
267
268 ret->IHTMLEmbedElement_iface.lpVtbl = &HTMLEmbedElementVtbl;
269 ret->element.node.vtbl = &HTMLEmbedElementImplVtbl;
270
271 HTMLElement_Init(&ret->element, doc, nselem, &HTMLEmbedElement_dispex);
272 *elem = &ret->element;
273 return S_OK;
274}
const GUID IID_IUnknown
#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
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:542
unsigned short WORD
Definition: ntddk_ex.h:93
const GLdouble * v
Definition: gl.h:2040
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 HTMLEmbedElement_Invoke(IHTMLEmbedElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlembed.c:76
static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
Definition: htmlembed.c:162
static HRESULT WINAPI HTMLEmbedElement_put_src(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:113
static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:106
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
Definition: htmlembed.c:54
static HRESULT WINAPI HTMLEmbedElement_QueryInterface(IHTMLEmbedElement *iface, REFIID riid, void **ppv)
Definition: htmlembed.c:32
static HTMLEmbedElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlembed.c:207
static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
Definition: htmlembed.c:40
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlembed.c:260
static HRESULT WINAPI HTMLEmbedElement_put_name(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:141
static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
Definition: htmlembed.c:47
static HRESULT WINAPI HTMLEmbedElement_get_palete(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:99
static const tid_t HTMLEmbedElement_iface_tids[]
Definition: htmlembed.c:248
static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlembed.c:212
static HTMLEmbedElement * impl_from_IHTMLEmbedElement(IHTMLEmbedElement *iface)
Definition: htmlembed.c:27
static dispex_static_data_t HTMLEmbedElement_dispex
Definition: htmlembed.c:253
static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:134
static HRESULT WINAPI HTMLEmbedElement_put_hidden(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:85
static const NodeImplVtbl HTMLEmbedElementImplVtbl
Definition: htmlembed.c:239
static HRESULT WINAPI HTMLEmbedElement_put_width(IHTMLEmbedElement *iface, VARIANT v)
Definition: htmlembed.c:155
static HRESULT WINAPI HTMLEmbedElement_put_height(IHTMLEmbedElement *iface, VARIANT v)
Definition: htmlembed.c:169
static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:148
static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:120
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlembed.c:60
static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl
Definition: htmlembed.c:183
static HRESULT WINAPI HTMLEmbedElement_put_units(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:127
static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:92
static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
Definition: htmlembed.c:176
static void HTMLEmbedElement_destructor(HTMLDOMNode *iface)
Definition: htmlembed.c:232
static HRESULT WINAPI HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlembed.c:68
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 const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
static size_t elem
Definition: string.c:68
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
#define HTMLELEMENT_TIDS
unsigned int UINT
Definition: ndis.h:50
const GUID IID_IDispatch
#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
IHTMLEmbedElement IHTMLEmbedElement_iface
Definition: htmlembed.c:24
HTMLElement element
Definition: htmlembed.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