push 36f87734b677b59a60e8d0f7daaece38a167639b
[wine/hacks.git] / dlls / mshtml / htmlelem2.c
blob36676c675eb4afb2cc6113137c4c4043d045689a
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 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
62 static HRESULT WINAPI HTMLElement2_GetTypeInfo(IHTMLElement2 *iface, UINT iTInfo,
63 LCID lcid, ITypeInfo **ppTInfo)
65 HTMLElement *This = HTMLELEM2_THIS(iface);
66 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
69 static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
70 LPOLESTR *rgszNames, UINT cNames,
71 LCID lcid, DISPID *rgDispId)
73 HTMLElement *This = HTMLELEM2_THIS(iface);
74 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
77 static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
78 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
79 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
81 HTMLElement *This = HTMLELEM2_THIS(iface);
82 return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid,
83 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
86 static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
88 HTMLElement *This = HTMLELEM2_THIS(iface);
89 FIXME("(%p)->(%p)\n", This, p);
90 return E_NOTIMPL;
93 static HRESULT WINAPI HTMLElement2_setCapture(IHTMLElement2 *iface, VARIANT_BOOL containerCapture)
95 HTMLElement *This = HTMLELEM2_THIS(iface);
96 FIXME("(%p)->(%x)\n", This, containerCapture);
97 return E_NOTIMPL;
100 static HRESULT WINAPI HTMLElement2_releaseCapture(IHTMLElement2 *iface)
102 HTMLElement *This = HTMLELEM2_THIS(iface);
103 FIXME("(%p)\n", This);
104 return E_NOTIMPL;
107 static HRESULT WINAPI HTMLElement2_put_onlosecapture(IHTMLElement2 *iface, VARIANT v)
109 HTMLElement *This = HTMLELEM2_THIS(iface);
110 FIXME("(%p)->()\n", This);
111 return E_NOTIMPL;
114 static HRESULT WINAPI HTMLElement2_get_onlosecapture(IHTMLElement2 *iface, VARIANT *p)
116 HTMLElement *This = HTMLELEM2_THIS(iface);
117 FIXME("(%p)->(%p)\n", This, p);
118 return E_NOTIMPL;
121 static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
122 long x, long y, BSTR *component)
124 HTMLElement *This = HTMLELEM2_THIS(iface);
125 FIXME("(%p)->(%ld %ld %p)\n", This, x, y, component);
126 return E_NOTIMPL;
129 static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
131 HTMLElement *This = HTMLELEM2_THIS(iface);
132 FIXME("(%p)->()\n", This);
133 return E_NOTIMPL;
136 static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
138 HTMLElement *This = HTMLELEM2_THIS(iface);
139 FIXME("(%p)->()\n", This);
140 return E_NOTIMPL;
143 static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p)
145 HTMLElement *This = HTMLELEM2_THIS(iface);
146 FIXME("(%p)->(%p)\n", This, p);
147 return E_NOTIMPL;
150 static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
152 HTMLElement *This = HTMLELEM2_THIS(iface);
153 FIXME("(%p)->()\n", This);
154 return E_NOTIMPL;
157 static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
159 HTMLElement *This = HTMLELEM2_THIS(iface);
160 FIXME("(%p)->(%p)\n", This, p);
161 return E_NOTIMPL;
164 static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
166 HTMLElement *This = HTMLELEM2_THIS(iface);
167 FIXME("(%p)->()\n", This);
168 return E_NOTIMPL;
171 static HRESULT WINAPI HTMLElement2_get_ondragend(IHTMLElement2 *iface, VARIANT *p)
173 HTMLElement *This = HTMLELEM2_THIS(iface);
174 FIXME("(%p)->(%p)\n", This, p);
175 return E_NOTIMPL;
178 static HRESULT WINAPI HTMLElement2_put_ondragenter(IHTMLElement2 *iface, VARIANT v)
180 HTMLElement *This = HTMLELEM2_THIS(iface);
181 FIXME("(%p)->()\n", This);
182 return E_NOTIMPL;
185 static HRESULT WINAPI HTMLElement2_get_ondragenter(IHTMLElement2 *iface, VARIANT *p)
187 HTMLElement *This = HTMLELEM2_THIS(iface);
188 FIXME("(%p)->(%p)\n", This, p);
189 return E_NOTIMPL;
192 static HRESULT WINAPI HTMLElement2_put_ondragover(IHTMLElement2 *iface, VARIANT v)
194 HTMLElement *This = HTMLELEM2_THIS(iface);
195 FIXME("(%p)->()\n", This);
196 return E_NOTIMPL;
199 static HRESULT WINAPI HTMLElement2_get_ondragover(IHTMLElement2 *iface, VARIANT *p)
201 HTMLElement *This = HTMLELEM2_THIS(iface);
202 FIXME("(%p)->(%p)\n", This, p);
203 return E_NOTIMPL;
206 static HRESULT WINAPI HTMLElement2_put_ondragleave(IHTMLElement2 *iface, VARIANT v)
208 HTMLElement *This = HTMLELEM2_THIS(iface);
209 FIXME("(%p)->()\n", This);
210 return E_NOTIMPL;
213 static HRESULT WINAPI HTMLElement2_get_ondragleave(IHTMLElement2 *iface, VARIANT *p)
215 HTMLElement *This = HTMLELEM2_THIS(iface);
216 FIXME("(%p)->(%p)\n", This, p);
217 return E_NOTIMPL;
220 static HRESULT WINAPI HTMLElement2_put_ondrop(IHTMLElement2 *iface, VARIANT v)
222 HTMLElement *This = HTMLELEM2_THIS(iface);
223 FIXME("(%p)->()\n", This);
224 return E_NOTIMPL;
227 static HRESULT WINAPI HTMLElement2_get_ondrop(IHTMLElement2 *iface, VARIANT *p)
229 HTMLElement *This = HTMLELEM2_THIS(iface);
230 FIXME("(%p)->(%p)\n", This, p);
231 return E_NOTIMPL;
234 static HRESULT WINAPI HTMLElement2_put_onbeforecut(IHTMLElement2 *iface, VARIANT v)
236 HTMLElement *This = HTMLELEM2_THIS(iface);
237 FIXME("(%p)->()\n", This);
238 return E_NOTIMPL;
241 static HRESULT WINAPI HTMLElement2_get_onbeforecut(IHTMLElement2 *iface, VARIANT *p)
243 HTMLElement *This = HTMLELEM2_THIS(iface);
244 FIXME("(%p)->(%p)\n", This, p);
245 return E_NOTIMPL;
248 static HRESULT WINAPI HTMLElement2_put_oncut(IHTMLElement2 *iface, VARIANT v)
250 HTMLElement *This = HTMLELEM2_THIS(iface);
251 FIXME("(%p)->()\n", This);
252 return E_NOTIMPL;
255 static HRESULT WINAPI HTMLElement2_get_oncut(IHTMLElement2 *iface, VARIANT *p)
257 HTMLElement *This = HTMLELEM2_THIS(iface);
258 FIXME("(%p)->(%p)\n", This, p);
259 return E_NOTIMPL;
262 static HRESULT WINAPI HTMLElement2_put_onbeforecopy(IHTMLElement2 *iface, VARIANT v)
264 HTMLElement *This = HTMLELEM2_THIS(iface);
265 FIXME("(%p)->()\n", This);
266 return E_NOTIMPL;
269 static HRESULT WINAPI HTMLElement2_get_onbeforecopy(IHTMLElement2 *iface, VARIANT *p)
271 HTMLElement *This = HTMLELEM2_THIS(iface);
272 FIXME("(%p)->(%p)\n", This, p);
273 return E_NOTIMPL;
276 static HRESULT WINAPI HTMLElement2_put_oncopy(IHTMLElement2 *iface, VARIANT v)
278 HTMLElement *This = HTMLELEM2_THIS(iface);
279 FIXME("(%p)->()\n", This);
280 return E_NOTIMPL;
283 static HRESULT WINAPI HTMLElement2_get_oncopy(IHTMLElement2 *iface, VARIANT *p)
285 HTMLElement *This = HTMLELEM2_THIS(iface);
286 FIXME("(%p)->(%p)\n", This, p);
287 return E_NOTIMPL;
290 static HRESULT WINAPI HTMLElement2_put_onbeforepaste(IHTMLElement2 *iface, VARIANT v)
292 HTMLElement *This = HTMLELEM2_THIS(iface);
293 FIXME("(%p)->()\n", This);
294 return E_NOTIMPL;
297 static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIANT *p)
299 HTMLElement *This = HTMLELEM2_THIS(iface);
300 FIXME("(%p)->(%p)\n", This, p);
301 return E_NOTIMPL;
304 static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
306 HTMLElement *This = HTMLELEM2_THIS(iface);
307 FIXME("(%p)->()\n", This);
308 return E_NOTIMPL;
311 static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
313 HTMLElement *This = HTMLELEM2_THIS(iface);
314 FIXME("(%p)->(%p)\n", This, p);
315 return E_NOTIMPL;
318 static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
320 HTMLElement *This = HTMLELEM2_THIS(iface);
322 TRACE("(%p)->(%p)\n", This, p);
324 return HTMLCurrentStyle_Create(p);
327 static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
329 HTMLElement *This = HTMLELEM2_THIS(iface);
330 FIXME("(%p)->()\n", This);
331 return E_NOTIMPL;
334 static HRESULT WINAPI HTMLElement2_get_onpropertychange(IHTMLElement2 *iface, VARIANT *p)
336 HTMLElement *This = HTMLELEM2_THIS(iface);
337 FIXME("(%p)->(%p)\n", This, p);
338 return E_NOTIMPL;
341 static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRectCollection **pRectCol)
343 HTMLElement *This = HTMLELEM2_THIS(iface);
344 FIXME("(%p)->(%p)\n", This, pRectCol);
345 return E_NOTIMPL;
348 static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect)
350 HTMLElement *This = HTMLELEM2_THIS(iface);
351 FIXME("(%p)->(%p)\n", This, pRect);
352 return E_NOTIMPL;
355 static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname,
356 BSTR expression, BSTR language)
358 HTMLElement *This = HTMLELEM2_THIS(iface);
359 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression),
360 debugstr_w(language));
361 return E_NOTIMPL;
364 static HRESULT WINAPI HTMLElement2_getExpression(IHTMLElement2 *iface, BSTR propname,
365 VARIANT *expression)
367 HTMLElement *This = HTMLELEM2_THIS(iface);
368 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
369 return E_NOTIMPL;
372 static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR propname,
373 VARIANT_BOOL *pfSuccess)
375 HTMLElement *This = HTMLELEM2_THIS(iface);
376 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
377 return E_NOTIMPL;
380 static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
382 HTMLElement *This = HTMLELEM2_THIS(iface);
383 nsIDOMNSHTMLElement *nselem;
384 nsresult nsres;
386 TRACE("(%p)->(%d)\n", This, v);
388 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
389 if(NS_FAILED(nsres)) {
390 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
391 return S_OK;
394 nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
395 nsIDOMNSHTMLElement_Release(nselem);
396 if(NS_FAILED(nsres))
397 ERR("GetTabIndex failed: %08x\n", nsres);
399 return S_OK;
402 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
404 HTMLElement *This = HTMLELEM2_THIS(iface);
405 nsIDOMNSHTMLElement *nselem;
406 PRInt32 index = 0;
407 nsresult nsres;
409 TRACE("(%p)->(%p)\n", This, p);
411 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
412 if(NS_FAILED(nsres)) {
413 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
414 return E_FAIL;
417 nsres = nsIDOMNSHTMLElement_GetTabIndex(nselem, &index);
418 nsIDOMNSHTMLElement_Release(nselem);
419 if(NS_FAILED(nsres)) {
420 ERR("GetTabIndex failed: %08x\n", nsres);
421 return E_FAIL;
424 *p = index;
425 return S_OK;
428 static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
430 HTMLElement *This = HTMLELEM2_THIS(iface);
431 nsIDOMNSHTMLElement *nselem;
432 nsresult nsres;
434 TRACE("(%p)\n", This);
436 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
437 if(NS_SUCCEEDED(nsres)) {
438 nsIDOMNSHTMLElement_focus(nselem);
439 nsIDOMNSHTMLElement_Release(nselem);
440 }else {
441 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
444 return S_OK;
447 static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
449 HTMLElement *This = HTMLELEM2_THIS(iface);
450 VARIANT var;
452 static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
454 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
456 V_VT(&var) = VT_BSTR;
457 V_BSTR(&var) = v;
458 return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
461 static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
463 HTMLElement *This = HTMLELEM2_THIS(iface);
464 FIXME("(%p)->(%p)\n", This, p);
465 return E_NOTIMPL;
468 static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
470 HTMLElement *This = HTMLELEM2_THIS(iface);
471 FIXME("(%p)->()\n", This);
472 return E_NOTIMPL;
475 static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
477 HTMLElement *This = HTMLELEM2_THIS(iface);
478 FIXME("(%p)->(%p)\n", This, p);
479 return E_NOTIMPL;
482 static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
484 HTMLElement *This = HTMLELEM2_THIS(iface);
485 FIXME("(%p)->()\n", This);
486 return E_NOTIMPL;
489 static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
491 HTMLElement *This = HTMLELEM2_THIS(iface);
492 FIXME("(%p)->(%p)\n", This, p);
493 return E_NOTIMPL;
496 static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
498 HTMLElement *This = HTMLELEM2_THIS(iface);
499 FIXME("(%p)->()\n", This);
500 return E_NOTIMPL;
503 static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p)
505 HTMLElement *This = HTMLELEM2_THIS(iface);
506 FIXME("(%p)->(%p)\n", This, p);
507 return E_NOTIMPL;
510 static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
512 HTMLElement *This = HTMLELEM2_THIS(iface);
513 FIXME("(%p)\n", This);
514 return E_NOTIMPL;
517 static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
519 HTMLElement *This = HTMLELEM2_THIS(iface);
520 FIXME("(%p)->(%p)\n", This, pUnk);
521 return E_NOTIMPL;
524 static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *pUnk)
526 HTMLElement *This = HTMLELEM2_THIS(iface);
527 FIXME("(%p)->(%p)\n", This, pUnk);
528 return E_NOTIMPL;
531 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *p)
533 HTMLElement *This = HTMLELEM2_THIS(iface);
534 nsIDOMNSHTMLElement *nselem;
535 PRInt32 height=0;
536 nsresult nsres;
538 TRACE("(%p)->(%p)\n", This, p);
540 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
541 if(NS_SUCCEEDED(nsres)) {
542 nsIDOMNSHTMLElement_GetClientHeight(nselem, &height);
543 nsIDOMNSHTMLElement_Release(nselem);
544 }else {
545 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
548 *p = height;
549 return S_OK;
552 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, long *p)
554 HTMLElement *This = HTMLELEM2_THIS(iface);
555 nsIDOMNSHTMLElement *nselem;
556 PRInt32 width=0;
557 nsresult nsres;
559 TRACE("(%p)->(%p)\n", This, p);
561 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
562 if(NS_SUCCEEDED(nsres)) {
563 nsIDOMNSHTMLElement_GetClientWidth(nselem, &width);
564 nsIDOMNSHTMLElement_Release(nselem);
565 }else {
566 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
569 *p = width;
570 return S_OK;
573 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, long *p)
575 HTMLElement *This = HTMLELEM2_THIS(iface);
576 FIXME("(%p)->(%p)\n", This, p);
577 return E_NOTIMPL;
580 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, long *p)
582 HTMLElement *This = HTMLELEM2_THIS(iface);
583 FIXME("(%p)->(%p)\n", This, p);
584 return E_NOTIMPL;
587 static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
588 IDispatch *pDisp, VARIANT_BOOL *pfResult)
590 HTMLElement *This = HTMLELEM2_THIS(iface);
591 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
592 return E_NOTIMPL;
595 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
597 HTMLElement *This = HTMLELEM2_THIS(iface);
598 FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
599 return E_NOTIMPL;
602 static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
604 HTMLElement *This = HTMLELEM2_THIS(iface);
605 FIXME("(%p)->(%p)\n", This, p);
606 return E_NOTIMPL;
609 static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
611 HTMLElement *This = HTMLELEM2_THIS(iface);
612 FIXME("(%p)->()\n", This);
613 return E_NOTIMPL;
616 static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
618 HTMLElement *This = HTMLELEM2_THIS(iface);
619 FIXME("(%p)->(%p)\n", This, p);
620 return E_NOTIMPL;
623 static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
625 HTMLElement *This = HTMLELEM2_THIS(iface);
626 FIXME("(%p)->()\n", This);
627 return E_NOTIMPL;
630 static HRESULT WINAPI HTMLElement2_get_onrowsdelete(IHTMLElement2 *iface, VARIANT *p)
632 HTMLElement *This = HTMLELEM2_THIS(iface);
633 FIXME("(%p)->(%p)\n", This, p);
634 return E_NOTIMPL;
637 static HRESULT WINAPI HTMLElement2_put_onrowsinserted(IHTMLElement2 *iface, VARIANT v)
639 HTMLElement *This = HTMLELEM2_THIS(iface);
640 FIXME("(%p)->()\n", This);
641 return E_NOTIMPL;
644 static HRESULT WINAPI HTMLElement2_get_onrowsinserted(IHTMLElement2 *iface, VARIANT *p)
646 HTMLElement *This = HTMLELEM2_THIS(iface);
647 FIXME("(%p)->(%p)\n", This, p);
648 return E_NOTIMPL;
651 static HRESULT WINAPI HTMLElement2_put_oncellchange(IHTMLElement2 *iface, VARIANT v)
653 HTMLElement *This = HTMLELEM2_THIS(iface);
654 FIXME("(%p)->()\n", This);
655 return E_NOTIMPL;
658 static HRESULT WINAPI HTMLElement2_get_oncellchange(IHTMLElement2 *iface, VARIANT *p)
660 HTMLElement *This = HTMLELEM2_THIS(iface);
661 FIXME("(%p)->(%p)\n", This, p);
662 return E_NOTIMPL;
665 static HRESULT WINAPI HTMLElement2_put_dir(IHTMLElement2 *iface, BSTR v)
667 HTMLElement *This = HTMLELEM2_THIS(iface);
668 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
669 return E_NOTIMPL;
672 static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
674 HTMLElement *This = HTMLELEM2_THIS(iface);
676 TRACE("(%p)->(%p)\n", This, p);
678 *p = NULL;
680 if(This->nselem) {
681 nsAString dir_str;
682 nsresult nsres;
684 nsAString_Init(&dir_str, NULL);
686 nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
687 if(NS_SUCCEEDED(nsres)) {
688 const PRUnichar *dir;
689 nsAString_GetData(&dir_str, &dir);
690 if(*dir)
691 *p = SysAllocString(dir);
692 }else {
693 ERR("GetDir failed: %08x\n", nsres);
696 nsAString_Finish(&dir_str);
699 TRACE("ret %s\n", debugstr_w(*p));
700 return S_OK;
703 static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDispatch **range)
705 HTMLElement *This = HTMLELEM2_THIS(iface);
706 FIXME("(%p)->(%p)\n", This, range);
707 return E_NOTIMPL;
710 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *p)
712 HTMLElement *This = HTMLELEM2_THIS(iface);
713 nsIDOMNSHTMLElement *nselem;
714 PRInt32 height = 0;
715 nsresult nsres;
717 TRACE("(%p)->(%p)\n", This, p);
719 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
720 if(NS_SUCCEEDED(nsres)) {
721 nsres = nsIDOMNSHTMLElement_GetScrollHeight(nselem, &height);
722 nsIDOMNSHTMLElement_Release(nselem);
723 if(NS_FAILED(nsres))
724 ERR("GetScrollHeight failed: %08x\n", nsres);
725 }else {
726 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
729 *p = height;
730 TRACE("*p = %ld\n", *p);
732 return S_OK;
735 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p)
737 HTMLElement *This = HTMLELEM2_THIS(iface);
738 nsIDOMNSHTMLElement *nselem;
739 PRInt32 width = 0;
740 nsresult nsres;
742 TRACE("(%p)->(%p)\n", This, p);
744 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
745 if(NS_SUCCEEDED(nsres)) {
746 nsres = nsIDOMNSHTMLElement_GetScrollWidth(nselem, &width);
747 nsIDOMNSHTMLElement_Release(nselem);
748 if(NS_FAILED(nsres))
749 ERR("GetScrollWidth failed: %08x\n", nsres);
750 }else {
751 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
754 *p = width;
755 TRACE("*p = %ld\n", *p);
757 return S_OK;
760 static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
762 HTMLElement *This = HTMLELEM2_THIS(iface);
763 nsIDOMNSHTMLElement *nselem;
764 nsresult nsres;
766 TRACE("(%p)->(%ld)\n", This, v);
768 if(!This->nselem) {
769 FIXME("NULL nselem\n");
770 return E_NOTIMPL;
773 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
774 if(NS_SUCCEEDED(nsres)) {
775 nsIDOMNSHTMLElement_SetScrollTop(nselem, v);
776 nsIDOMNSHTMLElement_Release(nselem);
777 }else {
778 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
781 return S_OK;
784 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
786 HTMLElement *This = HTMLELEM2_THIS(iface);
787 nsIDOMNSHTMLElement *nselem;
788 PRInt32 top = 0;
789 nsresult nsres;
791 TRACE("(%p)->(%p)\n", This, p);
793 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
794 if(NS_SUCCEEDED(nsres)) {
795 nsres = nsIDOMNSHTMLElement_GetScrollTop(nselem, &top);
796 nsIDOMNSHTMLElement_Release(nselem);
797 if(NS_FAILED(nsres))
798 ERR("GetScrollTop failed: %08x\n", nsres);
799 }else {
800 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
803 *p = top;
804 TRACE("*p = %ld\n", *p);
806 return S_OK;
809 static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
811 HTMLElement *This = HTMLELEM2_THIS(iface);
812 nsIDOMNSHTMLElement *nselem;
813 nsresult nsres;
815 TRACE("(%p)->(%ld)\n", This, v);
817 if(!This->nselem) {
818 FIXME("NULL nselem\n");
819 return E_NOTIMPL;
822 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
823 if(NS_SUCCEEDED(nsres)) {
824 nsIDOMNSHTMLElement_SetScrollLeft(nselem, v);
825 nsIDOMNSHTMLElement_Release(nselem);
826 }else {
827 ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
830 return S_OK;
833 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)
835 HTMLElement *This = HTMLELEM2_THIS(iface);
836 nsIDOMNSHTMLElement *nselem;
837 PRInt32 left = 0;
838 nsresult nsres;
840 TRACE("(%p)->(%p)\n", This, p);
842 if(!p)
843 return E_INVALIDARG;
845 if(!This->nselem)
847 FIXME("NULL nselem\n");
848 return E_NOTIMPL;
851 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
852 if(NS_SUCCEEDED(nsres))
854 nsres = nsIDOMNSHTMLElement_GetScrollLeft(nselem, &left);
855 nsIDOMNSHTMLElement_Release(nselem);
856 if(NS_FAILED(nsres))
857 left = 0;
860 *p = left;
861 TRACE("*p = %ld\n", *p);
863 return S_OK;
866 static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
868 HTMLElement *This = HTMLELEM2_THIS(iface);
869 FIXME("(%p)\n", This);
870 return E_NOTIMPL;
873 static HRESULT WINAPI HTMLElement2_mergeAttributes(IHTMLElement2 *iface, IHTMLElement *mergeThis)
875 HTMLElement *This = HTMLELEM2_THIS(iface);
876 FIXME("(%p)->(%p)\n", This, mergeThis);
877 return E_NOTIMPL;
880 static HRESULT WINAPI HTMLElement2_put_oncontextmenu(IHTMLElement2 *iface, VARIANT v)
882 HTMLElement *This = HTMLELEM2_THIS(iface);
883 FIXME("(%p)->()\n", This);
884 return E_NOTIMPL;
887 static HRESULT WINAPI HTMLElement2_get_oncontextmenu(IHTMLElement2 *iface, VARIANT *p)
889 HTMLElement *This = HTMLELEM2_THIS(iface);
890 FIXME("(%p)->(%p)\n", This, p);
891 return E_NOTIMPL;
894 static HRESULT WINAPI HTMLElement2_insertAdjecentElement(IHTMLElement2 *iface, BSTR where,
895 IHTMLElement *insertedElement, IHTMLElement **inserted)
897 HTMLElement *This = HTMLELEM2_THIS(iface);
898 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(where), insertedElement, inserted);
899 return E_NOTIMPL;
902 static HRESULT WINAPI HTMLElement2_applyElement(IHTMLElement2 *iface, IHTMLElement *apply,
903 BSTR where, IHTMLElement **applied)
905 HTMLElement *This = HTMLELEM2_THIS(iface);
906 FIXME("(%p)->(%p %s %p)\n", This, apply, debugstr_w(where), applied);
907 return E_NOTIMPL;
910 static HRESULT WINAPI HTMLElement2_getAdjecentText(IHTMLElement2 *iface, BSTR where, BSTR *text)
912 HTMLElement *This = HTMLELEM2_THIS(iface);
913 FIXME("(%p)->(%s %p)\n", This, debugstr_w(where), text);
914 return E_NOTIMPL;
917 static HRESULT WINAPI HTMLElement2_replaceAdjecentText(IHTMLElement2 *iface, BSTR where,
918 BSTR newText, BSTR *oldText)
920 HTMLElement *This = HTMLELEM2_THIS(iface);
921 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(where), debugstr_w(newText), oldText);
922 return E_NOTIMPL;
925 static HRESULT WINAPI HTMLElement2_get_canHandleChildren(IHTMLElement2 *iface, VARIANT_BOOL *p)
927 HTMLElement *This = HTMLELEM2_THIS(iface);
928 FIXME("(%p)->(%p)\n", This, p);
929 return E_NOTIMPL;
932 static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
933 VARIANT *pvarFactory, long *pCookie)
935 HTMLElement *This = HTMLELEM2_THIS(iface);
936 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
937 return E_NOTIMPL;
940 static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, long cookie,
941 VARIANT_BOOL *pfResult)
943 HTMLElement *This = HTMLELEM2_THIS(iface);
944 FIXME("(%p)->(%ld %p)\n", This, cookie, pfResult);
945 return E_NOTIMPL;
948 static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
950 HTMLElement *This = HTMLELEM2_THIS(iface);
951 FIXME("(%p)->(%p)\n", This, p);
952 return E_NOTIMPL;
955 static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)
957 HTMLElement *This = HTMLELEM2_THIS(iface);
958 FIXME("(%p)->(%p)\n", This, p);
959 return E_NOTIMPL;
962 static HRESULT WINAPI HTMLElement2_put_tagUrn(IHTMLElement2 *iface, BSTR v)
964 HTMLElement *This = HTMLELEM2_THIS(iface);
965 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
966 return E_NOTIMPL;
969 static HRESULT WINAPI HTMLElement2_get_tagUrn(IHTMLElement2 *iface, BSTR *p)
971 HTMLElement *This = HTMLELEM2_THIS(iface);
972 FIXME("(%p)->(%p)\n", This, p);
973 return E_NOTIMPL;
976 static HRESULT WINAPI HTMLElement2_put_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT vv)
978 HTMLElement *This = HTMLELEM2_THIS(iface);
979 FIXME("(%p)->()\n", This);
980 return E_NOTIMPL;
983 static HRESULT WINAPI HTMLElement2_get_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT *p)
985 HTMLElement *This = HTMLELEM2_THIS(iface);
986 FIXME("(%p)->(%p)\n", This, p);
987 return E_NOTIMPL;
990 static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, long *p)
992 HTMLElement *This = HTMLELEM2_THIS(iface);
993 FIXME("(%p)->(%p)\n", This, p);
994 return E_NOTIMPL;
997 static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BSTR v,
998 IHTMLElementCollection **pelColl)
1000 HTMLElement *This = HTMLELEM2_THIS(iface);
1001 nsIDOMNodeList *nslist;
1002 nsAString tag_str;
1003 nsresult nsres;
1005 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
1007 nsAString_Init(&tag_str, v);
1008 nsres = nsIDOMHTMLElement_GetElementsByTagName(This->nselem, &tag_str, &nslist);
1009 nsAString_Finish(&tag_str);
1010 if(NS_FAILED(nsres)) {
1011 ERR("GetElementByTagName failed: %08x\n", nsres);
1012 return E_FAIL;
1015 *pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
1016 nsIDOMNodeList_Release(nslist);
1017 return S_OK;
1020 #undef HTMLELEM2_THIS
1022 static const IHTMLElement2Vtbl HTMLElement2Vtbl = {
1023 HTMLElement2_QueryInterface,
1024 HTMLElement2_AddRef,
1025 HTMLElement2_Release,
1026 HTMLElement2_GetTypeInfoCount,
1027 HTMLElement2_GetTypeInfo,
1028 HTMLElement2_GetIDsOfNames,
1029 HTMLElement2_Invoke,
1030 HTMLElement2_get_scopeName,
1031 HTMLElement2_setCapture,
1032 HTMLElement2_releaseCapture,
1033 HTMLElement2_put_onlosecapture,
1034 HTMLElement2_get_onlosecapture,
1035 HTMLElement2_componentFromPoint,
1036 HTMLElement2_doScroll,
1037 HTMLElement2_put_onscroll,
1038 HTMLElement2_get_onscroll,
1039 HTMLElement2_put_ondrag,
1040 HTMLElement2_get_ondrag,
1041 HTMLElement2_put_ondragend,
1042 HTMLElement2_get_ondragend,
1043 HTMLElement2_put_ondragenter,
1044 HTMLElement2_get_ondragenter,
1045 HTMLElement2_put_ondragover,
1046 HTMLElement2_get_ondragover,
1047 HTMLElement2_put_ondragleave,
1048 HTMLElement2_get_ondragleave,
1049 HTMLElement2_put_ondrop,
1050 HTMLElement2_get_ondrop,
1051 HTMLElement2_put_onbeforecut,
1052 HTMLElement2_get_onbeforecut,
1053 HTMLElement2_put_oncut,
1054 HTMLElement2_get_oncut,
1055 HTMLElement2_put_onbeforecopy,
1056 HTMLElement2_get_onbeforecopy,
1057 HTMLElement2_put_oncopy,
1058 HTMLElement2_get_oncopy,
1059 HTMLElement2_put_onbeforepaste,
1060 HTMLElement2_get_onbeforepaste,
1061 HTMLElement2_put_onpaste,
1062 HTMLElement2_get_onpaste,
1063 HTMLElement2_get_currentStyle,
1064 HTMLElement2_put_onpropertychange,
1065 HTMLElement2_get_onpropertychange,
1066 HTMLElement2_getClientRects,
1067 HTMLElement2_getBoundingClientRect,
1068 HTMLElement2_setExpression,
1069 HTMLElement2_getExpression,
1070 HTMLElement2_removeExpression,
1071 HTMLElement2_put_tabIndex,
1072 HTMLElement2_get_tabIndex,
1073 HTMLElement2_focus,
1074 HTMLElement2_put_accessKey,
1075 HTMLElement2_get_accessKey,
1076 HTMLElement2_put_onblur,
1077 HTMLElement2_get_onblur,
1078 HTMLElement2_put_onfocus,
1079 HTMLElement2_get_onfocus,
1080 HTMLElement2_put_onresize,
1081 HTMLElement2_get_onresize,
1082 HTMLElement2_blur,
1083 HTMLElement2_addFilter,
1084 HTMLElement2_removeFilter,
1085 HTMLElement2_get_clientHeight,
1086 HTMLElement2_get_clientWidth,
1087 HTMLElement2_get_clientTop,
1088 HTMLElement2_get_clientLeft,
1089 HTMLElement2_attachEvent,
1090 HTMLElement2_detachEvent,
1091 HTMLElement2_get_readyState,
1092 HTMLElement2_put_onreadystatechange,
1093 HTMLElement2_get_onreadystatechange,
1094 HTMLElement2_put_onrowsdelete,
1095 HTMLElement2_get_onrowsdelete,
1096 HTMLElement2_put_onrowsinserted,
1097 HTMLElement2_get_onrowsinserted,
1098 HTMLElement2_put_oncellchange,
1099 HTMLElement2_get_oncellchange,
1100 HTMLElement2_put_dir,
1101 HTMLElement2_get_dir,
1102 HTMLElement2_createControlRange,
1103 HTMLElement2_get_scrollHeight,
1104 HTMLElement2_get_scrollWidth,
1105 HTMLElement2_put_scrollTop,
1106 HTMLElement2_get_scrollTop,
1107 HTMLElement2_put_scrollLeft,
1108 HTMLElement2_get_scrollLeft,
1109 HTMLElement2_clearAttributes,
1110 HTMLElement2_mergeAttributes,
1111 HTMLElement2_put_oncontextmenu,
1112 HTMLElement2_get_oncontextmenu,
1113 HTMLElement2_insertAdjecentElement,
1114 HTMLElement2_applyElement,
1115 HTMLElement2_getAdjecentText,
1116 HTMLElement2_replaceAdjecentText,
1117 HTMLElement2_get_canHandleChildren,
1118 HTMLElement2_addBehavior,
1119 HTMLElement2_removeBehavior,
1120 HTMLElement2_get_runtimeStyle,
1121 HTMLElement2_get_behaviorUrns,
1122 HTMLElement2_put_tagUrn,
1123 HTMLElement2_get_tagUrn,
1124 HTMLElement2_put_onbeforeeditfocus,
1125 HTMLElement2_get_onbeforeeditfocus,
1126 HTMLElement2_get_readyStateValue,
1127 HTMLElement2_getElementsByTagName,
1130 void HTMLElement2_Init(HTMLElement *This)
1132 This->lpHTMLElement2Vtbl = &HTMLElement2Vtbl;