winegstreamer: Remove useless FIXME.
[wine/wine-gecko.git] / dlls / mshtml / htmlinput.c
bloba174634ab925b4e1d803971f234b3018c23d59df
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>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 typedef struct {
36 HTMLElement element;
38 IHTMLInputElement IHTMLInputElement_iface;
39 IHTMLInputTextElement IHTMLInputTextElement_iface;
41 nsIDOMHTMLInputElement *nsinput;
42 } HTMLInputElement;
44 static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
46 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
49 static inline HTMLInputElement *impl_from_IHTMLInputTextElement(IHTMLInputTextElement *iface)
51 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement_iface);
54 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
55 REFIID riid, void **ppv)
57 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
59 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
62 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
64 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
66 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
69 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
71 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
73 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
76 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
78 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
80 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
83 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
84 LCID lcid, ITypeInfo **ppTInfo)
86 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
88 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
89 ppTInfo);
92 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
93 LPOLESTR *rgszNames, UINT cNames,
94 LCID lcid, DISPID *rgDispId)
96 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
98 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
99 cNames, lcid, rgDispId);
102 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
103 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
104 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
106 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
108 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
109 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
112 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
114 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
115 nsAString type_str;
116 nsresult nsres;
118 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
121 * FIXME:
122 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
124 nsAString_InitDepend(&type_str, v);
125 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
126 nsAString_Finish(&type_str);
127 if(NS_FAILED(nsres)) {
128 ERR("SetType failed: %08x\n", nsres);
129 return E_FAIL;
132 return S_OK;
135 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
137 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
138 nsAString type_str;
139 nsresult nsres;
141 TRACE("(%p)->(%p)\n", This, p);
143 nsAString_Init(&type_str, NULL);
144 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
145 return return_nsstr(nsres, &type_str, p);
148 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
150 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
151 nsAString val_str;
152 nsresult nsres;
154 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
156 nsAString_InitDepend(&val_str, v);
157 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
158 nsAString_Finish(&val_str);
159 if(NS_FAILED(nsres))
160 ERR("SetValue failed: %08x\n", nsres);
162 return S_OK;
165 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
167 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
168 nsAString value_str;
169 nsresult nsres;
171 TRACE("(%p)->(%p)\n", This, p);
173 nsAString_Init(&value_str, NULL);
174 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
175 return return_nsstr(nsres, &value_str, p);
178 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
180 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
181 nsAString name_str;
182 nsresult nsres;
184 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
186 nsAString_InitDepend(&name_str, v);
187 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
188 nsAString_Finish(&name_str);
189 if(NS_FAILED(nsres)) {
190 ERR("SetName failed: %08x\n", nsres);
191 return E_FAIL;
194 return S_OK;
197 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
199 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
200 nsAString name_str;
201 nsresult nsres;
203 TRACE("(%p)->(%p)\n", This, p);
205 nsAString_Init(&name_str, NULL);
206 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
207 return return_nsstr(nsres, &name_str, p);
210 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
212 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
213 FIXME("(%p)->(%x)\n", This, v);
214 return E_NOTIMPL;
217 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
219 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
220 FIXME("(%p)->(%p)\n", This, p);
221 return E_NOTIMPL;
224 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
226 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
227 nsresult nsres;
229 TRACE("(%p)->(%x)\n", This, v);
231 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
232 if(NS_FAILED(nsres))
233 ERR("SetDisabled failed: %08x\n", nsres);
235 return S_OK;
238 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
240 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
241 cpp_bool disabled = FALSE;
243 TRACE("(%p)->(%p)\n", This, p);
245 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
247 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
248 return S_OK;
251 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
253 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
254 FIXME("(%p)->(%p)\n", This, p);
255 return E_NOTIMPL;
258 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
260 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
261 FIXME("(%p)->(%d)\n", This, v);
262 return E_NOTIMPL;
265 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
267 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
268 FIXME("(%p)->(%p)\n", This, p);
269 return E_NOTIMPL;
272 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
274 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
275 FIXME("(%p)->(%d)\n", This, v);
276 return E_NOTIMPL;
279 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
281 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
282 FIXME("(%p)->(%p)\n", This, p);
283 return E_NOTIMPL;
286 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
288 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
289 nsresult nsres;
291 TRACE("(%p)\n", This);
293 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
294 if(NS_FAILED(nsres)) {
295 ERR("Select failed: %08x\n", nsres);
296 return E_FAIL;
299 return S_OK;
302 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
304 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
305 FIXME("(%p)->()\n", This);
306 return E_NOTIMPL;
309 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
311 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
312 FIXME("(%p)->(%p)\n", This, p);
313 return E_NOTIMPL;
316 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
318 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
319 FIXME("(%p)->()\n", This);
320 return E_NOTIMPL;
323 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
325 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
326 FIXME("(%p)->(%p)\n", This, p);
327 return E_NOTIMPL;
330 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
332 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
333 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
334 return E_NOTIMPL;
337 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
339 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
340 FIXME("(%p)->(%p)\n", This, p);
341 return E_NOTIMPL;
344 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
346 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
347 FIXME("(%p)->(%x)\n", This, v);
348 return E_NOTIMPL;
351 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
353 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
354 FIXME("(%p)->(%p)\n", This, p);
355 return E_NOTIMPL;
358 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
360 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
361 FIXME("(%p)->(%p)\n", This, range);
362 return E_NOTIMPL;
365 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
367 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
368 FIXME("(%p)->(%x)\n", This, v);
369 return E_NOTIMPL;
372 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
374 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
375 FIXME("(%p)->(%p)\n", This, p);
376 return E_NOTIMPL;
379 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
381 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
382 nsresult nsres;
384 TRACE("(%p)->(%x)\n", This, v);
386 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
387 if(NS_FAILED(nsres)) {
388 ERR("SetDefaultChecked failed: %08x\n", nsres);
389 return E_FAIL;
392 return S_OK;
395 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
397 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
398 cpp_bool default_checked = FALSE;
399 nsresult nsres;
401 TRACE("(%p)->(%p)\n", This, p);
403 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
404 if(NS_FAILED(nsres)) {
405 ERR("GetDefaultChecked failed: %08x\n", nsres);
406 return E_FAIL;
409 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
410 return S_OK;
413 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
415 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
416 nsresult nsres;
418 TRACE("(%p)->(%x)\n", This, v);
420 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
421 if(NS_FAILED(nsres)) {
422 ERR("SetChecked failed: %08x\n", nsres);
423 return E_FAIL;
426 return S_OK;
429 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
431 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
432 cpp_bool checked;
433 nsresult nsres;
435 TRACE("(%p)->(%p)\n", This, p);
437 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
438 if(NS_FAILED(nsres)) {
439 ERR("GetChecked failed: %08x\n", nsres);
440 return E_FAIL;
443 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
444 TRACE("checked=%x\n", *p);
445 return S_OK;
448 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
450 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
451 FIXME("(%p)->()\n", This);
452 return E_NOTIMPL;
455 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
457 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
458 FIXME("(%p)->(%p)\n", This, p);
459 return E_NOTIMPL;
462 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
464 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
465 FIXME("(%p)->(%d)\n", This, v);
466 return E_NOTIMPL;
469 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
471 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
472 FIXME("(%p)->(%p)\n", This, p);
473 return E_NOTIMPL;
476 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
478 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
479 FIXME("(%p)->(%d)\n", This, v);
480 return E_NOTIMPL;
483 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
485 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
486 FIXME("(%p)->(%p)\n", This, p);
487 return E_NOTIMPL;
490 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
492 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
493 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
494 return E_NOTIMPL;
497 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
499 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
500 FIXME("(%p)->(%p)\n", This, p);
501 return E_NOTIMPL;
504 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
506 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
507 nsAString nsstr;
508 nsresult nsres;
510 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
512 nsAString_InitDepend(&nsstr, v);
513 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
514 nsAString_Finish(&nsstr);
515 if(NS_FAILED(nsres))
516 ERR("SetSrc failed: %08x\n", nsres);
518 return S_OK;
521 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
523 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
524 const PRUnichar *src;
525 nsAString src_str;
526 nsresult nsres;
527 HRESULT hres;
529 TRACE("(%p)->(%p)\n", This, p);
531 nsAString_Init(&src_str, NULL);
532 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
533 if(NS_FAILED(nsres)) {
534 ERR("GetSrc failed: %08x\n", nsres);
535 return E_FAIL;
538 nsAString_GetData(&src_str, &src);
539 hres = nsuri_to_url(src, FALSE, p);
540 nsAString_Finish(&src_str);
542 return hres;
545 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
547 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
548 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
549 return E_NOTIMPL;
552 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
554 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
555 FIXME("(%p)->(%p)\n", This, p);
556 return E_NOTIMPL;
559 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
561 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
562 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
563 return E_NOTIMPL;
566 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
568 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
569 FIXME("(%p)->(%p)\n", This, p);
570 return E_NOTIMPL;
573 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
575 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
576 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
577 return E_NOTIMPL;
580 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
582 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
583 FIXME("(%p)->(%p)\n", This, p);
584 return E_NOTIMPL;
587 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
589 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
590 FIXME("(%p)->(%p)\n", This, p);
591 return E_NOTIMPL;
594 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
596 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
597 FIXME("(%p)->(%p)\n", This, p);
598 return E_NOTIMPL;
601 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
603 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
604 FIXME("(%p)->()\n", This);
605 return E_NOTIMPL;
608 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
610 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
611 FIXME("(%p)->(%p)\n", This, p);
612 return E_NOTIMPL;
615 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
617 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
618 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
619 return E_NOTIMPL;
622 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
624 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
625 FIXME("(%p)->(%p)\n", This, p);
626 return E_NOTIMPL;
629 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
631 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
632 FIXME("(%p)->()\n", This);
633 return E_NOTIMPL;
636 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
638 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
639 FIXME("(%p)->(%p)\n", This, p);
640 return E_NOTIMPL;
643 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
645 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
646 FIXME("(%p)->()\n", This);
647 return E_NOTIMPL;
650 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
652 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
653 FIXME("(%p)->(%p)\n", This, p);
654 return E_NOTIMPL;
657 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
659 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
660 FIXME("(%p)->()\n", This);
661 return E_NOTIMPL;
664 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
666 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
667 FIXME("(%p)->(%p)\n", This, p);
668 return E_NOTIMPL;
671 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
673 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
674 FIXME("(%p)->(%d)\n", This, v);
675 return E_NOTIMPL;
678 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
680 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
681 FIXME("(%p)->(%p)\n", This, p);
682 return E_NOTIMPL;
685 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
687 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
688 FIXME("(%p)->(%d)\n", This, v);
689 return E_NOTIMPL;
692 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
694 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
695 FIXME("(%p)->(%p)\n", This, p);
696 return E_NOTIMPL;
699 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
701 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
702 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
703 return E_NOTIMPL;
706 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
708 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
709 FIXME("(%p)->(%p)\n", This, p);
710 return E_NOTIMPL;
713 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
714 HTMLInputElement_QueryInterface,
715 HTMLInputElement_AddRef,
716 HTMLInputElement_Release,
717 HTMLInputElement_GetTypeInfoCount,
718 HTMLInputElement_GetTypeInfo,
719 HTMLInputElement_GetIDsOfNames,
720 HTMLInputElement_Invoke,
721 HTMLInputElement_put_type,
722 HTMLInputElement_get_type,
723 HTMLInputElement_put_value,
724 HTMLInputElement_get_value,
725 HTMLInputElement_put_name,
726 HTMLInputElement_get_name,
727 HTMLInputElement_put_status,
728 HTMLInputElement_get_status,
729 HTMLInputElement_put_disabled,
730 HTMLInputElement_get_disabled,
731 HTMLInputElement_get_form,
732 HTMLInputElement_put_size,
733 HTMLInputElement_get_size,
734 HTMLInputElement_put_maxLength,
735 HTMLInputElement_get_maxLength,
736 HTMLInputElement_select,
737 HTMLInputElement_put_onchange,
738 HTMLInputElement_get_onchange,
739 HTMLInputElement_put_onselect,
740 HTMLInputElement_get_onselect,
741 HTMLInputElement_put_defaultValue,
742 HTMLInputElement_get_defaultValue,
743 HTMLInputElement_put_readOnly,
744 HTMLInputElement_get_readOnly,
745 HTMLInputElement_createTextRange,
746 HTMLInputElement_put_indeterminate,
747 HTMLInputElement_get_indeterminate,
748 HTMLInputElement_put_defaultChecked,
749 HTMLInputElement_get_defaultChecked,
750 HTMLInputElement_put_checked,
751 HTMLInputElement_get_checked,
752 HTMLInputElement_put_border,
753 HTMLInputElement_get_border,
754 HTMLInputElement_put_vspace,
755 HTMLInputElement_get_vspace,
756 HTMLInputElement_put_hspace,
757 HTMLInputElement_get_hspace,
758 HTMLInputElement_put_alt,
759 HTMLInputElement_get_alt,
760 HTMLInputElement_put_src,
761 HTMLInputElement_get_src,
762 HTMLInputElement_put_lowsrc,
763 HTMLInputElement_get_lowsrc,
764 HTMLInputElement_put_vrml,
765 HTMLInputElement_get_vrml,
766 HTMLInputElement_put_dynsrc,
767 HTMLInputElement_get_dynsrc,
768 HTMLInputElement_get_readyState,
769 HTMLInputElement_get_complete,
770 HTMLInputElement_put_loop,
771 HTMLInputElement_get_loop,
772 HTMLInputElement_put_align,
773 HTMLInputElement_get_align,
774 HTMLInputElement_put_onload,
775 HTMLInputElement_get_onload,
776 HTMLInputElement_put_onerror,
777 HTMLInputElement_get_onerror,
778 HTMLInputElement_put_onabort,
779 HTMLInputElement_get_onabort,
780 HTMLInputElement_put_width,
781 HTMLInputElement_get_width,
782 HTMLInputElement_put_height,
783 HTMLInputElement_get_height,
784 HTMLInputElement_put_start,
785 HTMLInputElement_get_start
788 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
789 REFIID riid, void **ppv)
791 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
793 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
796 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
798 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
800 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
803 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
805 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
807 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
810 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
812 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
813 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
816 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
817 LCID lcid, ITypeInfo **ppTInfo)
819 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
820 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
821 ppTInfo);
824 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
825 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
827 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
828 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
829 cNames, lcid, rgDispId);
832 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
833 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
834 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
836 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
837 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
838 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
841 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
843 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
845 TRACE("(%p)->(%p)\n", This, p);
847 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
850 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
852 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
854 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
856 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
859 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
861 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
863 TRACE("(%p)->(%p)\n", This, p);
865 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
868 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
870 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
872 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
874 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
877 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
879 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
881 TRACE("(%p)->(%p)\n", This, p);
883 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
886 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
888 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
889 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
890 return E_NOTIMPL;
893 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
895 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
896 TRACE("(%p)->(%p)\n", This, p);
897 return E_NOTIMPL;
900 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
902 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
904 TRACE("(%p)->(%x)\n", This, v);
906 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
909 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
911 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
913 TRACE("(%p)->(%p)\n", This, p);
915 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
918 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
920 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
922 TRACE("(%p)->(%p)\n", This, p);
924 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
927 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
929 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
931 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
933 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
936 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
938 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
940 TRACE("(%p)->(%p)\n", This, p);
942 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
945 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
947 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
949 TRACE("(%p)->(%d)\n", This, v);
951 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
954 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
956 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
958 TRACE("(%p)->(%p)\n", This, p);
960 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
963 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
965 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
967 TRACE("(%p)->(%d)\n", This, v);
969 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
972 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
974 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
976 TRACE("(%p)->(%p)\n", This, p);
978 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
981 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
983 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
985 TRACE("(%p)\n", This);
987 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
990 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
992 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
994 TRACE("(%p)->()\n", This);
996 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
999 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1001 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1003 TRACE("(%p)->(%p)\n", This, p);
1005 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1008 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1010 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1012 TRACE("(%p)->()\n", This);
1014 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1017 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1019 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1021 TRACE("(%p)->(%p)\n", This, p);
1023 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1026 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1028 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1030 TRACE("(%p)->(%x)\n", This, v);
1032 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1035 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1037 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1039 TRACE("(%p)->(%p)\n", This, p);
1041 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1044 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1046 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1048 TRACE("(%p)->(%p)\n", This, range);
1050 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1053 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1054 HTMLInputTextElement_QueryInterface,
1055 HTMLInputTextElement_AddRef,
1056 HTMLInputTextElement_Release,
1057 HTMLInputTextElement_GetTypeInfoCount,
1058 HTMLInputTextElement_GetTypeInfo,
1059 HTMLInputTextElement_GetIDsOfNames,
1060 HTMLInputTextElement_Invoke,
1061 HTMLInputTextElement_get_type,
1062 HTMLInputTextElement_put_value,
1063 HTMLInputTextElement_get_value,
1064 HTMLInputTextElement_put_name,
1065 HTMLInputTextElement_get_name,
1066 HTMLInputTextElement_put_status,
1067 HTMLInputTextElement_get_status,
1068 HTMLInputTextElement_put_disabled,
1069 HTMLInputTextElement_get_disabled,
1070 HTMLInputTextElement_get_form,
1071 HTMLInputTextElement_put_defaultValue,
1072 HTMLInputTextElement_get_defaultValue,
1073 HTMLInputTextElement_put_size,
1074 HTMLInputTextElement_get_size,
1075 HTMLInputTextElement_put_maxLength,
1076 HTMLInputTextElement_get_maxLength,
1077 HTMLInputTextElement_select,
1078 HTMLInputTextElement_put_onchange,
1079 HTMLInputTextElement_get_onchange,
1080 HTMLInputTextElement_put_onselect,
1081 HTMLInputTextElement_get_onselect,
1082 HTMLInputTextElement_put_readOnly,
1083 HTMLInputTextElement_get_readOnly,
1084 HTMLInputTextElement_createTextRange
1087 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1089 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1092 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1094 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1096 *ppv = NULL;
1098 if(IsEqualGUID(&IID_IUnknown, riid)) {
1099 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1100 *ppv = &This->IHTMLInputElement_iface;
1101 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1102 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1103 *ppv = &This->IHTMLInputElement_iface;
1104 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1105 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1106 *ppv = &This->IHTMLInputElement_iface;
1107 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1108 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1109 *ppv = &This->IHTMLInputTextElement_iface;
1112 if(*ppv) {
1113 IUnknown_AddRef((IUnknown*)*ppv);
1114 return S_OK;
1117 return HTMLElement_QI(&This->element.node, riid, ppv);
1120 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1122 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1124 nsIDOMHTMLInputElement_Release(This->nsinput);
1126 HTMLElement_destructor(&This->element.node);
1129 static HRESULT HTMLInputElementImpl_fire_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1131 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1133 if(eid == EVENTID_CLICK) {
1134 nsresult nsres;
1136 *handled = TRUE;
1138 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1139 if(NS_FAILED(nsres)) {
1140 ERR("Click failed: %08x\n", nsres);
1141 return E_FAIL;
1145 return S_OK;
1148 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1150 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1151 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1154 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1156 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1157 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1160 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1161 HTMLInputElement_QI,
1162 HTMLInputElement_destructor,
1163 HTMLElement_clone,
1164 HTMLElement_get_attr_col,
1165 NULL,
1166 HTMLInputElementImpl_fire_event,
1167 NULL,
1168 HTMLInputElementImpl_put_disabled,
1169 HTMLInputElementImpl_get_disabled,
1172 static const tid_t HTMLInputElement_iface_tids[] = {
1173 HTMLELEMENT_TIDS,
1174 IHTMLInputElement_tid,
1177 static dispex_static_data_t HTMLInputElement_dispex = {
1178 NULL,
1179 DispHTMLInputElement_tid,
1180 NULL,
1181 HTMLInputElement_iface_tids
1184 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1186 HTMLInputElement *ret;
1187 nsresult nsres;
1189 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1190 if(!ret)
1191 return E_OUTOFMEMORY;
1193 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1194 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1195 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1197 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1198 if(NS_FAILED(nsres)) {
1199 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1200 heap_free(ret);
1201 return E_FAIL;
1204 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1206 *elem = &ret->element;
1207 return S_OK;