ReactOS 0.4.15-dev-7953-g1f49173
htmlhead.c
Go to the documentation of this file.
1 /*
2 * Copyright 2011 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 IHTMLTitleElement IHTMLTitleElement_iface;
26
27static inline HTMLTitleElement *impl_from_IHTMLTitleElement(IHTMLTitleElement *iface)
28{
29 return CONTAINING_RECORD(iface, HTMLTitleElement, IHTMLTitleElement_iface);
30}
31
32static HRESULT WINAPI HTMLTitleElement_QueryInterface(IHTMLTitleElement *iface,
33 REFIID riid, void **ppv)
34{
36
37 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
38}
39
40static ULONG WINAPI HTMLTitleElement_AddRef(IHTMLTitleElement *iface)
41{
43
44 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
45}
46
47static ULONG WINAPI HTMLTitleElement_Release(IHTMLTitleElement *iface)
48{
50
51 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
52}
53
54static HRESULT WINAPI HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement *iface, UINT *pctinfo)
55{
57
58 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
59}
60
61static HRESULT WINAPI HTMLTitleElement_GetTypeInfo(IHTMLTitleElement *iface, UINT iTInfo,
62 LCID lcid, ITypeInfo **ppTInfo)
63{
65
66 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
67 ppTInfo);
68}
69
70static HRESULT WINAPI HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement *iface, REFIID riid,
71 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
72{
74
75 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
76 cNames, lcid, rgDispId);
77}
78
79static HRESULT WINAPI HTMLTitleElement_Invoke(IHTMLTitleElement *iface, DISPID dispIdMember,
80 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
81 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
82{
84
85 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
86 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
87}
88
89static HRESULT WINAPI HTMLTitleElement_put_text(IHTMLTitleElement *iface, BSTR v)
90{
92 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
93 return E_NOTIMPL;
94}
95
96static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
97{
99 FIXME("(%p)->(%p)\n", This, p);
100 return E_NOTIMPL;
101}
102
103static const IHTMLTitleElementVtbl HTMLTitleElementVtbl = {
113};
114
116{
117 return CONTAINING_RECORD(iface, HTMLTitleElement, element.node);
118}
119
121{
123
124 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
125
126 if(IsEqualGUID(&IID_IHTMLTitleElement, riid))
127 *ppv = &This->IHTMLTitleElement_iface;
128 else
129 return HTMLElement_QI(&This->element.node, riid, ppv);
130
131 IUnknown_AddRef((IUnknown*)*ppv);
132 return S_OK;
133}
134
136{
138
139 HTMLElement_destructor(&This->element.node);
140}
141
149};
150
153 IHTMLTitleElement_tid,
154 0
155};
157 NULL,
158 DispHTMLTitleElement_tid,
159 NULL,
161};
162
164{
166
167 ret = heap_alloc_zero(sizeof(*ret));
168 if(!ret)
169 return E_OUTOFMEMORY;
170
171 ret->IHTMLTitleElement_iface.lpVtbl = &HTMLTitleElementVtbl;
172 ret->element.node.vtbl = &HTMLTitleElementImplVtbl;
173
174 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTitleElement_dispex);
175
176 *elem = &ret->element;
177 return S_OK;
178}
179
180typedef struct {
182
183 IHTMLHeadElement IHTMLHeadElement_iface;
185
186static inline HTMLHeadElement *impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
187{
188 return CONTAINING_RECORD(iface, HTMLHeadElement, IHTMLHeadElement_iface);
189}
190
191static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface,
192 REFIID riid, void **ppv)
193{
195
196 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
197}
198
199static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
200{
202
203 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
204}
205
206static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
207{
209
210 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
211}
212
213static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
214{
216
217 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
218}
219
220static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo,
221 LCID lcid, ITypeInfo **ppTInfo)
222{
224
225 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
226 ppTInfo);
227}
228
230 LPOLESTR *rgszNames, UINT cNames,
231 LCID lcid, DISPID *rgDispId)
232{
234
235 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
236 cNames, lcid, rgDispId);
237}
238
239static HRESULT WINAPI HTMLHeadElement_Invoke(IHTMLHeadElement *iface, DISPID dispIdMember,
240 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
241 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
242{
244
245 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
246 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
247}
248
249static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
250{
252 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
253 return E_NOTIMPL;
254}
255
256static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
257{
259 FIXME("(%p)->(%p)\n", This, p);
260 return E_NOTIMPL;
261}
262
263static const IHTMLHeadElementVtbl HTMLHeadElementVtbl = {
273};
274
276{
277 return CONTAINING_RECORD(iface, HTMLHeadElement, element.node);
278}
279
281{
283
284 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
285
286 if(IsEqualGUID(&IID_IHTMLHeadElement, riid))
287 *ppv = &This->IHTMLHeadElement_iface;
288 else
289 return HTMLElement_QI(&This->element.node, riid, ppv);
290
291 IUnknown_AddRef((IUnknown*)*ppv);
292 return S_OK;
293}
294
296{
298
299 HTMLElement_destructor(&This->element.node);
300}
301
309};
310
313 IHTMLHeadElement_tid,
314 0
315};
317 NULL,
318 DispHTMLHeadElement_tid,
319 NULL,
321};
322
324{
326
327 ret = heap_alloc_zero(sizeof(*ret));
328 if(!ret)
329 return E_OUTOFMEMORY;
330
331 ret->IHTMLHeadElement_iface.lpVtbl = &HTMLHeadElementVtbl;
332 ret->element.node.vtbl = &HTMLHeadElementImplVtbl;
333
334 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHeadElement_dispex);
335
336 *elem = &ret->element;
337 return S_OK;
338}
#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
HRESULT HTMLTitleElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlhead.c:163
static const tid_t HTMLTitleElement_iface_tids[]
Definition: htmlhead.c:151
static HRESULT WINAPI HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement *iface, UINT *pctinfo)
Definition: htmlhead.c:54
static const NodeImplVtbl HTMLHeadElementImplVtbl
Definition: htmlhead.c:302
static HTMLHeadElement * impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
Definition: htmlhead.c:186
static const tid_t HTMLHeadElement_iface_tids[]
Definition: htmlhead.c:311
static ULONG WINAPI HTMLTitleElement_Release(IHTMLTitleElement *iface)
Definition: htmlhead.c:47
HRESULT HTMLHeadElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlhead.c:323
static HRESULT HTMLHeadElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:280
static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
Definition: htmlhead.c:263
static HRESULT HTMLTitleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:120
static dispex_static_data_t HTMLTitleElement_dispex
Definition: htmlhead.c:156
static void HTMLHeadElement_destructor(HTMLDOMNode *iface)
Definition: htmlhead.c:295
static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
Definition: htmlhead.c:249
static HTMLHeadElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlhead.c:275
static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlhead.c:229
static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
Definition: htmlhead.c:213
static HRESULT WINAPI HTMLTitleElement_put_text(IHTMLTitleElement *iface, BSTR v)
Definition: htmlhead.c:89
static HRESULT WINAPI HTMLHeadElement_Invoke(IHTMLHeadElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlhead.c:239
static const IHTMLTitleElementVtbl HTMLTitleElementVtbl
Definition: htmlhead.c:103
static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
Definition: htmlhead.c:206
static ULONG WINAPI HTMLTitleElement_AddRef(IHTMLTitleElement *iface)
Definition: htmlhead.c:40
static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
Definition: htmlhead.c:256
static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:191
static const NodeImplVtbl HTMLTitleElementImplVtbl
Definition: htmlhead.c:142
static HTMLTitleElement * impl_from_IHTMLTitleElement(IHTMLTitleElement *iface)
Definition: htmlhead.c:27
static void HTMLTitleElement_destructor(HTMLDOMNode *iface)
Definition: htmlhead.c:135
static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlhead.c:220
static HTMLTitleElement * HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlhead.c:115
static HRESULT WINAPI HTMLTitleElement_GetTypeInfo(IHTMLTitleElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlhead.c:61
static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
Definition: htmlhead.c:96
static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
Definition: htmlhead.c:199
static HRESULT WINAPI HTMLTitleElement_Invoke(IHTMLTitleElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlhead.c:79
static HRESULT WINAPI HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlhead.c:70
static dispex_static_data_t HTMLHeadElement_dispex
Definition: htmlhead.c:316
static HRESULT WINAPI HTMLTitleElement_QueryInterface(IHTMLTitleElement *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:32
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
#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
HTMLElement element
Definition: htmlhead.c:181
IHTMLHeadElement IHTMLHeadElement_iface
Definition: htmlhead.c:183
HTMLElement element
Definition: htmlhead.c:22
IHTMLTitleElement IHTMLTitleElement_iface
Definition: htmlhead.c:24
#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