Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenhtmlframebase.c
Go to the documentation of this file.
00001 /* 00002 * Copyright 2008 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 00021 #define COBJMACROS 00022 00023 #include "windef.h" 00024 #include "winbase.h" 00025 #include "winuser.h" 00026 #include "ole2.h" 00027 00028 #include "mshtml_private.h" 00029 00030 #include "wine/debug.h" 00031 00032 WINE_DEFAULT_DEBUG_CHANNEL(mshtml); 00033 00034 static const WCHAR autoW[] = {'a','u','t','o',0}; 00035 static const WCHAR yesW[] = {'y','e','s',0}; 00036 static const WCHAR noW[] = {'n','o',0}; 00037 00038 HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc) 00039 { 00040 nsIDOMWindow *nswindow; 00041 HTMLWindow *window; 00042 HRESULT hres = S_OK; 00043 00044 if(frame->content_window) 00045 return S_OK; 00046 00047 nswindow = get_nsdoc_window(nsdoc); 00048 if(!nswindow) 00049 return E_FAIL; 00050 00051 window = nswindow_to_window(nswindow); 00052 if(!window) 00053 hres = HTMLWindow_Create(frame->element.node.doc->basedoc.doc_obj, nswindow, 00054 frame->element.node.doc->basedoc.window, &window); 00055 nsIDOMWindow_Release(nswindow); 00056 if(FAILED(hres)) 00057 return hres; 00058 00059 frame->content_window = window; 00060 window->frame_element = frame; 00061 return S_OK; 00062 } 00063 00064 #define HTMLFRAMEBASE_THIS(iface) DEFINE_THIS(HTMLFrameBase, IHTMLFrameBase, iface) 00065 00066 static HRESULT WINAPI HTMLFrameBase_QueryInterface(IHTMLFrameBase *iface, REFIID riid, void **ppv) 00067 { 00068 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00069 00070 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv); 00071 } 00072 00073 static ULONG WINAPI HTMLFrameBase_AddRef(IHTMLFrameBase *iface) 00074 { 00075 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00076 00077 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node)); 00078 } 00079 00080 static ULONG WINAPI HTMLFrameBase_Release(IHTMLFrameBase *iface) 00081 { 00082 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00083 00084 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node)); 00085 } 00086 00087 static HRESULT WINAPI HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase *iface, UINT *pctinfo) 00088 { 00089 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00090 00091 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo); 00092 } 00093 00094 static HRESULT WINAPI HTMLFrameBase_GetTypeInfo(IHTMLFrameBase *iface, UINT iTInfo, 00095 LCID lcid, ITypeInfo **ppTInfo) 00096 { 00097 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00098 00099 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo); 00100 } 00101 00102 static HRESULT WINAPI HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase *iface, REFIID riid, 00103 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) 00104 { 00105 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00106 00107 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, 00108 cNames, lcid, rgDispId); 00109 } 00110 00111 static HRESULT WINAPI HTMLFrameBase_Invoke(IHTMLFrameBase *iface, DISPID dispIdMember, 00112 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, 00113 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) 00114 { 00115 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00116 00117 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, 00118 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 00119 } 00120 00121 static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v) 00122 { 00123 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00124 00125 TRACE("(%p)->(%s)\n", This, debugstr_w(v)); 00126 00127 if(!This->content_window || !This->element.node.doc || !This->element.node.doc->basedoc.window) { 00128 FIXME("detached element\n"); 00129 return E_FAIL; 00130 } 00131 00132 return navigate_url(This->content_window, v, This->element.node.doc->basedoc.window->url); 00133 } 00134 00135 static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p) 00136 { 00137 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00138 FIXME("(%p)->(%p)\n", This, p); 00139 return E_NOTIMPL; 00140 } 00141 00142 static HRESULT WINAPI HTMLFrameBase_put_name(IHTMLFrameBase *iface, BSTR v) 00143 { 00144 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00145 FIXME("(%p)->(%s)\n", This, debugstr_w(v)); 00146 return E_NOTIMPL; 00147 } 00148 00149 static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p) 00150 { 00151 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00152 nsAString nsstr; 00153 const PRUnichar *strdata; 00154 nsresult nsres; 00155 00156 TRACE("(%p)->(%p)\n", This, p); 00157 00158 if(This->nsframe) { 00159 nsAString_Init(&nsstr, NULL); 00160 nsres = nsIDOMHTMLFrameElement_GetName(This->nsframe, &nsstr); 00161 }else if(This->nsiframe) { 00162 nsAString_Init(&nsstr, NULL); 00163 nsres = nsIDOMHTMLIFrameElement_GetName(This->nsiframe, &nsstr); 00164 }else { 00165 ERR("No attached ns frame object\n"); 00166 return E_UNEXPECTED; 00167 } 00168 00169 if(NS_FAILED(nsres)) { 00170 ERR("GetName failed: 0x%08x\n", nsres); 00171 nsAString_Finish(&nsstr); 00172 return E_FAIL; 00173 } 00174 00175 nsAString_GetData(&nsstr, &strdata); 00176 if(*strdata) { 00177 *p = SysAllocString(strdata); 00178 if(!*p) { 00179 nsAString_Finish(&nsstr); 00180 return E_OUTOFMEMORY; 00181 } 00182 }else 00183 *p = NULL; 00184 00185 nsAString_Finish(&nsstr); 00186 00187 return S_OK; 00188 } 00189 00190 static HRESULT WINAPI HTMLFrameBase_put_border(IHTMLFrameBase *iface, VARIANT v) 00191 { 00192 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00193 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); 00194 return E_NOTIMPL; 00195 } 00196 00197 static HRESULT WINAPI HTMLFrameBase_get_border(IHTMLFrameBase *iface, VARIANT *p) 00198 { 00199 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00200 FIXME("(%p)->(%p)\n", This, p); 00201 return E_NOTIMPL; 00202 } 00203 00204 static HRESULT WINAPI HTMLFrameBase_put_frameBorder(IHTMLFrameBase *iface, BSTR v) 00205 { 00206 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00207 FIXME("(%p)->(%s)\n", This, debugstr_w(v)); 00208 return E_NOTIMPL; 00209 } 00210 00211 static HRESULT WINAPI HTMLFrameBase_get_frameBorder(IHTMLFrameBase *iface, BSTR *p) 00212 { 00213 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00214 FIXME("(%p)->(%p)\n", This, p); 00215 return E_NOTIMPL; 00216 } 00217 00218 static HRESULT WINAPI HTMLFrameBase_put_frameSpacing(IHTMLFrameBase *iface, VARIANT v) 00219 { 00220 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00221 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); 00222 return E_NOTIMPL; 00223 } 00224 00225 static HRESULT WINAPI HTMLFrameBase_get_frameSpacing(IHTMLFrameBase *iface, VARIANT *p) 00226 { 00227 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00228 FIXME("(%p)->(%p)\n", This, p); 00229 return E_NOTIMPL; 00230 } 00231 00232 static HRESULT WINAPI HTMLFrameBase_put_marginWidth(IHTMLFrameBase *iface, VARIANT v) 00233 { 00234 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00235 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); 00236 return E_NOTIMPL; 00237 } 00238 00239 static HRESULT WINAPI HTMLFrameBase_get_marginWidth(IHTMLFrameBase *iface, VARIANT *p) 00240 { 00241 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00242 FIXME("(%p)->(%p)\n", This, p); 00243 return E_NOTIMPL; 00244 } 00245 00246 static HRESULT WINAPI HTMLFrameBase_put_marginHeight(IHTMLFrameBase *iface, VARIANT v) 00247 { 00248 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00249 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); 00250 return E_NOTIMPL; 00251 } 00252 00253 static HRESULT WINAPI HTMLFrameBase_get_marginHeight(IHTMLFrameBase *iface, VARIANT *p) 00254 { 00255 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00256 FIXME("(%p)->(%p)\n", This, p); 00257 return E_NOTIMPL; 00258 } 00259 00260 static HRESULT WINAPI HTMLFrameBase_put_noResize(IHTMLFrameBase *iface, VARIANT_BOOL v) 00261 { 00262 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00263 FIXME("(%p)->(%x)\n", This, v); 00264 return E_NOTIMPL; 00265 } 00266 00267 static HRESULT WINAPI HTMLFrameBase_get_noResize(IHTMLFrameBase *iface, VARIANT_BOOL *p) 00268 { 00269 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00270 FIXME("(%p)->(%p)\n", This, p); 00271 return E_NOTIMPL; 00272 } 00273 00274 static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v) 00275 { 00276 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00277 nsAString nsstr; 00278 nsresult nsres; 00279 00280 TRACE("(%p)->(%s)\n", This, debugstr_w(v)); 00281 00282 if(!(!strcmpiW(v, yesW) || !strcmpiW(v, noW) || !strcmpiW(v, autoW))) 00283 return E_INVALIDARG; 00284 00285 if(This->nsframe) { 00286 nsAString_InitDepend(&nsstr, v); 00287 nsres = nsIDOMHTMLFrameElement_SetScrolling(This->nsframe, &nsstr); 00288 }else if(This->nsiframe) { 00289 nsAString_InitDepend(&nsstr, v); 00290 nsres = nsIDOMHTMLIFrameElement_SetScrolling(This->nsiframe, &nsstr); 00291 }else { 00292 ERR("No attached ns frame object\n"); 00293 return E_UNEXPECTED; 00294 } 00295 nsAString_Finish(&nsstr); 00296 00297 if(NS_FAILED(nsres)) { 00298 ERR("SetScrolling failed: 0x%08x\n", nsres); 00299 return E_FAIL; 00300 } 00301 00302 return S_OK; 00303 } 00304 00305 static HRESULT WINAPI HTMLFrameBase_get_scrolling(IHTMLFrameBase *iface, BSTR *p) 00306 { 00307 HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); 00308 nsAString nsstr; 00309 const PRUnichar *strdata; 00310 nsresult nsres; 00311 00312 TRACE("(%p)->(%p)\n", This, p); 00313 00314 if(This->nsframe) { 00315 nsAString_Init(&nsstr, NULL); 00316 nsres = nsIDOMHTMLFrameElement_GetScrolling(This->nsframe, &nsstr); 00317 }else if(This->nsiframe) { 00318 nsAString_Init(&nsstr, NULL); 00319 nsres = nsIDOMHTMLIFrameElement_GetScrolling(This->nsiframe, &nsstr); 00320 }else { 00321 ERR("No attached ns frame object\n"); 00322 return E_UNEXPECTED; 00323 } 00324 00325 if(NS_FAILED(nsres)) { 00326 ERR("GetScrolling failed: 0x%08x\n", nsres); 00327 nsAString_Finish(&nsstr); 00328 return E_FAIL; 00329 } 00330 00331 nsAString_GetData(&nsstr, &strdata); 00332 00333 if(*strdata) 00334 *p = SysAllocString(strdata); 00335 else 00336 *p = SysAllocString(autoW); 00337 00338 nsAString_Finish(&nsstr); 00339 00340 return *p ? S_OK : E_OUTOFMEMORY; 00341 } 00342 00343 static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl = { 00344 HTMLFrameBase_QueryInterface, 00345 HTMLFrameBase_AddRef, 00346 HTMLFrameBase_Release, 00347 HTMLFrameBase_GetTypeInfoCount, 00348 HTMLFrameBase_GetTypeInfo, 00349 HTMLFrameBase_GetIDsOfNames, 00350 HTMLFrameBase_Invoke, 00351 HTMLFrameBase_put_src, 00352 HTMLFrameBase_get_src, 00353 HTMLFrameBase_put_name, 00354 HTMLFrameBase_get_name, 00355 HTMLFrameBase_put_border, 00356 HTMLFrameBase_get_border, 00357 HTMLFrameBase_put_frameBorder, 00358 HTMLFrameBase_get_frameBorder, 00359 HTMLFrameBase_put_frameSpacing, 00360 HTMLFrameBase_get_frameSpacing, 00361 HTMLFrameBase_put_marginWidth, 00362 HTMLFrameBase_get_marginWidth, 00363 HTMLFrameBase_put_marginHeight, 00364 HTMLFrameBase_get_marginHeight, 00365 HTMLFrameBase_put_noResize, 00366 HTMLFrameBase_get_noResize, 00367 HTMLFrameBase_put_scrolling, 00368 HTMLFrameBase_get_scrolling 00369 }; 00370 00371 #define HTMLFRAMEBASE2_THIS(iface) DEFINE_THIS(HTMLFrameBase, IHTMLFrameBase2, iface) 00372 00373 static HRESULT WINAPI HTMLFrameBase2_QueryInterface(IHTMLFrameBase2 *iface, REFIID riid, void **ppv) 00374 { 00375 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00376 00377 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv); 00378 } 00379 00380 static ULONG WINAPI HTMLFrameBase2_AddRef(IHTMLFrameBase2 *iface) 00381 { 00382 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00383 00384 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node)); 00385 } 00386 00387 static ULONG WINAPI HTMLFrameBase2_Release(IHTMLFrameBase2 *iface) 00388 { 00389 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00390 00391 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node)); 00392 } 00393 00394 static HRESULT WINAPI HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2 *iface, UINT *pctinfo) 00395 { 00396 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00397 FIXME("(%p)\n", This); 00398 return E_NOTIMPL; 00399 } 00400 00401 static HRESULT WINAPI HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2 *iface, UINT iTInfo, 00402 LCID lcid, ITypeInfo **ppTInfo) 00403 { 00404 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00405 FIXME("(%p)\n", This); 00406 return E_NOTIMPL; 00407 } 00408 00409 static HRESULT WINAPI HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2 *iface, REFIID riid, 00410 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) 00411 { 00412 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00413 FIXME("(%p)\n", This); 00414 return E_NOTIMPL; 00415 } 00416 00417 static HRESULT WINAPI HTMLFrameBase2_Invoke(IHTMLFrameBase2 *iface, DISPID dispIdMember, 00418 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, 00419 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) 00420 { 00421 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00422 FIXME("(%p)\n", This); 00423 return E_NOTIMPL; 00424 } 00425 00426 static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, IHTMLWindow2 **p) 00427 { 00428 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00429 00430 TRACE("(%p)->(%p)\n", This, p); 00431 00432 if(This->content_window) { 00433 IHTMLWindow2_AddRef(HTMLWINDOW2(This->content_window)); 00434 *p = HTMLWINDOW2(This->content_window); 00435 }else { 00436 WARN("NULL content window\n"); 00437 *p = NULL; 00438 } 00439 return S_OK; 00440 } 00441 00442 static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v) 00443 { 00444 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00445 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); 00446 return E_NOTIMPL; 00447 } 00448 00449 static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p) 00450 { 00451 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00452 FIXME("(%p)->(%p)\n", This, p); 00453 return E_NOTIMPL; 00454 } 00455 00456 static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v) 00457 { 00458 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00459 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); 00460 return E_NOTIMPL; 00461 } 00462 00463 static HRESULT WINAPI HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT *p) 00464 { 00465 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00466 FIXME("(%p)->(%p)\n", This, p); 00467 return E_NOTIMPL; 00468 } 00469 00470 static HRESULT WINAPI HTMLFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR *p) 00471 { 00472 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00473 00474 TRACE("(%p)->(%p)\n", This, p); 00475 00476 if(!This->content_window || !This->content_window->doc) { 00477 FIXME("no document associated\n"); 00478 return E_FAIL; 00479 } 00480 00481 return IHTMLDocument2_get_readyState(HTMLDOC(&This->content_window->doc->basedoc), p); 00482 } 00483 00484 static HRESULT WINAPI HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL v) 00485 { 00486 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00487 FIXME("(%p)->(%x)\n", This, v); 00488 return E_NOTIMPL; 00489 } 00490 00491 static HRESULT WINAPI HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL *p) 00492 { 00493 HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface); 00494 FIXME("(%p)->(%p)\n", This, p); 00495 return E_NOTIMPL; 00496 } 00497 00498 #undef HTMLFRAMEBASE2_THIS 00499 00500 static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl = { 00501 HTMLFrameBase2_QueryInterface, 00502 HTMLFrameBase2_AddRef, 00503 HTMLFrameBase2_Release, 00504 HTMLFrameBase2_GetTypeInfoCount, 00505 HTMLFrameBase2_GetTypeInfo, 00506 HTMLFrameBase2_GetIDsOfNames, 00507 HTMLFrameBase2_Invoke, 00508 HTMLFrameBase2_get_contentWindow, 00509 HTMLFrameBase2_put_onload, 00510 HTMLFrameBase2_get_onload, 00511 HTMLFrameBase2_put_onreadystatechange, 00512 HTMLFrameBase2_get_onreadystatechange, 00513 HTMLFrameBase2_get_readyState, 00514 HTMLFrameBase2_put_allowTransparency, 00515 HTMLFrameBase2_get_allowTransparency 00516 }; 00517 00518 HRESULT HTMLFrameBase_QI(HTMLFrameBase *This, REFIID riid, void **ppv) 00519 { 00520 if(IsEqualGUID(&IID_IHTMLFrameBase, riid)) { 00521 TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This, ppv); 00522 *ppv = HTMLFRAMEBASE(This); 00523 }else if(IsEqualGUID(&IID_IHTMLFrameBase2, riid)) { 00524 TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This, ppv); 00525 *ppv = HTMLFRAMEBASE2(This); 00526 }else { 00527 return HTMLElement_QI(&This->element.node, riid, ppv); 00528 } 00529 00530 IUnknown_AddRef((IUnknown*)*ppv); 00531 return S_OK; 00532 } 00533 00534 void HTMLFrameBase_destructor(HTMLFrameBase *This) 00535 { 00536 if(This->content_window) 00537 This->content_window->frame_element = NULL; 00538 00539 if(This->nsframe) 00540 nsIDOMHTMLFrameElement_Release(This->nsframe); 00541 if(This->nsiframe) 00542 nsIDOMHTMLIFrameElement_Release(This->nsiframe); 00543 00544 HTMLElement_destructor(&This->element.node); 00545 } 00546 00547 void HTMLFrameBase_Init(HTMLFrameBase *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, 00548 dispex_static_data_t *dispex_data) 00549 { 00550 nsresult nsres; 00551 00552 This->lpIHTMLFrameBaseVtbl = &HTMLFrameBaseVtbl; 00553 This->lpIHTMLFrameBase2Vtbl = &HTMLFrameBase2Vtbl; 00554 00555 HTMLElement_Init(&This->element, doc, nselem, dispex_data); 00556 00557 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLFrameElement, (void**)&This->nsframe); 00558 if(NS_FAILED(nsres)) { 00559 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&This->nsiframe); 00560 if(NS_FAILED(nsres)) 00561 ERR("Could not get nsIDOMHTML[I]Frame interface\n"); 00562 }else 00563 This->nsiframe = NULL; 00564 } Generated on Sat May 26 2012 04:23:31 for ReactOS by
1.7.6.1
|