dplayx/tests: Fix compilation on systems that don't support nameless unions.
[wine.git] / dlls / mshtml / htmlelem2.c
blob3455517d3163d51019d1e70fb0ecdf5486085023
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
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.
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.
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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 #define HTMLELEM2_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement2, iface)
37 static HRESULT WINAPI HTMLElement2_QueryInterface(IHTMLElement2 *iface,
38 REFIID riid, void **ppv)
40 HTMLElement *This = HTMLELEM2_THIS(iface);
41 return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
44 static ULONG WINAPI HTMLElement2_AddRef(IHTMLElement2 *iface)
46 HTMLElement *This = HTMLELEM2_THIS(iface);
47 return IHTMLElement_AddRef(HTMLELEM(This));
50 static ULONG WINAPI HTMLElement2_Release(IHTMLElement2 *iface)
52 HTMLElement *This = HTMLELEM2_THIS(iface);
53 return IHTMLElement_Release(HTMLELEM(This));
56 static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
58 HTMLElement *This = HTMLELEM2_THIS(iface);
59 FIXME("(%p)->(%p)\n", This, pctinfo);
60 return E_NOTIMPL;
63 static HRESULT WINAPI HTMLElement2_GetTypeInfo(IHTMLElement2 *iface, UINT iTInfo,
64 LCID lcid, ITypeInfo **ppTInfo)
66 HTMLElement *This = HTMLELEM2_THIS(iface);
67 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
68 return E_NOTIMPL;
71 static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
72 LPOLESTR *rgszNames, UINT cNames,
73 LCID lcid, DISPID *rgDispId)
75 HTMLElement *This = HTMLELEM2_THIS(iface);
76 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
77 lcid, rgDispId);
78 return E_NOTIMPL;
81 static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
82 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
83 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
85 HTMLElement *This = HTMLELEM2_THIS(iface);
86 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
87 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
88 return E_NOTIMPL;
91 static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
93 HTMLElement *This = HTMLELEM2_THIS(iface);
94 FIXME("(%p)->(%p)\n", This, p);
95 return E_NOTIMPL;
98 static HRESULT WINAPI HTMLElement2_setCapture(IHTMLElement2 *iface, VARIANT_BOOL containerCapture)
100 HTMLElement *This = HTMLELEM2_THIS(iface);
101 FIXME("(%p)->(%x)\n", This, containerCapture);
102 return E_NOTIMPL;
105 static HRESULT WINAPI HTMLElement2_releaseCapture(IHTMLElement2 *iface)
107 HTMLElement *This = HTMLELEM2_THIS(iface);
108 FIXME("(%p)\n", This);
109 return E_NOTIMPL;
112 static HRESULT WINAPI HTMLElement2_put_onlosecapture(IHTMLElement2 *iface, VARIANT v)
114 HTMLElement *This = HTMLELEM2_THIS(iface);
115 FIXME("(%p)->()\n", This);
116 return E_NOTIMPL;
119 static HRESULT WINAPI HTMLElement2_get_onlosecapture(IHTMLElement2 *iface, VARIANT *p)
121 HTMLElement *This = HTMLELEM2_THIS(iface);
122 FIXME("(%p)->(%p)\n", This, p);
123 return E_NOTIMPL;
126 static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
127 long x, long y, BSTR *component)
129 HTMLElement *This = HTMLELEM2_THIS(iface);
130 FIXME("(%p)->(%ld %ld %p)\n", This, x, y, component);
131 return E_NOTIMPL;
134 static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
136 HTMLElement *This = HTMLELEM2_THIS(iface);
137 FIXME("(%p)->()\n", This);
138 return E_NOTIMPL;
141 static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
143 HTMLElement *This = HTMLELEM2_THIS(iface);
144 FIXME("(%p)->()\n", This);
145 return E_NOTIMPL;
148 static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p)
150 HTMLElement *This = HTMLELEM2_THIS(iface);
151 FIXME("(%p)->(%p)\n", This, p);
152 return E_NOTIMPL;
155 static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
157 HTMLElement *This = HTMLELEM2_THIS(iface);
158 FIXME("(%p)->()\n", This);
159 return E_NOTIMPL;
162 static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
164 HTMLElement *This = HTMLELEM2_THIS(iface);
165 FIXME("(%p)->(%p)\n", This, p);
166 return E_NOTIMPL;
169 static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
171 HTMLElement *This = HTMLELEM2_THIS(iface);
172 FIXME("(%p)->()\n", This);
173 return E_NOTIMPL;
176 static HRESULT WINAPI HTMLElement2_get_ondragend(IHTMLElement2 *iface, VARIANT *p)
178 HTMLElement *This = HTMLELEM2_THIS(iface);
179 FIXME("(%p)->(%p)\n", This, p);
180 return E_NOTIMPL;
183 static HRESULT WINAPI HTMLElement2_put_ondragenter(IHTMLElement2 *iface, VARIANT v)
185 HTMLElement *This = HTMLELEM2_THIS(iface);
186 FIXME("(%p)->()\n", This);
187 return E_NOTIMPL;
190 static HRESULT WINAPI HTMLElement2_get_ondragenter(IHTMLElement2 *iface, VARIANT *p)
192 HTMLElement *This = HTMLELEM2_THIS(iface);
193 FIXME("(%p)->(%p)\n", This, p);
194 return E_NOTIMPL;
197 static HRESULT WINAPI HTMLElement2_put_ondragover(IHTMLElement2 *iface, VARIANT v)
199 HTMLElement *This = HTMLELEM2_THIS(iface);
200 FIXME("(%p)->()\n", This);
201 return E_NOTIMPL;
204 static HRESULT WINAPI HTMLElement2_get_ondragover(IHTMLElement2 *iface, VARIANT *p)
206 HTMLElement *This = HTMLELEM2_THIS(iface);
207 FIXME("(%p)->(%p)\n", This, p);
208 return E_NOTIMPL;
211 static HRESULT WINAPI HTMLElement2_put_ondragleave(IHTMLElement2 *iface, VARIANT v)
213 HTMLElement *This = HTMLELEM2_THIS(iface);
214 FIXME("(%p)->()\n", This);
215 return E_NOTIMPL;
218 static HRESULT WINAPI HTMLElement2_get_ondragleave(IHTMLElement2 *iface, VARIANT *p)
220 HTMLElement *This = HTMLELEM2_THIS(iface);
221 FIXME("(%p)->(%p)\n", This, p);
222 return E_NOTIMPL;
225 static HRESULT WINAPI HTMLElement2_put_ondrop(IHTMLElement2 *iface, VARIANT v)
227 HTMLElement *This = HTMLELEM2_THIS(iface);
228 FIXME("(%p)->()\n", This);
229 return E_NOTIMPL;
232 static HRESULT WINAPI HTMLElement2_get_ondrop(IHTMLElement2 *iface, VARIANT *p)
234 HTMLElement *This = HTMLELEM2_THIS(iface);
235 FIXME("(%p)->(%p)\n", This, p);
236 return E_NOTIMPL;
239 static HRESULT WINAPI HTMLElement2_put_onbeforecut(IHTMLElement2 *iface, VARIANT v)
241 HTMLElement *This = HTMLELEM2_THIS(iface);
242 FIXME("(%p)->()\n", This);
243 return E_NOTIMPL;
246 static HRESULT WINAPI HTMLElement2_get_onbeforecut(IHTMLElement2 *iface, VARIANT *p)
248 HTMLElement *This = HTMLELEM2_THIS(iface);
249 FIXME("(%p)->(%p)\n", This, p);
250 return E_NOTIMPL;
253 static HRESULT WINAPI HTMLElement2_put_oncut(IHTMLElement2 *iface, VARIANT v)
255 HTMLElement *This = HTMLELEM2_THIS(iface);
256 FIXME("(%p)->()\n", This);
257 return E_NOTIMPL;
260 static HRESULT WINAPI HTMLElement2_get_oncut(IHTMLElement2 *iface, VARIANT *p)
262 HTMLElement *This = HTMLELEM2_THIS(iface);
263 FIXME("(%p)->(%p)\n", This, p);
264 return E_NOTIMPL;
267 static HRESULT WINAPI HTMLElement2_put_onbeforecopy(IHTMLElement2 *iface, VARIANT v)
269 HTMLElement *This = HTMLELEM2_THIS(iface);
270 FIXME("(%p)->()\n", This);
271 return E_NOTIMPL;
274 static HRESULT WINAPI HTMLElement2_get_onbeforecopy(IHTMLElement2 *iface, VARIANT *p)
276 HTMLElement *This = HTMLELEM2_THIS(iface);
277 FIXME("(%p)->(%p)\n", This, p);
278 return E_NOTIMPL;
281 static HRESULT WINAPI HTMLElement2_put_oncopy(IHTMLElement2 *iface, VARIANT v)
283 HTMLElement *This = HTMLELEM2_THIS(iface);
284 FIXME("(%p)->()\n", This);
285 return E_NOTIMPL;
288 static HRESULT WINAPI HTMLElement2_get_oncopy(IHTMLElement2 *iface, VARIANT *p)
290 HTMLElement *This = HTMLELEM2_THIS(iface);
291 FIXME("(%p)->(%p)\n", This, p);
292 return E_NOTIMPL;
295 static HRESULT WINAPI HTMLElement2_put_onbeforepaste(IHTMLElement2 *iface, VARIANT v)
297 HTMLElement *This = HTMLELEM2_THIS(iface);
298 FIXME("(%p)->()\n", This);
299 return E_NOTIMPL;
302 static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIANT *p)
304 HTMLElement *This = HTMLELEM2_THIS(iface);
305 FIXME("(%p)->(%p)\n", This, p);
306 return E_NOTIMPL;
309 static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
311 HTMLElement *This = HTMLELEM2_THIS(iface);
312 FIXME("(%p)->()\n", This);
313 return E_NOTIMPL;
316 static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
318 HTMLElement *This = HTMLELEM2_THIS(iface);
319 FIXME("(%p)->(%p)\n", This, p);
320 return E_NOTIMPL;
323 static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
325 HTMLElement *This = HTMLELEM2_THIS(iface);
326 FIXME("(%p)->(%p)\n", This, p);
327 return E_NOTIMPL;
330 static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
332 HTMLElement *This = HTMLELEM2_THIS(iface);
333 FIXME("(%p)->()\n", This);
334 return E_NOTIMPL;
337 static HRESULT WINAPI HTMLElement2_get_onpropertychange(IHTMLElement2 *iface, VARIANT *p)
339 HTMLElement *This = HTMLELEM2_THIS(iface);
340 FIXME("(%p)->(%p)\n", This, p);
341 return E_NOTIMPL;
344 static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRectCollection **pRectCol)
346 HTMLElement *This = HTMLELEM2_THIS(iface);
347 FIXME("(%p)->(%p)\n", This, pRectCol);
348 return E_NOTIMPL;
351 static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect)
353 HTMLElement *This = HTMLELEM2_THIS(iface);
354 FIXME("(%p)->(%p)\n", This, pRect);
355 return E_NOTIMPL;
358 static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname,
359 BSTR expression, BSTR language)
361 HTMLElement *This = HTMLELEM2_THIS(iface);
362 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression),
363 debugstr_w(language));
364 return E_NOTIMPL;
367 static HRESULT WINAPI HTMLElement2_getExpression(IHTMLElement2 *iface, BSTR propname,
368 VARIANT *expression)
370 HTMLElement *This = HTMLELEM2_THIS(iface);
371 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
372 return E_NOTIMPL;
375 static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR propname,
376 VARIANT_BOOL *pfSuccess)
378 HTMLElement *This = HTMLELEM2_THIS(iface);
379 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
380 return E_NOTIMPL;
383 static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
385 HTMLElement *This = HTMLELEM2_THIS(iface);
386 nsIDOMNSHTMLElement *nselem;
387 nsresult nsres;
389 TRACE("(%p)->(%d)\n", This, v);
391 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
392 if(NS_FAILED(nsres)) {
393 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
394 return S_OK;
397 nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
398 nsIDOMNSHTMLElement_Release(nselem);
399 if(NS_FAILED(nsres))
400 ERR("GetTabIndex failed: %08x\n", nsres);
402 return S_OK;
405 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
407 HTMLElement *This = HTMLELEM2_THIS(iface);
408 nsIDOMNSHTMLElement *nselem;
409 PRInt32 index = 0;
410 nsresult nsres;
412 TRACE("(%p)->(%p)\n", This, p);
414 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
415 if(NS_FAILED(nsres)) {
416 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
417 return E_FAIL;
420 nsres = nsIDOMNSHTMLElement_GetTabIndex(nselem, &index);
421 nsIDOMNSHTMLElement_Release(nselem);
422 if(NS_FAILED(nsres)) {
423 ERR("GetTabIndex failed: %08x\n", nsres);
424 return E_FAIL;
427 *p = index;
428 return S_OK;
431 static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
433 HTMLElement *This = HTMLELEM2_THIS(iface);
434 nsIDOMNSHTMLElement *nselem;
435 nsresult nsres;
437 TRACE("(%p)\n", This);
439 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
440 if(NS_SUCCEEDED(nsres)) {
441 nsIDOMNSHTMLElement_focus(nselem);
442 nsIDOMNSHTMLElement_Release(nselem);
443 }else {
444 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
447 return S_OK;
450 static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
452 HTMLElement *This = HTMLELEM2_THIS(iface);
453 VARIANT var;
455 static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
457 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
459 V_VT(&var) = VT_BSTR;
460 V_BSTR(&var) = v;
461 return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
464 static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
466 HTMLElement *This = HTMLELEM2_THIS(iface);
467 FIXME("(%p)->(%p)\n", This, p);
468 return E_NOTIMPL;
471 static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
473 HTMLElement *This = HTMLELEM2_THIS(iface);
474 FIXME("(%p)->()\n", This);
475 return E_NOTIMPL;
478 static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
480 HTMLElement *This = HTMLELEM2_THIS(iface);
481 FIXME("(%p)->(%p)\n", This, p);
482 return E_NOTIMPL;
485 static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
487 HTMLElement *This = HTMLELEM2_THIS(iface);
488 FIXME("(%p)->()\n", This);
489 return E_NOTIMPL;
492 static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
494 HTMLElement *This = HTMLELEM2_THIS(iface);
495 FIXME("(%p)->(%p)\n", This, p);
496 return E_NOTIMPL;
499 static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
501 HTMLElement *This = HTMLELEM2_THIS(iface);
502 FIXME("(%p)->()\n", This);
503 return E_NOTIMPL;
506 static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p)
508 HTMLElement *This = HTMLELEM2_THIS(iface);
509 FIXME("(%p)->(%p)\n", This, p);
510 return E_NOTIMPL;
513 static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
515 HTMLElement *This = HTMLELEM2_THIS(iface);
516 FIXME("(%p)\n", This);
517 return E_NOTIMPL;
520 static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
522 HTMLElement *This = HTMLELEM2_THIS(iface);
523 FIXME("(%p)->(%p)\n", This, pUnk);
524 return E_NOTIMPL;
527 static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *pUnk)
529 HTMLElement *This = HTMLELEM2_THIS(iface);
530 FIXME("(%p)->(%p)\n", This, pUnk);
531 return E_NOTIMPL;
534 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *p)
536 HTMLElement *This = HTMLELEM2_THIS(iface);
537 nsIDOMNSHTMLElement *nselem;
538 PRInt32 height=0;
539 nsresult nsres;
541 TRACE("(%p)->(%p)\n", This, p);
543 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
544 if(NS_SUCCEEDED(nsres)) {
545 nsIDOMNSHTMLElement_GetClientHeight(nselem, &height);
546 nsIDOMNSHTMLElement_Release(nselem);
547 }else {
548 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
551 *p = height;
552 return S_OK;
555 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, long *p)
557 HTMLElement *This = HTMLELEM2_THIS(iface);
558 nsIDOMNSHTMLElement *nselem;
559 PRInt32 width=0;
560 nsresult nsres;
562 TRACE("(%p)->(%p)\n", This, p);
564 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
565 if(NS_SUCCEEDED(nsres)) {
566 nsIDOMNSHTMLElement_GetClientWidth(nselem, &width);
567 nsIDOMNSHTMLElement_Release(nselem);
568 }else {
569 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
572 *p = width;
573 return S_OK;
576 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, long *p)
578 HTMLElement *This = HTMLELEM2_THIS(iface);
579 FIXME("(%p)->(%p)\n", This, p);
580 return E_NOTIMPL;
583 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, long *p)
585 HTMLElement *This = HTMLELEM2_THIS(iface);
586 FIXME("(%p)->(%p)\n", This, p);
587 return E_NOTIMPL;
590 static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
591 IDispatch *pDisp, VARIANT_BOOL *pfResult)
593 HTMLElement *This = HTMLELEM2_THIS(iface);
594 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
595 return E_NOTIMPL;
598 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
600 HTMLElement *This = HTMLELEM2_THIS(iface);
601 FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
602 return E_NOTIMPL;
605 static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
607 HTMLElement *This = HTMLELEM2_THIS(iface);
608 FIXME("(%p)->(%p)\n", This, p);
609 return E_NOTIMPL;
612 static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
614 HTMLElement *This = HTMLELEM2_THIS(iface);
615 FIXME("(%p)->()\n", This);
616 return E_NOTIMPL;
619 static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
621 HTMLElement *This = HTMLELEM2_THIS(iface);
622 FIXME("(%p)->(%p)\n", This, p);
623 return E_NOTIMPL;
626 static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
628 HTMLElement *This = HTMLELEM2_THIS(iface);
629 FIXME("(%p)->()\n", This);
630 return E_NOTIMPL;
633 static HRESULT WINAPI HTMLElement2_get_onrowsdelete(IHTMLElement2 *iface, VARIANT *p)
635 HTMLElement *This = HTMLELEM2_THIS(iface);
636 FIXME("(%p)->(%p)\n", This, p);
637 return E_NOTIMPL;
640 static HRESULT WINAPI HTMLElement2_put_onrowsinserted(IHTMLElement2 *iface, VARIANT v)
642 HTMLElement *This = HTMLELEM2_THIS(iface);
643 FIXME("(%p)->()\n", This);
644 return E_NOTIMPL;
647 static HRESULT WINAPI HTMLElement2_get_onrowsinserted(IHTMLElement2 *iface, VARIANT *p)
649 HTMLElement *This = HTMLELEM2_THIS(iface);
650 FIXME("(%p)->(%p)\n", This, p);
651 return E_NOTIMPL;
654 static HRESULT WINAPI HTMLElement2_put_oncellchange(IHTMLElement2 *iface, VARIANT v)
656 HTMLElement *This = HTMLELEM2_THIS(iface);
657 FIXME("(%p)->()\n", This);
658 return E_NOTIMPL;
661 static HRESULT WINAPI HTMLElement2_get_oncellchange(IHTMLElement2 *iface, VARIANT *p)
663 HTMLElement *This = HTMLELEM2_THIS(iface);
664 FIXME("(%p)->(%p)\n", This, p);
665 return E_NOTIMPL;
668 static HRESULT WINAPI HTMLElement2_put_dir(IHTMLElement2 *iface, BSTR v)
670 HTMLElement *This = HTMLELEM2_THIS(iface);
671 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
672 return E_NOTIMPL;
675 static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
677 HTMLElement *This = HTMLELEM2_THIS(iface);
679 TRACE("(%p)->(%p)\n", This, p);
681 *p = NULL;
683 if(This->nselem) {
684 nsAString dir_str;
685 nsresult nsres;
687 nsAString_Init(&dir_str, NULL);
689 nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
690 if(NS_SUCCEEDED(nsres)) {
691 const PRUnichar *dir;
692 nsAString_GetData(&dir_str, &dir);
693 if(*dir)
694 *p = SysAllocString(dir);
695 }else {
696 ERR("GetDir failed: %08x\n", nsres);
699 nsAString_Finish(&dir_str);
702 TRACE("ret %s\n", debugstr_w(*p));
703 return S_OK;
706 static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDispatch **range)
708 HTMLElement *This = HTMLELEM2_THIS(iface);
709 FIXME("(%p)->(%p)\n", This, range);
710 return E_NOTIMPL;
713 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *p)
715 HTMLElement *This = HTMLELEM2_THIS(iface);
716 nsIDOMNSHTMLElement *nselem;
717 PRInt32 height = 0;
718 nsresult nsres;
720 TRACE("(%p)->(%p)\n", This, p);
722 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
723 if(NS_SUCCEEDED(nsres)) {
724 nsres = nsIDOMNSHTMLElement_GetScrollHeight(nselem, &height);
725 nsIDOMNSHTMLElement_Release(nselem);
726 if(NS_FAILED(nsres))
727 ERR("GetScrollHeight failed: %08x\n", nsres);
728 }else {
729 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
732 *p = height;
733 TRACE("*p = %ld\n", *p);
735 return S_OK;
738 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p)
740 HTMLElement *This = HTMLELEM2_THIS(iface);
741 nsIDOMNSHTMLElement *nselem;
742 PRInt32 width = 0;
743 nsresult nsres;
745 TRACE("(%p)->(%p)\n", This, p);
747 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
748 if(NS_SUCCEEDED(nsres)) {
749 nsres = nsIDOMNSHTMLElement_GetScrollWidth(nselem, &width);
750 nsIDOMNSHTMLElement_Release(nselem);
751 if(NS_FAILED(nsres))
752 ERR("GetScrollWidth failed: %08x\n", nsres);
753 }else {
754 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
757 *p = width;
758 TRACE("*p = %ld\n", *p);
760 return S_OK;
763 static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
765 HTMLElement *This = HTMLELEM2_THIS(iface);
766 nsIDOMNSHTMLElement *nselem;
767 nsresult nsres;
769 TRACE("(%p)->(%ld)\n", This, v);
771 if(!This->nselem) {
772 FIXME("NULL nselem\n");
773 return E_NOTIMPL;
776 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
777 if(NS_SUCCEEDED(nsres)) {
778 nsIDOMNSHTMLElement_SetScrollTop(nselem, v);
779 nsIDOMNSHTMLElement_Release(nselem);
780 }else {
781 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
784 return S_OK;
787 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
789 HTMLElement *This = HTMLELEM2_THIS(iface);
790 nsIDOMNSHTMLElement *nselem;
791 PRInt32 top = 0;
792 nsresult nsres;
794 TRACE("(%p)->(%p)\n", This, p);
796 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
797 if(NS_SUCCEEDED(nsres)) {
798 nsres = nsIDOMNSHTMLElement_GetScrollTop(nselem, &top);
799 nsIDOMNSHTMLElement_Release(nselem);
800 if(NS_FAILED(nsres))
801 ERR("GetScrollTop failed: %08x\n", nsres);
802 }else {
803 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
806 *p = top;
807 TRACE("*p = %ld\n", *p);
809 return S_OK;
812 static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
814 HTMLElement *This = HTMLELEM2_THIS(iface);
815 nsIDOMNSHTMLElement *nselem;
816 nsresult nsres;
818 TRACE("(%p)->(%ld)\n", This, v);
820 if(!This->nselem) {
821 FIXME("NULL nselem\n");
822 return E_NOTIMPL;
825 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
826 if(NS_SUCCEEDED(nsres)) {
827 nsIDOMNSHTMLElement_SetScrollLeft(nselem, v);
828 nsIDOMNSHTMLElement_Release(nselem);
829 }else {
830 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
833 return S_OK;
836 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)
838 HTMLElement *This = HTMLELEM2_THIS(iface);
839 FIXME("(%p)->(%p)\n", This, p);
840 return E_NOTIMPL;
843 static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
845 HTMLElement *This = HTMLELEM2_THIS(iface);
846 FIXME("(%p)\n", This);
847 return E_NOTIMPL;
850 static HRESULT WINAPI HTMLElement2_mergeAttributes(IHTMLElement2 *iface, IHTMLElement *mergeThis)
852 HTMLElement *This = HTMLELEM2_THIS(iface);
853 FIXME("(%p)->(%p)\n", This, mergeThis);
854 return E_NOTIMPL;
857 static HRESULT WINAPI HTMLElement2_put_oncontextmenu(IHTMLElement2 *iface, VARIANT v)
859 HTMLElement *This = HTMLELEM2_THIS(iface);
860 FIXME("(%p)->()\n", This);
861 return E_NOTIMPL;
864 static HRESULT WINAPI HTMLElement2_get_oncontextmenu(IHTMLElement2 *iface, VARIANT *p)
866 HTMLElement *This = HTMLELEM2_THIS(iface);
867 FIXME("(%p)->(%p)\n", This, p);
868 return E_NOTIMPL;
871 static HRESULT WINAPI HTMLElement2_insertAdjecentElement(IHTMLElement2 *iface, BSTR where,
872 IHTMLElement *insertedElement, IHTMLElement **inserted)
874 HTMLElement *This = HTMLELEM2_THIS(iface);
875 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(where), insertedElement, inserted);
876 return E_NOTIMPL;
879 static HRESULT WINAPI HTMLElement2_applyElement(IHTMLElement2 *iface, IHTMLElement *apply,
880 BSTR where, IHTMLElement **applied)
882 HTMLElement *This = HTMLELEM2_THIS(iface);
883 FIXME("(%p)->(%p %s %p)\n", This, apply, debugstr_w(where), applied);
884 return E_NOTIMPL;
887 static HRESULT WINAPI HTMLElement2_getAdjecentText(IHTMLElement2 *iface, BSTR where, BSTR *text)
889 HTMLElement *This = HTMLELEM2_THIS(iface);
890 FIXME("(%p)->(%s %p)\n", This, debugstr_w(where), text);
891 return E_NOTIMPL;
894 static HRESULT WINAPI HTMLElement2_replaceAdjecentText(IHTMLElement2 *iface, BSTR where,
895 BSTR newText, BSTR *oldText)
897 HTMLElement *This = HTMLELEM2_THIS(iface);
898 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(where), debugstr_w(newText), oldText);
899 return E_NOTIMPL;
902 static HRESULT WINAPI HTMLElement2_get_canHandleChildren(IHTMLElement2 *iface, VARIANT_BOOL *p)
904 HTMLElement *This = HTMLELEM2_THIS(iface);
905 FIXME("(%p)->(%p)\n", This, p);
906 return E_NOTIMPL;
909 static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
910 VARIANT *pvarFactory, long *pCookie)
912 HTMLElement *This = HTMLELEM2_THIS(iface);
913 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
914 return E_NOTIMPL;
917 static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, long cookie,
918 VARIANT_BOOL *pfResult)
920 HTMLElement *This = HTMLELEM2_THIS(iface);
921 FIXME("(%p)->(%ld %p)\n", This, cookie, pfResult);
922 return E_NOTIMPL;
925 static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
927 HTMLElement *This = HTMLELEM2_THIS(iface);
928 FIXME("(%p)->(%p)\n", This, p);
929 return E_NOTIMPL;
932 static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)
934 HTMLElement *This = HTMLELEM2_THIS(iface);
935 FIXME("(%p)->(%p)\n", This, p);
936 return E_NOTIMPL;
939 static HRESULT WINAPI HTMLElement2_put_tagUrn(IHTMLElement2 *iface, BSTR v)
941 HTMLElement *This = HTMLELEM2_THIS(iface);
942 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
943 return E_NOTIMPL;
946 static HRESULT WINAPI HTMLElement2_get_tagUrn(IHTMLElement2 *iface, BSTR *p)
948 HTMLElement *This = HTMLELEM2_THIS(iface);
949 FIXME("(%p)->(%p)\n", This, p);
950 return E_NOTIMPL;
953 static HRESULT WINAPI HTMLElement2_put_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT vv)
955 HTMLElement *This = HTMLELEM2_THIS(iface);
956 FIXME("(%p)->()\n", This);
957 return E_NOTIMPL;
960 static HRESULT WINAPI HTMLElement2_get_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT *p)
962 HTMLElement *This = HTMLELEM2_THIS(iface);
963 FIXME("(%p)->(%p)\n", This, p);
964 return E_NOTIMPL;
967 static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, long *p)
969 HTMLElement *This = HTMLELEM2_THIS(iface);
970 FIXME("(%p)->(%p)\n", This, p);
971 return E_NOTIMPL;
974 static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BSTR v,
975 IHTMLElementCollection **pelColl)
977 HTMLElement *This = HTMLELEM2_THIS(iface);
978 nsIDOMNodeList *nslist;
979 nsAString tag_str;
980 nsresult nsres;
982 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
984 nsAString_Init(&tag_str, v);
985 nsres = nsIDOMHTMLElement_GetElementsByTagName(This->nselem, &tag_str, &nslist);
986 nsAString_Finish(&tag_str);
987 if(NS_FAILED(nsres)) {
988 ERR("GetElementByTagName failed: %08x\n", nsres);
989 return E_FAIL;
992 *pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
993 nsIDOMNodeList_Release(nslist);
994 return S_OK;
997 #undef HTMLELEM2_THIS
999 static const IHTMLElement2Vtbl HTMLElement2Vtbl = {
1000 HTMLElement2_QueryInterface,
1001 HTMLElement2_AddRef,
1002 HTMLElement2_Release,
1003 HTMLElement2_GetTypeInfoCount,
1004 HTMLElement2_GetTypeInfo,
1005 HTMLElement2_GetIDsOfNames,
1006 HTMLElement2_Invoke,
1007 HTMLElement2_get_scopeName,
1008 HTMLElement2_setCapture,
1009 HTMLElement2_releaseCapture,
1010 HTMLElement2_put_onlosecapture,
1011 HTMLElement2_get_onlosecapture,
1012 HTMLElement2_componentFromPoint,
1013 HTMLElement2_doScroll,
1014 HTMLElement2_put_onscroll,
1015 HTMLElement2_get_onscroll,
1016 HTMLElement2_put_ondrag,
1017 HTMLElement2_get_ondrag,
1018 HTMLElement2_put_ondragend,
1019 HTMLElement2_get_ondragend,
1020 HTMLElement2_put_ondragenter,
1021 HTMLElement2_get_ondragenter,
1022 HTMLElement2_put_ondragover,
1023 HTMLElement2_get_ondragover,
1024 HTMLElement2_put_ondragleave,
1025 HTMLElement2_get_ondragleave,
1026 HTMLElement2_put_ondrop,
1027 HTMLElement2_get_ondrop,
1028 HTMLElement2_put_onbeforecut,
1029 HTMLElement2_get_onbeforecut,
1030 HTMLElement2_put_oncut,
1031 HTMLElement2_get_oncut,
1032 HTMLElement2_put_onbeforecopy,
1033 HTMLElement2_get_onbeforecopy,
1034 HTMLElement2_put_oncopy,
1035 HTMLElement2_get_oncopy,
1036 HTMLElement2_put_onbeforepaste,
1037 HTMLElement2_get_onbeforepaste,
1038 HTMLElement2_put_onpaste,
1039 HTMLElement2_get_onpaste,
1040 HTMLElement2_get_currentStyle,
1041 HTMLElement2_put_onpropertychange,
1042 HTMLElement2_get_onpropertychange,
1043 HTMLElement2_getClientRects,
1044 HTMLElement2_getBoundingClientRect,
1045 HTMLElement2_setExpression,
1046 HTMLElement2_getExpression,
1047 HTMLElement2_removeExpression,
1048 HTMLElement2_put_tabIndex,
1049 HTMLElement2_get_tabIndex,
1050 HTMLElement2_focus,
1051 HTMLElement2_put_accessKey,
1052 HTMLElement2_get_accessKey,
1053 HTMLElement2_put_onblur,
1054 HTMLElement2_get_onblur,
1055 HTMLElement2_put_onfocus,
1056 HTMLElement2_get_onfocus,
1057 HTMLElement2_put_onresize,
1058 HTMLElement2_get_onresize,
1059 HTMLElement2_blur,
1060 HTMLElement2_addFilter,
1061 HTMLElement2_removeFilter,
1062 HTMLElement2_get_clientHeight,
1063 HTMLElement2_get_clientWidth,
1064 HTMLElement2_get_clientTop,
1065 HTMLElement2_get_clientLeft,
1066 HTMLElement2_attachEvent,
1067 HTMLElement2_detachEvent,
1068 HTMLElement2_get_readyState,
1069 HTMLElement2_put_onreadystatechange,
1070 HTMLElement2_get_onreadystatechange,
1071 HTMLElement2_put_onrowsdelete,
1072 HTMLElement2_get_onrowsdelete,
1073 HTMLElement2_put_onrowsinserted,
1074 HTMLElement2_get_onrowsinserted,
1075 HTMLElement2_put_oncellchange,
1076 HTMLElement2_get_oncellchange,
1077 HTMLElement2_put_dir,
1078 HTMLElement2_get_dir,
1079 HTMLElement2_createControlRange,
1080 HTMLElement2_get_scrollHeight,
1081 HTMLElement2_get_scrollWidth,
1082 HTMLElement2_put_scrollTop,
1083 HTMLElement2_get_scrollTop,
1084 HTMLElement2_put_scrollLeft,
1085 HTMLElement2_get_scrollLeft,
1086 HTMLElement2_clearAttributes,
1087 HTMLElement2_mergeAttributes,
1088 HTMLElement2_put_oncontextmenu,
1089 HTMLElement2_get_oncontextmenu,
1090 HTMLElement2_insertAdjecentElement,
1091 HTMLElement2_applyElement,
1092 HTMLElement2_getAdjecentText,
1093 HTMLElement2_replaceAdjecentText,
1094 HTMLElement2_get_canHandleChildren,
1095 HTMLElement2_addBehavior,
1096 HTMLElement2_removeBehavior,
1097 HTMLElement2_get_runtimeStyle,
1098 HTMLElement2_get_behaviorUrns,
1099 HTMLElement2_put_tagUrn,
1100 HTMLElement2_get_tagUrn,
1101 HTMLElement2_put_onbeforeeditfocus,
1102 HTMLElement2_get_onbeforeeditfocus,
1103 HTMLElement2_get_readyStateValue,
1104 HTMLElement2_getElementsByTagName,
1107 void HTMLElement2_Init(HTMLElement *This)
1109 This->lpHTMLElement2Vtbl = &HTMLElement2Vtbl;