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"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
36 struct HTMLTitleElement
{
39 IHTMLTitleElement IHTMLTitleElement_iface
;
42 static inline HTMLTitleElement
*impl_from_IHTMLTitleElement(IHTMLTitleElement
*iface
)
44 return CONTAINING_RECORD(iface
, HTMLTitleElement
, IHTMLTitleElement_iface
);
47 static HRESULT WINAPI
HTMLTitleElement_QueryInterface(IHTMLTitleElement
*iface
,
48 REFIID riid
, void **ppv
)
50 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
52 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
55 static ULONG WINAPI
HTMLTitleElement_AddRef(IHTMLTitleElement
*iface
)
57 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
59 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
62 static ULONG WINAPI
HTMLTitleElement_Release(IHTMLTitleElement
*iface
)
64 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
66 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
69 static HRESULT WINAPI
HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement
*iface
, UINT
*pctinfo
)
71 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
73 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
76 static HRESULT WINAPI
HTMLTitleElement_GetTypeInfo(IHTMLTitleElement
*iface
, UINT iTInfo
,
77 LCID lcid
, ITypeInfo
**ppTInfo
)
79 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
81 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
85 static HRESULT WINAPI
HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement
*iface
, REFIID riid
,
86 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
88 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
90 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
91 cNames
, lcid
, rgDispId
);
94 static HRESULT WINAPI
HTMLTitleElement_Invoke(IHTMLTitleElement
*iface
, DISPID dispIdMember
,
95 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
96 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
98 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
100 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
101 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
104 static HRESULT WINAPI
HTMLTitleElement_put_text(IHTMLTitleElement
*iface
, BSTR v
)
106 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
110 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
112 nsAString_InitDepend(&text
, v
);
113 nsres
= nsIDOMNode_SetTextContent(This
->element
.node
.nsnode
, &text
);
114 nsAString_Finish(&text
);
116 return map_nsresult(nsres
);
119 static HRESULT WINAPI
HTMLTitleElement_get_text(IHTMLTitleElement
*iface
, BSTR
*p
)
121 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
125 TRACE("(%p)->(%p)\n", This
, p
);
127 nsAString_InitDepend(&text
, NULL
);
128 nsres
= nsIDOMNode_GetTextContent(This
->element
.node
.nsnode
, &text
);
129 return return_nsstr(nsres
, &text
, p
);
132 static const IHTMLTitleElementVtbl HTMLTitleElementVtbl
= {
133 HTMLTitleElement_QueryInterface
,
134 HTMLTitleElement_AddRef
,
135 HTMLTitleElement_Release
,
136 HTMLTitleElement_GetTypeInfoCount
,
137 HTMLTitleElement_GetTypeInfo
,
138 HTMLTitleElement_GetIDsOfNames
,
139 HTMLTitleElement_Invoke
,
140 HTMLTitleElement_put_text
,
141 HTMLTitleElement_get_text
144 static inline HTMLTitleElement
*HTMLTitleElement_from_DispatchEx(DispatchEx
*iface
)
146 return CONTAINING_RECORD(iface
, HTMLTitleElement
, element
.node
.event_target
.dispex
);
149 static void *HTMLTitleElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
151 HTMLTitleElement
*This
= HTMLTitleElement_from_DispatchEx(dispex
);
153 if(IsEqualGUID(&IID_IHTMLTitleElement
, riid
))
154 return &This
->IHTMLTitleElement_iface
;
156 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
159 static const NodeImplVtbl HTMLTitleElementImplVtbl
= {
160 .clsid
= &CLSID_HTMLTitleElement
,
161 .cpc_entries
= HTMLElement_cpc
,
162 .clone
= HTMLElement_clone
,
163 .get_attr_col
= HTMLElement_get_attr_col
166 static const event_target_vtbl_t HTMLTitleElement_event_target_vtbl
= {
168 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
169 .query_interface
= HTMLTitleElement_query_interface
,
170 .destructor
= HTMLElement_destructor
,
171 .traverse
= HTMLDOMNode_traverse
,
172 .unlink
= HTMLDOMNode_unlink
174 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
175 .handle_event
= HTMLElement_handle_event
178 static const tid_t HTMLTitleElement_iface_tids
[] = {
180 IHTMLTitleElement_tid
,
183 static dispex_static_data_t HTMLTitleElement_dispex
= {
185 &HTMLTitleElement_event_target_vtbl
.dispex_vtbl
,
186 DispHTMLTitleElement_tid
,
187 HTMLTitleElement_iface_tids
,
188 HTMLElement_init_dispex_info
191 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
193 HTMLTitleElement
*ret
;
195 ret
= calloc(1, sizeof(*ret
));
197 return E_OUTOFMEMORY
;
199 ret
->IHTMLTitleElement_iface
.lpVtbl
= &HTMLTitleElementVtbl
;
200 ret
->element
.node
.vtbl
= &HTMLTitleElementImplVtbl
;
202 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTitleElement_dispex
);
204 *elem
= &ret
->element
;
208 struct HTMLHtmlElement
{
211 IHTMLHtmlElement IHTMLHtmlElement_iface
;
214 static inline HTMLHtmlElement
*impl_from_IHTMLHtmlElement(IHTMLHtmlElement
*iface
)
216 return CONTAINING_RECORD(iface
, HTMLHtmlElement
, IHTMLHtmlElement_iface
);
219 static HRESULT WINAPI
HTMLHtmlElement_QueryInterface(IHTMLHtmlElement
*iface
,
220 REFIID riid
, void **ppv
)
222 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
224 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
227 static ULONG WINAPI
HTMLHtmlElement_AddRef(IHTMLHtmlElement
*iface
)
229 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
231 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
234 static ULONG WINAPI
HTMLHtmlElement_Release(IHTMLHtmlElement
*iface
)
236 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
238 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
241 static HRESULT WINAPI
HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement
*iface
, UINT
*pctinfo
)
243 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
245 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
248 static HRESULT WINAPI
HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement
*iface
, UINT iTInfo
,
249 LCID lcid
, ITypeInfo
**ppTInfo
)
251 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
253 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
257 static HRESULT WINAPI
HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement
*iface
, REFIID riid
,
258 LPOLESTR
*rgszNames
, UINT cNames
,
259 LCID lcid
, DISPID
*rgDispId
)
261 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
263 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
264 cNames
, lcid
, rgDispId
);
267 static HRESULT WINAPI
HTMLHtmlElement_Invoke(IHTMLHtmlElement
*iface
, DISPID dispIdMember
,
268 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
269 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
271 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
273 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
274 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
277 static HRESULT WINAPI
HTMLHtmlElement_put_version(IHTMLHtmlElement
*iface
, BSTR v
)
279 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
280 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
284 static HRESULT WINAPI
HTMLHtmlElement_get_version(IHTMLHtmlElement
*iface
, BSTR
*p
)
286 HTMLHtmlElement
*This
= impl_from_IHTMLHtmlElement(iface
);
287 FIXME("(%p)->(%p)\n", This
, p
);
291 static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl
= {
292 HTMLHtmlElement_QueryInterface
,
293 HTMLHtmlElement_AddRef
,
294 HTMLHtmlElement_Release
,
295 HTMLHtmlElement_GetTypeInfoCount
,
296 HTMLHtmlElement_GetTypeInfo
,
297 HTMLHtmlElement_GetIDsOfNames
,
298 HTMLHtmlElement_Invoke
,
299 HTMLHtmlElement_put_version
,
300 HTMLHtmlElement_get_version
303 static inline HTMLHtmlElement
*HTMLHtmlElement_from_DispatchEx(DispatchEx
*iface
)
305 return CONTAINING_RECORD(iface
, HTMLHtmlElement
, element
.node
.event_target
.dispex
);
308 static BOOL
HTMLHtmlElement_is_settable(HTMLDOMNode
*iface
, DISPID dispid
)
311 case DISPID_IHTMLELEMENT_OUTERTEXT
:
318 static void *HTMLHtmlElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
320 HTMLHtmlElement
*This
= HTMLHtmlElement_from_DispatchEx(dispex
);
322 if(IsEqualGUID(&IID_IHTMLHtmlElement
, riid
))
323 return &This
->IHTMLHtmlElement_iface
;
325 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
328 static const NodeImplVtbl HTMLHtmlElementImplVtbl
= {
329 .clsid
= &CLSID_HTMLHtmlElement
,
330 .cpc_entries
= HTMLElement_cpc
,
331 .clone
= HTMLElement_clone
,
332 .get_attr_col
= HTMLElement_get_attr_col
,
333 .is_settable
= HTMLHtmlElement_is_settable
336 static const event_target_vtbl_t HTMLHtmlElement_event_target_vtbl
= {
338 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
339 .query_interface
= HTMLHtmlElement_query_interface
,
340 .destructor
= HTMLElement_destructor
,
341 .traverse
= HTMLDOMNode_traverse
,
342 .unlink
= HTMLDOMNode_unlink
344 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
345 .handle_event
= HTMLElement_handle_event
348 static const tid_t HTMLHtmlElement_iface_tids
[] = {
350 IHTMLHtmlElement_tid
,
353 static dispex_static_data_t HTMLHtmlElement_dispex
= {
355 &HTMLHtmlElement_event_target_vtbl
.dispex_vtbl
,
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
= calloc(1, sizeof(*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
;
378 struct HTMLMetaElement
{
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
,
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
,
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
));
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
));
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
));
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
));
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
);
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_DispatchEx(DispatchEx
*iface
)
543 return CONTAINING_RECORD(iface
, HTMLMetaElement
, element
.node
.event_target
.dispex
);
546 static void *HTMLMetaElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
548 HTMLMetaElement
*This
= HTMLMetaElement_from_DispatchEx(dispex
);
550 if(IsEqualGUID(&IID_IHTMLMetaElement
, riid
))
551 return &This
->IHTMLMetaElement_iface
;
553 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
556 static const NodeImplVtbl HTMLMetaElementImplVtbl
= {
557 .clsid
= &CLSID_HTMLMetaElement
,
558 .cpc_entries
= HTMLElement_cpc
,
559 .clone
= HTMLElement_clone
,
560 .get_attr_col
= HTMLElement_get_attr_col
563 static const event_target_vtbl_t HTMLMetaElement_event_target_vtbl
= {
565 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
566 .query_interface
= HTMLMetaElement_query_interface
,
567 .destructor
= HTMLElement_destructor
,
568 .traverse
= HTMLDOMNode_traverse
,
569 .unlink
= HTMLDOMNode_unlink
571 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
572 .handle_event
= HTMLElement_handle_event
575 static const tid_t HTMLMetaElement_iface_tids
[] = {
577 IHTMLMetaElement_tid
,
581 static dispex_static_data_t HTMLMetaElement_dispex
= {
583 &HTMLMetaElement_event_target_vtbl
.dispex_vtbl
,
584 DispHTMLMetaElement_tid
,
585 HTMLMetaElement_iface_tids
,
586 HTMLElement_init_dispex_info
589 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
591 HTMLMetaElement
*ret
;
593 ret
= calloc(1, sizeof(*ret
));
595 return E_OUTOFMEMORY
;
597 ret
->IHTMLMetaElement_iface
.lpVtbl
= &HTMLMetaElementVtbl
;
598 ret
->element
.node
.vtbl
= &HTMLMetaElementImplVtbl
;
600 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLMetaElement_dispex
);
602 *elem
= &ret
->element
;
606 struct HTMLHeadElement
{
609 IHTMLHeadElement IHTMLHeadElement_iface
;
612 static inline HTMLHeadElement
*impl_from_IHTMLHeadElement(IHTMLHeadElement
*iface
)
614 return CONTAINING_RECORD(iface
, HTMLHeadElement
, IHTMLHeadElement_iface
);
617 static HRESULT WINAPI
HTMLHeadElement_QueryInterface(IHTMLHeadElement
*iface
,
618 REFIID riid
, void **ppv
)
620 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
622 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
625 static ULONG WINAPI
HTMLHeadElement_AddRef(IHTMLHeadElement
*iface
)
627 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
629 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
632 static ULONG WINAPI
HTMLHeadElement_Release(IHTMLHeadElement
*iface
)
634 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
636 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
639 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement
*iface
, UINT
*pctinfo
)
641 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
643 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
646 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfo(IHTMLHeadElement
*iface
, UINT iTInfo
,
647 LCID lcid
, ITypeInfo
**ppTInfo
)
649 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
651 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
655 static HRESULT WINAPI
HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement
*iface
, REFIID riid
,
656 LPOLESTR
*rgszNames
, UINT cNames
,
657 LCID lcid
, DISPID
*rgDispId
)
659 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
661 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
662 cNames
, lcid
, rgDispId
);
665 static HRESULT WINAPI
HTMLHeadElement_Invoke(IHTMLHeadElement
*iface
, DISPID dispIdMember
,
666 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
667 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
669 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
671 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
672 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
675 static HRESULT WINAPI
HTMLHeadElement_put_profile(IHTMLHeadElement
*iface
, BSTR v
)
677 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
678 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
682 static HRESULT WINAPI
HTMLHeadElement_get_profile(IHTMLHeadElement
*iface
, BSTR
*p
)
684 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
685 FIXME("(%p)->(%p)\n", This
, p
);
689 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
= {
690 HTMLHeadElement_QueryInterface
,
691 HTMLHeadElement_AddRef
,
692 HTMLHeadElement_Release
,
693 HTMLHeadElement_GetTypeInfoCount
,
694 HTMLHeadElement_GetTypeInfo
,
695 HTMLHeadElement_GetIDsOfNames
,
696 HTMLHeadElement_Invoke
,
697 HTMLHeadElement_put_profile
,
698 HTMLHeadElement_get_profile
701 static inline HTMLHeadElement
*impl_from_DispatchEx(DispatchEx
*iface
)
703 return CONTAINING_RECORD(iface
, HTMLHeadElement
, element
.node
.event_target
.dispex
);
706 static void *HTMLHeadElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
708 HTMLHeadElement
*This
= impl_from_DispatchEx(dispex
);
710 if(IsEqualGUID(&IID_IHTMLHeadElement
, riid
))
711 return &This
->IHTMLHeadElement_iface
;
712 if(IsEqualGUID(&DIID_DispHTMLHeadElement
, riid
))
713 return &This
->IHTMLHeadElement_iface
;
715 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
718 static const NodeImplVtbl HTMLHeadElementImplVtbl
= {
719 .clsid
= &CLSID_HTMLHeadElement
,
720 .cpc_entries
= HTMLElement_cpc
,
721 .clone
= HTMLElement_clone
,
722 .get_attr_col
= HTMLElement_get_attr_col
725 static const event_target_vtbl_t HTMLHeadElement_event_target_vtbl
= {
727 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
728 .query_interface
= HTMLHeadElement_query_interface
,
729 .destructor
= HTMLElement_destructor
,
730 .traverse
= HTMLDOMNode_traverse
,
731 .unlink
= HTMLDOMNode_unlink
733 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
734 .handle_event
= HTMLElement_handle_event
737 static const tid_t HTMLHeadElement_iface_tids
[] = {
739 IHTMLHeadElement_tid
,
742 static dispex_static_data_t HTMLHeadElement_dispex
= {
744 &HTMLHeadElement_event_target_vtbl
.dispex_vtbl
,
745 DispHTMLHeadElement_tid
,
746 HTMLHeadElement_iface_tids
,
747 HTMLElement_init_dispex_info
750 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
752 HTMLHeadElement
*ret
;
754 ret
= calloc(1, sizeof(*ret
));
756 return E_OUTOFMEMORY
;
758 ret
->IHTMLHeadElement_iface
.lpVtbl
= &HTMLHeadElementVtbl
;
759 ret
->element
.node
.vtbl
= &HTMLHeadElementImplVtbl
;
761 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHeadElement_dispex
);
763 *elem
= &ret
->element
;