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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 IHTMLInputElement IHTMLInputElement_iface;
39 IHTMLInputTextElement IHTMLInputTextElement_iface;
41 nsIDOMHTMLInputElement *nsinput;
44 static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
46 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
49 static inline HTMLInputElement *impl_from_IHTMLInputTextElement(IHTMLInputTextElement *iface)
51 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement_iface);
54 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
55 REFIID riid, void **ppv)
57 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
59 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
62 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
64 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
66 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
69 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
71 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
73 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
76 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
78 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
80 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
83 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
84 LCID lcid, ITypeInfo **ppTInfo)
86 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
88 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
91 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
92 LPOLESTR *rgszNames, UINT cNames,
93 LCID lcid, DISPID *rgDispId)
95 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
97 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
98 cNames, lcid, rgDispId);
101 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
102 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
103 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
105 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
107 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
108 pDispParams, pVarResult, pExcepInfo, puArgErr);
111 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
113 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
117 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
121 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
123 nsAString_InitDepend(&type_str, v);
124 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
125 nsAString_Finish(&type_str);
126 if(NS_FAILED(nsres)) {
127 ERR("SetType failed: %08x\n", nsres);
134 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
136 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
138 const PRUnichar *type;
141 TRACE("(%p)->(%p)\n", This, p);
143 nsAString_Init(&type_str, NULL);
144 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
146 if(NS_SUCCEEDED(nsres)) {
147 nsAString_GetData(&type_str, &type);
148 *p = SysAllocString(type);
150 ERR("GetType failed: %08x\n", nsres);
153 nsAString_Finish(&type_str);
155 TRACE("type=%s\n", debugstr_w(*p));
159 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
161 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
165 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
167 nsAString_InitDepend(&val_str, v);
168 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
169 nsAString_Finish(&val_str);
171 ERR("SetValue failed: %08x\n", nsres);
176 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
178 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
180 const PRUnichar *value = NULL;
183 TRACE("(%p)->(%p)\n", This, p);
185 nsAString_Init(&value_str, NULL);
187 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
188 if(NS_SUCCEEDED(nsres)) {
189 nsAString_GetData(&value_str, &value);
190 *p = SysAllocString(value);
192 ERR("GetValue failed: %08x\n", nsres);
195 nsAString_Finish(&value_str);
197 TRACE("value=%s\n", debugstr_w(*p));
201 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
203 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
207 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
209 nsAString_InitDepend(&name_str, v);
210 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
211 nsAString_Finish(&name_str);
212 if(NS_FAILED(nsres)) {
213 ERR("SetName failed: %08x\n", nsres);
220 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
222 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
224 const PRUnichar *name;
228 TRACE("(%p)->(%p)\n", This, p);
230 nsAString_Init(&name_str, NULL);
232 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
233 if(NS_SUCCEEDED(nsres)) {
234 nsAString_GetData(&name_str, &name);
235 *p = *name ? SysAllocString(name) : NULL;
237 ERR("GetName failed: %08x\n", nsres);
241 nsAString_Finish(&name_str);
245 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
247 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
248 FIXME("(%p)->(%x)\n", This, v);
252 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
254 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
255 FIXME("(%p)->(%p)\n", This, p);
259 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
261 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
264 TRACE("(%p)->(%x)\n", This, v);
266 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
268 ERR("SetDisabled failed: %08x\n", nsres);
273 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
275 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
276 PRBool disabled = FALSE;
278 TRACE("(%p)->(%p)\n", This, p);
280 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
282 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
286 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
288 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
289 FIXME("(%p)->(%p)\n", This, p);
293 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
295 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
296 FIXME("(%p)->(%d)\n", This, v);
300 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
302 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
303 FIXME("(%p)->(%p)\n", This, p);
307 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
309 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
310 FIXME("(%p)->(%d)\n", This, v);
314 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
316 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
317 FIXME("(%p)->(%p)\n", This, p);
321 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
323 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
326 TRACE("(%p)\n", This);
328 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
329 if(NS_FAILED(nsres)) {
330 ERR("Select failed: %08x\n", nsres);
337 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
339 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
340 FIXME("(%p)->()\n", This);
344 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
346 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
347 FIXME("(%p)->(%p)\n", This, p);
351 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
353 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
354 FIXME("(%p)->()\n", This);
358 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
360 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
361 FIXME("(%p)->(%p)\n", This, p);
365 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
367 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
368 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
372 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
374 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
375 FIXME("(%p)->(%p)\n", This, p);
379 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
381 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
382 FIXME("(%p)->(%x)\n", This, v);
386 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
388 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
389 FIXME("(%p)->(%p)\n", This, p);
393 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
395 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
396 FIXME("(%p)->(%p)\n", This, range);
400 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
402 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
403 FIXME("(%p)->(%x)\n", This, v);
407 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
409 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
410 FIXME("(%p)->(%p)\n", This, p);
414 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
416 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
419 TRACE("(%p)->(%x)\n", This, v);
421 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
422 if(NS_FAILED(nsres)) {
423 ERR("SetDefaultChecked failed: %08x\n", nsres);
430 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
432 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
433 PRBool default_checked = FALSE;
436 TRACE("(%p)->(%p)\n", This, p);
438 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
439 if(NS_FAILED(nsres)) {
440 ERR("GetDefaultChecked failed: %08x\n", nsres);
444 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
448 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
450 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
453 TRACE("(%p)->(%x)\n", This, v);
455 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
456 if(NS_FAILED(nsres)) {
457 ERR("SetChecked failed: %08x\n", nsres);
464 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
466 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
470 TRACE("(%p)->(%p)\n", This, p);
472 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
473 if(NS_FAILED(nsres)) {
474 ERR("GetChecked failed: %08x\n", nsres);
478 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
479 TRACE("checked=%x\n", *p);
483 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
485 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
486 FIXME("(%p)->()\n", This);
490 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
492 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
493 FIXME("(%p)->(%p)\n", This, p);
497 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
499 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
500 FIXME("(%p)->(%d)\n", This, v);
504 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
506 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
507 FIXME("(%p)->(%p)\n", This, p);
511 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
513 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
514 FIXME("(%p)->(%d)\n", This, v);
518 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
520 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
521 FIXME("(%p)->(%p)\n", This, p);
525 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
527 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
528 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
532 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
534 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
535 FIXME("(%p)->(%p)\n", This, p);
539 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
541 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
545 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
547 nsAString_InitDepend(&nsstr, v);
548 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
549 nsAString_Finish(&nsstr);
551 ERR("SetSrc failed: %08x\n", nsres);
556 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
558 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
559 const PRUnichar *src;
564 TRACE("(%p)->(%p)\n", This, p);
566 nsAString_Init(&src_str, NULL);
567 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
568 if(NS_FAILED(nsres)) {
569 ERR("GetSrc failed: %08x\n", nsres);
573 nsAString_GetData(&src_str, &src);
574 hres = nsuri_to_url(src, FALSE, p);
575 nsAString_Finish(&src_str);
580 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
582 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
583 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
587 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
589 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
590 FIXME("(%p)->(%p)\n", This, p);
594 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
596 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
597 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
601 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
603 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
604 FIXME("(%p)->(%p)\n", This, p);
608 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
610 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
611 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
615 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
617 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
618 FIXME("(%p)->(%p)\n", This, p);
622 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
624 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
625 FIXME("(%p)->(%p)\n", This, p);
629 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
631 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
632 FIXME("(%p)->(%p)\n", This, p);
636 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
638 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
639 FIXME("(%p)->()\n", This);
643 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
645 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
646 FIXME("(%p)->(%p)\n", This, p);
650 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
652 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
653 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
657 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
659 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
660 FIXME("(%p)->(%p)\n", This, p);
664 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
666 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
667 FIXME("(%p)->()\n", This);
671 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
673 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
674 FIXME("(%p)->(%p)\n", This, p);
678 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
680 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
681 FIXME("(%p)->()\n", This);
685 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
687 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
688 FIXME("(%p)->(%p)\n", This, p);
692 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
694 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
695 FIXME("(%p)->()\n", This);
699 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
701 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
702 FIXME("(%p)->(%p)\n", This, p);
706 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
708 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
709 FIXME("(%p)->(%d)\n", This, v);
713 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
715 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
716 FIXME("(%p)->(%p)\n", This, p);
720 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
722 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
723 FIXME("(%p)->(%d)\n", This, v);
727 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
729 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
730 FIXME("(%p)->(%p)\n", This, p);
734 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
736 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
737 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
741 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
743 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
744 FIXME("(%p)->(%p)\n", This, p);
748 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
749 HTMLInputElement_QueryInterface,
750 HTMLInputElement_AddRef,
751 HTMLInputElement_Release,
752 HTMLInputElement_GetTypeInfoCount,
753 HTMLInputElement_GetTypeInfo,
754 HTMLInputElement_GetIDsOfNames,
755 HTMLInputElement_Invoke,
756 HTMLInputElement_put_type,
757 HTMLInputElement_get_type,
758 HTMLInputElement_put_value,
759 HTMLInputElement_get_value,
760 HTMLInputElement_put_name,
761 HTMLInputElement_get_name,
762 HTMLInputElement_put_status,
763 HTMLInputElement_get_status,
764 HTMLInputElement_put_disabled,
765 HTMLInputElement_get_disabled,
766 HTMLInputElement_get_form,
767 HTMLInputElement_put_size,
768 HTMLInputElement_get_size,
769 HTMLInputElement_put_maxLength,
770 HTMLInputElement_get_maxLength,
771 HTMLInputElement_select,
772 HTMLInputElement_put_onchange,
773 HTMLInputElement_get_onchange,
774 HTMLInputElement_put_onselect,
775 HTMLInputElement_get_onselect,
776 HTMLInputElement_put_defaultValue,
777 HTMLInputElement_get_defaultValue,
778 HTMLInputElement_put_readOnly,
779 HTMLInputElement_get_readOnly,
780 HTMLInputElement_createTextRange,
781 HTMLInputElement_put_indeterminate,
782 HTMLInputElement_get_indeterminate,
783 HTMLInputElement_put_defaultChecked,
784 HTMLInputElement_get_defaultChecked,
785 HTMLInputElement_put_checked,
786 HTMLInputElement_get_checked,
787 HTMLInputElement_put_border,
788 HTMLInputElement_get_border,
789 HTMLInputElement_put_vspace,
790 HTMLInputElement_get_vspace,
791 HTMLInputElement_put_hspace,
792 HTMLInputElement_get_hspace,
793 HTMLInputElement_put_alt,
794 HTMLInputElement_get_alt,
795 HTMLInputElement_put_src,
796 HTMLInputElement_get_src,
797 HTMLInputElement_put_lowsrc,
798 HTMLInputElement_get_lowsrc,
799 HTMLInputElement_put_vrml,
800 HTMLInputElement_get_vrml,
801 HTMLInputElement_put_dynsrc,
802 HTMLInputElement_get_dynsrc,
803 HTMLInputElement_get_readyState,
804 HTMLInputElement_get_complete,
805 HTMLInputElement_put_loop,
806 HTMLInputElement_get_loop,
807 HTMLInputElement_put_align,
808 HTMLInputElement_get_align,
809 HTMLInputElement_put_onload,
810 HTMLInputElement_get_onload,
811 HTMLInputElement_put_onerror,
812 HTMLInputElement_get_onerror,
813 HTMLInputElement_put_onabort,
814 HTMLInputElement_get_onabort,
815 HTMLInputElement_put_width,
816 HTMLInputElement_get_width,
817 HTMLInputElement_put_height,
818 HTMLInputElement_get_height,
819 HTMLInputElement_put_start,
820 HTMLInputElement_get_start
823 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
824 REFIID riid, void **ppv)
826 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
828 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
831 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
833 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
835 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
838 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
840 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
842 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
845 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
847 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
848 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
851 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
852 LCID lcid, ITypeInfo **ppTInfo)
854 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
855 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
858 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
859 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
861 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
862 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
865 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
866 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
867 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
869 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
870 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
871 pVarResult, pExcepInfo, puArgErr);
874 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
876 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
878 TRACE("(%p)->(%p)\n", This, p);
880 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
883 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
885 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
887 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
889 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
892 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
894 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
896 TRACE("(%p)->(%p)\n", This, p);
898 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
901 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
903 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
905 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
907 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
910 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
912 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
914 TRACE("(%p)->(%p)\n", This, p);
916 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
919 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
921 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
922 FIXME("(%p)->(v)\n", This);
926 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
928 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
929 TRACE("(%p)->(v)\n", This);
933 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
935 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
937 TRACE("(%p)->(%x)\n", This, v);
939 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
942 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
944 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
946 TRACE("(%p)->(%p)\n", This, p);
948 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
951 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
953 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
955 TRACE("(%p)->(%p)\n", This, p);
957 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
960 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
962 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
964 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
966 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
969 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
971 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
973 TRACE("(%p)->(%p)\n", This, p);
975 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
978 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
980 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
982 TRACE("(%p)->(%d)\n", This, v);
984 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
987 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
989 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
991 TRACE("(%p)->(%p)\n", This, p);
993 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
996 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
998 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1000 TRACE("(%p)->(%d)\n", This, v);
1002 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1005 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1007 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1009 TRACE("(%p)->(%p)\n", This, p);
1011 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1014 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1016 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1018 TRACE("(%p)\n", This);
1020 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1023 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1025 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1027 TRACE("(%p)->()\n", This);
1029 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1032 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1034 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1036 TRACE("(%p)->(%p)\n", This, p);
1038 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1041 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1043 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1045 TRACE("(%p)->()\n", This);
1047 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1050 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1052 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1054 TRACE("(%p)->(%p)\n", This, p);
1056 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1059 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1061 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1063 TRACE("(%p)->(%x)\n", This, v);
1065 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1068 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1070 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1072 TRACE("(%p)->(%p)\n", This, p);
1074 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1077 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1079 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1081 TRACE("(%p)->(%p)\n", This, range);
1083 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1086 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1087 HTMLInputTextElement_QueryInterface,
1088 HTMLInputTextElement_AddRef,
1089 HTMLInputTextElement_Release,
1090 HTMLInputTextElement_GetTypeInfoCount,
1091 HTMLInputTextElement_GetTypeInfo,
1092 HTMLInputTextElement_GetIDsOfNames,
1093 HTMLInputTextElement_Invoke,
1094 HTMLInputTextElement_get_type,
1095 HTMLInputTextElement_put_value,
1096 HTMLInputTextElement_get_value,
1097 HTMLInputTextElement_put_name,
1098 HTMLInputTextElement_get_name,
1099 HTMLInputTextElement_put_status,
1100 HTMLInputTextElement_get_status,
1101 HTMLInputTextElement_put_disabled,
1102 HTMLInputTextElement_get_disabled,
1103 HTMLInputTextElement_get_form,
1104 HTMLInputTextElement_put_defaultValue,
1105 HTMLInputTextElement_get_defaultValue,
1106 HTMLInputTextElement_put_size,
1107 HTMLInputTextElement_get_size,
1108 HTMLInputTextElement_put_maxLength,
1109 HTMLInputTextElement_get_maxLength,
1110 HTMLInputTextElement_select,
1111 HTMLInputTextElement_put_onchange,
1112 HTMLInputTextElement_get_onchange,
1113 HTMLInputTextElement_put_onselect,
1114 HTMLInputTextElement_get_onselect,
1115 HTMLInputTextElement_put_readOnly,
1116 HTMLInputTextElement_get_readOnly,
1117 HTMLInputTextElement_createTextRange
1120 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1122 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1124 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1128 if(IsEqualGUID(&IID_IUnknown, riid)) {
1129 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1130 *ppv = &This->IHTMLInputElement_iface;
1131 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1132 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1133 *ppv = &This->IHTMLInputElement_iface;
1134 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1135 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1136 *ppv = &This->IHTMLInputElement_iface;
1137 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1138 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1139 *ppv = &This->IHTMLInputTextElement_iface;
1143 IUnknown_AddRef((IUnknown*)*ppv);
1147 return HTMLElement_QI(&This->element.node, riid, ppv);
1150 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1152 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1154 nsIDOMHTMLInputElement_Release(This->nsinput);
1156 HTMLElement_destructor(&This->element.node);
1159 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1161 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1163 if(eid == EVENTID_CLICK) {
1168 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1169 if(NS_FAILED(nsres)) {
1170 ERR("Click failed: %08x\n", nsres);
1178 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1180 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1181 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1184 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1186 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1187 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1190 #undef HTMLINPUT_NODE_THIS
1192 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1193 HTMLInputElement_QI,
1194 HTMLInputElement_destructor,
1197 HTMLInputElementImpl_call_event,
1198 HTMLInputElementImpl_put_disabled,
1199 HTMLInputElementImpl_get_disabled,
1202 static const tid_t HTMLInputElement_iface_tids[] = {
1204 IHTMLInputElement_tid,
1207 static dispex_static_data_t HTMLInputElement_dispex = {
1209 DispHTMLInputElement_tid,
1211 HTMLInputElement_iface_tids
1214 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1216 HTMLInputElement *ret;
1219 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1221 return E_OUTOFMEMORY;
1223 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1224 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1225 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1227 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1228 if(NS_FAILED(nsres)) {
1229 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1234 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1236 *elem = &ret->element;