push 5bdbf5929ff53e78410b88336df0dc6549434b50
[wine/hacks.git] / dlls / mshtml / htmlcomment.c
blob722cb14966e36fab7619e3a72419cdbb32e936c5
1 /*
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
20 #include <stdarg.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
29 #include "mshtml_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 typedef struct {
36 HTMLElement element;
37 const IHTMLCommentElementVtbl *lpIHTMLCommentElementVtbl;
38 } HTMLCommentElement;
40 #define HTMLCOMMENT(x) ((IHTMLCommentElement*) &(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(HTMLDOMNODE(&This->element.node), riid, ppv);
52 static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
54 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
56 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
59 static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
61 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
63 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
66 static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
68 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
69 FIXME("(%p)->(%p)\n", This, pctinfo);
70 return E_NOTIMPL;
73 static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
74 LCID lcid, ITypeInfo **ppTInfo)
76 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
77 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
78 return E_NOTIMPL;
81 static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid,
82 LPOLESTR *rgszNames, UINT cNames,
83 LCID lcid, DISPID *rgDispId)
85 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
86 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
87 lcid, rgDispId);
88 return E_NOTIMPL;
91 static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISPID dispIdMember,
92 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
93 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
95 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
96 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
97 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
98 return E_NOTIMPL;
101 static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
103 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
104 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
105 return E_NOTIMPL;
108 static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
110 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
111 FIXME("(%p)->(%p)\n", This, p);
112 return E_NOTIMPL;
115 static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, long v)
117 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
118 FIXME("(%p)->(%ld)\n", This, v);
119 return E_NOTIMPL;
122 static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, long *p)
124 HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
125 FIXME("(%p)->(%p)\n", This, p);
126 return E_NOTIMPL;
129 #undef HTMLCOMMENT_THIS
131 static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = {
132 HTMLCommentElement_QueryInterface,
133 HTMLCommentElement_AddRef,
134 HTMLCommentElement_Release,
135 HTMLCommentElement_GetTypeInfoCount,
136 HTMLCommentElement_GetTypeInfo,
137 HTMLCommentElement_GetIDsOfNames,
138 HTMLCommentElement_Invoke,
139 HTMLCommentElement_put_text,
140 HTMLCommentElement_get_text,
141 HTMLCommentElement_put_atomic,
142 HTMLCommentElement_get_atomic
145 #define HTMLCOMMENT_NODE_THIS(iface) DEFINE_THIS2(HTMLCommentElement, element.node, iface)
147 HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
149 HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface);
151 *ppv = NULL;
153 if(IsEqualGUID(&IID_IHTMLCommentElement, riid)) {
154 TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This, ppv);
155 *ppv = HTMLCOMMENT(This);
156 }else {
157 return HTMLElement_QI(&This->element.node, riid, ppv);
160 IUnknown_AddRef((IUnknown*)*ppv);
161 return S_OK;
164 void HTMLCommentElement_destructor(HTMLDOMNode *iface)
166 HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface);
168 HTMLElement_destructor(&This->element.node);
171 #undef HTMLCOMMENT_NODE_THIS
173 static const NodeImplVtbl HTMLCommentElementImplVtbl = {
174 HTMLCommentElement_QI,
175 HTMLCommentElement_destructor
178 static const tid_t HTMLCommentElement_iface_tids[] = {
179 IHTMLDOMNode_tid,
180 IHTMLDOMNode2_tid,
181 IHTMLElement_tid,
182 IHTMLElement2_tid,
183 IHTMLElement3_tid,
184 IHTMLCommentElement_tid,
187 static dispex_static_data_t HTMLCommentElement_dispex = {
188 NULL,
189 DispHTMLCommentElement_tid,
190 NULL,
191 HTMLCommentElement_iface_tids
194 HTMLElement *HTMLCommentElement_Create(HTMLDocument *doc, nsIDOMNode *nsnode)
196 HTMLCommentElement *ret = heap_alloc_zero(sizeof(*ret));
198 ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
199 ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl;
201 init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLCOMMENT(ret), &HTMLCommentElement_dispex);
202 HTMLElement_Init(&ret->element);
203 HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
205 return &ret->element;