[gdi32]
[reactos.git] / reactos / dll / win32 / 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 #include "htmlevent.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 typedef struct {
36 HTMLElement element;
37
38 const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
39 const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
40
41 nsIDOMHTMLInputElement *nsinput;
42 } HTMLInputElement;
43
44 #define HTMLINPUT(x) ((IHTMLInputElement*) &(x)->lpHTMLInputElementVtbl)
45 #define HTMLINPUTTEXT(x) (&(x)->lpHTMLInputTextElementVtbl)
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
54 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
55 }
56
57 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
58 {
59 HTMLInputElement *This = HTMLINPUT_THIS(iface);
60
61 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
62 }
63
64 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
65 {
66 HTMLInputElement *This = HTMLINPUT_THIS(iface);
67
68 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
69 }
70
71 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
72 {
73 HTMLInputElement *This = HTMLINPUT_THIS(iface);
74
75 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
76 }
77
78 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
79 LCID lcid, ITypeInfo **ppTInfo)
80 {
81 HTMLInputElement *This = HTMLINPUT_THIS(iface);
82
83 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
84 }
85
86 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
87 LPOLESTR *rgszNames, UINT cNames,
88 LCID lcid, DISPID *rgDispId)
89 {
90 HTMLInputElement *This = HTMLINPUT_THIS(iface);
91
92 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
93 cNames, lcid, rgDispId);
94 }
95
96 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
97 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
98 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
99 {
100 HTMLInputElement *This = HTMLINPUT_THIS(iface);
101
102 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
103 pDispParams, pVarResult, pExcepInfo, puArgErr);
104 }
105
106 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
107 {
108 HTMLInputElement *This = HTMLINPUT_THIS(iface);
109 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
110 return E_NOTIMPL;
111 }
112
113 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
114 {
115 HTMLInputElement *This = HTMLINPUT_THIS(iface);
116 nsAString type_str;
117 const PRUnichar *type;
118 nsresult nsres;
119
120 TRACE("(%p)->(%p)\n", This, p);
121
122 nsAString_Init(&type_str, NULL);
123 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
124
125 if(NS_SUCCEEDED(nsres)) {
126 nsAString_GetData(&type_str, &type);
127 *p = SysAllocString(type);
128 }else {
129 ERR("GetType failed: %08x\n", nsres);
130 }
131
132 nsAString_Finish(&type_str);
133
134 TRACE("type=%s\n", debugstr_w(*p));
135 return S_OK;
136 }
137
138 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
139 {
140 HTMLInputElement *This = HTMLINPUT_THIS(iface);
141 nsAString val_str;
142 nsresult nsres;
143
144 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
145
146 nsAString_Init(&val_str, v);
147 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
148 nsAString_Finish(&val_str);
149 if(NS_FAILED(nsres))
150 ERR("SetValue failed: %08x\n", nsres);
151
152 return S_OK;
153 }
154
155 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
156 {
157 HTMLInputElement *This = HTMLINPUT_THIS(iface);
158 nsAString value_str;
159 const PRUnichar *value = NULL;
160 nsresult nsres;
161
162 TRACE("(%p)->(%p)\n", This, p);
163
164 nsAString_Init(&value_str, NULL);
165
166 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
167 if(NS_SUCCEEDED(nsres)) {
168 nsAString_GetData(&value_str, &value);
169 *p = SysAllocString(value);
170 }else {
171 ERR("GetValue failed: %08x\n", nsres);
172 }
173
174 nsAString_Finish(&value_str);
175
176 TRACE("value=%s\n", debugstr_w(*p));
177 return S_OK;
178 }
179
180 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
181 {
182 HTMLInputElement *This = HTMLINPUT_THIS(iface);
183 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
184 return E_NOTIMPL;
185 }
186
187 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
188 {
189 HTMLInputElement *This = HTMLINPUT_THIS(iface);
190 nsAString name_str;
191 const PRUnichar *name;
192 nsresult nsres;
193
194 TRACE("(%p)->(%p)\n", This, p);
195
196 nsAString_Init(&name_str, NULL);
197
198 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
199 if(NS_SUCCEEDED(nsres)) {
200 nsAString_GetData(&name_str, &name);
201 *p = SysAllocString(name);
202 }else {
203 ERR("GetName failed: %08x\n", nsres);
204 return E_FAIL;
205 }
206
207 nsAString_Finish(&name_str);
208
209 TRACE("name=%s\n", debugstr_w(*p));
210 return S_OK;
211 }
212
213 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
214 {
215 HTMLInputElement *This = HTMLINPUT_THIS(iface);
216 FIXME("(%p)->(%x)\n", This, v);
217 return E_NOTIMPL;
218 }
219
220 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
221 {
222 HTMLInputElement *This = HTMLINPUT_THIS(iface);
223 FIXME("(%p)->(%p)\n", This, p);
224 return E_NOTIMPL;
225 }
226
227 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
228 {
229 HTMLInputElement *This = HTMLINPUT_THIS(iface);
230 nsresult nsres;
231
232 TRACE("(%p)->(%x)\n", This, v);
233
234 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
235 if(NS_FAILED(nsres))
236 ERR("SetDisabled failed: %08x\n", nsres);
237
238 return S_OK;
239 }
240
241 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
242 {
243 HTMLInputElement *This = HTMLINPUT_THIS(iface);
244 PRBool disabled = FALSE;
245
246 TRACE("(%p)->(%p)\n", This, p);
247
248 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
249
250 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
251 return S_OK;
252 }
253
254 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
255 {
256 HTMLInputElement *This = HTMLINPUT_THIS(iface);
257 FIXME("(%p)->(%p)\n", This, p);
258 return E_NOTIMPL;
259 }
260
261 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
262 {
263 HTMLInputElement *This = HTMLINPUT_THIS(iface);
264 FIXME("(%p)->(%d)\n", This, v);
265 return E_NOTIMPL;
266 }
267
268 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
269 {
270 HTMLInputElement *This = HTMLINPUT_THIS(iface);
271 FIXME("(%p)->(%p)\n", This, p);
272 return E_NOTIMPL;
273 }
274
275 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
276 {
277 HTMLInputElement *This = HTMLINPUT_THIS(iface);
278 FIXME("(%p)->(%d)\n", This, v);
279 return E_NOTIMPL;
280 }
281
282 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
283 {
284 HTMLInputElement *This = HTMLINPUT_THIS(iface);
285 FIXME("(%p)->(%p)\n", This, p);
286 return E_NOTIMPL;
287 }
288
289 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
290 {
291 HTMLInputElement *This = HTMLINPUT_THIS(iface);
292 nsresult nsres;
293
294 TRACE("(%p)\n", This);
295
296 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
297 if(NS_FAILED(nsres)) {
298 ERR("Select failed: %08x\n", nsres);
299 return E_FAIL;
300 }
301
302 return S_OK;
303 }
304
305 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
306 {
307 HTMLInputElement *This = HTMLINPUT_THIS(iface);
308 FIXME("(%p)->()\n", This);
309 return E_NOTIMPL;
310 }
311
312 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
313 {
314 HTMLInputElement *This = HTMLINPUT_THIS(iface);
315 FIXME("(%p)->(%p)\n", This, p);
316 return E_NOTIMPL;
317 }
318
319 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
320 {
321 HTMLInputElement *This = HTMLINPUT_THIS(iface);
322 FIXME("(%p)->()\n", This);
323 return E_NOTIMPL;
324 }
325
326 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
327 {
328 HTMLInputElement *This = HTMLINPUT_THIS(iface);
329 FIXME("(%p)->(%p)\n", This, p);
330 return E_NOTIMPL;
331 }
332
333 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
334 {
335 HTMLInputElement *This = HTMLINPUT_THIS(iface);
336 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
337 return E_NOTIMPL;
338 }
339
340 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
341 {
342 HTMLInputElement *This = HTMLINPUT_THIS(iface);
343 FIXME("(%p)->(%p)\n", This, p);
344 return E_NOTIMPL;
345 }
346
347 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
348 {
349 HTMLInputElement *This = HTMLINPUT_THIS(iface);
350 FIXME("(%p)->(%x)\n", This, v);
351 return E_NOTIMPL;
352 }
353
354 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
355 {
356 HTMLInputElement *This = HTMLINPUT_THIS(iface);
357 FIXME("(%p)->(%p)\n", This, p);
358 return E_NOTIMPL;
359 }
360
361 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
362 {
363 HTMLInputElement *This = HTMLINPUT_THIS(iface);
364 FIXME("(%p)->(%p)\n", This, range);
365 return E_NOTIMPL;
366 }
367
368 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
369 {
370 HTMLInputElement *This = HTMLINPUT_THIS(iface);
371 FIXME("(%p)->(%x)\n", This, v);
372 return E_NOTIMPL;
373 }
374
375 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
376 {
377 HTMLInputElement *This = HTMLINPUT_THIS(iface);
378 FIXME("(%p)->(%p)\n", This, p);
379 return E_NOTIMPL;
380 }
381
382 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
383 {
384 HTMLInputElement *This = HTMLINPUT_THIS(iface);
385 nsresult nsres;
386
387 TRACE("(%p)->(%x)\n", This, v);
388
389 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
390 if(NS_FAILED(nsres)) {
391 ERR("SetDefaultChecked failed: %08x\n", nsres);
392 return E_FAIL;
393 }
394
395 return S_OK;
396 }
397
398 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
399 {
400 HTMLInputElement *This = HTMLINPUT_THIS(iface);
401 PRBool default_checked = FALSE;
402 nsresult nsres;
403
404 TRACE("(%p)->(%p)\n", This, p);
405
406 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
407 if(NS_FAILED(nsres)) {
408 ERR("GetDefaultChecked failed: %08x\n", nsres);
409 return E_FAIL;
410 }
411
412 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
413 return S_OK;
414 }
415
416 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
417 {
418 HTMLInputElement *This = HTMLINPUT_THIS(iface);
419 nsresult nsres;
420
421 TRACE("(%p)->(%x)\n", This, v);
422
423 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
424 if(NS_FAILED(nsres)) {
425 ERR("SetChecked failed: %08x\n", nsres);
426 return E_FAIL;
427 }
428
429 return S_OK;
430 }
431
432 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
433 {
434 HTMLInputElement *This = HTMLINPUT_THIS(iface);
435 PRBool checked;
436 nsresult nsres;
437
438 TRACE("(%p)->(%p)\n", This, p);
439
440 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
441 if(NS_FAILED(nsres)) {
442 ERR("GetChecked failed: %08x\n", nsres);
443 return E_FAIL;
444 }
445
446 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
447 TRACE("checked=%x\n", *p);
448 return S_OK;
449 }
450
451 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
452 {
453 HTMLInputElement *This = HTMLINPUT_THIS(iface);
454 FIXME("(%p)->()\n", This);
455 return E_NOTIMPL;
456 }
457
458 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *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_vspace(IHTMLInputElement *iface, LONG v)
466 {
467 HTMLInputElement *This = HTMLINPUT_THIS(iface);
468 FIXME("(%p)->(%d)\n", This, v);
469 return E_NOTIMPL;
470 }
471
472 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *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_hspace(IHTMLInputElement *iface, LONG v)
480 {
481 HTMLInputElement *This = HTMLINPUT_THIS(iface);
482 FIXME("(%p)->(%d)\n", This, v);
483 return E_NOTIMPL;
484 }
485
486 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *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_alt(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_alt(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_put_src(IHTMLInputElement *iface, BSTR v)
508 {
509 HTMLInputElement *This = HTMLINPUT_THIS(iface);
510 nsAString nsstr;
511 nsresult nsres;
512
513 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
514
515 nsAString_Init(&nsstr, v);
516 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
517 nsAString_Finish(&nsstr);
518 if(NS_FAILED(nsres))
519 ERR("SetSrc failed: %08x\n", nsres);
520
521 return S_OK;
522 }
523
524 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
525 {
526 HTMLInputElement *This = HTMLINPUT_THIS(iface);
527 const PRUnichar *src;
528 nsAString src_str;
529 nsresult nsres;
530 HRESULT hres;
531
532 TRACE("(%p)->(%p)\n", This, p);
533
534 nsAString_Init(&src_str, NULL);
535 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
536 if(NS_FAILED(nsres)) {
537 ERR("GetSrc failed: %08x\n", nsres);
538 return E_FAIL;
539 }
540
541 nsAString_GetData(&src_str, &src);
542 hres = nsuri_to_url(src, FALSE, p);
543 nsAString_Finish(&src_str);
544
545 return hres;
546 }
547
548 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
549 {
550 HTMLInputElement *This = HTMLINPUT_THIS(iface);
551 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
552 return E_NOTIMPL;
553 }
554
555 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
556 {
557 HTMLInputElement *This = HTMLINPUT_THIS(iface);
558 FIXME("(%p)->(%p)\n", This, p);
559 return E_NOTIMPL;
560 }
561
562 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
563 {
564 HTMLInputElement *This = HTMLINPUT_THIS(iface);
565 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
566 return E_NOTIMPL;
567 }
568
569 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
570 {
571 HTMLInputElement *This = HTMLINPUT_THIS(iface);
572 FIXME("(%p)->(%p)\n", This, p);
573 return E_NOTIMPL;
574 }
575
576 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
577 {
578 HTMLInputElement *This = HTMLINPUT_THIS(iface);
579 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
580 return E_NOTIMPL;
581 }
582
583 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
584 {
585 HTMLInputElement *This = HTMLINPUT_THIS(iface);
586 FIXME("(%p)->(%p)\n", This, p);
587 return E_NOTIMPL;
588 }
589
590 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
591 {
592 HTMLInputElement *This = HTMLINPUT_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, p);
594 return E_NOTIMPL;
595 }
596
597 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
598 {
599 HTMLInputElement *This = HTMLINPUT_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, p);
601 return E_NOTIMPL;
602 }
603
604 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
605 {
606 HTMLInputElement *This = HTMLINPUT_THIS(iface);
607 FIXME("(%p)->()\n", This);
608 return E_NOTIMPL;
609 }
610
611 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
612 {
613 HTMLInputElement *This = HTMLINPUT_THIS(iface);
614 FIXME("(%p)->(%p)\n", This, p);
615 return E_NOTIMPL;
616 }
617
618 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
619 {
620 HTMLInputElement *This = HTMLINPUT_THIS(iface);
621 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
622 return E_NOTIMPL;
623 }
624
625 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
626 {
627 HTMLInputElement *This = HTMLINPUT_THIS(iface);
628 FIXME("(%p)->(%p)\n", This, p);
629 return E_NOTIMPL;
630 }
631
632 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
633 {
634 HTMLInputElement *This = HTMLINPUT_THIS(iface);
635 FIXME("(%p)->()\n", This);
636 return E_NOTIMPL;
637 }
638
639 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
640 {
641 HTMLInputElement *This = HTMLINPUT_THIS(iface);
642 FIXME("(%p)->(%p)\n", This, p);
643 return E_NOTIMPL;
644 }
645
646 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
647 {
648 HTMLInputElement *This = HTMLINPUT_THIS(iface);
649 FIXME("(%p)->()\n", This);
650 return E_NOTIMPL;
651 }
652
653 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
654 {
655 HTMLInputElement *This = HTMLINPUT_THIS(iface);
656 FIXME("(%p)->(%p)\n", This, p);
657 return E_NOTIMPL;
658 }
659
660 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
661 {
662 HTMLInputElement *This = HTMLINPUT_THIS(iface);
663 FIXME("(%p)->()\n", This);
664 return E_NOTIMPL;
665 }
666
667 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
668 {
669 HTMLInputElement *This = HTMLINPUT_THIS(iface);
670 FIXME("(%p)->(%p)\n", This, p);
671 return E_NOTIMPL;
672 }
673
674 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
675 {
676 HTMLInputElement *This = HTMLINPUT_THIS(iface);
677 FIXME("(%p)->(%d)\n", This, v);
678 return E_NOTIMPL;
679 }
680
681 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
682 {
683 HTMLInputElement *This = HTMLINPUT_THIS(iface);
684 FIXME("(%p)->(%p)\n", This, p);
685 return E_NOTIMPL;
686 }
687
688 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
689 {
690 HTMLInputElement *This = HTMLINPUT_THIS(iface);
691 FIXME("(%p)->(%d)\n", This, v);
692 return E_NOTIMPL;
693 }
694
695 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
696 {
697 HTMLInputElement *This = HTMLINPUT_THIS(iface);
698 FIXME("(%p)->(%p)\n", This, p);
699 return E_NOTIMPL;
700 }
701
702 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
703 {
704 HTMLInputElement *This = HTMLINPUT_THIS(iface);
705 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
706 return E_NOTIMPL;
707 }
708
709 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
710 {
711 HTMLInputElement *This = HTMLINPUT_THIS(iface);
712 FIXME("(%p)->(%p)\n", This, p);
713 return E_NOTIMPL;
714 }
715
716 #undef HTMLINPUT_THIS
717
718 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
719 HTMLInputElement_QueryInterface,
720 HTMLInputElement_AddRef,
721 HTMLInputElement_Release,
722 HTMLInputElement_GetTypeInfoCount,
723 HTMLInputElement_GetTypeInfo,
724 HTMLInputElement_GetIDsOfNames,
725 HTMLInputElement_Invoke,
726 HTMLInputElement_put_type,
727 HTMLInputElement_get_type,
728 HTMLInputElement_put_value,
729 HTMLInputElement_get_value,
730 HTMLInputElement_put_name,
731 HTMLInputElement_get_name,
732 HTMLInputElement_put_status,
733 HTMLInputElement_get_status,
734 HTMLInputElement_put_disabled,
735 HTMLInputElement_get_disabled,
736 HTMLInputElement_get_form,
737 HTMLInputElement_put_size,
738 HTMLInputElement_get_size,
739 HTMLInputElement_put_maxLength,
740 HTMLInputElement_get_maxLength,
741 HTMLInputElement_select,
742 HTMLInputElement_put_onchange,
743 HTMLInputElement_get_onchange,
744 HTMLInputElement_put_onselect,
745 HTMLInputElement_get_onselect,
746 HTMLInputElement_put_defaultValue,
747 HTMLInputElement_get_defaultValue,
748 HTMLInputElement_put_readOnly,
749 HTMLInputElement_get_readOnly,
750 HTMLInputElement_createTextRange,
751 HTMLInputElement_put_indeterminate,
752 HTMLInputElement_get_indeterminate,
753 HTMLInputElement_put_defaultChecked,
754 HTMLInputElement_get_defaultChecked,
755 HTMLInputElement_put_checked,
756 HTMLInputElement_get_checked,
757 HTMLInputElement_put_border,
758 HTMLInputElement_get_border,
759 HTMLInputElement_put_vspace,
760 HTMLInputElement_get_vspace,
761 HTMLInputElement_put_hspace,
762 HTMLInputElement_get_hspace,
763 HTMLInputElement_put_alt,
764 HTMLInputElement_get_alt,
765 HTMLInputElement_put_src,
766 HTMLInputElement_get_src,
767 HTMLInputElement_put_lowsrc,
768 HTMLInputElement_get_lowsrc,
769 HTMLInputElement_put_vrml,
770 HTMLInputElement_get_vrml,
771 HTMLInputElement_put_dynsrc,
772 HTMLInputElement_get_dynsrc,
773 HTMLInputElement_get_readyState,
774 HTMLInputElement_get_complete,
775 HTMLInputElement_put_loop,
776 HTMLInputElement_get_loop,
777 HTMLInputElement_put_align,
778 HTMLInputElement_get_align,
779 HTMLInputElement_put_onload,
780 HTMLInputElement_get_onload,
781 HTMLInputElement_put_onerror,
782 HTMLInputElement_get_onerror,
783 HTMLInputElement_put_onabort,
784 HTMLInputElement_get_onabort,
785 HTMLInputElement_put_width,
786 HTMLInputElement_get_width,
787 HTMLInputElement_put_height,
788 HTMLInputElement_get_height,
789 HTMLInputElement_put_start,
790 HTMLInputElement_get_start
791 };
792
793 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
794
795 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
796 REFIID riid, void **ppv)
797 {
798 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
799
800 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
801 }
802
803 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
804 {
805 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
806
807 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
808 }
809
810 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
811 {
812 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
813
814 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
815 }
816
817 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
818 {
819 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
820 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
821 }
822
823 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
824 LCID lcid, ITypeInfo **ppTInfo)
825 {
826 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
827 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
828 }
829
830 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
831 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
832 {
833 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
834 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
835 }
836
837 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
838 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
839 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
840 {
841 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
842 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
843 pVarResult, pExcepInfo, puArgErr);
844 }
845
846 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
847 {
848 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
849
850 TRACE("(%p)->(%p)\n", This, p);
851
852 return IHTMLInputElement_get_type(HTMLINPUT(This), p);
853 }
854
855 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
856 {
857 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
858
859 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
860
861 return IHTMLInputElement_put_value(HTMLINPUT(This), v);
862 }
863
864 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
865 {
866 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
867
868 TRACE("(%p)->(%p)\n", This, p);
869
870 return IHTMLInputElement_get_value(HTMLINPUT(This), p);
871 }
872
873 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
874 {
875 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
876
877 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
878
879 return IHTMLInputElement_put_name(HTMLINPUT(This), v);
880 }
881
882 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
883 {
884 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
885
886 TRACE("(%p)->(%p)\n", This, p);
887
888 return IHTMLInputElement_get_name(HTMLINPUT(This), p);
889 }
890
891 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
892 {
893 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
894 FIXME("(%p)->(v)\n", This);
895 return E_NOTIMPL;
896 }
897
898 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
899 {
900 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
901 TRACE("(%p)->(v)\n", This);
902 return E_NOTIMPL;
903 }
904
905 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
906 {
907 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
908
909 TRACE("(%p)->(%x)\n", This, v);
910
911 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
912 }
913
914 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
915 {
916 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
917
918 TRACE("(%p)->(%p)\n", This, p);
919
920 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
921 }
922
923 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
924 {
925 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
926
927 TRACE("(%p)->(%p)\n", This, p);
928
929 return IHTMLInputElement_get_form(HTMLINPUT(This), p);
930 }
931
932 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
933 {
934 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
935
936 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
937
938 return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
939 }
940
941 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
942 {
943 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
944
945 TRACE("(%p)->(%p)\n", This, p);
946
947 return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
948 }
949
950 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
951 {
952 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
953
954 TRACE("(%p)->(%d)\n", This, v);
955
956 return IHTMLInputElement_put_size(HTMLINPUT(This), v);
957 }
958
959 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
960 {
961 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
962
963 TRACE("(%p)->(%p)\n", This, p);
964
965 return IHTMLInputElement_get_size(HTMLINPUT(This), p);
966 }
967
968 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
969 {
970 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
971
972 TRACE("(%p)->(%d)\n", This, v);
973
974 return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
975 }
976
977 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
978 {
979 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
980
981 TRACE("(%p)->(%p)\n", This, p);
982
983 return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
984 }
985
986 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
987 {
988 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
989
990 TRACE("(%p)\n", This);
991
992 return IHTMLInputElement_select(HTMLINPUT(This));
993 }
994
995 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
996 {
997 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
998
999 TRACE("(%p)->()\n", This);
1000
1001 return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
1002 }
1003
1004 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1005 {
1006 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1007
1008 TRACE("(%p)->(%p)\n", This, p);
1009
1010 return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
1011 }
1012
1013 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1014 {
1015 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1016
1017 TRACE("(%p)->()\n", This);
1018
1019 return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
1020 }
1021
1022 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1023 {
1024 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1025
1026 TRACE("(%p)->(%p)\n", This, p);
1027
1028 return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
1029 }
1030
1031 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1032 {
1033 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1034
1035 TRACE("(%p)->(%x)\n", This, v);
1036
1037 return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
1038 }
1039
1040 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1041 {
1042 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1043
1044 TRACE("(%p)->(%p)\n", This, p);
1045
1046 return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
1047 }
1048
1049 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1050 {
1051 HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
1052
1053 TRACE("(%p)->(%p)\n", This, range);
1054
1055 return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
1056 }
1057
1058 #undef HTMLINPUT_THIS
1059
1060 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1061 HTMLInputTextElement_QueryInterface,
1062 HTMLInputTextElement_AddRef,
1063 HTMLInputTextElement_Release,
1064 HTMLInputTextElement_GetTypeInfoCount,
1065 HTMLInputTextElement_GetTypeInfo,
1066 HTMLInputTextElement_GetIDsOfNames,
1067 HTMLInputTextElement_Invoke,
1068 HTMLInputTextElement_get_type,
1069 HTMLInputTextElement_put_value,
1070 HTMLInputTextElement_get_value,
1071 HTMLInputTextElement_put_name,
1072 HTMLInputTextElement_get_name,
1073 HTMLInputTextElement_put_status,
1074 HTMLInputTextElement_get_status,
1075 HTMLInputTextElement_put_disabled,
1076 HTMLInputTextElement_get_disabled,
1077 HTMLInputTextElement_get_form,
1078 HTMLInputTextElement_put_defaultValue,
1079 HTMLInputTextElement_get_defaultValue,
1080 HTMLInputTextElement_put_size,
1081 HTMLInputTextElement_get_size,
1082 HTMLInputTextElement_put_maxLength,
1083 HTMLInputTextElement_get_maxLength,
1084 HTMLInputTextElement_select,
1085 HTMLInputTextElement_put_onchange,
1086 HTMLInputTextElement_get_onchange,
1087 HTMLInputTextElement_put_onselect,
1088 HTMLInputTextElement_get_onselect,
1089 HTMLInputTextElement_put_readOnly,
1090 HTMLInputTextElement_get_readOnly,
1091 HTMLInputTextElement_createTextRange
1092 };
1093
1094 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1095
1096 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1097 {
1098 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1099
1100 *ppv = NULL;
1101
1102 if(IsEqualGUID(&IID_IUnknown, riid)) {
1103 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1104 *ppv = HTMLINPUT(This);
1105 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1106 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1107 *ppv = HTMLINPUT(This);
1108 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1109 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1110 *ppv = HTMLINPUT(This);
1111 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1112 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1113 *ppv = HTMLINPUTTEXT(This);
1114 }
1115
1116 if(*ppv) {
1117 IUnknown_AddRef((IUnknown*)*ppv);
1118 return S_OK;
1119 }
1120
1121 return HTMLElement_QI(&This->element.node, riid, ppv);
1122 }
1123
1124 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1125 {
1126 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1127
1128 nsIDOMHTMLInputElement_Release(This->nsinput);
1129
1130 HTMLElement_destructor(&This->element.node);
1131 }
1132
1133 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1134 {
1135 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1136
1137 if(eid == EVENTID_CLICK) {
1138 nsresult nsres;
1139
1140 *handled = TRUE;
1141
1142 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1143 if(NS_FAILED(nsres)) {
1144 ERR("Click failed: %08x\n", nsres);
1145 return E_FAIL;
1146 }
1147 }
1148
1149 return S_OK;
1150 }
1151
1152 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1153 {
1154 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1155 return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
1156 }
1157
1158 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1159 {
1160 HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1161 return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
1162 }
1163
1164 #undef HTMLINPUT_NODE_THIS
1165
1166 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1167 HTMLInputElement_QI,
1168 HTMLInputElement_destructor,
1169 NULL,
1170 HTMLInputElementImpl_call_event,
1171 HTMLInputElementImpl_put_disabled,
1172 HTMLInputElementImpl_get_disabled,
1173 };
1174
1175 static const tid_t HTMLInputElement_iface_tids[] = {
1176 IHTMLDOMNode_tid,
1177 IHTMLDOMNode2_tid,
1178 IHTMLElement_tid,
1179 IHTMLElement2_tid,
1180 IHTMLElement3_tid,
1181 IHTMLInputElement_tid,
1182 0
1183 };
1184 static dispex_static_data_t HTMLInputElement_dispex = {
1185 NULL,
1186 DispHTMLInputElement_tid,
1187 NULL,
1188 HTMLInputElement_iface_tids
1189 };
1190
1191 HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
1192 {
1193 HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1194 nsresult nsres;
1195
1196 ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1197 ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
1198 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1199
1200 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1201
1202 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1203 (void**)&ret->nsinput);
1204 if(NS_FAILED(nsres))
1205 ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1206
1207 return &ret->element;
1208 }