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 HTMLDOMTextNode
{
37 const IHTMLDOMTextNodeVtbl
*lpIHTMLDOMTextNodeVtbl
;
40 #define HTMLTEXT(x) (&(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
));
105 static HRESULT WINAPI
HTMLDOMTextNode_get_data(IHTMLDOMTextNode
*iface
, BSTR
*p
)
107 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
108 FIXME("(%p)->(%p)\n", This
, p
);
112 static HRESULT WINAPI
HTMLDOMTextNode_toString(IHTMLDOMTextNode
*iface
, BSTR
*String
)
114 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
115 FIXME("(%p)->(%p)\n", This
, String
);
119 static HRESULT WINAPI
HTMLDOMTextNode_get_length(IHTMLDOMTextNode
*iface
, LONG
*p
)
121 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
122 FIXME("(%p)->(%p)\n", This
, p
);
126 static HRESULT WINAPI
HTMLDOMTextNode_splitText(IHTMLDOMTextNode
*iface
, LONG offset
, IHTMLDOMNode
**pRetNode
)
128 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
129 FIXME("(%p)->(%d %p)\n", This
, offset
, pRetNode
);
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
);
158 if(IsEqualGUID(&IID_IHTMLDOMTextNode
, riid
)) {
159 TRACE("(%p)->(IID_IHTMLDOMTextNode %p)\n", This
, ppv
);
160 *ppv
= HTMLTEXT(This
);
162 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
165 IUnknown_AddRef((IUnknown
*)*ppv
);
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
= {
180 HTMLDOMTextNode_destructor
183 static const tid_t HTMLDOMTextNode_iface_tids
[] = {
186 IHTMLDOMTextNode_tid
,
189 static dispex_static_data_t HTMLDOMTextNode_dispex
= {
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
);