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