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
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
35 struct HTMLTitleElement
{
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
,
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
);
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
);
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
;
157 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
159 IUnknown_AddRef((IUnknown
*)*ppv
);
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
,
173 HTMLTitleElement_destructor
,
176 HTMLElement_dispatch_nsevent_hook
,
177 HTMLElement_handle_event
,
178 HTMLElement_get_attr_col
181 static const tid_t HTMLTitleElement_iface_tids
[] = {
183 IHTMLTitleElement_tid
,
186 static dispex_static_data_t HTMLTitleElement_dispex
= {
189 DispHTMLTitleElement_tid
,
190 HTMLTitleElement_iface_tids
,
191 HTMLElement_init_dispex_info
194 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
196 HTMLTitleElement
*ret
;
198 ret
= calloc(1, sizeof(*ret
));
200 return E_OUTOFMEMORY
;
202 ret
->IHTMLTitleElement_iface
.lpVtbl
= &HTMLTitleElementVtbl
;
203 ret
->element
.node
.vtbl
= &HTMLTitleElementImplVtbl
;
205 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTitleElement_dispex
);
207 *elem
= &ret
->element
;
211 struct HTMLHtmlElement
{
214 IHTMLHtmlElement IHTMLHtmlElement_iface
;
217 static inline HTMLHtmlElement
*impl_from_IHTMLHtmlElement(IHTMLHtmlElement
*iface
)
219 return CONTAINING_RECORD(iface
, HTMLHtmlElement
, IHTMLHtmlElement_iface
);
222 static HRESULT WINAPI
HTMLHtmlElement_QueryInterface(IHTMLHtmlElement
*iface
,
223 REFIID riid
, void **ppv
)
225 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
227 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
230 static ULONG WINAPI
HTMLHtmlElement_AddRef(IHTMLHtmlElement
*iface
)
232 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
234 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
237 static ULONG WINAPI
HTMLHtmlElement_Release(IHTMLHtmlElement
*iface
)
239 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
241 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
244 static HRESULT WINAPI
HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement
*iface
, UINT
*pctinfo
)
246 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
248 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
251 static HRESULT WINAPI
HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement
*iface
, UINT iTInfo
,
252 LCID lcid
, ITypeInfo
**ppTInfo
)
254 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
256 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
260 static HRESULT WINAPI
HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement
*iface
, REFIID riid
,
261 LPOLESTR
*rgszNames
, UINT cNames
,
262 LCID lcid
, DISPID
*rgDispId
)
264 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
266 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
267 cNames
, lcid
, rgDispId
);
270 static HRESULT WINAPI
HTMLHtmlElement_Invoke(IHTMLHtmlElement
*iface
, DISPID dispIdMember
,
271 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
272 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
274 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
276 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
277 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
280 static HRESULT WINAPI
HTMLHtmlElement_put_version(IHTMLHtmlElement
*iface
, BSTR v
)
282 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
283 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
287 static HRESULT WINAPI
HTMLHtmlElement_get_version(IHTMLHtmlElement
*iface
, BSTR
*p
)
289 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
290 FIXME("(%p)->(%p)\n", This
, p
);
294 static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl
= {
295 HTMLHtmlElement_QueryInterface
,
296 HTMLHtmlElement_AddRef
,
297 HTMLHtmlElement_Release
,
298 HTMLHtmlElement_GetTypeInfoCount
,
299 HTMLHtmlElement_GetTypeInfo
,
300 HTMLHtmlElement_GetIDsOfNames
,
301 HTMLHtmlElement_Invoke
,
302 HTMLHtmlElement_put_version
,
303 HTMLHtmlElement_get_version
306 static inline HTMLHtmlElement
*HTMLHtmlElement_from_HTMLDOMNode(HTMLDOMNode
*iface
)
308 return CONTAINING_RECORD(iface
, HTMLHtmlElement
, element
.node
);
311 static HRESULT
HTMLHtmlElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
313 HTMLHtmlElement
*This
= HTMLHtmlElement_from_HTMLDOMNode(iface
);
315 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
317 if(IsEqualGUID(&IID_IHTMLHtmlElement
, riid
))
318 *ppv
= &This
->IHTMLHtmlElement_iface
;
320 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
322 IUnknown_AddRef((IUnknown
*)*ppv
);
326 static void HTMLHtmlElement_destructor(HTMLDOMNode
*iface
)
328 HTMLHtmlElement
*This
= HTMLHtmlElement_from_HTMLDOMNode(iface
);
330 HTMLElement_destructor(&This
->element
.node
);
333 static BOOL
HTMLHtmlElement_is_settable(HTMLDOMNode
*iface
, DISPID dispid
)
336 case DISPID_IHTMLELEMENT_OUTERTEXT
:
343 static const NodeImplVtbl HTMLHtmlElementImplVtbl
= {
344 &CLSID_HTMLHtmlElement
,
346 HTMLHtmlElement_destructor
,
349 HTMLElement_dispatch_nsevent_hook
,
350 HTMLElement_handle_event
,
351 HTMLElement_get_attr_col
,
364 HTMLHtmlElement_is_settable
367 static const tid_t HTMLHtmlElement_iface_tids
[] = {
369 IHTMLHtmlElement_tid
,
372 static dispex_static_data_t HTMLHtmlElement_dispex
= {
375 DispHTMLHtmlElement_tid
,
376 HTMLHtmlElement_iface_tids
,
377 HTMLElement_init_dispex_info
380 HRESULT
HTMLHtmlElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
382 HTMLHtmlElement
*ret
;
384 ret
= calloc(1, sizeof(*ret
));
386 return E_OUTOFMEMORY
;
388 ret
->IHTMLHtmlElement_iface
.lpVtbl
= &HTMLHtmlElementVtbl
;
389 ret
->element
.node
.vtbl
= &HTMLHtmlElementImplVtbl
;
391 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHtmlElement_dispex
);
393 *elem
= &ret
->element
;
397 struct HTMLMetaElement
{
400 IHTMLMetaElement IHTMLMetaElement_iface
;
403 static inline HTMLMetaElement
*impl_from_IHTMLMetaElement(IHTMLMetaElement
*iface
)
405 return CONTAINING_RECORD(iface
, HTMLMetaElement
, IHTMLMetaElement_iface
);
408 static HRESULT WINAPI
HTMLMetaElement_QueryInterface(IHTMLMetaElement
*iface
, REFIID riid
, void **ppv
)
410 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
412 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
415 static ULONG WINAPI
HTMLMetaElement_AddRef(IHTMLMetaElement
*iface
)
417 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
419 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
422 static ULONG WINAPI
HTMLMetaElement_Release(IHTMLMetaElement
*iface
)
424 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
426 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
429 static HRESULT WINAPI
HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement
*iface
, UINT
*pctinfo
)
431 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
432 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
435 static HRESULT WINAPI
HTMLMetaElement_GetTypeInfo(IHTMLMetaElement
*iface
, UINT iTInfo
,
436 LCID lcid
, ITypeInfo
**ppTInfo
)
438 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
439 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
443 static HRESULT WINAPI
HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement
*iface
, REFIID riid
,
444 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
446 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
447 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
448 cNames
, lcid
, rgDispId
);
451 static HRESULT WINAPI
HTMLMetaElement_Invoke(IHTMLMetaElement
*iface
, DISPID dispIdMember
, REFIID riid
,
452 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
,
455 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
456 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
457 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
460 static HRESULT WINAPI
HTMLMetaElement_put_httpEquiv(IHTMLMetaElement
*iface
, BSTR v
)
462 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
463 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
467 static HRESULT WINAPI
HTMLMetaElement_get_httpEquiv(IHTMLMetaElement
*iface
, BSTR
*p
)
469 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
471 TRACE("(%p)->(%p)\n", This
, p
);
473 return elem_string_attr_getter(&This
->element
, L
"http-equiv", TRUE
, p
);
476 static HRESULT WINAPI
HTMLMetaElement_put_content(IHTMLMetaElement
*iface
, BSTR v
)
478 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
479 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
483 static HRESULT WINAPI
HTMLMetaElement_get_content(IHTMLMetaElement
*iface
, BSTR
*p
)
485 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
487 TRACE("(%p)->(%p)\n", This
, p
);
489 return elem_string_attr_getter(&This
->element
, L
"content", TRUE
, p
);
492 static HRESULT WINAPI
HTMLMetaElement_put_name(IHTMLMetaElement
*iface
, BSTR v
)
494 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
495 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
499 static HRESULT WINAPI
HTMLMetaElement_get_name(IHTMLMetaElement
*iface
, BSTR
*p
)
501 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
503 TRACE("(%p)->(%p)\n", This
, p
);
505 return elem_string_attr_getter(&This
->element
, L
"name", TRUE
, p
);
508 static HRESULT WINAPI
HTMLMetaElement_put_url(IHTMLMetaElement
*iface
, BSTR v
)
510 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
511 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
515 static HRESULT WINAPI
HTMLMetaElement_get_url(IHTMLMetaElement
*iface
, BSTR
*p
)
517 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
518 FIXME("(%p)->(%p)\n", This
, p
);
522 static HRESULT WINAPI
HTMLMetaElement_put_charset(IHTMLMetaElement
*iface
, BSTR v
)
524 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
526 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
528 return elem_string_attr_setter(&This
->element
, L
"charset", v
);
531 static HRESULT WINAPI
HTMLMetaElement_get_charset(IHTMLMetaElement
*iface
, BSTR
*p
)
533 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
535 TRACE("(%p)->(%p)\n", This
, p
);
537 return elem_string_attr_getter(&This
->element
, L
"charset", TRUE
, p
);
540 static const IHTMLMetaElementVtbl HTMLMetaElementVtbl
= {
541 HTMLMetaElement_QueryInterface
,
542 HTMLMetaElement_AddRef
,
543 HTMLMetaElement_Release
,
544 HTMLMetaElement_GetTypeInfoCount
,
545 HTMLMetaElement_GetTypeInfo
,
546 HTMLMetaElement_GetIDsOfNames
,
547 HTMLMetaElement_Invoke
,
548 HTMLMetaElement_put_httpEquiv
,
549 HTMLMetaElement_get_httpEquiv
,
550 HTMLMetaElement_put_content
,
551 HTMLMetaElement_get_content
,
552 HTMLMetaElement_put_name
,
553 HTMLMetaElement_get_name
,
554 HTMLMetaElement_put_url
,
555 HTMLMetaElement_get_url
,
556 HTMLMetaElement_put_charset
,
557 HTMLMetaElement_get_charset
560 static inline HTMLMetaElement
*HTMLMetaElement_from_HTMLDOMNode(HTMLDOMNode
*iface
)
562 return CONTAINING_RECORD(iface
, HTMLMetaElement
, element
.node
);
565 static HRESULT
HTMLMetaElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
567 HTMLMetaElement
*This
= HTMLMetaElement_from_HTMLDOMNode(iface
);
569 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
570 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
571 *ppv
= &This
->IHTMLMetaElement_iface
;
572 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
573 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
574 *ppv
= &This
->IHTMLMetaElement_iface
;
575 }else if(IsEqualGUID(&IID_IHTMLMetaElement
, riid
)) {
576 TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This
, ppv
);
577 *ppv
= &This
->IHTMLMetaElement_iface
;
579 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
582 IUnknown_AddRef((IUnknown
*)*ppv
);
586 static void HTMLMetaElement_destructor(HTMLDOMNode
*iface
)
588 HTMLMetaElement
*This
= HTMLMetaElement_from_HTMLDOMNode(iface
);
590 HTMLElement_destructor(&This
->element
.node
);
593 static const NodeImplVtbl HTMLMetaElementImplVtbl
= {
594 &CLSID_HTMLMetaElement
,
596 HTMLMetaElement_destructor
,
599 HTMLElement_dispatch_nsevent_hook
,
600 HTMLElement_handle_event
,
601 HTMLElement_get_attr_col
604 static const tid_t HTMLMetaElement_iface_tids
[] = {
606 IHTMLMetaElement_tid
,
610 static dispex_static_data_t HTMLMetaElement_dispex
= {
613 DispHTMLMetaElement_tid
,
614 HTMLMetaElement_iface_tids
,
615 HTMLElement_init_dispex_info
618 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
620 HTMLMetaElement
*ret
;
622 ret
= calloc(1, sizeof(*ret
));
624 return E_OUTOFMEMORY
;
626 ret
->IHTMLMetaElement_iface
.lpVtbl
= &HTMLMetaElementVtbl
;
627 ret
->element
.node
.vtbl
= &HTMLMetaElementImplVtbl
;
629 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLMetaElement_dispex
);
631 *elem
= &ret
->element
;
635 struct HTMLHeadElement
{
638 IHTMLHeadElement IHTMLHeadElement_iface
;
641 static inline HTMLHeadElement
*impl_from_IHTMLHeadElement(IHTMLHeadElement
*iface
)
643 return CONTAINING_RECORD(iface
, HTMLHeadElement
, IHTMLHeadElement_iface
);
646 static HRESULT WINAPI
HTMLHeadElement_QueryInterface(IHTMLHeadElement
*iface
,
647 REFIID riid
, void **ppv
)
649 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
651 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
654 static ULONG WINAPI
HTMLHeadElement_AddRef(IHTMLHeadElement
*iface
)
656 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
658 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
661 static ULONG WINAPI
HTMLHeadElement_Release(IHTMLHeadElement
*iface
)
663 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
665 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
668 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement
*iface
, UINT
*pctinfo
)
670 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
672 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
675 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfo(IHTMLHeadElement
*iface
, UINT iTInfo
,
676 LCID lcid
, ITypeInfo
**ppTInfo
)
678 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
680 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
684 static HRESULT WINAPI
HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement
*iface
, REFIID riid
,
685 LPOLESTR
*rgszNames
, UINT cNames
,
686 LCID lcid
, DISPID
*rgDispId
)
688 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
690 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
691 cNames
, lcid
, rgDispId
);
694 static HRESULT WINAPI
HTMLHeadElement_Invoke(IHTMLHeadElement
*iface
, DISPID dispIdMember
,
695 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
696 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
698 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
700 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
701 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
704 static HRESULT WINAPI
HTMLHeadElement_put_profile(IHTMLHeadElement
*iface
, BSTR v
)
706 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
707 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
711 static HRESULT WINAPI
HTMLHeadElement_get_profile(IHTMLHeadElement
*iface
, BSTR
*p
)
713 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
714 FIXME("(%p)->(%p)\n", This
, p
);
718 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
= {
719 HTMLHeadElement_QueryInterface
,
720 HTMLHeadElement_AddRef
,
721 HTMLHeadElement_Release
,
722 HTMLHeadElement_GetTypeInfoCount
,
723 HTMLHeadElement_GetTypeInfo
,
724 HTMLHeadElement_GetIDsOfNames
,
725 HTMLHeadElement_Invoke
,
726 HTMLHeadElement_put_profile
,
727 HTMLHeadElement_get_profile
730 static inline HTMLHeadElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
732 return CONTAINING_RECORD(iface
, HTMLHeadElement
, element
.node
);
735 static HRESULT
HTMLHeadElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
737 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
739 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
741 if(IsEqualGUID(&IID_IHTMLHeadElement
, riid
))
742 *ppv
= &This
->IHTMLHeadElement_iface
;
743 else if(IsEqualGUID(&DIID_DispHTMLHeadElement
, riid
))
744 *ppv
= &This
->IHTMLHeadElement_iface
;
746 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
748 IUnknown_AddRef((IUnknown
*)*ppv
);
752 static void HTMLHeadElement_destructor(HTMLDOMNode
*iface
)
754 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
756 HTMLElement_destructor(&This
->element
.node
);
759 static const NodeImplVtbl HTMLHeadElementImplVtbl
= {
760 &CLSID_HTMLHeadElement
,
762 HTMLHeadElement_destructor
,
765 HTMLElement_dispatch_nsevent_hook
,
766 HTMLElement_handle_event
,
767 HTMLElement_get_attr_col
770 static const tid_t HTMLHeadElement_iface_tids
[] = {
772 IHTMLHeadElement_tid
,
775 static dispex_static_data_t HTMLHeadElement_dispex
= {
778 DispHTMLHeadElement_tid
,
779 HTMLHeadElement_iface_tids
,
780 HTMLElement_init_dispex_info
783 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
785 HTMLHeadElement
*ret
;
787 ret
= calloc(1, sizeof(*ret
));
789 return E_OUTOFMEMORY
;
791 ret
->IHTMLHeadElement_iface
.lpVtbl
= &HTMLHeadElementVtbl
;
792 ret
->element
.node
.vtbl
= &HTMLHeadElementImplVtbl
;
794 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHeadElement_dispex
);
796 *elem
= &ret
->element
;