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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
37 IHTMLTitleElement IHTMLTitleElement_iface
;
40 static inline HTMLTitleElement
*impl_from_IHTMLTitleElement(IHTMLTitleElement
*iface
)
42 return CONTAINING_RECORD(iface
, HTMLTitleElement
, IHTMLTitleElement_iface
);
45 static HRESULT WINAPI
HTMLTitleElement_QueryInterface(IHTMLTitleElement
*iface
,
46 REFIID riid
, void **ppv
)
48 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
50 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
53 static ULONG WINAPI
HTMLTitleElement_AddRef(IHTMLTitleElement
*iface
)
55 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
57 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
60 static ULONG WINAPI
HTMLTitleElement_Release(IHTMLTitleElement
*iface
)
62 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
64 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
67 static HRESULT WINAPI
HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement
*iface
, UINT
*pctinfo
)
69 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
71 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
74 static HRESULT WINAPI
HTMLTitleElement_GetTypeInfo(IHTMLTitleElement
*iface
, UINT iTInfo
,
75 LCID lcid
, ITypeInfo
**ppTInfo
)
77 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
79 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
83 static HRESULT WINAPI
HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement
*iface
, REFIID riid
,
84 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
86 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
88 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
89 cNames
, lcid
, rgDispId
);
92 static HRESULT WINAPI
HTMLTitleElement_Invoke(IHTMLTitleElement
*iface
, DISPID dispIdMember
,
93 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
94 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
96 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
98 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
99 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
102 static HRESULT WINAPI
HTMLTitleElement_put_text(IHTMLTitleElement
*iface
, BSTR v
)
104 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
105 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
109 static HRESULT WINAPI
HTMLTitleElement_get_text(IHTMLTitleElement
*iface
, BSTR
*p
)
111 HTMLTitleElement
*This
= impl_from_IHTMLTitleElement(iface
);
112 FIXME("(%p)->(%p)\n", This
, p
);
116 static const IHTMLTitleElementVtbl HTMLTitleElementVtbl
= {
117 HTMLTitleElement_QueryInterface
,
118 HTMLTitleElement_AddRef
,
119 HTMLTitleElement_Release
,
120 HTMLTitleElement_GetTypeInfoCount
,
121 HTMLTitleElement_GetTypeInfo
,
122 HTMLTitleElement_GetIDsOfNames
,
123 HTMLTitleElement_Invoke
,
124 HTMLTitleElement_put_text
,
125 HTMLTitleElement_get_text
128 static inline HTMLTitleElement
*HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode
*iface
)
130 return CONTAINING_RECORD(iface
, HTMLTitleElement
, element
.node
);
133 static HRESULT
HTMLTitleElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
135 HTMLTitleElement
*This
= HTMLTitleElement_from_HTMLDOMNode(iface
);
137 if(IsEqualGUID(&IID_IHTMLTitleElement
, riid
)) {
138 TRACE("(%p)->(IID_IHTMLTitleElement %p)\n", This
, ppv
);
139 *ppv
= &This
->IHTMLTitleElement_iface
;
141 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
144 IUnknown_AddRef((IUnknown
*)*ppv
);
148 static void HTMLTitleElement_destructor(HTMLDOMNode
*iface
)
150 HTMLTitleElement
*This
= HTMLTitleElement_from_HTMLDOMNode(iface
);
152 HTMLElement_destructor(&This
->element
.node
);
155 static const NodeImplVtbl HTMLTitleElementImplVtbl
= {
157 HTMLTitleElement_destructor
,
159 HTMLElement_get_attr_col
162 static const tid_t HTMLTitleElement_iface_tids
[] = {
164 IHTMLTitleElement_tid
,
167 static dispex_static_data_t HTMLTitleElement_dispex
= {
169 DispHTMLTitleElement_tid
,
171 HTMLTitleElement_iface_tids
174 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
176 HTMLTitleElement
*ret
;
178 ret
= heap_alloc_zero(sizeof(*ret
));
180 return E_OUTOFMEMORY
;
182 ret
->IHTMLTitleElement_iface
.lpVtbl
= &HTMLTitleElementVtbl
;
183 ret
->element
.node
.vtbl
= &HTMLTitleElementImplVtbl
;
185 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTitleElement_dispex
);
187 *elem
= &ret
->element
;
194 IHTMLHeadElement IHTMLHeadElement_iface
;
197 static inline HTMLHeadElement
*impl_from_IHTMLHeadElement(IHTMLHeadElement
*iface
)
199 return CONTAINING_RECORD(iface
, HTMLHeadElement
, IHTMLHeadElement_iface
);
202 static HRESULT WINAPI
HTMLHeadElement_QueryInterface(IHTMLHeadElement
*iface
,
203 REFIID riid
, void **ppv
)
205 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
207 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
210 static ULONG WINAPI
HTMLHeadElement_AddRef(IHTMLHeadElement
*iface
)
212 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
214 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
217 static ULONG WINAPI
HTMLHeadElement_Release(IHTMLHeadElement
*iface
)
219 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
221 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
224 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement
*iface
, UINT
*pctinfo
)
226 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
228 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
231 static HRESULT WINAPI
HTMLHeadElement_GetTypeInfo(IHTMLHeadElement
*iface
, UINT iTInfo
,
232 LCID lcid
, ITypeInfo
**ppTInfo
)
234 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
236 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
240 static HRESULT WINAPI
HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement
*iface
, REFIID riid
,
241 LPOLESTR
*rgszNames
, UINT cNames
,
242 LCID lcid
, DISPID
*rgDispId
)
244 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
246 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
247 cNames
, lcid
, rgDispId
);
250 static HRESULT WINAPI
HTMLHeadElement_Invoke(IHTMLHeadElement
*iface
, DISPID dispIdMember
,
251 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
252 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
254 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
256 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
257 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
260 static HRESULT WINAPI
HTMLHeadElement_put_profile(IHTMLHeadElement
*iface
, BSTR v
)
262 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
263 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
267 static HRESULT WINAPI
HTMLHeadElement_get_profile(IHTMLHeadElement
*iface
, BSTR
*p
)
269 HTMLHeadElement
*This
= impl_from_IHTMLHeadElement(iface
);
270 FIXME("(%p)->(%p)\n", This
, p
);
274 static const IHTMLHeadElementVtbl HTMLHeadElementVtbl
= {
275 HTMLHeadElement_QueryInterface
,
276 HTMLHeadElement_AddRef
,
277 HTMLHeadElement_Release
,
278 HTMLHeadElement_GetTypeInfoCount
,
279 HTMLHeadElement_GetTypeInfo
,
280 HTMLHeadElement_GetIDsOfNames
,
281 HTMLHeadElement_Invoke
,
282 HTMLHeadElement_put_profile
,
283 HTMLHeadElement_get_profile
286 static inline HTMLHeadElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
288 return CONTAINING_RECORD(iface
, HTMLHeadElement
, element
.node
);
291 static HRESULT
HTMLHeadElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
293 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
295 if(IsEqualGUID(&IID_IHTMLHeadElement
, riid
)) {
296 TRACE("(%p)->(IID_IHTMLHeadElement %p)\n", This
, ppv
);
297 *ppv
= &This
->IHTMLHeadElement_iface
;
299 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
302 IUnknown_AddRef((IUnknown
*)*ppv
);
306 static void HTMLHeadElement_destructor(HTMLDOMNode
*iface
)
308 HTMLHeadElement
*This
= impl_from_HTMLDOMNode(iface
);
310 HTMLElement_destructor(&This
->element
.node
);
313 static const NodeImplVtbl HTMLHeadElementImplVtbl
= {
315 HTMLHeadElement_destructor
,
317 HTMLElement_get_attr_col
320 static const tid_t HTMLHeadElement_iface_tids
[] = {
322 IHTMLHeadElement_tid
,
325 static dispex_static_data_t HTMLHeadElement_dispex
= {
327 DispHTMLHeadElement_tid
,
329 HTMLHeadElement_iface_tids
332 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
334 HTMLHeadElement
*ret
;
336 ret
= heap_alloc_zero(sizeof(*ret
));
338 return E_OUTOFMEMORY
;
340 ret
->IHTMLHeadElement_iface
.lpVtbl
= &HTMLHeadElementVtbl
;
341 ret
->element
.node
.vtbl
= &HTMLHeadElementImplVtbl
;
343 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLHeadElement_dispex
);
345 *elem
= &ret
->element
;