push 9cc132ec6c678833a0b16cc6a61d52a23f072314
[wine/hacks.git] / dlls / mshtml / htmlinput.c
blob76a5063bc2ed7ad6a4c7257447bafab2173a3d76
1 /*
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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 typedef struct {
36 HTMLElement element;
38 const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
39 const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
41 nsIDOMHTMLInputElement *nsinput;
42 } HTMLInputElement;
44 #define HTMLINPUT(x) ((IHTMLInputElement*) &(x)->lpHTMLInputElementVtbl)
45 #define HTMLINPUTTEXT(x) (&(x)->lpHTMLInputTextElementVtbl)
47 #define HTMLINPUT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputElement, iface)
49 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
50 REFIID riid, void **ppv)
52 HTMLInputElement *This = HTMLINPUT_THIS(iface);
54 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
57 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
59 HTMLInputElement *This = HTMLINPUT_THIS(iface);
61 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
64 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
66 HTMLInputElement *This = HTMLINPUT_THIS(iface);
68 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
71 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
73 HTMLInputElement *This = HTMLINPUT_THIS(iface);
75 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
78 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
79 LCID lcid, ITypeInfo **ppTInfo)
81 HTMLInputElement *This = HTMLINPUT_THIS(iface);
83 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
86 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
87 LPOLESTR *rgszNames, UINT cNames,
88 LCID lcid, DISPID *rgDispId)
90 HTMLInputElement *This = HTMLINPUT_THIS(iface);
92 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
93 cNames, lcid, rgDispId);
96 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
97 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
98 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
100 HTMLInputElement *This = HTMLINPUT_THIS(iface);
102 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
103 pDispParams, pVarResult, pExcepInfo, puArgErr);
106 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
108 HTMLInputElement *This = HTMLINPUT_THIS(iface);
109 nsAString type_str;
110 nsresult nsres;
112 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
115 * FIXME:
116 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
118 nsAString_InitDepend(&type_str, v);
119 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
120 nsAString_Finish(&type_str);
121 if(NS_FAILED(nsres)) {
122 ERR("SetType failed: %08x\n", nsres);
123 return E_FAIL;
126 return S_OK;
129 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
131 HTMLInputElement *This = HTMLINPUT_THIS(iface);
132 nsAString type_str;
133 const PRUnichar *type;
134 nsresult nsres;
136 TRACE("(%p)->(%p)\n", This, p);
138 nsAString_Init(&type_str, NULL);
139 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
141 if(NS_SUCCEEDED(nsres)) {
142 nsAString_GetData(&type_str, &type);
143 *p = SysAllocString(type);
144 }else {
145 ERR("GetType failed: %08x\n", nsres);
148 nsAString_Finish(&type_str);
150 TRACE("type=%s\n", debugstr_w(*p));
151 return S_OK;
154 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
156 HTMLInputElement *This = HTMLINPUT_THIS(iface);
157 nsAString val_str;
158 nsresult nsres;
160 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
162 nsAString_InitDepend(&val_str, v);
163 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
164 nsAString_Finish(&val_str);
165 if(NS_FAILED(nsres))
166 ERR("SetValue failed: %08x\n", nsres);
168 return S_OK;
171 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
173 HTMLInputElement *This = HTMLINPUT_THIS(iface);
174 nsAString value_str;
175 const PRUnichar *value = NULL;
176 nsresult nsres;
178 TRACE("(%p)->(%p)\n", This, p);
180 nsAString_Init(&value_str, NULL);
182 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
183 if(NS_SUCCEEDED(nsres)) {
184 nsAString_GetData(&value_str, &value);
185 *p = SysAllocString(value);
186 }else {
187 ERR("GetValue failed: %08x\n", nsres);
190 nsAString_Finish(&value_str);
192 TRACE("value=%s\n", debugstr_w(*p));
193 return S_OK;
196 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
198 HTMLInputElement *This = HTMLINPUT_THIS(iface);
199 nsAString name_str;
200 nsresult nsres;
202 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
204 nsAString_InitDepend(&name_str, v);
205 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
206 nsAString_Finish(&name_str);
207 if(NS_FAILED(nsres)) {
208 ERR("SetName failed: %08x\n", nsres);
209 return E_FAIL;
212 return S_OK;
215 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
217 HTMLInputElement *This = HTMLINPUT_THIS(iface);
218 nsAString name_str;
219 const PRUnichar *name;
220 nsresult nsres;
221 HRESULT hres = S_OK;
223 TRACE("(%p)->(%p)\n", This, p);
225 nsAString_Init(&name_str, NULL);
227 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
228 if(NS_SUCCEEDED(nsres)) {
229 nsAString_GetData(&name_str, &name);
230 *p = *name ? SysAllocString(name) : NULL;
231 }else {
232 ERR("GetName failed: %08x\n", nsres);
233 hres = E_FAIL;
236 nsAString_Finish(&name_str);
237 return hres;
240 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
242 HTMLInputElement *This = HTMLINPUT_THIS(iface);
243 FIXME("(%p)->(%x)\n", This, v);
244 return E_NOTIMPL;
247 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
249 HTMLInputElement *This = HTMLINPUT_THIS(iface);
250 FIXME("(%p)->(%p)\n", This, p);
251 return E_NOTIMPL;
254 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
256 HTMLInputElement *This = HTMLINPUT_THIS(iface);
257 nsresult nsres;
259 TRACE("(%p)->(%x)\n", This, v);
261 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
262 if(NS_FAILED(nsres))
263 ERR("SetDisabled failed: %08x\n", nsres);
265 return S_OK;
268 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
270 HTMLInputElement *This = HTMLINPUT_THIS(iface);
271 PRBool disabled = FALSE;
273 TRACE("(%p)->(%p)\n", This, p);
275 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
277 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
278 return S_OK;
281 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
283 HTMLInputElement *This = HTMLINPUT_THIS(iface);
284 FIXME("(%p)->(%p)\n", This, p);
285 return E_NOTIMPL;
288 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
290 HTMLInputElement *This = HTMLINPUT_THIS(iface);
291 FIXME("(%p)->(%d)\n", This, v);
292 return E_NOTIMPL;
295 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
297 HTMLInputElement *This = HTMLINPUT_THIS(iface);
298 FIXME("(%p)->(%p)\n", This, p);
299 return E_NOTIMPL;
302 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
304 HTMLInputElement *This = HTMLINPUT_THIS(iface);
305 FIXME("(%p)->(%d)\n", This, v);
306 return E_NOTIMPL;
309 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
311 HTMLInputElement *This = HTMLINPUT_THIS(iface);
312 FIXME("(%p)->(%p)\n", This, p);
313 return E_NOTIMPL;
316 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
318 HTMLInputElement *This = HTMLINPUT_THIS(iface);
319 nsresult nsres;
321 TRACE("(%p)\n", This);
323 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
324 if(NS_FAILED(nsres)) {
325 ERR("Select failed: %08x\n", nsres);
326 return E_FAIL;
329 return S_OK;
332 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
334 HTMLInputElement *This = HTMLINPUT_THIS(iface);
335 FIXME("(%p)->()\n", This);
336 return E_NOTIMPL;
339 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
341 HTMLInputElement *This = HTMLINPUT_THIS(iface);
342 FIXME("(%p)->(%p)\n", This, p);
343 return E_NOTIMPL;
346 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
348 HTMLInputElement *This = HTMLINPUT_THIS(iface);
349 FIXME("(%p)->()\n", This);
350 return E_NOTIMPL;
353 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
355 HTMLInputElement *This = HTMLINPUT_THIS(iface);
356 FIXME("(%p)->(%p)\n", This, p);
357 return E_NOTIMPL;
360 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
362 HTMLInputElement *This = HTMLINPUT_THIS(iface);
363 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
364 return E_NOTIMPL;
367 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
369 HTMLInputElement *This = HTMLINPUT_THIS(iface);
370 FIXME("(%p)->(%p)\n", This, p);
371 return E_NOTIMPL;
374 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
376 HTMLInputElement *This = HTMLINPUT_THIS(iface);
377 FIXME("(%p)->(%x)\n", This, v);
378 return E_NOTIMPL;
381 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
383 HTMLInputElement *This = HTMLINPUT_THIS(iface);
384 FIXME("(%p)->(%p)\n", This, p);
385 return E_NOTIMPL;
388 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
390 HTMLInputElement *This = HTMLINPUT_THIS(iface);
391 FIXME("(%p)->(%p)\n", This, range);
392 return E_NOTIMPL;
395 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
397 HTMLInputElement *This = HTMLINPUT_THIS(iface);
398 FIXME("(%p)->(%x)\n", This, v);
399 return E_NOTIMPL;
402 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
404 HTMLInputElement *This = HTMLINPUT_THIS(iface);
405 FIXME("(%p)->(%p)\n", This, p);
406 return E_NOTIMPL;
409 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
411 HTMLInputElement *This = HTMLINPUT_THIS(iface);
412 nsresult nsres;
414 TRACE("(%p)->(%x)\n", This, v);
416 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
417 if(NS_FAILED(nsres)) {
418 ERR("SetDefaultChecked failed: %08x\n", nsres);
419 return E_FAIL;
422 return S_OK;
425 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
427 HTMLInputElement *This = HTMLINPUT_THIS(iface);
428 PRBool default_checked = FALSE;
429 nsresult nsres;
431 TRACE("(%p)->(%p)\n", This, p);
433 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
434 if(NS_FAILED(nsres)) {
435 ERR("GetDefaultChecked failed: %08x\n", nsres);
436 return E_FAIL;
439 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
440 return S_OK;
443 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
445 HTMLInputElement *This = HTMLINPUT_THIS(iface);
446 nsresult nsres;
448 TRACE("(%p)->(%x)\n", This, v);
450 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
451 if(NS_FAILED(nsres)) {
452 ERR("SetChecked failed: %08x\n", nsres);
453 return E_FAIL;
456 return S_OK;
459 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
461 HTMLInputElement *This = HTMLINPUT_THIS(iface);
462 PRBool checked;
463 nsresult nsres;
465 TRACE("(%p)->(%p)\n", This, p);
467 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
468 if(NS_FAILED(nsres)) {
469 ERR("GetChecked failed: %08x\n", nsres);
470 return E_FAIL;
473 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
474 TRACE("checked=%x\n", *p);
475 return S_OK;
478 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
480 HTMLInputElement *This = HTMLINPUT_THIS(iface);
481 FIXME("(%p)->()\n", This);
482 return E_NOTIMPL;
485 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
487 HTMLInputElement *This = HTMLINPUT_THIS(iface);
488 FIXME("(%p)->(%p)\n", This, p);
489 return E_NOTIMPL;
492 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
494 HTMLInputElement *This = HTMLINPUT_THIS(iface);
495 FIXME("(%p)->(%d)\n", This, v);
496 return E_NOTIMPL;
499 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
501 HTMLInputElement *This = HTMLINPUT_THIS(iface);
502 FIXME("(%p)->(%p)\n", This, p);
503 return E_NOTIMPL;
506 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
508 HTMLInputElement *This = HTMLINPUT_THIS(iface);
509 FIXME("(%p)->(%d)\n", This, v);
510 return E_NOTIMPL;
513 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
515 HTMLInputElement *This = HTMLINPUT_THIS(iface);
516 FIXME("(%p)->(%p)\n", This, p);
517 return E_NOTIMPL;
520 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
522 HTMLInputElement *This = HTMLINPUT_THIS(iface);
523 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
524 return E_NOTIMPL;
527 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
529 HTMLInputElement *This = HTMLINPUT_THIS(iface);
530 FIXME("(%p)->(%p)\n", This, p);
531 return E_NOTIMPL;
534 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
536 HTMLInputElement *This = HTMLINPUT_THIS(iface);
537 nsAString nsstr;
538 nsresult nsres;
540 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
542 nsAString_InitDepend(&nsstr, v);
543 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
544 nsAString_Finish(&nsstr);
545 if(NS_FAILED(nsres))
546 ERR("SetSrc failed: %08x\n", nsres);
548 return S_OK;
551 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
553 HTMLInputElement *This = HTMLINPUT_THIS(iface);
554 const PRUnichar *src;
555 nsAString src_str;
556 nsresult nsres;
557 HRESULT hres;
559 TRACE("(%p)->(%p)\n", This, p);
561 nsAString_Init(&src_str, NULL);
562 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
563 if(NS_FAILED(nsres)) {
564 ERR("GetSrc failed: %08x\n", nsres);
565 return E_FAIL;
568 nsAString_GetData(&src_str, &src);
569 hres = nsuri_to_url(src, FALSE, p);
570 nsAString_Finish(&src_str);
572 return hres;
575 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
577 HTMLInputElement *This = HTMLINPUT_THIS(iface);
578 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
579 return E_NOTIMPL;
582 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
584 HTMLInputElement *This = HTMLINPUT_THIS(iface);
585 FIXME("(%p)->(%p)\n", This, p);
586 return E_NOTIMPL;
589 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
591 HTMLInputElement *This = HTMLINPUT_THIS(iface);
592 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
593 return E_NOTIMPL;
596 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
598 HTMLInputElement *This = HTMLINPUT_THIS(iface);
599 FIXME("(%p)->(%p)\n", This, p);
600 return E_NOTIMPL;
603 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
605 HTMLInputElement *This = HTMLINPUT_THIS(iface);
606 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
607 return E_NOTIMPL;
610 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
612 HTMLInputElement *This = HTMLINPUT_THIS(iface);
613 FIXME("(%p)->(%p)\n", This, p);
614 return E_NOTIMPL;
617 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
619 HTMLInputElement *This = HTMLINPUT_THIS(iface);
620 FIXME("(%p)->(%p)\n", This, p);
621 return E_NOTIMPL;
624 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
626 HTMLInputElement *This = HTMLINPUT_THIS(iface);
627 FIXME("(%p)->(%p)\n", This, p);
628 return E_NOTIMPL;
631 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
633 HTMLInputElement *This = HTMLINPUT_THIS(iface);
634 FIXME("(%p)->()\n", This);
635 return E_NOTIMPL;
638 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
640 HTMLInputElement *This = HTMLINPUT_THIS(iface);
641 FIXME("(%p)->(%p)\n", This, p);
642 return E_NOTIMPL;
645 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
647 HTMLInputElement *This = HTMLINPUT_THIS(iface);
648 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
649 return E_NOTIMPL;
652 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
654 HTMLInputElement *This = HTMLINPUT_THIS(iface);
655 FIXME("(%p)->(%p)\n", This, p);
656 return E_NOTIMPL;
659 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
661 HTMLInputElement *This = HTMLINPUT_THIS(iface);
662 FIXME("(%p)->()\n", This);
663 return E_NOTIMPL;
666 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
668 HTMLInputElement *This = HTMLINPUT_THIS(iface);
669 FIXME("(%p)->(%p)\n", This, p);
670 return E_NOTIMPL;
673 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
675 HTMLInputElement *This = HTMLINPUT_THIS(iface);
676 FIXME("(%p)->()\n", This);
677 return E_NOTIMPL;
680 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
682 HTMLInputElement *This = HTMLINPUT_THIS(iface);
683 FIXME("(%p)->(%p)\n", This, p);
684 return E_NOTIMPL;
687 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
689 HTMLInputElement *This = HTMLINPUT_THIS(iface);
690 FIXME("(%p)->()\n", This);
691 return E_NOTIMPL;
694 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
696 HTMLInputElement *This = HTMLINPUT_THIS(iface);
697 FIXME("(%p)->(%p)\n", This, p);
698 return E_NOTIMPL;
701 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
703 HTMLInputElement *This = HTMLINPUT_THIS(iface);
704 FIXME("(%p)->(%d)\n", This, v);
705 return E_NOTIMPL;
708 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
710 HTMLInputElement *This = HTMLINPUT_THIS(iface);
711 FIXME("(%p)->(%p)\n", This, p);
712 return E_NOTIMPL;
715 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
717 HTMLInputElement *This = HTMLINPUT_THIS(iface);
718 FIXME("(%p)->(%d)\n", This, v);
719 return E_NOTIMPL;
722 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
724 HTMLInputElement *This = HTMLINPUT_THIS(iface);
725 FIXME("(%p)->(%p)\n", This, p);
726 return E_NOTIMPL;
729 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
731 HTMLInputElement *This = HTMLINPUT_THIS(iface);
732 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
733 return E_NOTIMPL;
736 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
738 HTMLInputElement *This = HTMLINPUT_THIS(iface);
739 FIXME("(%p)->(%p)\n", This, p);
740 return E_NOTIMPL;
743 #undef HTMLINPUT_THIS
745 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
746 HTMLInputElement_QueryInterface,
747 HTMLInputElement_AddRef,
748 HTMLInputElement_Release,
749 HTMLInputElement_GetTypeInfoCount,
750 HTMLInputElement_GetTypeInfo,
751 HTMLInputElement_GetIDsOfNames,
752 HTMLInputElement_Invoke,
753 HTMLInputElement_put_type,
754 HTMLInputElement_get_type,
755 HTMLInputElement_put_value,
756 HTMLInputElement_get_value,
757 HTMLInputElement_put_name,
758 HTMLInputElement_get_name,
759 HTMLInputElement_put_status,
760 HTMLInputElement_get_status,
761 HTMLInputElement_put_disabled,
762 HTMLInputElement_get_disabled,
763 HTMLInputElement_get_form,
764 HTMLInputElement_put_size,
765 HTMLInputElement_get_size,
766 HTMLInputElement_put_maxLength,
767 HTMLInputElement_get_maxLength,
768 HTMLInputElement_select,
769 HTMLInputElement_put_onchange,
770 HTMLInputElement_get_onchange,
771 HTMLInputElement_put_onselect,
772 HTMLInputElement_get_onselect,
773 HTMLInputElement_put_defaultValue,
774 HTMLInputElement_get_defaultValue,
775 HTMLInputElement_put_readOnly,
776 HTMLInputElement_get_readOnly,
777 HTMLInputElement_createTextRange,
778 HTMLInputElement_put_indeterminate,
779 HTMLInputElement_get_indeterminate,
780 HTMLInputElement_put_defaultChecked,
781 HTMLInputElement_get_defaultChecked,
782 HTMLInputElement_put_checked,
783 HTMLInputElement_get_checked,
784 HTMLInputElement_put_border,
785 HTMLInputElement_get_border,
786 HTMLInputElement_put_vspace,
787 HTMLInputElement_get_vspace,
788 HTMLInputElement_put_hspace,
789 HTMLInputElement_get_hspace,
790 HTMLInputElement_put_alt,
791 HTMLInputElement_get_alt,
792 HTMLInputElement_put_src,
793 HTMLInputElement_get_src,
794 HTMLInputElement_put_lowsrc,
795 HTMLInputElement_get_lowsrc,
796 HTMLInputElement_put_vrml,
797 HTMLInputElement_get_vrml,
798 HTMLInputElement_put_dynsrc,
799 HTMLInputElement_get_dynsrc,
800 HTMLInputElement_get_readyState,
801 HTMLInputElement_get_complete,
802 HTMLInputElement_put_loop,
803 HTMLInputElement_get_loop,
804 HTMLInputElement_put_align,
805 HTMLInputElement_get_align,
806 HTMLInputElement_put_onload,
807 HTMLInputElement_get_onload,
808 HTMLInputElement_put_onerror,
809 HTMLInputElement_get_onerror,
810 HTMLInputElement_put_onabort,
811 HTMLInputElement_get_onabort,
812 HTMLInputElement_put_width,
813 HTMLInputElement_get_width,
814 HTMLInputElement_put_height,
815 HTMLInputElement_get_height,
816 HTMLInputElement_put_start,
817 HTMLInputElement_get_start
820 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
822 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
823 REFIID riid, void **ppv)
825 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
827 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
830 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
832 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
834 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
837 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
839 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
841 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
844 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
846 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
847 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
850 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
851 LCID lcid, ITypeInfo **ppTInfo)
853 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
854 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
857 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
858 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
860 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
861 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
864 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
865 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
866 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
868 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
869 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
870 pVarResult, pExcepInfo, puArgErr);
873 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
875 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
877 TRACE("(%p)->(%p)\n", This, p);
879 return IHTMLInputElement_get_type(HTMLINPUT(This), p);
882 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
884 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
886 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
888 return IHTMLInputElement_put_value(HTMLINPUT(This), v);
891 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
893 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
895 TRACE("(%p)->(%p)\n", This, p);
897 return IHTMLInputElement_get_value(HTMLINPUT(This), p);
900 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
902 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
904 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
906 return IHTMLInputElement_put_name(HTMLINPUT(This), v);
909 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
911 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
913 TRACE("(%p)->(%p)\n", This, p);
915 return IHTMLInputElement_get_name(HTMLINPUT(This), p);
918 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
920 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
921 FIXME("(%p)->(v)\n", This);
922 return E_NOTIMPL;
925 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
927 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
928 TRACE("(%p)->(v)\n", This);
929 return E_NOTIMPL;
932 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
934 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
936 TRACE("(%p)->(%x)\n", This, v);
938 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
941 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
943 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
945 TRACE("(%p)->(%p)\n", This, p);
947 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
950 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
952 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
954 TRACE("(%p)->(%p)\n", This, p);
956 return IHTMLInputElement_get_form(HTMLINPUT(This), p);
959 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
961 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
963 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
965 return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
968 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
970 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
972 TRACE("(%p)->(%p)\n", This, p);
974 return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
977 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
979 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
981 TRACE("(%p)->(%d)\n", This, v);
983 return IHTMLInputElement_put_size(HTMLINPUT(This), v);
986 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
988 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
990 TRACE("(%p)->(%p)\n", This, p);
992 return IHTMLInputElement_get_size(HTMLINPUT(This), p);
995 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
997 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
999 TRACE("(%p)->(%d)\n", This, v);
1001 return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
1004 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1006 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1010 return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
1013 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1015 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1017 TRACE("(%p)\n", This);
1019 return IHTMLInputElement_select(HTMLINPUT(This));
1022 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1024 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1026 TRACE("(%p)->()\n", This);
1028 return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
1031 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1033 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1035 TRACE("(%p)->(%p)\n", This, p);
1037 return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
1040 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1042 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1044 TRACE("(%p)->()\n", This);
1046 return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
1049 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1051 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1053 TRACE("(%p)->(%p)\n", This, p);
1055 return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
1058 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1060 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1062 TRACE("(%p)->(%x)\n", This, v);
1064 return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
1067 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1069 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1071 TRACE("(%p)->(%p)\n", This, p);
1073 return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
1076 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1078 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1080 TRACE("(%p)->(%p)\n", This, range);
1082 return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
1085 #undef HTMLINPUT_THIS
1087 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1088 HTMLInputTextElement_QueryInterface,
1089 HTMLInputTextElement_AddRef,
1090 HTMLInputTextElement_Release,
1091 HTMLInputTextElement_GetTypeInfoCount,
1092 HTMLInputTextElement_GetTypeInfo,
1093 HTMLInputTextElement_GetIDsOfNames,
1094 HTMLInputTextElement_Invoke,
1095 HTMLInputTextElement_get_type,
1096 HTMLInputTextElement_put_value,
1097 HTMLInputTextElement_get_value,
1098 HTMLInputTextElement_put_name,
1099 HTMLInputTextElement_get_name,
1100 HTMLInputTextElement_put_status,
1101 HTMLInputTextElement_get_status,
1102 HTMLInputTextElement_put_disabled,
1103 HTMLInputTextElement_get_disabled,
1104 HTMLInputTextElement_get_form,
1105 HTMLInputTextElement_put_defaultValue,
1106 HTMLInputTextElement_get_defaultValue,
1107 HTMLInputTextElement_put_size,
1108 HTMLInputTextElement_get_size,
1109 HTMLInputTextElement_put_maxLength,
1110 HTMLInputTextElement_get_maxLength,
1111 HTMLInputTextElement_select,
1112 HTMLInputTextElement_put_onchange,
1113 HTMLInputTextElement_get_onchange,
1114 HTMLInputTextElement_put_onselect,
1115 HTMLInputTextElement_get_onselect,
1116 HTMLInputTextElement_put_readOnly,
1117 HTMLInputTextElement_get_readOnly,
1118 HTMLInputTextElement_createTextRange
1121 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1123 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1125 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1127 *ppv = NULL;
1129 if(IsEqualGUID(&IID_IUnknown, riid)) {
1130 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1131 *ppv = HTMLINPUT(This);
1132 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1133 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1134 *ppv = HTMLINPUT(This);
1135 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1136 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1137 *ppv = HTMLINPUT(This);
1138 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1139 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1140 *ppv = HTMLINPUTTEXT(This);
1143 if(*ppv) {
1144 IUnknown_AddRef((IUnknown*)*ppv);
1145 return S_OK;
1148 return HTMLElement_QI(&This->element.node, riid, ppv);
1151 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1153 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1155 nsIDOMHTMLInputElement_Release(This->nsinput);
1157 HTMLElement_destructor(&This->element.node);
1160 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1162 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1164 if(eid == EVENTID_CLICK) {
1165 nsresult nsres;
1167 *handled = TRUE;
1169 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1170 if(NS_FAILED(nsres)) {
1171 ERR("Click failed: %08x\n", nsres);
1172 return E_FAIL;
1176 return S_OK;
1179 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1181 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1182 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
1185 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1187 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1188 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
1191 #undef HTMLINPUT_NODE_THIS
1193 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1194 HTMLInputElement_QI,
1195 HTMLInputElement_destructor,
1196 NULL,
1197 HTMLInputElementImpl_call_event,
1198 HTMLInputElementImpl_put_disabled,
1199 HTMLInputElementImpl_get_disabled,
1202 static const tid_t HTMLInputElement_iface_tids[] = {
1203 HTMLELEMENT_TIDS,
1204 IHTMLInputElement_tid,
1207 static dispex_static_data_t HTMLInputElement_dispex = {
1208 NULL,
1209 DispHTMLInputElement_tid,
1210 NULL,
1211 HTMLInputElement_iface_tids
1214 HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
1216 HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1217 nsresult nsres;
1219 ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1220 ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
1221 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1223 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1225 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1226 (void**)&ret->nsinput);
1227 if(NS_FAILED(nsres))
1228 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1230 return &ret->element;