windows.networking.hostname/tests: Add IHostNameFactory::CreateHostName() tests.
[wine.git] / dlls / mshtml / htmlhead.c
blob072efd967b9222945000967ba0c50e0a91afff93
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 nsAString text;
107 nsresult nsres;
109 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
111 nsAString_InitDepend(&text, v);
112 nsres = nsIDOMNode_SetTextContent(This->element.node.nsnode, &text);
113 nsAString_Finish(&text);
115 return map_nsresult(nsres);
118 static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
120 HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
121 nsAString text;
122 nsresult nsres;
124 TRACE("(%p)->(%p)\n", This, p);
126 nsAString_InitDepend(&text, NULL);
127 nsres = nsIDOMNode_GetTextContent(This->element.node.nsnode, &text);
128 return return_nsstr(nsres, &text, p);
131 static const IHTMLTitleElementVtbl HTMLTitleElementVtbl = {
132 HTMLTitleElement_QueryInterface,
133 HTMLTitleElement_AddRef,
134 HTMLTitleElement_Release,
135 HTMLTitleElement_GetTypeInfoCount,
136 HTMLTitleElement_GetTypeInfo,
137 HTMLTitleElement_GetIDsOfNames,
138 HTMLTitleElement_Invoke,
139 HTMLTitleElement_put_text,
140 HTMLTitleElement_get_text
143 static inline HTMLTitleElement *HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode *iface)
145 return CONTAINING_RECORD(iface, HTMLTitleElement, element.node);
148 static HRESULT HTMLTitleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
150 HTMLTitleElement *This = HTMLTitleElement_from_HTMLDOMNode(iface);
152 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
154 if(IsEqualGUID(&IID_IHTMLTitleElement, riid))
155 *ppv = &This->IHTMLTitleElement_iface;
156 else
157 return HTMLElement_QI(&This->element.node, riid, ppv);
159 IUnknown_AddRef((IUnknown*)*ppv);
160 return S_OK;
163 static void HTMLTitleElement_destructor(HTMLDOMNode *iface)
165 HTMLTitleElement *This = HTMLTitleElement_from_HTMLDOMNode(iface);
167 HTMLElement_destructor(&This->element.node);
170 static const NodeImplVtbl HTMLTitleElementImplVtbl = {
171 &CLSID_HTMLTitleElement,
172 HTMLTitleElement_QI,
173 HTMLTitleElement_destructor,
174 HTMLElement_cpc,
175 HTMLElement_clone,
176 HTMLElement_handle_event,
177 HTMLElement_get_attr_col
180 static const tid_t HTMLTitleElement_iface_tids[] = {
181 HTMLELEMENT_TIDS,
182 IHTMLTitleElement_tid,
185 static dispex_static_data_t HTMLTitleElement_dispex = {
186 L"HTMLTitleElement",
187 NULL,
188 DispHTMLTitleElement_tid,
189 HTMLTitleElement_iface_tids,
190 HTMLElement_init_dispex_info
193 HRESULT HTMLTitleElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
195 HTMLTitleElement *ret;
197 ret = calloc(1, sizeof(*ret));
198 if(!ret)
199 return E_OUTOFMEMORY;
201 ret->IHTMLTitleElement_iface.lpVtbl = &HTMLTitleElementVtbl;
202 ret->element.node.vtbl = &HTMLTitleElementImplVtbl;
204 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTitleElement_dispex);
206 *elem = &ret->element;
207 return S_OK;
210 struct HTMLHtmlElement {
211 HTMLElement element;
213 IHTMLHtmlElement IHTMLHtmlElement_iface;
216 static inline HTMLHtmlElement *impl_from_IHTMLHtmlElement(IHTMLHtmlElement *iface)
218 return CONTAINING_RECORD(iface, HTMLHtmlElement, IHTMLHtmlElement_iface);
221 static HRESULT WINAPI HTMLHtmlElement_QueryInterface(IHTMLHtmlElement *iface,
222 REFIID riid, void **ppv)
224 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
226 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
229 static ULONG WINAPI HTMLHtmlElement_AddRef(IHTMLHtmlElement *iface)
231 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
233 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
236 static ULONG WINAPI HTMLHtmlElement_Release(IHTMLHtmlElement *iface)
238 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
240 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
243 static HRESULT WINAPI HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement *iface, UINT *pctinfo)
245 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
247 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
250 static HRESULT WINAPI HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement *iface, UINT iTInfo,
251 LCID lcid, ITypeInfo **ppTInfo)
253 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
255 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
256 ppTInfo);
259 static HRESULT WINAPI HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement *iface, REFIID riid,
260 LPOLESTR *rgszNames, UINT cNames,
261 LCID lcid, DISPID *rgDispId)
263 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
265 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
266 cNames, lcid, rgDispId);
269 static HRESULT WINAPI HTMLHtmlElement_Invoke(IHTMLHtmlElement *iface, DISPID dispIdMember,
270 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
271 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
273 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
275 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
276 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
279 static HRESULT WINAPI HTMLHtmlElement_put_version(IHTMLHtmlElement *iface, BSTR v)
281 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
282 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
283 return E_NOTIMPL;
286 static HRESULT WINAPI HTMLHtmlElement_get_version(IHTMLHtmlElement *iface, BSTR *p)
288 HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
289 FIXME("(%p)->(%p)\n", This, p);
290 return E_NOTIMPL;
293 static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl = {
294 HTMLHtmlElement_QueryInterface,
295 HTMLHtmlElement_AddRef,
296 HTMLHtmlElement_Release,
297 HTMLHtmlElement_GetTypeInfoCount,
298 HTMLHtmlElement_GetTypeInfo,
299 HTMLHtmlElement_GetIDsOfNames,
300 HTMLHtmlElement_Invoke,
301 HTMLHtmlElement_put_version,
302 HTMLHtmlElement_get_version
305 static inline HTMLHtmlElement *HTMLHtmlElement_from_HTMLDOMNode(HTMLDOMNode *iface)
307 return CONTAINING_RECORD(iface, HTMLHtmlElement, element.node);
310 static HRESULT HTMLHtmlElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
312 HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
314 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
316 if(IsEqualGUID(&IID_IHTMLHtmlElement, riid))
317 *ppv = &This->IHTMLHtmlElement_iface;
318 else
319 return HTMLElement_QI(&This->element.node, riid, ppv);
321 IUnknown_AddRef((IUnknown*)*ppv);
322 return S_OK;
325 static void HTMLHtmlElement_destructor(HTMLDOMNode *iface)
327 HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
329 HTMLElement_destructor(&This->element.node);
332 static BOOL HTMLHtmlElement_is_settable(HTMLDOMNode *iface, DISPID dispid)
334 switch(dispid) {
335 case DISPID_IHTMLELEMENT_OUTERTEXT:
336 return FALSE;
337 default:
338 return TRUE;
342 static const NodeImplVtbl HTMLHtmlElementImplVtbl = {
343 &CLSID_HTMLHtmlElement,
344 HTMLHtmlElement_QI,
345 HTMLHtmlElement_destructor,
346 HTMLElement_cpc,
347 HTMLElement_clone,
348 HTMLElement_handle_event,
349 HTMLElement_get_attr_col,
350 NULL,
351 NULL,
352 NULL,
353 NULL,
354 NULL,
355 NULL,
356 NULL,
357 NULL,
358 NULL,
359 NULL,
360 NULL,
361 NULL,
362 HTMLHtmlElement_is_settable
365 static const tid_t HTMLHtmlElement_iface_tids[] = {
366 HTMLELEMENT_TIDS,
367 IHTMLHtmlElement_tid,
370 static dispex_static_data_t HTMLHtmlElement_dispex = {
371 L"HTMLHtmlElement",
372 NULL,
373 DispHTMLHtmlElement_tid,
374 HTMLHtmlElement_iface_tids,
375 HTMLElement_init_dispex_info
378 HRESULT HTMLHtmlElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
380 HTMLHtmlElement *ret;
382 ret = calloc(1, sizeof(*ret));
383 if(!ret)
384 return E_OUTOFMEMORY;
386 ret->IHTMLHtmlElement_iface.lpVtbl = &HTMLHtmlElementVtbl;
387 ret->element.node.vtbl = &HTMLHtmlElementImplVtbl;
389 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHtmlElement_dispex);
391 *elem = &ret->element;
392 return S_OK;
395 struct HTMLMetaElement {
396 HTMLElement element;
398 IHTMLMetaElement IHTMLMetaElement_iface;
401 static inline HTMLMetaElement *impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
403 return CONTAINING_RECORD(iface, HTMLMetaElement, IHTMLMetaElement_iface);
406 static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
408 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
410 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
413 static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
415 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
417 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
420 static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
422 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
424 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
427 static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
429 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
430 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
433 static HRESULT WINAPI HTMLMetaElement_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo,
434 LCID lcid, ITypeInfo **ppTInfo)
436 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
437 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
438 ppTInfo);
441 static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid,
442 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
444 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
445 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
446 cNames, lcid, rgDispId);
449 static HRESULT WINAPI HTMLMetaElement_Invoke(IHTMLMetaElement *iface, DISPID dispIdMember, REFIID riid,
450 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
451 UINT *puArgErr)
453 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
454 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
455 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
458 static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
460 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
461 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
462 return E_NOTIMPL;
465 static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
467 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
469 TRACE("(%p)->(%p)\n", This, p);
471 return elem_string_attr_getter(&This->element, L"http-equiv", TRUE, p);
474 static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
476 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
477 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
478 return E_NOTIMPL;
481 static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
483 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
485 TRACE("(%p)->(%p)\n", This, p);
487 return elem_string_attr_getter(&This->element, L"content", TRUE, p);
490 static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
492 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
493 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
494 return E_NOTIMPL;
497 static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
499 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
501 TRACE("(%p)->(%p)\n", This, p);
503 return elem_string_attr_getter(&This->element, L"name", TRUE, p);
506 static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
508 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
509 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
510 return E_NOTIMPL;
513 static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
515 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
516 FIXME("(%p)->(%p)\n", This, p);
517 return E_NOTIMPL;
520 static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
522 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
524 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
526 return elem_string_attr_setter(&This->element, L"charset", v);
529 static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
531 HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
533 TRACE("(%p)->(%p)\n", This, p);
535 return elem_string_attr_getter(&This->element, L"charset", TRUE, p);
538 static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
539 HTMLMetaElement_QueryInterface,
540 HTMLMetaElement_AddRef,
541 HTMLMetaElement_Release,
542 HTMLMetaElement_GetTypeInfoCount,
543 HTMLMetaElement_GetTypeInfo,
544 HTMLMetaElement_GetIDsOfNames,
545 HTMLMetaElement_Invoke,
546 HTMLMetaElement_put_httpEquiv,
547 HTMLMetaElement_get_httpEquiv,
548 HTMLMetaElement_put_content,
549 HTMLMetaElement_get_content,
550 HTMLMetaElement_put_name,
551 HTMLMetaElement_get_name,
552 HTMLMetaElement_put_url,
553 HTMLMetaElement_get_url,
554 HTMLMetaElement_put_charset,
555 HTMLMetaElement_get_charset
558 static inline HTMLMetaElement *HTMLMetaElement_from_HTMLDOMNode(HTMLDOMNode *iface)
560 return CONTAINING_RECORD(iface, HTMLMetaElement, element.node);
563 static HRESULT HTMLMetaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
565 HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
567 if(IsEqualGUID(&IID_IUnknown, riid)) {
568 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
569 *ppv = &This->IHTMLMetaElement_iface;
570 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
571 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
572 *ppv = &This->IHTMLMetaElement_iface;
573 }else if(IsEqualGUID(&IID_IHTMLMetaElement, riid)) {
574 TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This, ppv);
575 *ppv = &This->IHTMLMetaElement_iface;
576 }else {
577 return HTMLElement_QI(&This->element.node, riid, ppv);
580 IUnknown_AddRef((IUnknown*)*ppv);
581 return S_OK;
584 static void HTMLMetaElement_destructor(HTMLDOMNode *iface)
586 HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
588 HTMLElement_destructor(&This->element.node);
591 static const NodeImplVtbl HTMLMetaElementImplVtbl = {
592 &CLSID_HTMLMetaElement,
593 HTMLMetaElement_QI,
594 HTMLMetaElement_destructor,
595 HTMLElement_cpc,
596 HTMLElement_clone,
597 HTMLElement_handle_event,
598 HTMLElement_get_attr_col
601 static const tid_t HTMLMetaElement_iface_tids[] = {
602 HTMLELEMENT_TIDS,
603 IHTMLMetaElement_tid,
607 static dispex_static_data_t HTMLMetaElement_dispex = {
608 L"HTMLMetaElement",
609 NULL,
610 DispHTMLMetaElement_tid,
611 HTMLMetaElement_iface_tids,
612 HTMLElement_init_dispex_info
615 HRESULT HTMLMetaElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
617 HTMLMetaElement *ret;
619 ret = calloc(1, sizeof(*ret));
620 if(!ret)
621 return E_OUTOFMEMORY;
623 ret->IHTMLMetaElement_iface.lpVtbl = &HTMLMetaElementVtbl;
624 ret->element.node.vtbl = &HTMLMetaElementImplVtbl;
626 HTMLElement_Init(&ret->element, doc, nselem, &HTMLMetaElement_dispex);
628 *elem = &ret->element;
629 return S_OK;
632 struct HTMLHeadElement {
633 HTMLElement element;
635 IHTMLHeadElement IHTMLHeadElement_iface;
638 static inline HTMLHeadElement *impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
640 return CONTAINING_RECORD(iface, HTMLHeadElement, IHTMLHeadElement_iface);
643 static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface,
644 REFIID riid, void **ppv)
646 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
648 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
651 static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
653 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
655 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
658 static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
660 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
662 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
665 static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
667 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
669 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
672 static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo,
673 LCID lcid, ITypeInfo **ppTInfo)
675 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
677 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
678 ppTInfo);
681 static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid,
682 LPOLESTR *rgszNames, UINT cNames,
683 LCID lcid, DISPID *rgDispId)
685 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
687 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
688 cNames, lcid, rgDispId);
691 static HRESULT WINAPI HTMLHeadElement_Invoke(IHTMLHeadElement *iface, DISPID dispIdMember,
692 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
693 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
695 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
697 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
698 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
701 static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
703 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
704 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
705 return E_NOTIMPL;
708 static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
710 HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
711 FIXME("(%p)->(%p)\n", This, p);
712 return E_NOTIMPL;
715 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl = {
716 HTMLHeadElement_QueryInterface,
717 HTMLHeadElement_AddRef,
718 HTMLHeadElement_Release,
719 HTMLHeadElement_GetTypeInfoCount,
720 HTMLHeadElement_GetTypeInfo,
721 HTMLHeadElement_GetIDsOfNames,
722 HTMLHeadElement_Invoke,
723 HTMLHeadElement_put_profile,
724 HTMLHeadElement_get_profile
727 static inline HTMLHeadElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
729 return CONTAINING_RECORD(iface, HTMLHeadElement, element.node);
732 static HRESULT HTMLHeadElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
734 HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
736 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
738 if(IsEqualGUID(&IID_IHTMLHeadElement, riid))
739 *ppv = &This->IHTMLHeadElement_iface;
740 else if(IsEqualGUID(&DIID_DispHTMLHeadElement, riid))
741 *ppv = &This->IHTMLHeadElement_iface;
742 else
743 return HTMLElement_QI(&This->element.node, riid, ppv);
745 IUnknown_AddRef((IUnknown*)*ppv);
746 return S_OK;
749 static void HTMLHeadElement_destructor(HTMLDOMNode *iface)
751 HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
753 HTMLElement_destructor(&This->element.node);
756 static const NodeImplVtbl HTMLHeadElementImplVtbl = {
757 &CLSID_HTMLHeadElement,
758 HTMLHeadElement_QI,
759 HTMLHeadElement_destructor,
760 HTMLElement_cpc,
761 HTMLElement_clone,
762 HTMLElement_handle_event,
763 HTMLElement_get_attr_col
766 static const tid_t HTMLHeadElement_iface_tids[] = {
767 HTMLELEMENT_TIDS,
768 IHTMLHeadElement_tid,
771 static dispex_static_data_t HTMLHeadElement_dispex = {
772 L"HTMLHeadElement",
773 NULL,
774 DispHTMLHeadElement_tid,
775 HTMLHeadElement_iface_tids,
776 HTMLElement_init_dispex_info
779 HRESULT HTMLHeadElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
781 HTMLHeadElement *ret;
783 ret = calloc(1, sizeof(*ret));
784 if(!ret)
785 return E_OUTOFMEMORY;
787 ret->IHTMLHeadElement_iface.lpVtbl = &HTMLHeadElementVtbl;
788 ret->element.node.vtbl = &HTMLHeadElementImplVtbl;
790 HTMLElement_Init(&ret->element, doc, nselem, &HTMLHeadElement_dispex);
792 *elem = &ret->element;
793 return S_OK;