ReactOS  0.4.13-dev-482-ge57f103
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 
21 typedef struct {
23 
24  IHTMLTitleElement IHTMLTitleElement_iface;
26 
27 static inline HTMLTitleElement *impl_from_IHTMLTitleElement(IHTMLTitleElement *iface)
28 {
29  return CONTAINING_RECORD(iface, HTMLTitleElement, IHTMLTitleElement_iface);
30 }
31 
32 static 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 
40 static ULONG WINAPI HTMLTitleElement_AddRef(IHTMLTitleElement *iface)
41 {
43 
44  return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
45 }
46 
47 static ULONG WINAPI HTMLTitleElement_Release(IHTMLTitleElement *iface)
48 {
50 
51  return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
52 }
53 
54 static 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 
61 static 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 
70 static 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 
79 static 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 
89 static 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 
96 static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
97 {
99  FIXME("(%p)->(%p)\n", This, p);
100  return E_NOTIMPL;
101 }
102 
103 static 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 
180 typedef struct {
182 
183  IHTMLHeadElement IHTMLHeadElement_iface;
185 
186 static inline HTMLHeadElement *impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
187 {
188  return CONTAINING_RECORD(iface, HTMLHeadElement, IHTMLHeadElement_iface);
189 }
190 
191 static 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 
199 static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
200 {
202 
203  return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
204 }
205 
206 static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
207 {
209 
210  return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
211 }
212 
213 static 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 
220 static 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 
229 static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid,
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 
239 static 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 
249 static 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 
256 static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
257 {
259  FIXME("(%p)->(%p)\n", This, p);
260  return E_NOTIMPL;
261 }
262 
263 static 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 }
static HTMLHeadElement * impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
Definition: htmlhead.c:186
#define REFIID
Definition: guiddef.h:113
static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:191
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 ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
Definition: htmlhead.c:199
static HRESULT HTMLTitleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:120
static const NodeImplVtbl HTMLTitleElementImplVtbl
Definition: htmlhead.c:142
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
static HRESULT WINAPI HTMLTitleElement_GetTypeInfo(IHTMLTitleElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlhead.c:61
tid_t
Definition: ieframe.h:311
static HRESULT WINAPI HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement *iface, UINT *pctinfo)
Definition: htmlhead.c:54
static ULONG WINAPI HTMLTitleElement_AddRef(IHTMLTitleElement *iface)
Definition: htmlhead.c:40
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
Definition: htmlhead.c:206
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
Definition: htmlhead.c:96
static dispex_static_data_t HTMLTitleElement_dispex
Definition: htmlhead.c:156
static const NodeImplVtbl HTMLHeadElementImplVtbl
Definition: htmlhead.c:302
static const tid_t HTMLHeadElement_iface_tids[]
Definition: htmlhead.c:311
static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
Definition: htmlhead.c:213
IHTMLTitleElement IHTMLTitleElement_iface
Definition: htmlhead.c:24
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
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1934
static HRESULT WINAPI HTMLTitleElement_put_text(IHTMLTitleElement *iface, BSTR v)
Definition: htmlhead.c:89
static LPOLESTR
Definition: stg_prop.c:27
static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
Definition: htmlhead.c:263
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
static HRESULT HTMLHeadElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:280
#define HTMLELEMENT_TIDS
static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlhead.c:229
static HRESULT WINAPI HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlhead.c:70
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlhead.c:220
#define debugstr_w
Definition: kernel32.h:32
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static HTMLHeadElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlhead.c:275
IHTMLHeadElement IHTMLHeadElement_iface
Definition: htmlhead.c:183
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
#define TRACE(s)
Definition: solgame.cpp:4
static const IHTMLTitleElementVtbl HTMLTitleElementVtbl
Definition: htmlhead.c:103
static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
Definition: htmlhead.c:256
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
HTMLElement element
Definition: htmlhead.c:181
static HTMLTitleElement * impl_from_IHTMLTitleElement(IHTMLTitleElement *iface)
Definition: htmlhead.c:27
int ret
static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
Definition: htmlhead.c:249
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
static dispex_static_data_t HTMLHeadElement_dispex
Definition: htmlhead.c:316
HRESULT HTMLHeadElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlhead.c:323
static HTMLTitleElement * HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlhead.c:115
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
HRESULT HTMLTitleElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlhead.c:163
static const tid_t HTMLTitleElement_iface_tids[]
Definition: htmlhead.c:151
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
const GLdouble * v
Definition: gl.h:2040
static ULONG WINAPI HTMLTitleElement_Release(IHTMLTitleElement *iface)
Definition: htmlhead.c:47
static HRESULT WINAPI HTMLTitleElement_QueryInterface(IHTMLTitleElement *iface, REFIID riid, void **ppv)
Definition: htmlhead.c:32
static void HTMLTitleElement_destructor(HTMLDOMNode *iface)
Definition: htmlhead.c:135
#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
HTMLElement element
Definition: htmlhead.c:22
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
GLfloat GLfloat p
Definition: glext.h:8902
static void HTMLHeadElement_destructor(HTMLDOMNode *iface)
Definition: htmlhead.c:295