ntdll: Rename local variables in heap_reallocate.
[wine.git] / dlls / mshtml / htmlhead.c
blob1bad06ee9d7f33a03e14069c201edc1497379c41
1 /*
2 * Copyright 2011,2012 Jacek Caban for CodeWeavers
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.
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.
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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27 #include "mshtmdid.h"
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 struct HTMLTitleElement {
36 HTMLElement element;
38 IHTMLTitleElement IHTMLTitleElement_iface;
41 static inline HTMLTitleElement *impl_from_IHTMLTitleElement(IHTMLTitleElement *iface)
43 return CONTAINING_RECORD(iface, HTMLTitleElement, IHTMLTitleElement_iface);
46 static HRESULT WINAPI HTMLTitleElement_QueryInterface(IHTMLTitleElement *iface,
47 REFIID riid, void **ppv)
49 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
51 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
54 static ULONG WINAPI HTMLTitleElement_AddRef(IHTMLTitleElement *iface)
56 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
58 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
61 static ULONG WINAPI HTMLTitleElement_Release(IHTMLTitleElement *iface)
63 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
65 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
68 static HRESULT WINAPI HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement *iface, UINT *pctinfo)
70 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
72 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
75 static HRESULT WINAPI HTMLTitleElement_GetTypeInfo(IHTMLTitleElement *iface, UINT iTInfo,
76 LCID lcid, ITypeInfo **ppTInfo)
78 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
80 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
81 ppTInfo);
84 static HRESULT WINAPI HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement *iface, REFIID riid,
85 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
87 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
89 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
90 cNames, lcid, rgDispId);
93 static HRESULT WINAPI HTMLTitleElement_Invoke(IHTMLTitleElement *iface, DISPID dispIdMember,
94 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
95 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
97 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
99 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
100 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
103 static HRESULT WINAPI HTMLTitleElement_put_text(IHTMLTitleElement *iface, BSTR v)
105 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
106 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
107 return E_NOTIMPL;
110 static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
112 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
113 FIXME("(%p)->(%p)\n", This, p);
114 return E_NOTIMPL;
117 static const IHTMLTitleElementVtbl HTMLTitleElementVtbl = {
118 HTMLTitleElement_QueryInterface,
119 HTMLTitleElement_AddRef,
120 HTMLTitleElement_Release,
121 HTMLTitleElement_GetTypeInfoCount,
122 HTMLTitleElement_GetTypeInfo,
123 HTMLTitleElement_GetIDsOfNames,
124 HTMLTitleElement_Invoke,
125 HTMLTitleElement_put_text,
126 HTMLTitleElement_get_text
129 static inline HTMLTitleElement *HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode *iface)
131 return CONTAINING_RECORD(iface, HTMLTitleElement, element.node);
134 static HRESULT HTMLTitleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
136 HTMLTitleElement *This = HTMLTitleElement_from_HTMLDOMNode(iface);
138 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
140 if(IsEqualGUID(&IID_IHTMLTitleElement, riid))
141 *ppv = &This->IHTMLTitleElement_iface;
142 else
143 return HTMLElement_QI(&This->element.node, riid, ppv);
145 IUnknown_AddRef((IUnknown*)*ppv);
146 return S_OK;
149 static void HTMLTitleElement_destructor(HTMLDOMNode *iface)
151 HTMLTitleElement *This = HTMLTitleElement_from_HTMLDOMNode(iface);
153 HTMLElement_destructor(&This->element.node);
156 static const NodeImplVtbl HTMLTitleElementImplVtbl = {
157 &CLSID_HTMLTitleElement,
158 HTMLTitleElement_QI,
159 HTMLTitleElement_destructor,
160 HTMLElement_cpc,
161 HTMLElement_clone,
162 HTMLElement_handle_event,
163 HTMLElement_get_attr_col
166 static const tid_t HTMLTitleElement_iface_tids[] = {
167 HTMLELEMENT_TIDS,
168 IHTMLTitleElement_tid,
171 static dispex_static_data_t HTMLTitleElement_dispex = {
172 L"HTMLTitleElement",
173 NULL,
174 DispHTMLTitleElement_tid,
175 HTMLTitleElement_iface_tids,
176 HTMLElement_init_dispex_info
179 HRESULT HTMLTitleElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
181 HTMLTitleElement *ret;
183 ret = heap_alloc_zero(sizeof(*ret));
184 if(!ret)
185 return E_OUTOFMEMORY;
187 ret->IHTMLTitleElement_iface.lpVtbl = &HTMLTitleElementVtbl;
188 ret->element.node.vtbl = &HTMLTitleElementImplVtbl;
190 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTitleElement_dispex);
192 *elem = &ret->element;
193 return S_OK;
196 struct HTMLHtmlElement {
197 HTMLElement element;
199 IHTMLHtmlElement IHTMLHtmlElement_iface;
202 static inline HTMLHtmlElement *impl_from_IHTMLHtmlElement(IHTMLHtmlElement *iface)
204 return CONTAINING_RECORD(iface, HTMLHtmlElement, IHTMLHtmlElement_iface);
207 static HRESULT WINAPI HTMLHtmlElement_QueryInterface(IHTMLHtmlElement *iface,
208 REFIID riid, void **ppv)
210 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
212 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
215 static ULONG WINAPI HTMLHtmlElement_AddRef(IHTMLHtmlElement *iface)
217 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
219 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
222 static ULONG WINAPI HTMLHtmlElement_Release(IHTMLHtmlElement *iface)
224 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
226 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
229 static HRESULT WINAPI HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement *iface, UINT *pctinfo)
231 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
233 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
236 static HRESULT WINAPI HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement *iface, UINT iTInfo,
237 LCID lcid, ITypeInfo **ppTInfo)
239 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
241 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
242 ppTInfo);
245 static HRESULT WINAPI HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement *iface, REFIID riid,
246 LPOLESTR *rgszNames, UINT cNames,
247 LCID lcid, DISPID *rgDispId)
249 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
251 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
252 cNames, lcid, rgDispId);
255 static HRESULT WINAPI HTMLHtmlElement_Invoke(IHTMLHtmlElement *iface, DISPID dispIdMember,
256 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
257 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
259 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
261 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
262 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
265 static HRESULT WINAPI HTMLHtmlElement_put_version(IHTMLHtmlElement *iface, BSTR v)
267 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
268 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
269 return E_NOTIMPL;
272 static HRESULT WINAPI HTMLHtmlElement_get_version(IHTMLHtmlElement *iface, BSTR *p)
274 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
275 FIXME("(%p)->(%p)\n", This, p);
276 return E_NOTIMPL;
279 static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl = {
280 HTMLHtmlElement_QueryInterface,
281 HTMLHtmlElement_AddRef,
282 HTMLHtmlElement_Release,
283 HTMLHtmlElement_GetTypeInfoCount,
284 HTMLHtmlElement_GetTypeInfo,
285 HTMLHtmlElement_GetIDsOfNames,
286 HTMLHtmlElement_Invoke,
287 HTMLHtmlElement_put_version,
288 HTMLHtmlElement_get_version
291 static inline HTMLHtmlElement *HTMLHtmlElement_from_HTMLDOMNode(HTMLDOMNode *iface)
293 return CONTAINING_RECORD(iface, HTMLHtmlElement, element.node);
296 static HRESULT HTMLHtmlElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
298 HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
300 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
302 if(IsEqualGUID(&IID_IHTMLHtmlElement, riid))
303 *ppv = &This->IHTMLHtmlElement_iface;
304 else
305 return HTMLElement_QI(&This->element.node, riid, ppv);
307 IUnknown_AddRef((IUnknown*)*ppv);
308 return S_OK;
311 static void HTMLHtmlElement_destructor(HTMLDOMNode *iface)
313 HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
315 HTMLElement_destructor(&This->element.node);
318 static BOOL HTMLHtmlElement_is_settable(HTMLDOMNode *iface, DISPID dispid)
320 switch(dispid) {
321 case DISPID_IHTMLELEMENT_OUTERTEXT:
322 return FALSE;
323 default:
324 return TRUE;
328 static const NodeImplVtbl HTMLHtmlElementImplVtbl = {
329 &CLSID_HTMLHtmlElement,
330 HTMLHtmlElement_QI,
331 HTMLHtmlElement_destructor,
332 HTMLElement_cpc,
333 HTMLElement_clone,
334 HTMLElement_handle_event,
335 HTMLElement_get_attr_col,
336 NULL,
337 NULL,
338 NULL,
339 NULL,
340 NULL,
341 NULL,
342 NULL,
343 NULL,
344 NULL,
345 NULL,
346 NULL,
347 HTMLHtmlElement_is_settable
350 static const tid_t HTMLHtmlElement_iface_tids[] = {
351 HTMLELEMENT_TIDS,
352 IHTMLHtmlElement_tid,
355 static dispex_static_data_t HTMLHtmlElement_dispex = {
356 L"HTMLHtmlElement",
357 NULL,
358 DispHTMLHtmlElement_tid,
359 HTMLHtmlElement_iface_tids,
360 HTMLElement_init_dispex_info
363 HRESULT HTMLHtmlElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
365 HTMLHtmlElement *ret;
367 ret = heap_alloc_zero(sizeof(*ret));
368 if(!ret)
369 return E_OUTOFMEMORY;
371 ret->IHTMLHtmlElement_iface.lpVtbl = &HTMLHtmlElementVtbl;
372 ret->element.node.vtbl = &HTMLHtmlElementImplVtbl;
374 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHtmlElement_dispex);
376 *elem = &ret->element;
377 return S_OK;
380 struct HTMLMetaElement {
381 HTMLElement element;
383 IHTMLMetaElement IHTMLMetaElement_iface;
386 static inline HTMLMetaElement *impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
388 return CONTAINING_RECORD(iface, HTMLMetaElement, IHTMLMetaElement_iface);
391 static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
393 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
395 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
398 static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
400 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
402 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
405 static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
407 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
409 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
412 static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
414 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
415 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
418 static HRESULT WINAPI HTMLMetaElement_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo,
419 LCID lcid, ITypeInfo **ppTInfo)
421 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
422 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
423 ppTInfo);
426 static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid,
427 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
429 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
430 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
431 cNames, lcid, rgDispId);
434 static HRESULT WINAPI HTMLMetaElement_Invoke(IHTMLMetaElement *iface, DISPID dispIdMember, REFIID riid,
435 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
436 UINT *puArgErr)
438 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
439 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
440 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
443 static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
445 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
446 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
447 return E_NOTIMPL;
450 static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
452 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
454 TRACE("(%p)->(%p)\n", This, p);
456 return elem_string_attr_getter(&This->element, L"http-equiv", TRUE, p);
459 static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
461 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
462 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
463 return E_NOTIMPL;
466 static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
468 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
470 TRACE("(%p)->(%p)\n", This, p);
472 return elem_string_attr_getter(&This->element, L"content", TRUE, p);
475 static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
477 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
478 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
479 return E_NOTIMPL;
482 static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
484 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
486 TRACE("(%p)->(%p)\n", This, p);
488 return elem_string_attr_getter(&This->element, L"name", TRUE, p);
491 static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
493 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
494 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
495 return E_NOTIMPL;
498 static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
500 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
501 FIXME("(%p)->(%p)\n", This, p);
502 return E_NOTIMPL;
505 static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
507 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
509 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
511 return elem_string_attr_setter(&This->element, L"charset", v);
514 static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
516 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
518 TRACE("(%p)->(%p)\n", This, p);
520 return elem_string_attr_getter(&This->element, L"charset", TRUE, p);
523 static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
524 HTMLMetaElement_QueryInterface,
525 HTMLMetaElement_AddRef,
526 HTMLMetaElement_Release,
527 HTMLMetaElement_GetTypeInfoCount,
528 HTMLMetaElement_GetTypeInfo,
529 HTMLMetaElement_GetIDsOfNames,
530 HTMLMetaElement_Invoke,
531 HTMLMetaElement_put_httpEquiv,
532 HTMLMetaElement_get_httpEquiv,
533 HTMLMetaElement_put_content,
534 HTMLMetaElement_get_content,
535 HTMLMetaElement_put_name,
536 HTMLMetaElement_get_name,
537 HTMLMetaElement_put_url,
538 HTMLMetaElement_get_url,
539 HTMLMetaElement_put_charset,
540 HTMLMetaElement_get_charset
543 static inline HTMLMetaElement *HTMLMetaElement_from_HTMLDOMNode(HTMLDOMNode *iface)
545 return CONTAINING_RECORD(iface, HTMLMetaElement, element.node);
548 static HRESULT HTMLMetaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
550 HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
552 if(IsEqualGUID(&IID_IUnknown, riid)) {
553 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
554 *ppv = &This->IHTMLMetaElement_iface;
555 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
556 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
557 *ppv = &This->IHTMLMetaElement_iface;
558 }else if(IsEqualGUID(&IID_IHTMLMetaElement, riid)) {
559 TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This, ppv);
560 *ppv = &This->IHTMLMetaElement_iface;
561 }else {
562 return HTMLElement_QI(&This->element.node, riid, ppv);
565 IUnknown_AddRef((IUnknown*)*ppv);
566 return S_OK;
569 static void HTMLMetaElement_destructor(HTMLDOMNode *iface)
571 HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
573 HTMLElement_destructor(&This->element.node);
576 static const NodeImplVtbl HTMLMetaElementImplVtbl = {
577 &CLSID_HTMLMetaElement,
578 HTMLMetaElement_QI,
579 HTMLMetaElement_destructor,
580 HTMLElement_cpc,
581 HTMLElement_clone,
582 HTMLElement_handle_event,
583 HTMLElement_get_attr_col
586 static const tid_t HTMLMetaElement_iface_tids[] = {
587 HTMLELEMENT_TIDS,
588 IHTMLMetaElement_tid,
592 static dispex_static_data_t HTMLMetaElement_dispex = {
593 L"HTMLMetaElement",
594 NULL,
595 DispHTMLMetaElement_tid,
596 HTMLMetaElement_iface_tids,
597 HTMLElement_init_dispex_info
600 HRESULT HTMLMetaElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
602 HTMLMetaElement *ret;
604 ret = heap_alloc_zero(sizeof(*ret));
605 if(!ret)
606 return E_OUTOFMEMORY;
608 ret->IHTMLMetaElement_iface.lpVtbl = &HTMLMetaElementVtbl;
609 ret->element.node.vtbl = &HTMLMetaElementImplVtbl;
611 HTMLElement_Init(&ret->element, doc, nselem, &HTMLMetaElement_dispex);
613 *elem = &ret->element;
614 return S_OK;
617 struct HTMLHeadElement {
618 HTMLElement element;
620 IHTMLHeadElement IHTMLHeadElement_iface;
623 static inline HTMLHeadElement *impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
625 return CONTAINING_RECORD(iface, HTMLHeadElement, IHTMLHeadElement_iface);
628 static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface,
629 REFIID riid, void **ppv)
631 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
633 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
636 static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
638 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
640 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
643 static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
645 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
647 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
650 static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
652 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
654 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
657 static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo,
658 LCID lcid, ITypeInfo **ppTInfo)
660 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
662 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
663 ppTInfo);
666 static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid,
667 LPOLESTR *rgszNames, UINT cNames,
668 LCID lcid, DISPID *rgDispId)
670 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
672 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
673 cNames, lcid, rgDispId);
676 static HRESULT WINAPI HTMLHeadElement_Invoke(IHTMLHeadElement *iface, DISPID dispIdMember,
677 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
678 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
680 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
682 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
683 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
686 static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
688 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
689 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
690 return E_NOTIMPL;
693 static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
695 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
696 FIXME("(%p)->(%p)\n", This, p);
697 return E_NOTIMPL;
700 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl = {
701 HTMLHeadElement_QueryInterface,
702 HTMLHeadElement_AddRef,
703 HTMLHeadElement_Release,
704 HTMLHeadElement_GetTypeInfoCount,
705 HTMLHeadElement_GetTypeInfo,
706 HTMLHeadElement_GetIDsOfNames,
707 HTMLHeadElement_Invoke,
708 HTMLHeadElement_put_profile,
709 HTMLHeadElement_get_profile
712 static inline HTMLHeadElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
714 return CONTAINING_RECORD(iface, HTMLHeadElement, element.node);
717 static HRESULT HTMLHeadElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
719 HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
721 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
723 if(IsEqualGUID(&IID_IHTMLHeadElement, riid))
724 *ppv = &This->IHTMLHeadElement_iface;
725 else if(IsEqualGUID(&DIID_DispHTMLHeadElement, riid))
726 *ppv = &This->IHTMLHeadElement_iface;
727 else
728 return HTMLElement_QI(&This->element.node, riid, ppv);
730 IUnknown_AddRef((IUnknown*)*ppv);
731 return S_OK;
734 static void HTMLHeadElement_destructor(HTMLDOMNode *iface)
736 HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
738 HTMLElement_destructor(&This->element.node);
741 static const NodeImplVtbl HTMLHeadElementImplVtbl = {
742 &CLSID_HTMLHeadElement,
743 HTMLHeadElement_QI,
744 HTMLHeadElement_destructor,
745 HTMLElement_cpc,
746 HTMLElement_clone,
747 HTMLElement_handle_event,
748 HTMLElement_get_attr_col
751 static const tid_t HTMLHeadElement_iface_tids[] = {
752 HTMLELEMENT_TIDS,
753 IHTMLHeadElement_tid,
756 static dispex_static_data_t HTMLHeadElement_dispex = {
757 L"HTMLHeadElement",
758 NULL,
759 DispHTMLHeadElement_tid,
760 HTMLHeadElement_iface_tids,
761 HTMLElement_init_dispex_info
764 HRESULT HTMLHeadElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
766 HTMLHeadElement *ret;
768 ret = heap_alloc_zero(sizeof(*ret));
769 if(!ret)
770 return E_OUTOFMEMORY;
772 ret->IHTMLHeadElement_iface.lpVtbl = &HTMLHeadElementVtbl;
773 ret->element.node.vtbl = &HTMLHeadElementImplVtbl;
775 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHeadElement_dispex);
777 *elem = &ret->element;
778 return S_OK;