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
19 #include "mshtml_private.h"
26 IHTMLInputElement IHTMLInputElement_iface
;
27 IHTMLInputTextElement IHTMLInputTextElement_iface
;
29 nsIDOMHTMLInputElement
*nsinput
;
32 static const WCHAR forW
[] = {'f','o','r',0};
34 static inline HTMLInputElement
*impl_from_IHTMLInputElement(IHTMLInputElement
*iface
)
36 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputElement_iface
);
39 static inline HTMLInputElement
*impl_from_IHTMLInputTextElement(IHTMLInputTextElement
*iface
)
41 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputTextElement_iface
);
44 static HRESULT WINAPI
HTMLInputElement_QueryInterface(IHTMLInputElement
*iface
,
45 REFIID riid
, void **ppv
)
47 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
49 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
52 static ULONG WINAPI
HTMLInputElement_AddRef(IHTMLInputElement
*iface
)
54 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
56 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
59 static ULONG WINAPI
HTMLInputElement_Release(IHTMLInputElement
*iface
)
61 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
63 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
66 static HRESULT WINAPI
HTMLInputElement_GetTypeInfoCount(IHTMLInputElement
*iface
, UINT
*pctinfo
)
68 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
70 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
73 static HRESULT WINAPI
HTMLInputElement_GetTypeInfo(IHTMLInputElement
*iface
, UINT iTInfo
,
74 LCID lcid
, ITypeInfo
**ppTInfo
)
76 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
78 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
82 static HRESULT WINAPI
HTMLInputElement_GetIDsOfNames(IHTMLInputElement
*iface
, REFIID riid
,
83 LPOLESTR
*rgszNames
, UINT cNames
,
84 LCID lcid
, DISPID
*rgDispId
)
86 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
88 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
89 cNames
, lcid
, rgDispId
);
92 static HRESULT WINAPI
HTMLInputElement_Invoke(IHTMLInputElement
*iface
, DISPID dispIdMember
,
93 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
94 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
96 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
98 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
99 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
102 static HRESULT WINAPI
HTMLInputElement_put_type(IHTMLInputElement
*iface
, BSTR v
)
104 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
108 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
112 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
114 nsAString_InitDepend(&type_str
, v
);
115 nsres
= nsIDOMHTMLInputElement_SetType(This
->nsinput
, &type_str
);
116 nsAString_Finish(&type_str
);
117 if(NS_FAILED(nsres
)) {
118 ERR("SetType failed: %08x\n", nsres
);
125 static HRESULT WINAPI
HTMLInputElement_get_type(IHTMLInputElement
*iface
, BSTR
*p
)
127 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
131 TRACE("(%p)->(%p)\n", This
, p
);
133 nsAString_Init(&type_str
, NULL
);
134 nsres
= nsIDOMHTMLInputElement_GetType(This
->nsinput
, &type_str
);
135 return return_nsstr(nsres
, &type_str
, p
);
138 static HRESULT WINAPI
HTMLInputElement_put_value(IHTMLInputElement
*iface
, BSTR v
)
140 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
144 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
146 nsAString_InitDepend(&val_str
, v
);
147 nsres
= nsIDOMHTMLInputElement_SetValue(This
->nsinput
, &val_str
);
148 nsAString_Finish(&val_str
);
150 ERR("SetValue failed: %08x\n", nsres
);
155 static HRESULT WINAPI
HTMLInputElement_get_value(IHTMLInputElement
*iface
, BSTR
*p
)
157 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
161 TRACE("(%p)->(%p)\n", This
, p
);
163 nsAString_Init(&value_str
, NULL
);
164 nsres
= nsIDOMHTMLInputElement_GetValue(This
->nsinput
, &value_str
);
165 return return_nsstr(nsres
, &value_str
, p
);
168 static HRESULT WINAPI
HTMLInputElement_put_name(IHTMLInputElement
*iface
, BSTR v
)
170 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
174 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
176 nsAString_InitDepend(&name_str
, v
);
177 nsres
= nsIDOMHTMLInputElement_SetName(This
->nsinput
, &name_str
);
178 nsAString_Finish(&name_str
);
179 if(NS_FAILED(nsres
)) {
180 ERR("SetName failed: %08x\n", nsres
);
187 static HRESULT WINAPI
HTMLInputElement_get_name(IHTMLInputElement
*iface
, BSTR
*p
)
189 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
193 TRACE("(%p)->(%p)\n", This
, p
);
195 nsAString_Init(&name_str
, NULL
);
196 nsres
= nsIDOMHTMLInputElement_GetName(This
->nsinput
, &name_str
);
197 return return_nsstr(nsres
, &name_str
, p
);
200 static HRESULT WINAPI
HTMLInputElement_put_status(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
202 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
203 FIXME("(%p)->(%x)\n", This
, v
);
207 static HRESULT WINAPI
HTMLInputElement_get_status(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
209 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
210 FIXME("(%p)->(%p)\n", This
, p
);
214 static HRESULT WINAPI
HTMLInputElement_put_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
216 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
219 TRACE("(%p)->(%x)\n", This
, v
);
221 nsres
= nsIDOMHTMLInputElement_SetDisabled(This
->nsinput
, v
!= VARIANT_FALSE
);
223 ERR("SetDisabled failed: %08x\n", nsres
);
228 static HRESULT WINAPI
HTMLInputElement_get_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
230 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
231 cpp_bool disabled
= FALSE
;
233 TRACE("(%p)->(%p)\n", This
, p
);
235 nsIDOMHTMLInputElement_GetDisabled(This
->nsinput
, &disabled
);
237 *p
= disabled
? VARIANT_TRUE
: VARIANT_FALSE
;
241 static HRESULT WINAPI
HTMLInputElement_get_form(IHTMLInputElement
*iface
, IHTMLFormElement
**p
)
243 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
244 nsIDOMHTMLFormElement
*nsform
;
249 TRACE("(%p)->(%p)\n", This
, p
);
251 nsres
= nsIDOMHTMLInputElement_GetForm(This
->nsinput
, &nsform
);
252 if (NS_FAILED(nsres
) || nsform
== NULL
) {
253 ERR("GetForm failed: %08x, nsform: %p\n", nsres
, nsform
);
258 hres
= get_node(This
->element
.node
.doc
, (nsIDOMNode
*)nsform
, TRUE
, &node
);
259 nsIDOMHTMLFormElement_Release(nsform
);
263 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
269 static HRESULT WINAPI
HTMLInputElement_put_size(IHTMLInputElement
*iface
, LONG v
)
271 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
275 TRACE("(%p)->(%d)\n", This
, v
);
277 return CTL_E_INVALIDPROPERTYVALUE
;
279 nsres
= nsIDOMHTMLInputElement_SetSize(This
->nsinput
, val
);
280 if (NS_FAILED(nsres
)) {
281 ERR("Set Size(%u) failed: %08x\n", val
, nsres
);
287 static HRESULT WINAPI
HTMLInputElement_get_size(IHTMLInputElement
*iface
, LONG
*p
)
289 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
293 TRACE("(%p)->(%p)\n", This
, p
);
297 nsres
= nsIDOMHTMLInputElement_GetSize(This
->nsinput
, &val
);
298 if (NS_FAILED(nsres
)) {
299 ERR("Get Size failed: %08x\n", nsres
);
306 static HRESULT WINAPI
HTMLInputElement_put_maxLength(IHTMLInputElement
*iface
, LONG v
)
308 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
311 TRACE("(%p)->(%d)\n", This
, v
);
313 nsres
= nsIDOMHTMLInputElement_SetMaxLength(This
->nsinput
, v
);
314 if(NS_FAILED(nsres
)) {
315 /* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
316 FIXME("SetMaxLength failed\n");
323 static HRESULT WINAPI
HTMLInputElement_get_maxLength(IHTMLInputElement
*iface
, LONG
*p
)
325 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
329 TRACE("(%p)->(%p)\n", This
, p
);
331 nsres
= nsIDOMHTMLInputElement_GetMaxLength(This
->nsinput
, &max_length
);
332 assert(nsres
== NS_OK
);
334 /* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
335 *p
= max_length
== -1 ? INT_MAX
: max_length
;
339 static HRESULT WINAPI
HTMLInputElement_select(IHTMLInputElement
*iface
)
341 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
344 TRACE("(%p)\n", This
);
346 nsres
= nsIDOMHTMLInputElement_Select(This
->nsinput
);
347 if(NS_FAILED(nsres
)) {
348 ERR("Select failed: %08x\n", nsres
);
355 static HRESULT WINAPI
HTMLInputElement_put_onchange(IHTMLInputElement
*iface
, VARIANT v
)
357 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
359 TRACE("(%p)->()\n", This
);
361 return set_node_event(&This
->element
.node
, EVENTID_CHANGE
, &v
);
364 static HRESULT WINAPI
HTMLInputElement_get_onchange(IHTMLInputElement
*iface
, VARIANT
*p
)
366 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
368 TRACE("(%p)->(%p)\n", This
, p
);
370 return get_node_event(&This
->element
.node
, EVENTID_CHANGE
, p
);
373 static HRESULT WINAPI
HTMLInputElement_put_onselect(IHTMLInputElement
*iface
, VARIANT v
)
375 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
376 FIXME("(%p)->()\n", This
);
380 static HRESULT WINAPI
HTMLInputElement_get_onselect(IHTMLInputElement
*iface
, VARIANT
*p
)
382 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
383 FIXME("(%p)->(%p)\n", This
, p
);
387 static HRESULT WINAPI
HTMLInputElement_put_defaultValue(IHTMLInputElement
*iface
, BSTR v
)
389 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
393 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
395 nsAString_InitDepend(&nsstr
, v
);
396 nsres
= nsIDOMHTMLInputElement_SetDefaultValue(This
->nsinput
, &nsstr
);
397 nsAString_Finish(&nsstr
);
398 if(NS_FAILED(nsres
)) {
399 ERR("SetValue failed: %08x\n", nsres
);
406 static HRESULT WINAPI
HTMLInputElement_get_defaultValue(IHTMLInputElement
*iface
, BSTR
*p
)
408 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
412 TRACE("(%p)->(%p)\n", This
, p
);
414 nsAString_Init(&nsstr
, NULL
);
415 nsres
= nsIDOMHTMLInputElement_GetDefaultValue(This
->nsinput
, &nsstr
);
416 return return_nsstr(nsres
, &nsstr
, p
);
419 static HRESULT WINAPI
HTMLInputElement_put_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
421 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
424 TRACE("(%p)->(%x)\n", This
, v
);
426 nsres
= nsIDOMHTMLInputElement_SetReadOnly(This
->nsinput
, v
!= VARIANT_FALSE
);
427 if (NS_FAILED(nsres
)) {
428 ERR("Set ReadOnly Failed: %08x\n", nsres
);
434 static HRESULT WINAPI
HTMLInputElement_get_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
436 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
440 TRACE("(%p)->(%p)\n", This
, p
);
442 nsres
= nsIDOMHTMLInputElement_GetReadOnly(This
->nsinput
, &b
);
443 if (NS_FAILED(nsres
)) {
444 ERR("Get ReadOnly Failed: %08x\n", nsres
);
447 *p
= b
? VARIANT_TRUE
: VARIANT_FALSE
;
451 static HRESULT WINAPI
HTMLInputElement_createTextRange(IHTMLInputElement
*iface
, IHTMLTxtRange
**range
)
453 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
454 FIXME("(%p)->(%p)\n", This
, range
);
458 static HRESULT WINAPI
HTMLInputElement_put_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
460 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
461 FIXME("(%p)->(%x)\n", This
, v
);
465 static HRESULT WINAPI
HTMLInputElement_get_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
467 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
468 FIXME("(%p)->(%p)\n", This
, p
);
472 static HRESULT WINAPI
HTMLInputElement_put_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
474 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
477 TRACE("(%p)->(%x)\n", This
, v
);
479 nsres
= nsIDOMHTMLInputElement_SetDefaultChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
480 if(NS_FAILED(nsres
)) {
481 ERR("SetDefaultChecked failed: %08x\n", nsres
);
488 static HRESULT WINAPI
HTMLInputElement_get_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
490 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
491 cpp_bool default_checked
= FALSE
;
494 TRACE("(%p)->(%p)\n", This
, p
);
496 nsres
= nsIDOMHTMLInputElement_GetDefaultChecked(This
->nsinput
, &default_checked
);
497 if(NS_FAILED(nsres
)) {
498 ERR("GetDefaultChecked failed: %08x\n", nsres
);
502 *p
= default_checked
? VARIANT_TRUE
: VARIANT_FALSE
;
506 static HRESULT WINAPI
HTMLInputElement_put_checked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
508 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
511 TRACE("(%p)->(%x)\n", This
, v
);
513 nsres
= nsIDOMHTMLInputElement_SetChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
514 if(NS_FAILED(nsres
)) {
515 ERR("SetChecked failed: %08x\n", nsres
);
522 static HRESULT WINAPI
HTMLInputElement_get_checked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
524 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
528 TRACE("(%p)->(%p)\n", This
, p
);
530 nsres
= nsIDOMHTMLInputElement_GetChecked(This
->nsinput
, &checked
);
531 if(NS_FAILED(nsres
)) {
532 ERR("GetChecked failed: %08x\n", nsres
);
536 *p
= checked
? VARIANT_TRUE
: VARIANT_FALSE
;
537 TRACE("checked=%x\n", *p
);
541 static HRESULT WINAPI
HTMLInputElement_put_border(IHTMLInputElement
*iface
, VARIANT v
)
543 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
544 FIXME("(%p)->()\n", This
);
548 static HRESULT WINAPI
HTMLInputElement_get_border(IHTMLInputElement
*iface
, VARIANT
*p
)
550 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
551 FIXME("(%p)->(%p)\n", This
, p
);
555 static HRESULT WINAPI
HTMLInputElement_put_vspace(IHTMLInputElement
*iface
, LONG v
)
557 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
558 FIXME("(%p)->(%d)\n", This
, v
);
562 static HRESULT WINAPI
HTMLInputElement_get_vspace(IHTMLInputElement
*iface
, LONG
*p
)
564 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
565 FIXME("(%p)->(%p)\n", This
, p
);
569 static HRESULT WINAPI
HTMLInputElement_put_hspace(IHTMLInputElement
*iface
, LONG v
)
571 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
572 FIXME("(%p)->(%d)\n", This
, v
);
576 static HRESULT WINAPI
HTMLInputElement_get_hspace(IHTMLInputElement
*iface
, LONG
*p
)
578 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
579 FIXME("(%p)->(%p)\n", This
, p
);
583 static HRESULT WINAPI
HTMLInputElement_put_alt(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_alt(IHTMLInputElement
*iface
, BSTR
*p
)
592 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
593 FIXME("(%p)->(%p)\n", This
, p
);
597 static HRESULT WINAPI
HTMLInputElement_put_src(IHTMLInputElement
*iface
, BSTR v
)
599 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
603 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
605 nsAString_InitDepend(&nsstr
, v
);
606 nsres
= nsIDOMHTMLInputElement_SetSrc(This
->nsinput
, &nsstr
);
607 nsAString_Finish(&nsstr
);
609 ERR("SetSrc failed: %08x\n", nsres
);
614 static HRESULT WINAPI
HTMLInputElement_get_src(IHTMLInputElement
*iface
, BSTR
*p
)
616 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
617 const PRUnichar
*src
;
622 TRACE("(%p)->(%p)\n", This
, p
);
624 nsAString_Init(&src_str
, NULL
);
625 nsres
= nsIDOMHTMLInputElement_GetSrc(This
->nsinput
, &src_str
);
626 if(NS_FAILED(nsres
)) {
627 ERR("GetSrc failed: %08x\n", nsres
);
631 nsAString_GetData(&src_str
, &src
);
632 hres
= nsuri_to_url(src
, FALSE
, p
);
633 nsAString_Finish(&src_str
);
638 static HRESULT WINAPI
HTMLInputElement_put_lowsrc(IHTMLInputElement
*iface
, BSTR v
)
640 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
641 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
645 static HRESULT WINAPI
HTMLInputElement_get_lowsrc(IHTMLInputElement
*iface
, BSTR
*p
)
647 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
648 FIXME("(%p)->(%p)\n", This
, p
);
652 static HRESULT WINAPI
HTMLInputElement_put_vrml(IHTMLInputElement
*iface
, BSTR v
)
654 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
655 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
659 static HRESULT WINAPI
HTMLInputElement_get_vrml(IHTMLInputElement
*iface
, BSTR
*p
)
661 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
662 FIXME("(%p)->(%p)\n", This
, p
);
666 static HRESULT WINAPI
HTMLInputElement_put_dynsrc(IHTMLInputElement
*iface
, BSTR v
)
668 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
669 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
673 static HRESULT WINAPI
HTMLInputElement_get_dynsrc(IHTMLInputElement
*iface
, BSTR
*p
)
675 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
676 FIXME("(%p)->(%p)\n", This
, p
);
680 static HRESULT WINAPI
HTMLInputElement_get_readyState(IHTMLInputElement
*iface
, BSTR
*p
)
682 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
683 FIXME("(%p)->(%p)\n", This
, p
);
687 static HRESULT WINAPI
HTMLInputElement_get_complete(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
689 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
690 FIXME("(%p)->(%p)\n", This
, p
);
694 static HRESULT WINAPI
HTMLInputElement_put_loop(IHTMLInputElement
*iface
, VARIANT v
)
696 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
697 FIXME("(%p)->()\n", This
);
701 static HRESULT WINAPI
HTMLInputElement_get_loop(IHTMLInputElement
*iface
, VARIANT
*p
)
703 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
704 FIXME("(%p)->(%p)\n", This
, p
);
708 static HRESULT WINAPI
HTMLInputElement_put_align(IHTMLInputElement
*iface
, BSTR v
)
710 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
711 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
715 static HRESULT WINAPI
HTMLInputElement_get_align(IHTMLInputElement
*iface
, BSTR
*p
)
717 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
718 FIXME("(%p)->(%p)\n", This
, p
);
722 static HRESULT WINAPI
HTMLInputElement_put_onload(IHTMLInputElement
*iface
, VARIANT v
)
724 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
725 FIXME("(%p)->()\n", This
);
729 static HRESULT WINAPI
HTMLInputElement_get_onload(IHTMLInputElement
*iface
, VARIANT
*p
)
731 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
732 FIXME("(%p)->(%p)\n", This
, p
);
736 static HRESULT WINAPI
HTMLInputElement_put_onerror(IHTMLInputElement
*iface
, VARIANT v
)
738 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
739 FIXME("(%p)->()\n", This
);
743 static HRESULT WINAPI
HTMLInputElement_get_onerror(IHTMLInputElement
*iface
, VARIANT
*p
)
745 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
746 FIXME("(%p)->(%p)\n", This
, p
);
750 static HRESULT WINAPI
HTMLInputElement_put_onabort(IHTMLInputElement
*iface
, VARIANT v
)
752 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
753 FIXME("(%p)->()\n", This
);
757 static HRESULT WINAPI
HTMLInputElement_get_onabort(IHTMLInputElement
*iface
, VARIANT
*p
)
759 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
760 FIXME("(%p)->(%p)\n", This
, p
);
764 static HRESULT WINAPI
HTMLInputElement_put_width(IHTMLInputElement
*iface
, LONG v
)
766 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
767 FIXME("(%p)->(%d)\n", This
, v
);
771 static HRESULT WINAPI
HTMLInputElement_get_width(IHTMLInputElement
*iface
, LONG
*p
)
773 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
774 FIXME("(%p)->(%p)\n", This
, p
);
778 static HRESULT WINAPI
HTMLInputElement_put_height(IHTMLInputElement
*iface
, LONG v
)
780 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
781 FIXME("(%p)->(%d)\n", This
, v
);
785 static HRESULT WINAPI
HTMLInputElement_get_height(IHTMLInputElement
*iface
, LONG
*p
)
787 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
788 FIXME("(%p)->(%p)\n", This
, p
);
792 static HRESULT WINAPI
HTMLInputElement_put_start(IHTMLInputElement
*iface
, BSTR v
)
794 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
795 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
799 static HRESULT WINAPI
HTMLInputElement_get_start(IHTMLInputElement
*iface
, BSTR
*p
)
801 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
802 FIXME("(%p)->(%p)\n", This
, p
);
806 static const IHTMLInputElementVtbl HTMLInputElementVtbl
= {
807 HTMLInputElement_QueryInterface
,
808 HTMLInputElement_AddRef
,
809 HTMLInputElement_Release
,
810 HTMLInputElement_GetTypeInfoCount
,
811 HTMLInputElement_GetTypeInfo
,
812 HTMLInputElement_GetIDsOfNames
,
813 HTMLInputElement_Invoke
,
814 HTMLInputElement_put_type
,
815 HTMLInputElement_get_type
,
816 HTMLInputElement_put_value
,
817 HTMLInputElement_get_value
,
818 HTMLInputElement_put_name
,
819 HTMLInputElement_get_name
,
820 HTMLInputElement_put_status
,
821 HTMLInputElement_get_status
,
822 HTMLInputElement_put_disabled
,
823 HTMLInputElement_get_disabled
,
824 HTMLInputElement_get_form
,
825 HTMLInputElement_put_size
,
826 HTMLInputElement_get_size
,
827 HTMLInputElement_put_maxLength
,
828 HTMLInputElement_get_maxLength
,
829 HTMLInputElement_select
,
830 HTMLInputElement_put_onchange
,
831 HTMLInputElement_get_onchange
,
832 HTMLInputElement_put_onselect
,
833 HTMLInputElement_get_onselect
,
834 HTMLInputElement_put_defaultValue
,
835 HTMLInputElement_get_defaultValue
,
836 HTMLInputElement_put_readOnly
,
837 HTMLInputElement_get_readOnly
,
838 HTMLInputElement_createTextRange
,
839 HTMLInputElement_put_indeterminate
,
840 HTMLInputElement_get_indeterminate
,
841 HTMLInputElement_put_defaultChecked
,
842 HTMLInputElement_get_defaultChecked
,
843 HTMLInputElement_put_checked
,
844 HTMLInputElement_get_checked
,
845 HTMLInputElement_put_border
,
846 HTMLInputElement_get_border
,
847 HTMLInputElement_put_vspace
,
848 HTMLInputElement_get_vspace
,
849 HTMLInputElement_put_hspace
,
850 HTMLInputElement_get_hspace
,
851 HTMLInputElement_put_alt
,
852 HTMLInputElement_get_alt
,
853 HTMLInputElement_put_src
,
854 HTMLInputElement_get_src
,
855 HTMLInputElement_put_lowsrc
,
856 HTMLInputElement_get_lowsrc
,
857 HTMLInputElement_put_vrml
,
858 HTMLInputElement_get_vrml
,
859 HTMLInputElement_put_dynsrc
,
860 HTMLInputElement_get_dynsrc
,
861 HTMLInputElement_get_readyState
,
862 HTMLInputElement_get_complete
,
863 HTMLInputElement_put_loop
,
864 HTMLInputElement_get_loop
,
865 HTMLInputElement_put_align
,
866 HTMLInputElement_get_align
,
867 HTMLInputElement_put_onload
,
868 HTMLInputElement_get_onload
,
869 HTMLInputElement_put_onerror
,
870 HTMLInputElement_get_onerror
,
871 HTMLInputElement_put_onabort
,
872 HTMLInputElement_get_onabort
,
873 HTMLInputElement_put_width
,
874 HTMLInputElement_get_width
,
875 HTMLInputElement_put_height
,
876 HTMLInputElement_get_height
,
877 HTMLInputElement_put_start
,
878 HTMLInputElement_get_start
881 static HRESULT WINAPI
HTMLInputTextElement_QueryInterface(IHTMLInputTextElement
*iface
,
882 REFIID riid
, void **ppv
)
884 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
886 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
889 static ULONG WINAPI
HTMLInputTextElement_AddRef(IHTMLInputTextElement
*iface
)
891 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
893 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
896 static ULONG WINAPI
HTMLInputTextElement_Release(IHTMLInputTextElement
*iface
)
898 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
900 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
903 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement
*iface
, UINT
*pctinfo
)
905 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
906 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
909 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement
*iface
, UINT iTInfo
,
910 LCID lcid
, ITypeInfo
**ppTInfo
)
912 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
913 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
917 static HRESULT WINAPI
HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement
*iface
, REFIID riid
,
918 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
920 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
921 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
922 cNames
, lcid
, rgDispId
);
925 static HRESULT WINAPI
HTMLInputTextElement_Invoke(IHTMLInputTextElement
*iface
, DISPID dispIdMember
,
926 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
927 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
929 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
930 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
931 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
934 static HRESULT WINAPI
HTMLInputTextElement_get_type(IHTMLInputTextElement
*iface
, BSTR
*p
)
936 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
938 TRACE("(%p)->(%p)\n", This
, p
);
940 return IHTMLInputElement_get_type(&This
->IHTMLInputElement_iface
, p
);
943 static HRESULT WINAPI
HTMLInputTextElement_put_value(IHTMLInputTextElement
*iface
, BSTR v
)
945 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
947 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
949 return IHTMLInputElement_put_value(&This
->IHTMLInputElement_iface
, v
);
952 static HRESULT WINAPI
HTMLInputTextElement_get_value(IHTMLInputTextElement
*iface
, BSTR
*p
)
954 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
956 TRACE("(%p)->(%p)\n", This
, p
);
958 return IHTMLInputElement_get_value(&This
->IHTMLInputElement_iface
, p
);
961 static HRESULT WINAPI
HTMLInputTextElement_put_name(IHTMLInputTextElement
*iface
, BSTR v
)
963 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
965 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
967 return IHTMLInputElement_put_name(&This
->IHTMLInputElement_iface
, v
);
970 static HRESULT WINAPI
HTMLInputTextElement_get_name(IHTMLInputTextElement
*iface
, BSTR
*p
)
972 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
974 TRACE("(%p)->(%p)\n", This
, p
);
976 return IHTMLInputElement_get_name(&This
->IHTMLInputElement_iface
, p
);
979 static HRESULT WINAPI
HTMLInputTextElement_put_status(IHTMLInputTextElement
*iface
, VARIANT v
)
981 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
982 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
986 static HRESULT WINAPI
HTMLInputTextElement_get_status(IHTMLInputTextElement
*iface
, VARIANT
*p
)
988 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
989 TRACE("(%p)->(%p)\n", This
, p
);
993 static HRESULT WINAPI
HTMLInputTextElement_put_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
995 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
997 TRACE("(%p)->(%x)\n", This
, v
);
999 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
1002 static HRESULT WINAPI
HTMLInputTextElement_get_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
1004 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1006 TRACE("(%p)->(%p)\n", This
, p
);
1008 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
1011 static HRESULT WINAPI
HTMLInputTextElement_get_form(IHTMLInputTextElement
*iface
, IHTMLFormElement
**p
)
1013 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1015 TRACE("(%p)->(%p)\n", This
, p
);
1017 return IHTMLInputElement_get_form(&This
->IHTMLInputElement_iface
, p
);
1020 static HRESULT WINAPI
HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement
*iface
, BSTR v
)
1022 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1024 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1026 return IHTMLInputElement_put_defaultValue(&This
->IHTMLInputElement_iface
, v
);
1029 static HRESULT WINAPI
HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement
*iface
, BSTR
*p
)
1031 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1033 TRACE("(%p)->(%p)\n", This
, p
);
1035 return IHTMLInputElement_get_defaultValue(&This
->IHTMLInputElement_iface
, p
);
1038 static HRESULT WINAPI
HTMLInputTextElement_put_size(IHTMLInputTextElement
*iface
, LONG v
)
1040 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1042 TRACE("(%p)->(%d)\n", This
, v
);
1044 return IHTMLInputElement_put_size(&This
->IHTMLInputElement_iface
, v
);
1047 static HRESULT WINAPI
HTMLInputTextElement_get_size(IHTMLInputTextElement
*iface
, LONG
*p
)
1049 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1051 TRACE("(%p)->(%p)\n", This
, p
);
1053 return IHTMLInputElement_get_size(&This
->IHTMLInputElement_iface
, p
);
1056 static HRESULT WINAPI
HTMLInputTextElement_put_maxLength(IHTMLInputTextElement
*iface
, LONG v
)
1058 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1060 TRACE("(%p)->(%d)\n", This
, v
);
1062 return IHTMLInputElement_put_maxLength(&This
->IHTMLInputElement_iface
, v
);
1065 static HRESULT WINAPI
HTMLInputTextElement_get_maxLength(IHTMLInputTextElement
*iface
, LONG
*p
)
1067 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1069 TRACE("(%p)->(%p)\n", This
, p
);
1071 return IHTMLInputElement_get_maxLength(&This
->IHTMLInputElement_iface
, p
);
1074 static HRESULT WINAPI
HTMLInputTextElement_select(IHTMLInputTextElement
*iface
)
1076 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1078 TRACE("(%p)\n", This
);
1080 return IHTMLInputElement_select(&This
->IHTMLInputElement_iface
);
1083 static HRESULT WINAPI
HTMLInputTextElement_put_onchange(IHTMLInputTextElement
*iface
, VARIANT v
)
1085 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1087 TRACE("(%p)->()\n", This
);
1089 return IHTMLInputElement_put_onchange(&This
->IHTMLInputElement_iface
, v
);
1092 static HRESULT WINAPI
HTMLInputTextElement_get_onchange(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1094 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1096 TRACE("(%p)->(%p)\n", This
, p
);
1098 return IHTMLInputElement_get_onchange(&This
->IHTMLInputElement_iface
, p
);
1101 static HRESULT WINAPI
HTMLInputTextElement_put_onselect(IHTMLInputTextElement
*iface
, VARIANT v
)
1103 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1105 TRACE("(%p)->()\n", This
);
1107 return IHTMLInputElement_put_onselect(&This
->IHTMLInputElement_iface
, v
);
1110 static HRESULT WINAPI
HTMLInputTextElement_get_onselect(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1112 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1114 TRACE("(%p)->(%p)\n", This
, p
);
1116 return IHTMLInputElement_get_onselect(&This
->IHTMLInputElement_iface
, p
);
1119 static HRESULT WINAPI
HTMLInputTextElement_put_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
1121 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1123 TRACE("(%p)->(%x)\n", This
, v
);
1125 return IHTMLInputElement_put_readOnly(&This
->IHTMLInputElement_iface
, v
);
1128 static HRESULT WINAPI
HTMLInputTextElement_get_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
1130 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1132 TRACE("(%p)->(%p)\n", This
, p
);
1134 return IHTMLInputElement_get_readOnly(&This
->IHTMLInputElement_iface
, p
);
1137 static HRESULT WINAPI
HTMLInputTextElement_createTextRange(IHTMLInputTextElement
*iface
, IHTMLTxtRange
**range
)
1139 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1141 TRACE("(%p)->(%p)\n", This
, range
);
1143 return IHTMLInputElement_createTextRange(&This
->IHTMLInputElement_iface
, range
);
1146 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl
= {
1147 HTMLInputTextElement_QueryInterface
,
1148 HTMLInputTextElement_AddRef
,
1149 HTMLInputTextElement_Release
,
1150 HTMLInputTextElement_GetTypeInfoCount
,
1151 HTMLInputTextElement_GetTypeInfo
,
1152 HTMLInputTextElement_GetIDsOfNames
,
1153 HTMLInputTextElement_Invoke
,
1154 HTMLInputTextElement_get_type
,
1155 HTMLInputTextElement_put_value
,
1156 HTMLInputTextElement_get_value
,
1157 HTMLInputTextElement_put_name
,
1158 HTMLInputTextElement_get_name
,
1159 HTMLInputTextElement_put_status
,
1160 HTMLInputTextElement_get_status
,
1161 HTMLInputTextElement_put_disabled
,
1162 HTMLInputTextElement_get_disabled
,
1163 HTMLInputTextElement_get_form
,
1164 HTMLInputTextElement_put_defaultValue
,
1165 HTMLInputTextElement_get_defaultValue
,
1166 HTMLInputTextElement_put_size
,
1167 HTMLInputTextElement_get_size
,
1168 HTMLInputTextElement_put_maxLength
,
1169 HTMLInputTextElement_get_maxLength
,
1170 HTMLInputTextElement_select
,
1171 HTMLInputTextElement_put_onchange
,
1172 HTMLInputTextElement_get_onchange
,
1173 HTMLInputTextElement_put_onselect
,
1174 HTMLInputTextElement_get_onselect
,
1175 HTMLInputTextElement_put_readOnly
,
1176 HTMLInputTextElement_get_readOnly
,
1177 HTMLInputTextElement_createTextRange
1180 static inline HTMLInputElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1182 return CONTAINING_RECORD(iface
, HTMLInputElement
, element
.node
);
1185 static HRESULT
HTMLInputElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1187 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1191 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1192 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1193 *ppv
= &This
->IHTMLInputElement_iface
;
1194 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1195 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1196 *ppv
= &This
->IHTMLInputElement_iface
;
1197 }else if(IsEqualGUID(&IID_IHTMLInputElement
, riid
)) {
1198 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This
, ppv
);
1199 *ppv
= &This
->IHTMLInputElement_iface
;
1200 }else if(IsEqualGUID(&IID_IHTMLInputTextElement
, riid
)) {
1201 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This
, ppv
);
1202 *ppv
= &This
->IHTMLInputTextElement_iface
;
1206 IUnknown_AddRef((IUnknown
*)*ppv
);
1210 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1213 static HRESULT
HTMLInputElementImpl_fire_event(HTMLDOMNode
*iface
, eventid_t eid
, BOOL
*handled
)
1215 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1217 if(eid
== EVENTID_CLICK
) {
1222 nsres
= nsIDOMHTMLInputElement_Click(This
->nsinput
);
1223 if(NS_FAILED(nsres
)) {
1224 ERR("Click failed: %08x\n", nsres
);
1232 static HRESULT
HTMLInputElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1234 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1235 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
1238 static HRESULT
HTMLInputElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1240 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1241 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
1244 static const NodeImplVtbl HTMLInputElementImplVtbl
= {
1245 HTMLInputElement_QI
,
1246 HTMLElement_destructor
,
1249 HTMLElement_handle_event
,
1250 HTMLElement_get_attr_col
,
1252 HTMLInputElementImpl_fire_event
,
1253 HTMLInputElementImpl_put_disabled
,
1254 HTMLInputElementImpl_get_disabled
,
1257 static const tid_t HTMLInputElement_iface_tids
[] = {
1259 IHTMLInputElement_tid
,
1262 static dispex_static_data_t HTMLInputElement_dispex
= {
1264 DispHTMLInputElement_tid
,
1266 HTMLInputElement_iface_tids
1269 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
1271 HTMLInputElement
*ret
;
1274 ret
= heap_alloc_zero(sizeof(HTMLInputElement
));
1276 return E_OUTOFMEMORY
;
1278 ret
->IHTMLInputElement_iface
.lpVtbl
= &HTMLInputElementVtbl
;
1279 ret
->IHTMLInputTextElement_iface
.lpVtbl
= &HTMLInputTextElementVtbl
;
1280 ret
->element
.node
.vtbl
= &HTMLInputElementImplVtbl
;
1282 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLInputElement_dispex
);
1284 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLInputElement
, (void**)&ret
->nsinput
);
1286 /* Share nsinput reference with nsnode */
1287 assert(nsres
== NS_OK
&& (nsIDOMNode
*)ret
->nsinput
== ret
->element
.node
.nsnode
);
1288 nsIDOMNode_Release(ret
->element
.node
.nsnode
);
1290 *elem
= &ret
->element
;
1295 HTMLElement element
;
1297 IHTMLLabelElement IHTMLLabelElement_iface
;
1300 static inline HTMLLabelElement
*impl_from_IHTMLLabelElement(IHTMLLabelElement
*iface
)
1302 return CONTAINING_RECORD(iface
, HTMLLabelElement
, IHTMLLabelElement_iface
);
1305 static HRESULT WINAPI
HTMLLabelElement_QueryInterface(IHTMLLabelElement
*iface
,
1306 REFIID riid
, void **ppv
)
1308 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1310 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1313 static ULONG WINAPI
HTMLLabelElement_AddRef(IHTMLLabelElement
*iface
)
1315 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1317 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1320 static ULONG WINAPI
HTMLLabelElement_Release(IHTMLLabelElement
*iface
)
1322 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1324 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1327 static HRESULT WINAPI
HTMLLabelElement_GetTypeInfoCount(IHTMLLabelElement
*iface
, UINT
*pctinfo
)
1329 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1331 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
1334 static HRESULT WINAPI
HTMLLabelElement_GetTypeInfo(IHTMLLabelElement
*iface
, UINT iTInfo
,
1335 LCID lcid
, ITypeInfo
**ppTInfo
)
1337 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1339 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1342 static HRESULT WINAPI
HTMLLabelElement_GetIDsOfNames(IHTMLLabelElement
*iface
, REFIID riid
,
1343 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1345 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1347 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1348 cNames
, lcid
, rgDispId
);
1351 static HRESULT WINAPI
HTMLLabelElement_Invoke(IHTMLLabelElement
*iface
, DISPID dispIdMember
,
1352 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1353 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1355 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1357 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1358 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1361 static HRESULT WINAPI
HTMLLabelElement_put_htmlFor(IHTMLLabelElement
*iface
, BSTR v
)
1363 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1364 nsAString for_str
, val_str
;
1367 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1369 nsAString_InitDepend(&for_str
, forW
);
1370 nsAString_InitDepend(&val_str
, v
);
1371 nsres
= nsIDOMHTMLElement_SetAttribute(This
->element
.nselem
, &for_str
, &val_str
);
1372 nsAString_Finish(&for_str
);
1373 nsAString_Finish(&val_str
);
1374 if(NS_FAILED(nsres
)) {
1375 ERR("SetAttribute failed: %08x\n", nsres
);
1382 static HRESULT WINAPI
HTMLLabelElement_get_htmlFor(IHTMLLabelElement
*iface
, BSTR
*p
)
1384 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1386 TRACE("(%p)->(%p)\n", This
, p
);
1388 return elem_string_attr_getter(&This
->element
, forW
, FALSE
, p
);
1391 static HRESULT WINAPI
HTMLLabelElement_put_accessKey(IHTMLLabelElement
*iface
, BSTR v
)
1393 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1394 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1398 static HRESULT WINAPI
HTMLLabelElement_get_accessKey(IHTMLLabelElement
*iface
, BSTR
*p
)
1400 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1401 FIXME("(%p)->(%p)\n", This
, p
);
1405 static const IHTMLLabelElementVtbl HTMLLabelElementVtbl
= {
1406 HTMLLabelElement_QueryInterface
,
1407 HTMLLabelElement_AddRef
,
1408 HTMLLabelElement_Release
,
1409 HTMLLabelElement_GetTypeInfoCount
,
1410 HTMLLabelElement_GetTypeInfo
,
1411 HTMLLabelElement_GetIDsOfNames
,
1412 HTMLLabelElement_Invoke
,
1413 HTMLLabelElement_put_htmlFor
,
1414 HTMLLabelElement_get_htmlFor
,
1415 HTMLLabelElement_put_accessKey
,
1416 HTMLLabelElement_get_accessKey
1419 static inline HTMLLabelElement
*label_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1421 return CONTAINING_RECORD(iface
, HTMLLabelElement
, element
.node
);
1424 static HRESULT
HTMLLabelElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1426 HTMLLabelElement
*This
= label_from_HTMLDOMNode(iface
);
1430 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1431 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1432 *ppv
= &This
->IHTMLLabelElement_iface
;
1433 }else if(IsEqualGUID(&IID_IHTMLLabelElement
, riid
)) {
1434 TRACE("(%p)->(IID_IHTMLLabelElement %p)\n", This
, ppv
);
1435 *ppv
= &This
->IHTMLLabelElement_iface
;
1437 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1440 IUnknown_AddRef((IUnknown
*)*ppv
);
1444 static const NodeImplVtbl HTMLLabelElementImplVtbl
= {
1445 HTMLLabelElement_QI
,
1446 HTMLElement_destructor
,
1449 HTMLElement_handle_event
,
1450 HTMLElement_get_attr_col
,
1453 static const tid_t HTMLLabelElement_iface_tids
[] = {
1455 IHTMLLabelElement_tid
,
1459 static dispex_static_data_t HTMLLabelElement_dispex
= {
1461 DispHTMLLabelElement_tid
,
1463 HTMLLabelElement_iface_tids
1466 HRESULT
HTMLLabelElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
1468 HTMLLabelElement
*ret
;
1470 ret
= heap_alloc_zero(sizeof(*ret
));
1472 return E_OUTOFMEMORY
;
1474 ret
->IHTMLLabelElement_iface
.lpVtbl
= &HTMLLabelElementVtbl
;
1475 ret
->element
.node
.vtbl
= &HTMLLabelElementImplVtbl
;
1477 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLLabelElement_dispex
);
1478 *elem
= &ret
->element
;
1483 HTMLElement element
;
1485 IHTMLButtonElement IHTMLButtonElement_iface
;
1487 nsIDOMHTMLButtonElement
*nsbutton
;
1488 } HTMLButtonElement
;
1490 static inline HTMLButtonElement
*impl_from_IHTMLButtonElement(IHTMLButtonElement
*iface
)
1492 return CONTAINING_RECORD(iface
, HTMLButtonElement
, IHTMLButtonElement_iface
);
1495 static HRESULT WINAPI
HTMLButtonElement_QueryInterface(IHTMLButtonElement
*iface
,
1496 REFIID riid
, void **ppv
)
1498 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1500 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1503 static ULONG WINAPI
HTMLButtonElement_AddRef(IHTMLButtonElement
*iface
)
1505 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1507 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1510 static ULONG WINAPI
HTMLButtonElement_Release(IHTMLButtonElement
*iface
)
1512 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1514 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1517 static HRESULT WINAPI
HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement
*iface
, UINT
*pctinfo
)
1519 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1521 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
1524 static HRESULT WINAPI
HTMLButtonElement_GetTypeInfo(IHTMLButtonElement
*iface
, UINT iTInfo
,
1525 LCID lcid
, ITypeInfo
**ppTInfo
)
1527 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1529 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1532 static HRESULT WINAPI
HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement
*iface
, REFIID riid
,
1533 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1535 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1537 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1538 cNames
, lcid
, rgDispId
);
1541 static HRESULT WINAPI
HTMLButtonElement_Invoke(IHTMLButtonElement
*iface
, DISPID dispIdMember
,
1542 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1543 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1545 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1547 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1548 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1551 static HRESULT WINAPI
HTMLButtonElement_get_type(IHTMLButtonElement
*iface
, BSTR
*p
)
1553 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1554 FIXME("(%p)->(%p)\n", This
, p
);
1558 static HRESULT WINAPI
HTMLButtonElement_put_value(IHTMLButtonElement
*iface
, BSTR v
)
1560 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1561 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1565 static HRESULT WINAPI
HTMLButtonElement_get_value(IHTMLButtonElement
*iface
, BSTR
*p
)
1567 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1568 FIXME("(%p)->(%p)\n", This
, p
);
1572 static HRESULT WINAPI
HTMLButtonElement_put_name(IHTMLButtonElement
*iface
, BSTR v
)
1574 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1578 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1580 nsAString_InitDepend(&name_str
, v
);
1581 nsres
= nsIDOMHTMLButtonElement_SetName(This
->nsbutton
, &name_str
);
1582 nsAString_Finish(&name_str
);
1583 if(NS_FAILED(nsres
)) {
1584 ERR("SetName failed: %08x\n", nsres
);
1591 static HRESULT WINAPI
HTMLButtonElement_get_name(IHTMLButtonElement
*iface
, BSTR
*p
)
1593 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1597 TRACE("(%p)->(%p)\n", This
, p
);
1599 nsAString_Init(&name_str
, NULL
);
1600 nsres
= nsIDOMHTMLButtonElement_GetName(This
->nsbutton
, &name_str
);
1601 return return_nsstr(nsres
, &name_str
, p
);
1604 static HRESULT WINAPI
HTMLButtonElement_put_status(IHTMLButtonElement
*iface
, VARIANT v
)
1606 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1607 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1611 static HRESULT WINAPI
HTMLButtonElement_get_status(IHTMLButtonElement
*iface
, VARIANT
*p
)
1613 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1614 FIXME("(%p)->(%p)\n", This
, p
);
1618 static HRESULT WINAPI
HTMLButtonElement_put_disabled(IHTMLButtonElement
*iface
, VARIANT_BOOL v
)
1620 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1623 TRACE("(%p)->(%x)\n", This
, v
);
1625 nsres
= nsIDOMHTMLButtonElement_SetDisabled(This
->nsbutton
, !!v
);
1626 if(NS_FAILED(nsres
)) {
1627 ERR("SetDisabled failed: %08x\n", nsres
);
1634 static HRESULT WINAPI
HTMLButtonElement_get_disabled(IHTMLButtonElement
*iface
, VARIANT_BOOL
*p
)
1636 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1640 TRACE("(%p)->(%p)\n", This
, p
);
1642 nsres
= nsIDOMHTMLButtonElement_GetDisabled(This
->nsbutton
, &disabled
);
1643 if(NS_FAILED(nsres
)) {
1644 ERR("GetDisabled failed: %08x\n", nsres
);
1648 *p
= disabled
? VARIANT_TRUE
: VARIANT_FALSE
;
1652 static HRESULT WINAPI
HTMLButtonElement_get_form(IHTMLButtonElement
*iface
, IHTMLFormElement
**p
)
1654 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1655 FIXME("(%p)->(%p)\n", This
, p
);
1659 static HRESULT WINAPI
HTMLButtonElement_createTextRange(IHTMLButtonElement
*iface
, IHTMLTxtRange
**range
)
1661 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1662 FIXME("(%p)->(%p)\n", This
, range
);
1666 static const IHTMLButtonElementVtbl HTMLButtonElementVtbl
= {
1667 HTMLButtonElement_QueryInterface
,
1668 HTMLButtonElement_AddRef
,
1669 HTMLButtonElement_Release
,
1670 HTMLButtonElement_GetTypeInfoCount
,
1671 HTMLButtonElement_GetTypeInfo
,
1672 HTMLButtonElement_GetIDsOfNames
,
1673 HTMLButtonElement_Invoke
,
1674 HTMLButtonElement_get_type
,
1675 HTMLButtonElement_put_value
,
1676 HTMLButtonElement_get_value
,
1677 HTMLButtonElement_put_name
,
1678 HTMLButtonElement_get_name
,
1679 HTMLButtonElement_put_status
,
1680 HTMLButtonElement_get_status
,
1681 HTMLButtonElement_put_disabled
,
1682 HTMLButtonElement_get_disabled
,
1683 HTMLButtonElement_get_form
,
1684 HTMLButtonElement_createTextRange
1687 static inline HTMLButtonElement
*button_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1689 return CONTAINING_RECORD(iface
, HTMLButtonElement
, element
.node
);
1692 static HRESULT
HTMLButtonElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1694 HTMLButtonElement
*This
= button_from_HTMLDOMNode(iface
);
1698 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1699 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1700 *ppv
= &This
->IHTMLButtonElement_iface
;
1701 }else if(IsEqualGUID(&IID_IHTMLButtonElement
, riid
)) {
1702 TRACE("(%p)->(IID_IHTMLButtonElement %p)\n", This
, ppv
);
1703 *ppv
= &This
->IHTMLButtonElement_iface
;
1705 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1708 IUnknown_AddRef((IUnknown
*)*ppv
);
1712 static HRESULT
HTMLButtonElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1714 HTMLButtonElement
*This
= button_from_HTMLDOMNode(iface
);
1715 return IHTMLButtonElement_put_disabled(&This
->IHTMLButtonElement_iface
, v
);
1718 static HRESULT
HTMLButtonElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1720 HTMLButtonElement
*This
= button_from_HTMLDOMNode(iface
);
1721 return IHTMLButtonElement_get_disabled(&This
->IHTMLButtonElement_iface
, p
);
1724 static const NodeImplVtbl HTMLButtonElementImplVtbl
= {
1725 HTMLButtonElement_QI
,
1726 HTMLElement_destructor
,
1729 HTMLElement_handle_event
,
1730 HTMLElement_get_attr_col
,
1733 HTMLButtonElementImpl_put_disabled
,
1734 HTMLButtonElementImpl_get_disabled
1737 static const tid_t HTMLButtonElement_iface_tids
[] = {
1739 IHTMLButtonElement_tid
,
1743 static dispex_static_data_t HTMLButtonElement_dispex
= {
1745 DispHTMLButtonElement_tid
,
1747 HTMLButtonElement_iface_tids
1750 HRESULT
HTMLButtonElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
1752 HTMLButtonElement
*ret
;
1755 ret
= heap_alloc_zero(sizeof(*ret
));
1757 return E_OUTOFMEMORY
;
1759 ret
->IHTMLButtonElement_iface
.lpVtbl
= &HTMLButtonElementVtbl
;
1760 ret
->element
.node
.vtbl
= &HTMLButtonElementImplVtbl
;
1762 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLButtonElement_dispex
);
1764 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLButtonElement
, (void**)&ret
->nsbutton
);
1766 /* Share nsbutton reference with nsnode */
1767 assert(nsres
== NS_OK
&& (nsIDOMNode
*)ret
->nsbutton
== ret
->element
.node
.nsnode
);
1768 nsIDOMNode_Release(ret
->element
.node
.nsnode
);
1770 *elem
= &ret
->element
;