2 * Copyright 2006 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
32 #include "wine/debug.h"
34 #include "mshtml_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
41 const IHTMLTextAreaElementVtbl *lpHTMLTextAreaElementVtbl;
43 nsIDOMHTMLTextAreaElement *nstextarea;
44 } HTMLTextAreaElement;
46 #define HTMLTXTAREA(x) ((IHTMLTextAreaElement*) &(x)->lpHTMLTextAreaElementVtbl)
48 #define HTMLTXTAREA_THIS(iface) DEFINE_THIS(HTMLTextAreaElement, HTMLTextAreaElement, iface)
50 static HRESULT WINAPI HTMLTextAreaElement_QueryInterface(IHTMLTextAreaElement *iface,
51 REFIID riid, void **ppv)
53 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
58 if(IsEqualGUID(&IID_IUnknown, riid)) {
59 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
60 *ppv = HTMLTXTAREA(This);
61 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
62 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
63 *ppv = HTMLTXTAREA(This);
64 }else if(IsEqualGUID(&IID_IHTMLTextAreaElement, riid)) {
65 TRACE("(%p)->(IID_IHTMLTextAreaElement %p)\n", This, ppv);
66 *ppv = HTMLTXTAREA(This);
70 IUnknown_AddRef((IUnknown*)*ppv);
74 hres = HTMLElement_QI(&This->element, riid, ppv);
76 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
81 static ULONG WINAPI HTMLTextAreaElement_AddRef(IHTMLTextAreaElement *iface)
83 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
85 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
88 static ULONG WINAPI HTMLTextAreaElement_Release(IHTMLTextAreaElement *iface)
90 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
92 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
95 static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfoCount(IHTMLTextAreaElement *iface, UINT *pctinfo)
97 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
98 FIXME("(%p)->(%p)\n", This, pctinfo);
102 static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfo(IHTMLTextAreaElement *iface, UINT iTInfo,
103 LCID lcid, ITypeInfo **ppTInfo)
105 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
106 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
110 static HRESULT WINAPI HTMLTextAreaElement_GetIDsOfNames(IHTMLTextAreaElement *iface, REFIID riid,
111 LPOLESTR *rgszNames, UINT cNames,
112 LCID lcid, DISPID *rgDispId)
114 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
115 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
120 static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DISPID dispIdMember,
121 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
122 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
124 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
125 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
126 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
130 static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p)
132 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
133 FIXME("(%p)->(%p)\n", This, p);
137 static HRESULT WINAPI HTMLTextAreaElement_put_value(IHTMLTextAreaElement *iface, BSTR v)
139 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
140 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
144 static HRESULT WINAPI HTMLTextAreaElement_get_value(IHTMLTextAreaElement *iface, BSTR *p)
146 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
148 const PRUnichar *value;
151 TRACE("(%p)->(%p)\n", This, p);
153 nsAString_Init(&value_str, NULL);
155 nsres = nsIDOMHTMLTextAreaElement_GetValue(This->nstextarea, &value_str);
156 if(NS_SUCCEEDED(nsres)) {
157 nsAString_GetData(&value_str, &value, NULL);
158 *p = SysAllocString(value);
160 ERR("GetValue failed: %08x\n", nsres);
163 nsAString_Finish(&value_str);
165 TRACE("%s\n", debugstr_w(*p));
169 static HRESULT WINAPI HTMLTextAreaElement_put_name(IHTMLTextAreaElement *iface, BSTR v)
171 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
172 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
176 static HRESULT WINAPI HTMLTextAreaElement_get_name(IHTMLTextAreaElement *iface, BSTR *p)
178 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
180 const PRUnichar *name;
183 TRACE("(%p)->(%p)\n", This, p);
185 nsAString_Init(&name_str, NULL);
187 nsres = nsIDOMHTMLTextAreaElement_GetName(This->nstextarea, &name_str);
188 if(NS_SUCCEEDED(nsres)) {
189 nsAString_GetData(&name_str, &name, NULL);
190 *p = SysAllocString(name);
192 ERR("GetName failed: %08x\n", nsres);
195 nsAString_Finish(&name_str);
197 TRACE("%s\n", debugstr_w(*p));
201 static HRESULT WINAPI HTMLTextAreaElement_put_status(IHTMLTextAreaElement *iface, VARIANT v)
203 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
204 FIXME("(%p)->()\n", This);
208 static HRESULT WINAPI HTMLTextAreaElement_get_status(IHTMLTextAreaElement *iface, VARIANT *p)
210 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
211 FIXME("(%p)->(%p)\n", This, p);
215 static HRESULT WINAPI HTMLTextAreaElement_put_disabled(IHTMLTextAreaElement *iface, VARIANT_BOOL v)
217 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
218 FIXME("(%p)->(%x)\n", This, v);
222 static HRESULT WINAPI HTMLTextAreaElement_get_disabled(IHTMLTextAreaElement *iface, VARIANT_BOOL *p)
224 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
225 FIXME("(%p)->(%p)\n", This, p);
229 static HRESULT WINAPI HTMLTextAreaElement_get_form(IHTMLTextAreaElement *iface, IHTMLFormElement **p)
231 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
232 FIXME("(%p)->(%p)\n", This, p);
236 static HRESULT WINAPI HTMLTextAreaElement_put_defaultValue(IHTMLTextAreaElement *iface, BSTR v)
238 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
239 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
243 static HRESULT WINAPI HTMLTextAreaElement_get_defaultValue(IHTMLTextAreaElement *iface, BSTR *p)
245 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
246 FIXME("(%p)->(%p)\n", This, p);
250 static HRESULT WINAPI HTMLTextAreaElement_select(IHTMLTextAreaElement *iface)
252 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
253 FIXME("(%p)\n", This);
257 static HRESULT WINAPI HTMLTextAreaElement_put_onchange(IHTMLTextAreaElement *iface, VARIANT v)
259 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
260 FIXME("(%p)->()\n", This);
264 static HRESULT WINAPI HTMLTextAreaElement_get_onchange(IHTMLTextAreaElement *iface, VARIANT *p)
266 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
267 FIXME("(%p)->(%p)\n", This, p);
271 static HRESULT WINAPI HTMLTextAreaElement_put_onselect(IHTMLTextAreaElement *iface, VARIANT v)
273 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
274 FIXME("(%p)->()\n", This);
278 static HRESULT WINAPI HTMLTextAreaElement_get_onselect(IHTMLTextAreaElement *iface, VARIANT *p)
280 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
281 FIXME("(%p)->(%p)\n", This, p);
285 static HRESULT WINAPI HTMLTextAreaElement_put_readOnly(IHTMLTextAreaElement *iface, VARIANT_BOOL v)
287 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
288 FIXME("(%p)->(%x)\n", This, v);
292 static HRESULT WINAPI HTMLTextAreaElement_get_readOnly(IHTMLTextAreaElement *iface, VARIANT_BOOL *p)
294 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
295 FIXME("(%p)->(%p)\n", This, p);
299 static HRESULT WINAPI HTMLTextAreaElement_put_rows(IHTMLTextAreaElement *iface, long v)
301 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
302 FIXME("(%p)->(%ld)\n", This, v);
306 static HRESULT WINAPI HTMLTextAreaElement_get_rows(IHTMLTextAreaElement *iface, long *p)
308 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
309 FIXME("(%p)->(%p)\n", This, p);
313 static HRESULT WINAPI HTMLTextAreaElement_put_cols(IHTMLTextAreaElement *iface, long v)
315 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
316 FIXME("(%p)->(%ld)\n", This, v);
320 static HRESULT WINAPI HTMLTextAreaElement_get_cols(IHTMLTextAreaElement *iface, long *p)
322 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
323 FIXME("(%p)->(%p)\n", This, p);
327 static HRESULT WINAPI HTMLTextAreaElement_put_wrap(IHTMLTextAreaElement *iface, BSTR v)
329 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
330 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
334 static HRESULT WINAPI HTMLTextAreaElement_get_wrap(IHTMLTextAreaElement *iface, BSTR *p)
336 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
337 FIXME("(%p)->(%p)\n", This, p);
341 static HRESULT WINAPI HTMLTextAreaElement_createTextRange(IHTMLTextAreaElement *iface,
342 IHTMLTxtRange **range)
344 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
345 FIXME("(%p)->(%p)\n", This, range);
349 static void HTMLTextAreaElement_destructor(IUnknown *iface)
351 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
353 nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
357 #undef HTMLTXTAREA_THIS
359 static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = {
360 HTMLTextAreaElement_QueryInterface,
361 HTMLTextAreaElement_AddRef,
362 HTMLTextAreaElement_Release,
363 HTMLTextAreaElement_GetTypeInfoCount,
364 HTMLTextAreaElement_GetTypeInfo,
365 HTMLTextAreaElement_GetIDsOfNames,
366 HTMLTextAreaElement_Invoke,
367 HTMLTextAreaElement_get_type,
368 HTMLTextAreaElement_put_value,
369 HTMLTextAreaElement_get_value,
370 HTMLTextAreaElement_put_name,
371 HTMLTextAreaElement_get_name,
372 HTMLTextAreaElement_put_status,
373 HTMLTextAreaElement_get_status,
374 HTMLTextAreaElement_put_disabled,
375 HTMLTextAreaElement_get_disabled,
376 HTMLTextAreaElement_get_form,
377 HTMLTextAreaElement_put_defaultValue,
378 HTMLTextAreaElement_get_defaultValue,
379 HTMLTextAreaElement_select,
380 HTMLTextAreaElement_put_onchange,
381 HTMLTextAreaElement_get_onchange,
382 HTMLTextAreaElement_put_onselect,
383 HTMLTextAreaElement_get_onselect,
384 HTMLTextAreaElement_put_readOnly,
385 HTMLTextAreaElement_get_readOnly,
386 HTMLTextAreaElement_put_rows,
387 HTMLTextAreaElement_get_rows,
388 HTMLTextAreaElement_put_cols,
389 HTMLTextAreaElement_get_cols,
390 HTMLTextAreaElement_put_wrap,
391 HTMLTextAreaElement_get_wrap,
392 HTMLTextAreaElement_createTextRange
395 HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
397 HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement));
400 ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
402 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
403 (void**)&ret->nstextarea);
405 ERR("Could not get nsDOMHTMLInputElement: %08x\n", nsres);
407 ret->element.impl = (IUnknown*)HTMLTXTAREA(ret);
408 ret->element.destructor = HTMLTextAreaElement_destructor;
410 return &ret->element;