Revert r66580 and r66579.
[reactos.git] / reactos / base / shell / ie / mshtml / htmlelem3.c
1 /*
2 * Copyright 2008 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 "mshtml_private.h"
20
21 static inline HTMLElement *impl_from_IHTMLElement3(IHTMLElement3 *iface)
22 {
23 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement3_iface);
24 }
25
26 static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
27 REFIID riid, void **ppv)
28 {
29 HTMLElement *This = impl_from_IHTMLElement3(iface);
30 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
31 }
32
33 static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
34 {
35 HTMLElement *This = impl_from_IHTMLElement3(iface);
36 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
37 }
38
39 static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
40 {
41 HTMLElement *This = impl_from_IHTMLElement3(iface);
42 return IHTMLElement_Release(&This->IHTMLElement_iface);
43 }
44
45 static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
46 {
47 HTMLElement *This = impl_from_IHTMLElement3(iface);
48 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
49 }
50
51 static HRESULT WINAPI HTMLElement3_GetTypeInfo(IHTMLElement3 *iface, UINT iTInfo,
52 LCID lcid, ITypeInfo **ppTInfo)
53 {
54 HTMLElement *This = impl_from_IHTMLElement3(iface);
55 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
56 }
57
58 static HRESULT WINAPI HTMLElement3_GetIDsOfNames(IHTMLElement3 *iface, REFIID riid,
59 LPOLESTR *rgszNames, UINT cNames,
60 LCID lcid, DISPID *rgDispId)
61 {
62 HTMLElement *This = impl_from_IHTMLElement3(iface);
63 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
64 lcid, rgDispId);
65 }
66
67 static HRESULT WINAPI HTMLElement3_Invoke(IHTMLElement3 *iface, DISPID dispIdMember,
68 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
69 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
70 {
71 HTMLElement *This = impl_from_IHTMLElement3(iface);
72 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
73 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
74 }
75
76 static HRESULT WINAPI HTMLElement3_mergeAttributes(IHTMLElement3 *iface, IHTMLElement *mergeThis, VARIANT *pvarFlags)
77 {
78 HTMLElement *This = impl_from_IHTMLElement3(iface);
79 FIXME("(%p)->(%p %p)\n", This, mergeThis, pvarFlags);
80 return E_NOTIMPL;
81 }
82
83 static HRESULT WINAPI HTMLElement3_get_isMultiLine(IHTMLElement3 *iface, VARIANT_BOOL *p)
84 {
85 HTMLElement *This = impl_from_IHTMLElement3(iface);
86 FIXME("(%p)->(%p)\n", This, p);
87 return E_NOTIMPL;
88 }
89
90 static HRESULT WINAPI HTMLElement3_get_canHaveHTML(IHTMLElement3 *iface, VARIANT_BOOL *p)
91 {
92 HTMLElement *This = impl_from_IHTMLElement3(iface);
93 FIXME("(%p)->(%p)\n", This, p);
94 return E_NOTIMPL;
95 }
96
97 static HRESULT WINAPI HTMLElement3_put_onlayoutcomplete(IHTMLElement3 *iface, VARIANT v)
98 {
99 HTMLElement *This = impl_from_IHTMLElement3(iface);
100 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
101 return E_NOTIMPL;
102 }
103
104 static HRESULT WINAPI HTMLElement3_get_onlayoutcomplete(IHTMLElement3 *iface, VARIANT *p)
105 {
106 HTMLElement *This = impl_from_IHTMLElement3(iface);
107 FIXME("(%p)->(%p)\n", This, p);
108 return E_NOTIMPL;
109 }
110
111 static HRESULT WINAPI HTMLElement3_put_onpage(IHTMLElement3 *iface, VARIANT v)
112 {
113 HTMLElement *This = impl_from_IHTMLElement3(iface);
114 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
115 return E_NOTIMPL;
116 }
117
118 static HRESULT WINAPI HTMLElement3_get_onpage(IHTMLElement3 *iface, VARIANT *p)
119 {
120 HTMLElement *This = impl_from_IHTMLElement3(iface);
121 FIXME("(%p)->(%p)\n", This, p);
122 return E_NOTIMPL;
123 }
124
125 static HRESULT WINAPI HTMLElement3_put_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL v)
126 {
127 HTMLElement *This = impl_from_IHTMLElement3(iface);
128 FIXME("(%p)->(%x)\n", This, v);
129 return E_NOTIMPL;
130 }
131
132 static HRESULT WINAPI HTMLElement3_get_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL *p)
133 {
134 HTMLElement *This = impl_from_IHTMLElement3(iface);
135 FIXME("(%p)->(%p)\n", This, p);
136 return E_NOTIMPL;
137 }
138
139 static HRESULT WINAPI HTMLElement3_put_onbeforedeactivate(IHTMLElement3 *iface, VARIANT v)
140 {
141 HTMLElement *This = impl_from_IHTMLElement3(iface);
142 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
143 return E_NOTIMPL;
144 }
145
146 static HRESULT WINAPI HTMLElement3_get_onbeforedeactivate(IHTMLElement3 *iface, VARIANT *p)
147 {
148 HTMLElement *This = impl_from_IHTMLElement3(iface);
149 FIXME("(%p)->(%p)\n", This, p);
150 return E_NOTIMPL;
151 }
152
153 static HRESULT WINAPI HTMLElement3_setActive(IHTMLElement3 *iface)
154 {
155 HTMLElement *This = impl_from_IHTMLElement3(iface);
156 FIXME("(%p)\n", This);
157 return E_NOTIMPL;
158 }
159
160 static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v)
161 {
162 HTMLElement *This = impl_from_IHTMLElement3(iface);
163 nsresult nsres;
164 nsAString str;
165
166 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
167
168 nsAString_InitDepend(&str, v);
169 nsres = nsIDOMHTMLElement_SetContentEditable(This->nselem, &str);
170 nsAString_Finish(&str);
171
172 if (NS_FAILED(nsres)){
173 ERR("SetContentEditable(%s) failed!\n", debugstr_w(v));
174 return E_FAIL;
175 }
176
177 return S_OK;
178 }
179
180 static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p)
181 {
182 HTMLElement *This = impl_from_IHTMLElement3(iface);
183 nsresult nsres;
184 nsAString str;
185
186 TRACE("(%p)->(%p)\n", This, p);
187
188 nsAString_Init(&str, NULL);
189 nsres = nsIDOMHTMLElement_GetContentEditable(This->nselem, &str);
190 return return_nsstr(nsres, &str, p);
191 }
192
193 static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
194 {
195 HTMLElement *This = impl_from_IHTMLElement3(iface);
196 FIXME("(%p)->(%p)\n", This, p);
197 return E_NOTIMPL;
198 }
199
200 static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
201 {
202 HTMLElement *This = impl_from_IHTMLElement3(iface);
203 FIXME("(%p)->(%x)\n", This, v);
204 return E_NOTIMPL;
205 }
206
207 static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL *p)
208 {
209 HTMLElement *This = impl_from_IHTMLElement3(iface);
210 FIXME("(%p)->(%p)\n", This, p);
211 return E_NOTIMPL;
212 }
213
214 static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
215
216 static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
217 {
218 HTMLElement *This = impl_from_IHTMLElement3(iface);
219 VARIANT *var;
220 HRESULT hres;
221
222 TRACE("(%p)->(%x)\n", This, v);
223
224 if(This->node.vtbl->put_disabled)
225 return This->node.vtbl->put_disabled(&This->node, v);
226
227 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, TRUE, &var);
228 if(FAILED(hres))
229 return hres;
230
231 VariantClear(var);
232 V_VT(var) = VT_BOOL;
233 V_BOOL(var) = v;
234 return S_OK;
235 }
236
237 static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
238 {
239 HTMLElement *This = impl_from_IHTMLElement3(iface);
240 VARIANT *var;
241 HRESULT hres;
242
243 TRACE("(%p)->(%p)\n", This, p);
244
245 if(This->node.vtbl->get_disabled)
246 return This->node.vtbl->get_disabled(&This->node, p);
247
248 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
249 if(hres == DISP_E_UNKNOWNNAME) {
250 *p = VARIANT_FALSE;
251 return S_OK;
252 }
253 if(FAILED(hres))
254 return hres;
255
256 if(V_VT(var) != VT_BOOL) {
257 FIXME("value is %s\n", debugstr_variant(var));
258 return E_NOTIMPL;
259 }
260
261 *p = V_BOOL(var);
262 return S_OK;
263 }
264
265 static HRESULT WINAPI HTMLElement3_get_isDisabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
266 {
267 HTMLElement *This = impl_from_IHTMLElement3(iface);
268 FIXME("(%p)->(%p)\n", This, p);
269 return E_NOTIMPL;
270 }
271
272 static HRESULT WINAPI HTMLElement3_put_onmove(IHTMLElement3 *iface, VARIANT v)
273 {
274 HTMLElement *This = impl_from_IHTMLElement3(iface);
275 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
276 return E_NOTIMPL;
277 }
278
279 static HRESULT WINAPI HTMLElement3_get_onmove(IHTMLElement3 *iface, VARIANT *p)
280 {
281 HTMLElement *This = impl_from_IHTMLElement3(iface);
282 FIXME("(%p)->(%p)\n", This, p);
283 return E_NOTIMPL;
284 }
285
286 static HRESULT WINAPI HTMLElement3_put_oncontrolselect(IHTMLElement3 *iface, VARIANT v)
287 {
288 HTMLElement *This = impl_from_IHTMLElement3(iface);
289 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
290 return E_NOTIMPL;
291 }
292
293 static HRESULT WINAPI HTMLElement3_get_oncontrolselect(IHTMLElement3 *iface, VARIANT *p)
294 {
295 HTMLElement *This = impl_from_IHTMLElement3(iface);
296 FIXME("(%p)->(%p)\n", This, p);
297 return E_NOTIMPL;
298 }
299
300 static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEventName,
301 VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
302 {
303 HTMLElement *This = impl_from_IHTMLElement3(iface);
304
305 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(bstrEventName), debugstr_variant(pvarEventObject),
306 pfCancelled);
307
308 return dispatch_event(&This->node, bstrEventName, pvarEventObject, pfCancelled);
309 }
310
311 static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)
312 {
313 HTMLElement *This = impl_from_IHTMLElement3(iface);
314 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
315 return E_NOTIMPL;
316 }
317
318 static HRESULT WINAPI HTMLElement3_get_onresizestart(IHTMLElement3 *iface, VARIANT *p)
319 {
320 HTMLElement *This = impl_from_IHTMLElement3(iface);
321 FIXME("(%p)->(%p)\n", This, p);
322 return E_NOTIMPL;
323 }
324
325 static HRESULT WINAPI HTMLElement3_put_onresizeend(IHTMLElement3 *iface, VARIANT v)
326 {
327 HTMLElement *This = impl_from_IHTMLElement3(iface);
328 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
329 return E_NOTIMPL;
330 }
331
332 static HRESULT WINAPI HTMLElement3_get_onresizeend(IHTMLElement3 *iface, VARIANT *p)
333 {
334 HTMLElement *This = impl_from_IHTMLElement3(iface);
335 FIXME("(%p)->(%p)\n", This, p);
336 return E_NOTIMPL;
337 }
338
339 static HRESULT WINAPI HTMLElement3_put_onmovestart(IHTMLElement3 *iface, VARIANT v)
340 {
341 HTMLElement *This = impl_from_IHTMLElement3(iface);
342 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
343 return E_NOTIMPL;
344 }
345
346 static HRESULT WINAPI HTMLElement3_get_onmovestart(IHTMLElement3 *iface, VARIANT *p)
347 {
348 HTMLElement *This = impl_from_IHTMLElement3(iface);
349 FIXME("(%p)->(%p)\n", This, p);
350 return E_NOTIMPL;
351 }
352
353 static HRESULT WINAPI HTMLElement3_put_onmoveend(IHTMLElement3 *iface, VARIANT v)
354 {
355 HTMLElement *This = impl_from_IHTMLElement3(iface);
356 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
357 return E_NOTIMPL;
358 }
359
360 static HRESULT WINAPI HTMLElement3_get_onmoveend(IHTMLElement3 *iface, VARIANT *p)
361 {
362 HTMLElement *This = impl_from_IHTMLElement3(iface);
363 FIXME("(%p)->(%p)\n", This, p);
364 return E_NOTIMPL;
365 }
366
367 static HRESULT WINAPI HTMLElement3_put_onmousecenter(IHTMLElement3 *iface, VARIANT v)
368 {
369 HTMLElement *This = impl_from_IHTMLElement3(iface);
370 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
371 return E_NOTIMPL;
372 }
373
374 static HRESULT WINAPI HTMLElement3_get_onmousecenter(IHTMLElement3 *iface, VARIANT *p)
375 {
376 HTMLElement *This = impl_from_IHTMLElement3(iface);
377 FIXME("(%p)->(%p)\n", This, p);
378 return E_NOTIMPL;
379 }
380
381 static HRESULT WINAPI HTMLElement3_put_onmouseleave(IHTMLElement3 *iface, VARIANT v)
382 {
383 HTMLElement *This = impl_from_IHTMLElement3(iface);
384 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
385 return E_NOTIMPL;
386 }
387
388 static HRESULT WINAPI HTMLElement3_get_onmouseleave(IHTMLElement3 *iface, VARIANT *p)
389 {
390 HTMLElement *This = impl_from_IHTMLElement3(iface);
391 FIXME("(%p)->(%p)\n", This, p);
392 return E_NOTIMPL;
393 }
394
395 static HRESULT WINAPI HTMLElement3_put_onactivate(IHTMLElement3 *iface, VARIANT v)
396 {
397 HTMLElement *This = impl_from_IHTMLElement3(iface);
398 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
399 return E_NOTIMPL;
400 }
401
402 static HRESULT WINAPI HTMLElement3_get_onactivate(IHTMLElement3 *iface, VARIANT *p)
403 {
404 HTMLElement *This = impl_from_IHTMLElement3(iface);
405 FIXME("(%p)->(%p)\n", This, p);
406 return E_NOTIMPL;
407 }
408
409 static HRESULT WINAPI HTMLElement3_put_ondeactivate(IHTMLElement3 *iface, VARIANT v)
410 {
411 HTMLElement *This = impl_from_IHTMLElement3(iface);
412 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
413 return E_NOTIMPL;
414 }
415
416 static HRESULT WINAPI HTMLElement3_get_ondeactivate(IHTMLElement3 *iface, VARIANT *p)
417 {
418 HTMLElement *This = impl_from_IHTMLElement3(iface);
419 FIXME("(%p)->(%p)\n", This, p);
420 return E_NOTIMPL;
421 }
422
423 static HRESULT WINAPI HTMLElement3_dragDrop(IHTMLElement3 *iface, VARIANT_BOOL *pfRet)
424 {
425 HTMLElement *This = impl_from_IHTMLElement3(iface);
426 FIXME("(%p)->(%p)\n", This, pfRet);
427 return E_NOTIMPL;
428 }
429
430 static HRESULT WINAPI HTMLElement3_get_glyphMode(IHTMLElement3 *iface, LONG *p)
431 {
432 HTMLElement *This = impl_from_IHTMLElement3(iface);
433 FIXME("(%p)->(%p)\n", This, p);
434 return E_NOTIMPL;
435 }
436
437 static const IHTMLElement3Vtbl HTMLElement3Vtbl = {
438 HTMLElement3_QueryInterface,
439 HTMLElement3_AddRef,
440 HTMLElement3_Release,
441 HTMLElement3_GetTypeInfoCount,
442 HTMLElement3_GetTypeInfo,
443 HTMLElement3_GetIDsOfNames,
444 HTMLElement3_Invoke,
445 HTMLElement3_mergeAttributes,
446 HTMLElement3_get_isMultiLine,
447 HTMLElement3_get_canHaveHTML,
448 HTMLElement3_put_onlayoutcomplete,
449 HTMLElement3_get_onlayoutcomplete,
450 HTMLElement3_put_onpage,
451 HTMLElement3_get_onpage,
452 HTMLElement3_put_inflateBlock,
453 HTMLElement3_get_inflateBlock,
454 HTMLElement3_put_onbeforedeactivate,
455 HTMLElement3_get_onbeforedeactivate,
456 HTMLElement3_setActive,
457 HTMLElement3_put_contentEditable,
458 HTMLElement3_get_contentEditable,
459 HTMLElement3_get_isContentEditable,
460 HTMLElement3_put_hideFocus,
461 HTMLElement3_get_hideFocus,
462 HTMLElement3_put_disabled,
463 HTMLElement3_get_disabled,
464 HTMLElement3_get_isDisabled,
465 HTMLElement3_put_onmove,
466 HTMLElement3_get_onmove,
467 HTMLElement3_put_oncontrolselect,
468 HTMLElement3_get_oncontrolselect,
469 HTMLElement3_fireEvent,
470 HTMLElement3_put_onresizestart,
471 HTMLElement3_get_onresizestart,
472 HTMLElement3_put_onresizeend,
473 HTMLElement3_get_onresizeend,
474 HTMLElement3_put_onmovestart,
475 HTMLElement3_get_onmovestart,
476 HTMLElement3_put_onmoveend,
477 HTMLElement3_get_onmoveend,
478 HTMLElement3_put_onmousecenter,
479 HTMLElement3_get_onmousecenter,
480 HTMLElement3_put_onmouseleave,
481 HTMLElement3_get_onmouseleave,
482 HTMLElement3_put_onactivate,
483 HTMLElement3_get_onactivate,
484 HTMLElement3_put_ondeactivate,
485 HTMLElement3_get_ondeactivate,
486 HTMLElement3_dragDrop,
487 HTMLElement3_get_glyphMode
488 };
489
490 static inline HTMLElement *impl_from_IHTMLElement4(IHTMLElement4 *iface)
491 {
492 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement4_iface);
493 }
494
495 static HRESULT WINAPI HTMLElement4_QueryInterface(IHTMLElement4 *iface,
496 REFIID riid, void **ppv)
497 {
498 HTMLElement *This = impl_from_IHTMLElement4(iface);
499 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
500 }
501
502 static ULONG WINAPI HTMLElement4_AddRef(IHTMLElement4 *iface)
503 {
504 HTMLElement *This = impl_from_IHTMLElement4(iface);
505 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
506 }
507
508 static ULONG WINAPI HTMLElement4_Release(IHTMLElement4 *iface)
509 {
510 HTMLElement *This = impl_from_IHTMLElement4(iface);
511 return IHTMLElement_Release(&This->IHTMLElement_iface);
512 }
513
514 static HRESULT WINAPI HTMLElement4_GetTypeInfoCount(IHTMLElement4 *iface, UINT *pctinfo)
515 {
516 HTMLElement *This = impl_from_IHTMLElement4(iface);
517 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
518 }
519
520 static HRESULT WINAPI HTMLElement4_GetTypeInfo(IHTMLElement4 *iface, UINT iTInfo,
521 LCID lcid, ITypeInfo **ppTInfo)
522 {
523 HTMLElement *This = impl_from_IHTMLElement4(iface);
524 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
525 }
526
527 static HRESULT WINAPI HTMLElement4_GetIDsOfNames(IHTMLElement4 *iface, REFIID riid,
528 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
529 {
530 HTMLElement *This = impl_from_IHTMLElement4(iface);
531 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
532 lcid, rgDispId);
533 }
534
535 static HRESULT WINAPI HTMLElement4_Invoke(IHTMLElement4 *iface, DISPID dispIdMember, REFIID riid,
536 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
537 {
538 HTMLElement *This = impl_from_IHTMLElement4(iface);
539 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
540 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
541 }
542
543 static HRESULT WINAPI HTMLElement4_put_onmousewheel(IHTMLElement4 *iface, VARIANT v)
544 {
545 HTMLElement *This = impl_from_IHTMLElement4(iface);
546
547 FIXME("(%p)->(%s) semi-stub\n", This, debugstr_variant(&v));
548
549 return set_node_event(&This->node, EVENTID_MOUSEWHEEL, &v);
550 }
551
552 static HRESULT WINAPI HTMLElement4_get_onmousewheel(IHTMLElement4 *iface, VARIANT *p)
553 {
554 HTMLElement *This = impl_from_IHTMLElement4(iface);
555
556 TRACE("(%p)->(%p)\n", This, p);
557
558 return get_node_event(&This->node, EVENTID_MOUSEWHEEL, p);
559 }
560
561 static HRESULT WINAPI HTMLElement4_normalize(IHTMLElement4 *iface)
562 {
563 HTMLElement *This = impl_from_IHTMLElement4(iface);
564 FIXME("(%p)\n", This);
565 return E_NOTIMPL;
566 }
567
568 static HRESULT WINAPI HTMLElement4_getAttributeNode(IHTMLElement4 *iface, BSTR bstrname, IHTMLDOMAttribute **ppAttribute)
569 {
570 HTMLElement *This = impl_from_IHTMLElement4(iface);
571 HTMLAttributeCollection *attrs;
572 HRESULT hres;
573
574 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrname), ppAttribute);
575
576 hres = HTMLElement_get_attr_col(&This->node, &attrs);
577 if(FAILED(hres))
578 return hres;
579
580 hres = IHTMLAttributeCollection2_getNamedItem(&attrs->IHTMLAttributeCollection2_iface, bstrname, ppAttribute);
581 IHTMLAttributeCollection_Release(&attrs->IHTMLAttributeCollection_iface);
582 return hres;
583 }
584
585 static HRESULT WINAPI HTMLElement4_setAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
586 IHTMLDOMAttribute **ppretAttribute)
587 {
588 HTMLElement *This = impl_from_IHTMLElement4(iface);
589 FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
590 return E_NOTIMPL;
591 }
592
593 static HRESULT WINAPI HTMLElement4_removeAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
594 IHTMLDOMAttribute **ppretAttribute)
595 {
596 HTMLElement *This = impl_from_IHTMLElement4(iface);
597 FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
598 return E_NOTIMPL;
599 }
600
601 static HRESULT WINAPI HTMLElement4_put_onbeforeactivate(IHTMLElement4 *iface, VARIANT v)
602 {
603 HTMLElement *This = impl_from_IHTMLElement4(iface);
604 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
605 return E_NOTIMPL;
606 }
607
608 static HRESULT WINAPI HTMLElement4_get_onbeforeactivate(IHTMLElement4 *iface, VARIANT *p)
609 {
610 HTMLElement *This = impl_from_IHTMLElement4(iface);
611 FIXME("(%p)->(%p)\n", This, p);
612 return E_NOTIMPL;
613 }
614
615 static HRESULT WINAPI HTMLElement4_put_onfocusin(IHTMLElement4 *iface, VARIANT v)
616 {
617 HTMLElement *This = impl_from_IHTMLElement4(iface);
618 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
619 return E_NOTIMPL;
620 }
621
622 static HRESULT WINAPI HTMLElement4_get_onfocusin(IHTMLElement4 *iface, VARIANT *p)
623 {
624 HTMLElement *This = impl_from_IHTMLElement4(iface);
625 FIXME("(%p)->(%p)\n", This, p);
626 return E_NOTIMPL;
627 }
628
629 static HRESULT WINAPI HTMLElement4_put_onfocusout(IHTMLElement4 *iface, VARIANT v)
630 {
631 HTMLElement *This = impl_from_IHTMLElement4(iface);
632 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
633 return E_NOTIMPL;
634 }
635
636 static HRESULT WINAPI HTMLElement4_get_onfocusout(IHTMLElement4 *iface, VARIANT *p)
637 {
638 HTMLElement *This = impl_from_IHTMLElement4(iface);
639 FIXME("(%p)->(%p)\n", This, p);
640 return E_NOTIMPL;
641 }
642
643 static const IHTMLElement4Vtbl HTMLElement4Vtbl = {
644 HTMLElement4_QueryInterface,
645 HTMLElement4_AddRef,
646 HTMLElement4_Release,
647 HTMLElement4_GetTypeInfoCount,
648 HTMLElement4_GetTypeInfo,
649 HTMLElement4_GetIDsOfNames,
650 HTMLElement4_Invoke,
651 HTMLElement4_put_onmousewheel,
652 HTMLElement4_get_onmousewheel,
653 HTMLElement4_normalize,
654 HTMLElement4_getAttributeNode,
655 HTMLElement4_setAttributeNode,
656 HTMLElement4_removeAttributeNode,
657 HTMLElement4_put_onbeforeactivate,
658 HTMLElement4_get_onbeforeactivate,
659 HTMLElement4_put_onfocusin,
660 HTMLElement4_get_onfocusin,
661 HTMLElement4_put_onfocusout,
662 HTMLElement4_get_onfocusout
663 };
664
665 void HTMLElement3_Init(HTMLElement *This)
666 {
667 This->IHTMLElement3_iface.lpVtbl = &HTMLElement3Vtbl;
668 This->IHTMLElement4_iface.lpVtbl = &HTMLElement4Vtbl;
669 }