2 * Copyright 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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
37 IHTMLMetaElement IHTMLMetaElement_iface
;
40 static inline HTMLMetaElement
*impl_from_IHTMLMetaElement(IHTMLMetaElement
*iface
)
42 return CONTAINING_RECORD(iface
, HTMLMetaElement
, IHTMLMetaElement_iface
);
45 static HRESULT WINAPI
HTMLMetaElement_QueryInterface(IHTMLMetaElement
*iface
, REFIID riid
, void **ppv
)
47 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
49 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
52 static ULONG WINAPI
HTMLMetaElement_AddRef(IHTMLMetaElement
*iface
)
54 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
56 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
59 static ULONG WINAPI
HTMLMetaElement_Release(IHTMLMetaElement
*iface
)
61 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
63 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
66 static HRESULT WINAPI
HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement
*iface
, UINT
*pctinfo
)
68 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
69 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
72 static HRESULT WINAPI
HTMLMetaElement_GetTypeInfo(IHTMLMetaElement
*iface
, UINT iTInfo
,
73 LCID lcid
, ITypeInfo
**ppTInfo
)
75 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
76 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
80 static HRESULT WINAPI
HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement
*iface
, REFIID riid
,
81 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
83 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
84 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
85 cNames
, lcid
, rgDispId
);
88 static HRESULT WINAPI
HTMLMetaElement_Invoke(IHTMLMetaElement
*iface
, DISPID dispIdMember
, REFIID riid
,
89 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
,
92 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
93 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
94 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
97 static HRESULT WINAPI
HTMLMetaElement_put_httpEquiv(IHTMLMetaElement
*iface
, BSTR v
)
99 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
100 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
104 static HRESULT WINAPI
HTMLMetaElement_get_httpEquiv(IHTMLMetaElement
*iface
, BSTR
*p
)
106 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
107 FIXME("(%p)->(%p)\n", This
, p
);
111 static HRESULT WINAPI
HTMLMetaElement_put_content(IHTMLMetaElement
*iface
, BSTR v
)
113 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
114 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
118 static HRESULT WINAPI
HTMLMetaElement_get_content(IHTMLMetaElement
*iface
, BSTR
*p
)
120 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
121 FIXME("(%p)->(%p)\n", This
, p
);
125 static HRESULT WINAPI
HTMLMetaElement_put_name(IHTMLMetaElement
*iface
, BSTR v
)
127 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
128 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
132 static HRESULT WINAPI
HTMLMetaElement_get_name(IHTMLMetaElement
*iface
, BSTR
*p
)
134 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
135 FIXME("(%p)->(%p)\n", This
, p
);
139 static HRESULT WINAPI
HTMLMetaElement_put_url(IHTMLMetaElement
*iface
, BSTR v
)
141 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
142 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
146 static HRESULT WINAPI
HTMLMetaElement_get_url(IHTMLMetaElement
*iface
, BSTR
*p
)
148 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
149 FIXME("(%p)->(%p)\n", This
, p
);
153 static HRESULT WINAPI
HTMLMetaElement_put_charset(IHTMLMetaElement
*iface
, BSTR v
)
155 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
156 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
160 static HRESULT WINAPI
HTMLMetaElement_get_charset(IHTMLMetaElement
*iface
, BSTR
*p
)
162 HTMLMetaElement
*This
= impl_from_IHTMLMetaElement(iface
);
163 FIXME("(%p)->(%p)\n", This
, p
);
167 static const IHTMLMetaElementVtbl HTMLMetaElementVtbl
= {
168 HTMLMetaElement_QueryInterface
,
169 HTMLMetaElement_AddRef
,
170 HTMLMetaElement_Release
,
171 HTMLMetaElement_GetTypeInfoCount
,
172 HTMLMetaElement_GetTypeInfo
,
173 HTMLMetaElement_GetIDsOfNames
,
174 HTMLMetaElement_Invoke
,
175 HTMLMetaElement_put_httpEquiv
,
176 HTMLMetaElement_get_httpEquiv
,
177 HTMLMetaElement_put_content
,
178 HTMLMetaElement_get_content
,
179 HTMLMetaElement_put_name
,
180 HTMLMetaElement_get_name
,
181 HTMLMetaElement_put_url
,
182 HTMLMetaElement_get_url
,
183 HTMLMetaElement_put_charset
,
184 HTMLMetaElement_get_charset
187 static inline HTMLMetaElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
189 return CONTAINING_RECORD(iface
, HTMLMetaElement
, element
.node
);
192 static HRESULT
HTMLMetaElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
194 HTMLMetaElement
*This
= impl_from_HTMLDOMNode(iface
);
196 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
197 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
198 *ppv
= &This
->IHTMLMetaElement_iface
;
199 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
200 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
201 *ppv
= &This
->IHTMLMetaElement_iface
;
202 }else if(IsEqualGUID(&IID_IHTMLMetaElement
, riid
)) {
203 TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This
, ppv
);
204 *ppv
= &This
->IHTMLMetaElement_iface
;
206 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
209 IUnknown_AddRef((IUnknown
*)*ppv
);
213 static void HTMLMetaElement_destructor(HTMLDOMNode
*iface
)
215 HTMLMetaElement
*This
= impl_from_HTMLDOMNode(iface
);
217 HTMLElement_destructor(&This
->element
.node
);
220 static const NodeImplVtbl HTMLMetaElementImplVtbl
= {
222 HTMLMetaElement_destructor
,
224 HTMLElement_get_attr_col
227 static const tid_t HTMLMetaElement_iface_tids
[] = {
229 IHTMLMetaElement_tid
,
233 static dispex_static_data_t HTMLMetaElement_dispex
= {
235 DispHTMLMetaElement_tid
,
237 HTMLMetaElement_iface_tids
240 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
242 HTMLMetaElement
*ret
;
244 ret
= heap_alloc_zero(sizeof(*ret
));
246 return E_OUTOFMEMORY
;
248 ret
->IHTMLMetaElement_iface
.lpVtbl
= &HTMLMetaElementVtbl
;
249 ret
->element
.node
.vtbl
= &HTMLMetaElementImplVtbl
;
251 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLMetaElement_dispex
);
253 *elem
= &ret
->element
;