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
);
141 TRACE("(%p)->(%p)\n", This
, p
);
143 nsAString_Init(&type_str
, NULL
);
144 nsres
= nsIDOMHTMLInputElement_GetType(This
->nsinput
, &type_str
);
145 return return_nsstr(nsres
, &type_str
, p
);
148 static HRESULT WINAPI
HTMLInputElement_put_value(IHTMLInputElement
*iface
, BSTR v
)
150 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
154 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
156 nsAString_InitDepend(&val_str
, v
);
157 nsres
= nsIDOMHTMLInputElement_SetValue(This
->nsinput
, &val_str
);
158 nsAString_Finish(&val_str
);
160 ERR("SetValue failed: %08x\n", nsres
);
165 static HRESULT WINAPI
HTMLInputElement_get_value(IHTMLInputElement
*iface
, BSTR
*p
)
167 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
171 TRACE("(%p)->(%p)\n", This
, p
);
173 nsAString_Init(&value_str
, NULL
);
174 nsres
= nsIDOMHTMLInputElement_GetValue(This
->nsinput
, &value_str
);
175 return return_nsstr(nsres
, &value_str
, p
);
178 static HRESULT WINAPI
HTMLInputElement_put_name(IHTMLInputElement
*iface
, BSTR v
)
180 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
184 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
186 nsAString_InitDepend(&name_str
, v
);
187 nsres
= nsIDOMHTMLInputElement_SetName(This
->nsinput
, &name_str
);
188 nsAString_Finish(&name_str
);
189 if(NS_FAILED(nsres
)) {
190 ERR("SetName failed: %08x\n", nsres
);
197 static HRESULT WINAPI
HTMLInputElement_get_name(IHTMLInputElement
*iface
, BSTR
*p
)
199 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
203 TRACE("(%p)->(%p)\n", This
, p
);
205 nsAString_Init(&name_str
, NULL
);
206 nsres
= nsIDOMHTMLInputElement_GetName(This
->nsinput
, &name_str
);
207 return return_nsstr(nsres
, &name_str
, p
);
210 static HRESULT WINAPI
HTMLInputElement_put_status(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
212 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
213 FIXME("(%p)->(%x)\n", This
, v
);
217 static HRESULT WINAPI
HTMLInputElement_get_status(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
219 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
220 FIXME("(%p)->(%p)\n", This
, p
);
224 static HRESULT WINAPI
HTMLInputElement_put_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
226 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
229 TRACE("(%p)->(%x)\n", This
, v
);
231 nsres
= nsIDOMHTMLInputElement_SetDisabled(This
->nsinput
, v
!= VARIANT_FALSE
);
233 ERR("SetDisabled failed: %08x\n", nsres
);
238 static HRESULT WINAPI
HTMLInputElement_get_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
240 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
241 cpp_bool disabled
= FALSE
;
243 TRACE("(%p)->(%p)\n", This
, p
);
245 nsIDOMHTMLInputElement_GetDisabled(This
->nsinput
, &disabled
);
247 *p
= disabled
? VARIANT_TRUE
: VARIANT_FALSE
;
251 static HRESULT WINAPI
HTMLInputElement_get_form(IHTMLInputElement
*iface
, IHTMLFormElement
**p
)
253 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
254 FIXME("(%p)->(%p)\n", This
, p
);
258 static HRESULT WINAPI
HTMLInputElement_put_size(IHTMLInputElement
*iface
, LONG v
)
260 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
261 FIXME("(%p)->(%d)\n", This
, v
);
265 static HRESULT WINAPI
HTMLInputElement_get_size(IHTMLInputElement
*iface
, LONG
*p
)
267 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
268 FIXME("(%p)->(%p)\n", This
, p
);
272 static HRESULT WINAPI
HTMLInputElement_put_maxLength(IHTMLInputElement
*iface
, LONG v
)
274 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
275 FIXME("(%p)->(%d)\n", This
, v
);
279 static HRESULT WINAPI
HTMLInputElement_get_maxLength(IHTMLInputElement
*iface
, LONG
*p
)
281 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
282 FIXME("(%p)->(%p)\n", This
, p
);
286 static HRESULT WINAPI
HTMLInputElement_select(IHTMLInputElement
*iface
)
288 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
291 TRACE("(%p)\n", This
);
293 nsres
= nsIDOMHTMLInputElement_Select(This
->nsinput
);
294 if(NS_FAILED(nsres
)) {
295 ERR("Select failed: %08x\n", nsres
);
302 static HRESULT WINAPI
HTMLInputElement_put_onchange(IHTMLInputElement
*iface
, VARIANT v
)
304 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
305 FIXME("(%p)->()\n", This
);
309 static HRESULT WINAPI
HTMLInputElement_get_onchange(IHTMLInputElement
*iface
, VARIANT
*p
)
311 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
312 FIXME("(%p)->(%p)\n", This
, p
);
316 static HRESULT WINAPI
HTMLInputElement_put_onselect(IHTMLInputElement
*iface
, VARIANT v
)
318 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
319 FIXME("(%p)->()\n", This
);
323 static HRESULT WINAPI
HTMLInputElement_get_onselect(IHTMLInputElement
*iface
, VARIANT
*p
)
325 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
326 FIXME("(%p)->(%p)\n", This
, p
);
330 static HRESULT WINAPI
HTMLInputElement_put_defaultValue(IHTMLInputElement
*iface
, BSTR v
)
332 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
333 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
337 static HRESULT WINAPI
HTMLInputElement_get_defaultValue(IHTMLInputElement
*iface
, BSTR
*p
)
339 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
340 FIXME("(%p)->(%p)\n", This
, p
);
344 static HRESULT WINAPI
HTMLInputElement_put_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
346 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
347 FIXME("(%p)->(%x)\n", This
, v
);
351 static HRESULT WINAPI
HTMLInputElement_get_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
353 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
354 FIXME("(%p)->(%p)\n", This
, p
);
358 static HRESULT WINAPI
HTMLInputElement_createTextRange(IHTMLInputElement
*iface
, IHTMLTxtRange
**range
)
360 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
361 FIXME("(%p)->(%p)\n", This
, range
);
365 static HRESULT WINAPI
HTMLInputElement_put_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
367 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
368 FIXME("(%p)->(%x)\n", This
, v
);
372 static HRESULT WINAPI
HTMLInputElement_get_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
374 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
375 FIXME("(%p)->(%p)\n", This
, p
);
379 static HRESULT WINAPI
HTMLInputElement_put_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
381 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
384 TRACE("(%p)->(%x)\n", This
, v
);
386 nsres
= nsIDOMHTMLInputElement_SetDefaultChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
387 if(NS_FAILED(nsres
)) {
388 ERR("SetDefaultChecked failed: %08x\n", nsres
);
395 static HRESULT WINAPI
HTMLInputElement_get_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
397 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
398 cpp_bool default_checked
= FALSE
;
401 TRACE("(%p)->(%p)\n", This
, p
);
403 nsres
= nsIDOMHTMLInputElement_GetDefaultChecked(This
->nsinput
, &default_checked
);
404 if(NS_FAILED(nsres
)) {
405 ERR("GetDefaultChecked failed: %08x\n", nsres
);
409 *p
= default_checked
? VARIANT_TRUE
: VARIANT_FALSE
;
413 static HRESULT WINAPI
HTMLInputElement_put_checked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
415 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
418 TRACE("(%p)->(%x)\n", This
, v
);
420 nsres
= nsIDOMHTMLInputElement_SetChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
421 if(NS_FAILED(nsres
)) {
422 ERR("SetChecked failed: %08x\n", nsres
);
429 static HRESULT WINAPI
HTMLInputElement_get_checked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
431 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
435 TRACE("(%p)->(%p)\n", This
, p
);
437 nsres
= nsIDOMHTMLInputElement_GetChecked(This
->nsinput
, &checked
);
438 if(NS_FAILED(nsres
)) {
439 ERR("GetChecked failed: %08x\n", nsres
);
443 *p
= checked
? VARIANT_TRUE
: VARIANT_FALSE
;
444 TRACE("checked=%x\n", *p
);
448 static HRESULT WINAPI
HTMLInputElement_put_border(IHTMLInputElement
*iface
, VARIANT v
)
450 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
451 FIXME("(%p)->()\n", This
);
455 static HRESULT WINAPI
HTMLInputElement_get_border(IHTMLInputElement
*iface
, VARIANT
*p
)
457 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
458 FIXME("(%p)->(%p)\n", This
, p
);
462 static HRESULT WINAPI
HTMLInputElement_put_vspace(IHTMLInputElement
*iface
, LONG v
)
464 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
465 FIXME("(%p)->(%d)\n", This
, v
);
469 static HRESULT WINAPI
HTMLInputElement_get_vspace(IHTMLInputElement
*iface
, LONG
*p
)
471 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
472 FIXME("(%p)->(%p)\n", This
, p
);
476 static HRESULT WINAPI
HTMLInputElement_put_hspace(IHTMLInputElement
*iface
, LONG v
)
478 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
479 FIXME("(%p)->(%d)\n", This
, v
);
483 static HRESULT WINAPI
HTMLInputElement_get_hspace(IHTMLInputElement
*iface
, LONG
*p
)
485 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
486 FIXME("(%p)->(%p)\n", This
, p
);
490 static HRESULT WINAPI
HTMLInputElement_put_alt(IHTMLInputElement
*iface
, BSTR v
)
492 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
493 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
497 static HRESULT WINAPI
HTMLInputElement_get_alt(IHTMLInputElement
*iface
, BSTR
*p
)
499 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
500 FIXME("(%p)->(%p)\n", This
, p
);
504 static HRESULT WINAPI
HTMLInputElement_put_src(IHTMLInputElement
*iface
, BSTR v
)
506 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
510 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
512 nsAString_InitDepend(&nsstr
, v
);
513 nsres
= nsIDOMHTMLInputElement_SetSrc(This
->nsinput
, &nsstr
);
514 nsAString_Finish(&nsstr
);
516 ERR("SetSrc failed: %08x\n", nsres
);
521 static HRESULT WINAPI
HTMLInputElement_get_src(IHTMLInputElement
*iface
, BSTR
*p
)
523 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
524 const PRUnichar
*src
;
529 TRACE("(%p)->(%p)\n", This
, p
);
531 nsAString_Init(&src_str
, NULL
);
532 nsres
= nsIDOMHTMLInputElement_GetSrc(This
->nsinput
, &src_str
);
533 if(NS_FAILED(nsres
)) {
534 ERR("GetSrc failed: %08x\n", nsres
);
538 nsAString_GetData(&src_str
, &src
);
539 hres
= nsuri_to_url(src
, FALSE
, p
);
540 nsAString_Finish(&src_str
);
545 static HRESULT WINAPI
HTMLInputElement_put_lowsrc(IHTMLInputElement
*iface
, BSTR v
)
547 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
548 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
552 static HRESULT WINAPI
HTMLInputElement_get_lowsrc(IHTMLInputElement
*iface
, BSTR
*p
)
554 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
555 FIXME("(%p)->(%p)\n", This
, p
);
559 static HRESULT WINAPI
HTMLInputElement_put_vrml(IHTMLInputElement
*iface
, BSTR v
)
561 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
562 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
566 static HRESULT WINAPI
HTMLInputElement_get_vrml(IHTMLInputElement
*iface
, BSTR
*p
)
568 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
569 FIXME("(%p)->(%p)\n", This
, p
);
573 static HRESULT WINAPI
HTMLInputElement_put_dynsrc(IHTMLInputElement
*iface
, BSTR v
)
575 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
576 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
580 static HRESULT WINAPI
HTMLInputElement_get_dynsrc(IHTMLInputElement
*iface
, BSTR
*p
)
582 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
583 FIXME("(%p)->(%p)\n", This
, p
);
587 static HRESULT WINAPI
HTMLInputElement_get_readyState(IHTMLInputElement
*iface
, BSTR
*p
)
589 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
590 FIXME("(%p)->(%p)\n", This
, p
);
594 static HRESULT WINAPI
HTMLInputElement_get_complete(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
596 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
597 FIXME("(%p)->(%p)\n", This
, p
);
601 static HRESULT WINAPI
HTMLInputElement_put_loop(IHTMLInputElement
*iface
, VARIANT v
)
603 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
604 FIXME("(%p)->()\n", This
);
608 static HRESULT WINAPI
HTMLInputElement_get_loop(IHTMLInputElement
*iface
, VARIANT
*p
)
610 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
611 FIXME("(%p)->(%p)\n", This
, p
);
615 static HRESULT WINAPI
HTMLInputElement_put_align(IHTMLInputElement
*iface
, BSTR v
)
617 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
618 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
622 static HRESULT WINAPI
HTMLInputElement_get_align(IHTMLInputElement
*iface
, BSTR
*p
)
624 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
625 FIXME("(%p)->(%p)\n", This
, p
);
629 static HRESULT WINAPI
HTMLInputElement_put_onload(IHTMLInputElement
*iface
, VARIANT v
)
631 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
632 FIXME("(%p)->()\n", This
);
636 static HRESULT WINAPI
HTMLInputElement_get_onload(IHTMLInputElement
*iface
, VARIANT
*p
)
638 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
639 FIXME("(%p)->(%p)\n", This
, p
);
643 static HRESULT WINAPI
HTMLInputElement_put_onerror(IHTMLInputElement
*iface
, VARIANT v
)
645 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
646 FIXME("(%p)->()\n", This
);
650 static HRESULT WINAPI
HTMLInputElement_get_onerror(IHTMLInputElement
*iface
, VARIANT
*p
)
652 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
653 FIXME("(%p)->(%p)\n", This
, p
);
657 static HRESULT WINAPI
HTMLInputElement_put_onabort(IHTMLInputElement
*iface
, VARIANT v
)
659 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
660 FIXME("(%p)->()\n", This
);
664 static HRESULT WINAPI
HTMLInputElement_get_onabort(IHTMLInputElement
*iface
, VARIANT
*p
)
666 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
667 FIXME("(%p)->(%p)\n", This
, p
);
671 static HRESULT WINAPI
HTMLInputElement_put_width(IHTMLInputElement
*iface
, LONG v
)
673 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
674 FIXME("(%p)->(%d)\n", This
, v
);
678 static HRESULT WINAPI
HTMLInputElement_get_width(IHTMLInputElement
*iface
, LONG
*p
)
680 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
681 FIXME("(%p)->(%p)\n", This
, p
);
685 static HRESULT WINAPI
HTMLInputElement_put_height(IHTMLInputElement
*iface
, LONG v
)
687 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
688 FIXME("(%p)->(%d)\n", This
, v
);
692 static HRESULT WINAPI
HTMLInputElement_get_height(IHTMLInputElement
*iface
, LONG
*p
)
694 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
695 FIXME("(%p)->(%p)\n", This
, p
);
699 static HRESULT WINAPI
HTMLInputElement_put_start(IHTMLInputElement
*iface
, BSTR v
)
701 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
702 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
706 static HRESULT WINAPI
HTMLInputElement_get_start(IHTMLInputElement
*iface
, BSTR
*p
)
708 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
709 FIXME("(%p)->(%p)\n", This
, p
);
713 static const IHTMLInputElementVtbl HTMLInputElementVtbl
= {
714 HTMLInputElement_QueryInterface
,
715 HTMLInputElement_AddRef
,
716 HTMLInputElement_Release
,
717 HTMLInputElement_GetTypeInfoCount
,
718 HTMLInputElement_GetTypeInfo
,
719 HTMLInputElement_GetIDsOfNames
,
720 HTMLInputElement_Invoke
,
721 HTMLInputElement_put_type
,
722 HTMLInputElement_get_type
,
723 HTMLInputElement_put_value
,
724 HTMLInputElement_get_value
,
725 HTMLInputElement_put_name
,
726 HTMLInputElement_get_name
,
727 HTMLInputElement_put_status
,
728 HTMLInputElement_get_status
,
729 HTMLInputElement_put_disabled
,
730 HTMLInputElement_get_disabled
,
731 HTMLInputElement_get_form
,
732 HTMLInputElement_put_size
,
733 HTMLInputElement_get_size
,
734 HTMLInputElement_put_maxLength
,
735 HTMLInputElement_get_maxLength
,
736 HTMLInputElement_select
,
737 HTMLInputElement_put_onchange
,
738 HTMLInputElement_get_onchange
,
739 HTMLInputElement_put_onselect
,
740 HTMLInputElement_get_onselect
,
741 HTMLInputElement_put_defaultValue
,
742 HTMLInputElement_get_defaultValue
,
743 HTMLInputElement_put_readOnly
,
744 HTMLInputElement_get_readOnly
,
745 HTMLInputElement_createTextRange
,
746 HTMLInputElement_put_indeterminate
,
747 HTMLInputElement_get_indeterminate
,
748 HTMLInputElement_put_defaultChecked
,
749 HTMLInputElement_get_defaultChecked
,
750 HTMLInputElement_put_checked
,
751 HTMLInputElement_get_checked
,
752 HTMLInputElement_put_border
,
753 HTMLInputElement_get_border
,
754 HTMLInputElement_put_vspace
,
755 HTMLInputElement_get_vspace
,
756 HTMLInputElement_put_hspace
,
757 HTMLInputElement_get_hspace
,
758 HTMLInputElement_put_alt
,
759 HTMLInputElement_get_alt
,
760 HTMLInputElement_put_src
,
761 HTMLInputElement_get_src
,
762 HTMLInputElement_put_lowsrc
,
763 HTMLInputElement_get_lowsrc
,
764 HTMLInputElement_put_vrml
,
765 HTMLInputElement_get_vrml
,
766 HTMLInputElement_put_dynsrc
,
767 HTMLInputElement_get_dynsrc
,
768 HTMLInputElement_get_readyState
,
769 HTMLInputElement_get_complete
,
770 HTMLInputElement_put_loop
,
771 HTMLInputElement_get_loop
,
772 HTMLInputElement_put_align
,
773 HTMLInputElement_get_align
,
774 HTMLInputElement_put_onload
,
775 HTMLInputElement_get_onload
,
776 HTMLInputElement_put_onerror
,
777 HTMLInputElement_get_onerror
,
778 HTMLInputElement_put_onabort
,
779 HTMLInputElement_get_onabort
,
780 HTMLInputElement_put_width
,
781 HTMLInputElement_get_width
,
782 HTMLInputElement_put_height
,
783 HTMLInputElement_get_height
,
784 HTMLInputElement_put_start
,
785 HTMLInputElement_get_start
788 static HRESULT WINAPI
HTMLInputTextElement_QueryInterface(IHTMLInputTextElement
*iface
,
789 REFIID riid
, void **ppv
)
791 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
793 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
796 static ULONG WINAPI
HTMLInputTextElement_AddRef(IHTMLInputTextElement
*iface
)
798 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
800 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
803 static ULONG WINAPI
HTMLInputTextElement_Release(IHTMLInputTextElement
*iface
)
805 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
807 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
810 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement
*iface
, UINT
*pctinfo
)
812 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
813 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
816 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement
*iface
, UINT iTInfo
,
817 LCID lcid
, ITypeInfo
**ppTInfo
)
819 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
820 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
824 static HRESULT WINAPI
HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement
*iface
, REFIID riid
,
825 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
827 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
828 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
829 cNames
, lcid
, rgDispId
);
832 static HRESULT WINAPI
HTMLInputTextElement_Invoke(IHTMLInputTextElement
*iface
, DISPID dispIdMember
,
833 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
834 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
836 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
837 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
838 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
841 static HRESULT WINAPI
HTMLInputTextElement_get_type(IHTMLInputTextElement
*iface
, BSTR
*p
)
843 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
845 TRACE("(%p)->(%p)\n", This
, p
);
847 return IHTMLInputElement_get_type(&This
->IHTMLInputElement_iface
, p
);
850 static HRESULT WINAPI
HTMLInputTextElement_put_value(IHTMLInputTextElement
*iface
, BSTR v
)
852 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
854 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
856 return IHTMLInputElement_put_value(&This
->IHTMLInputElement_iface
, v
);
859 static HRESULT WINAPI
HTMLInputTextElement_get_value(IHTMLInputTextElement
*iface
, BSTR
*p
)
861 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
863 TRACE("(%p)->(%p)\n", This
, p
);
865 return IHTMLInputElement_get_value(&This
->IHTMLInputElement_iface
, p
);
868 static HRESULT WINAPI
HTMLInputTextElement_put_name(IHTMLInputTextElement
*iface
, BSTR v
)
870 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
872 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
874 return IHTMLInputElement_put_name(&This
->IHTMLInputElement_iface
, v
);
877 static HRESULT WINAPI
HTMLInputTextElement_get_name(IHTMLInputTextElement
*iface
, BSTR
*p
)
879 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
881 TRACE("(%p)->(%p)\n", This
, p
);
883 return IHTMLInputElement_get_name(&This
->IHTMLInputElement_iface
, p
);
886 static HRESULT WINAPI
HTMLInputTextElement_put_status(IHTMLInputTextElement
*iface
, VARIANT v
)
888 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
889 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
893 static HRESULT WINAPI
HTMLInputTextElement_get_status(IHTMLInputTextElement
*iface
, VARIANT
*p
)
895 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
896 TRACE("(%p)->(%p)\n", This
, p
);
900 static HRESULT WINAPI
HTMLInputTextElement_put_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
902 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
904 TRACE("(%p)->(%x)\n", This
, v
);
906 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
909 static HRESULT WINAPI
HTMLInputTextElement_get_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
911 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
913 TRACE("(%p)->(%p)\n", This
, p
);
915 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
918 static HRESULT WINAPI
HTMLInputTextElement_get_form(IHTMLInputTextElement
*iface
, IHTMLFormElement
**p
)
920 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
922 TRACE("(%p)->(%p)\n", This
, p
);
924 return IHTMLInputElement_get_form(&This
->IHTMLInputElement_iface
, p
);
927 static HRESULT WINAPI
HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement
*iface
, BSTR v
)
929 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
931 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
933 return IHTMLInputElement_put_defaultValue(&This
->IHTMLInputElement_iface
, v
);
936 static HRESULT WINAPI
HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement
*iface
, BSTR
*p
)
938 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
940 TRACE("(%p)->(%p)\n", This
, p
);
942 return IHTMLInputElement_get_defaultValue(&This
->IHTMLInputElement_iface
, p
);
945 static HRESULT WINAPI
HTMLInputTextElement_put_size(IHTMLInputTextElement
*iface
, LONG v
)
947 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
949 TRACE("(%p)->(%d)\n", This
, v
);
951 return IHTMLInputElement_put_size(&This
->IHTMLInputElement_iface
, v
);
954 static HRESULT WINAPI
HTMLInputTextElement_get_size(IHTMLInputTextElement
*iface
, LONG
*p
)
956 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
958 TRACE("(%p)->(%p)\n", This
, p
);
960 return IHTMLInputElement_get_size(&This
->IHTMLInputElement_iface
, p
);
963 static HRESULT WINAPI
HTMLInputTextElement_put_maxLength(IHTMLInputTextElement
*iface
, LONG v
)
965 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
967 TRACE("(%p)->(%d)\n", This
, v
);
969 return IHTMLInputElement_put_maxLength(&This
->IHTMLInputElement_iface
, v
);
972 static HRESULT WINAPI
HTMLInputTextElement_get_maxLength(IHTMLInputTextElement
*iface
, LONG
*p
)
974 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
976 TRACE("(%p)->(%p)\n", This
, p
);
978 return IHTMLInputElement_get_maxLength(&This
->IHTMLInputElement_iface
, p
);
981 static HRESULT WINAPI
HTMLInputTextElement_select(IHTMLInputTextElement
*iface
)
983 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
985 TRACE("(%p)\n", This
);
987 return IHTMLInputElement_select(&This
->IHTMLInputElement_iface
);
990 static HRESULT WINAPI
HTMLInputTextElement_put_onchange(IHTMLInputTextElement
*iface
, VARIANT v
)
992 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
994 TRACE("(%p)->()\n", This
);
996 return IHTMLInputElement_put_onchange(&This
->IHTMLInputElement_iface
, v
);
999 static HRESULT WINAPI
HTMLInputTextElement_get_onchange(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1001 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1003 TRACE("(%p)->(%p)\n", This
, p
);
1005 return IHTMLInputElement_get_onchange(&This
->IHTMLInputElement_iface
, p
);
1008 static HRESULT WINAPI
HTMLInputTextElement_put_onselect(IHTMLInputTextElement
*iface
, VARIANT v
)
1010 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1012 TRACE("(%p)->()\n", This
);
1014 return IHTMLInputElement_put_onselect(&This
->IHTMLInputElement_iface
, v
);
1017 static HRESULT WINAPI
HTMLInputTextElement_get_onselect(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1019 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1021 TRACE("(%p)->(%p)\n", This
, p
);
1023 return IHTMLInputElement_get_onselect(&This
->IHTMLInputElement_iface
, p
);
1026 static HRESULT WINAPI
HTMLInputTextElement_put_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
1028 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1030 TRACE("(%p)->(%x)\n", This
, v
);
1032 return IHTMLInputElement_put_readOnly(&This
->IHTMLInputElement_iface
, v
);
1035 static HRESULT WINAPI
HTMLInputTextElement_get_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
1037 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1039 TRACE("(%p)->(%p)\n", This
, p
);
1041 return IHTMLInputElement_get_readOnly(&This
->IHTMLInputElement_iface
, p
);
1044 static HRESULT WINAPI
HTMLInputTextElement_createTextRange(IHTMLInputTextElement
*iface
, IHTMLTxtRange
**range
)
1046 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1048 TRACE("(%p)->(%p)\n", This
, range
);
1050 return IHTMLInputElement_createTextRange(&This
->IHTMLInputElement_iface
, range
);
1053 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl
= {
1054 HTMLInputTextElement_QueryInterface
,
1055 HTMLInputTextElement_AddRef
,
1056 HTMLInputTextElement_Release
,
1057 HTMLInputTextElement_GetTypeInfoCount
,
1058 HTMLInputTextElement_GetTypeInfo
,
1059 HTMLInputTextElement_GetIDsOfNames
,
1060 HTMLInputTextElement_Invoke
,
1061 HTMLInputTextElement_get_type
,
1062 HTMLInputTextElement_put_value
,
1063 HTMLInputTextElement_get_value
,
1064 HTMLInputTextElement_put_name
,
1065 HTMLInputTextElement_get_name
,
1066 HTMLInputTextElement_put_status
,
1067 HTMLInputTextElement_get_status
,
1068 HTMLInputTextElement_put_disabled
,
1069 HTMLInputTextElement_get_disabled
,
1070 HTMLInputTextElement_get_form
,
1071 HTMLInputTextElement_put_defaultValue
,
1072 HTMLInputTextElement_get_defaultValue
,
1073 HTMLInputTextElement_put_size
,
1074 HTMLInputTextElement_get_size
,
1075 HTMLInputTextElement_put_maxLength
,
1076 HTMLInputTextElement_get_maxLength
,
1077 HTMLInputTextElement_select
,
1078 HTMLInputTextElement_put_onchange
,
1079 HTMLInputTextElement_get_onchange
,
1080 HTMLInputTextElement_put_onselect
,
1081 HTMLInputTextElement_get_onselect
,
1082 HTMLInputTextElement_put_readOnly
,
1083 HTMLInputTextElement_get_readOnly
,
1084 HTMLInputTextElement_createTextRange
1087 static inline HTMLInputElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1089 return CONTAINING_RECORD(iface
, HTMLInputElement
, element
.node
);
1092 static HRESULT
HTMLInputElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1094 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1098 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1099 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1100 *ppv
= &This
->IHTMLInputElement_iface
;
1101 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1102 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1103 *ppv
= &This
->IHTMLInputElement_iface
;
1104 }else if(IsEqualGUID(&IID_IHTMLInputElement
, riid
)) {
1105 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This
, ppv
);
1106 *ppv
= &This
->IHTMLInputElement_iface
;
1107 }else if(IsEqualGUID(&IID_IHTMLInputTextElement
, riid
)) {
1108 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This
, ppv
);
1109 *ppv
= &This
->IHTMLInputTextElement_iface
;
1113 IUnknown_AddRef((IUnknown
*)*ppv
);
1117 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1120 static void HTMLInputElement_destructor(HTMLDOMNode
*iface
)
1122 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1124 nsIDOMHTMLInputElement_Release(This
->nsinput
);
1126 HTMLElement_destructor(&This
->element
.node
);
1129 static HRESULT
HTMLInputElementImpl_fire_event(HTMLDOMNode
*iface
, eventid_t eid
, BOOL
*handled
)
1131 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1133 if(eid
== EVENTID_CLICK
) {
1138 nsres
= nsIDOMHTMLInputElement_Click(This
->nsinput
);
1139 if(NS_FAILED(nsres
)) {
1140 ERR("Click failed: %08x\n", nsres
);
1148 static HRESULT
HTMLInputElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1150 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1151 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
1154 static HRESULT
HTMLInputElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1156 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1157 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
1160 static const NodeImplVtbl HTMLInputElementImplVtbl
= {
1161 HTMLInputElement_QI
,
1162 HTMLInputElement_destructor
,
1164 HTMLElement_get_attr_col
,
1166 HTMLInputElementImpl_fire_event
,
1168 HTMLInputElementImpl_put_disabled
,
1169 HTMLInputElementImpl_get_disabled
,
1172 static const tid_t HTMLInputElement_iface_tids
[] = {
1174 IHTMLInputElement_tid
,
1177 static dispex_static_data_t HTMLInputElement_dispex
= {
1179 DispHTMLInputElement_tid
,
1181 HTMLInputElement_iface_tids
1184 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
1186 HTMLInputElement
*ret
;
1189 ret
= heap_alloc_zero(sizeof(HTMLInputElement
));
1191 return E_OUTOFMEMORY
;
1193 ret
->IHTMLInputElement_iface
.lpVtbl
= &HTMLInputElementVtbl
;
1194 ret
->IHTMLInputTextElement_iface
.lpVtbl
= &HTMLInputTextElementVtbl
;
1195 ret
->element
.node
.vtbl
= &HTMLInputElementImplVtbl
;
1197 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLInputElement
, (void**)&ret
->nsinput
);
1198 if(NS_FAILED(nsres
)) {
1199 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres
);
1204 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLInputElement_dispex
);
1206 *elem
= &ret
->element
;