2008-10-07 19:44:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
|
|
|
typedef struct {
|
2009-11-01 18:17:17 +00:00
|
|
|
HTMLFrameBase framebase;
|
2010-12-06 22:31:33 +00:00
|
|
|
IHTMLIFrameElement IHTMLIFrameElement_iface;
|
2012-09-03 10:52:53 +00:00
|
|
|
IHTMLIFrameElement2 IHTMLIFrameElement2_iface;
|
2012-09-03 11:16:57 +00:00
|
|
|
IHTMLIFrameElement3 IHTMLIFrameElement3_iface;
|
2008-10-07 19:44:36 +00:00
|
|
|
} HTMLIFrame;
|
|
|
|
|
2010-12-06 22:31:33 +00:00
|
|
|
static inline HTMLIFrame *impl_from_IHTMLIFrameElement(IHTMLIFrameElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLIFrame, IHTMLIFrameElement_iface);
|
|
|
|
}
|
2010-01-14 15:47:59 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_QueryInterface(IHTMLIFrameElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
|
2010-12-30 00:39:16 +00:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->framebase.element.node.IHTMLDOMNode_iface, riid, ppv);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLIFrameElement_AddRef(IHTMLIFrameElement *iface)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
|
2010-12-30 00:39:16 +00:00
|
|
|
return IHTMLDOMNode_AddRef(&This->framebase.element.node.IHTMLDOMNode_iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLIFrameElement_Release(IHTMLIFrameElement *iface)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
|
2010-12-30 00:39:16 +00:00
|
|
|
return IHTMLDOMNode_Release(&This->framebase.element.node.IHTMLDOMNode_iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_GetTypeInfoCount(IHTMLIFrameElement *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-12-31 10:07:33 +00:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->framebase.element.node.dispex.IDispatchEx_iface,
|
|
|
|
pctinfo);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_GetTypeInfo(IHTMLIFrameElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-12-31 10:07:33 +00:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->framebase.element.node.dispex.IDispatchEx_iface, iTInfo,
|
|
|
|
lcid, ppTInfo);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_GetIDsOfNames(IHTMLIFrameElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-12-31 10:07:33 +00:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->framebase.element.node.dispex.IDispatchEx_iface, riid,
|
|
|
|
rgszNames, cNames, lcid, rgDispId);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_Invoke(IHTMLIFrameElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-12-31 10:07:33 +00:00
|
|
|
return IDispatchEx_Invoke(&This->framebase.element.node.dispex.IDispatchEx_iface, dispIdMember,
|
|
|
|
riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2010-01-14 15:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_put_vspace(IHTMLIFrameElement *iface, LONG v)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_get_vspace(IHTMLIFrameElement *iface, LONG *p)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_put_hspace(IHTMLIFrameElement *iface, LONG v)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_get_hspace(IHTMLIFrameElement *iface, LONG *p)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_put_align(IHTMLIFrameElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement_get_align(IHTMLIFrameElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 22:31:33 +00:00
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement(iface);
|
2010-01-14 15:47:59 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLIFrameElementVtbl HTMLIFrameElementVtbl = {
|
|
|
|
HTMLIFrameElement_QueryInterface,
|
|
|
|
HTMLIFrameElement_AddRef,
|
|
|
|
HTMLIFrameElement_Release,
|
|
|
|
HTMLIFrameElement_GetTypeInfoCount,
|
|
|
|
HTMLIFrameElement_GetTypeInfo,
|
|
|
|
HTMLIFrameElement_GetIDsOfNames,
|
|
|
|
HTMLIFrameElement_Invoke,
|
|
|
|
HTMLIFrameElement_put_vspace,
|
|
|
|
HTMLIFrameElement_get_vspace,
|
|
|
|
HTMLIFrameElement_put_hspace,
|
|
|
|
HTMLIFrameElement_get_hspace,
|
|
|
|
HTMLIFrameElement_put_align,
|
|
|
|
HTMLIFrameElement_get_align
|
|
|
|
};
|
|
|
|
|
2012-09-03 10:52:53 +00:00
|
|
|
static inline HTMLIFrame *impl_from_IHTMLIFrameElement2(IHTMLIFrameElement2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLIFrame, IHTMLIFrameElement2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_QueryInterface(IHTMLIFrameElement2 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->framebase.element.node.IHTMLDOMNode_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLIFrameElement2_AddRef(IHTMLIFrameElement2 *iface)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->framebase.element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLIFrameElement2_Release(IHTMLIFrameElement2 *iface)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->framebase.element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_GetTypeInfoCount(IHTMLIFrameElement2 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->framebase.element.node.dispex.IDispatchEx_iface,
|
|
|
|
pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_GetTypeInfo(IHTMLIFrameElement2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->framebase.element.node.dispex.IDispatchEx_iface, iTInfo,
|
|
|
|
lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_GetIDsOfNames(IHTMLIFrameElement2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->framebase.element.node.dispex.IDispatchEx_iface, riid,
|
|
|
|
rgszNames, cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_Invoke(IHTMLIFrameElement2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->framebase.element.node.dispex.IDispatchEx_iface, dispIdMember,
|
|
|
|
riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_put_height(IHTMLIFrameElement2 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
2012-10-23 11:41:33 +00:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
if(V_VT(&v) != VT_BSTR) {
|
|
|
|
FIXME("Unsupported %s\n", debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, V_BSTR(&v));
|
|
|
|
nsres = nsIDOMHTMLIFrameElement_SetHeight(This->framebase.nsiframe, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetHeight failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2012-09-03 10:52:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_get_height(IHTMLIFrameElement2 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
2012-10-23 11:41:33 +00:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLIFrameElement_GetHeight(This->framebase.nsiframe, &nsstr);
|
|
|
|
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
return return_nsstr(nsres, &nsstr, &V_BSTR(p));
|
2012-09-03 10:52:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_put_width(IHTMLIFrameElement2 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
2012-10-23 11:41:51 +00:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
if(V_VT(&v) != VT_BSTR) {
|
|
|
|
FIXME("Unsupported %s\n", debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, V_BSTR(&v));
|
|
|
|
nsres = nsIDOMHTMLIFrameElement_SetWidth(This->framebase.nsiframe, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetWidth failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2012-09-03 10:52:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement2_get_width(IHTMLIFrameElement2 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
|
2012-10-23 11:41:51 +00:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLIFrameElement_GetWidth(This->framebase.nsiframe, &nsstr);
|
|
|
|
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
return return_nsstr(nsres, &nsstr, &V_BSTR(p));
|
2012-09-03 10:52:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLIFrameElement2Vtbl HTMLIFrameElement2Vtbl = {
|
|
|
|
HTMLIFrameElement2_QueryInterface,
|
|
|
|
HTMLIFrameElement2_AddRef,
|
|
|
|
HTMLIFrameElement2_Release,
|
|
|
|
HTMLIFrameElement2_GetTypeInfoCount,
|
|
|
|
HTMLIFrameElement2_GetTypeInfo,
|
|
|
|
HTMLIFrameElement2_GetIDsOfNames,
|
|
|
|
HTMLIFrameElement2_Invoke,
|
|
|
|
HTMLIFrameElement2_put_height,
|
|
|
|
HTMLIFrameElement2_get_height,
|
|
|
|
HTMLIFrameElement2_put_width,
|
|
|
|
HTMLIFrameElement2_get_width
|
|
|
|
};
|
|
|
|
|
2012-09-03 11:16:57 +00:00
|
|
|
static inline HTMLIFrame *impl_from_IHTMLIFrameElement3(IHTMLIFrameElement3 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLIFrame, IHTMLIFrameElement3_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_QueryInterface(IHTMLIFrameElement3 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->framebase.element.node.IHTMLDOMNode_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLIFrameElement3_AddRef(IHTMLIFrameElement3 *iface)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->framebase.element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLIFrameElement3_Release(IHTMLIFrameElement3 *iface)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->framebase.element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_GetTypeInfoCount(IHTMLIFrameElement3 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->framebase.element.node.dispex.IDispatchEx_iface,
|
|
|
|
pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_GetTypeInfo(IHTMLIFrameElement3 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->framebase.element.node.dispex.IDispatchEx_iface, iTInfo,
|
|
|
|
lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_GetIDsOfNames(IHTMLIFrameElement3 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->framebase.element.node.dispex.IDispatchEx_iface, riid,
|
|
|
|
rgszNames, cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_Invoke(IHTMLIFrameElement3 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->framebase.element.node.dispex.IDispatchEx_iface, dispIdMember,
|
|
|
|
riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_get_contentDocument(IHTMLIFrameElement3 *iface, IDispatch **p)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
2012-10-11 12:09:01 +00:00
|
|
|
IHTMLDocument2 *doc;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->framebase.content_window) {
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IHTMLWindow2_get_document(&This->framebase.content_window->base.IHTMLWindow2_iface, &doc);
|
|
|
|
*p = (IDispatch*)doc;
|
|
|
|
return hres;
|
2012-09-03 11:16:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_put_src(IHTMLIFrameElement3 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_get_src(IHTMLIFrameElement3 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_put_longDesc(IHTMLIFrameElement3 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_get_longDesc(IHTMLIFrameElement3 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_put_frameBorder(IHTMLIFrameElement3 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLIFrameElement3_get_frameBorder(IHTMLIFrameElement3 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLIFrameElement3Vtbl HTMLIFrameElement3Vtbl = {
|
|
|
|
HTMLIFrameElement3_QueryInterface,
|
|
|
|
HTMLIFrameElement3_AddRef,
|
|
|
|
HTMLIFrameElement3_Release,
|
|
|
|
HTMLIFrameElement3_GetTypeInfoCount,
|
|
|
|
HTMLIFrameElement3_GetTypeInfo,
|
|
|
|
HTMLIFrameElement3_GetIDsOfNames,
|
|
|
|
HTMLIFrameElement3_Invoke,
|
|
|
|
HTMLIFrameElement3_get_contentDocument,
|
|
|
|
HTMLIFrameElement3_put_src,
|
|
|
|
HTMLIFrameElement3_get_src,
|
|
|
|
HTMLIFrameElement3_put_longDesc,
|
|
|
|
HTMLIFrameElement3_get_longDesc,
|
|
|
|
HTMLIFrameElement3_put_frameBorder,
|
|
|
|
HTMLIFrameElement3_get_frameBorder
|
|
|
|
};
|
|
|
|
|
2010-12-27 19:13:09 +00:00
|
|
|
static inline HTMLIFrame *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLIFrame, framebase.element.node);
|
|
|
|
}
|
2008-10-07 19:44:36 +00:00
|
|
|
|
|
|
|
static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2008-10-07 19:44:36 +00:00
|
|
|
|
2010-01-14 15:47:59 +00:00
|
|
|
if(IsEqualGUID(&IID_IHTMLIFrameElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLIFrameElement %p)\n", This, ppv);
|
2010-12-06 22:31:33 +00:00
|
|
|
*ppv = &This->IHTMLIFrameElement_iface;
|
2012-09-03 10:52:53 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLIFrameElement2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLIFrameElement2 %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IHTMLIFrameElement2_iface;
|
2012-09-03 11:16:57 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLIFrameElement3, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLIFrameElement3 %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IHTMLIFrameElement3_iface;
|
2010-01-14 15:47:59 +00:00
|
|
|
}else {
|
|
|
|
return HTMLFrameBase_QI(&This->framebase, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2008-10-07 19:44:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLIFrame_destructor(HTMLDOMNode *iface)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2008-10-07 19:44:36 +00:00
|
|
|
|
2009-11-01 18:17:17 +00:00
|
|
|
HTMLFrameBase_destructor(&This->framebase);
|
2008-10-07 19:44:36 +00:00
|
|
|
}
|
|
|
|
|
2009-11-24 20:13:38 +00:00
|
|
|
static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2009-11-24 20:13:38 +00:00
|
|
|
|
2012-06-25 12:05:17 +00:00
|
|
|
if(!This->framebase.content_window || !This->framebase.content_window->base.inner_window->doc) {
|
2009-11-24 20:13:38 +00:00
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-06-25 12:05:17 +00:00
|
|
|
*p = (IDispatch*)&This->framebase.content_window->base.inner_window->doc->basedoc.IHTMLDocument2_iface;
|
2009-11-24 20:13:38 +00:00
|
|
|
IDispatch_AddRef(*p);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-12-14 23:38:53 +00:00
|
|
|
static HRESULT HTMLIFrame_get_dispid(HTMLDOMNode *iface, BSTR name,
|
|
|
|
DWORD grfdex, DISPID *pid)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2009-12-14 23:38:53 +00:00
|
|
|
|
|
|
|
if(!This->framebase.content_window)
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
|
2012-06-25 12:05:48 +00:00
|
|
|
return search_window_props(This->framebase.content_window->base.inner_window, name, grfdex, pid);
|
2009-12-14 23:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
|
|
|
|
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2009-12-14 23:38:53 +00:00
|
|
|
|
|
|
|
if(!This->framebase.content_window) {
|
|
|
|
ERR("no content window to invoke on\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2012-06-25 12:04:59 +00:00
|
|
|
return IDispatchEx_InvokeEx(&This->framebase.content_window->base.IDispatchEx_iface, id, lcid,
|
2010-12-31 10:03:45 +00:00
|
|
|
flags, params, res, ei, caller);
|
2009-12-14 23:38:53 +00:00
|
|
|
}
|
|
|
|
|
2009-11-30 16:58:59 +00:00
|
|
|
static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2009-11-30 16:58:59 +00:00
|
|
|
|
2011-01-02 23:59:45 +00:00
|
|
|
return IHTMLFrameBase2_get_readyState(&This->framebase.IHTMLFrameBase2_iface, p);
|
2009-11-30 16:58:59 +00:00
|
|
|
}
|
|
|
|
|
2009-12-03 00:12:12 +00:00
|
|
|
static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface)
|
|
|
|
{
|
2010-12-27 19:13:09 +00:00
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
2009-12-03 00:12:12 +00:00
|
|
|
nsIDOMDocument *nsdoc;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2009-12-07 22:28:04 +00:00
|
|
|
nsres = nsIDOMHTMLIFrameElement_GetContentDocument(This->framebase.nsiframe, &nsdoc);
|
2009-12-03 00:12:12 +00:00
|
|
|
if(NS_FAILED(nsres) || !nsdoc) {
|
|
|
|
ERR("GetContentDocument failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = set_frame_doc(&This->framebase, nsdoc);
|
|
|
|
nsIDOMDocument_Release(nsdoc);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2014-09-24 14:05:25 +00:00
|
|
|
static void HTMLIFrame_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->framebase.nsiframe)
|
|
|
|
note_cc_edge((nsISupports*)This->framebase.nsiframe, "This->nsiframe", cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLIFrame_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->framebase.nsiframe) {
|
|
|
|
nsIDOMHTMLIFrameElement *nsiframe = This->framebase.nsiframe;
|
|
|
|
|
|
|
|
This->framebase.nsiframe = NULL;
|
|
|
|
nsIDOMHTMLIFrameElement_Release(nsiframe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-07 19:44:36 +00:00
|
|
|
static const NodeImplVtbl HTMLIFrameImplVtbl = {
|
|
|
|
HTMLIFrame_QI,
|
2009-11-24 20:13:38 +00:00
|
|
|
HTMLIFrame_destructor,
|
2013-03-15 14:01:53 +00:00
|
|
|
HTMLElement_cpc,
|
2010-11-14 13:41:39 +00:00
|
|
|
HTMLElement_clone,
|
2012-09-04 11:58:58 +00:00
|
|
|
HTMLElement_handle_event,
|
2011-08-25 13:23:35 +00:00
|
|
|
HTMLElement_get_attr_col,
|
2009-11-24 20:13:38 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2009-11-30 16:58:59 +00:00
|
|
|
HTMLIFrame_get_document,
|
2009-12-03 00:12:12 +00:00
|
|
|
HTMLIFrame_get_readystate,
|
2009-12-14 23:38:53 +00:00
|
|
|
HTMLIFrame_get_dispid,
|
|
|
|
HTMLIFrame_invoke,
|
2014-09-24 14:05:25 +00:00
|
|
|
HTMLIFrame_bind_to_tree,
|
|
|
|
HTMLIFrame_traverse,
|
|
|
|
HTMLIFrame_unlink
|
2008-10-07 19:44:36 +00:00
|
|
|
};
|
|
|
|
|
2008-10-07 19:44:50 +00:00
|
|
|
static const tid_t HTMLIFrame_iface_tids[] = {
|
2010-01-28 01:09:02 +00:00
|
|
|
HTMLELEMENT_TIDS,
|
2009-10-13 18:49:34 +00:00
|
|
|
IHTMLFrameBase_tid,
|
2008-10-07 19:44:50 +00:00
|
|
|
IHTMLFrameBase2_tid,
|
2010-01-14 15:48:18 +00:00
|
|
|
IHTMLIFrameElement_tid,
|
2012-09-03 10:52:53 +00:00
|
|
|
IHTMLIFrameElement2_tid,
|
2012-09-03 11:16:57 +00:00
|
|
|
IHTMLIFrameElement3_tid,
|
2008-10-07 19:44:50 +00:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
static dispex_static_data_t HTMLIFrame_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLIFrame_tid,
|
|
|
|
NULL,
|
|
|
|
HTMLIFrame_iface_tids
|
|
|
|
};
|
|
|
|
|
2010-12-01 21:43:14 +00:00
|
|
|
HRESULT HTMLIFrame_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
2008-10-07 19:44:36 +00:00
|
|
|
{
|
|
|
|
HTMLIFrame *ret;
|
|
|
|
|
|
|
|
ret = heap_alloc_zero(sizeof(HTMLIFrame));
|
2010-12-01 21:43:14 +00:00
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
2008-10-07 19:44:36 +00:00
|
|
|
|
2010-12-06 22:31:33 +00:00
|
|
|
ret->IHTMLIFrameElement_iface.lpVtbl = &HTMLIFrameElementVtbl;
|
2012-09-03 10:52:53 +00:00
|
|
|
ret->IHTMLIFrameElement2_iface.lpVtbl = &HTMLIFrameElement2Vtbl;
|
2012-09-03 11:16:57 +00:00
|
|
|
ret->IHTMLIFrameElement3_iface.lpVtbl = &HTMLIFrameElement3Vtbl;
|
2009-11-01 18:17:17 +00:00
|
|
|
ret->framebase.element.node.vtbl = &HTMLIFrameImplVtbl;
|
2008-10-07 19:44:36 +00:00
|
|
|
|
2009-12-03 00:12:12 +00:00
|
|
|
HTMLFrameBase_Init(&ret->framebase, doc, nselem, &HTMLIFrame_dispex);
|
2009-11-01 18:17:58 +00:00
|
|
|
|
2010-12-01 21:43:14 +00:00
|
|
|
*elem = &ret->framebase.element;
|
|
|
|
return S_OK;
|
2008-10-07 19:44:36 +00:00
|
|
|
}
|