server: Send WM_WINE_SETCURSOR with the thread input cursor handle.
[wine.git] / dlls / mshtml / htmlcomment.c
blobfab79642e700abe2cadf6acd587bfb88535c4c3c
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"
30 #include "htmlevent.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 struct HTMLCommentElement {
37 HTMLElement element;
38 IHTMLCommentElement IHTMLCommentElement_iface;
41 static inline HTMLCommentElement *impl_from_IHTMLCommentElement(IHTMLCommentElement *iface)
43 return CONTAINING_RECORD(iface, HTMLCommentElement, IHTMLCommentElement_iface);
46 static HRESULT WINAPI HTMLCommentElement_QueryInterface(IHTMLCommentElement *iface,
47 REFIID riid, void **ppv)
49 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
51 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
54 static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
56 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
58 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
61 static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
63 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
65 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
68 static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
70 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
71 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
74 static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
75 LCID lcid, ITypeInfo **ppTInfo)
77 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
78 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
79 ppTInfo);
82 static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid,
83 LPOLESTR *rgszNames, UINT cNames,
84 LCID lcid, DISPID *rgDispId)
86 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
87 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
88 cNames, lcid, rgDispId);
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 = impl_from_IHTMLCommentElement(iface);
96 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
97 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
100 static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
102 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
103 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
104 return E_NOTIMPL;
107 static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
109 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
111 TRACE("(%p)->(%p)\n", This, p);
113 return IHTMLElement_get_outerHTML(&This->element.IHTMLElement_iface, p);
116 static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, LONG v)
118 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
119 FIXME("(%p)->(%ld)\n", This, v);
120 return E_NOTIMPL;
123 static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, LONG *p)
125 HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
126 FIXME("(%p)->(%p)\n", This, p);
127 return E_NOTIMPL;
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_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
151 HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
152 HTMLElement *new_elem;
153 HRESULT hres;
155 hres = HTMLCommentElement_Create(This->element.node.doc, nsnode, &new_elem);
156 if(FAILED(hres))
157 return hres;
159 *ret = &new_elem->node;
160 return S_OK;
163 static inline HTMLCommentElement *impl_from_DispatchEx(DispatchEx *iface)
165 return CONTAINING_RECORD(iface, HTMLCommentElement, element.node.event_target.dispex);
168 static void *HTMLCommentElement_query_interface(DispatchEx *dispex, REFIID riid)
170 HTMLCommentElement *This = impl_from_DispatchEx(dispex);
172 if(IsEqualGUID(&IID_IHTMLCommentElement, riid))
173 return &This->IHTMLCommentElement_iface;
175 return HTMLElement_query_interface(&This->element.node.event_target.dispex, riid);
178 static const NodeImplVtbl HTMLCommentElementImplVtbl = {
179 .clsid = &CLSID_HTMLCommentElement,
180 .cpc_entries = HTMLElement_cpc,
181 .clone = HTMLCommentElement_clone,
182 .get_attr_col = HTMLElement_get_attr_col
185 static const event_target_vtbl_t HTMLCommentElement_event_target_vtbl = {
187 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
188 .query_interface= HTMLCommentElement_query_interface,
189 .destructor = HTMLElement_destructor,
190 .traverse = HTMLDOMNode_traverse,
191 .unlink = HTMLDOMNode_unlink
193 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
194 .handle_event = HTMLElement_handle_event
197 static const tid_t HTMLCommentElement_iface_tids[] = {
198 HTMLELEMENT_TIDS,
199 IHTMLCommentElement_tid,
202 static dispex_static_data_t HTMLCommentElement_dispex = {
203 "Comment",
204 &HTMLCommentElement_event_target_vtbl.dispex_vtbl,
205 DispHTMLCommentElement_tid,
206 HTMLCommentElement_iface_tids,
207 HTMLElement_init_dispex_info
210 HRESULT HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLElement **elem)
212 HTMLCommentElement *ret;
214 ret = calloc(1, sizeof(*ret));
215 if(!ret)
216 return E_OUTOFMEMORY;
218 ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
219 ret->IHTMLCommentElement_iface.lpVtbl = &HTMLCommentElementVtbl;
221 HTMLElement_Init(&ret->element, doc, NULL, &HTMLCommentElement_dispex);
222 HTMLDOMNode_Init(doc, &ret->element.node, nsnode, &HTMLCommentElement_dispex);
224 *elem = &ret->element;
225 return S_OK;