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