dinput: Factor out IDirectInputDevice ansi vtable.
[wine.git] / dlls / mshtml / htmlinput.c
blob2ba5833f3c00f00520dbb9c8fc87e02440b72999
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 <assert.h>
21 #include <limits.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "htmlevent.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 struct HTMLInputElement {
38 HTMLElement element;
40 IHTMLInputElement IHTMLInputElement_iface;
41 IHTMLInputTextElement IHTMLInputTextElement_iface;
42 IHTMLInputTextElement2 IHTMLInputTextElement2_iface;
44 nsIDOMHTMLInputElement *nsinput;
47 static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
49 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
52 static inline HTMLInputElement *impl_from_IHTMLInputTextElement(IHTMLInputTextElement *iface)
54 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement_iface);
57 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
58 REFIID riid, void **ppv)
60 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
62 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
65 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
67 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
69 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
72 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
74 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
76 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
79 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
81 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
83 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
86 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
87 LCID lcid, ITypeInfo **ppTInfo)
89 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
91 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
92 ppTInfo);
95 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
96 LPOLESTR *rgszNames, UINT cNames,
97 LCID lcid, DISPID *rgDispId)
99 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
101 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
102 cNames, lcid, rgDispId);
105 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
106 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
107 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
109 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
111 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
112 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
115 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
117 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
118 nsAString type_str;
119 nsresult nsres;
121 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
124 * FIXME:
125 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
127 nsAString_InitDepend(&type_str, v);
128 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
129 nsAString_Finish(&type_str);
130 if(NS_FAILED(nsres)) {
131 ERR("SetType failed: %08x\n", nsres);
132 return E_FAIL;
135 return S_OK;
138 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
140 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
141 nsAString type_str;
142 nsresult nsres;
144 TRACE("(%p)->(%p)\n", This, p);
146 nsAString_Init(&type_str, NULL);
147 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
148 return return_nsstr(nsres, &type_str, p);
151 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
153 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
154 nsAString val_str;
155 nsresult nsres;
157 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
159 nsAString_InitDepend(&val_str, v);
160 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
161 nsAString_Finish(&val_str);
162 if(NS_FAILED(nsres))
163 ERR("SetValue failed: %08x\n", nsres);
165 return S_OK;
168 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
170 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
171 nsAString value_str;
172 nsresult nsres;
174 TRACE("(%p)->(%p)\n", This, p);
176 nsAString_Init(&value_str, NULL);
177 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
178 return return_nsstr(nsres, &value_str, p);
181 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
183 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
184 nsAString name_str;
185 nsresult nsres;
187 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
189 nsAString_InitDepend(&name_str, v);
190 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
191 nsAString_Finish(&name_str);
192 if(NS_FAILED(nsres)) {
193 ERR("SetName failed: %08x\n", nsres);
194 return E_FAIL;
197 return S_OK;
200 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
202 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
203 nsAString name_str;
204 nsresult nsres;
206 TRACE("(%p)->(%p)\n", This, p);
208 nsAString_Init(&name_str, NULL);
209 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
210 return return_nsstr(nsres, &name_str, p);
213 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
215 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
216 FIXME("(%p)->(%x)\n", This, v);
217 return E_NOTIMPL;
220 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
222 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
223 FIXME("(%p)->(%p)\n", This, p);
224 return E_NOTIMPL;
227 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
229 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
230 nsresult nsres;
232 TRACE("(%p)->(%x)\n", This, v);
234 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
235 if(NS_FAILED(nsres))
236 ERR("SetDisabled failed: %08x\n", nsres);
238 return S_OK;
241 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
243 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
244 cpp_bool disabled = FALSE;
246 TRACE("(%p)->(%p)\n", This, p);
248 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
250 *p = variant_bool(disabled);
251 return S_OK;
254 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
256 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
257 nsIDOMHTMLFormElement *nsform;
258 nsresult nsres;
260 TRACE("(%p)->(%p)\n", This, p);
262 nsres = nsIDOMHTMLInputElement_GetForm(This->nsinput, &nsform);
263 return return_nsform(nsres, nsform, p);
266 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
268 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
269 UINT32 val = v;
270 nsresult nsres;
272 TRACE("(%p)->(%d)\n", This, v);
273 if (v <= 0)
274 return CTL_E_INVALIDPROPERTYVALUE;
276 nsres = nsIDOMHTMLInputElement_SetSize(This->nsinput, val);
277 if (NS_FAILED(nsres)) {
278 ERR("Set Size(%u) failed: %08x\n", val, nsres);
279 return E_FAIL;
281 return S_OK;
284 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
286 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
287 UINT32 val;
288 nsresult nsres;
290 TRACE("(%p)->(%p)\n", This, p);
291 if (p == NULL)
292 return E_INVALIDARG;
294 nsres = nsIDOMHTMLInputElement_GetSize(This->nsinput, &val);
295 if (NS_FAILED(nsres)) {
296 ERR("Get Size failed: %08x\n", nsres);
297 return E_FAIL;
299 *p = val;
300 return S_OK;
303 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
305 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
306 nsresult nsres;
308 TRACE("(%p)->(%d)\n", This, v);
310 nsres = nsIDOMHTMLInputElement_SetMaxLength(This->nsinput, v);
311 if(NS_FAILED(nsres)) {
312 /* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
313 FIXME("SetMaxLength failed\n");
314 return E_FAIL;
317 return S_OK;
320 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
322 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
323 LONG max_length;
324 nsresult nsres;
326 TRACE("(%p)->(%p)\n", This, p);
328 nsres = nsIDOMHTMLInputElement_GetMaxLength(This->nsinput, &max_length);
329 assert(nsres == NS_OK);
331 /* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
332 *p = max_length == -1 ? INT_MAX : max_length;
333 return S_OK;
336 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
338 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
339 nsresult nsres;
341 TRACE("(%p)\n", This);
343 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
344 if(NS_FAILED(nsres)) {
345 ERR("Select failed: %08x\n", nsres);
346 return E_FAIL;
349 return S_OK;
352 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
354 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
356 TRACE("(%p)->()\n", This);
358 return set_node_event(&This->element.node, EVENTID_CHANGE, &v);
361 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
363 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
365 TRACE("(%p)->(%p)\n", This, p);
367 return get_node_event(&This->element.node, EVENTID_CHANGE, p);
370 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
372 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
373 FIXME("(%p)->()\n", This);
374 return E_NOTIMPL;
377 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
379 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
380 FIXME("(%p)->(%p)\n", This, p);
381 return E_NOTIMPL;
384 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
386 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
387 nsAString nsstr;
388 nsresult nsres;
390 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
392 nsAString_InitDepend(&nsstr, v);
393 nsres = nsIDOMHTMLInputElement_SetDefaultValue(This->nsinput, &nsstr);
394 nsAString_Finish(&nsstr);
395 if(NS_FAILED(nsres)) {
396 ERR("SetValue failed: %08x\n", nsres);
397 return E_FAIL;
400 return S_OK;
403 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
405 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
406 nsAString nsstr;
407 nsresult nsres;
409 TRACE("(%p)->(%p)\n", This, p);
411 nsAString_Init(&nsstr, NULL);
412 nsres = nsIDOMHTMLInputElement_GetDefaultValue(This->nsinput, &nsstr);
413 return return_nsstr(nsres, &nsstr, p);
416 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
418 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
419 nsresult nsres;
421 TRACE("(%p)->(%x)\n", This, v);
423 nsres = nsIDOMHTMLInputElement_SetReadOnly(This->nsinput, v != VARIANT_FALSE);
424 if (NS_FAILED(nsres)) {
425 ERR("Set ReadOnly Failed: %08x\n", nsres);
426 return E_FAIL;
428 return S_OK;
431 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
433 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
434 nsresult nsres;
435 cpp_bool b;
437 TRACE("(%p)->(%p)\n", This, p);
439 nsres = nsIDOMHTMLInputElement_GetReadOnly(This->nsinput, &b);
440 if (NS_FAILED(nsres)) {
441 ERR("Get ReadOnly Failed: %08x\n", nsres);
442 return E_FAIL;
445 *p = variant_bool(b);
446 return S_OK;
449 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
451 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
452 FIXME("(%p)->(%p)\n", This, range);
453 return E_NOTIMPL;
456 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
458 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
459 FIXME("(%p)->(%x)\n", This, v);
460 return E_NOTIMPL;
463 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
465 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
466 FIXME("(%p)->(%p)\n", This, p);
467 return E_NOTIMPL;
470 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
472 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
473 nsresult nsres;
475 TRACE("(%p)->(%x)\n", This, v);
477 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
478 if(NS_FAILED(nsres)) {
479 ERR("SetDefaultChecked failed: %08x\n", nsres);
480 return E_FAIL;
483 return S_OK;
486 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
488 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
489 cpp_bool default_checked = FALSE;
490 nsresult nsres;
492 TRACE("(%p)->(%p)\n", This, p);
494 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
495 if(NS_FAILED(nsres)) {
496 ERR("GetDefaultChecked failed: %08x\n", nsres);
497 return E_FAIL;
500 *p = variant_bool(default_checked);
501 return S_OK;
504 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
506 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
507 nsresult nsres;
509 TRACE("(%p)->(%x)\n", This, v);
511 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
512 if(NS_FAILED(nsres)) {
513 ERR("SetChecked failed: %08x\n", nsres);
514 return E_FAIL;
517 return S_OK;
520 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
522 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
523 cpp_bool checked;
524 nsresult nsres;
526 TRACE("(%p)->(%p)\n", This, p);
528 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
529 if(NS_FAILED(nsres)) {
530 ERR("GetChecked failed: %08x\n", nsres);
531 return E_FAIL;
534 *p = variant_bool(checked);
535 TRACE("checked=%x\n", *p);
536 return S_OK;
539 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
541 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
542 FIXME("(%p)->()\n", This);
543 return E_NOTIMPL;
546 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
548 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
549 FIXME("(%p)->(%p)\n", This, p);
550 return E_NOTIMPL;
553 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
555 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
556 FIXME("(%p)->(%d)\n", This, v);
557 return E_NOTIMPL;
560 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
562 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
563 FIXME("(%p)->(%p)\n", This, p);
564 return E_NOTIMPL;
567 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
569 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
570 FIXME("(%p)->(%d)\n", This, v);
571 return E_NOTIMPL;
574 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
576 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
577 FIXME("(%p)->(%p)\n", This, p);
578 return E_NOTIMPL;
581 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
583 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
584 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
585 return E_NOTIMPL;
588 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
590 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
591 FIXME("(%p)->(%p)\n", This, p);
592 return E_NOTIMPL;
595 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
597 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
598 nsAString nsstr;
599 nsresult nsres;
601 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
603 nsAString_InitDepend(&nsstr, v);
604 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
605 nsAString_Finish(&nsstr);
606 if(NS_FAILED(nsres))
607 ERR("SetSrc failed: %08x\n", nsres);
609 return S_OK;
612 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
614 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
615 const PRUnichar *src;
616 nsAString src_str;
617 nsresult nsres;
618 HRESULT hres;
620 TRACE("(%p)->(%p)\n", This, p);
622 nsAString_Init(&src_str, NULL);
623 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
624 if(NS_FAILED(nsres)) {
625 ERR("GetSrc failed: %08x\n", nsres);
626 return E_FAIL;
629 nsAString_GetData(&src_str, &src);
630 hres = nsuri_to_url(src, FALSE, p);
631 nsAString_Finish(&src_str);
633 return hres;
636 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
638 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
639 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
640 return E_NOTIMPL;
643 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
645 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
646 FIXME("(%p)->(%p)\n", This, p);
647 return E_NOTIMPL;
650 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
652 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
653 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
654 return E_NOTIMPL;
657 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
659 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
660 FIXME("(%p)->(%p)\n", This, p);
661 return E_NOTIMPL;
664 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
666 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
667 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
668 return E_NOTIMPL;
671 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
673 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
674 FIXME("(%p)->(%p)\n", This, p);
675 return E_NOTIMPL;
678 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
680 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
681 FIXME("(%p)->(%p)\n", This, p);
682 return E_NOTIMPL;
685 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
687 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
688 FIXME("(%p)->(%p)\n", This, p);
689 return E_NOTIMPL;
692 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
694 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
695 FIXME("(%p)->()\n", This);
696 return E_NOTIMPL;
699 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
701 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
702 FIXME("(%p)->(%p)\n", This, p);
703 return E_NOTIMPL;
706 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
708 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
709 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
710 return E_NOTIMPL;
713 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
715 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
716 FIXME("(%p)->(%p)\n", This, p);
717 return E_NOTIMPL;
720 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
722 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
723 FIXME("(%p)->()\n", This);
724 return E_NOTIMPL;
727 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
729 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
730 FIXME("(%p)->(%p)\n", This, p);
731 return E_NOTIMPL;
734 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
736 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
737 FIXME("(%p)->()\n", This);
738 return E_NOTIMPL;
741 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
743 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
744 FIXME("(%p)->(%p)\n", This, p);
745 return E_NOTIMPL;
748 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
750 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
751 FIXME("(%p)->()\n", This);
752 return E_NOTIMPL;
755 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
757 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
758 FIXME("(%p)->(%p)\n", This, p);
759 return E_NOTIMPL;
762 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
764 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
765 FIXME("(%p)->(%d)\n", This, v);
766 return E_NOTIMPL;
769 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
771 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
772 FIXME("(%p)->(%p)\n", This, p);
773 return E_NOTIMPL;
776 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
778 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
779 FIXME("(%p)->(%d)\n", This, v);
780 return E_NOTIMPL;
783 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
785 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
786 FIXME("(%p)->(%p)\n", This, p);
787 return E_NOTIMPL;
790 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
792 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
793 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
794 return E_NOTIMPL;
797 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
799 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
800 FIXME("(%p)->(%p)\n", This, p);
801 return E_NOTIMPL;
804 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
805 HTMLInputElement_QueryInterface,
806 HTMLInputElement_AddRef,
807 HTMLInputElement_Release,
808 HTMLInputElement_GetTypeInfoCount,
809 HTMLInputElement_GetTypeInfo,
810 HTMLInputElement_GetIDsOfNames,
811 HTMLInputElement_Invoke,
812 HTMLInputElement_put_type,
813 HTMLInputElement_get_type,
814 HTMLInputElement_put_value,
815 HTMLInputElement_get_value,
816 HTMLInputElement_put_name,
817 HTMLInputElement_get_name,
818 HTMLInputElement_put_status,
819 HTMLInputElement_get_status,
820 HTMLInputElement_put_disabled,
821 HTMLInputElement_get_disabled,
822 HTMLInputElement_get_form,
823 HTMLInputElement_put_size,
824 HTMLInputElement_get_size,
825 HTMLInputElement_put_maxLength,
826 HTMLInputElement_get_maxLength,
827 HTMLInputElement_select,
828 HTMLInputElement_put_onchange,
829 HTMLInputElement_get_onchange,
830 HTMLInputElement_put_onselect,
831 HTMLInputElement_get_onselect,
832 HTMLInputElement_put_defaultValue,
833 HTMLInputElement_get_defaultValue,
834 HTMLInputElement_put_readOnly,
835 HTMLInputElement_get_readOnly,
836 HTMLInputElement_createTextRange,
837 HTMLInputElement_put_indeterminate,
838 HTMLInputElement_get_indeterminate,
839 HTMLInputElement_put_defaultChecked,
840 HTMLInputElement_get_defaultChecked,
841 HTMLInputElement_put_checked,
842 HTMLInputElement_get_checked,
843 HTMLInputElement_put_border,
844 HTMLInputElement_get_border,
845 HTMLInputElement_put_vspace,
846 HTMLInputElement_get_vspace,
847 HTMLInputElement_put_hspace,
848 HTMLInputElement_get_hspace,
849 HTMLInputElement_put_alt,
850 HTMLInputElement_get_alt,
851 HTMLInputElement_put_src,
852 HTMLInputElement_get_src,
853 HTMLInputElement_put_lowsrc,
854 HTMLInputElement_get_lowsrc,
855 HTMLInputElement_put_vrml,
856 HTMLInputElement_get_vrml,
857 HTMLInputElement_put_dynsrc,
858 HTMLInputElement_get_dynsrc,
859 HTMLInputElement_get_readyState,
860 HTMLInputElement_get_complete,
861 HTMLInputElement_put_loop,
862 HTMLInputElement_get_loop,
863 HTMLInputElement_put_align,
864 HTMLInputElement_get_align,
865 HTMLInputElement_put_onload,
866 HTMLInputElement_get_onload,
867 HTMLInputElement_put_onerror,
868 HTMLInputElement_get_onerror,
869 HTMLInputElement_put_onabort,
870 HTMLInputElement_get_onabort,
871 HTMLInputElement_put_width,
872 HTMLInputElement_get_width,
873 HTMLInputElement_put_height,
874 HTMLInputElement_get_height,
875 HTMLInputElement_put_start,
876 HTMLInputElement_get_start
879 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
880 REFIID riid, void **ppv)
882 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
884 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
887 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
889 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
891 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
894 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
896 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
898 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
901 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
903 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
904 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
907 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
908 LCID lcid, ITypeInfo **ppTInfo)
910 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
911 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
912 ppTInfo);
915 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
916 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
918 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
919 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
920 cNames, lcid, rgDispId);
923 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
924 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
925 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
927 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
928 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
929 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
932 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
934 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
936 TRACE("(%p)->(%p)\n", This, p);
938 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
941 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
943 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
945 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
947 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
950 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
952 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
954 TRACE("(%p)->(%p)\n", This, p);
956 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
959 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
961 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
963 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
965 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
968 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
970 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
972 TRACE("(%p)->(%p)\n", This, p);
974 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
977 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
979 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
980 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
981 return E_NOTIMPL;
984 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
986 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
987 TRACE("(%p)->(%p)\n", This, p);
988 return E_NOTIMPL;
991 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
993 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
995 TRACE("(%p)->(%x)\n", This, v);
997 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1000 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1002 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1004 TRACE("(%p)->(%p)\n", This, p);
1006 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1009 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
1011 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1013 TRACE("(%p)->(%p)\n", This, p);
1015 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
1018 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
1020 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1022 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1024 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
1027 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
1029 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1031 TRACE("(%p)->(%p)\n", This, p);
1033 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
1036 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
1038 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1040 TRACE("(%p)->(%d)\n", This, v);
1042 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
1045 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
1047 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1049 TRACE("(%p)->(%p)\n", This, p);
1051 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
1054 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
1056 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1058 TRACE("(%p)->(%d)\n", This, v);
1060 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1063 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1065 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1067 TRACE("(%p)->(%p)\n", This, p);
1069 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1072 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1074 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1076 TRACE("(%p)\n", This);
1078 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1081 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1083 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1085 TRACE("(%p)->()\n", This);
1087 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1090 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1092 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1094 TRACE("(%p)->(%p)\n", This, p);
1096 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1099 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1101 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1103 TRACE("(%p)->()\n", This);
1105 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1108 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1110 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1112 TRACE("(%p)->(%p)\n", This, p);
1114 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1117 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1119 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1121 TRACE("(%p)->(%x)\n", This, v);
1123 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1126 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1128 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1130 TRACE("(%p)->(%p)\n", This, p);
1132 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1135 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1137 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1139 TRACE("(%p)->(%p)\n", This, range);
1141 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1144 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1145 HTMLInputTextElement_QueryInterface,
1146 HTMLInputTextElement_AddRef,
1147 HTMLInputTextElement_Release,
1148 HTMLInputTextElement_GetTypeInfoCount,
1149 HTMLInputTextElement_GetTypeInfo,
1150 HTMLInputTextElement_GetIDsOfNames,
1151 HTMLInputTextElement_Invoke,
1152 HTMLInputTextElement_get_type,
1153 HTMLInputTextElement_put_value,
1154 HTMLInputTextElement_get_value,
1155 HTMLInputTextElement_put_name,
1156 HTMLInputTextElement_get_name,
1157 HTMLInputTextElement_put_status,
1158 HTMLInputTextElement_get_status,
1159 HTMLInputTextElement_put_disabled,
1160 HTMLInputTextElement_get_disabled,
1161 HTMLInputTextElement_get_form,
1162 HTMLInputTextElement_put_defaultValue,
1163 HTMLInputTextElement_get_defaultValue,
1164 HTMLInputTextElement_put_size,
1165 HTMLInputTextElement_get_size,
1166 HTMLInputTextElement_put_maxLength,
1167 HTMLInputTextElement_get_maxLength,
1168 HTMLInputTextElement_select,
1169 HTMLInputTextElement_put_onchange,
1170 HTMLInputTextElement_get_onchange,
1171 HTMLInputTextElement_put_onselect,
1172 HTMLInputTextElement_get_onselect,
1173 HTMLInputTextElement_put_readOnly,
1174 HTMLInputTextElement_get_readOnly,
1175 HTMLInputTextElement_createTextRange
1178 static inline HTMLInputElement *impl_from_IHTMLInputTextElement2(IHTMLInputTextElement2 *iface)
1180 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement2_iface);
1183 static HRESULT WINAPI HTMLInputTextElement2_QueryInterface(IHTMLInputTextElement2 *iface, REFIID riid, void **ppv)
1185 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1186 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1189 static ULONG WINAPI HTMLInputTextElement2_AddRef(IHTMLInputTextElement2 *iface)
1191 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1192 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1195 static ULONG WINAPI HTMLInputTextElement2_Release(IHTMLInputTextElement2 *iface)
1197 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1198 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1201 static HRESULT WINAPI HTMLInputTextElement2_GetTypeInfoCount(IHTMLInputTextElement2 *iface, UINT *pctinfo)
1203 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1204 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1207 static HRESULT WINAPI HTMLInputTextElement2_GetTypeInfo(IHTMLInputTextElement2 *iface, UINT iTInfo,
1208 LCID lcid, ITypeInfo **ppTInfo)
1210 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1211 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1214 static HRESULT WINAPI HTMLInputTextElement2_GetIDsOfNames(IHTMLInputTextElement2 *iface, REFIID riid,
1215 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1217 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1218 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1219 cNames, lcid, rgDispId);
1222 static HRESULT WINAPI HTMLInputTextElement2_Invoke(IHTMLInputTextElement2 *iface, DISPID dispIdMember,
1223 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1224 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1226 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1227 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1228 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1231 static HRESULT WINAPI HTMLInputTextElement2_put_selectionStart(IHTMLInputTextElement2 *iface, LONG v)
1233 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1234 nsresult nsres;
1236 TRACE("(%p)->(%d)\n", This, v);
1238 nsres = nsIDOMHTMLInputElement_SetSelectionStart(This->nsinput, v);
1239 if(NS_FAILED(nsres)) {
1240 ERR("SetSelectionStart failed: %08x\n", nsres);
1241 return E_FAIL;
1243 return S_OK;
1246 static HRESULT WINAPI HTMLInputTextElement2_get_selectionStart(IHTMLInputTextElement2 *iface, LONG *p)
1248 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1249 INT32 selection_start;
1250 nsresult nsres;
1252 TRACE("(%p)->(%p)\n", This, p);
1254 nsres = nsIDOMHTMLInputElement_GetSelectionStart(This->nsinput, &selection_start);
1255 if(NS_FAILED(nsres)) {
1256 ERR("GetSelectionStart failed: %08x\n", nsres);
1257 return E_FAIL;
1260 *p = selection_start;
1261 return S_OK;
1264 static HRESULT WINAPI HTMLInputTextElement2_put_selectionEnd(IHTMLInputTextElement2 *iface, LONG v)
1266 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1267 nsresult nsres;
1269 TRACE("(%p)->(%d)\n", This, v);
1271 nsres = nsIDOMHTMLInputElement_SetSelectionEnd(This->nsinput, v);
1272 if(NS_FAILED(nsres)) {
1273 ERR("SetSelectionEnd failed: %08x\n", nsres);
1274 return E_FAIL;
1276 return S_OK;
1279 static HRESULT WINAPI HTMLInputTextElement2_get_selectionEnd(IHTMLInputTextElement2 *iface, LONG *p)
1281 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1282 INT32 selection_end;
1283 nsresult nsres;
1285 TRACE("(%p)->(%p)\n", This, p);
1287 nsres = nsIDOMHTMLInputElement_GetSelectionEnd(This->nsinput, &selection_end);
1288 if(NS_FAILED(nsres)) {
1289 ERR("GetSelectionEnd failed: %08x\n", nsres);
1290 return E_FAIL;
1293 *p = selection_end;
1294 return S_OK;
1297 static HRESULT WINAPI HTMLInputTextElement2_setSelectionRange(IHTMLInputTextElement2 *iface, LONG start, LONG end)
1299 HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface);
1300 nsAString none_str;
1301 nsresult nsres;
1303 TRACE("(%p)->(%d %d)\n", This, start, end);
1305 nsAString_InitDepend(&none_str, L"none");
1306 nsres = nsIDOMHTMLInputElement_SetSelectionRange(This->nsinput, start, end, &none_str);
1307 nsAString_Finish(&none_str);
1308 if(NS_FAILED(nsres)) {
1309 ERR("SetSelectionRange failed: %08x\n", nsres);
1310 return E_FAIL;
1312 return S_OK;
1315 static const IHTMLInputTextElement2Vtbl HTMLInputTextElement2Vtbl = {
1316 HTMLInputTextElement2_QueryInterface,
1317 HTMLInputTextElement2_AddRef,
1318 HTMLInputTextElement2_Release,
1319 HTMLInputTextElement2_GetTypeInfoCount,
1320 HTMLInputTextElement2_GetTypeInfo,
1321 HTMLInputTextElement2_GetIDsOfNames,
1322 HTMLInputTextElement2_Invoke,
1323 HTMLInputTextElement2_put_selectionStart,
1324 HTMLInputTextElement2_get_selectionStart,
1325 HTMLInputTextElement2_put_selectionEnd,
1326 HTMLInputTextElement2_get_selectionEnd,
1327 HTMLInputTextElement2_setSelectionRange
1330 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1332 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1335 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1337 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1339 *ppv = NULL;
1341 if(IsEqualGUID(&IID_IUnknown, riid)) {
1342 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1343 *ppv = &This->IHTMLInputElement_iface;
1344 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1345 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1346 *ppv = &This->IHTMLInputElement_iface;
1347 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1348 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1349 *ppv = &This->IHTMLInputElement_iface;
1350 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1351 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1352 *ppv = &This->IHTMLInputTextElement_iface;
1353 }else if(IsEqualGUID(&IID_IHTMLInputTextElement2, riid)) {
1354 TRACE("(%p)->(IID_IHTMLInputTextElement2 %p)\n", This, ppv);
1355 *ppv = &This->IHTMLInputTextElement2_iface;
1358 if(*ppv) {
1359 IUnknown_AddRef((IUnknown*)*ppv);
1360 return S_OK;
1363 return HTMLElement_QI(&This->element.node, riid, ppv);
1366 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1368 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1369 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1372 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1374 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1375 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1378 static BOOL HTMLInputElement_is_text_edit(HTMLDOMNode *iface)
1380 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1381 const PRUnichar *type;
1382 nsAString nsstr;
1383 nsresult nsres;
1384 BOOL ret = FALSE;
1386 nsAString_Init(&nsstr, NULL);
1387 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &nsstr);
1388 if(NS_SUCCEEDED(nsres)) {
1389 nsAString_GetData(&nsstr, &type);
1390 ret = !wcscmp(type, L"button") || !wcscmp(type, L"hidden") || !wcscmp(type, L"password")
1391 || !wcscmp(type, L"reset") || !wcscmp(type, L"submit") || !wcscmp(type, L"text");
1393 nsAString_Finish(&nsstr);
1394 return ret;
1397 static void HTMLInputElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1399 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1401 if(This->nsinput)
1402 note_cc_edge((nsISupports*)This->nsinput, "This->nsinput", cb);
1405 static void HTMLInputElement_unlink(HTMLDOMNode *iface)
1407 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1409 if(This->nsinput) {
1410 nsIDOMHTMLInputElement *nsinput = This->nsinput;
1412 This->nsinput = NULL;
1413 nsIDOMHTMLInputElement_Release(nsinput);
1417 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1418 &CLSID_HTMLInputElement,
1419 HTMLInputElement_QI,
1420 HTMLElement_destructor,
1421 HTMLElement_cpc,
1422 HTMLElement_clone,
1423 HTMLElement_handle_event,
1424 HTMLElement_get_attr_col,
1425 NULL,
1426 HTMLInputElementImpl_put_disabled,
1427 HTMLInputElementImpl_get_disabled,
1428 NULL,
1429 NULL,
1430 NULL,
1431 NULL,
1432 NULL,
1433 HTMLInputElement_traverse,
1434 HTMLInputElement_unlink,
1435 HTMLInputElement_is_text_edit
1438 static const tid_t HTMLInputElement_iface_tids[] = {
1439 HTMLELEMENT_TIDS,
1440 IHTMLInputElement_tid,
1441 IHTMLInputTextElement2_tid,
1444 static dispex_static_data_t HTMLInputElement_dispex = {
1445 NULL,
1446 DispHTMLInputElement_tid,
1447 HTMLInputElement_iface_tids,
1448 HTMLElement_init_dispex_info
1451 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
1453 HTMLInputElement *ret;
1454 nsresult nsres;
1456 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1457 if(!ret)
1458 return E_OUTOFMEMORY;
1460 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1461 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1462 ret->IHTMLInputTextElement2_iface.lpVtbl = &HTMLInputTextElement2Vtbl;
1463 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1465 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1467 nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1468 assert(nsres == NS_OK);
1470 *elem = &ret->element;
1471 return S_OK;
1474 struct HTMLLabelElement {
1475 HTMLElement element;
1477 IHTMLLabelElement IHTMLLabelElement_iface;
1480 static inline HTMLLabelElement *impl_from_IHTMLLabelElement(IHTMLLabelElement *iface)
1482 return CONTAINING_RECORD(iface, HTMLLabelElement, IHTMLLabelElement_iface);
1485 static HRESULT WINAPI HTMLLabelElement_QueryInterface(IHTMLLabelElement *iface,
1486 REFIID riid, void **ppv)
1488 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1490 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1493 static ULONG WINAPI HTMLLabelElement_AddRef(IHTMLLabelElement *iface)
1495 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1497 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1500 static ULONG WINAPI HTMLLabelElement_Release(IHTMLLabelElement *iface)
1502 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1504 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1507 static HRESULT WINAPI HTMLLabelElement_GetTypeInfoCount(IHTMLLabelElement *iface, UINT *pctinfo)
1509 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1511 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1514 static HRESULT WINAPI HTMLLabelElement_GetTypeInfo(IHTMLLabelElement *iface, UINT iTInfo,
1515 LCID lcid, ITypeInfo **ppTInfo)
1517 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1519 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1522 static HRESULT WINAPI HTMLLabelElement_GetIDsOfNames(IHTMLLabelElement *iface, REFIID riid,
1523 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1525 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1527 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1528 cNames, lcid, rgDispId);
1531 static HRESULT WINAPI HTMLLabelElement_Invoke(IHTMLLabelElement *iface, DISPID dispIdMember,
1532 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1533 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1535 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1537 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1538 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1541 static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BSTR v)
1543 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1544 nsAString for_str, val_str;
1545 nsresult nsres;
1547 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1549 nsAString_InitDepend(&for_str, L"for");
1550 nsAString_InitDepend(&val_str, v);
1551 nsres = nsIDOMElement_SetAttribute(This->element.dom_element, &for_str, &val_str);
1552 nsAString_Finish(&for_str);
1553 nsAString_Finish(&val_str);
1554 if(NS_FAILED(nsres)) {
1555 ERR("SetAttribute failed: %08x\n", nsres);
1556 return E_FAIL;
1559 return S_OK;
1562 static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p)
1564 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1566 TRACE("(%p)->(%p)\n", This, p);
1568 return elem_string_attr_getter(&This->element, L"for", FALSE, p);
1571 static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)
1573 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1574 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1575 return E_NOTIMPL;
1578 static HRESULT WINAPI HTMLLabelElement_get_accessKey(IHTMLLabelElement *iface, BSTR *p)
1580 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1581 FIXME("(%p)->(%p)\n", This, p);
1582 return E_NOTIMPL;
1585 static const IHTMLLabelElementVtbl HTMLLabelElementVtbl = {
1586 HTMLLabelElement_QueryInterface,
1587 HTMLLabelElement_AddRef,
1588 HTMLLabelElement_Release,
1589 HTMLLabelElement_GetTypeInfoCount,
1590 HTMLLabelElement_GetTypeInfo,
1591 HTMLLabelElement_GetIDsOfNames,
1592 HTMLLabelElement_Invoke,
1593 HTMLLabelElement_put_htmlFor,
1594 HTMLLabelElement_get_htmlFor,
1595 HTMLLabelElement_put_accessKey,
1596 HTMLLabelElement_get_accessKey
1599 static inline HTMLLabelElement *label_from_HTMLDOMNode(HTMLDOMNode *iface)
1601 return CONTAINING_RECORD(iface, HTMLLabelElement, element.node);
1604 static HRESULT HTMLLabelElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1606 HTMLLabelElement *This = label_from_HTMLDOMNode(iface);
1608 *ppv = NULL;
1610 if(IsEqualGUID(&IID_IUnknown, riid)) {
1611 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1612 *ppv = &This->IHTMLLabelElement_iface;
1613 }else if(IsEqualGUID(&IID_IHTMLLabelElement, riid)) {
1614 TRACE("(%p)->(IID_IHTMLLabelElement %p)\n", This, ppv);
1615 *ppv = &This->IHTMLLabelElement_iface;
1616 }else {
1617 return HTMLElement_QI(&This->element.node, riid, ppv);
1620 IUnknown_AddRef((IUnknown*)*ppv);
1621 return S_OK;
1624 static const NodeImplVtbl HTMLLabelElementImplVtbl = {
1625 &CLSID_HTMLLabelElement,
1626 HTMLLabelElement_QI,
1627 HTMLElement_destructor,
1628 HTMLElement_cpc,
1629 HTMLElement_clone,
1630 HTMLElement_handle_event,
1631 HTMLElement_get_attr_col,
1634 static const tid_t HTMLLabelElement_iface_tids[] = {
1635 HTMLELEMENT_TIDS,
1636 IHTMLLabelElement_tid,
1640 static dispex_static_data_t HTMLLabelElement_dispex = {
1641 NULL,
1642 DispHTMLLabelElement_tid,
1643 HTMLLabelElement_iface_tids,
1644 HTMLElement_init_dispex_info
1647 HRESULT HTMLLabelElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
1649 HTMLLabelElement *ret;
1651 ret = heap_alloc_zero(sizeof(*ret));
1652 if(!ret)
1653 return E_OUTOFMEMORY;
1655 ret->IHTMLLabelElement_iface.lpVtbl = &HTMLLabelElementVtbl;
1656 ret->element.node.vtbl = &HTMLLabelElementImplVtbl;
1658 HTMLElement_Init(&ret->element, doc, nselem, &HTMLLabelElement_dispex);
1659 *elem = &ret->element;
1660 return S_OK;
1663 struct HTMLButtonElement {
1664 HTMLElement element;
1666 IHTMLButtonElement IHTMLButtonElement_iface;
1668 nsIDOMHTMLButtonElement *nsbutton;
1671 static inline HTMLButtonElement *impl_from_IHTMLButtonElement(IHTMLButtonElement *iface)
1673 return CONTAINING_RECORD(iface, HTMLButtonElement, IHTMLButtonElement_iface);
1676 static HRESULT WINAPI HTMLButtonElement_QueryInterface(IHTMLButtonElement *iface,
1677 REFIID riid, void **ppv)
1679 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1681 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1684 static ULONG WINAPI HTMLButtonElement_AddRef(IHTMLButtonElement *iface)
1686 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1688 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1691 static ULONG WINAPI HTMLButtonElement_Release(IHTMLButtonElement *iface)
1693 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1695 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1698 static HRESULT WINAPI HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement *iface, UINT *pctinfo)
1700 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1702 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1705 static HRESULT WINAPI HTMLButtonElement_GetTypeInfo(IHTMLButtonElement *iface, UINT iTInfo,
1706 LCID lcid, ITypeInfo **ppTInfo)
1708 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1710 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1713 static HRESULT WINAPI HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement *iface, REFIID riid,
1714 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1716 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1718 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1719 cNames, lcid, rgDispId);
1722 static HRESULT WINAPI HTMLButtonElement_Invoke(IHTMLButtonElement *iface, DISPID dispIdMember,
1723 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1724 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1726 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1728 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1729 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1732 static HRESULT WINAPI HTMLButtonElement_get_type(IHTMLButtonElement *iface, BSTR *p)
1734 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1735 nsAString type_str;
1736 nsresult nsres;
1738 TRACE("(%p)->(%p)\n", This, p);
1740 nsAString_Init(&type_str, NULL);
1741 nsres = nsIDOMHTMLButtonElement_GetType(This->nsbutton, &type_str);
1742 return return_nsstr(nsres, &type_str, p);
1745 static HRESULT WINAPI HTMLButtonElement_put_value(IHTMLButtonElement *iface, BSTR v)
1747 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1748 nsAString nsstr;
1749 nsresult nsres;
1751 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1753 nsAString_InitDepend(&nsstr, v);
1754 nsres = nsIDOMHTMLButtonElement_SetValue(This->nsbutton, &nsstr);
1755 nsAString_Finish(&nsstr);
1756 if(NS_FAILED(nsres)) {
1757 ERR("SetValue failed: %08x\n", nsres);
1758 return E_FAIL;
1761 return S_OK;
1764 static HRESULT WINAPI HTMLButtonElement_get_value(IHTMLButtonElement *iface, BSTR *p)
1766 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1767 nsAString value_str;
1768 nsresult nsres;
1770 TRACE("(%p)->(%p)\n", This, p);
1772 nsAString_Init(&value_str, NULL);
1773 nsres = nsIDOMHTMLButtonElement_GetValue(This->nsbutton, &value_str);
1774 return return_nsstr(nsres, &value_str, p);
1777 static HRESULT WINAPI HTMLButtonElement_put_name(IHTMLButtonElement *iface, BSTR v)
1779 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1780 nsAString name_str;
1781 nsresult nsres;
1783 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1785 nsAString_InitDepend(&name_str, v);
1786 nsres = nsIDOMHTMLButtonElement_SetName(This->nsbutton, &name_str);
1787 nsAString_Finish(&name_str);
1788 if(NS_FAILED(nsres)) {
1789 ERR("SetName failed: %08x\n", nsres);
1790 return E_FAIL;
1793 return S_OK;
1796 static HRESULT WINAPI HTMLButtonElement_get_name(IHTMLButtonElement *iface, BSTR *p)
1798 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1799 nsAString name_str;
1800 nsresult nsres;
1802 TRACE("(%p)->(%p)\n", This, p);
1804 nsAString_Init(&name_str, NULL);
1805 nsres = nsIDOMHTMLButtonElement_GetName(This->nsbutton, &name_str);
1806 return return_nsstr(nsres, &name_str, p);
1809 static HRESULT WINAPI HTMLButtonElement_put_status(IHTMLButtonElement *iface, VARIANT v)
1811 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1812 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1813 return E_NOTIMPL;
1816 static HRESULT WINAPI HTMLButtonElement_get_status(IHTMLButtonElement *iface, VARIANT *p)
1818 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1819 FIXME("(%p)->(%p)\n", This, p);
1820 return E_NOTIMPL;
1823 static HRESULT WINAPI HTMLButtonElement_put_disabled(IHTMLButtonElement *iface, VARIANT_BOOL v)
1825 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1826 nsresult nsres;
1828 TRACE("(%p)->(%x)\n", This, v);
1830 nsres = nsIDOMHTMLButtonElement_SetDisabled(This->nsbutton, !!v);
1831 if(NS_FAILED(nsres)) {
1832 ERR("SetDisabled failed: %08x\n", nsres);
1833 return E_FAIL;
1836 return S_OK;
1839 static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface, VARIANT_BOOL *p)
1841 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1842 cpp_bool disabled;
1843 nsresult nsres;
1845 TRACE("(%p)->(%p)\n", This, p);
1847 nsres = nsIDOMHTMLButtonElement_GetDisabled(This->nsbutton, &disabled);
1848 if(NS_FAILED(nsres)) {
1849 ERR("GetDisabled failed: %08x\n", nsres);
1850 return E_FAIL;
1853 *p = variant_bool(disabled);
1854 return S_OK;
1857 static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTMLFormElement **p)
1859 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1860 nsIDOMHTMLFormElement *nsform;
1861 nsresult nsres;
1863 TRACE("(%p)->(%p)\n", This, p);
1865 nsres = nsIDOMHTMLButtonElement_GetForm(This->nsbutton, &nsform);
1866 return return_nsform(nsres, nsform, p);
1869 static HRESULT WINAPI HTMLButtonElement_createTextRange(IHTMLButtonElement *iface, IHTMLTxtRange **range)
1871 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1872 FIXME("(%p)->(%p)\n", This, range);
1873 return E_NOTIMPL;
1876 static const IHTMLButtonElementVtbl HTMLButtonElementVtbl = {
1877 HTMLButtonElement_QueryInterface,
1878 HTMLButtonElement_AddRef,
1879 HTMLButtonElement_Release,
1880 HTMLButtonElement_GetTypeInfoCount,
1881 HTMLButtonElement_GetTypeInfo,
1882 HTMLButtonElement_GetIDsOfNames,
1883 HTMLButtonElement_Invoke,
1884 HTMLButtonElement_get_type,
1885 HTMLButtonElement_put_value,
1886 HTMLButtonElement_get_value,
1887 HTMLButtonElement_put_name,
1888 HTMLButtonElement_get_name,
1889 HTMLButtonElement_put_status,
1890 HTMLButtonElement_get_status,
1891 HTMLButtonElement_put_disabled,
1892 HTMLButtonElement_get_disabled,
1893 HTMLButtonElement_get_form,
1894 HTMLButtonElement_createTextRange
1897 static inline HTMLButtonElement *button_from_HTMLDOMNode(HTMLDOMNode *iface)
1899 return CONTAINING_RECORD(iface, HTMLButtonElement, element.node);
1902 static HRESULT HTMLButtonElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1904 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1906 *ppv = NULL;
1908 if(IsEqualGUID(&IID_IUnknown, riid)) {
1909 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1910 *ppv = &This->IHTMLButtonElement_iface;
1911 }else if(IsEqualGUID(&IID_IHTMLButtonElement, riid)) {
1912 TRACE("(%p)->(IID_IHTMLButtonElement %p)\n", This, ppv);
1913 *ppv = &This->IHTMLButtonElement_iface;
1914 }else {
1915 return HTMLElement_QI(&This->element.node, riid, ppv);
1918 IUnknown_AddRef((IUnknown*)*ppv);
1919 return S_OK;
1922 static HRESULT HTMLButtonElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1924 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1925 return IHTMLButtonElement_put_disabled(&This->IHTMLButtonElement_iface, v);
1928 static HRESULT HTMLButtonElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1930 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1931 return IHTMLButtonElement_get_disabled(&This->IHTMLButtonElement_iface, p);
1934 static BOOL HTMLButtonElement_is_text_edit(HTMLDOMNode *iface)
1936 return TRUE;
1939 static void HTMLButtonElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1941 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1943 if(This->nsbutton)
1944 note_cc_edge((nsISupports*)This->nsbutton, "This->nsbutton", cb);
1947 static void HTMLButtonElement_unlink(HTMLDOMNode *iface)
1949 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1951 if(This->nsbutton) {
1952 nsIDOMHTMLButtonElement *nsbutton = This->nsbutton;
1954 This->nsbutton = NULL;
1955 nsIDOMHTMLButtonElement_Release(nsbutton);
1959 static const NodeImplVtbl HTMLButtonElementImplVtbl = {
1960 &CLSID_HTMLButtonElement,
1961 HTMLButtonElement_QI,
1962 HTMLElement_destructor,
1963 HTMLElement_cpc,
1964 HTMLElement_clone,
1965 HTMLElement_handle_event,
1966 HTMLElement_get_attr_col,
1967 NULL,
1968 HTMLButtonElementImpl_put_disabled,
1969 HTMLButtonElementImpl_get_disabled,
1970 NULL,
1971 NULL,
1972 NULL,
1973 NULL,
1974 NULL,
1975 HTMLButtonElement_traverse,
1976 HTMLButtonElement_unlink,
1977 HTMLButtonElement_is_text_edit
1980 static const tid_t HTMLButtonElement_iface_tids[] = {
1981 HTMLELEMENT_TIDS,
1982 IHTMLButtonElement_tid,
1986 static dispex_static_data_t HTMLButtonElement_dispex = {
1987 NULL,
1988 DispHTMLButtonElement_tid,
1989 HTMLButtonElement_iface_tids,
1990 HTMLElement_init_dispex_info
1993 HRESULT HTMLButtonElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
1995 HTMLButtonElement *ret;
1996 nsresult nsres;
1998 ret = heap_alloc_zero(sizeof(*ret));
1999 if(!ret)
2000 return E_OUTOFMEMORY;
2002 ret->IHTMLButtonElement_iface.lpVtbl = &HTMLButtonElementVtbl;
2003 ret->element.node.vtbl = &HTMLButtonElementImplVtbl;
2005 HTMLElement_Init(&ret->element, doc, nselem, &HTMLButtonElement_dispex);
2007 nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLButtonElement, (void**)&ret->nsbutton);
2008 assert(nsres == NS_OK);
2010 *elem = &ret->element;
2011 return S_OK;