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