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);
183 TRACE("(%p)->(%p)\n", This, p);
185 nsAString_Init(&value_str, NULL);
186 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
187 return return_nsstr(nsres, &value_str, p);
190 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
192 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
196 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
198 nsAString_InitDepend(&name_str, v);
199 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
200 nsAString_Finish(&name_str);
201 if(NS_FAILED(nsres)) {
202 ERR("SetName failed: %08x\n", nsres);
209 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
211 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
213 const PRUnichar *name;
217 TRACE("(%p)->(%p)\n", This, p);
219 nsAString_Init(&name_str, NULL);
221 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
222 if(NS_SUCCEEDED(nsres)) {
223 nsAString_GetData(&name_str, &name);
224 *p = *name ? SysAllocString(name) : NULL;
226 ERR("GetName failed: %08x\n", nsres);
230 nsAString_Finish(&name_str);
234 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
236 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
237 FIXME("(%p)->(%x)\n", This, v);
241 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
243 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
244 FIXME("(%p)->(%p)\n", This, p);
248 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
250 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
253 TRACE("(%p)->(%x)\n", This, v);
255 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
257 ERR("SetDisabled failed: %08x\n", nsres);
262 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
264 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
265 PRBool disabled = FALSE;
267 TRACE("(%p)->(%p)\n", This, p);
269 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
271 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
275 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
277 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
278 FIXME("(%p)->(%p)\n", This, p);
282 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
284 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
285 FIXME("(%p)->(%d)\n", This, v);
289 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
291 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
292 FIXME("(%p)->(%p)\n", This, p);
296 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
298 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
299 FIXME("(%p)->(%d)\n", This, v);
303 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
305 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
306 FIXME("(%p)->(%p)\n", This, p);
310 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
312 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
315 TRACE("(%p)\n", This);
317 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
318 if(NS_FAILED(nsres)) {
319 ERR("Select failed: %08x\n", nsres);
326 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
328 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
329 FIXME("(%p)->()\n", This);
333 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
335 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
336 FIXME("(%p)->(%p)\n", This, p);
340 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
342 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
343 FIXME("(%p)->()\n", This);
347 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
349 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
350 FIXME("(%p)->(%p)\n", This, p);
354 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
356 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
357 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
361 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
363 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
364 FIXME("(%p)->(%p)\n", This, p);
368 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
370 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
371 FIXME("(%p)->(%x)\n", This, v);
375 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
377 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
378 FIXME("(%p)->(%p)\n", This, p);
382 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
384 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
385 FIXME("(%p)->(%p)\n", This, range);
389 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
391 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
392 FIXME("(%p)->(%x)\n", This, v);
396 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
398 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
399 FIXME("(%p)->(%p)\n", This, p);
403 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
405 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
408 TRACE("(%p)->(%x)\n", This, v);
410 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
411 if(NS_FAILED(nsres)) {
412 ERR("SetDefaultChecked failed: %08x\n", nsres);
419 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
421 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
422 PRBool default_checked = FALSE;
425 TRACE("(%p)->(%p)\n", This, p);
427 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
428 if(NS_FAILED(nsres)) {
429 ERR("GetDefaultChecked failed: %08x\n", nsres);
433 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
437 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
439 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
442 TRACE("(%p)->(%x)\n", This, v);
444 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
445 if(NS_FAILED(nsres)) {
446 ERR("SetChecked failed: %08x\n", nsres);
453 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
455 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
459 TRACE("(%p)->(%p)\n", This, p);
461 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
462 if(NS_FAILED(nsres)) {
463 ERR("GetChecked failed: %08x\n", nsres);
467 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
468 TRACE("checked=%x\n", *p);
472 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
474 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
475 FIXME("(%p)->()\n", This);
479 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
481 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
482 FIXME("(%p)->(%p)\n", This, p);
486 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
488 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
489 FIXME("(%p)->(%d)\n", This, v);
493 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
495 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
496 FIXME("(%p)->(%p)\n", This, p);
500 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
502 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
503 FIXME("(%p)->(%d)\n", This, v);
507 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
509 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
510 FIXME("(%p)->(%p)\n", This, p);
514 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
516 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
517 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
521 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
523 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
524 FIXME("(%p)->(%p)\n", This, p);
528 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
530 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
534 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
536 nsAString_InitDepend(&nsstr, v);
537 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
538 nsAString_Finish(&nsstr);
540 ERR("SetSrc failed: %08x\n", nsres);
545 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
547 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
548 const PRUnichar *src;
553 TRACE("(%p)->(%p)\n", This, p);
555 nsAString_Init(&src_str, NULL);
556 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
557 if(NS_FAILED(nsres)) {
558 ERR("GetSrc failed: %08x\n", nsres);
562 nsAString_GetData(&src_str, &src);
563 hres = nsuri_to_url(src, FALSE, p);
564 nsAString_Finish(&src_str);
569 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
571 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
572 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
576 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
578 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
579 FIXME("(%p)->(%p)\n", This, p);
583 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
585 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
586 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
590 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
592 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
593 FIXME("(%p)->(%p)\n", This, p);
597 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
599 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
600 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
604 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
606 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
607 FIXME("(%p)->(%p)\n", This, p);
611 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
613 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
614 FIXME("(%p)->(%p)\n", This, p);
618 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
620 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
621 FIXME("(%p)->(%p)\n", This, p);
625 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
627 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
628 FIXME("(%p)->()\n", This);
632 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
634 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
635 FIXME("(%p)->(%p)\n", This, p);
639 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
641 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
642 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
646 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
648 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
649 FIXME("(%p)->(%p)\n", This, p);
653 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
655 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
656 FIXME("(%p)->()\n", This);
660 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
662 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
663 FIXME("(%p)->(%p)\n", This, p);
667 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
669 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
670 FIXME("(%p)->()\n", This);
674 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
676 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
677 FIXME("(%p)->(%p)\n", This, p);
681 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
683 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
684 FIXME("(%p)->()\n", This);
688 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
690 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
691 FIXME("(%p)->(%p)\n", This, p);
695 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
697 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
698 FIXME("(%p)->(%d)\n", This, v);
702 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
704 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
705 FIXME("(%p)->(%p)\n", This, p);
709 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
711 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
712 FIXME("(%p)->(%d)\n", This, v);
716 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
718 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
719 FIXME("(%p)->(%p)\n", This, p);
723 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
725 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
726 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
730 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
732 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
733 FIXME("(%p)->(%p)\n", This, p);
737 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
738 HTMLInputElement_QueryInterface,
739 HTMLInputElement_AddRef,
740 HTMLInputElement_Release,
741 HTMLInputElement_GetTypeInfoCount,
742 HTMLInputElement_GetTypeInfo,
743 HTMLInputElement_GetIDsOfNames,
744 HTMLInputElement_Invoke,
745 HTMLInputElement_put_type,
746 HTMLInputElement_get_type,
747 HTMLInputElement_put_value,
748 HTMLInputElement_get_value,
749 HTMLInputElement_put_name,
750 HTMLInputElement_get_name,
751 HTMLInputElement_put_status,
752 HTMLInputElement_get_status,
753 HTMLInputElement_put_disabled,
754 HTMLInputElement_get_disabled,
755 HTMLInputElement_get_form,
756 HTMLInputElement_put_size,
757 HTMLInputElement_get_size,
758 HTMLInputElement_put_maxLength,
759 HTMLInputElement_get_maxLength,
760 HTMLInputElement_select,
761 HTMLInputElement_put_onchange,
762 HTMLInputElement_get_onchange,
763 HTMLInputElement_put_onselect,
764 HTMLInputElement_get_onselect,
765 HTMLInputElement_put_defaultValue,
766 HTMLInputElement_get_defaultValue,
767 HTMLInputElement_put_readOnly,
768 HTMLInputElement_get_readOnly,
769 HTMLInputElement_createTextRange,
770 HTMLInputElement_put_indeterminate,
771 HTMLInputElement_get_indeterminate,
772 HTMLInputElement_put_defaultChecked,
773 HTMLInputElement_get_defaultChecked,
774 HTMLInputElement_put_checked,
775 HTMLInputElement_get_checked,
776 HTMLInputElement_put_border,
777 HTMLInputElement_get_border,
778 HTMLInputElement_put_vspace,
779 HTMLInputElement_get_vspace,
780 HTMLInputElement_put_hspace,
781 HTMLInputElement_get_hspace,
782 HTMLInputElement_put_alt,
783 HTMLInputElement_get_alt,
784 HTMLInputElement_put_src,
785 HTMLInputElement_get_src,
786 HTMLInputElement_put_lowsrc,
787 HTMLInputElement_get_lowsrc,
788 HTMLInputElement_put_vrml,
789 HTMLInputElement_get_vrml,
790 HTMLInputElement_put_dynsrc,
791 HTMLInputElement_get_dynsrc,
792 HTMLInputElement_get_readyState,
793 HTMLInputElement_get_complete,
794 HTMLInputElement_put_loop,
795 HTMLInputElement_get_loop,
796 HTMLInputElement_put_align,
797 HTMLInputElement_get_align,
798 HTMLInputElement_put_onload,
799 HTMLInputElement_get_onload,
800 HTMLInputElement_put_onerror,
801 HTMLInputElement_get_onerror,
802 HTMLInputElement_put_onabort,
803 HTMLInputElement_get_onabort,
804 HTMLInputElement_put_width,
805 HTMLInputElement_get_width,
806 HTMLInputElement_put_height,
807 HTMLInputElement_get_height,
808 HTMLInputElement_put_start,
809 HTMLInputElement_get_start
812 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
813 REFIID riid, void **ppv)
815 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
817 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
820 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
822 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
824 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
827 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
829 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
831 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
834 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
836 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
837 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
840 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
841 LCID lcid, ITypeInfo **ppTInfo)
843 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
844 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
848 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
849 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
851 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
852 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
853 cNames, lcid, rgDispId);
856 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
857 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
858 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
860 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
861 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
862 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
865 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
867 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
869 TRACE("(%p)->(%p)\n", This, p);
871 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
874 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
876 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
878 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
880 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
883 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
885 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
887 TRACE("(%p)->(%p)\n", This, p);
889 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
892 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
894 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
896 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
898 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
901 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
903 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
905 TRACE("(%p)->(%p)\n", This, p);
907 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
910 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
912 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
913 FIXME("(%p)->(v)\n", This);
917 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
919 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
920 TRACE("(%p)->(v)\n", This);
924 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
926 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
928 TRACE("(%p)->(%x)\n", This, v);
930 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
933 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
935 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
937 TRACE("(%p)->(%p)\n", This, p);
939 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
942 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
944 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
946 TRACE("(%p)->(%p)\n", This, p);
948 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
951 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
953 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
955 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
957 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
960 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
962 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
964 TRACE("(%p)->(%p)\n", This, p);
966 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
969 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
971 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
973 TRACE("(%p)->(%d)\n", This, v);
975 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
978 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
980 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
982 TRACE("(%p)->(%p)\n", This, p);
984 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
987 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
989 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
991 TRACE("(%p)->(%d)\n", This, v);
993 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
996 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
998 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1000 TRACE("(%p)->(%p)\n", This, p);
1002 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1005 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1007 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1009 TRACE("(%p)\n", This);
1011 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1014 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1016 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1018 TRACE("(%p)->()\n", This);
1020 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1023 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1025 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1027 TRACE("(%p)->(%p)\n", This, p);
1029 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1032 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1034 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1036 TRACE("(%p)->()\n", This);
1038 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1041 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1043 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1045 TRACE("(%p)->(%p)\n", This, p);
1047 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1050 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1052 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1054 TRACE("(%p)->(%x)\n", This, v);
1056 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1059 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1061 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1063 TRACE("(%p)->(%p)\n", This, p);
1065 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1068 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1070 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1072 TRACE("(%p)->(%p)\n", This, range);
1074 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1077 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1078 HTMLInputTextElement_QueryInterface,
1079 HTMLInputTextElement_AddRef,
1080 HTMLInputTextElement_Release,
1081 HTMLInputTextElement_GetTypeInfoCount,
1082 HTMLInputTextElement_GetTypeInfo,
1083 HTMLInputTextElement_GetIDsOfNames,
1084 HTMLInputTextElement_Invoke,
1085 HTMLInputTextElement_get_type,
1086 HTMLInputTextElement_put_value,
1087 HTMLInputTextElement_get_value,
1088 HTMLInputTextElement_put_name,
1089 HTMLInputTextElement_get_name,
1090 HTMLInputTextElement_put_status,
1091 HTMLInputTextElement_get_status,
1092 HTMLInputTextElement_put_disabled,
1093 HTMLInputTextElement_get_disabled,
1094 HTMLInputTextElement_get_form,
1095 HTMLInputTextElement_put_defaultValue,
1096 HTMLInputTextElement_get_defaultValue,
1097 HTMLInputTextElement_put_size,
1098 HTMLInputTextElement_get_size,
1099 HTMLInputTextElement_put_maxLength,
1100 HTMLInputTextElement_get_maxLength,
1101 HTMLInputTextElement_select,
1102 HTMLInputTextElement_put_onchange,
1103 HTMLInputTextElement_get_onchange,
1104 HTMLInputTextElement_put_onselect,
1105 HTMLInputTextElement_get_onselect,
1106 HTMLInputTextElement_put_readOnly,
1107 HTMLInputTextElement_get_readOnly,
1108 HTMLInputTextElement_createTextRange
1111 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1113 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1116 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1118 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1122 if(IsEqualGUID(&IID_IUnknown, riid)) {
1123 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1124 *ppv = &This->IHTMLInputElement_iface;
1125 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1126 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1127 *ppv = &This->IHTMLInputElement_iface;
1128 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1129 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1130 *ppv = &This->IHTMLInputElement_iface;
1131 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1132 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1133 *ppv = &This->IHTMLInputTextElement_iface;
1137 IUnknown_AddRef((IUnknown*)*ppv);
1141 return HTMLElement_QI(&This->element.node, riid, ppv);
1144 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1146 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1148 nsIDOMHTMLInputElement_Release(This->nsinput);
1150 HTMLElement_destructor(&This->element.node);
1153 static HRESULT HTMLInputElementImpl_fire_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1155 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1157 if(eid == EVENTID_CLICK) {
1162 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1163 if(NS_FAILED(nsres)) {
1164 ERR("Click failed: %08x\n", nsres);
1172 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1174 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1175 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1178 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1180 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1181 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1184 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1185 HTMLInputElement_QI,
1186 HTMLInputElement_destructor,
1188 HTMLElement_get_attr_col,
1190 HTMLInputElementImpl_fire_event,
1192 HTMLInputElementImpl_put_disabled,
1193 HTMLInputElementImpl_get_disabled,
1196 static const tid_t HTMLInputElement_iface_tids[] = {
1198 IHTMLInputElement_tid,
1201 static dispex_static_data_t HTMLInputElement_dispex = {
1203 DispHTMLInputElement_tid,
1205 HTMLInputElement_iface_tids
1208 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1210 HTMLInputElement *ret;
1213 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1215 return E_OUTOFMEMORY;
1217 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1218 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1219 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1221 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1222 if(NS_FAILED(nsres)) {
1223 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1228 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1230 *elem = &ret->element;