2007-11-30 13:29:02 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2007 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>
|
2012-06-27 10:56:30 +02:00
|
|
|
#include <assert.h>
|
2007-11-30 13:29:02 +01:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2009-03-11 00:36:30 +01:00
|
|
|
struct HTMLTable {
|
2007-11-30 13:29:02 +01:00
|
|
|
HTMLElement element;
|
|
|
|
|
2011-09-21 08:37:34 +02:00
|
|
|
IHTMLTable IHTMLTable_iface;
|
|
|
|
IHTMLTable2 IHTMLTable2_iface;
|
|
|
|
IHTMLTable3 IHTMLTable3_iface;
|
2007-12-04 13:40:23 +01:00
|
|
|
|
2008-09-30 17:45:25 +02:00
|
|
|
nsIDOMHTMLTableElement *nstable;
|
2009-03-11 00:36:30 +01:00
|
|
|
};
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2011-01-04 01:51:47 +01:00
|
|
|
static inline HTMLTable *impl_from_IHTMLTable(IHTMLTable *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable_iface);
|
|
|
|
}
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2011-09-21 08:37:34 +02:00
|
|
|
static inline HTMLTable *impl_from_IHTMLTable2(IHTMLTable2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline HTMLTable *impl_from_IHTMLTable3(IHTMLTable3 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable3_iface);
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:04:54 +02:00
|
|
|
static HRESULT var2str(const VARIANT *p, nsAString *nsstr)
|
|
|
|
{
|
|
|
|
BSTR str;
|
|
|
|
BOOL ret;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
switch(V_VT(p)) {
|
|
|
|
case VT_BSTR:
|
|
|
|
return nsAString_Init(nsstr, V_BSTR(p))?
|
|
|
|
S_OK : E_OUTOFMEMORY;
|
|
|
|
case VT_R8:
|
2016-07-01 11:33:47 +02:00
|
|
|
hres = VarBstrFromR8(V_R8(p), MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, &str);
|
2014-04-29 15:04:54 +02:00
|
|
|
break;
|
|
|
|
case VT_R4:
|
2016-07-01 11:33:47 +02:00
|
|
|
hres = VarBstrFromR4(V_R4(p), MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, &str);
|
2014-04-29 15:04:54 +02:00
|
|
|
break;
|
|
|
|
case VT_I4:
|
2016-07-01 11:33:47 +02:00
|
|
|
hres = VarBstrFromI4(V_I4(p), MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, &str);
|
2014-04-29 15:04:54 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("unsupported arg %s\n", debugstr_variant(p));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
if (FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
ret = nsAString_Init(nsstr, str);
|
|
|
|
SysFreeString(str);
|
|
|
|
return ret ? S_OK : E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT nsstr_to_truncated_bstr(const nsAString *nsstr, BSTR *ret_ptr)
|
|
|
|
{
|
|
|
|
const PRUnichar *str, *ptr, *end = NULL;
|
|
|
|
BSTR ret;
|
|
|
|
|
|
|
|
nsAString_GetData(nsstr, &str);
|
|
|
|
|
|
|
|
for(ptr = str; isdigitW(*ptr); ptr++);
|
|
|
|
if(*ptr == '.') {
|
|
|
|
for(end = ptr++; isdigitW(*ptr); ptr++);
|
|
|
|
if(*ptr)
|
|
|
|
end = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = end ? SysAllocStringLen(str, end-str) : SysAllocString(str);
|
|
|
|
|
|
|
|
*ret_ptr = ret;
|
|
|
|
return ret ? S_OK : E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
2007-11-30 13:29:02 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_QueryInterface(IHTMLTable *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTable_AddRef(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTable_Release(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_GetTypeInfoCount(IHTMLTable *iface, UINT *pctinfo)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_GetTypeInfo(IHTMLTable *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
2010-12-31 11:07:33 +01:00
|
|
|
ppTInfo);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_GetIDsOfNames(IHTMLTable *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
2010-12-31 11:07:33 +01:00
|
|
|
cNames, lcid, rgDispId);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_Invoke(IHTMLTable *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
2010-12-31 11:07:33 +01:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_put_cols(IHTMLTable *iface, LONG v)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2009-03-12 01:43:31 +01:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_get_cols(IHTMLTable *iface, LONG *p)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_border(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2012-03-28 14:26:20 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_border(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_frame(IHTMLTable *iface, BSTR v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-08-18 10:56:24 +02:00
|
|
|
nsAString str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&str, v);
|
|
|
|
nsres = nsIDOMHTMLTableElement_SetFrame(This->nstable, &str);
|
|
|
|
nsAString_Finish(&str);
|
|
|
|
|
|
|
|
if (NS_FAILED(nsres)) {
|
|
|
|
ERR("SetFrame(%s) failed: %08x\n", debugstr_w(v), nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_frame(IHTMLTable *iface, BSTR *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-08-18 10:56:24 +02:00
|
|
|
nsAString str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&str, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetFrame(This->nstable, &str);
|
|
|
|
|
|
|
|
return return_nsstr(nsres, &str, p);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_rules(IHTMLTable *iface, BSTR v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_rules(IHTMLTable *iface, BSTR *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2013-07-30 14:10:16 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
WCHAR buf[64];
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
switch(V_VT(&v)) {
|
|
|
|
case VT_BSTR:
|
|
|
|
nsAString_InitDepend(&nsstr, V_BSTR(&v));
|
|
|
|
break;
|
|
|
|
case VT_I4: {
|
|
|
|
static const WCHAR formatW[] = {'%','d',0};
|
|
|
|
sprintfW(buf, formatW, V_I4(&v));
|
|
|
|
nsAString_InitDepend(&nsstr, buf);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("unsupported arg %s\n", debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_SetCellSpacing(This->nstable, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetCellSpacing failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_cellSpacing(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2013-07-30 14:10:16 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetCellSpacing(This->nstable, &nsstr);
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
return return_nsstr(nsres, &nsstr, &V_BSTR(p));
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_cellPadding(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-11-06 11:42:45 +01:00
|
|
|
nsAString val;
|
|
|
|
HRESULT hres;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
hres = var2str(&v, &val);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_SetCellPadding(This->nstable, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Set Width(%s) failed, err = %08x\n", debugstr_variant(&v), nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_cellPadding(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-11-06 11:42:45 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&val, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetCellPadding(This->nstable, &val);
|
|
|
|
return return_nsstr_variant(nsres, &val, p);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_background(IHTMLTable *iface, BSTR v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_bgColor(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-04-06 16:48:41 +02:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
2014-04-28 12:40:08 +02:00
|
|
|
if(!variant_to_nscolor(&v, &val))
|
|
|
|
return S_OK;
|
|
|
|
|
2014-04-06 16:48:41 +02:00
|
|
|
nsres = nsIDOMHTMLTableElement_SetBgColor(This->nstable, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_bgColor(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-04-06 16:48:41 +02:00
|
|
|
nsAString strColor;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
const PRUnichar *color;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&strColor, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetBgColor(This->nstable, &strColor);
|
|
|
|
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
|
|
|
nsAString_GetData(&strColor, &color);
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
hres = nscolor_to_str(color, &V_BSTR(p));
|
|
|
|
}else {
|
|
|
|
ERR("SetBgColor failed: %08x\n", nsres);
|
|
|
|
hres = E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Finish(&strColor);
|
|
|
|
return hres;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_borderColor(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2012-03-28 14:26:20 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_borderColor(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_borderColorLight(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2012-03-28 14:26:20 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_borderColorLight(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_borderColorDark(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2012-03-28 14:26:20 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_borderColorDark(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_align(IHTMLTable *iface, BSTR v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-03-21 13:29:00 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&val, v);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_SetAlign(This->nstable, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Set Align(%s) failed!\n", debugstr_w(v));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_align(IHTMLTable *iface, BSTR *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-03-21 13:29:00 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&val, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetAlign(This->nstable, &val);
|
|
|
|
|
|
|
|
return return_nsstr(nsres, &val, p);
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_rows(IHTMLTable *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2008-09-30 17:45:48 +02:00
|
|
|
nsIDOMHTMLCollection *nscol;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetRows(This->nstable, &nscol);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetRows failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2012-06-27 10:55:48 +02:00
|
|
|
*p = create_collection_from_htmlcol(This->element.node.doc, nscol);
|
2008-09-30 17:45:48 +02:00
|
|
|
|
|
|
|
nsIDOMHTMLCollection_Release(nscol);
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_width(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-04-29 15:04:54 +02:00
|
|
|
nsAString val;
|
|
|
|
HRESULT hres;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
hres = var2str(&v, &val);
|
|
|
|
|
|
|
|
if (FAILED(hres)){
|
|
|
|
ERR("Set Width(%s) failed when initializing a nsAString, err = %08x\n",
|
|
|
|
debugstr_variant(&v), hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_SetWidth(This->nstable, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Set Width(%s) failed, err = %08x\n", debugstr_variant(&v), nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-04-29 15:04:54 +02:00
|
|
|
nsAString val;
|
|
|
|
BSTR bstr;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
nsAString_Init(&val, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetWidth(This->nstable, &val);
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Get Width failed!\n");
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = nsstr_to_truncated_bstr(&val, &bstr);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
V_BSTR(p) = bstr;
|
|
|
|
return hres;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_height(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2012-03-28 14:26:20 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_height(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_put_dataPageSize(IHTMLTable *iface, LONG v)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2009-03-12 01:43:31 +01:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_get_dataPageSize(IHTMLTable *iface, LONG *p)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_nextPage(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_previousPage(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_tHead(IHTMLTable *iface, IHTMLTableSection **p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_tFoot(IHTMLTable *iface, IHTMLTableSection **p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2013-04-14 16:43:30 +02:00
|
|
|
nsIDOMHTMLCollection *nscol = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetTBodies(This->nstable, &nscol);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetTBodies failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = create_collection_from_htmlcol(This->element.node.doc, nscol);
|
|
|
|
|
|
|
|
nsIDOMHTMLCollection_Release(nscol);
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_caption(IHTMLTable *iface, IHTMLTableCaption **p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_createTHead(IHTMLTable *iface, IDispatch **head)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, head);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_deleteTHead(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_createTFoot(IHTMLTable *iface, IDispatch **foot)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, foot);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_deleteTFoot(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_createCaption(IHTMLTable *iface, IHTMLTableCaption **caption)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, caption);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_deleteCaption(IHTMLTable *iface)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_insertRow(IHTMLTable *iface, LONG index, IDispatch **row)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-08-18 10:55:59 +02:00
|
|
|
nsIDOMHTMLElement *nselem;
|
|
|
|
HTMLElement *elem;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %p)\n", This, index, row);
|
|
|
|
nsres = nsIDOMHTMLTableElement_InsertRow(This->nstable, index, &nselem);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Insert Row at %d failed: %08x\n", index, nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = HTMLTableRow_Create(This->element.node.doc, nselem, &elem);
|
|
|
|
nsIDOMHTMLElement_Release(nselem);
|
|
|
|
if (FAILED(hres)) {
|
|
|
|
ERR("Create TableRow failed: %08x\n", hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
*row = (IDispatch *)&elem->IHTMLElement_iface;
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTable_deleteRow(IHTMLTable *iface, LONG index)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2014-08-18 10:55:59 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, index);
|
|
|
|
nsres = nsIDOMHTMLTableElement_DeleteRow(This->nstable, index);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Delete Row failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_readyState(IHTMLTable *iface, BSTR *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_put_onreadystatechange(IHTMLTable *iface, VARIANT v)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2012-03-28 14:26:20 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-11-30 13:29:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable_get_onreadystatechange(IHTMLTable *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-04 01:51:47 +01:00
|
|
|
HTMLTable *This = impl_from_IHTMLTable(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLTableVtbl HTMLTableVtbl = {
|
|
|
|
HTMLTable_QueryInterface,
|
|
|
|
HTMLTable_AddRef,
|
|
|
|
HTMLTable_Release,
|
|
|
|
HTMLTable_GetTypeInfoCount,
|
|
|
|
HTMLTable_GetTypeInfo,
|
|
|
|
HTMLTable_GetIDsOfNames,
|
|
|
|
HTMLTable_Invoke,
|
|
|
|
HTMLTable_put_cols,
|
|
|
|
HTMLTable_get_cols,
|
|
|
|
HTMLTable_put_border,
|
|
|
|
HTMLTable_get_border,
|
|
|
|
HTMLTable_put_frame,
|
|
|
|
HTMLTable_get_frame,
|
|
|
|
HTMLTable_put_rules,
|
|
|
|
HTMLTable_get_rules,
|
|
|
|
HTMLTable_put_cellSpacing,
|
|
|
|
HTMLTable_get_cellSpacing,
|
|
|
|
HTMLTable_put_cellPadding,
|
|
|
|
HTMLTable_get_cellPadding,
|
|
|
|
HTMLTable_put_background,
|
|
|
|
HTMLTable_get_background,
|
|
|
|
HTMLTable_put_bgColor,
|
|
|
|
HTMLTable_get_bgColor,
|
|
|
|
HTMLTable_put_borderColor,
|
|
|
|
HTMLTable_get_borderColor,
|
|
|
|
HTMLTable_put_borderColorLight,
|
|
|
|
HTMLTable_get_borderColorLight,
|
|
|
|
HTMLTable_put_borderColorDark,
|
|
|
|
HTMLTable_get_borderColorDark,
|
|
|
|
HTMLTable_put_align,
|
|
|
|
HTMLTable_get_align,
|
|
|
|
HTMLTable_refresh,
|
|
|
|
HTMLTable_get_rows,
|
|
|
|
HTMLTable_put_width,
|
|
|
|
HTMLTable_get_width,
|
|
|
|
HTMLTable_put_height,
|
|
|
|
HTMLTable_get_height,
|
|
|
|
HTMLTable_put_dataPageSize,
|
|
|
|
HTMLTable_get_dataPageSize,
|
|
|
|
HTMLTable_nextPage,
|
|
|
|
HTMLTable_previousPage,
|
|
|
|
HTMLTable_get_tHead,
|
|
|
|
HTMLTable_get_tFoot,
|
|
|
|
HTMLTable_get_tBodies,
|
|
|
|
HTMLTable_get_caption,
|
|
|
|
HTMLTable_createTHead,
|
|
|
|
HTMLTable_deleteTHead,
|
|
|
|
HTMLTable_createTFoot,
|
|
|
|
HTMLTable_deleteTFoot,
|
|
|
|
HTMLTable_createCaption,
|
|
|
|
HTMLTable_deleteCaption,
|
|
|
|
HTMLTable_insertRow,
|
|
|
|
HTMLTable_deleteRow,
|
|
|
|
HTMLTable_get_readyState,
|
|
|
|
HTMLTable_put_onreadystatechange,
|
|
|
|
HTMLTable_get_onreadystatechange
|
|
|
|
};
|
|
|
|
|
2011-09-21 08:37:34 +02:00
|
|
|
/* IHTMLTable2 */
|
|
|
|
static HRESULT WINAPI HTMLTable2_QueryInterface(IHTMLTable2 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTable2_AddRef(IHTMLTable2 *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTable2_Release(IHTMLTable2 *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_GetTypeInfoCount(IHTMLTable2 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2011-09-21 08:37:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_GetTypeInfo(IHTMLTable2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
2011-09-21 08:37:34 +02:00
|
|
|
ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_GetIDsOfNames(IHTMLTable2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
2011-09-21 08:37:34 +02:00
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_Invoke(IHTMLTable2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
2011-09-21 08:37:34 +02:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_firstPage(IHTMLTable2 *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_lastPage(IHTMLTable2 *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_cells(IHTMLTable2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable2_moveRow(IHTMLTable2 *iface, LONG indexFrom, LONG indexTo, IDispatch **row)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable2(iface);
|
|
|
|
FIXME("(%p)->(%d %d %p)\n", This, indexFrom, indexTo, row);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const IHTMLTable2Vtbl HTMLTable2Vtbl = {
|
|
|
|
HTMLTable2_QueryInterface,
|
|
|
|
HTMLTable2_AddRef,
|
|
|
|
HTMLTable2_Release,
|
|
|
|
HTMLTable2_GetTypeInfoCount,
|
|
|
|
HTMLTable2_GetTypeInfo,
|
|
|
|
HTMLTable2_GetIDsOfNames,
|
|
|
|
HTMLTable2_Invoke,
|
|
|
|
HTMLTable2_firstPage,
|
|
|
|
HTMLTable2_lastPage,
|
|
|
|
HTMLTable2_cells,
|
|
|
|
HTMLTable2_moveRow
|
|
|
|
};
|
|
|
|
|
|
|
|
/* IHTMLTable3 */
|
|
|
|
static HRESULT WINAPI HTMLTable3_QueryInterface(IHTMLTable3 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTable3_AddRef(IHTMLTable3 *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTable3_Release(IHTMLTable3 *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable3_GetTypeInfoCount(IHTMLTable3 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2011-09-21 08:37:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable3_GetTypeInfo(IHTMLTable3 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
2011-09-21 08:37:34 +02:00
|
|
|
ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable3_GetIDsOfNames(IHTMLTable3 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
2011-09-21 08:37:34 +02:00
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable3_Invoke(IHTMLTable3 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
2011-09-21 08:37:34 +02:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable3_put_summary(IHTMLTable3 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
2014-07-15 15:06:41 +02:00
|
|
|
nsAString str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&str, v);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableElement_SetSummary(This->nstable, &str);
|
|
|
|
|
|
|
|
nsAString_Finish(&str);
|
|
|
|
if (NS_FAILED(nsres)) {
|
|
|
|
ERR("Set summary(%s) failed: %08x\n", debugstr_w(v), nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2011-09-21 08:37:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTable3_get_summary(IHTMLTable3 *iface, BSTR * p)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_IHTMLTable3(iface);
|
2014-07-15 15:06:41 +02:00
|
|
|
nsAString str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&str, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableElement_GetSummary(This->nstable, &str);
|
|
|
|
|
|
|
|
return return_nsstr(nsres, &str, p);
|
2011-09-21 08:37:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLTable3Vtbl HTMLTable3Vtbl = {
|
|
|
|
HTMLTable3_QueryInterface,
|
|
|
|
HTMLTable3_AddRef,
|
|
|
|
HTMLTable3_Release,
|
|
|
|
HTMLTable3_GetTypeInfoCount,
|
|
|
|
HTMLTable3_GetTypeInfo,
|
|
|
|
HTMLTable3_GetIDsOfNames,
|
|
|
|
HTMLTable3_Invoke,
|
|
|
|
HTMLTable3_put_summary,
|
|
|
|
HTMLTable3_get_summary
|
|
|
|
};
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLTable *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTable, element.node);
|
|
|
|
}
|
2007-11-30 13:29:02 +01:00
|
|
|
|
|
|
|
static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLTable *This = impl_from_HTMLDOMNode(iface);
|
2007-11-30 13:29:02 +01:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2011-01-04 01:51:47 +01:00
|
|
|
*ppv = &This->IHTMLTable_iface;
|
2007-11-30 13:29:02 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
2011-01-04 01:51:47 +01:00
|
|
|
*ppv = &This->IHTMLTable_iface;
|
2007-11-30 13:29:02 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLTable, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLTable %p)\n", This, ppv);
|
2011-01-04 01:51:47 +01:00
|
|
|
*ppv = &This->IHTMLTable_iface;
|
2011-09-21 08:37:34 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLTable2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This, ppv);
|
2014-07-15 15:05:47 +02:00
|
|
|
*ppv = &This->IHTMLTable2_iface;
|
2011-09-21 08:37:34 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLTable3, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This, ppv);
|
2014-07-15 15:05:47 +02:00
|
|
|
*ppv = &This->IHTMLTable3_iface;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
2014-09-25 12:11:42 +02:00
|
|
|
static void HTMLTable_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nstable)
|
|
|
|
note_cc_edge((nsISupports*)This->nstable, "This->nstable", cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLTable_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLTable *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nstable) {
|
|
|
|
nsIDOMHTMLTableElement *nstable = This->nstable;
|
|
|
|
|
|
|
|
This->nstable = NULL;
|
|
|
|
nsIDOMHTMLTableElement_Release(nstable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-15 15:01:53 +01:00
|
|
|
static const cpc_entry_t HTMLTable_cpc[] = {
|
|
|
|
{&DIID_HTMLTableEvents},
|
|
|
|
HTMLELEMENT_CPC,
|
|
|
|
{NULL}
|
|
|
|
};
|
|
|
|
|
2007-11-30 13:29:02 +01:00
|
|
|
static const NodeImplVtbl HTMLTableImplVtbl = {
|
|
|
|
HTMLTable_QI,
|
2012-06-27 10:56:30 +02:00
|
|
|
HTMLElement_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLTable_cpc,
|
2010-11-14 14:41:39 +01:00
|
|
|
HTMLElement_clone,
|
2012-09-04 13:58:58 +02:00
|
|
|
HTMLElement_handle_event,
|
2014-09-25 12:11:42 +02:00
|
|
|
HTMLElement_get_attr_col,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLTable_traverse,
|
|
|
|
HTMLTable_unlink
|
2007-11-30 13:29:02 +01:00
|
|
|
};
|
|
|
|
|
2008-09-30 17:40:58 +02:00
|
|
|
static const tid_t HTMLTable_iface_tids[] = {
|
2010-01-28 02:09:02 +01:00
|
|
|
HTMLELEMENT_TIDS,
|
2008-09-30 17:40:58 +02:00
|
|
|
IHTMLTable_tid,
|
2014-07-14 11:57:36 +02:00
|
|
|
IHTMLTable2_tid,
|
|
|
|
IHTMLTable3_tid,
|
2008-09-30 17:40:58 +02:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
static dispex_static_data_t HTMLTable_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLTable_tid,
|
2016-07-07 12:50:18 +02:00
|
|
|
HTMLTable_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
2008-09-30 17:40:58 +02:00
|
|
|
};
|
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
HRESULT HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
2007-11-30 13:29:02 +01:00
|
|
|
{
|
2010-12-01 22:43:14 +01:00
|
|
|
HTMLTable *ret;
|
2008-09-30 17:45:25 +02:00
|
|
|
nsresult nsres;
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
ret = heap_alloc_zero(sizeof(HTMLTable));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2007-11-30 13:29:02 +01:00
|
|
|
ret->element.node.vtbl = &HTMLTableImplVtbl;
|
2011-01-04 01:51:47 +01:00
|
|
|
ret->IHTMLTable_iface.lpVtbl = &HTMLTableVtbl;
|
2014-07-15 15:05:47 +02:00
|
|
|
ret->IHTMLTable2_iface.lpVtbl = &HTMLTable2Vtbl;
|
|
|
|
ret->IHTMLTable3_iface.lpVtbl = &HTMLTable3Vtbl;
|
2007-11-30 13:29:02 +01:00
|
|
|
|
2012-06-27 10:56:30 +02:00
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
|
|
|
|
|
2008-09-30 17:45:25 +02:00
|
|
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
|
2014-09-25 12:11:42 +02:00
|
|
|
assert(nsres == NS_OK);
|
2012-06-27 10:56:30 +02:00
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
2007-11-30 13:29:02 +01:00
|
|
|
}
|