mlang/tests: Fix a pointer casting warning on 64-bit.
[wine/testsucceed.git] / dlls / mshtml / htmltextnode.c
blobd6453b1d9e47ead708c55e5ebf02dcbab6129571
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 HTMLDOMNode node;
37 const IHTMLDOMTextNodeVtbl *lpIHTMLDOMTextNodeVtbl;
38 } HTMLDOMTextNode;
40 #define HTMLTEXT(x) ((IHTMLDOMTextNode*) &(x)->lpIHTMLDOMTextNodeVtbl)
42 #define HTMLTEXT_THIS(iface) DEFINE_THIS(HTMLDOMTextNode, IHTMLDOMTextNode, iface)
44 #define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface)
46 static HRESULT WINAPI HTMLDOMTextNode_QueryInterface(IHTMLDOMTextNode *iface,
47 REFIID riid, void **ppv)
49 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
51 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->node), riid, ppv);
54 static ULONG WINAPI HTMLDOMTextNode_AddRef(IHTMLDOMTextNode *iface)
56 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
58 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->node));
61 static ULONG WINAPI HTMLDOMTextNode_Release(IHTMLDOMTextNode *iface)
63 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
65 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->node));
68 static HRESULT WINAPI HTMLDOMTextNode_GetTypeInfoCount(IHTMLDOMTextNode *iface, UINT *pctinfo)
70 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
71 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
74 static HRESULT WINAPI HTMLDOMTextNode_GetTypeInfo(IHTMLDOMTextNode *iface, UINT iTInfo,
75 LCID lcid, ITypeInfo **ppTInfo)
77 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
78 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
81 static HRESULT WINAPI HTMLDOMTextNode_GetIDsOfNames(IHTMLDOMTextNode *iface, REFIID riid,
82 LPOLESTR *rgszNames, UINT cNames,
83 LCID lcid, DISPID *rgDispId)
85 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
86 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
89 static HRESULT WINAPI HTMLDOMTextNode_Invoke(IHTMLDOMTextNode *iface, DISPID dispIdMember,
90 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
91 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
93 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
94 return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
95 pVarResult, pExcepInfo, puArgErr);
98 static HRESULT WINAPI HTMLDOMTextNode_put_data(IHTMLDOMTextNode *iface, BSTR v)
100 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
101 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
102 return E_NOTIMPL;
105 static HRESULT WINAPI HTMLDOMTextNode_get_data(IHTMLDOMTextNode *iface, BSTR *p)
107 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
108 FIXME("(%p)->(%p)\n", This, p);
109 return E_NOTIMPL;
112 static HRESULT WINAPI HTMLDOMTextNode_toString(IHTMLDOMTextNode *iface, BSTR *String)
114 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
115 FIXME("(%p)->(%p)\n", This, String);
116 return E_NOTIMPL;
119 static HRESULT WINAPI HTMLDOMTextNode_get_length(IHTMLDOMTextNode *iface, long *p)
121 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
122 FIXME("(%p)->(%p)\n", This, p);
123 return E_NOTIMPL;
126 static HRESULT WINAPI HTMLDOMTextNode_splitText(IHTMLDOMTextNode *iface, long offset, IHTMLDOMNode **pRetNode)
128 HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
129 FIXME("(%p)->(%ld %p)\n", This, offset, pRetNode);
130 return E_NOTIMPL;
133 #undef HTMLTEXT_THIS
135 static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl = {
136 HTMLDOMTextNode_QueryInterface,
137 HTMLDOMTextNode_AddRef,
138 HTMLDOMTextNode_Release,
139 HTMLDOMTextNode_GetTypeInfoCount,
140 HTMLDOMTextNode_GetTypeInfo,
141 HTMLDOMTextNode_GetIDsOfNames,
142 HTMLDOMTextNode_Invoke,
143 HTMLDOMTextNode_put_data,
144 HTMLDOMTextNode_get_data,
145 HTMLDOMTextNode_toString,
146 HTMLDOMTextNode_get_length,
147 HTMLDOMTextNode_splitText
150 #define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface)
152 static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
154 HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface);
156 *ppv = NULL;
158 if(IsEqualGUID(&IID_IHTMLDOMTextNode, riid)) {
159 TRACE("(%p)->(IID_IHTMLDOMTextNode %p)\n", This, ppv);
160 *ppv = HTMLTEXT(This);
161 }else {
162 return HTMLDOMNode_QI(&This->node, riid, ppv);
165 IUnknown_AddRef((IUnknown*)*ppv);
166 return S_OK;
169 static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface)
171 HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface);
173 HTMLDOMNode_destructor(&This->node);
176 #undef HTMLTEXT_NODE_THIS
178 static const NodeImplVtbl HTMLDOMTextNodeImplVtbl = {
179 HTMLDOMTextNode_QI,
180 HTMLDOMTextNode_destructor
183 static const tid_t HTMLDOMTextNode_iface_tids[] = {
184 IHTMLDOMNode_tid,
185 IHTMLDOMNode2_tid,
186 IHTMLDOMTextNode_tid,
189 static dispex_static_data_t HTMLDOMTextNode_dispex = {
190 NULL,
191 DispHTMLDOMTextNode_tid,
193 HTMLDOMTextNode_iface_tids
196 HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocument *doc, nsIDOMNode *nsnode)
198 HTMLDOMTextNode *ret ;
200 ret = heap_alloc_zero(sizeof(*ret));
201 ret->node.vtbl = &HTMLDOMTextNodeImplVtbl;
202 ret->lpIHTMLDOMTextNodeVtbl = &HTMLDOMTextNodeVtbl;
204 init_dispex(&ret->node.dispex, (IUnknown*)HTMLTEXT(ret), &HTMLDOMTextNode_dispex);
205 HTMLDOMNode_Init(doc, &ret->node, nsnode);
207 return &ret->node;