2 * Copyright 2008 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
29 #include "mshtml_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 struct HTMLCommentElement {
37 const IHTMLCommentElementVtbl *lpIHTMLCommentElementVtbl;
40 #define HTMLCOMMENT(x) (&(x)->lpIHTMLCommentElementVtbl)
42 #define HTMLCOMMENT_THIS(iface) DEFINE_THIS(HTMLCommentElement, IHTMLCommentElement, iface)
44 static HRESULT WINAPI HTMLCommentElement_QueryInterface(IHTMLCommentElement *iface,
45 REFIID riid, void **ppv)
47 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
49 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
52 static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
54 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
56 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
59 static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
61 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
63 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
66 static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
68 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
69 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
72 static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
73 LCID lcid, ITypeInfo **ppTInfo)
75 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
76 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
80 static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid,
81 LPOLESTR *rgszNames, UINT cNames,
82 LCID lcid, DISPID *rgDispId)
84 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
85 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
86 cNames, lcid, rgDispId);
89 static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISPID dispIdMember,
90 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
91 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
93 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
94 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
95 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
98 static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
100 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
101 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
105 static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
107 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
109 TRACE("(%p)->(%p)\n", This, p);
111 return IHTMLElement_get_outerHTML(&This->element.IHTMLElement_iface, p);
114 static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, LONG v)
116 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
117 FIXME("(%p)->(%d)\n", This, v);
121 static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, LONG *p)
123 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
124 FIXME("(%p)->(%p)\n", This, p);
128 #undef HTMLCOMMENT_THIS
130 static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = {
131 HTMLCommentElement_QueryInterface,
132 HTMLCommentElement_AddRef,
133 HTMLCommentElement_Release,
134 HTMLCommentElement_GetTypeInfoCount,
135 HTMLCommentElement_GetTypeInfo,
136 HTMLCommentElement_GetIDsOfNames,
137 HTMLCommentElement_Invoke,
138 HTMLCommentElement_put_text,
139 HTMLCommentElement_get_text,
140 HTMLCommentElement_put_atomic,
141 HTMLCommentElement_get_atomic
144 static inline HTMLCommentElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
146 return CONTAINING_RECORD(iface, HTMLCommentElement, element.node);
149 static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
151 HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
155 if(IsEqualGUID(&IID_IHTMLCommentElement, riid)) {
156 TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This, ppv);
157 *ppv = HTMLCOMMENT(This);
159 return HTMLElement_QI(&This->element.node, riid, ppv);
162 IUnknown_AddRef((IUnknown*)*ppv);
166 static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
168 HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
170 HTMLElement_destructor(&This->element.node);
173 static const NodeImplVtbl HTMLCommentElementImplVtbl = {
174 HTMLCommentElement_QI,
175 HTMLCommentElement_destructor,
179 static const tid_t HTMLCommentElement_iface_tids[] = {
181 IHTMLCommentElement_tid,
184 static dispex_static_data_t HTMLCommentElement_dispex = {
186 DispHTMLCommentElement_tid,
188 HTMLCommentElement_iface_tids
191 HRESULT HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLElement **elem)
193 HTMLCommentElement *ret;
195 ret = heap_alloc_zero(sizeof(*ret));
197 return E_OUTOFMEMORY;
199 ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
200 ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl;
202 HTMLElement_Init(&ret->element, doc, NULL, &HTMLCommentElement_dispex);
204 nsIDOMNode_AddRef(nsnode);
205 ret->element.node.nsnode = nsnode;
207 *elem = &ret->element;