ole32: Include ole2.h in ole32_main.c to type-check the function signature of OleMeta...
[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 <stdarg.h>
20
21 #define COBJMACROS
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27
28 #include "wine/debug.h"
29
30 #include "mshtml_private.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
33
34 typedef struct {
35     HTMLElement element;
36
37     const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
38     const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
39
40     nsIDOMHTMLInputElement *nsinput;
41 } HTMLInputElement;
42
43 #define HTMLINPUT(x)      ((IHTMLInputElement*)      &(x)->lpHTMLInputElementVtbl)
44 #define HTMLINPUTTEXT(x)  ((IHTMLInputTextElement*)  &(x)->lpHTMLInputTextElementVtbl)
45
46 #define HTMLINPUT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputElement, iface)
47
48 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
49                                                          REFIID riid, void **ppv)
50 {
51     HTMLInputElement *This = HTMLINPUT_THIS(iface);
52
53     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
54 }
55
56 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
57 {
58     HTMLInputElement *This = HTMLINPUT_THIS(iface);
59
60     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
61 }
62
63 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
64 {
65     HTMLInputElement *This = HTMLINPUT_THIS(iface);
66
67     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
68 }
69
70 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
71 {
72     HTMLInputElement *This = HTMLINPUT_THIS(iface);
73
74     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
75 }
76
77 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
78                                               LCID lcid, ITypeInfo **ppTInfo)
79 {
80     HTMLInputElement *This = HTMLINPUT_THIS(iface);
81
82     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
83 }
84
85 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
86                                                 LPOLESTR *rgszNames, UINT cNames,
87                                                 LCID lcid, DISPID *rgDispId)
88 {
89     HTMLInputElement *This = HTMLINPUT_THIS(iface);
90
91     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
92             cNames, lcid, rgDispId);
93 }
94
95 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
96                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
97                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
98 {
99     HTMLInputElement *This = HTMLINPUT_THIS(iface);
100
101     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
102             pDispParams, pVarResult, pExcepInfo, puArgErr);
103 }
104
105 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
106 {
107     HTMLInputElement *This = HTMLINPUT_THIS(iface);
108     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
109     return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
113 {
114     HTMLInputElement *This = HTMLINPUT_THIS(iface);
115     nsAString type_str;
116     const PRUnichar *type;
117     nsresult nsres;
118
119     TRACE("(%p)->(%p)\n", This, p);
120
121     nsAString_Init(&type_str, NULL);
122     nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
123
124     if(NS_SUCCEEDED(nsres)) {
125         nsAString_GetData(&type_str, &type);
126         *p = SysAllocString(type);
127     }else {
128         ERR("GetType failed: %08x\n", nsres);
129     }
130
131     nsAString_Finish(&type_str);
132
133     TRACE("type=%s\n", debugstr_w(*p));
134     return S_OK;
135 }
136
137 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
138 {
139     HTMLInputElement *This = HTMLINPUT_THIS(iface);
140     nsAString val_str;
141     nsresult nsres;
142
143     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
144
145     nsAString_Init(&val_str, v);
146     nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
147     nsAString_Finish(&val_str);
148     if(NS_FAILED(nsres))
149         ERR("SetValue failed: %08x\n", nsres);
150
151     return S_OK;
152 }
153
154 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
155 {
156     HTMLInputElement *This = HTMLINPUT_THIS(iface);
157     nsAString value_str;
158     const PRUnichar *value = NULL;
159     nsresult nsres;
160
161     TRACE("(%p)->(%p)\n", This, p);
162
163     nsAString_Init(&value_str, NULL);
164
165     nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
166     if(NS_SUCCEEDED(nsres)) {
167         nsAString_GetData(&value_str, &value);
168         *p = SysAllocString(value);
169     }else {
170         ERR("GetValue failed: %08x\n", nsres);
171     }
172
173     nsAString_Finish(&value_str);
174
175     TRACE("value=%s\n", debugstr_w(*p));
176     return S_OK;
177 }
178
179 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
180 {
181     HTMLInputElement *This = HTMLINPUT_THIS(iface);
182     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
183     return E_NOTIMPL;
184 }
185
186 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
187 {
188     HTMLInputElement *This = HTMLINPUT_THIS(iface);
189     nsAString name_str;
190     const PRUnichar *name;
191     nsresult nsres;
192
193     TRACE("(%p)->(%p)\n", This, p);
194
195     nsAString_Init(&name_str, NULL);
196
197     nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
198     if(NS_SUCCEEDED(nsres)) {
199         nsAString_GetData(&name_str, &name);
200         *p = SysAllocString(name);
201     }else {
202         ERR("GetName failed: %08x\n", nsres);
203         return E_FAIL;
204     }
205
206     nsAString_Finish(&name_str);
207
208     TRACE("name=%s\n", debugstr_w(*p));
209     return S_OK;
210 }
211
212 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
213 {
214     HTMLInputElement *This = HTMLINPUT_THIS(iface);
215     FIXME("(%p)->(%x)\n", This, v);
216     return E_NOTIMPL;
217 }
218
219 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
220 {
221     HTMLInputElement *This = HTMLINPUT_THIS(iface);
222     FIXME("(%p)->(%p)\n", This, p);
223     return E_NOTIMPL;
224 }
225
226 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
227 {
228     HTMLInputElement *This = HTMLINPUT_THIS(iface);
229     FIXME("(%p)->(%x)\n", This, v);
230     return E_NOTIMPL;
231 }
232
233 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
234 {
235     HTMLInputElement *This = HTMLINPUT_THIS(iface);
236     PRBool disabled = FALSE;
237
238     TRACE("(%p)->(%p)\n", This, p);
239
240     nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
241
242     *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
243     return S_OK;
244 }
245
246 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
247 {
248     HTMLInputElement *This = HTMLINPUT_THIS(iface);
249     FIXME("(%p)->(%p)\n", This, p);
250     return E_NOTIMPL;
251 }
252
253 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, long v)
254 {
255     HTMLInputElement *This = HTMLINPUT_THIS(iface);
256     FIXME("(%p)->(%ld)\n", This, v);
257     return E_NOTIMPL;
258 }
259
260 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, long *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_maxLength(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_maxLength(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_select(IHTMLInputElement *iface)
282 {
283     HTMLInputElement *This = HTMLINPUT_THIS(iface);
284     FIXME("(%p)\n", This);
285     return E_NOTIMPL;
286 }
287
288 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
289 {
290     HTMLInputElement *This = HTMLINPUT_THIS(iface);
291     FIXME("(%p)->()\n", This);
292     return E_NOTIMPL;
293 }
294
295 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
296 {
297     HTMLInputElement *This = HTMLINPUT_THIS(iface);
298     FIXME("(%p)->(%p)\n", This, p);
299     return E_NOTIMPL;
300 }
301
302 static HRESULT WINAPI HTMLInputElement_put_onselect(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_onselect(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_defaultValue(IHTMLInputElement *iface, BSTR v)
317 {
318     HTMLInputElement *This = HTMLINPUT_THIS(iface);
319     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
320     return E_NOTIMPL;
321 }
322
323 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *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_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
331 {
332     HTMLInputElement *This = HTMLINPUT_THIS(iface);
333     FIXME("(%p)->(%x)\n", This, v);
334     return E_NOTIMPL;
335 }
336
337 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *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_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
345 {
346     HTMLInputElement *This = HTMLINPUT_THIS(iface);
347     FIXME("(%p)->(%p)\n", This, range);
348     return E_NOTIMPL;
349 }
350
351 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
352 {
353     HTMLInputElement *This = HTMLINPUT_THIS(iface);
354     FIXME("(%p)->(%x)\n", This, v);
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
359 {
360     HTMLInputElement *This = HTMLINPUT_THIS(iface);
361     FIXME("(%p)->(%p)\n", This, p);
362     return E_NOTIMPL;
363 }
364
365 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(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_defaultChecked(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_checked(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_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
387 {
388     HTMLInputElement *This = HTMLINPUT_THIS(iface);
389     PRBool checked;
390     nsresult nsres;
391
392     TRACE("(%p)->(%p)\n", This, p);
393
394     nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
395     if(NS_FAILED(nsres)) {
396         ERR("GetChecked failed: %08x\n", nsres);
397         return E_FAIL;
398     }
399
400     *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
401     TRACE("checked=%x\n", *p);
402     return S_OK;
403 }
404
405 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
406 {
407     HTMLInputElement *This = HTMLINPUT_THIS(iface);
408     FIXME("(%p)->()\n", This);
409     return E_NOTIMPL;
410 }
411
412 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
413 {
414     HTMLInputElement *This = HTMLINPUT_THIS(iface);
415     FIXME("(%p)->(%p)\n", This, p);
416     return E_NOTIMPL;
417 }
418
419 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, long v)
420 {
421     HTMLInputElement *This = HTMLINPUT_THIS(iface);
422     FIXME("(%p)->(%ld)\n", This, v);
423     return E_NOTIMPL;
424 }
425
426 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, long *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_hspace(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_hspace(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_alt(IHTMLInputElement *iface, BSTR v)
448 {
449     HTMLInputElement *This = HTMLINPUT_THIS(iface);
450     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
451     return E_NOTIMPL;
452 }
453
454 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *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_src(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_src(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_lowsrc(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_lowsrc(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_vrml(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_vrml(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_dynsrc(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_dynsrc(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_get_readyState(IHTMLInputElement *iface, BSTR *p)
518 {
519     HTMLInputElement *This = HTMLINPUT_THIS(iface);
520     FIXME("(%p)->(%p)\n", This, p);
521     return E_NOTIMPL;
522 }
523
524 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *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_put_loop(IHTMLInputElement *iface, VARIANT v)
532 {
533     HTMLInputElement *This = HTMLINPUT_THIS(iface);
534     FIXME("(%p)->()\n", This);
535     return E_NOTIMPL;
536 }
537
538 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *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_align(IHTMLInputElement *iface, BSTR v)
546 {
547     HTMLInputElement *This = HTMLINPUT_THIS(iface);
548     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
549     return E_NOTIMPL;
550 }
551
552 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *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_onload(IHTMLInputElement *iface, VARIANT v)
560 {
561     HTMLInputElement *This = HTMLINPUT_THIS(iface);
562     FIXME("(%p)->()\n", This);
563     return E_NOTIMPL;
564 }
565
566 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *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_onerror(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_onerror(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_onabort(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_onabort(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_width(IHTMLInputElement *iface, long v)
602 {
603     HTMLInputElement *This = HTMLINPUT_THIS(iface);
604     FIXME("(%p)->(%ld)\n", This, v);
605     return E_NOTIMPL;
606 }
607
608 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, long *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_height(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_height(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_start(IHTMLInputElement *iface, BSTR v)
630 {
631     HTMLInputElement *This = HTMLINPUT_THIS(iface);
632     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
633     return E_NOTIMPL;
634 }
635
636 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
637 {
638     HTMLInputElement *This = HTMLINPUT_THIS(iface);
639     FIXME("(%p)->(%p)\n", This, p);
640     return E_NOTIMPL;
641 }
642
643 #undef HTMLINPUT_THIS
644
645 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
646     HTMLInputElement_QueryInterface,
647     HTMLInputElement_AddRef,
648     HTMLInputElement_Release,
649     HTMLInputElement_GetTypeInfoCount,
650     HTMLInputElement_GetTypeInfo,
651     HTMLInputElement_GetIDsOfNames,
652     HTMLInputElement_Invoke,
653     HTMLInputElement_put_type,
654     HTMLInputElement_get_type,
655     HTMLInputElement_put_value,
656     HTMLInputElement_get_value,
657     HTMLInputElement_put_name,
658     HTMLInputElement_get_name,
659     HTMLInputElement_put_status,
660     HTMLInputElement_get_status,
661     HTMLInputElement_put_disabled,
662     HTMLInputElement_get_disabled,
663     HTMLInputElement_get_form,
664     HTMLInputElement_put_size,
665     HTMLInputElement_get_size,
666     HTMLInputElement_put_maxLength,
667     HTMLInputElement_get_maxLength,
668     HTMLInputElement_select,
669     HTMLInputElement_put_onchange,
670     HTMLInputElement_get_onchange,
671     HTMLInputElement_put_onselect,
672     HTMLInputElement_get_onselect,
673     HTMLInputElement_put_defaultValue,
674     HTMLInputElement_get_defaultValue,
675     HTMLInputElement_put_readOnly,
676     HTMLInputElement_get_readOnly,
677     HTMLInputElement_createTextRange,
678     HTMLInputElement_put_indeterminate,
679     HTMLInputElement_get_indeterminate,
680     HTMLInputElement_put_defaultChecked,
681     HTMLInputElement_get_defaultChecked,
682     HTMLInputElement_put_checked,
683     HTMLInputElement_get_checked,
684     HTMLInputElement_put_border,
685     HTMLInputElement_get_border,
686     HTMLInputElement_put_vspace,
687     HTMLInputElement_get_vspace,
688     HTMLInputElement_put_hspace,
689     HTMLInputElement_get_hspace,
690     HTMLInputElement_put_alt,
691     HTMLInputElement_get_alt,
692     HTMLInputElement_put_src,
693     HTMLInputElement_get_src,
694     HTMLInputElement_put_lowsrc,
695     HTMLInputElement_get_lowsrc,
696     HTMLInputElement_put_vrml,
697     HTMLInputElement_get_vrml,
698     HTMLInputElement_put_dynsrc,
699     HTMLInputElement_get_dynsrc,
700     HTMLInputElement_get_readyState,
701     HTMLInputElement_get_complete,
702     HTMLInputElement_put_loop,
703     HTMLInputElement_get_loop,
704     HTMLInputElement_put_align,
705     HTMLInputElement_get_align,
706     HTMLInputElement_put_onload,
707     HTMLInputElement_get_onload,
708     HTMLInputElement_put_onerror,
709     HTMLInputElement_get_onerror,
710     HTMLInputElement_put_onabort,
711     HTMLInputElement_get_onabort,
712     HTMLInputElement_put_width,
713     HTMLInputElement_get_width,
714     HTMLInputElement_put_height,
715     HTMLInputElement_get_height,
716     HTMLInputElement_put_start,
717     HTMLInputElement_get_start
718 };
719
720 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
721
722 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
723         REFIID riid, void **ppv)
724 {
725     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
726
727     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
728 }
729
730 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
731 {
732     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
733
734     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
735 }
736
737 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
738 {
739     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
740
741     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
742 }
743
744 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
745 {
746     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
747     FIXME("(%p)->(%p)\n", This, pctinfo);
748     return E_NOTIMPL;
749 }
750
751 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
752         LCID lcid, ITypeInfo **ppTInfo)
753 {
754     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
755     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
756     return E_NOTIMPL;
757 }
758
759 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
760         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
761 {
762     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
763     FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
764                                         lcid, rgDispId);
765     return E_NOTIMPL;
766 }
767
768 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
769                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
770                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
771 {
772     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
773     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
774             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
775     return E_NOTIMPL;
776 }
777
778 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
779 {
780     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
781
782     TRACE("(%p)->(%p)\n", This, p);
783
784     return IHTMLInputElement_get_type(HTMLINPUT(This), p);
785 }
786
787 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
788 {
789     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
790
791     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
792
793     return IHTMLInputElement_put_value(HTMLINPUT(This), v);
794 }
795
796 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
797 {
798     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
799
800     TRACE("(%p)->(%p)\n", This, p);
801
802     return IHTMLInputTextElement_get_value(HTMLINPUT(This), p);
803 }
804
805 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
806 {
807     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
808
809     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
810
811     return IHTMLInputElement_put_name(HTMLINPUT(This), v);
812 }
813
814 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
815 {
816     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
817
818     TRACE("(%p)->(%p)\n", This, p);
819
820     return IHTMLInputElement_get_name(HTMLINPUT(This), p);
821 }
822
823 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
824 {
825     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
826     FIXME("(%p)->(v)\n", This);
827     return E_NOTIMPL;
828 }
829
830 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
831 {
832     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
833     TRACE("(%p)->(v)\n", This);
834     return E_NOTIMPL;
835 }
836
837 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
838 {
839     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
840
841     TRACE("(%p)->(%x)\n", This, v);
842
843     return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
844 }
845
846 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
847 {
848     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
849
850     TRACE("(%p)->(%p)\n", This, p);
851
852     return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
853 }
854
855 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
856 {
857     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
858
859     TRACE("(%p)->(%p)\n", This, p);
860
861     return IHTMLInputElement_get_form(HTMLINPUT(This), p);
862 }
863
864 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
865 {
866     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
867
868     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
869
870     return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
871 }
872
873 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
874 {
875     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
876
877     TRACE("(%p)->(%p)\n", This, p);
878
879     return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
880 }
881
882 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, long v)
883 {
884     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
885
886     TRACE("(%p)->(%ld)\n", This, v);
887
888     return IHTMLInputElement_put_size(HTMLINPUT(This), v);
889 }
890
891 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, long *p)
892 {
893     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
894
895     TRACE("(%p)->(%p)\n", This, p);
896
897     return IHTMLInputElement_get_size(HTMLINPUT(This), p);
898 }
899
900 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, long v)
901 {
902     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
903
904     TRACE("(%p)->(%ld)\n", This, v);
905
906     return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
907 }
908
909 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, long *p)
910 {
911     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
912
913     TRACE("(%p)->(%p)\n", This, p);
914
915     return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
916 }
917
918 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
919 {
920     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
921
922     TRACE("(%p)\n", This);
923
924     return IHTMLInputElement_select(HTMLINPUT(This));
925 }
926
927 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
928 {
929     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
930
931     TRACE("(%p)->()\n", This);
932
933     return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
934 }
935
936 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
937 {
938     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
939
940     TRACE("(%p)->(%p)\n", This, p);
941
942     return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
943 }
944
945 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
946 {
947     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
948
949     TRACE("(%p)->()\n", This);
950
951     return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
952 }
953
954 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
955 {
956     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
957
958     TRACE("(%p)->(%p)\n", This, p);
959
960     return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
961 }
962
963 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
964 {
965     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
966
967     TRACE("(%p)->(%x)\n", This, v);
968
969     return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
970 }
971
972 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
973 {
974     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
975
976     TRACE("(%p)->(%p)\n", This, p);
977
978     return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
979 }
980
981 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
982 {
983     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
984
985     TRACE("(%p)->(%p)\n", This, range);
986
987     return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
988 }
989
990 #undef HTMLINPUT_THIS
991
992 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
993     HTMLInputTextElement_QueryInterface,
994     HTMLInputTextElement_AddRef,
995     HTMLInputTextElement_Release,
996     HTMLInputTextElement_GetTypeInfoCount,
997     HTMLInputTextElement_GetTypeInfo,
998     HTMLInputTextElement_GetIDsOfNames,
999     HTMLInputTextElement_Invoke,
1000     HTMLInputTextElement_get_type,
1001     HTMLInputTextElement_put_value,
1002     HTMLInputTextElement_get_value,
1003     HTMLInputTextElement_put_name,
1004     HTMLInputTextElement_get_name,
1005     HTMLInputTextElement_put_status,
1006     HTMLInputTextElement_get_status,
1007     HTMLInputTextElement_put_disabled,
1008     HTMLInputTextElement_get_disabled,
1009     HTMLInputTextElement_get_form,
1010     HTMLInputTextElement_put_defaultValue,
1011     HTMLInputTextElement_get_defaultValue,
1012     HTMLInputTextElement_put_size,
1013     HTMLInputTextElement_get_size,
1014     HTMLInputTextElement_put_maxLength,
1015     HTMLInputTextElement_get_maxLength,
1016     HTMLInputTextElement_select,
1017     HTMLInputTextElement_put_onchange,
1018     HTMLInputTextElement_get_onchange,
1019     HTMLInputTextElement_put_onselect,
1020     HTMLInputTextElement_get_onselect,
1021     HTMLInputTextElement_put_readOnly,
1022     HTMLInputTextElement_get_readOnly,
1023     HTMLInputTextElement_createTextRange
1024 };
1025
1026 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1027
1028 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1029 {
1030     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1031
1032     *ppv = NULL;
1033
1034     if(IsEqualGUID(&IID_IUnknown, riid)) {
1035         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1036         *ppv = HTMLINPUT(This);
1037     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1038         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1039         *ppv = HTMLINPUT(This);
1040     }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1041         TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1042         *ppv = HTMLINPUT(This);
1043     }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1044         TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1045         *ppv = HTMLINPUT(This);
1046     }
1047
1048     if(*ppv) {
1049         IUnknown_AddRef((IUnknown*)*ppv);
1050         return S_OK;
1051     }
1052
1053     return HTMLElement_QI(&This->element.node, riid, ppv);
1054 }
1055
1056 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1057 {
1058     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1059
1060     nsIDOMHTMLInputElement_Release(This->nsinput);
1061
1062     HTMLElement_destructor(&This->element.node);
1063 }
1064
1065 #undef HTMLINPUT_NODE_THIS
1066
1067 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1068     HTMLInputElement_QI,
1069     HTMLInputElement_destructor
1070 };
1071
1072 static const tid_t HTMLInputElement_iface_tids[] = {
1073     IHTMLDOMNode_tid,
1074     IHTMLDOMNode2_tid,
1075     IHTMLElement_tid,
1076     IHTMLElement2_tid,
1077     IHTMLInputElement_tid,
1078     0
1079 };
1080 static dispex_static_data_t HTMLInputElement_dispex = {
1081     NULL,
1082     DispHTMLInputElement_tid,
1083     NULL,
1084     HTMLInputElement_iface_tids
1085 };
1086
1087 HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
1088 {
1089     HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1090     nsresult nsres;
1091
1092     ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1093     ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1094
1095     init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex);
1096     HTMLElement_Init(&ret->element);
1097
1098     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1099                                              (void**)&ret->nsinput);
1100     if(NS_FAILED(nsres))
1101         ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1102
1103     return &ret->element;
1104 }