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 TRACE("(%p)\n", This);
87 return IHTMLDocument2_AddRef(HTMLDOC(This->element.node.doc));
90 static ULONG WINAPI HTMLTextAreaElement_Release(IHTMLTextAreaElement *iface)
92 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
94 TRACE("(%p)\n", This);
96 return IHTMLDocument2_Release(HTMLDOC(This->element.node.doc));
99 static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfoCount(IHTMLTextAreaElement *iface, UINT *pctinfo)
101 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
102 FIXME("(%p)->(%p)\n", This, pctinfo);
106 static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfo(IHTMLTextAreaElement *iface, UINT iTInfo,
107 LCID lcid, ITypeInfo **ppTInfo)
109 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
110 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
114 static HRESULT WINAPI HTMLTextAreaElement_GetIDsOfNames(IHTMLTextAreaElement *iface, REFIID riid,
115 LPOLESTR *rgszNames, UINT cNames,
116 LCID lcid, DISPID *rgDispId)
118 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
119 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
124 static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DISPID dispIdMember,
125 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
126 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
128 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
129 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
130 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
134 static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p)
136 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
137 FIXME("(%p)->(%p)\n", This, p);
141 static HRESULT WINAPI HTMLTextAreaElement_put_value(IHTMLTextAreaElement *iface, BSTR v)
143 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
144 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
148 static HRESULT WINAPI HTMLTextAreaElement_get_value(IHTMLTextAreaElement *iface, BSTR *p)
150 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
152 const PRUnichar *value;
155 TRACE("(%p)->(%p)\n", This, p);
157 nsAString_Init(&value_str, NULL);
159 nsres = nsIDOMHTMLTextAreaElement_GetValue(This->nstextarea, &value_str);
160 if(NS_SUCCEEDED(nsres)) {
161 nsAString_GetData(&value_str, &value, NULL);
162 *p = SysAllocString(value);
164 ERR("GetValue failed: %08x\n", nsres);
167 nsAString_Finish(&value_str);
169 TRACE("%s\n", debugstr_w(*p));
173 static HRESULT WINAPI HTMLTextAreaElement_put_name(IHTMLTextAreaElement *iface, BSTR v)
175 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
176 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
180 static HRESULT WINAPI HTMLTextAreaElement_get_name(IHTMLTextAreaElement *iface, BSTR *p)
182 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
184 const PRUnichar *name;
187 TRACE("(%p)->(%p)\n", This, p);
189 nsAString_Init(&name_str, NULL);
191 nsres = nsIDOMHTMLTextAreaElement_GetName(This->nstextarea, &name_str);
192 if(NS_SUCCEEDED(nsres)) {
193 nsAString_GetData(&name_str, &name, NULL);
194 *p = SysAllocString(name);
196 ERR("GetName failed: %08x\n", nsres);
199 nsAString_Finish(&name_str);
201 TRACE("%s\n", debugstr_w(*p));
205 static HRESULT WINAPI HTMLTextAreaElement_put_status(IHTMLTextAreaElement *iface, VARIANT v)
207 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
208 FIXME("(%p)->()\n", This);
212 static HRESULT WINAPI HTMLTextAreaElement_get_status(IHTMLTextAreaElement *iface, VARIANT *p)
214 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
215 FIXME("(%p)->(%p)\n", This, p);
219 static HRESULT WINAPI HTMLTextAreaElement_put_disabled(IHTMLTextAreaElement *iface, VARIANT_BOOL v)
221 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
222 FIXME("(%p)->(%x)\n", This, v);
226 static HRESULT WINAPI HTMLTextAreaElement_get_disabled(IHTMLTextAreaElement *iface, VARIANT_BOOL *p)
228 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
229 FIXME("(%p)->(%p)\n", This, p);
233 static HRESULT WINAPI HTMLTextAreaElement_get_form(IHTMLTextAreaElement *iface, IHTMLFormElement **p)
235 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
236 FIXME("(%p)->(%p)\n", This, p);
240 static HRESULT WINAPI HTMLTextAreaElement_put_defaultValue(IHTMLTextAreaElement *iface, BSTR v)
242 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
243 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
247 static HRESULT WINAPI HTMLTextAreaElement_get_defaultValue(IHTMLTextAreaElement *iface, BSTR *p)
249 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
250 FIXME("(%p)->(%p)\n", This, p);
254 static HRESULT WINAPI HTMLTextAreaElement_select(IHTMLTextAreaElement *iface)
256 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
257 FIXME("(%p)\n", This);
261 static HRESULT WINAPI HTMLTextAreaElement_put_onchange(IHTMLTextAreaElement *iface, VARIANT v)
263 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
264 FIXME("(%p)->()\n", This);
268 static HRESULT WINAPI HTMLTextAreaElement_get_onchange(IHTMLTextAreaElement *iface, VARIANT *p)
270 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
271 FIXME("(%p)->(%p)\n", This, p);
275 static HRESULT WINAPI HTMLTextAreaElement_put_onselect(IHTMLTextAreaElement *iface, VARIANT v)
277 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
278 FIXME("(%p)->()\n", This);
282 static HRESULT WINAPI HTMLTextAreaElement_get_onselect(IHTMLTextAreaElement *iface, VARIANT *p)
284 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
285 FIXME("(%p)->(%p)\n", This, p);
289 static HRESULT WINAPI HTMLTextAreaElement_put_readOnly(IHTMLTextAreaElement *iface, VARIANT_BOOL v)
291 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
292 FIXME("(%p)->(%x)\n", This, v);
296 static HRESULT WINAPI HTMLTextAreaElement_get_readOnly(IHTMLTextAreaElement *iface, VARIANT_BOOL *p)
298 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
299 FIXME("(%p)->(%p)\n", This, p);
303 static HRESULT WINAPI HTMLTextAreaElement_put_rows(IHTMLTextAreaElement *iface, long v)
305 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
306 FIXME("(%p)->(%ld)\n", This, v);
310 static HRESULT WINAPI HTMLTextAreaElement_get_rows(IHTMLTextAreaElement *iface, long *p)
312 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
313 FIXME("(%p)->(%p)\n", This, p);
317 static HRESULT WINAPI HTMLTextAreaElement_put_cols(IHTMLTextAreaElement *iface, long v)
319 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
320 FIXME("(%p)->(%ld)\n", This, v);
324 static HRESULT WINAPI HTMLTextAreaElement_get_cols(IHTMLTextAreaElement *iface, long *p)
326 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
327 FIXME("(%p)->(%p)\n", This, p);
331 static HRESULT WINAPI HTMLTextAreaElement_put_wrap(IHTMLTextAreaElement *iface, BSTR v)
333 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
334 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
338 static HRESULT WINAPI HTMLTextAreaElement_get_wrap(IHTMLTextAreaElement *iface, BSTR *p)
340 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
341 FIXME("(%p)->(%p)\n", This, p);
345 static HRESULT WINAPI HTMLTextAreaElement_createTextRange(IHTMLTextAreaElement *iface,
346 IHTMLTxtRange **range)
348 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
349 FIXME("(%p)->(%p)\n", This, range);
353 static void HTMLTextAreaElement_destructor(IUnknown *iface)
355 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
357 nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
361 #undef HTMLTXTAREA_THIS
363 static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = {
364 HTMLTextAreaElement_QueryInterface,
365 HTMLTextAreaElement_AddRef,
366 HTMLTextAreaElement_Release,
367 HTMLTextAreaElement_GetTypeInfoCount,
368 HTMLTextAreaElement_GetTypeInfo,
369 HTMLTextAreaElement_GetIDsOfNames,
370 HTMLTextAreaElement_Invoke,
371 HTMLTextAreaElement_get_type,
372 HTMLTextAreaElement_put_value,
373 HTMLTextAreaElement_get_value,
374 HTMLTextAreaElement_put_name,
375 HTMLTextAreaElement_get_name,
376 HTMLTextAreaElement_put_status,
377 HTMLTextAreaElement_get_status,
378 HTMLTextAreaElement_put_disabled,
379 HTMLTextAreaElement_get_disabled,
380 HTMLTextAreaElement_get_form,
381 HTMLTextAreaElement_put_defaultValue,
382 HTMLTextAreaElement_get_defaultValue,
383 HTMLTextAreaElement_select,
384 HTMLTextAreaElement_put_onchange,
385 HTMLTextAreaElement_get_onchange,
386 HTMLTextAreaElement_put_onselect,
387 HTMLTextAreaElement_get_onselect,
388 HTMLTextAreaElement_put_readOnly,
389 HTMLTextAreaElement_get_readOnly,
390 HTMLTextAreaElement_put_rows,
391 HTMLTextAreaElement_get_rows,
392 HTMLTextAreaElement_put_cols,
393 HTMLTextAreaElement_get_cols,
394 HTMLTextAreaElement_put_wrap,
395 HTMLTextAreaElement_get_wrap,
396 HTMLTextAreaElement_createTextRange
399 HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
401 HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement));
404 ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
406 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
407 (void**)&ret->nstextarea);
409 ERR("Could not get nsDOMHTMLInputElement: %08x\n", nsres);
411 ret->element.impl = (IUnknown*)HTMLTXTAREA(ret);
412 ret->element.destructor = HTMLTextAreaElement_destructor;
414 return &ret->element;