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(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
62 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
64 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
66 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
69 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
71 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
73 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
76 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
78 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
80 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, 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(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
92 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
93 LPOLESTR *rgszNames, UINT cNames,
94 LCID lcid, DISPID *rgDispId)
96 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
98 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
99 cNames, lcid, rgDispId);
102 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
103 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
104 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
106 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
108 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
109 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
112 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
114 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
118 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
122 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
124 nsAString_InitDepend(&type_str, v);
125 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
126 nsAString_Finish(&type_str);
127 if(NS_FAILED(nsres)) {
128 ERR("SetType failed: %08x\n", nsres);
135 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
137 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
139 const PRUnichar *type;
142 TRACE("(%p)->(%p)\n", This, p);
144 nsAString_Init(&type_str, NULL);
145 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
147 if(NS_SUCCEEDED(nsres)) {
148 nsAString_GetData(&type_str, &type);
149 *p = SysAllocString(type);
151 ERR("GetType failed: %08x\n", nsres);
154 nsAString_Finish(&type_str);
156 TRACE("type=%s\n", debugstr_w(*p));
160 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
162 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
166 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
168 nsAString_InitDepend(&val_str, v);
169 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
170 nsAString_Finish(&val_str);
172 ERR("SetValue failed: %08x\n", nsres);
177 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
179 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
181 const PRUnichar *value = NULL;
184 TRACE("(%p)->(%p)\n", This, p);
186 nsAString_Init(&value_str, NULL);
188 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
189 if(NS_SUCCEEDED(nsres)) {
190 nsAString_GetData(&value_str, &value);
191 *p = SysAllocString(value);
193 ERR("GetValue failed: %08x\n", nsres);
196 nsAString_Finish(&value_str);
198 TRACE("value=%s\n", debugstr_w(*p));
202 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
204 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
208 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
210 nsAString_InitDepend(&name_str, v);
211 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
212 nsAString_Finish(&name_str);
213 if(NS_FAILED(nsres)) {
214 ERR("SetName failed: %08x\n", nsres);
221 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
223 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
225 const PRUnichar *name;
229 TRACE("(%p)->(%p)\n", This, p);
231 nsAString_Init(&name_str, NULL);
233 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
234 if(NS_SUCCEEDED(nsres)) {
235 nsAString_GetData(&name_str, &name);
236 *p = *name ? SysAllocString(name) : NULL;
238 ERR("GetName failed: %08x\n", nsres);
242 nsAString_Finish(&name_str);
246 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
248 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
249 FIXME("(%p)->(%x)\n", This, v);
253 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
255 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
256 FIXME("(%p)->(%p)\n", This, p);
260 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
262 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
265 TRACE("(%p)->(%x)\n", This, v);
267 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
269 ERR("SetDisabled failed: %08x\n", nsres);
274 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
276 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
277 PRBool disabled = FALSE;
279 TRACE("(%p)->(%p)\n", This, p);
281 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
283 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
287 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
289 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
290 FIXME("(%p)->(%p)\n", This, p);
294 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
296 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
297 FIXME("(%p)->(%d)\n", This, v);
301 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
303 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
304 FIXME("(%p)->(%p)\n", This, p);
308 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
310 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
311 FIXME("(%p)->(%d)\n", This, v);
315 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
317 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
318 FIXME("(%p)->(%p)\n", This, p);
322 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
324 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
327 TRACE("(%p)\n", This);
329 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
330 if(NS_FAILED(nsres)) {
331 ERR("Select failed: %08x\n", nsres);
338 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
340 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
341 FIXME("(%p)->()\n", This);
345 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
347 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
348 FIXME("(%p)->(%p)\n", This, p);
352 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
354 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
355 FIXME("(%p)->()\n", This);
359 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
361 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
362 FIXME("(%p)->(%p)\n", This, p);
366 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
368 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
369 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
373 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
375 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
376 FIXME("(%p)->(%p)\n", This, p);
380 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
382 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
383 FIXME("(%p)->(%x)\n", This, v);
387 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
389 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
390 FIXME("(%p)->(%p)\n", This, p);
394 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
396 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
397 FIXME("(%p)->(%p)\n", This, range);
401 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
403 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
404 FIXME("(%p)->(%x)\n", This, v);
408 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
410 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
411 FIXME("(%p)->(%p)\n", This, p);
415 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
417 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
420 TRACE("(%p)->(%x)\n", This, v);
422 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
423 if(NS_FAILED(nsres)) {
424 ERR("SetDefaultChecked failed: %08x\n", nsres);
431 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
433 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
434 PRBool default_checked = FALSE;
437 TRACE("(%p)->(%p)\n", This, p);
439 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
440 if(NS_FAILED(nsres)) {
441 ERR("GetDefaultChecked failed: %08x\n", nsres);
445 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
449 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
451 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
454 TRACE("(%p)->(%x)\n", This, v);
456 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
457 if(NS_FAILED(nsres)) {
458 ERR("SetChecked failed: %08x\n", nsres);
465 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
467 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
471 TRACE("(%p)->(%p)\n", This, p);
473 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
474 if(NS_FAILED(nsres)) {
475 ERR("GetChecked failed: %08x\n", nsres);
479 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
480 TRACE("checked=%x\n", *p);
484 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
486 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
487 FIXME("(%p)->()\n", This);
491 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
493 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
494 FIXME("(%p)->(%p)\n", This, p);
498 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
500 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
501 FIXME("(%p)->(%d)\n", This, v);
505 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
507 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
508 FIXME("(%p)->(%p)\n", This, p);
512 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
514 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
515 FIXME("(%p)->(%d)\n", This, v);
519 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
521 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
522 FIXME("(%p)->(%p)\n", This, p);
526 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
528 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
529 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
533 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
535 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
536 FIXME("(%p)->(%p)\n", This, p);
540 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
542 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
546 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
548 nsAString_InitDepend(&nsstr, v);
549 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
550 nsAString_Finish(&nsstr);
552 ERR("SetSrc failed: %08x\n", nsres);
557 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
559 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
560 const PRUnichar *src;
565 TRACE("(%p)->(%p)\n", This, p);
567 nsAString_Init(&src_str, NULL);
568 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
569 if(NS_FAILED(nsres)) {
570 ERR("GetSrc failed: %08x\n", nsres);
574 nsAString_GetData(&src_str, &src);
575 hres = nsuri_to_url(src, FALSE, p);
576 nsAString_Finish(&src_str);
581 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
583 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
584 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
588 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
590 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
591 FIXME("(%p)->(%p)\n", This, p);
595 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
597 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
598 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
602 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
604 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
605 FIXME("(%p)->(%p)\n", This, p);
609 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
611 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
612 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
616 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
618 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
619 FIXME("(%p)->(%p)\n", This, p);
623 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
625 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
626 FIXME("(%p)->(%p)\n", This, p);
630 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
632 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
633 FIXME("(%p)->(%p)\n", This, p);
637 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
639 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
640 FIXME("(%p)->()\n", This);
644 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
646 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
647 FIXME("(%p)->(%p)\n", This, p);
651 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
653 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
654 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
658 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
660 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
661 FIXME("(%p)->(%p)\n", This, p);
665 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
667 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
668 FIXME("(%p)->()\n", This);
672 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
674 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
675 FIXME("(%p)->(%p)\n", This, p);
679 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
681 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
682 FIXME("(%p)->()\n", This);
686 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
688 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
689 FIXME("(%p)->(%p)\n", This, p);
693 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
695 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
696 FIXME("(%p)->()\n", This);
700 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
702 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
703 FIXME("(%p)->(%p)\n", This, p);
707 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
709 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
710 FIXME("(%p)->(%d)\n", This, v);
714 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
716 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
717 FIXME("(%p)->(%p)\n", This, p);
721 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
723 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
724 FIXME("(%p)->(%d)\n", This, v);
728 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
730 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
731 FIXME("(%p)->(%p)\n", This, p);
735 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
737 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
738 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
742 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
744 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
745 FIXME("(%p)->(%p)\n", This, p);
749 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
750 HTMLInputElement_QueryInterface,
751 HTMLInputElement_AddRef,
752 HTMLInputElement_Release,
753 HTMLInputElement_GetTypeInfoCount,
754 HTMLInputElement_GetTypeInfo,
755 HTMLInputElement_GetIDsOfNames,
756 HTMLInputElement_Invoke,
757 HTMLInputElement_put_type,
758 HTMLInputElement_get_type,
759 HTMLInputElement_put_value,
760 HTMLInputElement_get_value,
761 HTMLInputElement_put_name,
762 HTMLInputElement_get_name,
763 HTMLInputElement_put_status,
764 HTMLInputElement_get_status,
765 HTMLInputElement_put_disabled,
766 HTMLInputElement_get_disabled,
767 HTMLInputElement_get_form,
768 HTMLInputElement_put_size,
769 HTMLInputElement_get_size,
770 HTMLInputElement_put_maxLength,
771 HTMLInputElement_get_maxLength,
772 HTMLInputElement_select,
773 HTMLInputElement_put_onchange,
774 HTMLInputElement_get_onchange,
775 HTMLInputElement_put_onselect,
776 HTMLInputElement_get_onselect,
777 HTMLInputElement_put_defaultValue,
778 HTMLInputElement_get_defaultValue,
779 HTMLInputElement_put_readOnly,
780 HTMLInputElement_get_readOnly,
781 HTMLInputElement_createTextRange,
782 HTMLInputElement_put_indeterminate,
783 HTMLInputElement_get_indeterminate,
784 HTMLInputElement_put_defaultChecked,
785 HTMLInputElement_get_defaultChecked,
786 HTMLInputElement_put_checked,
787 HTMLInputElement_get_checked,
788 HTMLInputElement_put_border,
789 HTMLInputElement_get_border,
790 HTMLInputElement_put_vspace,
791 HTMLInputElement_get_vspace,
792 HTMLInputElement_put_hspace,
793 HTMLInputElement_get_hspace,
794 HTMLInputElement_put_alt,
795 HTMLInputElement_get_alt,
796 HTMLInputElement_put_src,
797 HTMLInputElement_get_src,
798 HTMLInputElement_put_lowsrc,
799 HTMLInputElement_get_lowsrc,
800 HTMLInputElement_put_vrml,
801 HTMLInputElement_get_vrml,
802 HTMLInputElement_put_dynsrc,
803 HTMLInputElement_get_dynsrc,
804 HTMLInputElement_get_readyState,
805 HTMLInputElement_get_complete,
806 HTMLInputElement_put_loop,
807 HTMLInputElement_get_loop,
808 HTMLInputElement_put_align,
809 HTMLInputElement_get_align,
810 HTMLInputElement_put_onload,
811 HTMLInputElement_get_onload,
812 HTMLInputElement_put_onerror,
813 HTMLInputElement_get_onerror,
814 HTMLInputElement_put_onabort,
815 HTMLInputElement_get_onabort,
816 HTMLInputElement_put_width,
817 HTMLInputElement_get_width,
818 HTMLInputElement_put_height,
819 HTMLInputElement_get_height,
820 HTMLInputElement_put_start,
821 HTMLInputElement_get_start
824 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
825 REFIID riid, void **ppv)
827 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
829 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
832 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
834 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
836 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
839 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
841 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
843 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
846 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
848 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
849 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
852 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
853 LCID lcid, ITypeInfo **ppTInfo)
855 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
856 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
860 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
861 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
863 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
864 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
865 cNames, lcid, rgDispId);
868 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
869 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
870 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
872 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
873 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
874 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
877 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
879 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
881 TRACE("(%p)->(%p)\n", This, p);
883 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
886 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
888 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
890 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
892 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
895 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
897 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
899 TRACE("(%p)->(%p)\n", This, p);
901 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
904 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
906 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
908 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
910 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
913 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
915 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
917 TRACE("(%p)->(%p)\n", This, p);
919 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
922 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
924 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
925 FIXME("(%p)->(v)\n", This);
929 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
931 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
932 TRACE("(%p)->(v)\n", This);
936 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
938 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
940 TRACE("(%p)->(%x)\n", This, v);
942 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
945 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
947 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
949 TRACE("(%p)->(%p)\n", This, p);
951 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
954 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
956 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
958 TRACE("(%p)->(%p)\n", This, p);
960 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
963 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
965 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
967 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
969 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
972 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
974 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
976 TRACE("(%p)->(%p)\n", This, p);
978 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
981 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
983 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
985 TRACE("(%p)->(%d)\n", This, v);
987 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
990 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
992 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
994 TRACE("(%p)->(%p)\n", This, p);
996 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
999 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
1001 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1003 TRACE("(%p)->(%d)\n", This, v);
1005 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1008 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1010 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1012 TRACE("(%p)->(%p)\n", This, p);
1014 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1017 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1019 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1021 TRACE("(%p)\n", This);
1023 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1026 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1028 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1030 TRACE("(%p)->()\n", This);
1032 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1035 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1037 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1039 TRACE("(%p)->(%p)\n", This, p);
1041 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1044 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1046 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1048 TRACE("(%p)->()\n", This);
1050 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1053 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1055 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1057 TRACE("(%p)->(%p)\n", This, p);
1059 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1062 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1064 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1066 TRACE("(%p)->(%x)\n", This, v);
1068 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1071 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1073 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1075 TRACE("(%p)->(%p)\n", This, p);
1077 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1080 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1082 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1084 TRACE("(%p)->(%p)\n", This, range);
1086 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1089 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1090 HTMLInputTextElement_QueryInterface,
1091 HTMLInputTextElement_AddRef,
1092 HTMLInputTextElement_Release,
1093 HTMLInputTextElement_GetTypeInfoCount,
1094 HTMLInputTextElement_GetTypeInfo,
1095 HTMLInputTextElement_GetIDsOfNames,
1096 HTMLInputTextElement_Invoke,
1097 HTMLInputTextElement_get_type,
1098 HTMLInputTextElement_put_value,
1099 HTMLInputTextElement_get_value,
1100 HTMLInputTextElement_put_name,
1101 HTMLInputTextElement_get_name,
1102 HTMLInputTextElement_put_status,
1103 HTMLInputTextElement_get_status,
1104 HTMLInputTextElement_put_disabled,
1105 HTMLInputTextElement_get_disabled,
1106 HTMLInputTextElement_get_form,
1107 HTMLInputTextElement_put_defaultValue,
1108 HTMLInputTextElement_get_defaultValue,
1109 HTMLInputTextElement_put_size,
1110 HTMLInputTextElement_get_size,
1111 HTMLInputTextElement_put_maxLength,
1112 HTMLInputTextElement_get_maxLength,
1113 HTMLInputTextElement_select,
1114 HTMLInputTextElement_put_onchange,
1115 HTMLInputTextElement_get_onchange,
1116 HTMLInputTextElement_put_onselect,
1117 HTMLInputTextElement_get_onselect,
1118 HTMLInputTextElement_put_readOnly,
1119 HTMLInputTextElement_get_readOnly,
1120 HTMLInputTextElement_createTextRange
1123 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1125 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1128 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1130 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1134 if(IsEqualGUID(&IID_IUnknown, riid)) {
1135 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1136 *ppv = &This->IHTMLInputElement_iface;
1137 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1138 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1139 *ppv = &This->IHTMLInputElement_iface;
1140 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1141 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1142 *ppv = &This->IHTMLInputElement_iface;
1143 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1144 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1145 *ppv = &This->IHTMLInputTextElement_iface;
1149 IUnknown_AddRef((IUnknown*)*ppv);
1153 return HTMLElement_QI(&This->element.node, riid, ppv);
1156 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1158 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1160 nsIDOMHTMLInputElement_Release(This->nsinput);
1162 HTMLElement_destructor(&This->element.node);
1165 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1167 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1169 if(eid == EVENTID_CLICK) {
1174 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1175 if(NS_FAILED(nsres)) {
1176 ERR("Click failed: %08x\n", nsres);
1184 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1186 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1187 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1190 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1192 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1193 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1196 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1197 HTMLInputElement_QI,
1198 HTMLInputElement_destructor,
1201 HTMLInputElementImpl_call_event,
1202 HTMLInputElementImpl_put_disabled,
1203 HTMLInputElementImpl_get_disabled,
1206 static const tid_t HTMLInputElement_iface_tids[] = {
1208 IHTMLInputElement_tid,
1211 static dispex_static_data_t HTMLInputElement_dispex = {
1213 DispHTMLInputElement_tid,
1215 HTMLInputElement_iface_tids
1218 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1220 HTMLInputElement *ret;
1223 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1225 return E_OUTOFMEMORY;
1227 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1228 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1229 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1231 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1232 if(NS_FAILED(nsres)) {
1233 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1238 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1240 *elem = &ret->element;