ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

htmlelem2.c
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006-2010 Jacek Caban for CodeWeavers
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #include <stdarg.h>
00020 #include <math.h>
00021 
00022 #define COBJMACROS
00023 
00024 #include "windef.h"
00025 #include "winbase.h"
00026 #include "winuser.h"
00027 #include "ole2.h"
00028 
00029 #include "wine/debug.h"
00030 #include "wine/unicode.h"
00031 
00032 #include "mshtml_private.h"
00033 #include "htmlevent.h"
00034 
00035 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
00036 
00037 typedef struct {
00038     DispatchEx dispex;
00039     const IHTMLRectVtbl *lpIHTMLRectVtbl;
00040 
00041     LONG ref;
00042 
00043     nsIDOMClientRect *nsrect;
00044 } HTMLRect;
00045 
00046 #define HTMLRECT(x)  ((IHTMLRect*)  &(x)->lpIHTMLRectVtbl)
00047 
00048 #define HTMLRECT_THIS(iface) DEFINE_THIS(HTMLRect, IHTMLRect, iface)
00049 
00050 static HRESULT WINAPI HTMLRect_QueryInterface(IHTMLRect *iface, REFIID riid, void **ppv)
00051 {
00052     HTMLRect *This = HTMLRECT_THIS(iface);
00053 
00054     if(IsEqualGUID(&IID_IUnknown, riid)) {
00055         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
00056         *ppv = HTMLRECT(This);
00057     }else if(IsEqualGUID(&IID_IHTMLRect, riid)) {
00058         TRACE("(%p)->(IID_IHTMLRect %p)\n", This, ppv);
00059         *ppv = HTMLRECT(This);
00060     }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
00061         return *ppv ? S_OK : E_NOINTERFACE;
00062     }else {
00063         FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
00064         *ppv = NULL;
00065         return E_NOINTERFACE;
00066     }
00067 
00068     IUnknown_AddRef((IUnknown*)*ppv);
00069     return S_OK;
00070 }
00071 
00072 static ULONG WINAPI HTMLRect_AddRef(IHTMLRect *iface)
00073 {
00074     HTMLRect *This = HTMLRECT_THIS(iface);
00075     LONG ref = InterlockedIncrement(&This->ref);
00076 
00077     TRACE("(%p) ref=%d\n", This, ref);
00078 
00079     return ref;
00080 }
00081 
00082 static ULONG WINAPI HTMLRect_Release(IHTMLRect *iface)
00083 {
00084     HTMLRect *This = HTMLRECT_THIS(iface);
00085     LONG ref = InterlockedDecrement(&This->ref);
00086 
00087     TRACE("(%p) ref=%d\n", This, ref);
00088 
00089     if(!ref) {
00090         if(This->nsrect)
00091             nsIDOMClientRect_Release(This->nsrect);
00092         heap_free(This);
00093     }
00094 
00095     return ref;
00096 }
00097 
00098 static HRESULT WINAPI HTMLRect_GetTypeInfoCount(IHTMLRect *iface, UINT *pctinfo)
00099 {
00100     HTMLRect *This = HTMLRECT_THIS(iface);
00101     FIXME("(%p)->(%p)\n", This, pctinfo);
00102     return E_NOTIMPL;
00103 }
00104 
00105 static HRESULT WINAPI HTMLRect_GetTypeInfo(IHTMLRect *iface, UINT iTInfo,
00106         LCID lcid, ITypeInfo **ppTInfo)
00107 {
00108     HTMLRect *This = HTMLRECT_THIS(iface);
00109 
00110     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
00111 }
00112 
00113 static HRESULT WINAPI HTMLRect_GetIDsOfNames(IHTMLRect *iface, REFIID riid,
00114         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
00115 {
00116     HTMLRect *This = HTMLRECT_THIS(iface);
00117 
00118     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
00119 }
00120 
00121 static HRESULT WINAPI HTMLRect_Invoke(IHTMLRect *iface, DISPID dispIdMember,
00122         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
00123         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
00124 {
00125     HTMLRect *This = HTMLRECT_THIS(iface);
00126 
00127     return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
00128             pVarResult, pExcepInfo, puArgErr);
00129 }
00130 
00131 static HRESULT WINAPI HTMLRect_put_left(IHTMLRect *iface, LONG v)
00132 {
00133     HTMLRect *This = HTMLRECT_THIS(iface);
00134     FIXME("(%p)->(%d)\n", This, v);
00135     return E_NOTIMPL;
00136 }
00137 
00138 static HRESULT WINAPI HTMLRect_get_left(IHTMLRect *iface, LONG *p)
00139 {
00140     HTMLRect *This = HTMLRECT_THIS(iface);
00141     float left;
00142     nsresult nsres;
00143 
00144     TRACE("(%p)->(%p)\n", This, p);
00145 
00146     nsres = nsIDOMClientRect_GetLeft(This->nsrect, &left);
00147     if(NS_FAILED(nsres)) {
00148         ERR("GetLeft failed: %08x\n", nsres);
00149         return E_FAIL;
00150     }
00151 
00152     *p = floor(left+0.5);
00153     return S_OK;
00154 }
00155 
00156 static HRESULT WINAPI HTMLRect_put_top(IHTMLRect *iface, LONG v)
00157 {
00158     HTMLRect *This = HTMLRECT_THIS(iface);
00159     FIXME("(%p)->(%d)\n", This, v);
00160     return E_NOTIMPL;
00161 }
00162 
00163 static HRESULT WINAPI HTMLRect_get_top(IHTMLRect *iface, LONG *p)
00164 {
00165     HTMLRect *This = HTMLRECT_THIS(iface);
00166     float top;
00167     nsresult nsres;
00168 
00169     TRACE("(%p)->(%p)\n", This, p);
00170 
00171     nsres = nsIDOMClientRect_GetTop(This->nsrect, &top);
00172     if(NS_FAILED(nsres)) {
00173         ERR("GetTop failed: %08x\n", nsres);
00174         return E_FAIL;
00175     }
00176 
00177     *p = floor(top+0.5);
00178     return S_OK;
00179 }
00180 
00181 static HRESULT WINAPI HTMLRect_put_right(IHTMLRect *iface, LONG v)
00182 {
00183     HTMLRect *This = HTMLRECT_THIS(iface);
00184     FIXME("(%p)->(%d)\n", This, v);
00185     return E_NOTIMPL;
00186 }
00187 
00188 static HRESULT WINAPI HTMLRect_get_right(IHTMLRect *iface, LONG *p)
00189 {
00190     HTMLRect *This = HTMLRECT_THIS(iface);
00191     float right;
00192     nsresult nsres;
00193 
00194     TRACE("(%p)->(%p)\n", This, p);
00195 
00196     nsres = nsIDOMClientRect_GetRight(This->nsrect, &right);
00197     if(NS_FAILED(nsres)) {
00198         ERR("GetRight failed: %08x\n", nsres);
00199         return E_FAIL;
00200     }
00201 
00202     *p = floor(right+0.5);
00203     return S_OK;
00204 }
00205 
00206 static HRESULT WINAPI HTMLRect_put_bottom(IHTMLRect *iface, LONG v)
00207 {
00208     HTMLRect *This = HTMLRECT_THIS(iface);
00209     FIXME("(%p)->(%d)\n", This, v);
00210     return E_NOTIMPL;
00211 }
00212 
00213 static HRESULT WINAPI HTMLRect_get_bottom(IHTMLRect *iface, LONG *p)
00214 {
00215     HTMLRect *This = HTMLRECT_THIS(iface);
00216     float bottom;
00217     nsresult nsres;
00218 
00219     TRACE("(%p)->(%p)\n", This, p);
00220 
00221     nsres = nsIDOMClientRect_GetBottom(This->nsrect, &bottom);
00222     if(NS_FAILED(nsres)) {
00223         ERR("GetBottom failed: %08x\n", nsres);
00224         return E_FAIL;
00225     }
00226 
00227     *p = floor(bottom+0.5);
00228     return S_OK;
00229 }
00230 
00231 #undef HTMLRECT_THIS
00232 
00233 static const IHTMLRectVtbl HTMLRectVtbl = {
00234     HTMLRect_QueryInterface,
00235     HTMLRect_AddRef,
00236     HTMLRect_Release,
00237     HTMLRect_GetTypeInfoCount,
00238     HTMLRect_GetTypeInfo,
00239     HTMLRect_GetIDsOfNames,
00240     HTMLRect_Invoke,
00241     HTMLRect_put_left,
00242     HTMLRect_get_left,
00243     HTMLRect_put_top,
00244     HTMLRect_get_top,
00245     HTMLRect_put_right,
00246     HTMLRect_get_right,
00247     HTMLRect_put_bottom,
00248     HTMLRect_get_bottom
00249 };
00250 
00251 static const tid_t HTMLRect_iface_tids[] = {
00252     IHTMLRect_tid,
00253     0
00254 };
00255 static dispex_static_data_t HTMLRect_dispex = {
00256     NULL,
00257     IHTMLRect_tid,
00258     NULL,
00259     HTMLRect_iface_tids
00260 };
00261 
00262 static HRESULT create_html_rect(nsIDOMClientRect *nsrect, IHTMLRect **ret)
00263 {
00264     HTMLRect *rect;
00265 
00266     rect = heap_alloc_zero(sizeof(HTMLRect));
00267     if(!rect)
00268         return E_OUTOFMEMORY;
00269 
00270     rect->lpIHTMLRectVtbl = &HTMLRectVtbl;
00271     rect->ref = 1;
00272 
00273     init_dispex(&rect->dispex, (IUnknown*)HTMLRECT(rect), &HTMLRect_dispex);
00274 
00275     nsIDOMClientRect_AddRef(nsrect);
00276     rect->nsrect = nsrect;
00277 
00278     *ret = HTMLRECT(rect);
00279     return S_OK;
00280 }
00281 
00282 #define HTMLELEM2_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement2, iface)
00283 
00284 static HRESULT WINAPI HTMLElement2_QueryInterface(IHTMLElement2 *iface,
00285                                                   REFIID riid, void **ppv)
00286 {
00287     HTMLElement *This = HTMLELEM2_THIS(iface);
00288     return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
00289 }
00290 
00291 static ULONG WINAPI HTMLElement2_AddRef(IHTMLElement2 *iface)
00292 {
00293     HTMLElement *This = HTMLELEM2_THIS(iface);
00294     return IHTMLElement_AddRef(HTMLELEM(This));
00295 }
00296 
00297 static ULONG WINAPI HTMLElement2_Release(IHTMLElement2 *iface)
00298 {
00299     HTMLElement *This = HTMLELEM2_THIS(iface);
00300     return IHTMLElement_Release(HTMLELEM(This));
00301 }
00302 
00303 static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
00304 {
00305     HTMLElement *This = HTMLELEM2_THIS(iface);
00306     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
00307 }
00308 
00309 static HRESULT WINAPI HTMLElement2_GetTypeInfo(IHTMLElement2 *iface, UINT iTInfo,
00310                                                LCID lcid, ITypeInfo **ppTInfo)
00311 {
00312     HTMLElement *This = HTMLELEM2_THIS(iface);
00313     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
00314 }
00315 
00316 static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
00317                                                 LPOLESTR *rgszNames, UINT cNames,
00318                                                 LCID lcid, DISPID *rgDispId)
00319 {
00320     HTMLElement *This = HTMLELEM2_THIS(iface);
00321     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
00322 }
00323 
00324 static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
00325                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
00326                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
00327 {
00328     HTMLElement *This = HTMLELEM2_THIS(iface);
00329     return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid,
00330             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
00331 }
00332 
00333 static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
00334 {
00335     HTMLElement *This = HTMLELEM2_THIS(iface);
00336     FIXME("(%p)->(%p)\n", This, p);
00337     return E_NOTIMPL;
00338 }
00339 
00340 static HRESULT WINAPI HTMLElement2_setCapture(IHTMLElement2 *iface, VARIANT_BOOL containerCapture)
00341 {
00342     HTMLElement *This = HTMLELEM2_THIS(iface);
00343     FIXME("(%p)->(%x)\n", This, containerCapture);
00344     return E_NOTIMPL;
00345 }
00346 
00347 static HRESULT WINAPI HTMLElement2_releaseCapture(IHTMLElement2 *iface)
00348 {
00349     HTMLElement *This = HTMLELEM2_THIS(iface);
00350     FIXME("(%p)\n", This);
00351     return E_NOTIMPL;
00352 }
00353 
00354 static HRESULT WINAPI HTMLElement2_put_onlosecapture(IHTMLElement2 *iface, VARIANT v)
00355 {
00356     HTMLElement *This = HTMLELEM2_THIS(iface);
00357     FIXME("(%p)->()\n", This);
00358     return E_NOTIMPL;
00359 }
00360 
00361 static HRESULT WINAPI HTMLElement2_get_onlosecapture(IHTMLElement2 *iface, VARIANT *p)
00362 {
00363     HTMLElement *This = HTMLELEM2_THIS(iface);
00364     FIXME("(%p)->(%p)\n", This, p);
00365     return E_NOTIMPL;
00366 }
00367 
00368 static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
00369                                                       LONG x, LONG y, BSTR *component)
00370 {
00371     HTMLElement *This = HTMLELEM2_THIS(iface);
00372     FIXME("(%p)->(%d %d %p)\n", This, x, y, component);
00373     return E_NOTIMPL;
00374 }
00375 
00376 static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
00377 {
00378     HTMLElement *This = HTMLELEM2_THIS(iface);
00379 
00380     TRACE("(%p)->(%s)\n", This, debugstr_variant(&component));
00381 
00382     if(!This->node.doc->content_ready
00383        || !This->node.doc->basedoc.doc_obj->in_place_active)
00384         return E_PENDING;
00385 
00386     WARN("stub\n");
00387     return S_OK;
00388 }
00389 
00390 static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
00391 {
00392     HTMLElement *This = HTMLELEM2_THIS(iface);
00393     FIXME("(%p)->()\n", This);
00394     return E_NOTIMPL;
00395 }
00396 
00397 static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p)
00398 {
00399     HTMLElement *This = HTMLELEM2_THIS(iface);
00400     FIXME("(%p)->(%p)\n", This, p);
00401     return E_NOTIMPL;
00402 }
00403 
00404 static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
00405 {
00406     HTMLElement *This = HTMLELEM2_THIS(iface);
00407 
00408     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
00409 
00410     return set_node_event(&This->node, EVENTID_DRAG, &v);
00411 }
00412 
00413 static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
00414 {
00415     HTMLElement *This = HTMLELEM2_THIS(iface);
00416 
00417     TRACE("(%p)->(%p)\n", This, p);
00418 
00419     return get_node_event(&This->node, EVENTID_DRAG, p);
00420 }
00421 
00422 static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
00423 {
00424     HTMLElement *This = HTMLELEM2_THIS(iface);
00425     FIXME("(%p)->()\n", This);
00426     return E_NOTIMPL;
00427 }
00428 
00429 static HRESULT WINAPI HTMLElement2_get_ondragend(IHTMLElement2 *iface, VARIANT *p)
00430 {
00431     HTMLElement *This = HTMLELEM2_THIS(iface);
00432     FIXME("(%p)->(%p)\n", This, p);
00433     return E_NOTIMPL;
00434 }
00435 
00436 static HRESULT WINAPI HTMLElement2_put_ondragenter(IHTMLElement2 *iface, VARIANT v)
00437 {
00438     HTMLElement *This = HTMLELEM2_THIS(iface);
00439     FIXME("(%p)->()\n", This);
00440     return E_NOTIMPL;
00441 }
00442 
00443 static HRESULT WINAPI HTMLElement2_get_ondragenter(IHTMLElement2 *iface, VARIANT *p)
00444 {
00445     HTMLElement *This = HTMLELEM2_THIS(iface);
00446     FIXME("(%p)->(%p)\n", This, p);
00447     return E_NOTIMPL;
00448 }
00449 
00450 static HRESULT WINAPI HTMLElement2_put_ondragover(IHTMLElement2 *iface, VARIANT v)
00451 {
00452     HTMLElement *This = HTMLELEM2_THIS(iface);
00453     FIXME("(%p)->()\n", This);
00454     return E_NOTIMPL;
00455 }
00456 
00457 static HRESULT WINAPI HTMLElement2_get_ondragover(IHTMLElement2 *iface, VARIANT *p)
00458 {
00459     HTMLElement *This = HTMLELEM2_THIS(iface);
00460     FIXME("(%p)->(%p)\n", This, p);
00461     return E_NOTIMPL;
00462 }
00463 
00464 static HRESULT WINAPI HTMLElement2_put_ondragleave(IHTMLElement2 *iface, VARIANT v)
00465 {
00466     HTMLElement *This = HTMLELEM2_THIS(iface);
00467     FIXME("(%p)->()\n", This);
00468     return E_NOTIMPL;
00469 }
00470 
00471 static HRESULT WINAPI HTMLElement2_get_ondragleave(IHTMLElement2 *iface, VARIANT *p)
00472 {
00473     HTMLElement *This = HTMLELEM2_THIS(iface);
00474     FIXME("(%p)->(%p)\n", This, p);
00475     return E_NOTIMPL;
00476 }
00477 
00478 static HRESULT WINAPI HTMLElement2_put_ondrop(IHTMLElement2 *iface, VARIANT v)
00479 {
00480     HTMLElement *This = HTMLELEM2_THIS(iface);
00481     FIXME("(%p)->()\n", This);
00482     return E_NOTIMPL;
00483 }
00484 
00485 static HRESULT WINAPI HTMLElement2_get_ondrop(IHTMLElement2 *iface, VARIANT *p)
00486 {
00487     HTMLElement *This = HTMLELEM2_THIS(iface);
00488     FIXME("(%p)->(%p)\n", This, p);
00489     return E_NOTIMPL;
00490 }
00491 
00492 static HRESULT WINAPI HTMLElement2_put_onbeforecut(IHTMLElement2 *iface, VARIANT v)
00493 {
00494     HTMLElement *This = HTMLELEM2_THIS(iface);
00495     FIXME("(%p)->()\n", This);
00496     return E_NOTIMPL;
00497 }
00498 
00499 static HRESULT WINAPI HTMLElement2_get_onbeforecut(IHTMLElement2 *iface, VARIANT *p)
00500 {
00501     HTMLElement *This = HTMLELEM2_THIS(iface);
00502     FIXME("(%p)->(%p)\n", This, p);
00503     return E_NOTIMPL;
00504 }
00505 
00506 static HRESULT WINAPI HTMLElement2_put_oncut(IHTMLElement2 *iface, VARIANT v)
00507 {
00508     HTMLElement *This = HTMLELEM2_THIS(iface);
00509     FIXME("(%p)->()\n", This);
00510     return E_NOTIMPL;
00511 }
00512 
00513 static HRESULT WINAPI HTMLElement2_get_oncut(IHTMLElement2 *iface, VARIANT *p)
00514 {
00515     HTMLElement *This = HTMLELEM2_THIS(iface);
00516     FIXME("(%p)->(%p)\n", This, p);
00517     return E_NOTIMPL;
00518 }
00519 
00520 static HRESULT WINAPI HTMLElement2_put_onbeforecopy(IHTMLElement2 *iface, VARIANT v)
00521 {
00522     HTMLElement *This = HTMLELEM2_THIS(iface);
00523     FIXME("(%p)->()\n", This);
00524     return E_NOTIMPL;
00525 }
00526 
00527 static HRESULT WINAPI HTMLElement2_get_onbeforecopy(IHTMLElement2 *iface, VARIANT *p)
00528 {
00529     HTMLElement *This = HTMLELEM2_THIS(iface);
00530     FIXME("(%p)->(%p)\n", This, p);
00531     return E_NOTIMPL;
00532 }
00533 
00534 static HRESULT WINAPI HTMLElement2_put_oncopy(IHTMLElement2 *iface, VARIANT v)
00535 {
00536     HTMLElement *This = HTMLELEM2_THIS(iface);
00537     FIXME("(%p)->()\n", This);
00538     return E_NOTIMPL;
00539 }
00540 
00541 static HRESULT WINAPI HTMLElement2_get_oncopy(IHTMLElement2 *iface, VARIANT *p)
00542 {
00543     HTMLElement *This = HTMLELEM2_THIS(iface);
00544     FIXME("(%p)->(%p)\n", This, p);
00545     return E_NOTIMPL;
00546 }
00547 
00548 static HRESULT WINAPI HTMLElement2_put_onbeforepaste(IHTMLElement2 *iface, VARIANT v)
00549 {
00550     HTMLElement *This = HTMLELEM2_THIS(iface);
00551     FIXME("(%p)->()\n", This);
00552     return E_NOTIMPL;
00553 }
00554 
00555 static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIANT *p)
00556 {
00557     HTMLElement *This = HTMLELEM2_THIS(iface);
00558     FIXME("(%p)->(%p)\n", This, p);
00559     return E_NOTIMPL;
00560 }
00561 
00562 static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
00563 {
00564     HTMLElement *This = HTMLELEM2_THIS(iface);
00565 
00566     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
00567 
00568     return set_node_event(&This->node, EVENTID_PASTE, &v);
00569 }
00570 
00571 static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
00572 {
00573     HTMLElement *This = HTMLELEM2_THIS(iface);
00574 
00575     TRACE("(%p)->(%p)\n", This, p);
00576 
00577     return get_node_event(&This->node, EVENTID_PASTE, p);
00578 }
00579 
00580 static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
00581 {
00582     HTMLElement *This = HTMLELEM2_THIS(iface);
00583 
00584     TRACE("(%p)->(%p)\n", This, p);
00585 
00586     return HTMLCurrentStyle_Create(This, p);
00587 }
00588 
00589 static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
00590 {
00591     HTMLElement *This = HTMLELEM2_THIS(iface);
00592     FIXME("(%p)->()\n", This);
00593     return E_NOTIMPL;
00594 }
00595 
00596 static HRESULT WINAPI HTMLElement2_get_onpropertychange(IHTMLElement2 *iface, VARIANT *p)
00597 {
00598     HTMLElement *This = HTMLELEM2_THIS(iface);
00599     FIXME("(%p)->(%p)\n", This, p);
00600     return E_NOTIMPL;
00601 }
00602 
00603 static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRectCollection **pRectCol)
00604 {
00605     HTMLElement *This = HTMLELEM2_THIS(iface);
00606     FIXME("(%p)->(%p)\n", This, pRectCol);
00607     return E_NOTIMPL;
00608 }
00609 
00610 static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect)
00611 {
00612     HTMLElement *This = HTMLELEM2_THIS(iface);
00613     nsIDOMNSElement *nselem;
00614     nsIDOMClientRect *nsrect;
00615     nsresult nsres;
00616     HRESULT hres;
00617 
00618     TRACE("(%p)->(%p)\n", This, pRect);
00619 
00620     nsres = nsIDOMHTMLElement_QueryInterface(This->node.nsnode, &IID_nsIDOMNSElement,
00621             (void**)&nselem);
00622     if(NS_FAILED(nsres)) {
00623         ERR("Could not get nsIDOMNSElement iface: %08x\n", nsres);
00624         return E_FAIL;
00625     }
00626 
00627     nsres = nsIDOMNSElement_GetBoundingClientRect(nselem, &nsrect);
00628     nsIDOMNSElement_Release(nselem);
00629     if(NS_FAILED(nsres) || !nsrect) {
00630         ERR("GetBoindingClientRect failed: %08x\n", nsres);
00631         return E_FAIL;
00632     }
00633 
00634     hres = create_html_rect(nsrect, pRect);
00635 
00636     nsIDOMClientRect_Release(nsrect);
00637     return hres;
00638 }
00639 
00640 static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname,
00641                                                  BSTR expression, BSTR language)
00642 {
00643     HTMLElement *This = HTMLELEM2_THIS(iface);
00644     FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression),
00645           debugstr_w(language));
00646     return E_NOTIMPL;
00647 }
00648 
00649 static HRESULT WINAPI HTMLElement2_getExpression(IHTMLElement2 *iface, BSTR propname,
00650                                                  VARIANT *expression)
00651 {
00652     HTMLElement *This = HTMLELEM2_THIS(iface);
00653     FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
00654     return E_NOTIMPL;
00655 }
00656 
00657 static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR propname,
00658                                                     VARIANT_BOOL *pfSuccess)
00659 {
00660     HTMLElement *This = HTMLELEM2_THIS(iface);
00661     FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
00662     return E_NOTIMPL;
00663 }
00664 
00665 static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
00666 {
00667     HTMLElement *This = HTMLELEM2_THIS(iface);
00668     nsIDOMNSHTMLElement *nselem;
00669     nsresult nsres;
00670 
00671     TRACE("(%p)->(%d)\n", This, v);
00672 
00673     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
00674     if(NS_FAILED(nsres)) {
00675         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
00676         return S_OK;
00677     }
00678 
00679     nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
00680     nsIDOMNSHTMLElement_Release(nselem);
00681     if(NS_FAILED(nsres))
00682         ERR("GetTabIndex failed: %08x\n", nsres);
00683 
00684     return S_OK;
00685 }
00686 
00687 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
00688 {
00689     HTMLElement *This = HTMLELEM2_THIS(iface);
00690     nsIDOMNSHTMLElement *nselem;
00691     PRInt32 index = 0;
00692     nsresult nsres;
00693 
00694     TRACE("(%p)->(%p)\n", This, p);
00695 
00696     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
00697     if(NS_FAILED(nsres)) {
00698         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
00699         return E_FAIL;
00700     }
00701 
00702     nsres = nsIDOMNSHTMLElement_GetTabIndex(nselem, &index);
00703     nsIDOMNSHTMLElement_Release(nselem);
00704     if(NS_FAILED(nsres)) {
00705         ERR("GetTabIndex failed: %08x\n", nsres);
00706         return E_FAIL;
00707     }
00708 
00709     *p = index;
00710     return S_OK;
00711 }
00712 
00713 static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
00714 {
00715     HTMLElement *This = HTMLELEM2_THIS(iface);
00716     nsIDOMNSHTMLElement *nselem;
00717     nsresult nsres;
00718 
00719     TRACE("(%p)\n", This);
00720 
00721     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
00722     if(NS_SUCCEEDED(nsres)) {
00723         nsIDOMNSHTMLElement_Focus(nselem);
00724         nsIDOMNSHTMLElement_Release(nselem);
00725     }else {
00726         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
00727     }
00728 
00729     return S_OK;
00730 }
00731 
00732 static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
00733 {
00734     HTMLElement *This = HTMLELEM2_THIS(iface);
00735     VARIANT var;
00736 
00737     static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
00738 
00739     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00740 
00741     V_VT(&var) = VT_BSTR;
00742     V_BSTR(&var) = v;
00743     return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
00744 }
00745 
00746 static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
00747 {
00748     HTMLElement *This = HTMLELEM2_THIS(iface);
00749     FIXME("(%p)->(%p)\n", This, p);
00750     return E_NOTIMPL;
00751 }
00752 
00753 static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
00754 {
00755     HTMLElement *This = HTMLELEM2_THIS(iface);
00756 
00757     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
00758 
00759     return set_node_event(&This->node, EVENTID_BLUR, &v);
00760 }
00761 
00762 static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
00763 {
00764     HTMLElement *This = HTMLELEM2_THIS(iface);
00765 
00766     TRACE("(%p)->(%p)\n", This, p);
00767 
00768     return get_node_event(&This->node, EVENTID_BLUR, p);
00769 }
00770 
00771 static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
00772 {
00773     HTMLElement *This = HTMLELEM2_THIS(iface);
00774 
00775     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
00776 
00777     return set_node_event(&This->node, EVENTID_FOCUS, &v);
00778 }
00779 
00780 static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
00781 {
00782     HTMLElement *This = HTMLELEM2_THIS(iface);
00783 
00784     TRACE("(%p)->(%p)\n", This, p);
00785 
00786     return get_node_event(&This->node, EVENTID_FOCUS, p);
00787 }
00788 
00789 static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
00790 {
00791     HTMLElement *This = HTMLELEM2_THIS(iface);
00792     FIXME("(%p)->()\n", This);
00793     return E_NOTIMPL;
00794 }
00795 
00796 static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p)
00797 {
00798     HTMLElement *This = HTMLELEM2_THIS(iface);
00799     FIXME("(%p)->(%p)\n", This, p);
00800     return E_NOTIMPL;
00801 }
00802 
00803 static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
00804 {
00805     HTMLElement *This = HTMLELEM2_THIS(iface);
00806     FIXME("(%p)\n", This);
00807     return E_NOTIMPL;
00808 }
00809 
00810 static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
00811 {
00812     HTMLElement *This = HTMLELEM2_THIS(iface);
00813     FIXME("(%p)->(%p)\n", This, pUnk);
00814     return E_NOTIMPL;
00815 }
00816 
00817 static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *pUnk)
00818 {
00819     HTMLElement *This = HTMLELEM2_THIS(iface);
00820     FIXME("(%p)->(%p)\n", This, pUnk);
00821     return E_NOTIMPL;
00822 }
00823 
00824 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, LONG *p)
00825 {
00826     HTMLElement *This = HTMLELEM2_THIS(iface);
00827     nsIDOMNSElement *nselem;
00828     PRInt32 height=0;
00829     nsresult nsres;
00830 
00831     TRACE("(%p)->(%p)\n", This, p);
00832 
00833     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
00834     if(NS_SUCCEEDED(nsres)) {
00835         nsIDOMNSElement_GetClientHeight(nselem, &height);
00836         nsIDOMNSElement_Release(nselem);
00837     }else {
00838         ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
00839     }
00840 
00841     *p = height;
00842     return S_OK;
00843 }
00844 
00845 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, LONG *p)
00846 {
00847     HTMLElement *This = HTMLELEM2_THIS(iface);
00848     nsIDOMNSElement *nselem;
00849     PRInt32 width=0;
00850     nsresult nsres;
00851 
00852     TRACE("(%p)->(%p)\n", This, p);
00853 
00854     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
00855     if(NS_SUCCEEDED(nsres)) {
00856         nsIDOMNSElement_GetClientWidth(nselem, &width);
00857         nsIDOMNSElement_Release(nselem);
00858     }else {
00859         ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
00860     }
00861 
00862     *p = width;
00863     return S_OK;
00864 }
00865 
00866 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, LONG *p)
00867 {
00868     HTMLElement *This = HTMLELEM2_THIS(iface);
00869     nsIDOMNSElement *nselem;
00870     PRInt32 client_top = 0;
00871     nsresult nsres;
00872 
00873     TRACE("(%p)->(%p)\n", This, p);
00874 
00875     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
00876     if(NS_SUCCEEDED(nsres)) {
00877         nsres = nsIDOMNSElement_GetClientTop(nselem, &client_top);
00878         nsIDOMNSElement_Release(nselem);
00879         if(NS_FAILED(nsres))
00880             ERR("GetScrollHeight failed: %08x\n", nsres);
00881     }else {
00882         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
00883     }
00884 
00885     *p = client_top;
00886     TRACE("*p = %d\n", *p);
00887     return S_OK;
00888 }
00889 
00890 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, LONG *p)
00891 {
00892     HTMLElement *This = HTMLELEM2_THIS(iface);
00893     nsIDOMNSElement *nselem;
00894     PRInt32 client_left = 0;
00895     nsresult nsres;
00896 
00897     TRACE("(%p)->(%p)\n", This, p);
00898 
00899     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
00900     if(NS_SUCCEEDED(nsres)) {
00901         nsres = nsIDOMNSElement_GetClientLeft(nselem, &client_left);
00902         nsIDOMNSElement_Release(nselem);
00903         if(NS_FAILED(nsres))
00904             ERR("GetScrollHeight failed: %08x\n", nsres);
00905     }else {
00906         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
00907     }
00908 
00909     *p = client_left;
00910     TRACE("*p = %d\n", *p);
00911     return S_OK;
00912 }
00913 
00914 static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
00915                                                IDispatch *pDisp, VARIANT_BOOL *pfResult)
00916 {
00917     HTMLElement *This = HTMLELEM2_THIS(iface);
00918 
00919     TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
00920 
00921     return attach_event(get_node_event_target(&This->node), This->node.nsnode, &This->node.doc->basedoc, event, pDisp, pfResult);
00922 }
00923 
00924 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
00925 {
00926     HTMLElement *This = HTMLELEM2_THIS(iface);
00927 
00928     TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
00929 
00930     return detach_event(*get_node_event_target(&This->node), &This->node.doc->basedoc, event, pDisp);
00931 }
00932 
00933 static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
00934 {
00935     HTMLElement *This = HTMLELEM2_THIS(iface);
00936     BSTR str;
00937 
00938     TRACE("(%p)->(%p)\n", This, p);
00939 
00940     if(This->node.vtbl->get_readystate) {
00941         HRESULT hres;
00942 
00943         hres = This->node.vtbl->get_readystate(&This->node, &str);
00944         if(FAILED(hres))
00945             return hres;
00946     }else {
00947         static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
00948 
00949         str = SysAllocString(completeW);
00950         if(!str)
00951             return E_OUTOFMEMORY;
00952     }
00953 
00954     V_VT(p) = VT_BSTR;
00955     V_BSTR(p) = str;
00956     return S_OK;
00957 }
00958 
00959 static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
00960 {
00961     HTMLElement *This = HTMLELEM2_THIS(iface);
00962 
00963     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
00964 
00965     return set_node_event(&This->node, EVENTID_READYSTATECHANGE, &v);
00966 }
00967 
00968 static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
00969 {
00970     HTMLElement *This = HTMLELEM2_THIS(iface);
00971 
00972     TRACE("(%p)->(%p)\n", This, p);
00973 
00974     return get_node_event(&This->node, EVENTID_READYSTATECHANGE, p);
00975 }
00976 
00977 static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
00978 {
00979     HTMLElement *This = HTMLELEM2_THIS(iface);
00980     FIXME("(%p)->()\n", This);
00981     return E_NOTIMPL;
00982 }
00983 
00984 static HRESULT WINAPI HTMLElement2_get_onrowsdelete(IHTMLElement2 *iface, VARIANT *p)
00985 {
00986     HTMLElement *This = HTMLELEM2_THIS(iface);
00987     FIXME("(%p)->(%p)\n", This, p);
00988     return E_NOTIMPL;
00989 }
00990 
00991 static HRESULT WINAPI HTMLElement2_put_onrowsinserted(IHTMLElement2 *iface, VARIANT v)
00992 {
00993     HTMLElement *This = HTMLELEM2_THIS(iface);
00994     FIXME("(%p)->()\n", This);
00995     return E_NOTIMPL;
00996 }
00997 
00998 static HRESULT WINAPI HTMLElement2_get_onrowsinserted(IHTMLElement2 *iface, VARIANT *p)
00999 {
01000     HTMLElement *This = HTMLELEM2_THIS(iface);
01001     FIXME("(%p)->(%p)\n", This, p);
01002     return E_NOTIMPL;
01003 }
01004 
01005 static HRESULT WINAPI HTMLElement2_put_oncellchange(IHTMLElement2 *iface, VARIANT v)
01006 {
01007     HTMLElement *This = HTMLELEM2_THIS(iface);
01008     FIXME("(%p)->()\n", This);
01009     return E_NOTIMPL;
01010 }
01011 
01012 static HRESULT WINAPI HTMLElement2_get_oncellchange(IHTMLElement2 *iface, VARIANT *p)
01013 {
01014     HTMLElement *This = HTMLELEM2_THIS(iface);
01015     FIXME("(%p)->(%p)\n", This, p);
01016     return E_NOTIMPL;
01017 }
01018 
01019 static HRESULT WINAPI HTMLElement2_put_dir(IHTMLElement2 *iface, BSTR v)
01020 {
01021     HTMLElement *This = HTMLELEM2_THIS(iface);
01022     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01023     return E_NOTIMPL;
01024 }
01025 
01026 static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
01027 {
01028     HTMLElement *This = HTMLELEM2_THIS(iface);
01029 
01030     TRACE("(%p)->(%p)\n", This, p);
01031 
01032     *p = NULL;
01033 
01034     if(This->nselem) {
01035         nsAString dir_str;
01036         nsresult nsres;
01037 
01038         nsAString_Init(&dir_str, NULL);
01039 
01040         nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
01041         if(NS_SUCCEEDED(nsres)) {
01042             const PRUnichar *dir;
01043             nsAString_GetData(&dir_str, &dir);
01044             if(*dir)
01045                 *p = SysAllocString(dir);
01046         }else {
01047             ERR("GetDir failed: %08x\n", nsres);
01048         }
01049 
01050         nsAString_Finish(&dir_str);
01051     }
01052 
01053     TRACE("ret %s\n", debugstr_w(*p));
01054     return S_OK;
01055 }
01056 
01057 static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDispatch **range)
01058 {
01059     HTMLElement *This = HTMLELEM2_THIS(iface);
01060     FIXME("(%p)->(%p)\n", This, range);
01061     return E_NOTIMPL;
01062 }
01063 
01064 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, LONG *p)
01065 {
01066     HTMLElement *This = HTMLELEM2_THIS(iface);
01067     nsIDOMNSElement *nselem;
01068     PRInt32 height = 0;
01069     nsresult nsres;
01070 
01071     TRACE("(%p)->(%p)\n", This, p);
01072 
01073     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
01074     if(NS_SUCCEEDED(nsres)) {
01075         nsres = nsIDOMNSElement_GetScrollHeight(nselem, &height);
01076         nsIDOMNSElement_Release(nselem);
01077         if(NS_FAILED(nsres))
01078             ERR("GetScrollHeight failed: %08x\n", nsres);
01079     }else {
01080         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
01081     }
01082 
01083     *p = height;
01084     TRACE("*p = %d\n", *p);
01085 
01086     return S_OK;
01087 }
01088 
01089 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, LONG *p)
01090 {
01091     HTMLElement *This = HTMLELEM2_THIS(iface);
01092     nsIDOMNSElement *nselem;
01093     PRInt32 width = 0;
01094     nsresult nsres;
01095 
01096     TRACE("(%p)->(%p)\n", This, p);
01097 
01098     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
01099     if(NS_SUCCEEDED(nsres)) {
01100         nsres = nsIDOMNSElement_GetScrollWidth(nselem, &width);
01101         nsIDOMNSElement_Release(nselem);
01102         if(NS_FAILED(nsres))
01103             ERR("GetScrollWidth failed: %08x\n", nsres);
01104     }else {
01105         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
01106     }
01107 
01108     *p = width;
01109     TRACE("*p = %d\n", *p);
01110 
01111     return S_OK;
01112 }
01113 
01114 static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, LONG v)
01115 {
01116     HTMLElement *This = HTMLELEM2_THIS(iface);
01117     nsIDOMNSElement *nselem;
01118     nsresult nsres;
01119 
01120     TRACE("(%p)->(%d)\n", This, v);
01121 
01122     if(!This->nselem) {
01123         FIXME("NULL nselem\n");
01124         return E_NOTIMPL;
01125     }
01126 
01127     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
01128     if(NS_SUCCEEDED(nsres)) {
01129         nsIDOMNSElement_SetScrollTop(nselem, v);
01130         nsIDOMNSElement_Release(nselem);
01131     }else {
01132         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
01133     }
01134 
01135     return S_OK;
01136 }
01137 
01138 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, LONG *p)
01139 {
01140     HTMLElement *This = HTMLELEM2_THIS(iface);
01141     nsIDOMNSElement *nselem;
01142     PRInt32 top = 0;
01143     nsresult nsres;
01144 
01145     TRACE("(%p)->(%p)\n", This, p);
01146 
01147     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
01148     if(NS_SUCCEEDED(nsres)) {
01149         nsres = nsIDOMNSElement_GetScrollTop(nselem, &top);
01150         nsIDOMNSElement_Release(nselem);
01151         if(NS_FAILED(nsres))
01152             ERR("GetScrollTop failed: %08x\n", nsres);
01153     }else {
01154         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
01155     }
01156 
01157     *p = top;
01158     TRACE("*p = %d\n", *p);
01159 
01160     return S_OK;
01161 }
01162 
01163 static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, LONG v)
01164 {
01165     HTMLElement *This = HTMLELEM2_THIS(iface);
01166     nsIDOMNSElement *nselem;
01167     nsresult nsres;
01168 
01169     TRACE("(%p)->(%d)\n", This, v);
01170 
01171     if(!This->nselem) {
01172         FIXME("NULL nselem\n");
01173         return E_NOTIMPL;
01174     }
01175 
01176     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
01177     if(NS_SUCCEEDED(nsres)) {
01178         nsIDOMNSElement_SetScrollLeft(nselem, v);
01179         nsIDOMNSElement_Release(nselem);
01180     }else {
01181         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
01182     }
01183 
01184     return S_OK;
01185 }
01186 
01187 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, LONG *p)
01188 {
01189     HTMLElement *This = HTMLELEM2_THIS(iface);
01190     nsIDOMNSElement *nselem;
01191     PRInt32 left = 0;
01192     nsresult nsres;
01193 
01194     TRACE("(%p)->(%p)\n", This, p);
01195 
01196     if(!p)
01197         return E_INVALIDARG;
01198 
01199     if(!This->nselem)
01200     {
01201         FIXME("NULL nselem\n");
01202         return E_NOTIMPL;
01203     }
01204 
01205     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
01206     if(NS_SUCCEEDED(nsres))
01207     {
01208         nsres = nsIDOMNSElement_GetScrollLeft(nselem, &left);
01209         nsIDOMNSElement_Release(nselem);
01210         if(NS_FAILED(nsres))
01211             left = 0;
01212     }
01213 
01214     *p = left;
01215     TRACE("*p = %d\n", *p);
01216 
01217     return S_OK;
01218 }
01219 
01220 static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
01221 {
01222     HTMLElement *This = HTMLELEM2_THIS(iface);
01223     FIXME("(%p)\n", This);
01224     return E_NOTIMPL;
01225 }
01226 
01227 static HRESULT WINAPI HTMLElement2_mergeAttributes(IHTMLElement2 *iface, IHTMLElement *mergeThis)
01228 {
01229     HTMLElement *This = HTMLELEM2_THIS(iface);
01230     FIXME("(%p)->(%p)\n", This, mergeThis);
01231     return E_NOTIMPL;
01232 }
01233 
01234 static HRESULT WINAPI HTMLElement2_put_oncontextmenu(IHTMLElement2 *iface, VARIANT v)
01235 {
01236     HTMLElement *This = HTMLELEM2_THIS(iface);
01237     FIXME("(%p)->()\n", This);
01238     return E_NOTIMPL;
01239 }
01240 
01241 static HRESULT WINAPI HTMLElement2_get_oncontextmenu(IHTMLElement2 *iface, VARIANT *p)
01242 {
01243     HTMLElement *This = HTMLELEM2_THIS(iface);
01244     FIXME("(%p)->(%p)\n", This, p);
01245     return E_NOTIMPL;
01246 }
01247 
01248 static HRESULT WINAPI HTMLElement2_insertAdjecentElement(IHTMLElement2 *iface, BSTR where,
01249         IHTMLElement *insertedElement, IHTMLElement **inserted)
01250 {
01251     HTMLElement *This = HTMLELEM2_THIS(iface);
01252     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(where), insertedElement, inserted);
01253     return E_NOTIMPL;
01254 }
01255 
01256 static HRESULT WINAPI HTMLElement2_applyElement(IHTMLElement2 *iface, IHTMLElement *apply,
01257                                                 BSTR where, IHTMLElement **applied)
01258 {
01259     HTMLElement *This = HTMLELEM2_THIS(iface);
01260     FIXME("(%p)->(%p %s %p)\n", This, apply, debugstr_w(where), applied);
01261     return E_NOTIMPL;
01262 }
01263 
01264 static HRESULT WINAPI HTMLElement2_getAdjecentText(IHTMLElement2 *iface, BSTR where, BSTR *text)
01265 {
01266     HTMLElement *This = HTMLELEM2_THIS(iface);
01267     FIXME("(%p)->(%s %p)\n", This, debugstr_w(where), text);
01268     return E_NOTIMPL;
01269 }
01270 
01271 static HRESULT WINAPI HTMLElement2_replaceAdjecentText(IHTMLElement2 *iface, BSTR where,
01272                                                        BSTR newText, BSTR *oldText)
01273 {
01274     HTMLElement *This = HTMLELEM2_THIS(iface);
01275     FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(where), debugstr_w(newText), oldText);
01276     return E_NOTIMPL;
01277 }
01278 
01279 static HRESULT WINAPI HTMLElement2_get_canHandleChildren(IHTMLElement2 *iface, VARIANT_BOOL *p)
01280 {
01281     HTMLElement *This = HTMLELEM2_THIS(iface);
01282     FIXME("(%p)->(%p)\n", This, p);
01283     return E_NOTIMPL;
01284 }
01285 
01286 static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
01287                                                VARIANT *pvarFactory, LONG *pCookie)
01288 {
01289     HTMLElement *This = HTMLELEM2_THIS(iface);
01290     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
01291     return E_NOTIMPL;
01292 }
01293 
01294 static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, LONG cookie,
01295                                                   VARIANT_BOOL *pfResult)
01296 {
01297     HTMLElement *This = HTMLELEM2_THIS(iface);
01298     FIXME("(%p)->(%d %p)\n", This, cookie, pfResult);
01299     return E_NOTIMPL;
01300 }
01301 
01302 static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
01303 {
01304     HTMLElement *This = HTMLELEM2_THIS(iface);
01305     FIXME("(%p)->(%p)\n", This, p);
01306     return E_NOTIMPL;
01307 }
01308 
01309 static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)
01310 {
01311     HTMLElement *This = HTMLELEM2_THIS(iface);
01312     FIXME("(%p)->(%p)\n", This, p);
01313     return E_NOTIMPL;
01314 }
01315 
01316 static HRESULT WINAPI HTMLElement2_put_tagUrn(IHTMLElement2 *iface, BSTR v)
01317 {
01318     HTMLElement *This = HTMLELEM2_THIS(iface);
01319     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01320     return E_NOTIMPL;
01321 }
01322 
01323 static HRESULT WINAPI HTMLElement2_get_tagUrn(IHTMLElement2 *iface, BSTR *p)
01324 {
01325     HTMLElement *This = HTMLELEM2_THIS(iface);
01326     FIXME("(%p)->(%p)\n", This, p);
01327     return E_NOTIMPL;
01328 }
01329 
01330 static HRESULT WINAPI HTMLElement2_put_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT vv)
01331 {
01332     HTMLElement *This = HTMLELEM2_THIS(iface);
01333     FIXME("(%p)->()\n", This);
01334     return E_NOTIMPL;
01335 }
01336 
01337 static HRESULT WINAPI HTMLElement2_get_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT *p)
01338 {
01339     HTMLElement *This = HTMLELEM2_THIS(iface);
01340     FIXME("(%p)->(%p)\n", This, p);
01341     return E_NOTIMPL;
01342 }
01343 
01344 static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, LONG *p)
01345 {
01346     HTMLElement *This = HTMLELEM2_THIS(iface);
01347     FIXME("(%p)->(%p)\n", This, p);
01348     return E_NOTIMPL;
01349 }
01350 
01351 static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BSTR v,
01352                                                        IHTMLElementCollection **pelColl)
01353 {
01354     HTMLElement *This = HTMLELEM2_THIS(iface);
01355     nsIDOMNodeList *nslist;
01356     nsAString tag_str;
01357     nsresult nsres;
01358 
01359     TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
01360 
01361     nsAString_InitDepend(&tag_str, v);
01362     nsres = nsIDOMHTMLElement_GetElementsByTagName(This->nselem, &tag_str, &nslist);
01363     nsAString_Finish(&tag_str);
01364     if(NS_FAILED(nsres)) {
01365         ERR("GetElementByTagName failed: %08x\n", nsres);
01366         return E_FAIL;
01367     }
01368 
01369     *pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
01370     nsIDOMNodeList_Release(nslist);
01371     return S_OK;
01372 }
01373 
01374 #undef HTMLELEM2_THIS
01375 
01376 static const IHTMLElement2Vtbl HTMLElement2Vtbl = {
01377     HTMLElement2_QueryInterface,
01378     HTMLElement2_AddRef,
01379     HTMLElement2_Release,
01380     HTMLElement2_GetTypeInfoCount,
01381     HTMLElement2_GetTypeInfo,
01382     HTMLElement2_GetIDsOfNames,
01383     HTMLElement2_Invoke,
01384     HTMLElement2_get_scopeName,
01385     HTMLElement2_setCapture,
01386     HTMLElement2_releaseCapture,
01387     HTMLElement2_put_onlosecapture,
01388     HTMLElement2_get_onlosecapture,
01389     HTMLElement2_componentFromPoint,
01390     HTMLElement2_doScroll,
01391     HTMLElement2_put_onscroll,
01392     HTMLElement2_get_onscroll,
01393     HTMLElement2_put_ondrag,
01394     HTMLElement2_get_ondrag,
01395     HTMLElement2_put_ondragend,
01396     HTMLElement2_get_ondragend,
01397     HTMLElement2_put_ondragenter,
01398     HTMLElement2_get_ondragenter,
01399     HTMLElement2_put_ondragover,
01400     HTMLElement2_get_ondragover,
01401     HTMLElement2_put_ondragleave,
01402     HTMLElement2_get_ondragleave,
01403     HTMLElement2_put_ondrop,
01404     HTMLElement2_get_ondrop,
01405     HTMLElement2_put_onbeforecut,
01406     HTMLElement2_get_onbeforecut,
01407     HTMLElement2_put_oncut,
01408     HTMLElement2_get_oncut,
01409     HTMLElement2_put_onbeforecopy,
01410     HTMLElement2_get_onbeforecopy,
01411     HTMLElement2_put_oncopy,
01412     HTMLElement2_get_oncopy,
01413     HTMLElement2_put_onbeforepaste,
01414     HTMLElement2_get_onbeforepaste,
01415     HTMLElement2_put_onpaste,
01416     HTMLElement2_get_onpaste,
01417     HTMLElement2_get_currentStyle,
01418     HTMLElement2_put_onpropertychange,
01419     HTMLElement2_get_onpropertychange,
01420     HTMLElement2_getClientRects,
01421     HTMLElement2_getBoundingClientRect,
01422     HTMLElement2_setExpression,
01423     HTMLElement2_getExpression,
01424     HTMLElement2_removeExpression,
01425     HTMLElement2_put_tabIndex,
01426     HTMLElement2_get_tabIndex,
01427     HTMLElement2_focus,
01428     HTMLElement2_put_accessKey,
01429     HTMLElement2_get_accessKey,
01430     HTMLElement2_put_onblur,
01431     HTMLElement2_get_onblur,
01432     HTMLElement2_put_onfocus,
01433     HTMLElement2_get_onfocus,
01434     HTMLElement2_put_onresize,
01435     HTMLElement2_get_onresize,
01436     HTMLElement2_blur,
01437     HTMLElement2_addFilter,
01438     HTMLElement2_removeFilter,
01439     HTMLElement2_get_clientHeight,
01440     HTMLElement2_get_clientWidth,
01441     HTMLElement2_get_clientTop,
01442     HTMLElement2_get_clientLeft,
01443     HTMLElement2_attachEvent,
01444     HTMLElement2_detachEvent,
01445     HTMLElement2_get_readyState,
01446     HTMLElement2_put_onreadystatechange,
01447     HTMLElement2_get_onreadystatechange,
01448     HTMLElement2_put_onrowsdelete,
01449     HTMLElement2_get_onrowsdelete,
01450     HTMLElement2_put_onrowsinserted,
01451     HTMLElement2_get_onrowsinserted,
01452     HTMLElement2_put_oncellchange,
01453     HTMLElement2_get_oncellchange,
01454     HTMLElement2_put_dir,
01455     HTMLElement2_get_dir,
01456     HTMLElement2_createControlRange,
01457     HTMLElement2_get_scrollHeight,
01458     HTMLElement2_get_scrollWidth,
01459     HTMLElement2_put_scrollTop,
01460     HTMLElement2_get_scrollTop,
01461     HTMLElement2_put_scrollLeft,
01462     HTMLElement2_get_scrollLeft,
01463     HTMLElement2_clearAttributes,
01464     HTMLElement2_mergeAttributes,
01465     HTMLElement2_put_oncontextmenu,
01466     HTMLElement2_get_oncontextmenu,
01467     HTMLElement2_insertAdjecentElement,
01468     HTMLElement2_applyElement,
01469     HTMLElement2_getAdjecentText,
01470     HTMLElement2_replaceAdjecentText,
01471     HTMLElement2_get_canHandleChildren,
01472     HTMLElement2_addBehavior,
01473     HTMLElement2_removeBehavior,
01474     HTMLElement2_get_runtimeStyle,
01475     HTMLElement2_get_behaviorUrns,
01476     HTMLElement2_put_tagUrn,
01477     HTMLElement2_get_tagUrn,
01478     HTMLElement2_put_onbeforeeditfocus,
01479     HTMLElement2_get_onbeforeeditfocus,
01480     HTMLElement2_get_readyStateValue,
01481     HTMLElement2_getElementsByTagName,
01482 };
01483 
01484 void HTMLElement2_Init(HTMLElement *This)
01485 {
01486     This->lpHTMLElement2Vtbl = &HTMLElement2Vtbl;
01487 }

Generated on Sat May 26 2012 04:23:30 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.