2 * Copyright 2011 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
);
106 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
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
);
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
;
143 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
145 IUnknown_AddRef((IUnknown
*)*ppv
);
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
,
159 HTMLTitleElement_destructor
,
162 HTMLElement_handle_event
,
163 HTMLElement_get_attr_col
166 static const tid_t HTMLTitleElement_iface_tids
[] = {
168 IHTMLTitleElement_tid
,
171 static dispex_static_data_t HTMLTitleElement_dispex
= {
173 DispHTMLTitleElement_tid
,
174 HTMLTitleElement_iface_tids
,
175 HTMLElement_init_dispex_info
178 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
180 HTMLTitleElement
*ret
;
182 ret
= heap_alloc_zero(sizeof(*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
;
195 struct HTMLHtmlElement
{
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
,
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
));
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
);
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
;
304 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
306 IUnknown_AddRef((IUnknown
*)*ppv
);
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
)
320 case DISPID_IHTMLELEMENT_OUTERTEXT
:
327 static const NodeImplVtbl HTMLHtmlElementImplVtbl
= {
328 &CLSID_HTMLHtmlElement
,
330 HTMLHtmlElement_destructor
,
333 HTMLElement_handle_event
,
334 HTMLElement_get_attr_col
,
347 HTMLHtmlElement_is_settable
350 static const tid_t HTMLHtmlElement_iface_tids
[] = {
352 IHTMLHtmlElement_tid
,
355 static dispex_static_data_t HTMLHtmlElement_dispex
= {
357 DispHTMLHtmlElement_tid
,
358 HTMLHtmlElement_iface_tids
,
359 HTMLElement_init_dispex_info
362 HRESULT
HTMLHtmlElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
364 HTMLHtmlElement
*ret
;
366 ret
= heap_alloc_zero(sizeof(*ret
));
368 return E_OUTOFMEMORY
;
370 ret
->IHTMLHtmlElement_iface
.lpVtbl
= &HTMLHtmlElementVtbl
;
371 ret
->element
.node
.vtbl
= &HTMLHtmlElementImplVtbl
;
373 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHtmlElement_dispex
);
375 *elem
= &ret
->element
;
379 struct HTMLHeadElement
{
382 IHTMLHeadElement IHTMLHeadElement_iface
;
385 static inline HTMLHeadElement
*impl_from_IHTMLHeadElement(IHTMLHeadElement
*iface
)
387 return CONTAINING_RECORD(iface
, HTMLHeadElement
, IHTMLHeadElement_iface
);
390 static HRESULT WINAPI
HTMLHeadElement_QueryInterface(IHTMLHeadElement
*iface
,
391 REFIID riid
, void **ppv
)
393 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
395 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
398 static ULONG WINAPI
HTMLHeadElement_AddRef(IHTMLHeadElement
*iface
)
400 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
402 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
405 static ULONG WINAPI
HTMLHeadElement_Release(IHTMLHeadElement
*iface
)
407 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
409 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
412 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement
*iface
, UINT
*pctinfo
)
414 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
416 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
419 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfo(IHTMLHeadElement
*iface
, UINT iTInfo
,
420 LCID lcid
, ITypeInfo
**ppTInfo
)
422 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
424 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
428 static HRESULT WINAPI
HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement
*iface
, REFIID riid
,
429 LPOLESTR
*rgszNames
, UINT cNames
,
430 LCID lcid
, DISPID
*rgDispId
)
432 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
434 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
435 cNames
, lcid
, rgDispId
);
438 static HRESULT WINAPI
HTMLHeadElement_Invoke(IHTMLHeadElement
*iface
, DISPID dispIdMember
,
439 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
440 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
442 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
444 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
445 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
448 static HRESULT WINAPI
HTMLHeadElement_put_profile(IHTMLHeadElement
*iface
, BSTR v
)
450 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
451 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
455 static HRESULT WINAPI
HTMLHeadElement_get_profile(IHTMLHeadElement
*iface
, BSTR
*p
)
457 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
458 FIXME("(%p)->(%p)\n", This
, p
);
462 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
= {
463 HTMLHeadElement_QueryInterface
,
464 HTMLHeadElement_AddRef
,
465 HTMLHeadElement_Release
,
466 HTMLHeadElement_GetTypeInfoCount
,
467 HTMLHeadElement_GetTypeInfo
,
468 HTMLHeadElement_GetIDsOfNames
,
469 HTMLHeadElement_Invoke
,
470 HTMLHeadElement_put_profile
,
471 HTMLHeadElement_get_profile
474 static inline HTMLHeadElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
476 return CONTAINING_RECORD(iface
, HTMLHeadElement
, element
.node
);
479 static HRESULT
HTMLHeadElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
481 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
483 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
485 if(IsEqualGUID(&IID_IHTMLHeadElement
, riid
))
486 *ppv
= &This
->IHTMLHeadElement_iface
;
488 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
490 IUnknown_AddRef((IUnknown
*)*ppv
);
494 static void HTMLHeadElement_destructor(HTMLDOMNode
*iface
)
496 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
498 HTMLElement_destructor(&This
->element
.node
);
501 static const NodeImplVtbl HTMLHeadElementImplVtbl
= {
502 &CLSID_HTMLHeadElement
,
504 HTMLHeadElement_destructor
,
507 HTMLElement_handle_event
,
508 HTMLElement_get_attr_col
511 static const tid_t HTMLHeadElement_iface_tids
[] = {
513 IHTMLHeadElement_tid
,
516 static dispex_static_data_t HTMLHeadElement_dispex
= {
518 DispHTMLHeadElement_tid
,
519 HTMLHeadElement_iface_tids
,
520 HTMLElement_init_dispex_info
523 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
525 HTMLHeadElement
*ret
;
527 ret
= heap_alloc_zero(sizeof(*ret
));
529 return E_OUTOFMEMORY
;
531 ret
->IHTMLHeadElement_iface
.lpVtbl
= &HTMLHeadElementVtbl
;
532 ret
->element
.node
.vtbl
= &HTMLHeadElementImplVtbl
;
534 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHeadElement_dispex
);
536 *elem
= &ret
->element
;