wintrust/tests: Fix test on win9x.
[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     FIXME("(%p)->(%p)\n", This, pctinfo);
74     return E_NOTIMPL;
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     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
82     return E_NOTIMPL;
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     FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
91                                         lcid, rgDispId);
92     return E_NOTIMPL;
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     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
101             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
102     return E_NOTIMPL;
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     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
141     return E_NOTIMPL;
142 }
143
144 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
145 {
146     HTMLInputElement *This = HTMLINPUT_THIS(iface);
147     nsAString value_str;
148     const PRUnichar *value = NULL;
149     nsresult nsres;
150
151     TRACE("(%p)->(%p)\n", This, p);
152
153     nsAString_Init(&value_str, NULL);
154
155     nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
156     if(NS_SUCCEEDED(nsres)) {
157         nsAString_GetData(&value_str, &value);
158         *p = SysAllocString(value);
159     }else {
160         ERR("GetValue failed: %08x\n", nsres);
161     }
162
163     nsAString_Finish(&value_str);
164
165     TRACE("value=%s\n", debugstr_w(*p));
166     return S_OK;
167 }
168
169 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
170 {
171     HTMLInputElement *This = HTMLINPUT_THIS(iface);
172     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
173     return E_NOTIMPL;
174 }
175
176 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
177 {
178     HTMLInputElement *This = HTMLINPUT_THIS(iface);
179     nsAString name_str;
180     const PRUnichar *name;
181     nsresult nsres;
182
183     TRACE("(%p)->(%p)\n", This, p);
184
185     nsAString_Init(&name_str, NULL);
186
187     nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
188     if(NS_SUCCEEDED(nsres)) {
189         nsAString_GetData(&name_str, &name);
190         *p = SysAllocString(name);
191     }else {
192         ERR("GetName failed: %08x\n", nsres);
193         return E_FAIL;
194     }
195
196     nsAString_Finish(&name_str);
197
198     TRACE("name=%s\n", debugstr_w(*p));
199     return S_OK;
200 }
201
202 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
203 {
204     HTMLInputElement *This = HTMLINPUT_THIS(iface);
205     FIXME("(%p)->(%x)\n", This, v);
206     return E_NOTIMPL;
207 }
208
209 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
210 {
211     HTMLInputElement *This = HTMLINPUT_THIS(iface);
212     FIXME("(%p)->(%p)\n", This, p);
213     return E_NOTIMPL;
214 }
215
216 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
217 {
218     HTMLInputElement *This = HTMLINPUT_THIS(iface);
219     FIXME("(%p)->(%x)\n", This, v);
220     return E_NOTIMPL;
221 }
222
223 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
224 {
225     HTMLInputElement *This = HTMLINPUT_THIS(iface);
226     PRBool disabled = FALSE;
227
228     TRACE("(%p)->(%p)\n", This, p);
229
230     nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
231
232     *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
233     return S_OK;
234 }
235
236 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
237 {
238     HTMLInputElement *This = HTMLINPUT_THIS(iface);
239     FIXME("(%p)->(%p)\n", This, p);
240     return E_NOTIMPL;
241 }
242
243 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, long v)
244 {
245     HTMLInputElement *This = HTMLINPUT_THIS(iface);
246     FIXME("(%p)->(%ld)\n", This, v);
247     return E_NOTIMPL;
248 }
249
250 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, long *p)
251 {
252     HTMLInputElement *This = HTMLINPUT_THIS(iface);
253     FIXME("(%p)->(%p)\n", This, p);
254     return E_NOTIMPL;
255 }
256
257 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, long v)
258 {
259     HTMLInputElement *This = HTMLINPUT_THIS(iface);
260     FIXME("(%p)->(%ld)\n", This, v);
261     return E_NOTIMPL;
262 }
263
264 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, long *p)
265 {
266     HTMLInputElement *This = HTMLINPUT_THIS(iface);
267     FIXME("(%p)->(%p)\n", This, p);
268     return E_NOTIMPL;
269 }
270
271 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
272 {
273     HTMLInputElement *This = HTMLINPUT_THIS(iface);
274     FIXME("(%p)\n", This);
275     return E_NOTIMPL;
276 }
277
278 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
279 {
280     HTMLInputElement *This = HTMLINPUT_THIS(iface);
281     FIXME("(%p)->()\n", This);
282     return E_NOTIMPL;
283 }
284
285 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
286 {
287     HTMLInputElement *This = HTMLINPUT_THIS(iface);
288     FIXME("(%p)->(%p)\n", This, p);
289     return E_NOTIMPL;
290 }
291
292 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
293 {
294     HTMLInputElement *This = HTMLINPUT_THIS(iface);
295     FIXME("(%p)->()\n", This);
296     return E_NOTIMPL;
297 }
298
299 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
300 {
301     HTMLInputElement *This = HTMLINPUT_THIS(iface);
302     FIXME("(%p)->(%p)\n", This, p);
303     return E_NOTIMPL;
304 }
305
306 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
307 {
308     HTMLInputElement *This = HTMLINPUT_THIS(iface);
309     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
310     return E_NOTIMPL;
311 }
312
313 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
314 {
315     HTMLInputElement *This = HTMLINPUT_THIS(iface);
316     FIXME("(%p)->(%p)\n", This, p);
317     return E_NOTIMPL;
318 }
319
320 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
321 {
322     HTMLInputElement *This = HTMLINPUT_THIS(iface);
323     FIXME("(%p)->(%x)\n", This, v);
324     return E_NOTIMPL;
325 }
326
327 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
328 {
329     HTMLInputElement *This = HTMLINPUT_THIS(iface);
330     FIXME("(%p)->(%p)\n", This, p);
331     return E_NOTIMPL;
332 }
333
334 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
335 {
336     HTMLInputElement *This = HTMLINPUT_THIS(iface);
337     FIXME("(%p)->(%p)\n", This, range);
338     return E_NOTIMPL;
339 }
340
341 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
342 {
343     HTMLInputElement *This = HTMLINPUT_THIS(iface);
344     FIXME("(%p)->(%x)\n", This, v);
345     return E_NOTIMPL;
346 }
347
348 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
349 {
350     HTMLInputElement *This = HTMLINPUT_THIS(iface);
351     FIXME("(%p)->(%p)\n", This, p);
352     return E_NOTIMPL;
353 }
354
355 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
356 {
357     HTMLInputElement *This = HTMLINPUT_THIS(iface);
358     FIXME("(%p)->(%x)\n", This, v);
359     return E_NOTIMPL;
360 }
361
362 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
363 {
364     HTMLInputElement *This = HTMLINPUT_THIS(iface);
365     FIXME("(%p)->(%p)\n", This, p);
366     return E_NOTIMPL;
367 }
368
369 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
370 {
371     HTMLInputElement *This = HTMLINPUT_THIS(iface);
372     FIXME("(%p)->(%x)\n", This, v);
373     return E_NOTIMPL;
374 }
375
376 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
377 {
378     HTMLInputElement *This = HTMLINPUT_THIS(iface);
379     PRBool checked;
380     nsresult nsres;
381
382     TRACE("(%p)->(%p)\n", This, p);
383
384     nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
385     if(NS_FAILED(nsres)) {
386         ERR("GetChecked failed: %08x\n", nsres);
387         return E_FAIL;
388     }
389
390     *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
391     TRACE("checked=%x\n", *p);
392     return S_OK;
393 }
394
395 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
396 {
397     HTMLInputElement *This = HTMLINPUT_THIS(iface);
398     FIXME("(%p)->()\n", This);
399     return E_NOTIMPL;
400 }
401
402 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
403 {
404     HTMLInputElement *This = HTMLINPUT_THIS(iface);
405     FIXME("(%p)->(%p)\n", This, p);
406     return E_NOTIMPL;
407 }
408
409 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, long v)
410 {
411     HTMLInputElement *This = HTMLINPUT_THIS(iface);
412     FIXME("(%p)->(%ld)\n", This, v);
413     return E_NOTIMPL;
414 }
415
416 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, long *p)
417 {
418     HTMLInputElement *This = HTMLINPUT_THIS(iface);
419     FIXME("(%p)->(%p)\n", This, p);
420     return E_NOTIMPL;
421 }
422
423 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, long v)
424 {
425     HTMLInputElement *This = HTMLINPUT_THIS(iface);
426     FIXME("(%p)->(%ld)\n", This, v);
427     return E_NOTIMPL;
428 }
429
430 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, long *p)
431 {
432     HTMLInputElement *This = HTMLINPUT_THIS(iface);
433     FIXME("(%p)->(%p)\n", This, p);
434     return E_NOTIMPL;
435 }
436
437 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
438 {
439     HTMLInputElement *This = HTMLINPUT_THIS(iface);
440     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
441     return E_NOTIMPL;
442 }
443
444 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
445 {
446     HTMLInputElement *This = HTMLINPUT_THIS(iface);
447     FIXME("(%p)->(%p)\n", This, p);
448     return E_NOTIMPL;
449 }
450
451 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
452 {
453     HTMLInputElement *This = HTMLINPUT_THIS(iface);
454     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
455     return E_NOTIMPL;
456 }
457
458 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
459 {
460     HTMLInputElement *This = HTMLINPUT_THIS(iface);
461     FIXME("(%p)->(%p)\n", This, p);
462     return E_NOTIMPL;
463 }
464
465 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
466 {
467     HTMLInputElement *This = HTMLINPUT_THIS(iface);
468     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
469     return E_NOTIMPL;
470 }
471
472 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
473 {
474     HTMLInputElement *This = HTMLINPUT_THIS(iface);
475     FIXME("(%p)->(%p)\n", This, p);
476     return E_NOTIMPL;
477 }
478
479 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
480 {
481     HTMLInputElement *This = HTMLINPUT_THIS(iface);
482     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
483     return E_NOTIMPL;
484 }
485
486 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
487 {
488     HTMLInputElement *This = HTMLINPUT_THIS(iface);
489     FIXME("(%p)->(%p)\n", This, p);
490     return E_NOTIMPL;
491 }
492
493 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
494 {
495     HTMLInputElement *This = HTMLINPUT_THIS(iface);
496     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
497     return E_NOTIMPL;
498 }
499
500 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
501 {
502     HTMLInputElement *This = HTMLINPUT_THIS(iface);
503     FIXME("(%p)->(%p)\n", This, p);
504     return E_NOTIMPL;
505 }
506
507 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
508 {
509     HTMLInputElement *This = HTMLINPUT_THIS(iface);
510     FIXME("(%p)->(%p)\n", This, p);
511     return E_NOTIMPL;
512 }
513
514 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
515 {
516     HTMLInputElement *This = HTMLINPUT_THIS(iface);
517     FIXME("(%p)->(%p)\n", This, p);
518     return E_NOTIMPL;
519 }
520
521 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
522 {
523     HTMLInputElement *This = HTMLINPUT_THIS(iface);
524     FIXME("(%p)->()\n", This);
525     return E_NOTIMPL;
526 }
527
528 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
529 {
530     HTMLInputElement *This = HTMLINPUT_THIS(iface);
531     FIXME("(%p)->(%p)\n", This, p);
532     return E_NOTIMPL;
533 }
534
535 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
536 {
537     HTMLInputElement *This = HTMLINPUT_THIS(iface);
538     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
539     return E_NOTIMPL;
540 }
541
542 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
543 {
544     HTMLInputElement *This = HTMLINPUT_THIS(iface);
545     FIXME("(%p)->(%p)\n", This, p);
546     return E_NOTIMPL;
547 }
548
549 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
550 {
551     HTMLInputElement *This = HTMLINPUT_THIS(iface);
552     FIXME("(%p)->()\n", This);
553     return E_NOTIMPL;
554 }
555
556 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
557 {
558     HTMLInputElement *This = HTMLINPUT_THIS(iface);
559     FIXME("(%p)->(%p)\n", This, p);
560     return E_NOTIMPL;
561 }
562
563 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
564 {
565     HTMLInputElement *This = HTMLINPUT_THIS(iface);
566     FIXME("(%p)->()\n", This);
567     return E_NOTIMPL;
568 }
569
570 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
571 {
572     HTMLInputElement *This = HTMLINPUT_THIS(iface);
573     FIXME("(%p)->(%p)\n", This, p);
574     return E_NOTIMPL;
575 }
576
577 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
578 {
579     HTMLInputElement *This = HTMLINPUT_THIS(iface);
580     FIXME("(%p)->()\n", This);
581     return E_NOTIMPL;
582 }
583
584 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
585 {
586     HTMLInputElement *This = HTMLINPUT_THIS(iface);
587     FIXME("(%p)->(%p)\n", This, p);
588     return E_NOTIMPL;
589 }
590
591 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, long v)
592 {
593     HTMLInputElement *This = HTMLINPUT_THIS(iface);
594     FIXME("(%p)->(%ld)\n", This, v);
595     return E_NOTIMPL;
596 }
597
598 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, long *p)
599 {
600     HTMLInputElement *This = HTMLINPUT_THIS(iface);
601     FIXME("(%p)->(%p)\n", This, p);
602     return E_NOTIMPL;
603 }
604
605 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, long v)
606 {
607     HTMLInputElement *This = HTMLINPUT_THIS(iface);
608     FIXME("(%p)->(%ld)\n", This, v);
609     return E_NOTIMPL;
610 }
611
612 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, long *p)
613 {
614     HTMLInputElement *This = HTMLINPUT_THIS(iface);
615     FIXME("(%p)->(%p)\n", This, p);
616     return E_NOTIMPL;
617 }
618
619 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
620 {
621     HTMLInputElement *This = HTMLINPUT_THIS(iface);
622     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
623     return E_NOTIMPL;
624 }
625
626 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
627 {
628     HTMLInputElement *This = HTMLINPUT_THIS(iface);
629     FIXME("(%p)->(%p)\n", This, p);
630     return E_NOTIMPL;
631 }
632
633 #undef HTMLINPUT_THIS
634
635 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
636     HTMLInputElement_QueryInterface,
637     HTMLInputElement_AddRef,
638     HTMLInputElement_Release,
639     HTMLInputElement_GetTypeInfoCount,
640     HTMLInputElement_GetTypeInfo,
641     HTMLInputElement_GetIDsOfNames,
642     HTMLInputElement_Invoke,
643     HTMLInputElement_put_type,
644     HTMLInputElement_get_type,
645     HTMLInputElement_put_value,
646     HTMLInputElement_get_value,
647     HTMLInputElement_put_name,
648     HTMLInputElement_get_name,
649     HTMLInputElement_put_status,
650     HTMLInputElement_get_status,
651     HTMLInputElement_put_disabled,
652     HTMLInputElement_get_disabled,
653     HTMLInputElement_get_form,
654     HTMLInputElement_put_size,
655     HTMLInputElement_get_size,
656     HTMLInputElement_put_maxLength,
657     HTMLInputElement_get_maxLength,
658     HTMLInputElement_select,
659     HTMLInputElement_put_onchange,
660     HTMLInputElement_get_onchange,
661     HTMLInputElement_put_onselect,
662     HTMLInputElement_get_onselect,
663     HTMLInputElement_put_defaultValue,
664     HTMLInputElement_get_defaultValue,
665     HTMLInputElement_put_readOnly,
666     HTMLInputElement_get_readOnly,
667     HTMLInputElement_createTextRange,
668     HTMLInputElement_put_indeterminate,
669     HTMLInputElement_get_indeterminate,
670     HTMLInputElement_put_defaultChecked,
671     HTMLInputElement_get_defaultChecked,
672     HTMLInputElement_put_checked,
673     HTMLInputElement_get_checked,
674     HTMLInputElement_put_border,
675     HTMLInputElement_get_border,
676     HTMLInputElement_put_vspace,
677     HTMLInputElement_get_vspace,
678     HTMLInputElement_put_hspace,
679     HTMLInputElement_get_hspace,
680     HTMLInputElement_put_alt,
681     HTMLInputElement_get_alt,
682     HTMLInputElement_put_src,
683     HTMLInputElement_get_src,
684     HTMLInputElement_put_lowsrc,
685     HTMLInputElement_get_lowsrc,
686     HTMLInputElement_put_vrml,
687     HTMLInputElement_get_vrml,
688     HTMLInputElement_put_dynsrc,
689     HTMLInputElement_get_dynsrc,
690     HTMLInputElement_get_readyState,
691     HTMLInputElement_get_complete,
692     HTMLInputElement_put_loop,
693     HTMLInputElement_get_loop,
694     HTMLInputElement_put_align,
695     HTMLInputElement_get_align,
696     HTMLInputElement_put_onload,
697     HTMLInputElement_get_onload,
698     HTMLInputElement_put_onerror,
699     HTMLInputElement_get_onerror,
700     HTMLInputElement_put_onabort,
701     HTMLInputElement_get_onabort,
702     HTMLInputElement_put_width,
703     HTMLInputElement_get_width,
704     HTMLInputElement_put_height,
705     HTMLInputElement_get_height,
706     HTMLInputElement_put_start,
707     HTMLInputElement_get_start
708 };
709
710 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
711
712 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
713         REFIID riid, void **ppv)
714 {
715     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
716
717     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
718 }
719
720 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
721 {
722     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
723
724     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
725 }
726
727 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
728 {
729     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
730
731     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
732 }
733
734 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
735 {
736     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
737     FIXME("(%p)->(%p)\n", This, pctinfo);
738     return E_NOTIMPL;
739 }
740
741 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
742         LCID lcid, ITypeInfo **ppTInfo)
743 {
744     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
745     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
746     return E_NOTIMPL;
747 }
748
749 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
750         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
751 {
752     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
753     FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
754                                         lcid, rgDispId);
755     return E_NOTIMPL;
756 }
757
758 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
759                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
760                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
761 {
762     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
763     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
764             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
765     return E_NOTIMPL;
766 }
767
768 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
769 {
770     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
771
772     TRACE("(%p)->(%p)\n", This, p);
773
774     return IHTMLInputElement_get_type(HTMLINPUT(This), p);
775 }
776
777 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
778 {
779     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
780
781     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
782
783     return IHTMLInputElement_put_value(HTMLINPUT(This), v);
784 }
785
786 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
787 {
788     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
789
790     TRACE("(%p)->(%p)\n", This, p);
791
792     return IHTMLInputTextElement_get_value(HTMLINPUT(This), p);
793 }
794
795 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
796 {
797     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
798
799     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
800
801     return IHTMLInputElement_put_name(HTMLINPUT(This), v);
802 }
803
804 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
805 {
806     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
807
808     TRACE("(%p)->(%p)\n", This, p);
809
810     return IHTMLInputElement_get_name(HTMLINPUT(This), p);
811 }
812
813 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
814 {
815     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
816     FIXME("(%p)->(v)\n", This);
817     return E_NOTIMPL;
818 }
819
820 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
821 {
822     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
823     TRACE("(%p)->(v)\n", This);
824     return E_NOTIMPL;
825 }
826
827 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
828 {
829     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
830
831     TRACE("(%p)->(%x)\n", This, v);
832
833     return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
834 }
835
836 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
837 {
838     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
839
840     TRACE("(%p)->(%p)\n", This, p);
841
842     return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
843 }
844
845 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
846 {
847     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
848
849     TRACE("(%p)->(%p)\n", This, p);
850
851     return IHTMLInputElement_get_form(HTMLINPUT(This), p);
852 }
853
854 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
855 {
856     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
857
858     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
859
860     return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
861 }
862
863 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
864 {
865     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
866
867     TRACE("(%p)->(%p)\n", This, p);
868
869     return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
870 }
871
872 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, long v)
873 {
874     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
875
876     TRACE("(%p)->(%ld)\n", This, v);
877
878     return IHTMLInputElement_put_size(HTMLINPUT(This), v);
879 }
880
881 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, long *p)
882 {
883     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
884
885     TRACE("(%p)->(%p)\n", This, p);
886
887     return IHTMLInputElement_get_size(HTMLINPUT(This), p);
888 }
889
890 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, long v)
891 {
892     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
893
894     TRACE("(%p)->(%ld)\n", This, v);
895
896     return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
897 }
898
899 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, long *p)
900 {
901     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
902
903     TRACE("(%p)->(%p)\n", This, p);
904
905     return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
906 }
907
908 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
909 {
910     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
911
912     TRACE("(%p)\n", This);
913
914     return IHTMLInputElement_select(HTMLINPUT(This));
915 }
916
917 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
918 {
919     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
920
921     TRACE("(%p)->()\n", This);
922
923     return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
924 }
925
926 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
927 {
928     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
929
930     TRACE("(%p)->(%p)\n", This, p);
931
932     return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
933 }
934
935 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
936 {
937     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
938
939     TRACE("(%p)->()\n", This);
940
941     return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
942 }
943
944 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
945 {
946     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
947
948     TRACE("(%p)->(%p)\n", This, p);
949
950     return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
951 }
952
953 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
954 {
955     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
956
957     TRACE("(%p)->(%x)\n", This, v);
958
959     return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
960 }
961
962 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
963 {
964     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
965
966     TRACE("(%p)->(%p)\n", This, p);
967
968     return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
969 }
970
971 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
972 {
973     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
974
975     TRACE("(%p)->(%p)\n", This, range);
976
977     return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
978 }
979
980 #undef HTMLINPUT_THIS
981
982 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
983     HTMLInputTextElement_QueryInterface,
984     HTMLInputTextElement_AddRef,
985     HTMLInputTextElement_Release,
986     HTMLInputTextElement_GetTypeInfoCount,
987     HTMLInputTextElement_GetTypeInfo,
988     HTMLInputTextElement_GetIDsOfNames,
989     HTMLInputTextElement_Invoke,
990     HTMLInputTextElement_get_type,
991     HTMLInputTextElement_put_value,
992     HTMLInputTextElement_get_value,
993     HTMLInputTextElement_put_name,
994     HTMLInputTextElement_get_name,
995     HTMLInputTextElement_put_status,
996     HTMLInputTextElement_get_status,
997     HTMLInputTextElement_put_disabled,
998     HTMLInputTextElement_get_disabled,
999     HTMLInputTextElement_get_form,
1000     HTMLInputTextElement_put_defaultValue,
1001     HTMLInputTextElement_get_defaultValue,
1002     HTMLInputTextElement_put_size,
1003     HTMLInputTextElement_get_size,
1004     HTMLInputTextElement_put_maxLength,
1005     HTMLInputTextElement_get_maxLength,
1006     HTMLInputTextElement_select,
1007     HTMLInputTextElement_put_onchange,
1008     HTMLInputTextElement_get_onchange,
1009     HTMLInputTextElement_put_onselect,
1010     HTMLInputTextElement_get_onselect,
1011     HTMLInputTextElement_put_readOnly,
1012     HTMLInputTextElement_get_readOnly,
1013     HTMLInputTextElement_createTextRange
1014 };
1015
1016 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1017
1018 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1019 {
1020     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1021
1022     *ppv = NULL;
1023
1024     if(IsEqualGUID(&IID_IUnknown, riid)) {
1025         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1026         *ppv = HTMLINPUT(This);
1027     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1028         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1029         *ppv = HTMLINPUT(This);
1030     }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1031         TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1032         *ppv = HTMLINPUT(This);
1033     }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1034         TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1035         *ppv = HTMLINPUT(This);
1036     }
1037
1038     if(*ppv) {
1039         IUnknown_AddRef((IUnknown*)*ppv);
1040         return S_OK;
1041     }
1042
1043     return HTMLElement_QI(&This->element.node, riid, ppv);
1044 }
1045
1046 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1047 {
1048     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1049
1050     nsIDOMHTMLInputElement_Release(This->nsinput);
1051
1052     HTMLElement_destructor(&This->element.node);
1053 }
1054
1055 #undef HTMLINPUT_NODE_THIS
1056
1057 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1058     HTMLInputElement_QI,
1059     HTMLInputElement_destructor
1060 };
1061
1062 static const tid_t HTMLInputElement_iface_tids[] = {
1063     IHTMLDOMNode_tid,
1064     IHTMLDOMNode2_tid,
1065     IHTMLElement_tid,
1066     IHTMLElement2_tid,
1067     IHTMLInputElement_tid,
1068     0
1069 };
1070 static dispex_static_data_t HTMLInputElement_dispex = {
1071     NULL,
1072     DispHTMLInputElement_tid,
1073     NULL,
1074     HTMLInputElement_iface_tids
1075 };
1076
1077 HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
1078 {
1079     HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1080     nsresult nsres;
1081
1082     ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1083     ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1084
1085     init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex);
1086     HTMLElement_Init(&ret->element);
1087
1088     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1089                                              (void**)&ret->nsinput);
1090     if(NS_FAILED(nsres))
1091         ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1092
1093     return &ret->element;
1094 }