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
);
37 const IHTMLDOMTextNodeVtbl
*lpIHTMLDOMTextNodeVtbl
;
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 FIXME("(%p)->(%p)\n", This
, pctinfo
);
75 static HRESULT WINAPI
HTMLDOMTextNode_GetTypeInfo(IHTMLDOMTextNode
*iface
, UINT iTInfo
,
76 LCID lcid
, ITypeInfo
**ppTInfo
)
78 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
79 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
83 static HRESULT WINAPI
HTMLDOMTextNode_GetIDsOfNames(IHTMLDOMTextNode
*iface
, REFIID riid
,
84 LPOLESTR
*rgszNames
, UINT cNames
,
85 LCID lcid
, DISPID
*rgDispId
)
87 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
88 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
93 static HRESULT WINAPI
HTMLDOMTextNode_Invoke(IHTMLDOMTextNode
*iface
, DISPID dispIdMember
,
94 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
95 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
97 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
98 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
99 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
103 static HRESULT WINAPI
HTMLDOMTextNode_put_data(IHTMLDOMTextNode
*iface
, BSTR v
)
105 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
106 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
110 static HRESULT WINAPI
HTMLDOMTextNode_get_data(IHTMLDOMTextNode
*iface
, BSTR
*p
)
112 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
113 FIXME("(%p)->(%p)\n", This
, p
);
117 static HRESULT WINAPI
HTMLDOMTextNode_toString(IHTMLDOMTextNode
*iface
, BSTR
*String
)
119 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
120 FIXME("(%p)->(%p)\n", This
, String
);
124 static HRESULT WINAPI
HTMLDOMTextNode_get_length(IHTMLDOMTextNode
*iface
, long *p
)
126 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
127 FIXME("(%p)->(%p)\n", This
, p
);
131 static HRESULT WINAPI
HTMLDOMTextNode_splitText(IHTMLDOMTextNode
*iface
, long offset
, IHTMLDOMNode
**pRetNode
)
133 HTMLDOMTextNode
*This
= HTMLTEXT_THIS(iface
);
134 FIXME("(%p)->(%ld %p)\n", This
, offset
, pRetNode
);
140 static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl
= {
141 HTMLDOMTextNode_QueryInterface
,
142 HTMLDOMTextNode_AddRef
,
143 HTMLDOMTextNode_Release
,
144 HTMLDOMTextNode_GetTypeInfoCount
,
145 HTMLDOMTextNode_GetTypeInfo
,
146 HTMLDOMTextNode_GetIDsOfNames
,
147 HTMLDOMTextNode_Invoke
,
148 HTMLDOMTextNode_put_data
,
149 HTMLDOMTextNode_get_data
,
150 HTMLDOMTextNode_toString
,
151 HTMLDOMTextNode_get_length
,
152 HTMLDOMTextNode_splitText
155 #define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface)
157 HRESULT
HTMLDOMTextNode_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
159 HTMLDOMTextNode
*This
= HTMLTEXT_NODE_THIS(iface
);
163 if(IsEqualGUID(&IID_IHTMLDOMTextNode
, riid
)) {
164 TRACE("(%p)->(IID_IHTMLDOMTextNode %p)\n", This
, ppv
);
165 *ppv
= HTMLTEXT(This
);
167 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
170 IUnknown_AddRef((IUnknown
*)*ppv
);
174 void HTMLDOMTextNode_destructor(HTMLDOMNode
*iface
)
176 HTMLDOMTextNode
*This
= HTMLTEXT_NODE_THIS(iface
);
178 HTMLDOMNode_destructor(&This
->node
);
181 #undef HTMLTEXT_NODE_THIS
183 static const NodeImplVtbl HTMLDOMTextNodeImplVtbl
= {
185 HTMLDOMTextNode_destructor
188 static const tid_t HTMLDOMTextNode_iface_tids
[] = {
191 IHTMLDOMTextNode_tid
,
194 static dispex_static_data_t HTMLDOMTextNode_dispex
= {
196 DispHTMLDOMTextNode_tid
,
198 HTMLDOMTextNode_iface_tids
201 HTMLDOMNode
*HTMLDOMTextNode_Create(HTMLDocument
*doc
, nsIDOMNode
*nsnode
)
203 HTMLDOMTextNode
*ret
;
205 ret
= heap_alloc_zero(sizeof(*ret
));
206 ret
->node
.vtbl
= &HTMLDOMTextNodeImplVtbl
;
207 ret
->lpIHTMLDOMTextNodeVtbl
= &HTMLDOMTextNodeVtbl
;
209 init_dispex(&ret
->node
.dispex
, (IUnknown
*)HTMLTEXT(ret
), &HTMLDOMTextNode_dispex
);
210 HTMLDOMNode_Init(doc
, &ret
->node
, nsnode
);