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);
39 const IHTMLTextAreaElementVtbl *lpHTMLTextAreaElementVtbl;
42 nsIDOMHTMLTextAreaElement *nstextarea;
43 } HTMLTextAreaElement;
45 #define HTMLTXTAREA(x) ((IHTMLTextAreaElement*) &(x)->lpHTMLTextAreaElementVtbl)
47 #define HTMLTXTAREA_THIS(iface) DEFINE_THIS(HTMLTextAreaElement, HTMLTextAreaElement, iface)
49 static HRESULT WINAPI HTMLTextAreaElement_QueryInterface(IHTMLTextAreaElement *iface,
50 REFIID riid, void **ppv)
52 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
57 if(IsEqualGUID(&IID_IUnknown, riid)) {
58 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
59 *ppv = HTMLTXTAREA(This);
60 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
61 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
62 *ppv = HTMLTXTAREA(This);
63 }else if(IsEqualGUID(&IID_IHTMLTextAreaElement, riid)) {
64 TRACE("(%p)->(IID_IHTMLTextAreaElement %p)\n", This, ppv);
65 *ppv = HTMLTXTAREA(This);
69 IUnknown_AddRef((IUnknown*)*ppv);
73 hres = HTMLElement_QI(This->element, riid, ppv);
75 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
80 static ULONG WINAPI HTMLTextAreaElement_AddRef(IHTMLTextAreaElement *iface)
82 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
84 TRACE("(%p)\n", This);
86 return IHTMLDocument2_AddRef(HTMLDOC(This->element->node->doc));
89 static ULONG WINAPI HTMLTextAreaElement_Release(IHTMLTextAreaElement *iface)
91 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
93 TRACE("(%p)\n", This);
95 return IHTMLDocument2_Release(HTMLDOC(This->element->node->doc));
98 static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfoCount(IHTMLTextAreaElement *iface, UINT *pctinfo)
100 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
101 FIXME("(%p)->(%p)\n", This, pctinfo);
105 static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfo(IHTMLTextAreaElement *iface, UINT iTInfo,
106 LCID lcid, ITypeInfo **ppTInfo)
108 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
109 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
113 static HRESULT WINAPI HTMLTextAreaElement_GetIDsOfNames(IHTMLTextAreaElement *iface, REFIID riid,
114 LPOLESTR *rgszNames, UINT cNames,
115 LCID lcid, DISPID *rgDispId)
117 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
118 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
123 static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DISPID dispIdMember,
124 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
125 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
127 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
128 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
129 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
133 static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p)
135 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
136 FIXME("(%p)->(%p)\n", This, p);
140 static HRESULT WINAPI HTMLTextAreaElement_put_value(IHTMLTextAreaElement *iface, BSTR v)
142 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
143 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
147 static HRESULT WINAPI HTMLTextAreaElement_get_value(IHTMLTextAreaElement *iface, BSTR *p)
149 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
151 const PRUnichar *value;
154 TRACE("(%p)->(%p)\n", This, p);
156 nsAString_Init(&value_str, NULL);
158 nsres = nsIDOMHTMLTextAreaElement_GetValue(This->nstextarea, &value_str);
159 if(NS_SUCCEEDED(nsres)) {
160 nsAString_GetData(&value_str, &value, NULL);
161 *p = SysAllocString(value);
163 ERR("GetValue failed: %08x\n", nsres);
166 nsAString_Finish(&value_str);
168 TRACE("%s\n", debugstr_w(*p));
172 static HRESULT WINAPI HTMLTextAreaElement_put_name(IHTMLTextAreaElement *iface, BSTR v)
174 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
175 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
179 static HRESULT WINAPI HTMLTextAreaElement_get_name(IHTMLTextAreaElement *iface, BSTR *p)
181 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
183 const PRUnichar *name;
186 TRACE("(%p)->(%p)\n", This, p);
188 nsAString_Init(&name_str, NULL);
190 nsres = nsIDOMHTMLTextAreaElement_GetName(This->nstextarea, &name_str);
191 if(NS_SUCCEEDED(nsres)) {
192 nsAString_GetData(&name_str, &name, NULL);
193 *p = SysAllocString(name);
195 ERR("GetName failed: %08x\n", nsres);
198 nsAString_Finish(&name_str);
200 TRACE("%s\n", debugstr_w(*p));
204 static HRESULT WINAPI HTMLTextAreaElement_put_status(IHTMLTextAreaElement *iface, VARIANT v)
206 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
207 FIXME("(%p)->()\n", This);
211 static HRESULT WINAPI HTMLTextAreaElement_get_status(IHTMLTextAreaElement *iface, VARIANT *p)
213 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
214 FIXME("(%p)->(%p)\n", This, p);
218 static HRESULT WINAPI HTMLTextAreaElement_put_disabled(IHTMLTextAreaElement *iface, VARIANT_BOOL v)
220 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
221 FIXME("(%p)->(%x)\n", This, v);
225 static HRESULT WINAPI HTMLTextAreaElement_get_disabled(IHTMLTextAreaElement *iface, VARIANT_BOOL *p)
227 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
228 FIXME("(%p)->(%p)\n", This, p);
232 static HRESULT WINAPI HTMLTextAreaElement_get_form(IHTMLTextAreaElement *iface, IHTMLFormElement **p)
234 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
235 FIXME("(%p)->(%p)\n", This, p);
239 static HRESULT WINAPI HTMLTextAreaElement_put_defaultValue(IHTMLTextAreaElement *iface, BSTR v)
241 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
242 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
246 static HRESULT WINAPI HTMLTextAreaElement_get_defaultValue(IHTMLTextAreaElement *iface, BSTR *p)
248 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
249 FIXME("(%p)->(%p)\n", This, p);
253 static HRESULT WINAPI HTMLTextAreaElement_select(IHTMLTextAreaElement *iface)
255 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
256 FIXME("(%p)\n", This);
260 static HRESULT WINAPI HTMLTextAreaElement_put_onchange(IHTMLTextAreaElement *iface, VARIANT v)
262 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
263 FIXME("(%p)->()\n", This);
267 static HRESULT WINAPI HTMLTextAreaElement_get_onchange(IHTMLTextAreaElement *iface, VARIANT *p)
269 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
270 FIXME("(%p)->(%p)\n", This, p);
274 static HRESULT WINAPI HTMLTextAreaElement_put_onselect(IHTMLTextAreaElement *iface, VARIANT v)
276 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
277 FIXME("(%p)->()\n", This);
281 static HRESULT WINAPI HTMLTextAreaElement_get_onselect(IHTMLTextAreaElement *iface, VARIANT *p)
283 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
284 FIXME("(%p)->(%p)\n", This, p);
288 static HRESULT WINAPI HTMLTextAreaElement_put_readOnly(IHTMLTextAreaElement *iface, VARIANT_BOOL v)
290 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
291 FIXME("(%p)->(%x)\n", This, v);
295 static HRESULT WINAPI HTMLTextAreaElement_get_readOnly(IHTMLTextAreaElement *iface, VARIANT_BOOL *p)
297 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
298 FIXME("(%p)->(%p)\n", This, p);
302 static HRESULT WINAPI HTMLTextAreaElement_put_rows(IHTMLTextAreaElement *iface, long v)
304 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
305 FIXME("(%p)->(%ld)\n", This, v);
309 static HRESULT WINAPI HTMLTextAreaElement_get_rows(IHTMLTextAreaElement *iface, long *p)
311 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
312 FIXME("(%p)->(%p)\n", This, p);
316 static HRESULT WINAPI HTMLTextAreaElement_put_cols(IHTMLTextAreaElement *iface, long v)
318 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
319 FIXME("(%p)->(%ld)\n", This, v);
323 static HRESULT WINAPI HTMLTextAreaElement_get_cols(IHTMLTextAreaElement *iface, long *p)
325 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
326 FIXME("(%p)->(%p)\n", This, p);
330 static HRESULT WINAPI HTMLTextAreaElement_put_wrap(IHTMLTextAreaElement *iface, BSTR v)
332 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
333 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
337 static HRESULT WINAPI HTMLTextAreaElement_get_wrap(IHTMLTextAreaElement *iface, BSTR *p)
339 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
340 FIXME("(%p)->(%p)\n", This, p);
344 static HRESULT WINAPI HTMLTextAreaElement_createTextRange(IHTMLTextAreaElement *iface,
345 IHTMLTxtRange **range)
347 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
348 FIXME("(%p)->(%p)\n", This, range);
352 static void HTMLTextAreaElement_destructor(IUnknown *iface)
354 HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
356 nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
360 #undef HTMLTXTAREA_THIS
362 static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = {
363 HTMLTextAreaElement_QueryInterface,
364 HTMLTextAreaElement_AddRef,
365 HTMLTextAreaElement_Release,
366 HTMLTextAreaElement_GetTypeInfoCount,
367 HTMLTextAreaElement_GetTypeInfo,
368 HTMLTextAreaElement_GetIDsOfNames,
369 HTMLTextAreaElement_Invoke,
370 HTMLTextAreaElement_get_type,
371 HTMLTextAreaElement_put_value,
372 HTMLTextAreaElement_get_value,
373 HTMLTextAreaElement_put_name,
374 HTMLTextAreaElement_get_name,
375 HTMLTextAreaElement_put_status,
376 HTMLTextAreaElement_get_status,
377 HTMLTextAreaElement_put_disabled,
378 HTMLTextAreaElement_get_disabled,
379 HTMLTextAreaElement_get_form,
380 HTMLTextAreaElement_put_defaultValue,
381 HTMLTextAreaElement_get_defaultValue,
382 HTMLTextAreaElement_select,
383 HTMLTextAreaElement_put_onchange,
384 HTMLTextAreaElement_get_onchange,
385 HTMLTextAreaElement_put_onselect,
386 HTMLTextAreaElement_get_onselect,
387 HTMLTextAreaElement_put_readOnly,
388 HTMLTextAreaElement_get_readOnly,
389 HTMLTextAreaElement_put_rows,
390 HTMLTextAreaElement_get_rows,
391 HTMLTextAreaElement_put_cols,
392 HTMLTextAreaElement_get_cols,
393 HTMLTextAreaElement_put_wrap,
394 HTMLTextAreaElement_get_wrap,
395 HTMLTextAreaElement_createTextRange
398 void HTMLTextAreaElement_Create(HTMLElement *element)
400 HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement));
403 ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
404 ret->element = element;
406 nsres = nsIDOMHTMLElement_QueryInterface(element->nselem, &IID_nsIDOMHTMLTextAreaElement,
407 (void**)&ret->nstextarea);
409 ERR("Could not get nsDOMHTMLInputElement: %08x\n", nsres);
411 element->impl = (IUnknown*)HTMLTXTAREA(ret);
412 element->destructor = HTMLTextAreaElement_destructor;