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
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
39 IHTMLInputElement IHTMLInputElement_iface;
40 IHTMLInputTextElement IHTMLInputTextElement_iface;
42 nsIDOMHTMLInputElement *nsinput;
45 static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
47 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
50 static inline HTMLInputElement *impl_from_IHTMLInputTextElement(IHTMLInputTextElement *iface)
52 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement_iface);
55 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
56 REFIID riid, void **ppv)
58 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
60 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
63 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
65 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
67 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
70 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
72 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
74 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
77 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
79 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
81 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
84 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
85 LCID lcid, ITypeInfo **ppTInfo)
87 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
89 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
93 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
94 LPOLESTR *rgszNames, UINT cNames,
95 LCID lcid, DISPID *rgDispId)
97 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
99 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
100 cNames, lcid, rgDispId);
103 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
104 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
105 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
107 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
109 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
110 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
113 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
115 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
119 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
123 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
125 nsAString_InitDepend(&type_str, v);
126 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
127 nsAString_Finish(&type_str);
128 if(NS_FAILED(nsres)) {
129 ERR("SetType failed: %08x\n", nsres);
136 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
138 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
142 TRACE("(%p)->(%p)\n", This, p);
144 nsAString_Init(&type_str, NULL);
145 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
146 return return_nsstr(nsres, &type_str, p);
149 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
151 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
155 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
157 nsAString_InitDepend(&val_str, v);
158 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
159 nsAString_Finish(&val_str);
161 ERR("SetValue failed: %08x\n", nsres);
166 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
168 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
172 TRACE("(%p)->(%p)\n", This, p);
174 nsAString_Init(&value_str, NULL);
175 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
176 return return_nsstr(nsres, &value_str, p);
179 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
181 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
185 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
187 nsAString_InitDepend(&name_str, v);
188 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
189 nsAString_Finish(&name_str);
190 if(NS_FAILED(nsres)) {
191 ERR("SetName failed: %08x\n", nsres);
198 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
200 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
204 TRACE("(%p)->(%p)\n", This, p);
206 nsAString_Init(&name_str, NULL);
207 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
208 return return_nsstr(nsres, &name_str, p);
211 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
213 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
214 FIXME("(%p)->(%x)\n", This, v);
218 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
220 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
221 FIXME("(%p)->(%p)\n", This, p);
225 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
227 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
230 TRACE("(%p)->(%x)\n", This, v);
232 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
234 ERR("SetDisabled failed: %08x\n", nsres);
239 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
241 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
242 cpp_bool disabled = FALSE;
244 TRACE("(%p)->(%p)\n", This, p);
246 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
248 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
252 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
254 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
255 FIXME("(%p)->(%p)\n", This, p);
259 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
261 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
262 FIXME("(%p)->(%d)\n", This, v);
266 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
268 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
269 FIXME("(%p)->(%p)\n", This, p);
273 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
275 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
276 FIXME("(%p)->(%d)\n", This, v);
280 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
282 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
283 FIXME("(%p)->(%p)\n", This, p);
287 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
289 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
292 TRACE("(%p)\n", This);
294 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
295 if(NS_FAILED(nsres)) {
296 ERR("Select failed: %08x\n", nsres);
303 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
305 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
306 FIXME("(%p)->()\n", This);
310 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
312 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
313 FIXME("(%p)->(%p)\n", This, p);
317 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
319 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
320 FIXME("(%p)->()\n", This);
324 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
326 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
327 FIXME("(%p)->(%p)\n", This, p);
331 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
333 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
334 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
338 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
340 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
341 FIXME("(%p)->(%p)\n", This, p);
345 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
347 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
348 FIXME("(%p)->(%x)\n", This, v);
352 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
354 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
355 FIXME("(%p)->(%p)\n", This, p);
359 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
361 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
362 FIXME("(%p)->(%p)\n", This, range);
366 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
368 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
369 FIXME("(%p)->(%x)\n", This, v);
373 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
375 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
376 FIXME("(%p)->(%p)\n", This, p);
380 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
382 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
385 TRACE("(%p)->(%x)\n", This, v);
387 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
388 if(NS_FAILED(nsres)) {
389 ERR("SetDefaultChecked failed: %08x\n", nsres);
396 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
398 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
399 cpp_bool default_checked = FALSE;
402 TRACE("(%p)->(%p)\n", This, p);
404 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
405 if(NS_FAILED(nsres)) {
406 ERR("GetDefaultChecked failed: %08x\n", nsres);
410 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
414 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
416 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
419 TRACE("(%p)->(%x)\n", This, v);
421 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
422 if(NS_FAILED(nsres)) {
423 ERR("SetChecked failed: %08x\n", nsres);
430 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
432 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
436 TRACE("(%p)->(%p)\n", This, p);
438 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
439 if(NS_FAILED(nsres)) {
440 ERR("GetChecked failed: %08x\n", nsres);
444 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
445 TRACE("checked=%x\n", *p);
449 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
451 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
452 FIXME("(%p)->()\n", This);
456 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
458 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
459 FIXME("(%p)->(%p)\n", This, p);
463 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
465 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
466 FIXME("(%p)->(%d)\n", This, v);
470 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
472 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
473 FIXME("(%p)->(%p)\n", This, p);
477 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
479 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
480 FIXME("(%p)->(%d)\n", This, v);
484 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
486 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
487 FIXME("(%p)->(%p)\n", This, p);
491 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
493 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
494 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
498 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
500 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
501 FIXME("(%p)->(%p)\n", This, p);
505 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
507 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
511 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
513 nsAString_InitDepend(&nsstr, v);
514 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
515 nsAString_Finish(&nsstr);
517 ERR("SetSrc failed: %08x\n", nsres);
522 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
524 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
525 const PRUnichar *src;
530 TRACE("(%p)->(%p)\n", This, p);
532 nsAString_Init(&src_str, NULL);
533 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
534 if(NS_FAILED(nsres)) {
535 ERR("GetSrc failed: %08x\n", nsres);
539 nsAString_GetData(&src_str, &src);
540 hres = nsuri_to_url(src, FALSE, p);
541 nsAString_Finish(&src_str);
546 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
548 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
549 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
553 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
555 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
556 FIXME("(%p)->(%p)\n", This, p);
560 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
562 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
563 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
567 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
569 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
570 FIXME("(%p)->(%p)\n", This, p);
574 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
576 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
577 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
581 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
583 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
584 FIXME("(%p)->(%p)\n", This, p);
588 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
590 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
591 FIXME("(%p)->(%p)\n", This, p);
595 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
597 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
598 FIXME("(%p)->(%p)\n", This, p);
602 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
604 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
605 FIXME("(%p)->()\n", This);
609 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
611 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
612 FIXME("(%p)->(%p)\n", This, p);
616 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
618 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
619 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
623 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
625 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
626 FIXME("(%p)->(%p)\n", This, p);
630 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
632 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
633 FIXME("(%p)->()\n", This);
637 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
639 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
640 FIXME("(%p)->(%p)\n", This, p);
644 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
646 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
647 FIXME("(%p)->()\n", This);
651 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
653 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
654 FIXME("(%p)->(%p)\n", This, p);
658 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
660 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
661 FIXME("(%p)->()\n", This);
665 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
667 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
668 FIXME("(%p)->(%p)\n", This, p);
672 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
674 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
675 FIXME("(%p)->(%d)\n", This, v);
679 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
681 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
682 FIXME("(%p)->(%p)\n", This, p);
686 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
688 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
689 FIXME("(%p)->(%d)\n", This, v);
693 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
695 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
696 FIXME("(%p)->(%p)\n", This, p);
700 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
702 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
703 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
707 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
709 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
710 FIXME("(%p)->(%p)\n", This, p);
714 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
715 HTMLInputElement_QueryInterface,
716 HTMLInputElement_AddRef,
717 HTMLInputElement_Release,
718 HTMLInputElement_GetTypeInfoCount,
719 HTMLInputElement_GetTypeInfo,
720 HTMLInputElement_GetIDsOfNames,
721 HTMLInputElement_Invoke,
722 HTMLInputElement_put_type,
723 HTMLInputElement_get_type,
724 HTMLInputElement_put_value,
725 HTMLInputElement_get_value,
726 HTMLInputElement_put_name,
727 HTMLInputElement_get_name,
728 HTMLInputElement_put_status,
729 HTMLInputElement_get_status,
730 HTMLInputElement_put_disabled,
731 HTMLInputElement_get_disabled,
732 HTMLInputElement_get_form,
733 HTMLInputElement_put_size,
734 HTMLInputElement_get_size,
735 HTMLInputElement_put_maxLength,
736 HTMLInputElement_get_maxLength,
737 HTMLInputElement_select,
738 HTMLInputElement_put_onchange,
739 HTMLInputElement_get_onchange,
740 HTMLInputElement_put_onselect,
741 HTMLInputElement_get_onselect,
742 HTMLInputElement_put_defaultValue,
743 HTMLInputElement_get_defaultValue,
744 HTMLInputElement_put_readOnly,
745 HTMLInputElement_get_readOnly,
746 HTMLInputElement_createTextRange,
747 HTMLInputElement_put_indeterminate,
748 HTMLInputElement_get_indeterminate,
749 HTMLInputElement_put_defaultChecked,
750 HTMLInputElement_get_defaultChecked,
751 HTMLInputElement_put_checked,
752 HTMLInputElement_get_checked,
753 HTMLInputElement_put_border,
754 HTMLInputElement_get_border,
755 HTMLInputElement_put_vspace,
756 HTMLInputElement_get_vspace,
757 HTMLInputElement_put_hspace,
758 HTMLInputElement_get_hspace,
759 HTMLInputElement_put_alt,
760 HTMLInputElement_get_alt,
761 HTMLInputElement_put_src,
762 HTMLInputElement_get_src,
763 HTMLInputElement_put_lowsrc,
764 HTMLInputElement_get_lowsrc,
765 HTMLInputElement_put_vrml,
766 HTMLInputElement_get_vrml,
767 HTMLInputElement_put_dynsrc,
768 HTMLInputElement_get_dynsrc,
769 HTMLInputElement_get_readyState,
770 HTMLInputElement_get_complete,
771 HTMLInputElement_put_loop,
772 HTMLInputElement_get_loop,
773 HTMLInputElement_put_align,
774 HTMLInputElement_get_align,
775 HTMLInputElement_put_onload,
776 HTMLInputElement_get_onload,
777 HTMLInputElement_put_onerror,
778 HTMLInputElement_get_onerror,
779 HTMLInputElement_put_onabort,
780 HTMLInputElement_get_onabort,
781 HTMLInputElement_put_width,
782 HTMLInputElement_get_width,
783 HTMLInputElement_put_height,
784 HTMLInputElement_get_height,
785 HTMLInputElement_put_start,
786 HTMLInputElement_get_start
789 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
790 REFIID riid, void **ppv)
792 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
794 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
797 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
799 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
801 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
804 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
806 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
808 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
811 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
813 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
814 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
817 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
818 LCID lcid, ITypeInfo **ppTInfo)
820 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
821 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
825 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
826 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
828 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
829 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
830 cNames, lcid, rgDispId);
833 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
834 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
835 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
837 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
838 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
839 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
842 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
844 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
846 TRACE("(%p)->(%p)\n", This, p);
848 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
851 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
853 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
855 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
857 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
860 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
862 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
864 TRACE("(%p)->(%p)\n", This, p);
866 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
869 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
871 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
873 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
875 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
878 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
880 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
882 TRACE("(%p)->(%p)\n", This, p);
884 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
887 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
889 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
890 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
894 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
896 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
897 TRACE("(%p)->(%p)\n", This, p);
901 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
903 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
905 TRACE("(%p)->(%x)\n", This, v);
907 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
910 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
912 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
914 TRACE("(%p)->(%p)\n", This, p);
916 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
919 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
921 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
923 TRACE("(%p)->(%p)\n", This, p);
925 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
928 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
930 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
932 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
934 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
937 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
939 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
941 TRACE("(%p)->(%p)\n", This, p);
943 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
946 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
948 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
950 TRACE("(%p)->(%d)\n", This, v);
952 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
955 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
957 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
959 TRACE("(%p)->(%p)\n", This, p);
961 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
964 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
966 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
968 TRACE("(%p)->(%d)\n", This, v);
970 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
973 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
975 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
977 TRACE("(%p)->(%p)\n", This, p);
979 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
982 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
984 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
986 TRACE("(%p)\n", This);
988 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
991 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
993 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
995 TRACE("(%p)->()\n", This);
997 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1000 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1002 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1004 TRACE("(%p)->(%p)\n", This, p);
1006 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1009 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1011 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1013 TRACE("(%p)->()\n", This);
1015 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1018 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1020 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1022 TRACE("(%p)->(%p)\n", This, p);
1024 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1027 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1029 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1031 TRACE("(%p)->(%x)\n", This, v);
1033 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1036 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1038 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1040 TRACE("(%p)->(%p)\n", This, p);
1042 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1045 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1047 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1049 TRACE("(%p)->(%p)\n", This, range);
1051 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1054 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1055 HTMLInputTextElement_QueryInterface,
1056 HTMLInputTextElement_AddRef,
1057 HTMLInputTextElement_Release,
1058 HTMLInputTextElement_GetTypeInfoCount,
1059 HTMLInputTextElement_GetTypeInfo,
1060 HTMLInputTextElement_GetIDsOfNames,
1061 HTMLInputTextElement_Invoke,
1062 HTMLInputTextElement_get_type,
1063 HTMLInputTextElement_put_value,
1064 HTMLInputTextElement_get_value,
1065 HTMLInputTextElement_put_name,
1066 HTMLInputTextElement_get_name,
1067 HTMLInputTextElement_put_status,
1068 HTMLInputTextElement_get_status,
1069 HTMLInputTextElement_put_disabled,
1070 HTMLInputTextElement_get_disabled,
1071 HTMLInputTextElement_get_form,
1072 HTMLInputTextElement_put_defaultValue,
1073 HTMLInputTextElement_get_defaultValue,
1074 HTMLInputTextElement_put_size,
1075 HTMLInputTextElement_get_size,
1076 HTMLInputTextElement_put_maxLength,
1077 HTMLInputTextElement_get_maxLength,
1078 HTMLInputTextElement_select,
1079 HTMLInputTextElement_put_onchange,
1080 HTMLInputTextElement_get_onchange,
1081 HTMLInputTextElement_put_onselect,
1082 HTMLInputTextElement_get_onselect,
1083 HTMLInputTextElement_put_readOnly,
1084 HTMLInputTextElement_get_readOnly,
1085 HTMLInputTextElement_createTextRange
1088 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1090 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1093 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1095 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1099 if(IsEqualGUID(&IID_IUnknown, riid)) {
1100 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1101 *ppv = &This->IHTMLInputElement_iface;
1102 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1103 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1104 *ppv = &This->IHTMLInputElement_iface;
1105 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1106 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1107 *ppv = &This->IHTMLInputElement_iface;
1108 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1109 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1110 *ppv = &This->IHTMLInputTextElement_iface;
1114 IUnknown_AddRef((IUnknown*)*ppv);
1118 return HTMLElement_QI(&This->element.node, riid, ppv);
1121 static HRESULT HTMLInputElementImpl_fire_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1123 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1125 if(eid == EVENTID_CLICK) {
1130 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1131 if(NS_FAILED(nsres)) {
1132 ERR("Click failed: %08x\n", nsres);
1140 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1142 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1143 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1146 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1148 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1149 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1152 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1153 HTMLInputElement_QI,
1154 HTMLElement_destructor,
1156 HTMLElement_get_attr_col,
1158 HTMLInputElementImpl_fire_event,
1160 HTMLInputElementImpl_put_disabled,
1161 HTMLInputElementImpl_get_disabled,
1164 static const tid_t HTMLInputElement_iface_tids[] = {
1166 IHTMLInputElement_tid,
1169 static dispex_static_data_t HTMLInputElement_dispex = {
1171 DispHTMLInputElement_tid,
1173 HTMLInputElement_iface_tids
1176 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1178 HTMLInputElement *ret;
1181 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1183 return E_OUTOFMEMORY;
1185 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1186 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1187 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1189 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1191 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1193 /* Share nsinput reference with nsnode */
1194 assert(nsres == NS_OK && (nsIDOMNode*)ret->nsinput == ret->element.node.nsnode);
1195 nsIDOMNode_Release(ret->element.node.nsnode);
1197 *elem = &ret->element;