ReactOS  0.4.13-dev-563-g0561610
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 
21 typedef struct {
23 
24  IHTMLMetaElement IHTMLMetaElement_iface;
26 
27 static inline HTMLMetaElement *impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
28 {
29  return CONTAINING_RECORD(iface, HTMLMetaElement, IHTMLMetaElement_iface);
30 }
31 
32 static 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 
39 static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
40 {
42 
43  return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
44 }
45 
46 static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
47 {
49 
50  return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
51 }
52 
53 static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
54 {
56  return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
57 }
58 
59 static 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 
67 static 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 
75 static 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 
84 static 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 
91 static 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 
101 static 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 
108 static 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 
118 static 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 
125 static 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 
135 static 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 
142 static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
143 {
145  FIXME("(%p)->(%p)\n", This, p);
146  return E_NOTIMPL;
147 }
148 
149 static const WCHAR charsetW[] = {'c','h','a','r','s','e','t',0};
150 
151 static 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 
160 static 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 
169 static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
187 };
188 
190 {
191  return CONTAINING_RECORD(iface, HTMLMetaElement, element.node);
192 }
193 
195 {
197 
198  if(IsEqualGUID(&IID_IUnknown, riid)) {
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 HTMLMetaElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlmeta.c:189
static void HTMLMetaElement_destructor(HTMLDOMNode *iface)
Definition: htmlmeta.c:215
IHTMLMetaElement IHTMLMetaElement_iface
Definition: htmlmeta.c:24
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_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlmeta.c:59
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlmeta.c:67
static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:118
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
REFIID riid
Definition: precomp.h:44
static const IHTMLMetaElementVtbl HTMLMetaElementVtbl
Definition: htmlmeta.c:169
static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:108
tid_t
Definition: ieframe.h:311
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
static HRESULT HTMLMetaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlmeta.c:194
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
Definition: htmlmeta.c:32
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
DWORD LCID
Definition: nls.h:13
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
OLECHAR * BSTR
Definition: compat.h:1934
HRESULT HTMLMetaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlmeta.c:244
static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:125
static LPOLESTR
Definition: stg_prop.c:27
static const tid_t HTMLMetaElement_iface_tids[]
Definition: htmlmeta.c:231
static HTMLMetaElement * impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
Definition: htmlmeta.c:27
#define HTMLELEMENT_TIDS
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT elem_string_attr_setter(HTMLElement *elem, const WCHAR *name, const WCHAR *value)
Definition: htmlelem.c:186
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR charsetW[]
Definition: htmlmeta.c:149
static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:160
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static const WCHAR nameW[]
Definition: main.c:46
#define TRACE(s)
Definition: solgame.cpp:4
static dispex_static_data_t HTMLMetaElement_dispex
Definition: htmlmeta.c:237
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:135
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:101
static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
Definition: htmlmeta.c:53
static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
Definition: htmlmeta.c:39
const GUID IID_IDispatch
int ret
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
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
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
const GLdouble * v
Definition: gl.h:2040
static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
Definition: htmlmeta.c:91
#define E_NOTIMPL
Definition: ddrawi.h:99
static const NodeImplVtbl HTMLMetaElementImplVtbl
Definition: htmlmeta.c:222
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
Definition: htmlmeta.c:46
HTMLElement element
Definition: htmlmeta.c:22
static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
Definition: htmlmeta.c:84
struct stdole::DISPPARAMS DISPPARAMS
WCHAR PRUnichar
Definition: nsiface.idl:48
unsigned int ULONG
Definition: retypes.h:1
GLfloat GLfloat p
Definition: glext.h:8902