ReactOS 0.4.15-dev-7670-g69b08be
htmlmeta.c
Go to the documentation of this file.
1/*
2 * Copyright 2012 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include "mshtml_private.h"
20
21typedef struct {
23
24 IHTMLMetaElement IHTMLMetaElement_iface;
26
27static inline HTMLMetaElement *impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
28{
29 return CONTAINING_RECORD(iface, HTMLMetaElement, IHTMLMetaElement_iface);
30}
31
32static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
33{
35
36 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
37}
38
39static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
40{
42
43 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
44}
45
46static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
47{
49
50 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
51}
52
53static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
54{
56 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
57}
58
59static HRESULT WINAPI HTMLMetaElement_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo,
60 LCID lcid, ITypeInfo **ppTInfo)
61{
63 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
64 ppTInfo);
65}
66
67static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid,
68 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
69{
71 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
72 cNames, lcid, rgDispId);
73}
74
75static HRESULT WINAPI HTMLMetaElement_Invoke(IHTMLMetaElement *iface, DISPID dispIdMember, REFIID riid,
76 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
77 UINT *puArgErr)
78{
80 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
81 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
82}
83
84static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
85{
87 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
88 return E_NOTIMPL;
89}
90
91static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
92{
94 static const PRUnichar httpEquivW[] = {'h','t','t','p','-','e','q','u','i','v',0};
95
96 TRACE("(%p)->(%p)\n", This, p);
97
98 return elem_string_attr_getter(&This->element, httpEquivW, TRUE, p);
99}
100
101static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
102{
104 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
105 return E_NOTIMPL;
106}
107
108static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
109{
111 static const PRUnichar contentW[] = {'c','o','n','t','e','n','t',0};
112
113 TRACE("(%p)->(%p)\n", This, p);
114
115 return elem_string_attr_getter(&This->element, contentW, TRUE, p);
116}
117
118static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
119{
121 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
122 return E_NOTIMPL;
123}
124
125static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
126{
128 static const PRUnichar nameW[] = {'n','a','m','e',0};
129
130 TRACE("(%p)->(%p)\n", This, p);
131
132 return elem_string_attr_getter(&This->element, nameW, TRUE, p);
133}
134
135static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
136{
138 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
139 return E_NOTIMPL;
140}
141
142static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
143{
145 FIXME("(%p)->(%p)\n", This, p);
146 return E_NOTIMPL;
147}
148
149static const WCHAR charsetW[] = {'c','h','a','r','s','e','t',0};
150
151static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
152{
154
155 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
156
157 return elem_string_attr_setter(&This->element, charsetW, v);
158}
159
160static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
161{
163
164 TRACE("(%p)->(%p)\n", This, p);
165
166 return elem_string_attr_getter(&This->element, charsetW, TRUE, p);
167}
168
169static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
187};
188
190{
191 return CONTAINING_RECORD(iface, HTMLMetaElement, element.node);
192}
193
195{
197
199 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
200 *ppv = &This->IHTMLMetaElement_iface;
201 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
202 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
203 *ppv = &This->IHTMLMetaElement_iface;
204 }else if(IsEqualGUID(&IID_IHTMLMetaElement, riid)) {
205 TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This, ppv);
206 *ppv = &This->IHTMLMetaElement_iface;
207 }else {
208 return HTMLElement_QI(&This->element.node, riid, ppv);
209 }
210
211 IUnknown_AddRef((IUnknown*)*ppv);
212 return S_OK;
213}
214
216{
218
219 HTMLElement_destructor(&This->element.node);
220}
221
229};
230
233 IHTMLMetaElement_tid,
234 0
235};
236
238 NULL,
239 DispHTMLMetaElement_tid,
240 NULL,
242};
243
245{
247
248 ret = heap_alloc_zero(sizeof(*ret));
249 if(!ret)
250 return E_OUTOFMEMORY;
251
252 ret->IHTMLMetaElement_iface.lpVtbl = &HTMLMetaElementVtbl;
253 ret->element.node.vtbl = &HTMLMetaElementImplVtbl;
254
255 HTMLElement_Init(&ret->element, doc, nselem, &HTMLMetaElement_dispex);
256
257 *elem = &ret->element;
258 return S_OK;
259}
static const WCHAR nameW[]
Definition: main.c:46
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
OLECHAR * BSTR
Definition: compat.h:2293
unsigned short WORD
Definition: ntddk_ex.h:93
const GLdouble * v
Definition: gl.h:2040
GLfloat GLfloat p
Definition: glext.h:8902
HRESULT elem_string_attr_getter(HTMLElement *elem, const WCHAR *name, BOOL use_null, BSTR *p)
Definition: htmlelem.c:162
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
HRESULT elem_string_attr_setter(HTMLElement *elem, const WCHAR *name, const WCHAR *value)
Definition: htmlelem.c:186
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:101
static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:108
static HTMLMetaElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlmeta.c:189
static dispex_static_data_t HTMLMetaElement_dispex
Definition: htmlmeta.c:237
static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:91
static HRESULT HTMLMetaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlmeta.c:194
static void HTMLMetaElement_destructor(HTMLDOMNode *iface)
Definition: htmlmeta.c:215
static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:151
static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:142
static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:118
static const tid_t HTMLMetaElement_iface_tids[]
Definition: htmlmeta.c:231
static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:125
static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
Definition: htmlmeta.c:53
static const NodeImplVtbl HTMLMetaElementImplVtbl
Definition: htmlmeta.c:222
static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
Definition: htmlmeta.c:32
static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:84
static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
Definition: htmlmeta.c:39
static HRESULT WINAPI HTMLMetaElement_Invoke(IHTMLMetaElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlmeta.c:75
static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:160
static const WCHAR charsetW[]
Definition: htmlmeta.c:149
static HTMLMetaElement * impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
Definition: htmlmeta.c:27
HRESULT HTMLMetaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlmeta.c:244
static const IHTMLMetaElementVtbl HTMLMetaElementVtbl
Definition: htmlmeta.c:169
static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlmeta.c:67
static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
Definition: htmlmeta.c:46
static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:135
static HRESULT WINAPI HTMLMetaElement_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlmeta.c:59
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
static size_t elem
Definition: string.c:68
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
#define HTMLELEMENT_TIDS
unsigned int UINT
Definition: ndis.h:50
WCHAR PRUnichar
Definition: nsiface.idl:48
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
DWORD LCID
Definition: nls.h:13
#define TRACE(s)
Definition: solgame.cpp:4
HTMLElement element
Definition: htmlmeta.c:22
IHTMLMetaElement IHTMLMetaElement_iface
Definition: htmlmeta.c:24
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180