ReactOS  0.4.13-dev-479-gec9c8fd
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 
21 typedef struct {
23 
24  IHTMLEmbedElement IHTMLEmbedElement_iface;
26 
27 static inline HTMLEmbedElement *impl_from_IHTMLEmbedElement(IHTMLEmbedElement *iface)
28 {
29  return CONTAINING_RECORD(iface, HTMLEmbedElement, IHTMLEmbedElement_iface);
30 }
31 
32 static 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 
40 static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
41 {
43 
44  return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
45 }
46 
47 static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
48 {
50 
51  return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
52 }
53 
54 static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
55 {
57  return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
58 }
59 
60 static 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 
68 static 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 
76 static 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 
85 static 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 
92 static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
93 {
95  FIXME("(%p)->(%p)\n", This, p);
96  return E_NOTIMPL;
97 }
98 
99 static HRESULT WINAPI HTMLEmbedElement_get_palete(IHTMLEmbedElement *iface, BSTR *p)
100 {
102  FIXME("(%p)->(%p)\n", This, p);
103  return E_NOTIMPL;
104 }
105 
106 static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
107 {
109  FIXME("(%p)->(%p)\n", This, p);
110  return E_NOTIMPL;
111 }
112 
113 static 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 
120 static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
121 {
123  FIXME("(%p)->(%p)\n", This, p);
124  return E_NOTIMPL;
125 }
126 
127 static 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 
134 static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
135 {
137  FIXME("(%p)->(%p)\n", This, p);
138  return E_NOTIMPL;
139 }
140 
141 static 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 
148 static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
149 {
151  FIXME("(%p)->(%p)\n", This, p);
152  return E_NOTIMPL;
153 }
154 
155 static 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 
162 static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
163 {
165  FIXME("(%p)->(%p)\n", This, p);
166  return E_NOTIMPL;
167 }
168 
169 static 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 
176 static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
177 {
179  FIXME("(%p)->(%p)\n", This, p);
180  return E_NOTIMPL;
181 }
182 
183 static 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 
218  if(IsEqualGUID(&IID_IUnknown, riid)) {
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 }
static HRESULT WINAPI HTMLEmbedElement_QueryInterface(IHTMLEmbedElement *iface, REFIID riid, void **ppv)
Definition: htmlembed.c:32
static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:148
#define REFIID
Definition: guiddef.h:113
static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
Definition: htmlembed.c:47
static HRESULT WINAPI HTMLEmbedElement_put_width(IHTMLEmbedElement *iface, VARIANT v)
Definition: htmlembed.c:155
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
REFIID riid
Definition: precomp.h:44
tid_t
Definition: ieframe.h:311
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
static HTMLEmbedElement * impl_from_IHTMLEmbedElement(IHTMLEmbedElement *iface)
Definition: htmlembed.c:27
static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:106
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1934
static HRESULT WINAPI HTMLEmbedElement_put_src(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:113
static LPOLESTR
Definition: stg_prop.c:27
static dispex_static_data_t HTMLEmbedElement_dispex
Definition: htmlembed.c:253
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
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
static const NodeImplVtbl HTMLEmbedElementImplVtbl
Definition: htmlembed.c:239
#define HTMLELEMENT_TIDS
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void HTMLEmbedElement_destructor(HTMLDOMNode *iface)
Definition: htmlembed.c:232
static HRESULT WINAPI HTMLEmbedElement_get_palete(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:99
static HRESULT WINAPI HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlembed.c:68
#define debugstr_w
Definition: kernel32.h:32
static HTMLEmbedElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlembed.c:207
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
static HRESULT WINAPI HTMLEmbedElement_put_hidden(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:85
smooth NULL
Definition: ftsmooth.c:416
static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
Definition: htmlembed.c:40
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:120
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlembed.c:60
unsigned short WORD
Definition: ntddk_ex.h:93
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
static HRESULT WINAPI HTMLEmbedElement_put_height(IHTMLEmbedElement *iface, VARIANT v)
Definition: htmlembed.c:169
static HRESULT WINAPI HTMLEmbedElement_put_name(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:141
const GUID IID_IDispatch
static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
Definition: htmlembed.c:162
int ret
static const tid_t HTMLEmbedElement_iface_tids[]
Definition: htmlembed.c:248
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlembed.c:260
static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl
Definition: htmlembed.c:183
static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlembed.c:212
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
Definition: htmlembed.c:176
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
struct stdole::EXCEPINFO EXCEPINFO
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:134
const GLdouble * v
Definition: gl.h:2040
HTMLElement element
Definition: htmlembed.c:22
static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
Definition: htmlembed.c:92
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static HRESULT WINAPI HTMLEmbedElement_put_units(IHTMLEmbedElement *iface, BSTR v)
Definition: htmlembed.c:127
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
IHTMLEmbedElement IHTMLEmbedElement_iface
Definition: htmlembed.c:24
GLfloat GLfloat p
Definition: glext.h:8902
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
Definition: htmlembed.c:54