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