mshtml: Add separate task list for tasks dispatching events.
[wine.git] / dlls / mshtml / htmlinput.c
blobe02ac2249d97121e21cad9be03f3fdccf9b8ad9c
1 /*
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 <stdarg.h>
20 #include <limits.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 struct HTMLInputElement {
37 HTMLElement element;
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,
91 ppTInfo);
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);
117 nsAString type_str;
118 nsresult nsres;
120 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
123 * FIXME:
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);
131 return E_FAIL;
134 return S_OK;
137 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
139 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
140 nsAString type_str;
141 nsresult nsres;
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);
153 nsAString val_str;
154 nsresult nsres;
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);
161 if(NS_FAILED(nsres))
162 ERR("SetValue failed: %08lx\n", nsres);
164 return S_OK;
167 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
169 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
170 nsAString value_str;
171 nsresult nsres;
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);
183 nsAString name_str;
184 nsresult nsres;
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);
193 return E_FAIL;
196 return S_OK;
199 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
201 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
202 nsAString name_str;
203 nsresult nsres;
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);
216 return E_NOTIMPL;
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);
223 return E_NOTIMPL;
226 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
228 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
229 nsresult nsres;
231 TRACE("(%p)->(%x)\n", This, v);
233 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
234 if(NS_FAILED(nsres))
235 ERR("SetDisabled failed: %08lx\n", nsres);
237 return S_OK;
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);
250 return S_OK;
253 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
255 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
256 nsIDOMHTMLFormElement *nsform;
257 nsresult nsres;
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);
268 UINT32 val = v;
269 nsresult nsres;
271 TRACE("(%p)->(%ld)\n", This, v);
272 if (v <= 0)
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);
278 return E_FAIL;
280 return S_OK;
283 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
285 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
286 UINT32 val;
287 nsresult nsres;
289 TRACE("(%p)->(%p)\n", This, p);
290 if (p == NULL)
291 return E_INVALIDARG;
293 nsres = nsIDOMHTMLInputElement_GetSize(This->nsinput, &val);
294 if (NS_FAILED(nsres)) {
295 ERR("Get Size failed: %08lx\n", nsres);
296 return E_FAIL;
298 *p = val;
299 return S_OK;
302 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
304 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
305 nsresult nsres;
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");
313 return E_FAIL;
316 return S_OK;
319 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
321 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
322 LONG max_length;
323 nsresult nsres;
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;
332 return S_OK;
335 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
337 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
338 nsresult nsres;
340 TRACE("(%p)\n", This);
342 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
343 if(NS_FAILED(nsres)) {
344 ERR("Select failed: %08lx\n", nsres);
345 return E_FAIL;
348 return S_OK;
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);
373 return E_NOTIMPL;
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);
380 return E_NOTIMPL;
383 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
385 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
386 nsAString nsstr;
387 nsresult nsres;
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);
396 return E_FAIL;
399 return S_OK;
402 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
404 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
405 nsAString nsstr;
406 nsresult nsres;
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);
418 nsresult nsres;
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);
425 return E_FAIL;
427 return S_OK;
430 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
432 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
433 nsresult nsres;
434 cpp_bool b;
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);
441 return E_FAIL;
444 *p = variant_bool(b);
445 return S_OK;
448 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
450 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
451 FIXME("(%p)->(%p)\n", This, range);
452 return E_NOTIMPL;
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);
459 return E_NOTIMPL;
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);
466 return E_NOTIMPL;
469 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
471 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
472 nsresult nsres;
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);
479 return E_FAIL;
482 return S_OK;
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;
489 nsresult nsres;
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);
496 return E_FAIL;
499 *p = variant_bool(default_checked);
500 return S_OK;
503 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
505 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
506 nsresult nsres;
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);
513 return E_FAIL;
516 return S_OK;
519 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
521 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
522 cpp_bool checked;
523 nsresult nsres;
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);
530 return E_FAIL;
533 *p = variant_bool(checked);
534 TRACE("checked=%x\n", *p);
535 return S_OK;
538 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
540 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
541 FIXME("(%p)->()\n", This);
542 return E_NOTIMPL;
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);
549 return E_NOTIMPL;
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);
556 return E_NOTIMPL;
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);
563 return E_NOTIMPL;
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);
570 return E_NOTIMPL;
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);
577 return E_NOTIMPL;
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));
584 return E_NOTIMPL;
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);
591 return E_NOTIMPL;
594 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
596 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
597 nsAString nsstr;
598 nsresult nsres;
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);
605 if(NS_FAILED(nsres))
606 ERR("SetSrc failed: %08lx\n", nsres);
608 return S_OK;
611 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
613 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
614 const PRUnichar *src;
615 nsAString src_str;
616 nsresult nsres;
617 HRESULT hres;
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);
625 return E_FAIL;
628 nsAString_GetData(&src_str, &src);
629 hres = nsuri_to_url(src, FALSE, p);
630 nsAString_Finish(&src_str);
632 return hres;
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));
639 return E_NOTIMPL;
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);
646 return E_NOTIMPL;
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));
653 return E_NOTIMPL;
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);
660 return E_NOTIMPL;
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));
667 return E_NOTIMPL;
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);
674 return E_NOTIMPL;
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);
681 return E_NOTIMPL;
684 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
686 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
687 FIXME("(%p)->(%p)\n", This, p);
688 return E_NOTIMPL;
691 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
693 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
694 FIXME("(%p)->()\n", This);
695 return E_NOTIMPL;
698 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
700 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
701 FIXME("(%p)->(%p)\n", This, p);
702 return E_NOTIMPL;
705 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
707 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
708 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
709 return E_NOTIMPL;
712 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
714 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
715 FIXME("(%p)->(%p)\n", This, p);
716 return E_NOTIMPL;
719 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
721 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
723 TRACE("(%p)->()\n", This);
725 return set_node_event(&This->element.node, EVENTID_LOAD, &v);
728 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
730 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
732 TRACE("(%p)->(%p)\n", This, p);
734 return get_node_event(&This->element.node, EVENTID_LOAD, p);
737 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
739 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
740 FIXME("(%p)->()\n", This);
741 return E_NOTIMPL;
744 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
746 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
747 FIXME("(%p)->(%p)\n", This, p);
748 return E_NOTIMPL;
751 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
753 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
754 FIXME("(%p)->()\n", This);
755 return E_NOTIMPL;
758 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
760 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
761 FIXME("(%p)->(%p)\n", This, p);
762 return E_NOTIMPL;
765 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
767 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
768 FIXME("(%p)->(%ld)\n", This, v);
769 return E_NOTIMPL;
772 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
774 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
775 FIXME("(%p)->(%p)\n", This, p);
776 return E_NOTIMPL;
779 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
781 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
782 FIXME("(%p)->(%ld)\n", This, v);
783 return E_NOTIMPL;
786 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
788 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
789 FIXME("(%p)->(%p)\n", This, p);
790 return E_NOTIMPL;
793 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
795 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
796 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
797 return E_NOTIMPL;
800 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
802 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
803 FIXME("(%p)->(%p)\n", This, p);
804 return E_NOTIMPL;
807 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
808 HTMLInputElement_QueryInterface,
809 HTMLInputElement_AddRef,
810 HTMLInputElement_Release,
811 HTMLInputElement_GetTypeInfoCount,
812 HTMLInputElement_GetTypeInfo,
813 HTMLInputElement_GetIDsOfNames,
814 HTMLInputElement_Invoke,
815 HTMLInputElement_put_type,
816 HTMLInputElement_get_type,
817 HTMLInputElement_put_value,
818 HTMLInputElement_get_value,
819 HTMLInputElement_put_name,
820 HTMLInputElement_get_name,
821 HTMLInputElement_put_status,
822 HTMLInputElement_get_status,
823 HTMLInputElement_put_disabled,
824 HTMLInputElement_get_disabled,
825 HTMLInputElement_get_form,
826 HTMLInputElement_put_size,
827 HTMLInputElement_get_size,
828 HTMLInputElement_put_maxLength,
829 HTMLInputElement_get_maxLength,
830 HTMLInputElement_select,
831 HTMLInputElement_put_onchange,
832 HTMLInputElement_get_onchange,
833 HTMLInputElement_put_onselect,
834 HTMLInputElement_get_onselect,
835 HTMLInputElement_put_defaultValue,
836 HTMLInputElement_get_defaultValue,
837 HTMLInputElement_put_readOnly,
838 HTMLInputElement_get_readOnly,
839 HTMLInputElement_createTextRange,
840 HTMLInputElement_put_indeterminate,
841 HTMLInputElement_get_indeterminate,
842 HTMLInputElement_put_defaultChecked,
843 HTMLInputElement_get_defaultChecked,
844 HTMLInputElement_put_checked,
845 HTMLInputElement_get_checked,
846 HTMLInputElement_put_border,
847 HTMLInputElement_get_border,
848 HTMLInputElement_put_vspace,
849 HTMLInputElement_get_vspace,
850 HTMLInputElement_put_hspace,
851 HTMLInputElement_get_hspace,
852 HTMLInputElement_put_alt,
853 HTMLInputElement_get_alt,
854 HTMLInputElement_put_src,
855 HTMLInputElement_get_src,
856 HTMLInputElement_put_lowsrc,
857 HTMLInputElement_get_lowsrc,
858 HTMLInputElement_put_vrml,
859 HTMLInputElement_get_vrml,
860 HTMLInputElement_put_dynsrc,
861 HTMLInputElement_get_dynsrc,
862 HTMLInputElement_get_readyState,
863 HTMLInputElement_get_complete,
864 HTMLInputElement_put_loop,
865 HTMLInputElement_get_loop,
866 HTMLInputElement_put_align,
867 HTMLInputElement_get_align,
868 HTMLInputElement_put_onload,
869 HTMLInputElement_get_onload,
870 HTMLInputElement_put_onerror,
871 HTMLInputElement_get_onerror,
872 HTMLInputElement_put_onabort,
873 HTMLInputElement_get_onabort,
874 HTMLInputElement_put_width,
875 HTMLInputElement_get_width,
876 HTMLInputElement_put_height,
877 HTMLInputElement_get_height,
878 HTMLInputElement_put_start,
879 HTMLInputElement_get_start
882 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
883 REFIID riid, void **ppv)
885 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
887 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
890 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
892 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
894 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
897 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
899 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
901 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
904 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
906 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
907 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
910 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
911 LCID lcid, ITypeInfo **ppTInfo)
913 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
914 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
915 ppTInfo);
918 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
919 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
921 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
922 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
923 cNames, lcid, rgDispId);
926 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
927 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
928 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
930 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
931 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
932 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
935 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
937 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
939 TRACE("(%p)->(%p)\n", This, p);
941 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
944 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
946 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
948 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
950 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
953 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
955 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
957 TRACE("(%p)->(%p)\n", This, p);
959 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
962 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
964 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
966 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
968 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
971 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
973 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
975 TRACE("(%p)->(%p)\n", This, p);
977 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
980 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
982 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
983 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
984 return E_NOTIMPL;
987 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
989 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
990 TRACE("(%p)->(%p)\n", This, p);
991 return E_NOTIMPL;
994 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
996 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
998 TRACE("(%p)->(%x)\n", This, v);
1000 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1003 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1005 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1007 TRACE("(%p)->(%p)\n", This, p);
1009 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1012 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
1014 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1016 TRACE("(%p)->(%p)\n", This, p);
1018 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
1021 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
1023 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1025 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1027 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
1030 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
1032 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1034 TRACE("(%p)->(%p)\n", This, p);
1036 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
1039 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
1041 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1043 TRACE("(%p)->(%ld)\n", This, v);
1045 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
1048 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
1050 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1052 TRACE("(%p)->(%p)\n", This, p);
1054 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
1057 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
1059 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1061 TRACE("(%p)->(%ld)\n", This, v);
1063 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1066 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1068 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1070 TRACE("(%p)->(%p)\n", This, p);
1072 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1075 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1077 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1079 TRACE("(%p)\n", This);
1081 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1084 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1086 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1088 TRACE("(%p)->()\n", This);
1090 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1093 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1095 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1097 TRACE("(%p)->(%p)\n", This, p);
1099 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1102 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1104 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1106 TRACE("(%p)->()\n", This);
1108 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1111 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1113 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1115 TRACE("(%p)->(%p)\n", This, p);
1117 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1120 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1122 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1124 TRACE("(%p)->(%x)\n", This, v);
1126 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1129 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1131 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1133 TRACE("(%p)->(%p)\n", This, p);
1135 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1138 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1140 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1142 TRACE("(%p)->(%p)\n", This, range);
1144 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1147 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1148 HTMLInputTextElement_QueryInterface,
1149 HTMLInputTextElement_AddRef,
1150 HTMLInputTextElement_Release,
1151 HTMLInputTextElement_GetTypeInfoCount,
1152 HTMLInputTextElement_GetTypeInfo,
1153 HTMLInputTextElement_GetIDsOfNames,
1154 HTMLInputTextElement_Invoke,
1155 HTMLInputTextElement_get_type,
1156 HTMLInputTextElement_put_value,
1157 HTMLInputTextElement_get_value,
1158 HTMLInputTextElement_put_name,
1159 HTMLInputTextElement_get_name,
1160 HTMLInputTextElement_put_status,
1161 HTMLInputTextElement_get_status,
1162 HTMLInputTextElement_put_disabled,
1163 HTMLInputTextElement_get_disabled,
1164 HTMLInputTextElement_get_form,
1165 HTMLInputTextElement_put_defaultValue,
1166 HTMLInputTextElement_get_defaultValue,
1167 HTMLInputTextElement_put_size,
1168 HTMLInputTextElement_get_size,
1169 HTMLInputTextElement_put_maxLength,
1170 HTMLInputTextElement_get_maxLength,
1171 HTMLInputTextElement_select,
1172 HTMLInputTextElement_put_onchange,
1173 HTMLInputTextElement_get_onchange,
1174 HTMLInputTextElement_put_onselect,
1175 HTMLInputTextElement_get_onselect,
1176 HTMLInputTextElement_put_readOnly,
1177 HTMLInputTextElement_get_readOnly,
1178 HTMLInputTextElement_createTextRange
1181 static inline HTMLInputElement *impl_from_IHTMLInputTextElement2(IHTMLInputTextElement2 *iface)
1183 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement2_iface);
1186 static HRESULT WINAPI HTMLInputTextElement2_QueryInterface(IHTMLInputTextElement2 *iface, REFIID riid, void **ppv)
1188 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1189 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1192 static ULONG WINAPI HTMLInputTextElement2_AddRef(IHTMLInputTextElement2 *iface)
1194 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1195 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1198 static ULONG WINAPI HTMLInputTextElement2_Release(IHTMLInputTextElement2 *iface)
1200 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1201 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1204 static HRESULT WINAPI HTMLInputTextElement2_GetTypeInfoCount(IHTMLInputTextElement2 *iface, UINT *pctinfo)
1206 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1207 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1210 static HRESULT WINAPI HTMLInputTextElement2_GetTypeInfo(IHTMLInputTextElement2 *iface, UINT iTInfo,
1211 LCID lcid, ITypeInfo **ppTInfo)
1213 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1214 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1217 static HRESULT WINAPI HTMLInputTextElement2_GetIDsOfNames(IHTMLInputTextElement2 *iface, REFIID riid,
1218 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1220 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1221 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1222 cNames, lcid, rgDispId);
1225 static HRESULT WINAPI HTMLInputTextElement2_Invoke(IHTMLInputTextElement2 *iface, DISPID dispIdMember,
1226 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1227 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1229 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1230 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1231 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1234 static HRESULT WINAPI HTMLInputTextElement2_put_selectionStart(IHTMLInputTextElement2 *iface, LONG v)
1236 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1237 nsresult nsres;
1239 TRACE("(%p)->(%ld)\n", This, v);
1241 nsres = nsIDOMHTMLInputElement_SetSelectionStart(This->nsinput, v);
1242 if(NS_FAILED(nsres)) {
1243 ERR("SetSelectionStart failed: %08lx\n", nsres);
1244 return E_FAIL;
1246 return S_OK;
1249 static HRESULT WINAPI HTMLInputTextElement2_get_selectionStart(IHTMLInputTextElement2 *iface, LONG *p)
1251 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1252 LONG selection_start;
1253 nsresult nsres;
1255 TRACE("(%p)->(%p)\n", This, p);
1257 nsres = nsIDOMHTMLInputElement_GetSelectionStart(This->nsinput, &selection_start);
1258 if(NS_FAILED(nsres)) {
1259 ERR("GetSelectionStart failed: %08lx\n", nsres);
1260 return E_FAIL;
1263 *p = selection_start;
1264 return S_OK;
1267 static HRESULT WINAPI HTMLInputTextElement2_put_selectionEnd(IHTMLInputTextElement2 *iface, LONG v)
1269 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1270 nsresult nsres;
1272 TRACE("(%p)->(%ld)\n", This, v);
1274 nsres = nsIDOMHTMLInputElement_SetSelectionEnd(This->nsinput, v);
1275 if(NS_FAILED(nsres)) {
1276 ERR("SetSelectionEnd failed: %08lx\n", nsres);
1277 return E_FAIL;
1279 return S_OK;
1282 static HRESULT WINAPI HTMLInputTextElement2_get_selectionEnd(IHTMLInputTextElement2 *iface, LONG *p)
1284 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1285 LONG selection_end;
1286 nsresult nsres;
1288 TRACE("(%p)->(%p)\n", This, p);
1290 nsres = nsIDOMHTMLInputElement_GetSelectionEnd(This->nsinput, &selection_end);
1291 if(NS_FAILED(nsres)) {
1292 ERR("GetSelectionEnd failed: %08lx\n", nsres);
1293 return E_FAIL;
1296 *p = selection_end;
1297 return S_OK;
1300 static HRESULT WINAPI HTMLInputTextElement2_setSelectionRange(IHTMLInputTextElement2 *iface, LONG start, LONG end)
1302 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1303 nsAString none_str;
1304 nsresult nsres;
1306 TRACE("(%p)->(%ld %ld)\n", This, start, end);
1308 nsAString_InitDepend(&none_str, L"none");
1309 nsres = nsIDOMHTMLInputElement_SetSelectionRange(This->nsinput, start, end, &none_str);
1310 nsAString_Finish(&none_str);
1311 if(NS_FAILED(nsres)) {
1312 ERR("SetSelectionRange failed: %08lx\n", nsres);
1313 return E_FAIL;
1315 return S_OK;
1318 static const IHTMLInputTextElement2Vtbl HTMLInputTextElement2Vtbl = {
1319 HTMLInputTextElement2_QueryInterface,
1320 HTMLInputTextElement2_AddRef,
1321 HTMLInputTextElement2_Release,
1322 HTMLInputTextElement2_GetTypeInfoCount,
1323 HTMLInputTextElement2_GetTypeInfo,
1324 HTMLInputTextElement2_GetIDsOfNames,
1325 HTMLInputTextElement2_Invoke,
1326 HTMLInputTextElement2_put_selectionStart,
1327 HTMLInputTextElement2_get_selectionStart,
1328 HTMLInputTextElement2_put_selectionEnd,
1329 HTMLInputTextElement2_get_selectionEnd,
1330 HTMLInputTextElement2_setSelectionRange
1333 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1335 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1338 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1340 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1342 *ppv = NULL;
1344 if(IsEqualGUID(&IID_IUnknown, riid)) {
1345 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1346 *ppv = &This->IHTMLInputElement_iface;
1347 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1348 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1349 *ppv = &This->IHTMLInputElement_iface;
1350 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1351 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1352 *ppv = &This->IHTMLInputElement_iface;
1353 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1354 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1355 *ppv = &This->IHTMLInputTextElement_iface;
1356 }else if(IsEqualGUID(&IID_IHTMLInputTextElement2, riid)) {
1357 TRACE("(%p)->(IID_IHTMLInputTextElement2 %p)\n", This, ppv);
1358 *ppv = &This->IHTMLInputTextElement2_iface;
1361 if(*ppv) {
1362 IUnknown_AddRef((IUnknown*)*ppv);
1363 return S_OK;
1366 return HTMLElement_QI(&This->element.node, riid, ppv);
1369 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1371 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1372 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1375 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1377 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1378 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1381 static BOOL HTMLInputElement_is_text_edit(HTMLDOMNode *iface)
1383 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1384 const PRUnichar *type;
1385 nsAString nsstr;
1386 nsresult nsres;
1387 BOOL ret = FALSE;
1389 nsAString_Init(&nsstr, NULL);
1390 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &nsstr);
1391 if(NS_SUCCEEDED(nsres)) {
1392 nsAString_GetData(&nsstr, &type);
1393 ret = !wcscmp(type, L"button") || !wcscmp(type, L"hidden") || !wcscmp(type, L"password")
1394 || !wcscmp(type, L"reset") || !wcscmp(type, L"submit") || !wcscmp(type, L"text");
1396 nsAString_Finish(&nsstr);
1397 return ret;
1400 static void HTMLInputElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1402 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1404 if(This->nsinput)
1405 note_cc_edge((nsISupports*)This->nsinput, "This->nsinput", cb);
1408 static void HTMLInputElement_unlink(HTMLDOMNode *iface)
1410 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1412 if(This->nsinput) {
1413 nsIDOMHTMLInputElement *nsinput = This->nsinput;
1415 This->nsinput = NULL;
1416 nsIDOMHTMLInputElement_Release(nsinput);
1420 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1421 &CLSID_HTMLInputElement,
1422 HTMLInputElement_QI,
1423 HTMLElement_destructor,
1424 HTMLElement_cpc,
1425 HTMLElement_clone,
1426 HTMLElement_dispatch_nsevent_hook,
1427 HTMLElement_handle_event,
1428 HTMLElement_get_attr_col,
1429 NULL,
1430 HTMLInputElementImpl_put_disabled,
1431 HTMLInputElementImpl_get_disabled,
1432 NULL,
1433 NULL,
1434 NULL,
1435 NULL,
1436 NULL,
1437 NULL,
1438 HTMLInputElement_traverse,
1439 HTMLInputElement_unlink,
1440 HTMLInputElement_is_text_edit
1443 static const tid_t HTMLInputElement_iface_tids[] = {
1444 HTMLELEMENT_TIDS,
1445 IHTMLInputElement_tid,
1446 IHTMLInputTextElement2_tid,
1449 static dispex_static_data_t HTMLInputElement_dispex = {
1450 L"HTMLInputElement",
1451 NULL,
1452 DispHTMLInputElement_tid,
1453 HTMLInputElement_iface_tids,
1454 HTMLElement_init_dispex_info
1457 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
1459 HTMLInputElement *ret;
1460 nsresult nsres;
1462 ret = calloc(1, sizeof(HTMLInputElement));
1463 if(!ret)
1464 return E_OUTOFMEMORY;
1466 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1467 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1468 ret->IHTMLInputTextElement2_iface.lpVtbl = &HTMLInputTextElement2Vtbl;
1469 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1471 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1473 nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1474 assert(nsres == NS_OK);
1476 *elem = &ret->element;
1477 return S_OK;
1480 struct HTMLLabelElement {
1481 HTMLElement element;
1483 IHTMLLabelElement IHTMLLabelElement_iface;
1486 static inline HTMLLabelElement *impl_from_IHTMLLabelElement(IHTMLLabelElement *iface)
1488 return CONTAINING_RECORD(iface, HTMLLabelElement, IHTMLLabelElement_iface);
1491 static HRESULT WINAPI HTMLLabelElement_QueryInterface(IHTMLLabelElement *iface,
1492 REFIID riid, void **ppv)
1494 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1496 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1499 static ULONG WINAPI HTMLLabelElement_AddRef(IHTMLLabelElement *iface)
1501 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1503 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1506 static ULONG WINAPI HTMLLabelElement_Release(IHTMLLabelElement *iface)
1508 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1510 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1513 static HRESULT WINAPI HTMLLabelElement_GetTypeInfoCount(IHTMLLabelElement *iface, UINT *pctinfo)
1515 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1517 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1520 static HRESULT WINAPI HTMLLabelElement_GetTypeInfo(IHTMLLabelElement *iface, UINT iTInfo,
1521 LCID lcid, ITypeInfo **ppTInfo)
1523 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1525 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1528 static HRESULT WINAPI HTMLLabelElement_GetIDsOfNames(IHTMLLabelElement *iface, REFIID riid,
1529 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1531 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1533 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1534 cNames, lcid, rgDispId);
1537 static HRESULT WINAPI HTMLLabelElement_Invoke(IHTMLLabelElement *iface, DISPID dispIdMember,
1538 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1539 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1541 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1543 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1544 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1547 static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BSTR v)
1549 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1550 nsAString for_str, val_str;
1551 nsresult nsres;
1553 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1555 nsAString_InitDepend(&for_str, L"for");
1556 nsAString_InitDepend(&val_str, v);
1557 nsres = nsIDOMElement_SetAttribute(This->element.dom_element, &for_str, &val_str);
1558 nsAString_Finish(&for_str);
1559 nsAString_Finish(&val_str);
1560 if(NS_FAILED(nsres)) {
1561 ERR("SetAttribute failed: %08lx\n", nsres);
1562 return E_FAIL;
1565 return S_OK;
1568 static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p)
1570 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1572 TRACE("(%p)->(%p)\n", This, p);
1574 return elem_string_attr_getter(&This->element, L"for", FALSE, p);
1577 static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)
1579 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1580 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1581 return E_NOTIMPL;
1584 static HRESULT WINAPI HTMLLabelElement_get_accessKey(IHTMLLabelElement *iface, BSTR *p)
1586 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1587 FIXME("(%p)->(%p)\n", This, p);
1588 return E_NOTIMPL;
1591 static const IHTMLLabelElementVtbl HTMLLabelElementVtbl = {
1592 HTMLLabelElement_QueryInterface,
1593 HTMLLabelElement_AddRef,
1594 HTMLLabelElement_Release,
1595 HTMLLabelElement_GetTypeInfoCount,
1596 HTMLLabelElement_GetTypeInfo,
1597 HTMLLabelElement_GetIDsOfNames,
1598 HTMLLabelElement_Invoke,
1599 HTMLLabelElement_put_htmlFor,
1600 HTMLLabelElement_get_htmlFor,
1601 HTMLLabelElement_put_accessKey,
1602 HTMLLabelElement_get_accessKey
1605 static inline HTMLLabelElement *label_from_HTMLDOMNode(HTMLDOMNode *iface)
1607 return CONTAINING_RECORD(iface, HTMLLabelElement, element.node);
1610 static HRESULT HTMLLabelElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1612 HTMLLabelElement *This = label_from_HTMLDOMNode(iface);
1614 *ppv = NULL;
1616 if(IsEqualGUID(&IID_IUnknown, riid)) {
1617 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1618 *ppv = &This->IHTMLLabelElement_iface;
1619 }else if(IsEqualGUID(&IID_IHTMLLabelElement, riid)) {
1620 TRACE("(%p)->(IID_IHTMLLabelElement %p)\n", This, ppv);
1621 *ppv = &This->IHTMLLabelElement_iface;
1622 }else {
1623 return HTMLElement_QI(&This->element.node, riid, ppv);
1626 IUnknown_AddRef((IUnknown*)*ppv);
1627 return S_OK;
1630 static const NodeImplVtbl HTMLLabelElementImplVtbl = {
1631 &CLSID_HTMLLabelElement,
1632 HTMLLabelElement_QI,
1633 HTMLElement_destructor,
1634 HTMLElement_cpc,
1635 HTMLElement_clone,
1636 HTMLElement_dispatch_nsevent_hook,
1637 HTMLElement_handle_event,
1638 HTMLElement_get_attr_col,
1641 static const tid_t HTMLLabelElement_iface_tids[] = {
1642 HTMLELEMENT_TIDS,
1643 IHTMLLabelElement_tid,
1647 static dispex_static_data_t HTMLLabelElement_dispex = {
1648 L"HTMLLabelElement",
1649 NULL,
1650 DispHTMLLabelElement_tid,
1651 HTMLLabelElement_iface_tids,
1652 HTMLElement_init_dispex_info
1655 HRESULT HTMLLabelElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
1657 HTMLLabelElement *ret;
1659 ret = calloc(1, sizeof(*ret));
1660 if(!ret)
1661 return E_OUTOFMEMORY;
1663 ret->IHTMLLabelElement_iface.lpVtbl = &HTMLLabelElementVtbl;
1664 ret->element.node.vtbl = &HTMLLabelElementImplVtbl;
1666 HTMLElement_Init(&ret->element, doc, nselem, &HTMLLabelElement_dispex);
1667 *elem = &ret->element;
1668 return S_OK;
1671 struct HTMLButtonElement {
1672 HTMLElement element;
1674 IHTMLButtonElement IHTMLButtonElement_iface;
1676 nsIDOMHTMLButtonElement *nsbutton;
1679 static inline HTMLButtonElement *impl_from_IHTMLButtonElement(IHTMLButtonElement *iface)
1681 return CONTAINING_RECORD(iface, HTMLButtonElement, IHTMLButtonElement_iface);
1684 static HRESULT WINAPI HTMLButtonElement_QueryInterface(IHTMLButtonElement *iface,
1685 REFIID riid, void **ppv)
1687 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1689 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1692 static ULONG WINAPI HTMLButtonElement_AddRef(IHTMLButtonElement *iface)
1694 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1696 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1699 static ULONG WINAPI HTMLButtonElement_Release(IHTMLButtonElement *iface)
1701 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1703 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1706 static HRESULT WINAPI HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement *iface, UINT *pctinfo)
1708 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1710 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1713 static HRESULT WINAPI HTMLButtonElement_GetTypeInfo(IHTMLButtonElement *iface, UINT iTInfo,
1714 LCID lcid, ITypeInfo **ppTInfo)
1716 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1718 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1721 static HRESULT WINAPI HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement *iface, REFIID riid,
1722 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1724 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1726 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1727 cNames, lcid, rgDispId);
1730 static HRESULT WINAPI HTMLButtonElement_Invoke(IHTMLButtonElement *iface, DISPID dispIdMember,
1731 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1732 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1734 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1736 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1737 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1740 static HRESULT WINAPI HTMLButtonElement_get_type(IHTMLButtonElement *iface, BSTR *p)
1742 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1743 nsAString type_str;
1744 nsresult nsres;
1746 TRACE("(%p)->(%p)\n", This, p);
1748 nsAString_Init(&type_str, NULL);
1749 nsres = nsIDOMHTMLButtonElement_GetType(This->nsbutton, &type_str);
1750 return return_nsstr(nsres, &type_str, p);
1753 static HRESULT WINAPI HTMLButtonElement_put_value(IHTMLButtonElement *iface, BSTR v)
1755 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1756 nsAString nsstr;
1757 nsresult nsres;
1759 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1761 nsAString_InitDepend(&nsstr, v);
1762 nsres = nsIDOMHTMLButtonElement_SetValue(This->nsbutton, &nsstr);
1763 nsAString_Finish(&nsstr);
1764 if(NS_FAILED(nsres)) {
1765 ERR("SetValue failed: %08lx\n", nsres);
1766 return E_FAIL;
1769 return S_OK;
1772 static HRESULT WINAPI HTMLButtonElement_get_value(IHTMLButtonElement *iface, BSTR *p)
1774 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1775 nsAString value_str;
1776 nsresult nsres;
1778 TRACE("(%p)->(%p)\n", This, p);
1780 nsAString_Init(&value_str, NULL);
1781 nsres = nsIDOMHTMLButtonElement_GetValue(This->nsbutton, &value_str);
1782 return return_nsstr(nsres, &value_str, p);
1785 static HRESULT WINAPI HTMLButtonElement_put_name(IHTMLButtonElement *iface, BSTR v)
1787 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1788 nsAString name_str;
1789 nsresult nsres;
1791 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1793 nsAString_InitDepend(&name_str, v);
1794 nsres = nsIDOMHTMLButtonElement_SetName(This->nsbutton, &name_str);
1795 nsAString_Finish(&name_str);
1796 if(NS_FAILED(nsres)) {
1797 ERR("SetName failed: %08lx\n", nsres);
1798 return E_FAIL;
1801 return S_OK;
1804 static HRESULT WINAPI HTMLButtonElement_get_name(IHTMLButtonElement *iface, BSTR *p)
1806 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1807 nsAString name_str;
1808 nsresult nsres;
1810 TRACE("(%p)->(%p)\n", This, p);
1812 nsAString_Init(&name_str, NULL);
1813 nsres = nsIDOMHTMLButtonElement_GetName(This->nsbutton, &name_str);
1814 return return_nsstr(nsres, &name_str, p);
1817 static HRESULT WINAPI HTMLButtonElement_put_status(IHTMLButtonElement *iface, VARIANT v)
1819 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1820 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1821 return E_NOTIMPL;
1824 static HRESULT WINAPI HTMLButtonElement_get_status(IHTMLButtonElement *iface, VARIANT *p)
1826 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1827 FIXME("(%p)->(%p)\n", This, p);
1828 return E_NOTIMPL;
1831 static HRESULT WINAPI HTMLButtonElement_put_disabled(IHTMLButtonElement *iface, VARIANT_BOOL v)
1833 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1834 nsresult nsres;
1836 TRACE("(%p)->(%x)\n", This, v);
1838 nsres = nsIDOMHTMLButtonElement_SetDisabled(This->nsbutton, !!v);
1839 if(NS_FAILED(nsres)) {
1840 ERR("SetDisabled failed: %08lx\n", nsres);
1841 return E_FAIL;
1844 return S_OK;
1847 static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface, VARIANT_BOOL *p)
1849 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1850 cpp_bool disabled;
1851 nsresult nsres;
1853 TRACE("(%p)->(%p)\n", This, p);
1855 nsres = nsIDOMHTMLButtonElement_GetDisabled(This->nsbutton, &disabled);
1856 if(NS_FAILED(nsres)) {
1857 ERR("GetDisabled failed: %08lx\n", nsres);
1858 return E_FAIL;
1861 *p = variant_bool(disabled);
1862 return S_OK;
1865 static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTMLFormElement **p)
1867 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1868 nsIDOMHTMLFormElement *nsform;
1869 nsresult nsres;
1871 TRACE("(%p)->(%p)\n", This, p);
1873 nsres = nsIDOMHTMLButtonElement_GetForm(This->nsbutton, &nsform);
1874 return return_nsform(nsres, nsform, p);
1877 static HRESULT WINAPI HTMLButtonElement_createTextRange(IHTMLButtonElement *iface, IHTMLTxtRange **range)
1879 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1880 FIXME("(%p)->(%p)\n", This, range);
1881 return E_NOTIMPL;
1884 static const IHTMLButtonElementVtbl HTMLButtonElementVtbl = {
1885 HTMLButtonElement_QueryInterface,
1886 HTMLButtonElement_AddRef,
1887 HTMLButtonElement_Release,
1888 HTMLButtonElement_GetTypeInfoCount,
1889 HTMLButtonElement_GetTypeInfo,
1890 HTMLButtonElement_GetIDsOfNames,
1891 HTMLButtonElement_Invoke,
1892 HTMLButtonElement_get_type,
1893 HTMLButtonElement_put_value,
1894 HTMLButtonElement_get_value,
1895 HTMLButtonElement_put_name,
1896 HTMLButtonElement_get_name,
1897 HTMLButtonElement_put_status,
1898 HTMLButtonElement_get_status,
1899 HTMLButtonElement_put_disabled,
1900 HTMLButtonElement_get_disabled,
1901 HTMLButtonElement_get_form,
1902 HTMLButtonElement_createTextRange
1905 static inline HTMLButtonElement *button_from_HTMLDOMNode(HTMLDOMNode *iface)
1907 return CONTAINING_RECORD(iface, HTMLButtonElement, element.node);
1910 static HRESULT HTMLButtonElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1912 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1914 *ppv = NULL;
1916 if(IsEqualGUID(&IID_IUnknown, riid)) {
1917 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1918 *ppv = &This->IHTMLButtonElement_iface;
1919 }else if(IsEqualGUID(&IID_IHTMLButtonElement, riid)) {
1920 TRACE("(%p)->(IID_IHTMLButtonElement %p)\n", This, ppv);
1921 *ppv = &This->IHTMLButtonElement_iface;
1922 }else {
1923 return HTMLElement_QI(&This->element.node, riid, ppv);
1926 IUnknown_AddRef((IUnknown*)*ppv);
1927 return S_OK;
1930 static HRESULT HTMLButtonElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1932 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1933 return IHTMLButtonElement_put_disabled(&This->IHTMLButtonElement_iface, v);
1936 static HRESULT HTMLButtonElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1938 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1939 return IHTMLButtonElement_get_disabled(&This->IHTMLButtonElement_iface, p);
1942 static BOOL HTMLButtonElement_is_text_edit(HTMLDOMNode *iface)
1944 return TRUE;
1947 static void HTMLButtonElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1949 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1951 if(This->nsbutton)
1952 note_cc_edge((nsISupports*)This->nsbutton, "This->nsbutton", cb);
1955 static void HTMLButtonElement_unlink(HTMLDOMNode *iface)
1957 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1959 if(This->nsbutton) {
1960 nsIDOMHTMLButtonElement *nsbutton = This->nsbutton;
1962 This->nsbutton = NULL;
1963 nsIDOMHTMLButtonElement_Release(nsbutton);
1967 static const NodeImplVtbl HTMLButtonElementImplVtbl = {
1968 &CLSID_HTMLButtonElement,
1969 HTMLButtonElement_QI,
1970 HTMLElement_destructor,
1971 HTMLElement_cpc,
1972 HTMLElement_clone,
1973 HTMLElement_dispatch_nsevent_hook,
1974 HTMLElement_handle_event,
1975 HTMLElement_get_attr_col,
1976 NULL,
1977 HTMLButtonElementImpl_put_disabled,
1978 HTMLButtonElementImpl_get_disabled,
1979 NULL,
1980 NULL,
1981 NULL,
1982 NULL,
1983 NULL,
1984 NULL,
1985 HTMLButtonElement_traverse,
1986 HTMLButtonElement_unlink,
1987 HTMLButtonElement_is_text_edit
1990 static const tid_t HTMLButtonElement_iface_tids[] = {
1991 HTMLELEMENT_TIDS,
1992 IHTMLButtonElement_tid,
1996 static dispex_static_data_t HTMLButtonElement_dispex = {
1997 L"HTMLButtonElement",
1998 NULL,
1999 DispHTMLButtonElement_tid,
2000 HTMLButtonElement_iface_tids,
2001 HTMLElement_init_dispex_info
2004 HRESULT HTMLButtonElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
2006 HTMLButtonElement *ret;
2007 nsresult nsres;
2009 ret = calloc(1, sizeof(*ret));
2010 if(!ret)
2011 return E_OUTOFMEMORY;
2013 ret->IHTMLButtonElement_iface.lpVtbl = &HTMLButtonElementVtbl;
2014 ret->element.node.vtbl = &HTMLButtonElementImplVtbl;
2016 HTMLElement_Init(&ret->element, doc, nselem, &HTMLButtonElement_dispex);
2018 nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLButtonElement, (void**)&ret->nsbutton);
2019 assert(nsres == NS_OK);
2021 *elem = &ret->element;
2022 return S_OK;