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 const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
39 const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
41 nsIDOMHTMLInputElement *nsinput;
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 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
113 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
115 HTMLInputElement *This = HTMLINPUT_THIS(iface);
117 const PRUnichar *type;
120 TRACE("(%p)->(%p)\n", This, p);
122 nsAString_Init(&type_str, NULL);
123 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
125 if(NS_SUCCEEDED(nsres)) {
126 nsAString_GetData(&type_str, &type);
127 *p = SysAllocString(type);
129 ERR("GetType failed: %08x\n", nsres);
132 nsAString_Finish(&type_str);
134 TRACE("type=%s\n", debugstr_w(*p));
138 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
140 HTMLInputElement *This = HTMLINPUT_THIS(iface);
144 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
146 nsAString_Init(&val_str, v);
147 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
148 nsAString_Finish(&val_str);
150 ERR("SetValue failed: %08x\n", nsres);
155 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
157 HTMLInputElement *This = HTMLINPUT_THIS(iface);
159 const PRUnichar *value = NULL;
162 TRACE("(%p)->(%p)\n", This, p);
164 nsAString_Init(&value_str, NULL);
166 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
167 if(NS_SUCCEEDED(nsres)) {
168 nsAString_GetData(&value_str, &value);
169 *p = SysAllocString(value);
171 ERR("GetValue failed: %08x\n", nsres);
174 nsAString_Finish(&value_str);
176 TRACE("value=%s\n", debugstr_w(*p));
180 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
182 HTMLInputElement *This = HTMLINPUT_THIS(iface);
183 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
187 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
189 HTMLInputElement *This = HTMLINPUT_THIS(iface);
191 const PRUnichar *name;
194 TRACE("(%p)->(%p)\n", This, p);
196 nsAString_Init(&name_str, NULL);
198 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
199 if(NS_SUCCEEDED(nsres)) {
200 nsAString_GetData(&name_str, &name);
201 *p = SysAllocString(name);
203 ERR("GetName failed: %08x\n", nsres);
207 nsAString_Finish(&name_str);
209 TRACE("name=%s\n", debugstr_w(*p));
213 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
215 HTMLInputElement *This = HTMLINPUT_THIS(iface);
216 FIXME("(%p)->(%x)\n", This, v);
220 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
222 HTMLInputElement *This = HTMLINPUT_THIS(iface);
223 FIXME("(%p)->(%p)\n", This, p);
227 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
229 HTMLInputElement *This = HTMLINPUT_THIS(iface);
232 TRACE("(%p)->(%x)\n", This, v);
234 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
236 ERR("SetDisabled failed: %08x\n", nsres);
241 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
243 HTMLInputElement *This = HTMLINPUT_THIS(iface);
244 PRBool disabled = FALSE;
246 TRACE("(%p)->(%p)\n", This, p);
248 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
250 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
254 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
256 HTMLInputElement *This = HTMLINPUT_THIS(iface);
257 FIXME("(%p)->(%p)\n", This, p);
261 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
263 HTMLInputElement *This = HTMLINPUT_THIS(iface);
264 FIXME("(%p)->(%d)\n", This, v);
268 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
270 HTMLInputElement *This = HTMLINPUT_THIS(iface);
271 FIXME("(%p)->(%p)\n", This, p);
275 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
277 HTMLInputElement *This = HTMLINPUT_THIS(iface);
278 FIXME("(%p)->(%d)\n", This, v);
282 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
284 HTMLInputElement *This = HTMLINPUT_THIS(iface);
285 FIXME("(%p)->(%p)\n", This, p);
289 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
291 HTMLInputElement *This = HTMLINPUT_THIS(iface);
294 TRACE("(%p)\n", This);
296 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
297 if(NS_FAILED(nsres)) {
298 ERR("Select failed: %08x\n", nsres);
305 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
307 HTMLInputElement *This = HTMLINPUT_THIS(iface);
308 FIXME("(%p)->()\n", This);
312 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
314 HTMLInputElement *This = HTMLINPUT_THIS(iface);
315 FIXME("(%p)->(%p)\n", This, p);
319 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
321 HTMLInputElement *This = HTMLINPUT_THIS(iface);
322 FIXME("(%p)->()\n", This);
326 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
328 HTMLInputElement *This = HTMLINPUT_THIS(iface);
329 FIXME("(%p)->(%p)\n", This, p);
333 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
335 HTMLInputElement *This = HTMLINPUT_THIS(iface);
336 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
340 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
342 HTMLInputElement *This = HTMLINPUT_THIS(iface);
343 FIXME("(%p)->(%p)\n", This, p);
347 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
349 HTMLInputElement *This = HTMLINPUT_THIS(iface);
350 FIXME("(%p)->(%x)\n", This, v);
354 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
356 HTMLInputElement *This = HTMLINPUT_THIS(iface);
357 FIXME("(%p)->(%p)\n", This, p);
361 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
363 HTMLInputElement *This = HTMLINPUT_THIS(iface);
364 FIXME("(%p)->(%p)\n", This, range);
368 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
370 HTMLInputElement *This = HTMLINPUT_THIS(iface);
371 FIXME("(%p)->(%x)\n", This, v);
375 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
377 HTMLInputElement *This = HTMLINPUT_THIS(iface);
378 FIXME("(%p)->(%p)\n", This, p);
382 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
384 HTMLInputElement *This = HTMLINPUT_THIS(iface);
387 TRACE("(%p)->(%x)\n", This, v);
389 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
390 if(NS_FAILED(nsres)) {
391 ERR("SetDefaultChecked failed: %08x\n", nsres);
398 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
400 HTMLInputElement *This = HTMLINPUT_THIS(iface);
401 PRBool default_checked = FALSE;
404 TRACE("(%p)->(%p)\n", This, p);
406 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
407 if(NS_FAILED(nsres)) {
408 ERR("GetDefaultChecked failed: %08x\n", nsres);
412 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
416 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
418 HTMLInputElement *This = HTMLINPUT_THIS(iface);
421 TRACE("(%p)->(%x)\n", This, v);
423 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
424 if(NS_FAILED(nsres)) {
425 ERR("SetChecked failed: %08x\n", nsres);
432 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
434 HTMLInputElement *This = HTMLINPUT_THIS(iface);
438 TRACE("(%p)->(%p)\n", This, p);
440 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
441 if(NS_FAILED(nsres)) {
442 ERR("GetChecked failed: %08x\n", nsres);
446 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
447 TRACE("checked=%x\n", *p);
451 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
453 HTMLInputElement *This = HTMLINPUT_THIS(iface);
454 FIXME("(%p)->()\n", This);
458 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
460 HTMLInputElement *This = HTMLINPUT_THIS(iface);
461 FIXME("(%p)->(%p)\n", This, p);
465 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
467 HTMLInputElement *This = HTMLINPUT_THIS(iface);
468 FIXME("(%p)->(%d)\n", This, v);
472 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
474 HTMLInputElement *This = HTMLINPUT_THIS(iface);
475 FIXME("(%p)->(%p)\n", This, p);
479 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
481 HTMLInputElement *This = HTMLINPUT_THIS(iface);
482 FIXME("(%p)->(%d)\n", This, v);
486 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
488 HTMLInputElement *This = HTMLINPUT_THIS(iface);
489 FIXME("(%p)->(%p)\n", This, p);
493 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
495 HTMLInputElement *This = HTMLINPUT_THIS(iface);
496 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
500 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
502 HTMLInputElement *This = HTMLINPUT_THIS(iface);
503 FIXME("(%p)->(%p)\n", This, p);
507 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
509 HTMLInputElement *This = HTMLINPUT_THIS(iface);
513 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
515 nsAString_Init(&nsstr, v);
516 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
517 nsAString_Finish(&nsstr);
519 ERR("SetSrc failed: %08x\n", nsres);
524 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
526 HTMLInputElement *This = HTMLINPUT_THIS(iface);
527 const PRUnichar *src;
532 TRACE("(%p)->(%p)\n", This, p);
534 nsAString_Init(&src_str, NULL);
535 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
536 if(NS_FAILED(nsres)) {
537 ERR("GetSrc failed: %08x\n", nsres);
541 nsAString_GetData(&src_str, &src);
542 hres = nsuri_to_url(src, FALSE, p);
543 nsAString_Finish(&src_str);
548 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
550 HTMLInputElement *This = HTMLINPUT_THIS(iface);
551 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
555 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
557 HTMLInputElement *This = HTMLINPUT_THIS(iface);
558 FIXME("(%p)->(%p)\n", This, p);
562 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
564 HTMLInputElement *This = HTMLINPUT_THIS(iface);
565 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
569 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
571 HTMLInputElement *This = HTMLINPUT_THIS(iface);
572 FIXME("(%p)->(%p)\n", This, p);
576 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
578 HTMLInputElement *This = HTMLINPUT_THIS(iface);
579 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
583 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
585 HTMLInputElement *This = HTMLINPUT_THIS(iface);
586 FIXME("(%p)->(%p)\n", This, p);
590 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
592 HTMLInputElement *This = HTMLINPUT_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, p);
597 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
599 HTMLInputElement *This = HTMLINPUT_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, p);
604 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
606 HTMLInputElement *This = HTMLINPUT_THIS(iface);
607 FIXME("(%p)->()\n", This);
611 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
613 HTMLInputElement *This = HTMLINPUT_THIS(iface);
614 FIXME("(%p)->(%p)\n", This, p);
618 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
620 HTMLInputElement *This = HTMLINPUT_THIS(iface);
621 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
625 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
627 HTMLInputElement *This = HTMLINPUT_THIS(iface);
628 FIXME("(%p)->(%p)\n", This, p);
632 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
634 HTMLInputElement *This = HTMLINPUT_THIS(iface);
635 FIXME("(%p)->()\n", This);
639 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
641 HTMLInputElement *This = HTMLINPUT_THIS(iface);
642 FIXME("(%p)->(%p)\n", This, p);
646 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
648 HTMLInputElement *This = HTMLINPUT_THIS(iface);
649 FIXME("(%p)->()\n", This);
653 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
655 HTMLInputElement *This = HTMLINPUT_THIS(iface);
656 FIXME("(%p)->(%p)\n", This, p);
660 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
662 HTMLInputElement *This = HTMLINPUT_THIS(iface);
663 FIXME("(%p)->()\n", This);
667 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
669 HTMLInputElement *This = HTMLINPUT_THIS(iface);
670 FIXME("(%p)->(%p)\n", This, p);
674 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
676 HTMLInputElement *This = HTMLINPUT_THIS(iface);
677 FIXME("(%p)->(%d)\n", This, v);
681 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
683 HTMLInputElement *This = HTMLINPUT_THIS(iface);
684 FIXME("(%p)->(%p)\n", This, p);
688 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
690 HTMLInputElement *This = HTMLINPUT_THIS(iface);
691 FIXME("(%p)->(%d)\n", This, v);
695 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
697 HTMLInputElement *This = HTMLINPUT_THIS(iface);
698 FIXME("(%p)->(%p)\n", This, p);
702 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
704 HTMLInputElement *This = HTMLINPUT_THIS(iface);
705 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
709 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
711 HTMLInputElement *This = HTMLINPUT_THIS(iface);
712 FIXME("(%p)->(%p)\n", This, p);
716 #undef HTMLINPUT_THIS
718 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
719 HTMLInputElement_QueryInterface,
720 HTMLInputElement_AddRef,
721 HTMLInputElement_Release,
722 HTMLInputElement_GetTypeInfoCount,
723 HTMLInputElement_GetTypeInfo,
724 HTMLInputElement_GetIDsOfNames,
725 HTMLInputElement_Invoke,
726 HTMLInputElement_put_type,
727 HTMLInputElement_get_type,
728 HTMLInputElement_put_value,
729 HTMLInputElement_get_value,
730 HTMLInputElement_put_name,
731 HTMLInputElement_get_name,
732 HTMLInputElement_put_status,
733 HTMLInputElement_get_status,
734 HTMLInputElement_put_disabled,
735 HTMLInputElement_get_disabled,
736 HTMLInputElement_get_form,
737 HTMLInputElement_put_size,
738 HTMLInputElement_get_size,
739 HTMLInputElement_put_maxLength,
740 HTMLInputElement_get_maxLength,
741 HTMLInputElement_select,
742 HTMLInputElement_put_onchange,
743 HTMLInputElement_get_onchange,
744 HTMLInputElement_put_onselect,
745 HTMLInputElement_get_onselect,
746 HTMLInputElement_put_defaultValue,
747 HTMLInputElement_get_defaultValue,
748 HTMLInputElement_put_readOnly,
749 HTMLInputElement_get_readOnly,
750 HTMLInputElement_createTextRange,
751 HTMLInputElement_put_indeterminate,
752 HTMLInputElement_get_indeterminate,
753 HTMLInputElement_put_defaultChecked,
754 HTMLInputElement_get_defaultChecked,
755 HTMLInputElement_put_checked,
756 HTMLInputElement_get_checked,
757 HTMLInputElement_put_border,
758 HTMLInputElement_get_border,
759 HTMLInputElement_put_vspace,
760 HTMLInputElement_get_vspace,
761 HTMLInputElement_put_hspace,
762 HTMLInputElement_get_hspace,
763 HTMLInputElement_put_alt,
764 HTMLInputElement_get_alt,
765 HTMLInputElement_put_src,
766 HTMLInputElement_get_src,
767 HTMLInputElement_put_lowsrc,
768 HTMLInputElement_get_lowsrc,
769 HTMLInputElement_put_vrml,
770 HTMLInputElement_get_vrml,
771 HTMLInputElement_put_dynsrc,
772 HTMLInputElement_get_dynsrc,
773 HTMLInputElement_get_readyState,
774 HTMLInputElement_get_complete,
775 HTMLInputElement_put_loop,
776 HTMLInputElement_get_loop,
777 HTMLInputElement_put_align,
778 HTMLInputElement_get_align,
779 HTMLInputElement_put_onload,
780 HTMLInputElement_get_onload,
781 HTMLInputElement_put_onerror,
782 HTMLInputElement_get_onerror,
783 HTMLInputElement_put_onabort,
784 HTMLInputElement_get_onabort,
785 HTMLInputElement_put_width,
786 HTMLInputElement_get_width,
787 HTMLInputElement_put_height,
788 HTMLInputElement_get_height,
789 HTMLInputElement_put_start,
790 HTMLInputElement_get_start
793 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
795 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
796 REFIID riid, void **ppv)
798 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
800 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
803 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
805 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
807 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
810 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
812 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
814 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
817 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
819 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
820 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
823 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
824 LCID lcid, ITypeInfo **ppTInfo)
826 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
827 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
830 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
831 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
833 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
834 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
837 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
838 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
839 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
841 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
842 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
843 pVarResult, pExcepInfo, puArgErr);
846 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
848 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
850 TRACE("(%p)->(%p)\n", This, p);
852 return IHTMLInputElement_get_type(HTMLINPUT(This), p);
855 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
857 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
859 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
861 return IHTMLInputElement_put_value(HTMLINPUT(This), v);
864 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
866 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
868 TRACE("(%p)->(%p)\n", This, p);
870 return IHTMLInputElement_get_value(HTMLINPUT(This), p);
873 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
875 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
877 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
879 return IHTMLInputElement_put_name(HTMLINPUT(This), v);
882 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
884 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
886 TRACE("(%p)->(%p)\n", This, p);
888 return IHTMLInputElement_get_name(HTMLINPUT(This), p);
891 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
893 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
894 FIXME("(%p)->(v)\n", This);
898 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
900 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
901 TRACE("(%p)->(v)\n", This);
905 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
907 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
909 TRACE("(%p)->(%x)\n", This, v);
911 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
914 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
916 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
918 TRACE("(%p)->(%p)\n", This, p);
920 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
923 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
925 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
927 TRACE("(%p)->(%p)\n", This, p);
929 return IHTMLInputElement_get_form(HTMLINPUT(This), p);
932 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
934 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
936 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
938 return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
941 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
943 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
945 TRACE("(%p)->(%p)\n", This, p);
947 return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
950 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
952 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
954 TRACE("(%p)->(%d)\n", This, v);
956 return IHTMLInputElement_put_size(HTMLINPUT(This), v);
959 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
961 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
963 TRACE("(%p)->(%p)\n", This, p);
965 return IHTMLInputElement_get_size(HTMLINPUT(This), p);
968 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
970 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
972 TRACE("(%p)->(%d)\n", This, v);
974 return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
977 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
979 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
981 TRACE("(%p)->(%p)\n", This, p);
983 return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
986 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
988 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
990 TRACE("(%p)\n", This);
992 return IHTMLInputElement_select(HTMLINPUT(This));
995 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
997 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
999 TRACE("(%p)->()\n", This);
1001 return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
1004 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1006 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1010 return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
1013 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1015 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1017 TRACE("(%p)->()\n", This);
1019 return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
1022 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1024 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1026 TRACE("(%p)->(%p)\n", This, p);
1028 return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
1031 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1033 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1035 TRACE("(%p)->(%x)\n", This, v);
1037 return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
1040 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1042 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1044 TRACE("(%p)->(%p)\n", This, p);
1046 return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
1049 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1051 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1053 TRACE("(%p)->(%p)\n", This, range);
1055 return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
1058 #undef HTMLINPUT_THIS
1060 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1061 HTMLInputTextElement_QueryInterface,
1062 HTMLInputTextElement_AddRef,
1063 HTMLInputTextElement_Release,
1064 HTMLInputTextElement_GetTypeInfoCount,
1065 HTMLInputTextElement_GetTypeInfo,
1066 HTMLInputTextElement_GetIDsOfNames,
1067 HTMLInputTextElement_Invoke,
1068 HTMLInputTextElement_get_type,
1069 HTMLInputTextElement_put_value,
1070 HTMLInputTextElement_get_value,
1071 HTMLInputTextElement_put_name,
1072 HTMLInputTextElement_get_name,
1073 HTMLInputTextElement_put_status,
1074 HTMLInputTextElement_get_status,
1075 HTMLInputTextElement_put_disabled,
1076 HTMLInputTextElement_get_disabled,
1077 HTMLInputTextElement_get_form,
1078 HTMLInputTextElement_put_defaultValue,
1079 HTMLInputTextElement_get_defaultValue,
1080 HTMLInputTextElement_put_size,
1081 HTMLInputTextElement_get_size,
1082 HTMLInputTextElement_put_maxLength,
1083 HTMLInputTextElement_get_maxLength,
1084 HTMLInputTextElement_select,
1085 HTMLInputTextElement_put_onchange,
1086 HTMLInputTextElement_get_onchange,
1087 HTMLInputTextElement_put_onselect,
1088 HTMLInputTextElement_get_onselect,
1089 HTMLInputTextElement_put_readOnly,
1090 HTMLInputTextElement_get_readOnly,
1091 HTMLInputTextElement_createTextRange
1094 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1096 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1098 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1102 if(IsEqualGUID(&IID_IUnknown, riid)) {
1103 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1104 *ppv = HTMLINPUT(This);
1105 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1106 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1107 *ppv = HTMLINPUT(This);
1108 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1109 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1110 *ppv = HTMLINPUT(This);
1111 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1112 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1113 *ppv = HTMLINPUTTEXT(This);
1117 IUnknown_AddRef((IUnknown*)*ppv);
1121 return HTMLElement_QI(&This->element.node, riid, ppv);
1124 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1126 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1128 nsIDOMHTMLInputElement_Release(This->nsinput);
1130 HTMLElement_destructor(&This->element.node);
1133 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1135 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1137 if(eid == EVENTID_CLICK) {
1142 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1143 if(NS_FAILED(nsres)) {
1144 ERR("Click failed: %08x\n", nsres);
1152 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1154 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1155 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
1158 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1160 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1161 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
1164 #undef HTMLINPUT_NODE_THIS
1166 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1167 HTMLInputElement_QI,
1168 HTMLInputElement_destructor,
1170 HTMLInputElementImpl_call_event,
1171 HTMLInputElementImpl_put_disabled,
1172 HTMLInputElementImpl_get_disabled,
1175 static const tid_t HTMLInputElement_iface_tids[] = {
1181 IHTMLInputElement_tid,
1184 static dispex_static_data_t HTMLInputElement_dispex = {
1186 DispHTMLInputElement_tid,
1188 HTMLInputElement_iface_tids
1191 HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
1193 HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1196 ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1197 ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
1198 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1200 HTMLElement_Init(&ret->element, &HTMLInputElement_dispex);
1202 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1203 (void**)&ret->nsinput);
1204 if(NS_FAILED(nsres))
1205 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1207 return &ret->element;