wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().
[wine/zf.git] / dlls / mshtml / htmlhead.c
blob5dbf8d6b6bd78563b7b6d1111a066099c2bb9626
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 NULL,
173 DispHTMLTitleElement_tid,
174 HTMLTitleElement_iface_tids,
175 HTMLElement_init_dispex_info
178 HRESULT HTMLTitleElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
180 HTMLTitleElement *ret;
182 ret = heap_alloc_zero(sizeof(*ret));
183 if(!ret)
184 return E_OUTOFMEMORY;
186 ret->IHTMLTitleElement_iface.lpVtbl = &HTMLTitleElementVtbl;
187 ret->element.node.vtbl = &HTMLTitleElementImplVtbl;
189 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTitleElement_dispex);
191 *elem = &ret->element;
192 return S_OK;
195 struct HTMLHtmlElement {
196 HTMLElement element;
198 IHTMLHtmlElement IHTMLHtmlElement_iface;
201 static inline HTMLHtmlElement *impl_from_IHTMLHtmlElement(IHTMLHtmlElement *iface)
203 return CONTAINING_RECORD(iface, HTMLHtmlElement, IHTMLHtmlElement_iface);
206 static HRESULT WINAPI HTMLHtmlElement_QueryInterface(IHTMLHtmlElement *iface,
207 REFIID riid, void **ppv)
209 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
211 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
214 static ULONG WINAPI HTMLHtmlElement_AddRef(IHTMLHtmlElement *iface)
216 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
218 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
221 static ULONG WINAPI HTMLHtmlElement_Release(IHTMLHtmlElement *iface)
223 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
225 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
228 static HRESULT WINAPI HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement *iface, UINT *pctinfo)
230 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
232 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
235 static HRESULT WINAPI HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement *iface, UINT iTInfo,
236 LCID lcid, ITypeInfo **ppTInfo)
238 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
240 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
241 ppTInfo);
244 static HRESULT WINAPI HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement *iface, REFIID riid,
245 LPOLESTR *rgszNames, UINT cNames,
246 LCID lcid, DISPID *rgDispId)
248 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
250 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
251 cNames, lcid, rgDispId);
254 static HRESULT WINAPI HTMLHtmlElement_Invoke(IHTMLHtmlElement *iface, DISPID dispIdMember,
255 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
256 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
258 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
260 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
261 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
264 static HRESULT WINAPI HTMLHtmlElement_put_version(IHTMLHtmlElement *iface, BSTR v)
266 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
267 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
268 return E_NOTIMPL;
271 static HRESULT WINAPI HTMLHtmlElement_get_version(IHTMLHtmlElement *iface, BSTR *p)
273 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
274 FIXME("(%p)->(%p)\n", This, p);
275 return E_NOTIMPL;
278 static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl = {
279 HTMLHtmlElement_QueryInterface,
280 HTMLHtmlElement_AddRef,
281 HTMLHtmlElement_Release,
282 HTMLHtmlElement_GetTypeInfoCount,
283 HTMLHtmlElement_GetTypeInfo,
284 HTMLHtmlElement_GetIDsOfNames,
285 HTMLHtmlElement_Invoke,
286 HTMLHtmlElement_put_version,
287 HTMLHtmlElement_get_version
290 static inline HTMLHtmlElement *HTMLHtmlElement_from_HTMLDOMNode(HTMLDOMNode *iface)
292 return CONTAINING_RECORD(iface, HTMLHtmlElement, element.node);
295 static HRESULT HTMLHtmlElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
297 HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
299 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
301 if(IsEqualGUID(&IID_IHTMLHtmlElement, riid))
302 *ppv = &This->IHTMLHtmlElement_iface;
303 else
304 return HTMLElement_QI(&This->element.node, riid, ppv);
306 IUnknown_AddRef((IUnknown*)*ppv);
307 return S_OK;
310 static void HTMLHtmlElement_destructor(HTMLDOMNode *iface)
312 HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
314 HTMLElement_destructor(&This->element.node);
317 static BOOL HTMLHtmlElement_is_settable(HTMLDOMNode *iface, DISPID dispid)
319 switch(dispid) {
320 case DISPID_IHTMLELEMENT_OUTERTEXT:
321 return FALSE;
322 default:
323 return TRUE;
327 static const NodeImplVtbl HTMLHtmlElementImplVtbl = {
328 &CLSID_HTMLHtmlElement,
329 HTMLHtmlElement_QI,
330 HTMLHtmlElement_destructor,
331 HTMLElement_cpc,
332 HTMLElement_clone,
333 HTMLElement_handle_event,
334 HTMLElement_get_attr_col,
335 NULL,
336 NULL,
337 NULL,
338 NULL,
339 NULL,
340 NULL,
341 NULL,
342 NULL,
343 NULL,
344 NULL,
345 NULL,
346 HTMLHtmlElement_is_settable
349 static const tid_t HTMLHtmlElement_iface_tids[] = {
350 HTMLELEMENT_TIDS,
351 IHTMLHtmlElement_tid,
354 static dispex_static_data_t HTMLHtmlElement_dispex = {
355 NULL,
356 DispHTMLHtmlElement_tid,
357 HTMLHtmlElement_iface_tids,
358 HTMLElement_init_dispex_info
361 HRESULT HTMLHtmlElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
363 HTMLHtmlElement *ret;
365 ret = heap_alloc_zero(sizeof(*ret));
366 if(!ret)
367 return E_OUTOFMEMORY;
369 ret->IHTMLHtmlElement_iface.lpVtbl = &HTMLHtmlElementVtbl;
370 ret->element.node.vtbl = &HTMLHtmlElementImplVtbl;
372 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHtmlElement_dispex);
374 *elem = &ret->element;
375 return S_OK;
378 struct HTMLMetaElement {
379 HTMLElement element;
381 IHTMLMetaElement IHTMLMetaElement_iface;
384 static inline HTMLMetaElement *impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
386 return CONTAINING_RECORD(iface, HTMLMetaElement, IHTMLMetaElement_iface);
389 static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
391 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
393 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
396 static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
398 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
400 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
403 static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
405 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
407 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
410 static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
412 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
413 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
416 static HRESULT WINAPI HTMLMetaElement_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo,
417 LCID lcid, ITypeInfo **ppTInfo)
419 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
420 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
421 ppTInfo);
424 static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid,
425 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
427 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
428 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
429 cNames, lcid, rgDispId);
432 static HRESULT WINAPI HTMLMetaElement_Invoke(IHTMLMetaElement *iface, DISPID dispIdMember, REFIID riid,
433 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
434 UINT *puArgErr)
436 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
437 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
438 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
441 static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
443 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
444 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
445 return E_NOTIMPL;
448 static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
450 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
452 TRACE("(%p)->(%p)\n", This, p);
454 return elem_string_attr_getter(&This->element, L"http-equiv", TRUE, p);
457 static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
459 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
460 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
461 return E_NOTIMPL;
464 static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
466 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
468 TRACE("(%p)->(%p)\n", This, p);
470 return elem_string_attr_getter(&This->element, L"content", TRUE, p);
473 static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
475 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
476 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
477 return E_NOTIMPL;
480 static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
482 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
484 TRACE("(%p)->(%p)\n", This, p);
486 return elem_string_attr_getter(&This->element, L"name", TRUE, p);
489 static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
491 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
492 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
493 return E_NOTIMPL;
496 static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
498 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
499 FIXME("(%p)->(%p)\n", This, p);
500 return E_NOTIMPL;
503 static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
505 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
507 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
509 return elem_string_attr_setter(&This->element, L"charset", v);
512 static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
514 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
516 TRACE("(%p)->(%p)\n", This, p);
518 return elem_string_attr_getter(&This->element, L"charset", TRUE, p);
521 static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
522 HTMLMetaElement_QueryInterface,
523 HTMLMetaElement_AddRef,
524 HTMLMetaElement_Release,
525 HTMLMetaElement_GetTypeInfoCount,
526 HTMLMetaElement_GetTypeInfo,
527 HTMLMetaElement_GetIDsOfNames,
528 HTMLMetaElement_Invoke,
529 HTMLMetaElement_put_httpEquiv,
530 HTMLMetaElement_get_httpEquiv,
531 HTMLMetaElement_put_content,
532 HTMLMetaElement_get_content,
533 HTMLMetaElement_put_name,
534 HTMLMetaElement_get_name,
535 HTMLMetaElement_put_url,
536 HTMLMetaElement_get_url,
537 HTMLMetaElement_put_charset,
538 HTMLMetaElement_get_charset
541 static inline HTMLMetaElement *HTMLMetaElement_from_HTMLDOMNode(HTMLDOMNode *iface)
543 return CONTAINING_RECORD(iface, HTMLMetaElement, element.node);
546 static HRESULT HTMLMetaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
548 HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
550 if(IsEqualGUID(&IID_IUnknown, riid)) {
551 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
552 *ppv = &This->IHTMLMetaElement_iface;
553 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
554 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
555 *ppv = &This->IHTMLMetaElement_iface;
556 }else if(IsEqualGUID(&IID_IHTMLMetaElement, riid)) {
557 TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This, ppv);
558 *ppv = &This->IHTMLMetaElement_iface;
559 }else {
560 return HTMLElement_QI(&This->element.node, riid, ppv);
563 IUnknown_AddRef((IUnknown*)*ppv);
564 return S_OK;
567 static void HTMLMetaElement_destructor(HTMLDOMNode *iface)
569 HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
571 HTMLElement_destructor(&This->element.node);
574 static const NodeImplVtbl HTMLMetaElementImplVtbl = {
575 &CLSID_HTMLMetaElement,
576 HTMLMetaElement_QI,
577 HTMLMetaElement_destructor,
578 HTMLElement_cpc,
579 HTMLElement_clone,
580 HTMLElement_handle_event,
581 HTMLElement_get_attr_col
584 static const tid_t HTMLMetaElement_iface_tids[] = {
585 HTMLELEMENT_TIDS,
586 IHTMLMetaElement_tid,
590 static dispex_static_data_t HTMLMetaElement_dispex = {
591 NULL,
592 DispHTMLMetaElement_tid,
593 HTMLMetaElement_iface_tids,
594 HTMLElement_init_dispex_info
597 HRESULT HTMLMetaElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
599 HTMLMetaElement *ret;
601 ret = heap_alloc_zero(sizeof(*ret));
602 if(!ret)
603 return E_OUTOFMEMORY;
605 ret->IHTMLMetaElement_iface.lpVtbl = &HTMLMetaElementVtbl;
606 ret->element.node.vtbl = &HTMLMetaElementImplVtbl;
608 HTMLElement_Init(&ret->element, doc, nselem, &HTMLMetaElement_dispex);
610 *elem = &ret->element;
611 return S_OK;
614 struct HTMLHeadElement {
615 HTMLElement element;
617 IHTMLHeadElement IHTMLHeadElement_iface;
620 static inline HTMLHeadElement *impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
622 return CONTAINING_RECORD(iface, HTMLHeadElement, IHTMLHeadElement_iface);
625 static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface,
626 REFIID riid, void **ppv)
628 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
630 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
633 static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
635 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
637 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
640 static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
642 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
644 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
647 static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
649 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
651 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
654 static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo,
655 LCID lcid, ITypeInfo **ppTInfo)
657 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
659 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
660 ppTInfo);
663 static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid,
664 LPOLESTR *rgszNames, UINT cNames,
665 LCID lcid, DISPID *rgDispId)
667 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
669 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
670 cNames, lcid, rgDispId);
673 static HRESULT WINAPI HTMLHeadElement_Invoke(IHTMLHeadElement *iface, DISPID dispIdMember,
674 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
675 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
677 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
679 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
680 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
683 static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
685 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
686 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
687 return E_NOTIMPL;
690 static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
692 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
693 FIXME("(%p)->(%p)\n", This, p);
694 return E_NOTIMPL;
697 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl = {
698 HTMLHeadElement_QueryInterface,
699 HTMLHeadElement_AddRef,
700 HTMLHeadElement_Release,
701 HTMLHeadElement_GetTypeInfoCount,
702 HTMLHeadElement_GetTypeInfo,
703 HTMLHeadElement_GetIDsOfNames,
704 HTMLHeadElement_Invoke,
705 HTMLHeadElement_put_profile,
706 HTMLHeadElement_get_profile
709 static inline HTMLHeadElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
711 return CONTAINING_RECORD(iface, HTMLHeadElement, element.node);
714 static HRESULT HTMLHeadElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
716 HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
718 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
720 if(IsEqualGUID(&IID_IHTMLHeadElement, riid))
721 *ppv = &This->IHTMLHeadElement_iface;
722 else if(IsEqualGUID(&DIID_DispHTMLHeadElement, riid))
723 *ppv = &This->IHTMLHeadElement_iface;
724 else
725 return HTMLElement_QI(&This->element.node, riid, ppv);
727 IUnknown_AddRef((IUnknown*)*ppv);
728 return S_OK;
731 static void HTMLHeadElement_destructor(HTMLDOMNode *iface)
733 HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
735 HTMLElement_destructor(&This->element.node);
738 static const NodeImplVtbl HTMLHeadElementImplVtbl = {
739 &CLSID_HTMLHeadElement,
740 HTMLHeadElement_QI,
741 HTMLHeadElement_destructor,
742 HTMLElement_cpc,
743 HTMLElement_clone,
744 HTMLElement_handle_event,
745 HTMLElement_get_attr_col
748 static const tid_t HTMLHeadElement_iface_tids[] = {
749 HTMLELEMENT_TIDS,
750 IHTMLHeadElement_tid,
753 static dispex_static_data_t HTMLHeadElement_dispex = {
754 NULL,
755 DispHTMLHeadElement_tid,
756 HTMLHeadElement_iface_tids,
757 HTMLElement_init_dispex_info
760 HRESULT HTMLHeadElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
762 HTMLHeadElement *ret;
764 ret = heap_alloc_zero(sizeof(*ret));
765 if(!ret)
766 return E_OUTOFMEMORY;
768 ret->IHTMLHeadElement_iface.lpVtbl = &HTMLHeadElementVtbl;
769 ret->element.node.vtbl = &HTMLHeadElementImplVtbl;
771 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHeadElement_dispex);
773 *elem = &ret->element;
774 return S_OK;