shell32: Add printers CLSID to test, clean up a bit.
[wine/testsucceed.git] / dlls / mshtml / htmlinput.c
blob1b8d1c5413fd5d438271acc407ebf4603951ab83
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 const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
39 const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
41 nsIDOMHTMLInputElement *nsinput;
42 } HTMLInputElement;
44 #define HTMLINPUT(x) ((IHTMLInputElement*) &(x)->lpHTMLInputElementVtbl)
45 #define HTMLINPUTTEXT(x) (&(x)->lpHTMLInputTextElementVtbl)
47 #define HTMLINPUT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputElement, iface)
49 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
50 REFIID riid, void **ppv)
52 HTMLInputElement *This = HTMLINPUT_THIS(iface);
54 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
57 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
59 HTMLInputElement *This = HTMLINPUT_THIS(iface);
61 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
64 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
66 HTMLInputElement *This = HTMLINPUT_THIS(iface);
68 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
71 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
73 HTMLInputElement *This = HTMLINPUT_THIS(iface);
75 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
78 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
79 LCID lcid, ITypeInfo **ppTInfo)
81 HTMLInputElement *This = HTMLINPUT_THIS(iface);
83 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
86 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
87 LPOLESTR *rgszNames, UINT cNames,
88 LCID lcid, DISPID *rgDispId)
90 HTMLInputElement *This = HTMLINPUT_THIS(iface);
92 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
93 cNames, lcid, rgDispId);
96 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
97 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
98 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
100 HTMLInputElement *This = HTMLINPUT_THIS(iface);
102 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
103 pDispParams, pVarResult, pExcepInfo, puArgErr);
106 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
108 HTMLInputElement *This = HTMLINPUT_THIS(iface);
109 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
110 return E_NOTIMPL;
113 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
115 HTMLInputElement *This = HTMLINPUT_THIS(iface);
116 nsAString type_str;
117 const PRUnichar *type;
118 nsresult nsres;
120 TRACE("(%p)->(%p)\n", This, p);
122 nsAString_Init(&type_str, NULL);
123 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
125 if(NS_SUCCEEDED(nsres)) {
126 nsAString_GetData(&type_str, &type);
127 *p = SysAllocString(type);
128 }else {
129 ERR("GetType failed: %08x\n", nsres);
132 nsAString_Finish(&type_str);
134 TRACE("type=%s\n", debugstr_w(*p));
135 return S_OK;
138 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
140 HTMLInputElement *This = HTMLINPUT_THIS(iface);
141 nsAString val_str;
142 nsresult nsres;
144 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
146 nsAString_InitDepend(&val_str, v);
147 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
148 nsAString_Finish(&val_str);
149 if(NS_FAILED(nsres))
150 ERR("SetValue failed: %08x\n", nsres);
152 return S_OK;
155 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
157 HTMLInputElement *This = HTMLINPUT_THIS(iface);
158 nsAString value_str;
159 const PRUnichar *value = NULL;
160 nsresult nsres;
162 TRACE("(%p)->(%p)\n", This, p);
164 nsAString_Init(&value_str, NULL);
166 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
167 if(NS_SUCCEEDED(nsres)) {
168 nsAString_GetData(&value_str, &value);
169 *p = SysAllocString(value);
170 }else {
171 ERR("GetValue failed: %08x\n", nsres);
174 nsAString_Finish(&value_str);
176 TRACE("value=%s\n", debugstr_w(*p));
177 return S_OK;
180 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
182 HTMLInputElement *This = HTMLINPUT_THIS(iface);
183 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
184 return E_NOTIMPL;
187 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
189 HTMLInputElement *This = HTMLINPUT_THIS(iface);
190 nsAString name_str;
191 const PRUnichar *name;
192 nsresult nsres;
194 TRACE("(%p)->(%p)\n", This, p);
196 nsAString_Init(&name_str, NULL);
198 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
199 if(NS_SUCCEEDED(nsres)) {
200 nsAString_GetData(&name_str, &name);
201 *p = SysAllocString(name);
202 }else {
203 ERR("GetName failed: %08x\n", nsres);
204 return E_FAIL;
207 nsAString_Finish(&name_str);
209 TRACE("name=%s\n", debugstr_w(*p));
210 return S_OK;
213 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
215 HTMLInputElement *This = HTMLINPUT_THIS(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 = HTMLINPUT_THIS(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 = HTMLINPUT_THIS(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 = HTMLINPUT_THIS(iface);
244 PRBool disabled = FALSE;
246 TRACE("(%p)->(%p)\n", This, p);
248 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
250 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
251 return S_OK;
254 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
256 HTMLInputElement *This = HTMLINPUT_THIS(iface);
257 FIXME("(%p)->(%p)\n", This, p);
258 return E_NOTIMPL;
261 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
263 HTMLInputElement *This = HTMLINPUT_THIS(iface);
264 FIXME("(%p)->(%d)\n", This, v);
265 return E_NOTIMPL;
268 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
270 HTMLInputElement *This = HTMLINPUT_THIS(iface);
271 FIXME("(%p)->(%p)\n", This, p);
272 return E_NOTIMPL;
275 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
277 HTMLInputElement *This = HTMLINPUT_THIS(iface);
278 FIXME("(%p)->(%d)\n", This, v);
279 return E_NOTIMPL;
282 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
284 HTMLInputElement *This = HTMLINPUT_THIS(iface);
285 FIXME("(%p)->(%p)\n", This, p);
286 return E_NOTIMPL;
289 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
291 HTMLInputElement *This = HTMLINPUT_THIS(iface);
292 nsresult nsres;
294 TRACE("(%p)\n", This);
296 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
297 if(NS_FAILED(nsres)) {
298 ERR("Select failed: %08x\n", nsres);
299 return E_FAIL;
302 return S_OK;
305 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
307 HTMLInputElement *This = HTMLINPUT_THIS(iface);
308 FIXME("(%p)->()\n", This);
309 return E_NOTIMPL;
312 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
314 HTMLInputElement *This = HTMLINPUT_THIS(iface);
315 FIXME("(%p)->(%p)\n", This, p);
316 return E_NOTIMPL;
319 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
321 HTMLInputElement *This = HTMLINPUT_THIS(iface);
322 FIXME("(%p)->()\n", This);
323 return E_NOTIMPL;
326 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
328 HTMLInputElement *This = HTMLINPUT_THIS(iface);
329 FIXME("(%p)->(%p)\n", This, p);
330 return E_NOTIMPL;
333 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
335 HTMLInputElement *This = HTMLINPUT_THIS(iface);
336 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
337 return E_NOTIMPL;
340 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
342 HTMLInputElement *This = HTMLINPUT_THIS(iface);
343 FIXME("(%p)->(%p)\n", This, p);
344 return E_NOTIMPL;
347 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
349 HTMLInputElement *This = HTMLINPUT_THIS(iface);
350 FIXME("(%p)->(%x)\n", This, v);
351 return E_NOTIMPL;
354 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
356 HTMLInputElement *This = HTMLINPUT_THIS(iface);
357 FIXME("(%p)->(%p)\n", This, p);
358 return E_NOTIMPL;
361 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
363 HTMLInputElement *This = HTMLINPUT_THIS(iface);
364 FIXME("(%p)->(%p)\n", This, range);
365 return E_NOTIMPL;
368 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
370 HTMLInputElement *This = HTMLINPUT_THIS(iface);
371 FIXME("(%p)->(%x)\n", This, v);
372 return E_NOTIMPL;
375 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
377 HTMLInputElement *This = HTMLINPUT_THIS(iface);
378 FIXME("(%p)->(%p)\n", This, p);
379 return E_NOTIMPL;
382 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
384 HTMLInputElement *This = HTMLINPUT_THIS(iface);
385 nsresult nsres;
387 TRACE("(%p)->(%x)\n", This, v);
389 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
390 if(NS_FAILED(nsres)) {
391 ERR("SetDefaultChecked failed: %08x\n", nsres);
392 return E_FAIL;
395 return S_OK;
398 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
400 HTMLInputElement *This = HTMLINPUT_THIS(iface);
401 PRBool default_checked = FALSE;
402 nsresult nsres;
404 TRACE("(%p)->(%p)\n", This, p);
406 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
407 if(NS_FAILED(nsres)) {
408 ERR("GetDefaultChecked failed: %08x\n", nsres);
409 return E_FAIL;
412 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
413 return S_OK;
416 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
418 HTMLInputElement *This = HTMLINPUT_THIS(iface);
419 nsresult nsres;
421 TRACE("(%p)->(%x)\n", This, v);
423 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
424 if(NS_FAILED(nsres)) {
425 ERR("SetChecked failed: %08x\n", nsres);
426 return E_FAIL;
429 return S_OK;
432 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
434 HTMLInputElement *This = HTMLINPUT_THIS(iface);
435 PRBool checked;
436 nsresult nsres;
438 TRACE("(%p)->(%p)\n", This, p);
440 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
441 if(NS_FAILED(nsres)) {
442 ERR("GetChecked failed: %08x\n", nsres);
443 return E_FAIL;
446 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
447 TRACE("checked=%x\n", *p);
448 return S_OK;
451 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
453 HTMLInputElement *This = HTMLINPUT_THIS(iface);
454 FIXME("(%p)->()\n", This);
455 return E_NOTIMPL;
458 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
460 HTMLInputElement *This = HTMLINPUT_THIS(iface);
461 FIXME("(%p)->(%p)\n", This, p);
462 return E_NOTIMPL;
465 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
467 HTMLInputElement *This = HTMLINPUT_THIS(iface);
468 FIXME("(%p)->(%d)\n", This, v);
469 return E_NOTIMPL;
472 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
474 HTMLInputElement *This = HTMLINPUT_THIS(iface);
475 FIXME("(%p)->(%p)\n", This, p);
476 return E_NOTIMPL;
479 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
481 HTMLInputElement *This = HTMLINPUT_THIS(iface);
482 FIXME("(%p)->(%d)\n", This, v);
483 return E_NOTIMPL;
486 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
488 HTMLInputElement *This = HTMLINPUT_THIS(iface);
489 FIXME("(%p)->(%p)\n", This, p);
490 return E_NOTIMPL;
493 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
495 HTMLInputElement *This = HTMLINPUT_THIS(iface);
496 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
497 return E_NOTIMPL;
500 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
502 HTMLInputElement *This = HTMLINPUT_THIS(iface);
503 FIXME("(%p)->(%p)\n", This, p);
504 return E_NOTIMPL;
507 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
509 HTMLInputElement *This = HTMLINPUT_THIS(iface);
510 nsAString nsstr;
511 nsresult nsres;
513 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
515 nsAString_InitDepend(&nsstr, v);
516 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
517 nsAString_Finish(&nsstr);
518 if(NS_FAILED(nsres))
519 ERR("SetSrc failed: %08x\n", nsres);
521 return S_OK;
524 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
526 HTMLInputElement *This = HTMLINPUT_THIS(iface);
527 const PRUnichar *src;
528 nsAString src_str;
529 nsresult nsres;
530 HRESULT hres;
532 TRACE("(%p)->(%p)\n", This, p);
534 nsAString_Init(&src_str, NULL);
535 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
536 if(NS_FAILED(nsres)) {
537 ERR("GetSrc failed: %08x\n", nsres);
538 return E_FAIL;
541 nsAString_GetData(&src_str, &src);
542 hres = nsuri_to_url(src, FALSE, p);
543 nsAString_Finish(&src_str);
545 return hres;
548 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
550 HTMLInputElement *This = HTMLINPUT_THIS(iface);
551 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
552 return E_NOTIMPL;
555 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
557 HTMLInputElement *This = HTMLINPUT_THIS(iface);
558 FIXME("(%p)->(%p)\n", This, p);
559 return E_NOTIMPL;
562 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
564 HTMLInputElement *This = HTMLINPUT_THIS(iface);
565 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
566 return E_NOTIMPL;
569 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
571 HTMLInputElement *This = HTMLINPUT_THIS(iface);
572 FIXME("(%p)->(%p)\n", This, p);
573 return E_NOTIMPL;
576 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
578 HTMLInputElement *This = HTMLINPUT_THIS(iface);
579 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
580 return E_NOTIMPL;
583 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
585 HTMLInputElement *This = HTMLINPUT_THIS(iface);
586 FIXME("(%p)->(%p)\n", This, p);
587 return E_NOTIMPL;
590 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
592 HTMLInputElement *This = HTMLINPUT_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, p);
594 return E_NOTIMPL;
597 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
599 HTMLInputElement *This = HTMLINPUT_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, p);
601 return E_NOTIMPL;
604 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
606 HTMLInputElement *This = HTMLINPUT_THIS(iface);
607 FIXME("(%p)->()\n", This);
608 return E_NOTIMPL;
611 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
613 HTMLInputElement *This = HTMLINPUT_THIS(iface);
614 FIXME("(%p)->(%p)\n", This, p);
615 return E_NOTIMPL;
618 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
620 HTMLInputElement *This = HTMLINPUT_THIS(iface);
621 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
622 return E_NOTIMPL;
625 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
627 HTMLInputElement *This = HTMLINPUT_THIS(iface);
628 FIXME("(%p)->(%p)\n", This, p);
629 return E_NOTIMPL;
632 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
634 HTMLInputElement *This = HTMLINPUT_THIS(iface);
635 FIXME("(%p)->()\n", This);
636 return E_NOTIMPL;
639 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
641 HTMLInputElement *This = HTMLINPUT_THIS(iface);
642 FIXME("(%p)->(%p)\n", This, p);
643 return E_NOTIMPL;
646 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
648 HTMLInputElement *This = HTMLINPUT_THIS(iface);
649 FIXME("(%p)->()\n", This);
650 return E_NOTIMPL;
653 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
655 HTMLInputElement *This = HTMLINPUT_THIS(iface);
656 FIXME("(%p)->(%p)\n", This, p);
657 return E_NOTIMPL;
660 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
662 HTMLInputElement *This = HTMLINPUT_THIS(iface);
663 FIXME("(%p)->()\n", This);
664 return E_NOTIMPL;
667 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
669 HTMLInputElement *This = HTMLINPUT_THIS(iface);
670 FIXME("(%p)->(%p)\n", This, p);
671 return E_NOTIMPL;
674 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
676 HTMLInputElement *This = HTMLINPUT_THIS(iface);
677 FIXME("(%p)->(%d)\n", This, v);
678 return E_NOTIMPL;
681 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
683 HTMLInputElement *This = HTMLINPUT_THIS(iface);
684 FIXME("(%p)->(%p)\n", This, p);
685 return E_NOTIMPL;
688 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
690 HTMLInputElement *This = HTMLINPUT_THIS(iface);
691 FIXME("(%p)->(%d)\n", This, v);
692 return E_NOTIMPL;
695 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
697 HTMLInputElement *This = HTMLINPUT_THIS(iface);
698 FIXME("(%p)->(%p)\n", This, p);
699 return E_NOTIMPL;
702 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
704 HTMLInputElement *This = HTMLINPUT_THIS(iface);
705 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
706 return E_NOTIMPL;
709 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
711 HTMLInputElement *This = HTMLINPUT_THIS(iface);
712 FIXME("(%p)->(%p)\n", This, p);
713 return E_NOTIMPL;
716 #undef HTMLINPUT_THIS
718 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
719 HTMLInputElement_QueryInterface,
720 HTMLInputElement_AddRef,
721 HTMLInputElement_Release,
722 HTMLInputElement_GetTypeInfoCount,
723 HTMLInputElement_GetTypeInfo,
724 HTMLInputElement_GetIDsOfNames,
725 HTMLInputElement_Invoke,
726 HTMLInputElement_put_type,
727 HTMLInputElement_get_type,
728 HTMLInputElement_put_value,
729 HTMLInputElement_get_value,
730 HTMLInputElement_put_name,
731 HTMLInputElement_get_name,
732 HTMLInputElement_put_status,
733 HTMLInputElement_get_status,
734 HTMLInputElement_put_disabled,
735 HTMLInputElement_get_disabled,
736 HTMLInputElement_get_form,
737 HTMLInputElement_put_size,
738 HTMLInputElement_get_size,
739 HTMLInputElement_put_maxLength,
740 HTMLInputElement_get_maxLength,
741 HTMLInputElement_select,
742 HTMLInputElement_put_onchange,
743 HTMLInputElement_get_onchange,
744 HTMLInputElement_put_onselect,
745 HTMLInputElement_get_onselect,
746 HTMLInputElement_put_defaultValue,
747 HTMLInputElement_get_defaultValue,
748 HTMLInputElement_put_readOnly,
749 HTMLInputElement_get_readOnly,
750 HTMLInputElement_createTextRange,
751 HTMLInputElement_put_indeterminate,
752 HTMLInputElement_get_indeterminate,
753 HTMLInputElement_put_defaultChecked,
754 HTMLInputElement_get_defaultChecked,
755 HTMLInputElement_put_checked,
756 HTMLInputElement_get_checked,
757 HTMLInputElement_put_border,
758 HTMLInputElement_get_border,
759 HTMLInputElement_put_vspace,
760 HTMLInputElement_get_vspace,
761 HTMLInputElement_put_hspace,
762 HTMLInputElement_get_hspace,
763 HTMLInputElement_put_alt,
764 HTMLInputElement_get_alt,
765 HTMLInputElement_put_src,
766 HTMLInputElement_get_src,
767 HTMLInputElement_put_lowsrc,
768 HTMLInputElement_get_lowsrc,
769 HTMLInputElement_put_vrml,
770 HTMLInputElement_get_vrml,
771 HTMLInputElement_put_dynsrc,
772 HTMLInputElement_get_dynsrc,
773 HTMLInputElement_get_readyState,
774 HTMLInputElement_get_complete,
775 HTMLInputElement_put_loop,
776 HTMLInputElement_get_loop,
777 HTMLInputElement_put_align,
778 HTMLInputElement_get_align,
779 HTMLInputElement_put_onload,
780 HTMLInputElement_get_onload,
781 HTMLInputElement_put_onerror,
782 HTMLInputElement_get_onerror,
783 HTMLInputElement_put_onabort,
784 HTMLInputElement_get_onabort,
785 HTMLInputElement_put_width,
786 HTMLInputElement_get_width,
787 HTMLInputElement_put_height,
788 HTMLInputElement_get_height,
789 HTMLInputElement_put_start,
790 HTMLInputElement_get_start
793 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
795 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
796 REFIID riid, void **ppv)
798 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
800 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
803 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
805 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
807 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
810 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
812 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
814 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
817 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
819 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
820 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
823 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
824 LCID lcid, ITypeInfo **ppTInfo)
826 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
827 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
830 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
831 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
833 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
834 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
837 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
838 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
839 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
841 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
842 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
843 pVarResult, pExcepInfo, puArgErr);
846 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
848 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
850 TRACE("(%p)->(%p)\n", This, p);
852 return IHTMLInputElement_get_type(HTMLINPUT(This), p);
855 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
857 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
859 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
861 return IHTMLInputElement_put_value(HTMLINPUT(This), v);
864 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
866 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
868 TRACE("(%p)->(%p)\n", This, p);
870 return IHTMLInputElement_get_value(HTMLINPUT(This), p);
873 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
875 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
877 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
879 return IHTMLInputElement_put_name(HTMLINPUT(This), v);
882 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
884 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
886 TRACE("(%p)->(%p)\n", This, p);
888 return IHTMLInputElement_get_name(HTMLINPUT(This), p);
891 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
893 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
894 FIXME("(%p)->(v)\n", This);
895 return E_NOTIMPL;
898 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
900 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
901 TRACE("(%p)->(v)\n", This);
902 return E_NOTIMPL;
905 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
907 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
909 TRACE("(%p)->(%x)\n", This, v);
911 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
914 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
916 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
918 TRACE("(%p)->(%p)\n", This, p);
920 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
923 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
925 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
927 TRACE("(%p)->(%p)\n", This, p);
929 return IHTMLInputElement_get_form(HTMLINPUT(This), p);
932 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
934 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
936 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
938 return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
941 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
943 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
945 TRACE("(%p)->(%p)\n", This, p);
947 return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
950 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
952 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
954 TRACE("(%p)->(%d)\n", This, v);
956 return IHTMLInputElement_put_size(HTMLINPUT(This), v);
959 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
961 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
963 TRACE("(%p)->(%p)\n", This, p);
965 return IHTMLInputElement_get_size(HTMLINPUT(This), p);
968 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
970 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
972 TRACE("(%p)->(%d)\n", This, v);
974 return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
977 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
979 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
981 TRACE("(%p)->(%p)\n", This, p);
983 return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
986 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
988 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
990 TRACE("(%p)\n", This);
992 return IHTMLInputElement_select(HTMLINPUT(This));
995 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
997 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
999 TRACE("(%p)->()\n", This);
1001 return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
1004 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1006 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1010 return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
1013 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1015 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1017 TRACE("(%p)->()\n", This);
1019 return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
1022 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1024 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1026 TRACE("(%p)->(%p)\n", This, p);
1028 return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
1031 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1033 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1035 TRACE("(%p)->(%x)\n", This, v);
1037 return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
1040 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1042 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1044 TRACE("(%p)->(%p)\n", This, p);
1046 return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
1049 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1051 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1053 TRACE("(%p)->(%p)\n", This, range);
1055 return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
1058 #undef HTMLINPUT_THIS
1060 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1061 HTMLInputTextElement_QueryInterface,
1062 HTMLInputTextElement_AddRef,
1063 HTMLInputTextElement_Release,
1064 HTMLInputTextElement_GetTypeInfoCount,
1065 HTMLInputTextElement_GetTypeInfo,
1066 HTMLInputTextElement_GetIDsOfNames,
1067 HTMLInputTextElement_Invoke,
1068 HTMLInputTextElement_get_type,
1069 HTMLInputTextElement_put_value,
1070 HTMLInputTextElement_get_value,
1071 HTMLInputTextElement_put_name,
1072 HTMLInputTextElement_get_name,
1073 HTMLInputTextElement_put_status,
1074 HTMLInputTextElement_get_status,
1075 HTMLInputTextElement_put_disabled,
1076 HTMLInputTextElement_get_disabled,
1077 HTMLInputTextElement_get_form,
1078 HTMLInputTextElement_put_defaultValue,
1079 HTMLInputTextElement_get_defaultValue,
1080 HTMLInputTextElement_put_size,
1081 HTMLInputTextElement_get_size,
1082 HTMLInputTextElement_put_maxLength,
1083 HTMLInputTextElement_get_maxLength,
1084 HTMLInputTextElement_select,
1085 HTMLInputTextElement_put_onchange,
1086 HTMLInputTextElement_get_onchange,
1087 HTMLInputTextElement_put_onselect,
1088 HTMLInputTextElement_get_onselect,
1089 HTMLInputTextElement_put_readOnly,
1090 HTMLInputTextElement_get_readOnly,
1091 HTMLInputTextElement_createTextRange
1094 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1096 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1098 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1100 *ppv = NULL;
1102 if(IsEqualGUID(&IID_IUnknown, riid)) {
1103 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1104 *ppv = HTMLINPUT(This);
1105 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1106 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1107 *ppv = HTMLINPUT(This);
1108 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1109 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1110 *ppv = HTMLINPUT(This);
1111 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1112 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1113 *ppv = HTMLINPUTTEXT(This);
1116 if(*ppv) {
1117 IUnknown_AddRef((IUnknown*)*ppv);
1118 return S_OK;
1121 return HTMLElement_QI(&This->element.node, riid, ppv);
1124 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1126 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1128 nsIDOMHTMLInputElement_Release(This->nsinput);
1130 HTMLElement_destructor(&This->element.node);
1133 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1135 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1137 if(eid == EVENTID_CLICK) {
1138 nsresult nsres;
1140 *handled = TRUE;
1142 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1143 if(NS_FAILED(nsres)) {
1144 ERR("Click failed: %08x\n", nsres);
1145 return E_FAIL;
1149 return S_OK;
1152 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1154 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1155 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
1158 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1160 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1161 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
1164 #undef HTMLINPUT_NODE_THIS
1166 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1167 HTMLInputElement_QI,
1168 HTMLInputElement_destructor,
1169 NULL,
1170 HTMLInputElementImpl_call_event,
1171 HTMLInputElementImpl_put_disabled,
1172 HTMLInputElementImpl_get_disabled,
1175 static const tid_t HTMLInputElement_iface_tids[] = {
1176 HTMLELEMENT_TIDS,
1177 IHTMLInputElement_tid,
1180 static dispex_static_data_t HTMLInputElement_dispex = {
1181 NULL,
1182 DispHTMLInputElement_tid,
1183 NULL,
1184 HTMLInputElement_iface_tids
1187 HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
1189 HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1190 nsresult nsres;
1192 ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1193 ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
1194 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1196 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1198 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1199 (void**)&ret->nsinput);
1200 if(NS_FAILED(nsres))
1201 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1203 return &ret->element;