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