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
);
36 struct HTMLInputElement
{
39 IHTMLInputElement IHTMLInputElement_iface
;
40 IHTMLInputTextElement IHTMLInputTextElement_iface
;
41 IHTMLInputTextElement2 IHTMLInputTextElement2_iface
;
43 nsIDOMHTMLInputElement
*nsinput
;
46 static inline HTMLInputElement
*impl_from_IHTMLInputElement(IHTMLInputElement
*iface
)
48 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputElement_iface
);
51 static inline HTMLInputElement
*impl_from_IHTMLInputTextElement(IHTMLInputTextElement
*iface
)
53 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputTextElement_iface
);
56 static HRESULT WINAPI
HTMLInputElement_QueryInterface(IHTMLInputElement
*iface
,
57 REFIID riid
, void **ppv
)
59 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
61 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
64 static ULONG WINAPI
HTMLInputElement_AddRef(IHTMLInputElement
*iface
)
66 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
68 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
71 static ULONG WINAPI
HTMLInputElement_Release(IHTMLInputElement
*iface
)
73 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
75 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
78 static HRESULT WINAPI
HTMLInputElement_GetTypeInfoCount(IHTMLInputElement
*iface
, UINT
*pctinfo
)
80 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
82 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
85 static HRESULT WINAPI
HTMLInputElement_GetTypeInfo(IHTMLInputElement
*iface
, UINT iTInfo
,
86 LCID lcid
, ITypeInfo
**ppTInfo
)
88 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
90 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
94 static HRESULT WINAPI
HTMLInputElement_GetIDsOfNames(IHTMLInputElement
*iface
, REFIID riid
,
95 LPOLESTR
*rgszNames
, UINT cNames
,
96 LCID lcid
, DISPID
*rgDispId
)
98 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
100 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
101 cNames
, lcid
, rgDispId
);
104 static HRESULT WINAPI
HTMLInputElement_Invoke(IHTMLInputElement
*iface
, DISPID dispIdMember
,
105 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
106 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
108 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
110 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
111 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
114 static HRESULT WINAPI
HTMLInputElement_put_type(IHTMLInputElement
*iface
, BSTR v
)
116 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
120 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
124 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
126 nsAString_InitDepend(&type_str
, v
);
127 nsres
= nsIDOMHTMLInputElement_SetType(This
->nsinput
, &type_str
);
128 nsAString_Finish(&type_str
);
129 if(NS_FAILED(nsres
)) {
130 ERR("SetType failed: %08lx\n", nsres
);
137 static HRESULT WINAPI
HTMLInputElement_get_type(IHTMLInputElement
*iface
, BSTR
*p
)
139 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
143 TRACE("(%p)->(%p)\n", This
, p
);
145 nsAString_Init(&type_str
, NULL
);
146 nsres
= nsIDOMHTMLInputElement_GetType(This
->nsinput
, &type_str
);
147 return return_nsstr(nsres
, &type_str
, p
);
150 static HRESULT WINAPI
HTMLInputElement_put_value(IHTMLInputElement
*iface
, BSTR v
)
152 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
156 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
158 nsAString_InitDepend(&val_str
, v
);
159 nsres
= nsIDOMHTMLInputElement_SetValue(This
->nsinput
, &val_str
);
160 nsAString_Finish(&val_str
);
162 ERR("SetValue failed: %08lx\n", nsres
);
167 static HRESULT WINAPI
HTMLInputElement_get_value(IHTMLInputElement
*iface
, BSTR
*p
)
169 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
173 TRACE("(%p)->(%p)\n", This
, p
);
175 nsAString_Init(&value_str
, NULL
);
176 nsres
= nsIDOMHTMLInputElement_GetValue(This
->nsinput
, &value_str
);
177 return return_nsstr(nsres
, &value_str
, p
);
180 static HRESULT WINAPI
HTMLInputElement_put_name(IHTMLInputElement
*iface
, BSTR v
)
182 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
186 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
188 nsAString_InitDepend(&name_str
, v
);
189 nsres
= nsIDOMHTMLInputElement_SetName(This
->nsinput
, &name_str
);
190 nsAString_Finish(&name_str
);
191 if(NS_FAILED(nsres
)) {
192 ERR("SetName failed: %08lx\n", nsres
);
199 static HRESULT WINAPI
HTMLInputElement_get_name(IHTMLInputElement
*iface
, BSTR
*p
)
201 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
205 TRACE("(%p)->(%p)\n", This
, p
);
207 nsAString_Init(&name_str
, NULL
);
208 nsres
= nsIDOMHTMLInputElement_GetName(This
->nsinput
, &name_str
);
209 return return_nsstr(nsres
, &name_str
, p
);
212 static HRESULT WINAPI
HTMLInputElement_put_status(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
214 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
215 FIXME("(%p)->(%x)\n", This
, v
);
219 static HRESULT WINAPI
HTMLInputElement_get_status(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
221 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
222 FIXME("(%p)->(%p)\n", This
, p
);
226 static HRESULT WINAPI
HTMLInputElement_put_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
228 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
231 TRACE("(%p)->(%x)\n", This
, v
);
233 nsres
= nsIDOMHTMLInputElement_SetDisabled(This
->nsinput
, v
!= VARIANT_FALSE
);
235 ERR("SetDisabled failed: %08lx\n", nsres
);
240 static HRESULT WINAPI
HTMLInputElement_get_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
242 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
243 cpp_bool disabled
= FALSE
;
245 TRACE("(%p)->(%p)\n", This
, p
);
247 nsIDOMHTMLInputElement_GetDisabled(This
->nsinput
, &disabled
);
249 *p
= variant_bool(disabled
);
253 static HRESULT WINAPI
HTMLInputElement_get_form(IHTMLInputElement
*iface
, IHTMLFormElement
**p
)
255 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
256 nsIDOMHTMLFormElement
*nsform
;
259 TRACE("(%p)->(%p)\n", This
, p
);
261 nsres
= nsIDOMHTMLInputElement_GetForm(This
->nsinput
, &nsform
);
262 return return_nsform(nsres
, nsform
, p
);
265 static HRESULT WINAPI
HTMLInputElement_put_size(IHTMLInputElement
*iface
, LONG v
)
267 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
271 TRACE("(%p)->(%ld)\n", This
, v
);
273 return CTL_E_INVALIDPROPERTYVALUE
;
275 nsres
= nsIDOMHTMLInputElement_SetSize(This
->nsinput
, val
);
276 if (NS_FAILED(nsres
)) {
277 ERR("Set Size(%u) failed: %08lx\n", val
, nsres
);
283 static HRESULT WINAPI
HTMLInputElement_get_size(IHTMLInputElement
*iface
, LONG
*p
)
285 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
289 TRACE("(%p)->(%p)\n", This
, p
);
293 nsres
= nsIDOMHTMLInputElement_GetSize(This
->nsinput
, &val
);
294 if (NS_FAILED(nsres
)) {
295 ERR("Get Size failed: %08lx\n", nsres
);
302 static HRESULT WINAPI
HTMLInputElement_put_maxLength(IHTMLInputElement
*iface
, LONG v
)
304 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
307 TRACE("(%p)->(%ld)\n", This
, v
);
309 nsres
= nsIDOMHTMLInputElement_SetMaxLength(This
->nsinput
, v
);
310 if(NS_FAILED(nsres
)) {
311 /* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
312 FIXME("SetMaxLength failed\n");
319 static HRESULT WINAPI
HTMLInputElement_get_maxLength(IHTMLInputElement
*iface
, LONG
*p
)
321 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
325 TRACE("(%p)->(%p)\n", This
, p
);
327 nsres
= nsIDOMHTMLInputElement_GetMaxLength(This
->nsinput
, &max_length
);
328 assert(nsres
== NS_OK
);
330 /* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
331 *p
= max_length
== -1 ? INT_MAX
: max_length
;
335 static HRESULT WINAPI
HTMLInputElement_select(IHTMLInputElement
*iface
)
337 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
340 TRACE("(%p)\n", This
);
342 nsres
= nsIDOMHTMLInputElement_Select(This
->nsinput
);
343 if(NS_FAILED(nsres
)) {
344 ERR("Select failed: %08lx\n", nsres
);
351 static HRESULT WINAPI
HTMLInputElement_put_onchange(IHTMLInputElement
*iface
, VARIANT v
)
353 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
355 TRACE("(%p)->()\n", This
);
357 return set_node_event(&This
->element
.node
, EVENTID_CHANGE
, &v
);
360 static HRESULT WINAPI
HTMLInputElement_get_onchange(IHTMLInputElement
*iface
, VARIANT
*p
)
362 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
364 TRACE("(%p)->(%p)\n", This
, p
);
366 return get_node_event(&This
->element
.node
, EVENTID_CHANGE
, p
);
369 static HRESULT WINAPI
HTMLInputElement_put_onselect(IHTMLInputElement
*iface
, VARIANT v
)
371 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
372 FIXME("(%p)->()\n", This
);
376 static HRESULT WINAPI
HTMLInputElement_get_onselect(IHTMLInputElement
*iface
, VARIANT
*p
)
378 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
379 FIXME("(%p)->(%p)\n", This
, p
);
383 static HRESULT WINAPI
HTMLInputElement_put_defaultValue(IHTMLInputElement
*iface
, BSTR v
)
385 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
389 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
391 nsAString_InitDepend(&nsstr
, v
);
392 nsres
= nsIDOMHTMLInputElement_SetDefaultValue(This
->nsinput
, &nsstr
);
393 nsAString_Finish(&nsstr
);
394 if(NS_FAILED(nsres
)) {
395 ERR("SetValue failed: %08lx\n", nsres
);
402 static HRESULT WINAPI
HTMLInputElement_get_defaultValue(IHTMLInputElement
*iface
, BSTR
*p
)
404 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
408 TRACE("(%p)->(%p)\n", This
, p
);
410 nsAString_Init(&nsstr
, NULL
);
411 nsres
= nsIDOMHTMLInputElement_GetDefaultValue(This
->nsinput
, &nsstr
);
412 return return_nsstr(nsres
, &nsstr
, p
);
415 static HRESULT WINAPI
HTMLInputElement_put_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
417 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
420 TRACE("(%p)->(%x)\n", This
, v
);
422 nsres
= nsIDOMHTMLInputElement_SetReadOnly(This
->nsinput
, v
!= VARIANT_FALSE
);
423 if (NS_FAILED(nsres
)) {
424 ERR("Set ReadOnly Failed: %08lx\n", nsres
);
430 static HRESULT WINAPI
HTMLInputElement_get_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
432 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
436 TRACE("(%p)->(%p)\n", This
, p
);
438 nsres
= nsIDOMHTMLInputElement_GetReadOnly(This
->nsinput
, &b
);
439 if (NS_FAILED(nsres
)) {
440 ERR("Get ReadOnly Failed: %08lx\n", nsres
);
444 *p
= variant_bool(b
);
448 static HRESULT WINAPI
HTMLInputElement_createTextRange(IHTMLInputElement
*iface
, IHTMLTxtRange
**range
)
450 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
451 FIXME("(%p)->(%p)\n", This
, range
);
455 static HRESULT WINAPI
HTMLInputElement_put_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
457 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
458 FIXME("(%p)->(%x)\n", This
, v
);
462 static HRESULT WINAPI
HTMLInputElement_get_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
464 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
465 FIXME("(%p)->(%p)\n", This
, p
);
469 static HRESULT WINAPI
HTMLInputElement_put_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
471 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
474 TRACE("(%p)->(%x)\n", This
, v
);
476 nsres
= nsIDOMHTMLInputElement_SetDefaultChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
477 if(NS_FAILED(nsres
)) {
478 ERR("SetDefaultChecked failed: %08lx\n", nsres
);
485 static HRESULT WINAPI
HTMLInputElement_get_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
487 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
488 cpp_bool default_checked
= FALSE
;
491 TRACE("(%p)->(%p)\n", This
, p
);
493 nsres
= nsIDOMHTMLInputElement_GetDefaultChecked(This
->nsinput
, &default_checked
);
494 if(NS_FAILED(nsres
)) {
495 ERR("GetDefaultChecked failed: %08lx\n", nsres
);
499 *p
= variant_bool(default_checked
);
503 static HRESULT WINAPI
HTMLInputElement_put_checked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
505 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
508 TRACE("(%p)->(%x)\n", This
, v
);
510 nsres
= nsIDOMHTMLInputElement_SetChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
511 if(NS_FAILED(nsres
)) {
512 ERR("SetChecked failed: %08lx\n", nsres
);
519 static HRESULT WINAPI
HTMLInputElement_get_checked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
521 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
525 TRACE("(%p)->(%p)\n", This
, p
);
527 nsres
= nsIDOMHTMLInputElement_GetChecked(This
->nsinput
, &checked
);
528 if(NS_FAILED(nsres
)) {
529 ERR("GetChecked failed: %08lx\n", nsres
);
533 *p
= variant_bool(checked
);
534 TRACE("checked=%x\n", *p
);
538 static HRESULT WINAPI
HTMLInputElement_put_border(IHTMLInputElement
*iface
, VARIANT v
)
540 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
541 FIXME("(%p)->()\n", This
);
545 static HRESULT WINAPI
HTMLInputElement_get_border(IHTMLInputElement
*iface
, VARIANT
*p
)
547 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
548 FIXME("(%p)->(%p)\n", This
, p
);
552 static HRESULT WINAPI
HTMLInputElement_put_vspace(IHTMLInputElement
*iface
, LONG v
)
554 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
555 FIXME("(%p)->(%ld)\n", This
, v
);
559 static HRESULT WINAPI
HTMLInputElement_get_vspace(IHTMLInputElement
*iface
, LONG
*p
)
561 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
562 FIXME("(%p)->(%p)\n", This
, p
);
566 static HRESULT WINAPI
HTMLInputElement_put_hspace(IHTMLInputElement
*iface
, LONG v
)
568 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
569 FIXME("(%p)->(%ld)\n", This
, v
);
573 static HRESULT WINAPI
HTMLInputElement_get_hspace(IHTMLInputElement
*iface
, LONG
*p
)
575 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
576 FIXME("(%p)->(%p)\n", This
, p
);
580 static HRESULT WINAPI
HTMLInputElement_put_alt(IHTMLInputElement
*iface
, BSTR v
)
582 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
583 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
587 static HRESULT WINAPI
HTMLInputElement_get_alt(IHTMLInputElement
*iface
, BSTR
*p
)
589 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
590 FIXME("(%p)->(%p)\n", This
, p
);
594 static HRESULT WINAPI
HTMLInputElement_put_src(IHTMLInputElement
*iface
, BSTR v
)
596 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
600 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
602 nsAString_InitDepend(&nsstr
, v
);
603 nsres
= nsIDOMHTMLInputElement_SetSrc(This
->nsinput
, &nsstr
);
604 nsAString_Finish(&nsstr
);
606 ERR("SetSrc failed: %08lx\n", nsres
);
611 static HRESULT WINAPI
HTMLInputElement_get_src(IHTMLInputElement
*iface
, BSTR
*p
)
613 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
614 const PRUnichar
*src
;
619 TRACE("(%p)->(%p)\n", This
, p
);
621 nsAString_Init(&src_str
, NULL
);
622 nsres
= nsIDOMHTMLInputElement_GetSrc(This
->nsinput
, &src_str
);
623 if(NS_FAILED(nsres
)) {
624 ERR("GetSrc failed: %08lx\n", nsres
);
628 nsAString_GetData(&src_str
, &src
);
629 hres
= nsuri_to_url(src
, FALSE
, p
);
630 nsAString_Finish(&src_str
);
635 static HRESULT WINAPI
HTMLInputElement_put_lowsrc(IHTMLInputElement
*iface
, BSTR v
)
637 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
638 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
642 static HRESULT WINAPI
HTMLInputElement_get_lowsrc(IHTMLInputElement
*iface
, BSTR
*p
)
644 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
645 FIXME("(%p)->(%p)\n", This
, p
);
649 static HRESULT WINAPI
HTMLInputElement_put_vrml(IHTMLInputElement
*iface
, BSTR v
)
651 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
652 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
656 static HRESULT WINAPI
HTMLInputElement_get_vrml(IHTMLInputElement
*iface
, BSTR
*p
)
658 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
659 FIXME("(%p)->(%p)\n", This
, p
);
663 static HRESULT WINAPI
HTMLInputElement_put_dynsrc(IHTMLInputElement
*iface
, BSTR v
)
665 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
666 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
670 static HRESULT WINAPI
HTMLInputElement_get_dynsrc(IHTMLInputElement
*iface
, BSTR
*p
)
672 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
673 FIXME("(%p)->(%p)\n", This
, p
);
677 static HRESULT WINAPI
HTMLInputElement_get_readyState(IHTMLInputElement
*iface
, BSTR
*p
)
679 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
680 FIXME("(%p)->(%p)\n", This
, p
);
684 static HRESULT WINAPI
HTMLInputElement_get_complete(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
686 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
690 TRACE("(%p)->(%p)\n", This
, p
);
692 nsres
= nsIDOMHTMLInputElement_GetComplete(This
->nsinput
, &complete
);
694 return map_nsresult(nsres
);
696 *p
= variant_bool(complete
);
700 static HRESULT WINAPI
HTMLInputElement_put_loop(IHTMLInputElement
*iface
, VARIANT v
)
702 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
703 FIXME("(%p)->()\n", This
);
707 static HRESULT WINAPI
HTMLInputElement_get_loop(IHTMLInputElement
*iface
, VARIANT
*p
)
709 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
710 FIXME("(%p)->(%p)\n", This
, p
);
714 static HRESULT WINAPI
HTMLInputElement_put_align(IHTMLInputElement
*iface
, BSTR v
)
716 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
717 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
721 static HRESULT WINAPI
HTMLInputElement_get_align(IHTMLInputElement
*iface
, BSTR
*p
)
723 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
724 FIXME("(%p)->(%p)\n", This
, p
);
728 static HRESULT WINAPI
HTMLInputElement_put_onload(IHTMLInputElement
*iface
, VARIANT v
)
730 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
732 TRACE("(%p)->()\n", This
);
734 return set_node_event(&This
->element
.node
, EVENTID_LOAD
, &v
);
737 static HRESULT WINAPI
HTMLInputElement_get_onload(IHTMLInputElement
*iface
, VARIANT
*p
)
739 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
741 TRACE("(%p)->(%p)\n", This
, p
);
743 return get_node_event(&This
->element
.node
, EVENTID_LOAD
, p
);
746 static HRESULT WINAPI
HTMLInputElement_put_onerror(IHTMLInputElement
*iface
, VARIANT v
)
748 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
749 FIXME("(%p)->()\n", This
);
753 static HRESULT WINAPI
HTMLInputElement_get_onerror(IHTMLInputElement
*iface
, VARIANT
*p
)
755 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
756 FIXME("(%p)->(%p)\n", This
, p
);
760 static HRESULT WINAPI
HTMLInputElement_put_onabort(IHTMLInputElement
*iface
, VARIANT v
)
762 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
763 FIXME("(%p)->()\n", This
);
767 static HRESULT WINAPI
HTMLInputElement_get_onabort(IHTMLInputElement
*iface
, VARIANT
*p
)
769 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
770 FIXME("(%p)->(%p)\n", This
, p
);
774 static HRESULT WINAPI
HTMLInputElement_put_width(IHTMLInputElement
*iface
, LONG v
)
776 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
777 FIXME("(%p)->(%ld)\n", This
, v
);
781 static HRESULT WINAPI
HTMLInputElement_get_width(IHTMLInputElement
*iface
, LONG
*p
)
783 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
784 FIXME("(%p)->(%p)\n", This
, p
);
788 static HRESULT WINAPI
HTMLInputElement_put_height(IHTMLInputElement
*iface
, LONG v
)
790 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
791 FIXME("(%p)->(%ld)\n", This
, v
);
795 static HRESULT WINAPI
HTMLInputElement_get_height(IHTMLInputElement
*iface
, LONG
*p
)
797 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
798 FIXME("(%p)->(%p)\n", This
, p
);
802 static HRESULT WINAPI
HTMLInputElement_put_start(IHTMLInputElement
*iface
, BSTR v
)
804 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
805 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
809 static HRESULT WINAPI
HTMLInputElement_get_start(IHTMLInputElement
*iface
, BSTR
*p
)
811 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
812 FIXME("(%p)->(%p)\n", This
, p
);
816 static const IHTMLInputElementVtbl HTMLInputElementVtbl
= {
817 HTMLInputElement_QueryInterface
,
818 HTMLInputElement_AddRef
,
819 HTMLInputElement_Release
,
820 HTMLInputElement_GetTypeInfoCount
,
821 HTMLInputElement_GetTypeInfo
,
822 HTMLInputElement_GetIDsOfNames
,
823 HTMLInputElement_Invoke
,
824 HTMLInputElement_put_type
,
825 HTMLInputElement_get_type
,
826 HTMLInputElement_put_value
,
827 HTMLInputElement_get_value
,
828 HTMLInputElement_put_name
,
829 HTMLInputElement_get_name
,
830 HTMLInputElement_put_status
,
831 HTMLInputElement_get_status
,
832 HTMLInputElement_put_disabled
,
833 HTMLInputElement_get_disabled
,
834 HTMLInputElement_get_form
,
835 HTMLInputElement_put_size
,
836 HTMLInputElement_get_size
,
837 HTMLInputElement_put_maxLength
,
838 HTMLInputElement_get_maxLength
,
839 HTMLInputElement_select
,
840 HTMLInputElement_put_onchange
,
841 HTMLInputElement_get_onchange
,
842 HTMLInputElement_put_onselect
,
843 HTMLInputElement_get_onselect
,
844 HTMLInputElement_put_defaultValue
,
845 HTMLInputElement_get_defaultValue
,
846 HTMLInputElement_put_readOnly
,
847 HTMLInputElement_get_readOnly
,
848 HTMLInputElement_createTextRange
,
849 HTMLInputElement_put_indeterminate
,
850 HTMLInputElement_get_indeterminate
,
851 HTMLInputElement_put_defaultChecked
,
852 HTMLInputElement_get_defaultChecked
,
853 HTMLInputElement_put_checked
,
854 HTMLInputElement_get_checked
,
855 HTMLInputElement_put_border
,
856 HTMLInputElement_get_border
,
857 HTMLInputElement_put_vspace
,
858 HTMLInputElement_get_vspace
,
859 HTMLInputElement_put_hspace
,
860 HTMLInputElement_get_hspace
,
861 HTMLInputElement_put_alt
,
862 HTMLInputElement_get_alt
,
863 HTMLInputElement_put_src
,
864 HTMLInputElement_get_src
,
865 HTMLInputElement_put_lowsrc
,
866 HTMLInputElement_get_lowsrc
,
867 HTMLInputElement_put_vrml
,
868 HTMLInputElement_get_vrml
,
869 HTMLInputElement_put_dynsrc
,
870 HTMLInputElement_get_dynsrc
,
871 HTMLInputElement_get_readyState
,
872 HTMLInputElement_get_complete
,
873 HTMLInputElement_put_loop
,
874 HTMLInputElement_get_loop
,
875 HTMLInputElement_put_align
,
876 HTMLInputElement_get_align
,
877 HTMLInputElement_put_onload
,
878 HTMLInputElement_get_onload
,
879 HTMLInputElement_put_onerror
,
880 HTMLInputElement_get_onerror
,
881 HTMLInputElement_put_onabort
,
882 HTMLInputElement_get_onabort
,
883 HTMLInputElement_put_width
,
884 HTMLInputElement_get_width
,
885 HTMLInputElement_put_height
,
886 HTMLInputElement_get_height
,
887 HTMLInputElement_put_start
,
888 HTMLInputElement_get_start
891 static HRESULT WINAPI
HTMLInputTextElement_QueryInterface(IHTMLInputTextElement
*iface
,
892 REFIID riid
, void **ppv
)
894 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
896 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
899 static ULONG WINAPI
HTMLInputTextElement_AddRef(IHTMLInputTextElement
*iface
)
901 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
903 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
906 static ULONG WINAPI
HTMLInputTextElement_Release(IHTMLInputTextElement
*iface
)
908 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
910 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
913 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement
*iface
, UINT
*pctinfo
)
915 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
916 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
919 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement
*iface
, UINT iTInfo
,
920 LCID lcid
, ITypeInfo
**ppTInfo
)
922 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
923 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
927 static HRESULT WINAPI
HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement
*iface
, REFIID riid
,
928 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
930 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
931 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
932 cNames
, lcid
, rgDispId
);
935 static HRESULT WINAPI
HTMLInputTextElement_Invoke(IHTMLInputTextElement
*iface
, DISPID dispIdMember
,
936 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
937 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
939 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
940 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
941 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
944 static HRESULT WINAPI
HTMLInputTextElement_get_type(IHTMLInputTextElement
*iface
, BSTR
*p
)
946 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
948 TRACE("(%p)->(%p)\n", This
, p
);
950 return IHTMLInputElement_get_type(&This
->IHTMLInputElement_iface
, p
);
953 static HRESULT WINAPI
HTMLInputTextElement_put_value(IHTMLInputTextElement
*iface
, BSTR v
)
955 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
957 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
959 return IHTMLInputElement_put_value(&This
->IHTMLInputElement_iface
, v
);
962 static HRESULT WINAPI
HTMLInputTextElement_get_value(IHTMLInputTextElement
*iface
, BSTR
*p
)
964 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
966 TRACE("(%p)->(%p)\n", This
, p
);
968 return IHTMLInputElement_get_value(&This
->IHTMLInputElement_iface
, p
);
971 static HRESULT WINAPI
HTMLInputTextElement_put_name(IHTMLInputTextElement
*iface
, BSTR v
)
973 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
975 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
977 return IHTMLInputElement_put_name(&This
->IHTMLInputElement_iface
, v
);
980 static HRESULT WINAPI
HTMLInputTextElement_get_name(IHTMLInputTextElement
*iface
, BSTR
*p
)
982 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
984 TRACE("(%p)->(%p)\n", This
, p
);
986 return IHTMLInputElement_get_name(&This
->IHTMLInputElement_iface
, p
);
989 static HRESULT WINAPI
HTMLInputTextElement_put_status(IHTMLInputTextElement
*iface
, VARIANT v
)
991 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
992 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
996 static HRESULT WINAPI
HTMLInputTextElement_get_status(IHTMLInputTextElement
*iface
, VARIANT
*p
)
998 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
999 TRACE("(%p)->(%p)\n", This
, p
);
1003 static HRESULT WINAPI
HTMLInputTextElement_put_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
1005 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1007 TRACE("(%p)->(%x)\n", This
, v
);
1009 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
1012 static HRESULT WINAPI
HTMLInputTextElement_get_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
1014 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1016 TRACE("(%p)->(%p)\n", This
, p
);
1018 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
1021 static HRESULT WINAPI
HTMLInputTextElement_get_form(IHTMLInputTextElement
*iface
, IHTMLFormElement
**p
)
1023 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1025 TRACE("(%p)->(%p)\n", This
, p
);
1027 return IHTMLInputElement_get_form(&This
->IHTMLInputElement_iface
, p
);
1030 static HRESULT WINAPI
HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement
*iface
, BSTR v
)
1032 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1034 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1036 return IHTMLInputElement_put_defaultValue(&This
->IHTMLInputElement_iface
, v
);
1039 static HRESULT WINAPI
HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement
*iface
, BSTR
*p
)
1041 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1043 TRACE("(%p)->(%p)\n", This
, p
);
1045 return IHTMLInputElement_get_defaultValue(&This
->IHTMLInputElement_iface
, p
);
1048 static HRESULT WINAPI
HTMLInputTextElement_put_size(IHTMLInputTextElement
*iface
, LONG v
)
1050 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1052 TRACE("(%p)->(%ld)\n", This
, v
);
1054 return IHTMLInputElement_put_size(&This
->IHTMLInputElement_iface
, v
);
1057 static HRESULT WINAPI
HTMLInputTextElement_get_size(IHTMLInputTextElement
*iface
, LONG
*p
)
1059 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1061 TRACE("(%p)->(%p)\n", This
, p
);
1063 return IHTMLInputElement_get_size(&This
->IHTMLInputElement_iface
, p
);
1066 static HRESULT WINAPI
HTMLInputTextElement_put_maxLength(IHTMLInputTextElement
*iface
, LONG v
)
1068 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1070 TRACE("(%p)->(%ld)\n", This
, v
);
1072 return IHTMLInputElement_put_maxLength(&This
->IHTMLInputElement_iface
, v
);
1075 static HRESULT WINAPI
HTMLInputTextElement_get_maxLength(IHTMLInputTextElement
*iface
, LONG
*p
)
1077 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1079 TRACE("(%p)->(%p)\n", This
, p
);
1081 return IHTMLInputElement_get_maxLength(&This
->IHTMLInputElement_iface
, p
);
1084 static HRESULT WINAPI
HTMLInputTextElement_select(IHTMLInputTextElement
*iface
)
1086 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1088 TRACE("(%p)\n", This
);
1090 return IHTMLInputElement_select(&This
->IHTMLInputElement_iface
);
1093 static HRESULT WINAPI
HTMLInputTextElement_put_onchange(IHTMLInputTextElement
*iface
, VARIANT v
)
1095 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1097 TRACE("(%p)->()\n", This
);
1099 return IHTMLInputElement_put_onchange(&This
->IHTMLInputElement_iface
, v
);
1102 static HRESULT WINAPI
HTMLInputTextElement_get_onchange(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1104 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1106 TRACE("(%p)->(%p)\n", This
, p
);
1108 return IHTMLInputElement_get_onchange(&This
->IHTMLInputElement_iface
, p
);
1111 static HRESULT WINAPI
HTMLInputTextElement_put_onselect(IHTMLInputTextElement
*iface
, VARIANT v
)
1113 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1115 TRACE("(%p)->()\n", This
);
1117 return IHTMLInputElement_put_onselect(&This
->IHTMLInputElement_iface
, v
);
1120 static HRESULT WINAPI
HTMLInputTextElement_get_onselect(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1122 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1124 TRACE("(%p)->(%p)\n", This
, p
);
1126 return IHTMLInputElement_get_onselect(&This
->IHTMLInputElement_iface
, p
);
1129 static HRESULT WINAPI
HTMLInputTextElement_put_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
1131 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1133 TRACE("(%p)->(%x)\n", This
, v
);
1135 return IHTMLInputElement_put_readOnly(&This
->IHTMLInputElement_iface
, v
);
1138 static HRESULT WINAPI
HTMLInputTextElement_get_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
1140 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1142 TRACE("(%p)->(%p)\n", This
, p
);
1144 return IHTMLInputElement_get_readOnly(&This
->IHTMLInputElement_iface
, p
);
1147 static HRESULT WINAPI
HTMLInputTextElement_createTextRange(IHTMLInputTextElement
*iface
, IHTMLTxtRange
**range
)
1149 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1151 TRACE("(%p)->(%p)\n", This
, range
);
1153 return IHTMLInputElement_createTextRange(&This
->IHTMLInputElement_iface
, range
);
1156 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl
= {
1157 HTMLInputTextElement_QueryInterface
,
1158 HTMLInputTextElement_AddRef
,
1159 HTMLInputTextElement_Release
,
1160 HTMLInputTextElement_GetTypeInfoCount
,
1161 HTMLInputTextElement_GetTypeInfo
,
1162 HTMLInputTextElement_GetIDsOfNames
,
1163 HTMLInputTextElement_Invoke
,
1164 HTMLInputTextElement_get_type
,
1165 HTMLInputTextElement_put_value
,
1166 HTMLInputTextElement_get_value
,
1167 HTMLInputTextElement_put_name
,
1168 HTMLInputTextElement_get_name
,
1169 HTMLInputTextElement_put_status
,
1170 HTMLInputTextElement_get_status
,
1171 HTMLInputTextElement_put_disabled
,
1172 HTMLInputTextElement_get_disabled
,
1173 HTMLInputTextElement_get_form
,
1174 HTMLInputTextElement_put_defaultValue
,
1175 HTMLInputTextElement_get_defaultValue
,
1176 HTMLInputTextElement_put_size
,
1177 HTMLInputTextElement_get_size
,
1178 HTMLInputTextElement_put_maxLength
,
1179 HTMLInputTextElement_get_maxLength
,
1180 HTMLInputTextElement_select
,
1181 HTMLInputTextElement_put_onchange
,
1182 HTMLInputTextElement_get_onchange
,
1183 HTMLInputTextElement_put_onselect
,
1184 HTMLInputTextElement_get_onselect
,
1185 HTMLInputTextElement_put_readOnly
,
1186 HTMLInputTextElement_get_readOnly
,
1187 HTMLInputTextElement_createTextRange
1190 static inline HTMLInputElement
*impl_from_IHTMLInputTextElement2(IHTMLInputTextElement2
*iface
)
1192 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputTextElement2_iface
);
1195 static HRESULT WINAPI
HTMLInputTextElement2_QueryInterface(IHTMLInputTextElement2
*iface
, REFIID riid
, void **ppv
)
1197 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1198 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1201 static ULONG WINAPI
HTMLInputTextElement2_AddRef(IHTMLInputTextElement2
*iface
)
1203 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1204 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1207 static ULONG WINAPI
HTMLInputTextElement2_Release(IHTMLInputTextElement2
*iface
)
1209 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1210 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1213 static HRESULT WINAPI
HTMLInputTextElement2_GetTypeInfoCount(IHTMLInputTextElement2
*iface
, UINT
*pctinfo
)
1215 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1216 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1219 static HRESULT WINAPI
HTMLInputTextElement2_GetTypeInfo(IHTMLInputTextElement2
*iface
, UINT iTInfo
,
1220 LCID lcid
, ITypeInfo
**ppTInfo
)
1222 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1223 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1226 static HRESULT WINAPI
HTMLInputTextElement2_GetIDsOfNames(IHTMLInputTextElement2
*iface
, REFIID riid
,
1227 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1229 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1230 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1231 cNames
, lcid
, rgDispId
);
1234 static HRESULT WINAPI
HTMLInputTextElement2_Invoke(IHTMLInputTextElement2
*iface
, DISPID dispIdMember
,
1235 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1236 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1238 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1239 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1240 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1243 static HRESULT WINAPI
HTMLInputTextElement2_put_selectionStart(IHTMLInputTextElement2
*iface
, LONG v
)
1245 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1248 TRACE("(%p)->(%ld)\n", This
, v
);
1250 nsres
= nsIDOMHTMLInputElement_SetSelectionStart(This
->nsinput
, v
);
1251 if(NS_FAILED(nsres
)) {
1252 ERR("SetSelectionStart failed: %08lx\n", nsres
);
1258 static HRESULT WINAPI
HTMLInputTextElement2_get_selectionStart(IHTMLInputTextElement2
*iface
, LONG
*p
)
1260 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1261 LONG selection_start
;
1264 TRACE("(%p)->(%p)\n", This
, p
);
1266 nsres
= nsIDOMHTMLInputElement_GetSelectionStart(This
->nsinput
, &selection_start
);
1267 if(NS_FAILED(nsres
)) {
1268 ERR("GetSelectionStart failed: %08lx\n", nsres
);
1272 *p
= selection_start
;
1276 static HRESULT WINAPI
HTMLInputTextElement2_put_selectionEnd(IHTMLInputTextElement2
*iface
, LONG v
)
1278 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1281 TRACE("(%p)->(%ld)\n", This
, v
);
1283 nsres
= nsIDOMHTMLInputElement_SetSelectionEnd(This
->nsinput
, v
);
1284 if(NS_FAILED(nsres
)) {
1285 ERR("SetSelectionEnd failed: %08lx\n", nsres
);
1291 static HRESULT WINAPI
HTMLInputTextElement2_get_selectionEnd(IHTMLInputTextElement2
*iface
, LONG
*p
)
1293 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1297 TRACE("(%p)->(%p)\n", This
, p
);
1299 nsres
= nsIDOMHTMLInputElement_GetSelectionEnd(This
->nsinput
, &selection_end
);
1300 if(NS_FAILED(nsres
)) {
1301 ERR("GetSelectionEnd failed: %08lx\n", nsres
);
1309 static HRESULT WINAPI
HTMLInputTextElement2_setSelectionRange(IHTMLInputTextElement2
*iface
, LONG start
, LONG end
)
1311 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement2(iface
);
1315 TRACE("(%p)->(%ld %ld)\n", This
, start
, end
);
1317 nsAString_InitDepend(&none_str
, L
"none");
1318 nsres
= nsIDOMHTMLInputElement_SetSelectionRange(This
->nsinput
, start
, end
, &none_str
);
1319 nsAString_Finish(&none_str
);
1320 if(NS_FAILED(nsres
)) {
1321 ERR("SetSelectionRange failed: %08lx\n", nsres
);
1327 static const IHTMLInputTextElement2Vtbl HTMLInputTextElement2Vtbl
= {
1328 HTMLInputTextElement2_QueryInterface
,
1329 HTMLInputTextElement2_AddRef
,
1330 HTMLInputTextElement2_Release
,
1331 HTMLInputTextElement2_GetTypeInfoCount
,
1332 HTMLInputTextElement2_GetTypeInfo
,
1333 HTMLInputTextElement2_GetIDsOfNames
,
1334 HTMLInputTextElement2_Invoke
,
1335 HTMLInputTextElement2_put_selectionStart
,
1336 HTMLInputTextElement2_get_selectionStart
,
1337 HTMLInputTextElement2_put_selectionEnd
,
1338 HTMLInputTextElement2_get_selectionEnd
,
1339 HTMLInputTextElement2_setSelectionRange
1342 static inline HTMLInputElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1344 return CONTAINING_RECORD(iface
, HTMLInputElement
, element
.node
);
1347 static HRESULT
HTMLInputElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1349 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1350 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
1353 static HRESULT
HTMLInputElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1355 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1356 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
1359 static BOOL
HTMLInputElement_is_text_edit(HTMLDOMNode
*iface
)
1361 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1362 const PRUnichar
*type
;
1367 nsAString_Init(&nsstr
, NULL
);
1368 nsres
= nsIDOMHTMLInputElement_GetType(This
->nsinput
, &nsstr
);
1369 if(NS_SUCCEEDED(nsres
)) {
1370 nsAString_GetData(&nsstr
, &type
);
1371 ret
= !wcscmp(type
, L
"button") || !wcscmp(type
, L
"hidden") || !wcscmp(type
, L
"password")
1372 || !wcscmp(type
, L
"reset") || !wcscmp(type
, L
"submit") || !wcscmp(type
, L
"text");
1374 nsAString_Finish(&nsstr
);
1378 static inline HTMLInputElement
*input_from_DispatchEx(DispatchEx
*iface
)
1380 return CONTAINING_RECORD(iface
, HTMLInputElement
, element
.node
.event_target
.dispex
);
1383 static void *HTMLInputElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
1385 HTMLInputElement
*This
= input_from_DispatchEx(dispex
);
1387 if(IsEqualGUID(&IID_IHTMLInputElement
, riid
))
1388 return &This
->IHTMLInputElement_iface
;
1389 if(IsEqualGUID(&IID_IHTMLInputTextElement
, riid
))
1390 return &This
->IHTMLInputTextElement_iface
;
1391 if(IsEqualGUID(&IID_IHTMLInputTextElement2
, riid
))
1392 return &This
->IHTMLInputTextElement2_iface
;
1394 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
1397 static void HTMLInputElement_traverse(DispatchEx
*dispex
, nsCycleCollectionTraversalCallback
*cb
)
1399 HTMLInputElement
*This
= input_from_DispatchEx(dispex
);
1400 HTMLDOMNode_traverse(dispex
, cb
);
1403 note_cc_edge((nsISupports
*)This
->nsinput
, "nsinput", cb
);
1406 static void HTMLInputElement_unlink(DispatchEx
*dispex
)
1408 HTMLInputElement
*This
= input_from_DispatchEx(dispex
);
1409 HTMLDOMNode_unlink(dispex
);
1410 unlink_ref(&This
->nsinput
);
1413 static const NodeImplVtbl HTMLInputElementImplVtbl
= {
1414 .clsid
= &CLSID_HTMLInputElement
,
1415 .cpc_entries
= HTMLElement_cpc
,
1416 .clone
= HTMLElement_clone
,
1417 .get_attr_col
= HTMLElement_get_attr_col
,
1418 .put_disabled
= HTMLInputElementImpl_put_disabled
,
1419 .get_disabled
= HTMLInputElementImpl_get_disabled
,
1420 .is_text_edit
= HTMLInputElement_is_text_edit
1423 static const event_target_vtbl_t HTMLInputElement_event_target_vtbl
= {
1425 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
1426 .query_interface
= HTMLInputElement_query_interface
,
1427 .destructor
= HTMLElement_destructor
,
1428 .traverse
= HTMLInputElement_traverse
,
1429 .unlink
= HTMLInputElement_unlink
1431 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
1432 .handle_event
= HTMLElement_handle_event
1435 static const tid_t HTMLInputElement_iface_tids
[] = {
1437 IHTMLInputElement_tid
,
1438 IHTMLInputTextElement2_tid
,
1441 static dispex_static_data_t HTMLInputElement_dispex
= {
1443 &HTMLInputElement_event_target_vtbl
.dispex_vtbl
,
1444 DispHTMLInputElement_tid
,
1445 HTMLInputElement_iface_tids
,
1446 HTMLElement_init_dispex_info
1449 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
1451 HTMLInputElement
*ret
;
1454 ret
= calloc(1, sizeof(HTMLInputElement
));
1456 return E_OUTOFMEMORY
;
1458 ret
->IHTMLInputElement_iface
.lpVtbl
= &HTMLInputElementVtbl
;
1459 ret
->IHTMLInputTextElement_iface
.lpVtbl
= &HTMLInputTextElementVtbl
;
1460 ret
->IHTMLInputTextElement2_iface
.lpVtbl
= &HTMLInputTextElement2Vtbl
;
1461 ret
->element
.node
.vtbl
= &HTMLInputElementImplVtbl
;
1463 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLInputElement_dispex
);
1465 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLInputElement
, (void**)&ret
->nsinput
);
1466 assert(nsres
== NS_OK
);
1468 *elem
= &ret
->element
;
1472 struct HTMLLabelElement
{
1473 HTMLElement element
;
1475 IHTMLLabelElement IHTMLLabelElement_iface
;
1478 static inline HTMLLabelElement
*impl_from_IHTMLLabelElement(IHTMLLabelElement
*iface
)
1480 return CONTAINING_RECORD(iface
, HTMLLabelElement
, IHTMLLabelElement_iface
);
1483 static HRESULT WINAPI
HTMLLabelElement_QueryInterface(IHTMLLabelElement
*iface
,
1484 REFIID riid
, void **ppv
)
1486 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1488 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1491 static ULONG WINAPI
HTMLLabelElement_AddRef(IHTMLLabelElement
*iface
)
1493 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1495 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1498 static ULONG WINAPI
HTMLLabelElement_Release(IHTMLLabelElement
*iface
)
1500 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1502 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1505 static HRESULT WINAPI
HTMLLabelElement_GetTypeInfoCount(IHTMLLabelElement
*iface
, UINT
*pctinfo
)
1507 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1509 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1512 static HRESULT WINAPI
HTMLLabelElement_GetTypeInfo(IHTMLLabelElement
*iface
, UINT iTInfo
,
1513 LCID lcid
, ITypeInfo
**ppTInfo
)
1515 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1517 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1520 static HRESULT WINAPI
HTMLLabelElement_GetIDsOfNames(IHTMLLabelElement
*iface
, REFIID riid
,
1521 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1523 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1525 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1526 cNames
, lcid
, rgDispId
);
1529 static HRESULT WINAPI
HTMLLabelElement_Invoke(IHTMLLabelElement
*iface
, DISPID dispIdMember
,
1530 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1531 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1533 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1535 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1536 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1539 static HRESULT WINAPI
HTMLLabelElement_put_htmlFor(IHTMLLabelElement
*iface
, BSTR v
)
1541 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1542 nsAString for_str
, val_str
;
1545 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1547 nsAString_InitDepend(&for_str
, L
"for");
1548 nsAString_InitDepend(&val_str
, v
);
1549 nsres
= nsIDOMElement_SetAttribute(This
->element
.dom_element
, &for_str
, &val_str
);
1550 nsAString_Finish(&for_str
);
1551 nsAString_Finish(&val_str
);
1552 if(NS_FAILED(nsres
)) {
1553 ERR("SetAttribute failed: %08lx\n", nsres
);
1560 static HRESULT WINAPI
HTMLLabelElement_get_htmlFor(IHTMLLabelElement
*iface
, BSTR
*p
)
1562 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1564 TRACE("(%p)->(%p)\n", This
, p
);
1566 return elem_string_attr_getter(&This
->element
, L
"for", FALSE
, p
);
1569 static HRESULT WINAPI
HTMLLabelElement_put_accessKey(IHTMLLabelElement
*iface
, BSTR v
)
1571 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1572 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1576 static HRESULT WINAPI
HTMLLabelElement_get_accessKey(IHTMLLabelElement
*iface
, BSTR
*p
)
1578 HTMLLabelElement
*This
= impl_from_IHTMLLabelElement(iface
);
1579 FIXME("(%p)->(%p)\n", This
, p
);
1583 static const IHTMLLabelElementVtbl HTMLLabelElementVtbl
= {
1584 HTMLLabelElement_QueryInterface
,
1585 HTMLLabelElement_AddRef
,
1586 HTMLLabelElement_Release
,
1587 HTMLLabelElement_GetTypeInfoCount
,
1588 HTMLLabelElement_GetTypeInfo
,
1589 HTMLLabelElement_GetIDsOfNames
,
1590 HTMLLabelElement_Invoke
,
1591 HTMLLabelElement_put_htmlFor
,
1592 HTMLLabelElement_get_htmlFor
,
1593 HTMLLabelElement_put_accessKey
,
1594 HTMLLabelElement_get_accessKey
1597 static inline HTMLLabelElement
*label_from_DispatchEx(DispatchEx
*iface
)
1599 return CONTAINING_RECORD(iface
, HTMLLabelElement
, element
.node
.event_target
.dispex
);
1602 static void *HTMLLabelElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
1604 HTMLLabelElement
*This
= label_from_DispatchEx(dispex
);
1606 if(IsEqualGUID(&IID_IHTMLLabelElement
, riid
))
1607 return &This
->IHTMLLabelElement_iface
;
1609 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
1612 static const NodeImplVtbl HTMLLabelElementImplVtbl
= {
1613 .clsid
= &CLSID_HTMLLabelElement
,
1614 .cpc_entries
= HTMLElement_cpc
,
1615 .clone
= HTMLElement_clone
,
1616 .get_attr_col
= HTMLElement_get_attr_col
,
1619 static const event_target_vtbl_t HTMLLabelElement_event_target_vtbl
= {
1621 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
1622 .query_interface
= HTMLLabelElement_query_interface
,
1623 .destructor
= HTMLElement_destructor
,
1624 .traverse
= HTMLDOMNode_traverse
,
1625 .unlink
= HTMLDOMNode_unlink
1627 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
1628 .handle_event
= HTMLElement_handle_event
1631 static const tid_t HTMLLabelElement_iface_tids
[] = {
1633 IHTMLLabelElement_tid
,
1637 static dispex_static_data_t HTMLLabelElement_dispex
= {
1639 &HTMLLabelElement_event_target_vtbl
.dispex_vtbl
,
1640 DispHTMLLabelElement_tid
,
1641 HTMLLabelElement_iface_tids
,
1642 HTMLElement_init_dispex_info
1645 HRESULT
HTMLLabelElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
1647 HTMLLabelElement
*ret
;
1649 ret
= calloc(1, sizeof(*ret
));
1651 return E_OUTOFMEMORY
;
1653 ret
->IHTMLLabelElement_iface
.lpVtbl
= &HTMLLabelElementVtbl
;
1654 ret
->element
.node
.vtbl
= &HTMLLabelElementImplVtbl
;
1656 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLLabelElement_dispex
);
1657 *elem
= &ret
->element
;
1661 struct HTMLButtonElement
{
1662 HTMLElement element
;
1664 IHTMLButtonElement IHTMLButtonElement_iface
;
1666 nsIDOMHTMLButtonElement
*nsbutton
;
1669 static inline HTMLButtonElement
*impl_from_IHTMLButtonElement(IHTMLButtonElement
*iface
)
1671 return CONTAINING_RECORD(iface
, HTMLButtonElement
, IHTMLButtonElement_iface
);
1674 static HRESULT WINAPI
HTMLButtonElement_QueryInterface(IHTMLButtonElement
*iface
,
1675 REFIID riid
, void **ppv
)
1677 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1679 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1682 static ULONG WINAPI
HTMLButtonElement_AddRef(IHTMLButtonElement
*iface
)
1684 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1686 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1689 static ULONG WINAPI
HTMLButtonElement_Release(IHTMLButtonElement
*iface
)
1691 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1693 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1696 static HRESULT WINAPI
HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement
*iface
, UINT
*pctinfo
)
1698 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1700 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1703 static HRESULT WINAPI
HTMLButtonElement_GetTypeInfo(IHTMLButtonElement
*iface
, UINT iTInfo
,
1704 LCID lcid
, ITypeInfo
**ppTInfo
)
1706 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1708 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1711 static HRESULT WINAPI
HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement
*iface
, REFIID riid
,
1712 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1714 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1716 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1717 cNames
, lcid
, rgDispId
);
1720 static HRESULT WINAPI
HTMLButtonElement_Invoke(IHTMLButtonElement
*iface
, DISPID dispIdMember
,
1721 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1722 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1724 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1726 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1727 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1730 static HRESULT WINAPI
HTMLButtonElement_get_type(IHTMLButtonElement
*iface
, BSTR
*p
)
1732 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1736 TRACE("(%p)->(%p)\n", This
, p
);
1738 nsAString_Init(&type_str
, NULL
);
1739 nsres
= nsIDOMHTMLButtonElement_GetType(This
->nsbutton
, &type_str
);
1740 return return_nsstr(nsres
, &type_str
, p
);
1743 static HRESULT WINAPI
HTMLButtonElement_put_value(IHTMLButtonElement
*iface
, BSTR v
)
1745 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1749 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1751 nsAString_InitDepend(&nsstr
, v
);
1752 nsres
= nsIDOMHTMLButtonElement_SetValue(This
->nsbutton
, &nsstr
);
1753 nsAString_Finish(&nsstr
);
1754 if(NS_FAILED(nsres
)) {
1755 ERR("SetValue failed: %08lx\n", nsres
);
1762 static HRESULT WINAPI
HTMLButtonElement_get_value(IHTMLButtonElement
*iface
, BSTR
*p
)
1764 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1765 nsAString value_str
;
1768 TRACE("(%p)->(%p)\n", This
, p
);
1770 nsAString_Init(&value_str
, NULL
);
1771 nsres
= nsIDOMHTMLButtonElement_GetValue(This
->nsbutton
, &value_str
);
1772 return return_nsstr(nsres
, &value_str
, p
);
1775 static HRESULT WINAPI
HTMLButtonElement_put_name(IHTMLButtonElement
*iface
, BSTR v
)
1777 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1781 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1783 nsAString_InitDepend(&name_str
, v
);
1784 nsres
= nsIDOMHTMLButtonElement_SetName(This
->nsbutton
, &name_str
);
1785 nsAString_Finish(&name_str
);
1786 if(NS_FAILED(nsres
)) {
1787 ERR("SetName failed: %08lx\n", nsres
);
1794 static HRESULT WINAPI
HTMLButtonElement_get_name(IHTMLButtonElement
*iface
, BSTR
*p
)
1796 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1800 TRACE("(%p)->(%p)\n", This
, p
);
1802 nsAString_Init(&name_str
, NULL
);
1803 nsres
= nsIDOMHTMLButtonElement_GetName(This
->nsbutton
, &name_str
);
1804 return return_nsstr(nsres
, &name_str
, p
);
1807 static HRESULT WINAPI
HTMLButtonElement_put_status(IHTMLButtonElement
*iface
, VARIANT v
)
1809 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1810 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1814 static HRESULT WINAPI
HTMLButtonElement_get_status(IHTMLButtonElement
*iface
, VARIANT
*p
)
1816 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1817 FIXME("(%p)->(%p)\n", This
, p
);
1821 static HRESULT WINAPI
HTMLButtonElement_put_disabled(IHTMLButtonElement
*iface
, VARIANT_BOOL v
)
1823 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1826 TRACE("(%p)->(%x)\n", This
, v
);
1828 nsres
= nsIDOMHTMLButtonElement_SetDisabled(This
->nsbutton
, !!v
);
1829 if(NS_FAILED(nsres
)) {
1830 ERR("SetDisabled failed: %08lx\n", nsres
);
1837 static HRESULT WINAPI
HTMLButtonElement_get_disabled(IHTMLButtonElement
*iface
, VARIANT_BOOL
*p
)
1839 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1843 TRACE("(%p)->(%p)\n", This
, p
);
1845 nsres
= nsIDOMHTMLButtonElement_GetDisabled(This
->nsbutton
, &disabled
);
1846 if(NS_FAILED(nsres
)) {
1847 ERR("GetDisabled failed: %08lx\n", nsres
);
1851 *p
= variant_bool(disabled
);
1855 static HRESULT WINAPI
HTMLButtonElement_get_form(IHTMLButtonElement
*iface
, IHTMLFormElement
**p
)
1857 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1858 nsIDOMHTMLFormElement
*nsform
;
1861 TRACE("(%p)->(%p)\n", This
, p
);
1863 nsres
= nsIDOMHTMLButtonElement_GetForm(This
->nsbutton
, &nsform
);
1864 return return_nsform(nsres
, nsform
, p
);
1867 static HRESULT WINAPI
HTMLButtonElement_createTextRange(IHTMLButtonElement
*iface
, IHTMLTxtRange
**range
)
1869 HTMLButtonElement
*This
= impl_from_IHTMLButtonElement(iface
);
1870 FIXME("(%p)->(%p)\n", This
, range
);
1874 static const IHTMLButtonElementVtbl HTMLButtonElementVtbl
= {
1875 HTMLButtonElement_QueryInterface
,
1876 HTMLButtonElement_AddRef
,
1877 HTMLButtonElement_Release
,
1878 HTMLButtonElement_GetTypeInfoCount
,
1879 HTMLButtonElement_GetTypeInfo
,
1880 HTMLButtonElement_GetIDsOfNames
,
1881 HTMLButtonElement_Invoke
,
1882 HTMLButtonElement_get_type
,
1883 HTMLButtonElement_put_value
,
1884 HTMLButtonElement_get_value
,
1885 HTMLButtonElement_put_name
,
1886 HTMLButtonElement_get_name
,
1887 HTMLButtonElement_put_status
,
1888 HTMLButtonElement_get_status
,
1889 HTMLButtonElement_put_disabled
,
1890 HTMLButtonElement_get_disabled
,
1891 HTMLButtonElement_get_form
,
1892 HTMLButtonElement_createTextRange
1895 static inline HTMLButtonElement
*button_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1897 return CONTAINING_RECORD(iface
, HTMLButtonElement
, element
.node
);
1900 static HRESULT
HTMLButtonElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1902 HTMLButtonElement
*This
= button_from_HTMLDOMNode(iface
);
1903 return IHTMLButtonElement_put_disabled(&This
->IHTMLButtonElement_iface
, v
);
1906 static HRESULT
HTMLButtonElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1908 HTMLButtonElement
*This
= button_from_HTMLDOMNode(iface
);
1909 return IHTMLButtonElement_get_disabled(&This
->IHTMLButtonElement_iface
, p
);
1912 static BOOL
HTMLButtonElement_is_text_edit(HTMLDOMNode
*iface
)
1917 static inline HTMLButtonElement
*button_from_DispatchEx(DispatchEx
*iface
)
1919 return CONTAINING_RECORD(iface
, HTMLButtonElement
, element
.node
.event_target
.dispex
);
1922 static void *HTMLButtonElement_query_interface(DispatchEx
*dispex
, REFIID riid
)
1924 HTMLButtonElement
*This
= button_from_DispatchEx(dispex
);
1926 if(IsEqualGUID(&IID_IHTMLButtonElement
, riid
))
1927 return &This
->IHTMLButtonElement_iface
;
1929 return HTMLElement_query_interface(&This
->element
.node
.event_target
.dispex
, riid
);
1932 static void HTMLButtonElement_traverse(DispatchEx
*dispex
, nsCycleCollectionTraversalCallback
*cb
)
1934 HTMLButtonElement
*This
= button_from_DispatchEx(dispex
);
1935 HTMLDOMNode_traverse(dispex
, cb
);
1938 note_cc_edge((nsISupports
*)This
->nsbutton
, "nsbutton", cb
);
1941 static void HTMLButtonElement_unlink(DispatchEx
*dispex
)
1943 HTMLButtonElement
*This
= button_from_DispatchEx(dispex
);
1944 HTMLDOMNode_unlink(dispex
);
1945 unlink_ref(&This
->nsbutton
);
1948 static const NodeImplVtbl HTMLButtonElementImplVtbl
= {
1949 .clsid
= &CLSID_HTMLButtonElement
,
1950 .cpc_entries
= HTMLElement_cpc
,
1951 .clone
= HTMLElement_clone
,
1952 .get_attr_col
= HTMLElement_get_attr_col
,
1953 .put_disabled
= HTMLButtonElementImpl_put_disabled
,
1954 .get_disabled
= HTMLButtonElementImpl_get_disabled
,
1955 .is_text_edit
= HTMLButtonElement_is_text_edit
1958 static const event_target_vtbl_t HTMLButtonElement_event_target_vtbl
= {
1960 HTMLELEMENT_DISPEX_VTBL_ENTRIES
,
1961 .query_interface
= HTMLButtonElement_query_interface
,
1962 .destructor
= HTMLElement_destructor
,
1963 .traverse
= HTMLButtonElement_traverse
,
1964 .unlink
= HTMLButtonElement_unlink
1966 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES
,
1967 .handle_event
= HTMLElement_handle_event
1970 static const tid_t HTMLButtonElement_iface_tids
[] = {
1972 IHTMLButtonElement_tid
,
1976 static dispex_static_data_t HTMLButtonElement_dispex
= {
1977 "HTMLButtonElement",
1978 &HTMLButtonElement_event_target_vtbl
.dispex_vtbl
,
1979 DispHTMLButtonElement_tid
,
1980 HTMLButtonElement_iface_tids
,
1981 HTMLElement_init_dispex_info
1984 HRESULT
HTMLButtonElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
1986 HTMLButtonElement
*ret
;
1989 ret
= calloc(1, sizeof(*ret
));
1991 return E_OUTOFMEMORY
;
1993 ret
->IHTMLButtonElement_iface
.lpVtbl
= &HTMLButtonElementVtbl
;
1994 ret
->element
.node
.vtbl
= &HTMLButtonElementImplVtbl
;
1996 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLButtonElement_dispex
);
1998 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLButtonElement
, (void**)&ret
->nsbutton
);
1999 assert(nsres
== NS_OK
);
2001 *elem
= &ret
->element
;