user/tests: Try harder to flush X events before running tests.
[wine] / dlls / mshtml / htmlinput.c
1 /*
2  * Copyright 2006 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "winnls.h"
30 #include "ole2.h"
31
32 #include "wine/debug.h"
33
34 #include "mshtml_private.h"
35
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37
38 typedef struct {
39     const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
40
41     HTMLElement *element;
42     nsIDOMHTMLInputElement *nsinput;
43 } HTMLInputElement;
44
45 #define HTMLINPUT(x)  ((IHTMLInputElement*)  &(x)->lpHTMLInputElementVtbl)
46
47 #define HTMLINPUT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputElement, iface)
48
49 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
50                                                          REFIID riid, void **ppv)
51 {
52     HTMLInputElement *This = HTMLINPUT_THIS(iface);
53
54     *ppv = NULL;
55
56     if(IsEqualGUID(&IID_IUnknown, riid)) {
57         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
58         *ppv = HTMLINPUT(This);
59     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
60         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
61         *ppv = HTMLINPUT(This);
62     }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
63         TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
64         *ppv = HTMLINPUT(This);
65     }else if(IsEqualGUID(&IID_IHTMLElement, riid)) {
66         TRACE("(%p)->(IID_IHTMLElement %p)\n", This, ppv);
67         *ppv = HTMLELEM(This->element);
68     }else if(IsEqualGUID(&IID_IHTMLDOMNode, riid)) {
69         TRACE("(%p)->(IID_IHTMLDOMNode %p)\n", This, ppv);
70         *ppv = HTMLDOMNODE(This->element->node);
71     }
72
73     if(*ppv) {
74         IUnknown_AddRef((IUnknown*)*ppv);
75         return S_OK;
76     }
77
78     WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
79     return E_NOINTERFACE;
80 }
81
82 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
83 {
84     HTMLInputElement *This = HTMLINPUT_THIS(iface);
85
86     TRACE("(%p)\n", This);
87
88     return IHTMLDocument2_AddRef(HTMLDOC(This->element->node->doc));
89 }
90
91 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
92 {
93     HTMLInputElement *This = HTMLINPUT_THIS(iface);
94
95     TRACE("(%p)\n", This);
96
97     return IHTMLDocument2_Release(HTMLDOC(This->element->node->doc));
98 }
99
100 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
101 {
102     HTMLInputElement *This = HTMLINPUT_THIS(iface);
103     FIXME("(%p)->(%p)\n", This, pctinfo);
104     return E_NOTIMPL;
105 }
106
107 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
108                                               LCID lcid, ITypeInfo **ppTInfo)
109 {
110     HTMLInputElement *This = HTMLINPUT_THIS(iface);
111     FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
112     return E_NOTIMPL;
113 }
114
115 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
116                                                 LPOLESTR *rgszNames, UINT cNames,
117                                                 LCID lcid, DISPID *rgDispId)
118 {
119     HTMLInputElement *This = HTMLINPUT_THIS(iface);
120     FIXME("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
121                                         lcid, rgDispId);
122     return E_NOTIMPL;
123 }
124
125 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
126                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
127                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
128 {
129     HTMLInputElement *This = HTMLINPUT_THIS(iface);
130     FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
131             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
132     return E_NOTIMPL;
133 }
134
135 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
136 {
137     HTMLInputElement *This = HTMLINPUT_THIS(iface);
138     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
139     return E_NOTIMPL;
140 }
141
142 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
143 {
144     HTMLInputElement *This = HTMLINPUT_THIS(iface);
145     nsAString type_str;
146     const PRUnichar *type;
147     nsresult nsres;
148
149     TRACE("(%p)->(%p)\n", This, p);
150
151     nsAString_Init(&type_str, NULL);
152     nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
153
154     if(NS_SUCCEEDED(nsres)) {
155         nsAString_GetData(&type_str, &type, NULL);
156         *p = SysAllocString(type);
157     }else {
158         ERR("GetType failed: %08lx\n", nsres);
159     }
160
161     nsAString_Finish(&type_str);
162
163     TRACE("type=%s\n", debugstr_w(*p));
164     return S_OK;
165 }
166
167 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
168 {
169     HTMLInputElement *This = HTMLINPUT_THIS(iface);
170     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
171     return E_NOTIMPL;
172 }
173
174 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
175 {
176     HTMLInputElement *This = HTMLINPUT_THIS(iface);
177     nsAString value_str;
178     const PRUnichar *value;
179     nsresult nsres;
180
181     TRACE("(%p)->(%p)\n", This, p);
182
183     nsAString_Init(&value_str, NULL);
184
185     nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
186     if(NS_SUCCEEDED(nsres)) {
187         nsAString_GetData(&value_str, &value, NULL);
188         *p = SysAllocString(value);
189     }else {
190         ERR("GetValue failed: %08lx\n", nsres);
191     }
192
193     nsAString_Finish(&value_str);
194
195     TRACE("value=%s\n", debugstr_w(value));
196     return S_OK;
197 }
198
199 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
200 {
201     HTMLInputElement *This = HTMLINPUT_THIS(iface);
202     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
203     return E_NOTIMPL;
204 }
205
206 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
207 {
208     HTMLInputElement *This = HTMLINPUT_THIS(iface);
209     nsAString name_str;
210     const PRUnichar *name;
211     nsresult nsres;
212
213     TRACE("(%p)->(%p)\n", This, p);
214
215     nsAString_Init(&name_str, NULL);
216
217     nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
218     if(NS_SUCCEEDED(nsres)) {
219         nsAString_GetData(&name_str, &name, NULL);
220         *p = SysAllocString(name);
221     }else {
222         ERR("GetName failed: %08lx\n", nsres);
223         return E_FAIL;
224     }
225
226     nsAString_Finish(&name_str);
227
228     TRACE("name=%s\n", debugstr_w(*p));
229     return S_OK;
230 }
231
232 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
233 {
234     HTMLInputElement *This = HTMLINPUT_THIS(iface);
235     FIXME("(%p)->(%x)\n", This, v);
236     return E_NOTIMPL;
237 }
238
239 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
240 {
241     HTMLInputElement *This = HTMLINPUT_THIS(iface);
242     FIXME("(%p)->(%p)\n", This, p);
243     return E_NOTIMPL;
244 }
245
246 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
247 {
248     HTMLInputElement *This = HTMLINPUT_THIS(iface);
249     FIXME("(%p)->(%x)\n", This, v);
250     return E_NOTIMPL;
251 }
252
253 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
254 {
255     HTMLInputElement *This = HTMLINPUT_THIS(iface);
256     FIXME("(%p)->(%p)\n", This, p);
257     return E_NOTIMPL;
258 }
259
260 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
261 {
262     HTMLInputElement *This = HTMLINPUT_THIS(iface);
263     FIXME("(%p)->(%p)\n", This, p);
264     return E_NOTIMPL;
265 }
266
267 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, long v)
268 {
269     HTMLInputElement *This = HTMLINPUT_THIS(iface);
270     FIXME("(%p)->(%ld)\n", This, v);
271     return E_NOTIMPL;
272 }
273
274 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, long *p)
275 {
276     HTMLInputElement *This = HTMLINPUT_THIS(iface);
277     FIXME("(%p)->(%p)\n", This, p);
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, long v)
282 {
283     HTMLInputElement *This = HTMLINPUT_THIS(iface);
284     FIXME("(%p)->(%ld)\n", This, v);
285     return E_NOTIMPL;
286 }
287
288 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, long *p)
289 {
290     HTMLInputElement *This = HTMLINPUT_THIS(iface);
291     FIXME("(%p)->(%p)\n", This, p);
292     return E_NOTIMPL;
293 }
294
295 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
296 {
297     HTMLInputElement *This = HTMLINPUT_THIS(iface);
298     FIXME("(%p)\n", This);
299     return E_NOTIMPL;
300 }
301
302 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
303 {
304     HTMLInputElement *This = HTMLINPUT_THIS(iface);
305     FIXME("(%p)->()\n", This);
306     return E_NOTIMPL;
307 }
308
309 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
310 {
311     HTMLInputElement *This = HTMLINPUT_THIS(iface);
312     FIXME("(%p)->(%p)\n", This, p);
313     return E_NOTIMPL;
314 }
315
316 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
317 {
318     HTMLInputElement *This = HTMLINPUT_THIS(iface);
319     FIXME("(%p)->()\n", This);
320     return E_NOTIMPL;
321 }
322
323 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
324 {
325     HTMLInputElement *This = HTMLINPUT_THIS(iface);
326     FIXME("(%p)->(%p)\n", This, p);
327     return E_NOTIMPL;
328 }
329
330 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
331 {
332     HTMLInputElement *This = HTMLINPUT_THIS(iface);
333     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
334     return E_NOTIMPL;
335 }
336
337 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
338 {
339     HTMLInputElement *This = HTMLINPUT_THIS(iface);
340     FIXME("(%p)->(%p)\n", This, p);
341     return E_NOTIMPL;
342 }
343
344 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
345 {
346     HTMLInputElement *This = HTMLINPUT_THIS(iface);
347     FIXME("(%p)->(%x)\n", This, v);
348     return E_NOTIMPL;
349 }
350
351 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
352 {
353     HTMLInputElement *This = HTMLINPUT_THIS(iface);
354     FIXME("(%p)->(%p)\n", This, p);
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
359 {
360     HTMLInputElement *This = HTMLINPUT_THIS(iface);
361     FIXME("(%p)->(%p)\n", This, range);
362     return E_NOTIMPL;
363 }
364
365 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
366 {
367     HTMLInputElement *This = HTMLINPUT_THIS(iface);
368     FIXME("(%p)->(%x)\n", This, v);
369     return E_NOTIMPL;
370 }
371
372 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
373 {
374     HTMLInputElement *This = HTMLINPUT_THIS(iface);
375     FIXME("(%p)->(%p)\n", This, p);
376     return E_NOTIMPL;
377 }
378
379 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
380 {
381     HTMLInputElement *This = HTMLINPUT_THIS(iface);
382     FIXME("(%p)->(%x)\n", This, v);
383     return E_NOTIMPL;
384 }
385
386 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
387 {
388     HTMLInputElement *This = HTMLINPUT_THIS(iface);
389     FIXME("(%p)->(%p)\n", This, p);
390     return E_NOTIMPL;
391 }
392
393 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
394 {
395     HTMLInputElement *This = HTMLINPUT_THIS(iface);
396     FIXME("(%p)->(%x)\n", This, v);
397     return E_NOTIMPL;
398 }
399
400 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
401 {
402     HTMLInputElement *This = HTMLINPUT_THIS(iface);
403     PRBool checked;
404     nsresult nsres;
405
406     TRACE("(%p)->(%p)\n", This, p);
407
408     nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
409     if(NS_FAILED(nsres)) {
410         ERR("GetChecked failed: %08lx\n", nsres);
411         return E_FAIL;
412     }
413
414     *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
415     TRACE("checked=%x\n", *p);
416     return S_OK;
417 }
418
419 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
420 {
421     HTMLInputElement *This = HTMLINPUT_THIS(iface);
422     FIXME("(%p)->()\n", This);
423     return E_NOTIMPL;
424 }
425
426 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
427 {
428     HTMLInputElement *This = HTMLINPUT_THIS(iface);
429     FIXME("(%p)->(%p)\n", This, p);
430     return E_NOTIMPL;
431 }
432
433 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, long v)
434 {
435     HTMLInputElement *This = HTMLINPUT_THIS(iface);
436     FIXME("(%p)->(%ld)\n", This, v);
437     return E_NOTIMPL;
438 }
439
440 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, long *p)
441 {
442     HTMLInputElement *This = HTMLINPUT_THIS(iface);
443     FIXME("(%p)->(%p)\n", This, p);
444     return E_NOTIMPL;
445 }
446
447 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, long v)
448 {
449     HTMLInputElement *This = HTMLINPUT_THIS(iface);
450     FIXME("(%p)->(%ld)\n", This, v);
451     return E_NOTIMPL;
452 }
453
454 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, long *p)
455 {
456     HTMLInputElement *This = HTMLINPUT_THIS(iface);
457     FIXME("(%p)->(%p)\n", This, p);
458     return E_NOTIMPL;
459 }
460
461 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
462 {
463     HTMLInputElement *This = HTMLINPUT_THIS(iface);
464     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
465     return E_NOTIMPL;
466 }
467
468 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
469 {
470     HTMLInputElement *This = HTMLINPUT_THIS(iface);
471     FIXME("(%p)->(%p)\n", This, p);
472     return E_NOTIMPL;
473 }
474
475 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
476 {
477     HTMLInputElement *This = HTMLINPUT_THIS(iface);
478     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
479     return E_NOTIMPL;
480 }
481
482 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
483 {
484     HTMLInputElement *This = HTMLINPUT_THIS(iface);
485     FIXME("(%p)->(%p)\n", This, p);
486     return E_NOTIMPL;
487 }
488
489 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
490 {
491     HTMLInputElement *This = HTMLINPUT_THIS(iface);
492     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
493     return E_NOTIMPL;
494 }
495
496 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
497 {
498     HTMLInputElement *This = HTMLINPUT_THIS(iface);
499     FIXME("(%p)->(%p)\n", This, p);
500     return E_NOTIMPL;
501 }
502
503 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
504 {
505     HTMLInputElement *This = HTMLINPUT_THIS(iface);
506     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
507     return E_NOTIMPL;
508 }
509
510 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
511 {
512     HTMLInputElement *This = HTMLINPUT_THIS(iface);
513     FIXME("(%p)->(%p)\n", This, p);
514     return E_NOTIMPL;
515 }
516
517 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
518 {
519     HTMLInputElement *This = HTMLINPUT_THIS(iface);
520     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
521     return E_NOTIMPL;
522 }
523
524 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
525 {
526     HTMLInputElement *This = HTMLINPUT_THIS(iface);
527     FIXME("(%p)->(%p)\n", This, p);
528     return E_NOTIMPL;
529 }
530
531 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
532 {
533     HTMLInputElement *This = HTMLINPUT_THIS(iface);
534     FIXME("(%p)->(%p)\n", This, p);
535     return E_NOTIMPL;
536 }
537
538 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
539 {
540     HTMLInputElement *This = HTMLINPUT_THIS(iface);
541     FIXME("(%p)->(%p)\n", This, p);
542     return E_NOTIMPL;
543 }
544
545 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
546 {
547     HTMLInputElement *This = HTMLINPUT_THIS(iface);
548     FIXME("(%p)->()\n", This);
549     return E_NOTIMPL;
550 }
551
552 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
553 {
554     HTMLInputElement *This = HTMLINPUT_THIS(iface);
555     FIXME("(%p)->(%p)\n", This, p);
556     return E_NOTIMPL;
557 }
558
559 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
560 {
561     HTMLInputElement *This = HTMLINPUT_THIS(iface);
562     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
563     return E_NOTIMPL;
564 }
565
566 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
567 {
568     HTMLInputElement *This = HTMLINPUT_THIS(iface);
569     FIXME("(%p)->(%p)\n", This, p);
570     return E_NOTIMPL;
571 }
572
573 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
574 {
575     HTMLInputElement *This = HTMLINPUT_THIS(iface);
576     FIXME("(%p)->()\n", This);
577     return E_NOTIMPL;
578 }
579
580 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
581 {
582     HTMLInputElement *This = HTMLINPUT_THIS(iface);
583     FIXME("(%p)->(%p)\n", This, p);
584     return E_NOTIMPL;
585 }
586
587 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
588 {
589     HTMLInputElement *This = HTMLINPUT_THIS(iface);
590     FIXME("(%p)->()\n", This);
591     return E_NOTIMPL;
592 }
593
594 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
595 {
596     HTMLInputElement *This = HTMLINPUT_THIS(iface);
597     FIXME("(%p)->(%p)\n", This, p);
598     return E_NOTIMPL;
599 }
600
601 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
602 {
603     HTMLInputElement *This = HTMLINPUT_THIS(iface);
604     FIXME("(%p)->()\n", This);
605     return E_NOTIMPL;
606 }
607
608 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
609 {
610     HTMLInputElement *This = HTMLINPUT_THIS(iface);
611     FIXME("(%p)->(%p)\n", This, p);
612     return E_NOTIMPL;
613 }
614
615 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, long v)
616 {
617     HTMLInputElement *This = HTMLINPUT_THIS(iface);
618     FIXME("(%p)->(%ld)\n", This, v);
619     return E_NOTIMPL;
620 }
621
622 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, long *p)
623 {
624     HTMLInputElement *This = HTMLINPUT_THIS(iface);
625     FIXME("(%p)->(%p)\n", This, p);
626     return E_NOTIMPL;
627 }
628
629 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, long v)
630 {
631     HTMLInputElement *This = HTMLINPUT_THIS(iface);
632     FIXME("(%p)->(%ld)\n", This, v);
633     return E_NOTIMPL;
634 }
635
636 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, long *p)
637 {
638     HTMLInputElement *This = HTMLINPUT_THIS(iface);
639     FIXME("(%p)->(%p)\n", This, p);
640     return E_NOTIMPL;
641 }
642
643 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
644 {
645     HTMLInputElement *This = HTMLINPUT_THIS(iface);
646     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
647     return E_NOTIMPL;
648 }
649
650 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
651 {
652     HTMLInputElement *This = HTMLINPUT_THIS(iface);
653     FIXME("(%p)->(%p)\n", This, p);
654     return E_NOTIMPL;
655 }
656
657 static void HTMLInputElement_destructor(IUnknown *iface)
658 {
659     HTMLInputElement *This = HTMLINPUT_THIS(iface);
660
661     nsIDOMHTMLInputElement_Release(This->nsinput);
662     HeapFree(GetProcessHeap(), 0, This);
663 }
664
665 #undef HTMLINPUT_THIS
666
667 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
668     HTMLInputElement_QueryInterface,
669     HTMLInputElement_AddRef,
670     HTMLInputElement_Release,
671     HTMLInputElement_GetTypeInfoCount,
672     HTMLInputElement_GetTypeInfo,
673     HTMLInputElement_GetIDsOfNames,
674     HTMLInputElement_Invoke,
675     HTMLInputElement_put_type,
676     HTMLInputElement_get_type,
677     HTMLInputElement_put_value,
678     HTMLInputElement_get_value,
679     HTMLInputElement_put_name,
680     HTMLInputElement_get_name,
681     HTMLInputElement_put_status,
682     HTMLInputElement_get_status,
683     HTMLInputElement_put_disabled,
684     HTMLInputElement_get_disabled,
685     HTMLInputElement_get_form,
686     HTMLInputElement_put_size,
687     HTMLInputElement_get_size,
688     HTMLInputElement_put_maxLength,
689     HTMLInputElement_get_maxLength,
690     HTMLInputElement_select,
691     HTMLInputElement_put_onchange,
692     HTMLInputElement_get_onchange,
693     HTMLInputElement_put_onselect,
694     HTMLInputElement_get_onselect,
695     HTMLInputElement_put_defaultValue,
696     HTMLInputElement_get_defaultValue,
697     HTMLInputElement_put_readOnly,
698     HTMLInputElement_get_readOnly,
699     HTMLInputElement_createTextRange,
700     HTMLInputElement_put_indeterminate,
701     HTMLInputElement_get_indeterminate,
702     HTMLInputElement_put_defaultChecked,
703     HTMLInputElement_get_defaultChecked,
704     HTMLInputElement_put_checked,
705     HTMLInputElement_get_checked,
706     HTMLInputElement_put_border,
707     HTMLInputElement_get_border,
708     HTMLInputElement_put_vspace,
709     HTMLInputElement_get_vspace,
710     HTMLInputElement_put_hspace,
711     HTMLInputElement_get_hspace,
712     HTMLInputElement_put_alt,
713     HTMLInputElement_get_alt,
714     HTMLInputElement_put_src,
715     HTMLInputElement_get_src,
716     HTMLInputElement_put_lowsrc,
717     HTMLInputElement_get_lowsrc,
718     HTMLInputElement_put_vrml,
719     HTMLInputElement_get_vrml,
720     HTMLInputElement_put_dynsrc,
721     HTMLInputElement_get_dynsrc,
722     HTMLInputElement_get_readyState,
723     HTMLInputElement_get_complete,
724     HTMLInputElement_put_loop,
725     HTMLInputElement_get_loop,
726     HTMLInputElement_put_align,
727     HTMLInputElement_get_align,
728     HTMLInputElement_put_onload,
729     HTMLInputElement_get_onload,
730     HTMLInputElement_put_onerror,
731     HTMLInputElement_get_onerror,
732     HTMLInputElement_put_onabort,
733     HTMLInputElement_get_onabort,
734     HTMLInputElement_put_width,
735     HTMLInputElement_get_width,
736     HTMLInputElement_put_height,
737     HTMLInputElement_get_height,
738     HTMLInputElement_put_start,
739     HTMLInputElement_get_start
740 };
741
742 void HTMLInputElement_Create(HTMLElement *element)
743 {
744     HTMLInputElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLInputElement));
745     nsresult nsres;
746
747     ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
748     ret->element = element;
749
750     nsres = nsIDOMHTMLElement_QueryInterface(element->nselem, &IID_nsIDOMHTMLInputElement,
751                                              (void**)&ret->nsinput);
752     if(NS_FAILED(nsres))
753         ERR("Could not get nsIDOMHTMLInputElement interface: %08lx\n", nsres);
754
755     element->impl = (IUnknown*)HTMLINPUT(ret);
756     element->destructor = HTMLInputElement_destructor;
757 }