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
19 #include "mshtml_private.h"
24 IHTMLTitleElement IHTMLTitleElement_iface
;
27 static inline HTMLTitleElement
*impl_from_IHTMLTitleElement(IHTMLTitleElement
*iface
)
29 return CONTAINING_RECORD(iface
, HTMLTitleElement
, IHTMLTitleElement_iface
);
32 static HRESULT WINAPI
HTMLTitleElement_QueryInterface(IHTMLTitleElement
*iface
,
33 REFIID riid
, void **ppv
)
35 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
37 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
40 static ULONG WINAPI
HTMLTitleElement_AddRef(IHTMLTitleElement
*iface
)
42 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
44 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
47 static ULONG WINAPI
HTMLTitleElement_Release(IHTMLTitleElement
*iface
)
49 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
51 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
54 static HRESULT WINAPI
HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement
*iface
, UINT
*pctinfo
)
56 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
58 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
61 static HRESULT WINAPI
HTMLTitleElement_GetTypeInfo(IHTMLTitleElement
*iface
, UINT iTInfo
,
62 LCID lcid
, ITypeInfo
**ppTInfo
)
64 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
66 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
70 static HRESULT WINAPI
HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement
*iface
, REFIID riid
,
71 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
73 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
75 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
76 cNames
, lcid
, rgDispId
);
79 static HRESULT WINAPI
HTMLTitleElement_Invoke(IHTMLTitleElement
*iface
, DISPID dispIdMember
,
80 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
81 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
83 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
85 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
86 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
89 static HRESULT WINAPI
HTMLTitleElement_put_text(IHTMLTitleElement
*iface
, BSTR v
)
91 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
92 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
96 static HRESULT WINAPI
HTMLTitleElement_get_text(IHTMLTitleElement
*iface
, BSTR
*p
)
98 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
99 FIXME("(%p)->(%p)\n", This
, p
);
103 static const IHTMLTitleElementVtbl HTMLTitleElementVtbl
= {
104 HTMLTitleElement_QueryInterface
,
105 HTMLTitleElement_AddRef
,
106 HTMLTitleElement_Release
,
107 HTMLTitleElement_GetTypeInfoCount
,
108 HTMLTitleElement_GetTypeInfo
,
109 HTMLTitleElement_GetIDsOfNames
,
110 HTMLTitleElement_Invoke
,
111 HTMLTitleElement_put_text
,
112 HTMLTitleElement_get_text
115 static inline HTMLTitleElement
*HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode
*iface
)
117 return CONTAINING_RECORD(iface
, HTMLTitleElement
, element
.node
);
120 static HRESULT
HTMLTitleElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
122 HTMLTitleElement
*This
= HTMLTitleElement_from_HTMLDOMNode(iface
);
124 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
126 if(IsEqualGUID(&IID_IHTMLTitleElement
, riid
))
127 *ppv
= &This
->IHTMLTitleElement_iface
;
129 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
131 IUnknown_AddRef((IUnknown
*)*ppv
);
135 static void HTMLTitleElement_destructor(HTMLDOMNode
*iface
)
137 HTMLTitleElement
*This
= HTMLTitleElement_from_HTMLDOMNode(iface
);
139 HTMLElement_destructor(&This
->element
.node
);
142 static const NodeImplVtbl HTMLTitleElementImplVtbl
= {
144 HTMLTitleElement_destructor
,
147 HTMLElement_handle_event
,
148 HTMLElement_get_attr_col
151 static const tid_t HTMLTitleElement_iface_tids
[] = {
153 IHTMLTitleElement_tid
,
156 static dispex_static_data_t HTMLTitleElement_dispex
= {
158 DispHTMLTitleElement_tid
,
160 HTMLTitleElement_iface_tids
163 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
165 HTMLTitleElement
*ret
;
167 ret
= heap_alloc_zero(sizeof(*ret
));
169 return E_OUTOFMEMORY
;
171 ret
->IHTMLTitleElement_iface
.lpVtbl
= &HTMLTitleElementVtbl
;
172 ret
->element
.node
.vtbl
= &HTMLTitleElementImplVtbl
;
174 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTitleElement_dispex
);
176 *elem
= &ret
->element
;
183 IHTMLHeadElement IHTMLHeadElement_iface
;
186 static inline HTMLHeadElement
*impl_from_IHTMLHeadElement(IHTMLHeadElement
*iface
)
188 return CONTAINING_RECORD(iface
, HTMLHeadElement
, IHTMLHeadElement_iface
);
191 static HRESULT WINAPI
HTMLHeadElement_QueryInterface(IHTMLHeadElement
*iface
,
192 REFIID riid
, void **ppv
)
194 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
196 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
199 static ULONG WINAPI
HTMLHeadElement_AddRef(IHTMLHeadElement
*iface
)
201 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
203 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
206 static ULONG WINAPI
HTMLHeadElement_Release(IHTMLHeadElement
*iface
)
208 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
210 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
213 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement
*iface
, UINT
*pctinfo
)
215 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
217 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
220 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfo(IHTMLHeadElement
*iface
, UINT iTInfo
,
221 LCID lcid
, ITypeInfo
**ppTInfo
)
223 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
225 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
229 static HRESULT WINAPI
HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement
*iface
, REFIID riid
,
230 LPOLESTR
*rgszNames
, UINT cNames
,
231 LCID lcid
, DISPID
*rgDispId
)
233 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
235 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
236 cNames
, lcid
, rgDispId
);
239 static HRESULT WINAPI
HTMLHeadElement_Invoke(IHTMLHeadElement
*iface
, DISPID dispIdMember
,
240 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
241 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
243 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
245 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
246 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
249 static HRESULT WINAPI
HTMLHeadElement_put_profile(IHTMLHeadElement
*iface
, BSTR v
)
251 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
252 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
256 static HRESULT WINAPI
HTMLHeadElement_get_profile(IHTMLHeadElement
*iface
, BSTR
*p
)
258 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
259 FIXME("(%p)->(%p)\n", This
, p
);
263 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
= {
264 HTMLHeadElement_QueryInterface
,
265 HTMLHeadElement_AddRef
,
266 HTMLHeadElement_Release
,
267 HTMLHeadElement_GetTypeInfoCount
,
268 HTMLHeadElement_GetTypeInfo
,
269 HTMLHeadElement_GetIDsOfNames
,
270 HTMLHeadElement_Invoke
,
271 HTMLHeadElement_put_profile
,
272 HTMLHeadElement_get_profile
275 static inline HTMLHeadElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
277 return CONTAINING_RECORD(iface
, HTMLHeadElement
, element
.node
);
280 static HRESULT
HTMLHeadElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
282 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
284 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
286 if(IsEqualGUID(&IID_IHTMLHeadElement
, riid
))
287 *ppv
= &This
->IHTMLHeadElement_iface
;
289 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
291 IUnknown_AddRef((IUnknown
*)*ppv
);
295 static void HTMLHeadElement_destructor(HTMLDOMNode
*iface
)
297 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
299 HTMLElement_destructor(&This
->element
.node
);
302 static const NodeImplVtbl HTMLHeadElementImplVtbl
= {
304 HTMLHeadElement_destructor
,
307 HTMLElement_handle_event
,
308 HTMLElement_get_attr_col
311 static const tid_t HTMLHeadElement_iface_tids
[] = {
313 IHTMLHeadElement_tid
,
316 static dispex_static_data_t HTMLHeadElement_dispex
= {
318 DispHTMLHeadElement_tid
,
320 HTMLHeadElement_iface_tids
323 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
325 HTMLHeadElement
*ret
;
327 ret
= heap_alloc_zero(sizeof(*ret
));
329 return E_OUTOFMEMORY
;
331 ret
->IHTMLHeadElement_iface
.lpVtbl
= &HTMLHeadElementVtbl
;
332 ret
->element
.node
.vtbl
= &HTMLHeadElementImplVtbl
;
334 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHeadElement_dispex
);
336 *elem
= &ret
->element
;