2008-09-30 17:40:19 +02: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>
|
2012-06-28 11:19:41 +02:00
|
|
|
#include <assert.h>
|
2008-09-30 17:40:19 +02: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);
|
|
|
|
|
2017-04-20 16:09:14 +02:00
|
|
|
struct HTMLTableRow {
|
2008-09-30 17:40:19 +02:00
|
|
|
HTMLElement element;
|
|
|
|
|
2010-12-06 23:32:02 +01:00
|
|
|
IHTMLTableRow IHTMLTableRow_iface;
|
2008-09-30 17:46:02 +02:00
|
|
|
|
|
|
|
nsIDOMHTMLTableRowElement *nsrow;
|
2017-04-20 16:09:14 +02:00
|
|
|
};
|
2008-09-30 17:40:19 +02:00
|
|
|
|
2010-12-06 23:32:02 +01:00
|
|
|
static inline HTMLTableRow *impl_from_IHTMLTableRow(IHTMLTableRow *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTableRow, IHTMLTableRow_iface);
|
|
|
|
}
|
2008-09-30 17:40:19 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_QueryInterface(IHTMLTableRow *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTableRow_AddRef(IHTMLTableRow *iface)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTableRow_Release(IHTMLTableRow *iface)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_GetTypeInfoCount(IHTMLTableRow *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_GetTypeInfo(IHTMLTableRow *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(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);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_GetIDsOfNames(IHTMLTableRow *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(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);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(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);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-12 06:11:32 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&val, v);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_SetAlign(This->nsrow, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Set Align(%s) failed!\n", debugstr_w(v));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-12 06:11:32 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&val, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_GetAlign(This->nsrow, &val);
|
|
|
|
|
|
|
|
return return_nsstr(nsres, &val, p);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-13 09:27:32 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&val, v);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_SetVAlign(This->nsrow, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Set VAlign(%s) failed!\n", debugstr_w(v));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-13 09:27:32 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&val, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_GetVAlign(This->nsrow, &val);
|
|
|
|
|
|
|
|
return return_nsstr(nsres, &val, p);
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-26 08:06:39 +01:00
|
|
|
nsAString val;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
2014-05-03 11:40:17 +02:00
|
|
|
if (!variant_to_nscolor(&v, &val))
|
|
|
|
return S_OK;
|
|
|
|
|
2014-03-26 08:06:39 +01:00
|
|
|
nsres = nsIDOMHTMLTableRowElement_SetBgColor(This->nsrow, &val);
|
|
|
|
nsAString_Finish(&val);
|
|
|
|
|
|
|
|
if (NS_FAILED(nsres)){
|
|
|
|
ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-26 08:06:39 +01:00
|
|
|
nsAString strColor;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
const PRUnichar *color;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&strColor, NULL);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_GetBgColor(This->nsrow, &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;
|
|
|
|
}
|
|
|
|
|
2014-04-06 16:44:39 +02:00
|
|
|
nsAString_Finish(&strColor);
|
2014-03-26 08:06:39 +01:00
|
|
|
return hres;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_borderColor(IHTMLTableRow *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_put_borderColorLight(IHTMLTableRow *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_borderColorLight(IHTMLTableRow *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_put_borderColorDark(IHTMLTableRow *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p)
|
2008-09-30 17:40:19 +02:00
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-15 04:23:10 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_GetRowIndex(This->nsrow, p);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Get rowIndex failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
2014-03-18 06:14:07 +01:00
|
|
|
static HRESULT WINAPI HTMLTableRow_get_sectionRowIndex(IHTMLTableRow *iface, LONG *p)
|
2008-09-30 17:40:19 +02:00
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-03-18 06:14:07 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_GetSectionRowIndex(This->nsrow, p);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Get selectionRowIndex failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2008-09-30 17:46:02 +02:00
|
|
|
nsIDOMHTMLCollection *nscol;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_GetCells(This->nsrow, &nscol);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetCells 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:46:02 +02:00
|
|
|
|
|
|
|
nsIDOMHTMLCollection_Release(nscol);
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTableRow_insertCell(IHTMLTableRow *iface, LONG index, IDispatch **row)
|
2008-09-30 17:40:19 +02:00
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-05-26 16:12:50 +02:00
|
|
|
nsIDOMHTMLElement *nselem;
|
|
|
|
HTMLElement *elem;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %p)\n", This, index, row);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_InsertCell(This->nsrow, index, &nselem);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Insert Cell at %d failed: %08x\n", index, nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = HTMLTableCell_Create(This->element.node.doc, nselem, &elem);
|
|
|
|
nsIDOMHTMLElement_Release(nselem);
|
|
|
|
if (FAILED(hres)) {
|
|
|
|
ERR("Create TableCell failed: %08x\n", hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
*row = (IDispatch *)&elem->IHTMLElement_iface;
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLTableRow_deleteCell(IHTMLTableRow *iface, LONG index)
|
2008-09-30 17:40:19 +02:00
|
|
|
{
|
2010-12-06 23:32:02 +01:00
|
|
|
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
2014-05-18 10:24:23 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, index);
|
|
|
|
nsres = nsIDOMHTMLTableRowElement_DeleteCell(This->nsrow, index);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Delete Cell failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLTableRowVtbl HTMLTableRowVtbl = {
|
|
|
|
HTMLTableRow_QueryInterface,
|
|
|
|
HTMLTableRow_AddRef,
|
|
|
|
HTMLTableRow_Release,
|
|
|
|
HTMLTableRow_GetTypeInfoCount,
|
|
|
|
HTMLTableRow_GetTypeInfo,
|
|
|
|
HTMLTableRow_GetIDsOfNames,
|
|
|
|
HTMLTableRow_Invoke,
|
|
|
|
HTMLTableRow_put_align,
|
|
|
|
HTMLTableRow_get_align,
|
|
|
|
HTMLTableRow_put_vAlign,
|
|
|
|
HTMLTableRow_get_vAlign,
|
|
|
|
HTMLTableRow_put_bgColor,
|
|
|
|
HTMLTableRow_get_bgColor,
|
|
|
|
HTMLTableRow_put_borderColor,
|
|
|
|
HTMLTableRow_get_borderColor,
|
|
|
|
HTMLTableRow_put_borderColorLight,
|
|
|
|
HTMLTableRow_get_borderColorLight,
|
|
|
|
HTMLTableRow_put_borderColorDark,
|
|
|
|
HTMLTableRow_get_borderColorDark,
|
|
|
|
HTMLTableRow_get_rowIndex,
|
2014-03-18 06:14:07 +01:00
|
|
|
HTMLTableRow_get_sectionRowIndex,
|
2008-09-30 17:40:19 +02:00
|
|
|
HTMLTableRow_get_cells,
|
|
|
|
HTMLTableRow_insertCell,
|
|
|
|
HTMLTableRow_deleteCell
|
|
|
|
};
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLTableRow *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLTableRow, element.node);
|
|
|
|
}
|
2008-09-30 17:40:19 +02:00
|
|
|
|
|
|
|
static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
|
2008-09-30 17:40:19 +02:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2010-12-06 23:32:02 +01:00
|
|
|
*ppv = &This->IHTMLTableRow_iface;
|
2008-09-30 17:40:19 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
2010-12-06 23:32:02 +01:00
|
|
|
*ppv = &This->IHTMLTableRow_iface;
|
2008-09-30 17:40:19 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLTableRow, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This, ppv);
|
2010-12-06 23:32:02 +01:00
|
|
|
*ppv = &This->IHTMLTableRow_iface;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
2014-09-26 15:11:40 +02:00
|
|
|
static void HTMLTableRow_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
|
|
|
{
|
|
|
|
HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsrow)
|
|
|
|
note_cc_edge((nsISupports*)This->nsrow, "This->nstablerow", cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLTableRow_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsrow) {
|
|
|
|
nsIDOMHTMLTableRowElement *nsrow = This->nsrow;
|
|
|
|
|
|
|
|
This->nsrow = NULL;
|
|
|
|
nsIDOMHTMLTableRowElement_Release(nsrow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-30 17:40:19 +02:00
|
|
|
static const NodeImplVtbl HTMLTableRowImplVtbl = {
|
2017-04-21 13:50:49 +02:00
|
|
|
&CLSID_HTMLTableRow,
|
2008-09-30 17:40:19 +02:00
|
|
|
HTMLTableRow_QI,
|
2012-06-28 11:19:41 +02:00
|
|
|
HTMLElement_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLElement_cpc,
|
2011-08-25 15:23:35 +02:00
|
|
|
HTMLElement_clone,
|
2012-09-04 13:58:58 +02:00
|
|
|
HTMLElement_handle_event,
|
2014-09-26 15:11:40 +02:00
|
|
|
HTMLElement_get_attr_col,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLTableRow_traverse,
|
|
|
|
HTMLTableRow_unlink
|
2008-09-30 17:40:19 +02:00
|
|
|
};
|
|
|
|
|
2008-09-30 17:42:34 +02:00
|
|
|
static const tid_t HTMLTableRow_iface_tids[] = {
|
2010-01-28 02:09:02 +01:00
|
|
|
HTMLELEMENT_TIDS,
|
2008-09-30 17:42:34 +02:00
|
|
|
IHTMLTableRow_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
static dispex_static_data_t HTMLTableRow_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLTableRow_tid,
|
2016-07-07 12:50:18 +02:00
|
|
|
HTMLTableRow_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
2008-09-30 17:42:34 +02:00
|
|
|
};
|
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
HRESULT HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
2008-09-30 17:40:19 +02:00
|
|
|
{
|
2010-12-01 22:43:14 +01:00
|
|
|
HTMLTableRow *ret;
|
2008-09-30 17:46:02 +02:00
|
|
|
nsresult nsres;
|
2008-09-30 17:40:19 +02:00
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
ret = heap_alloc_zero(sizeof(HTMLTableRow));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-06 23:32:02 +01:00
|
|
|
ret->IHTMLTableRow_iface.lpVtbl = &HTMLTableRowVtbl;
|
2008-09-30 17:40:19 +02:00
|
|
|
ret->element.node.vtbl = &HTMLTableRowImplVtbl;
|
|
|
|
|
2012-06-28 11:19:41 +02:00
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableRow_dispex);
|
|
|
|
|
2008-09-30 17:46:02 +02:00
|
|
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
|
2014-09-26 15:11:40 +02:00
|
|
|
assert(nsres == NS_OK);
|
2008-09-30 17:46:02 +02:00
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
2008-09-30 17:40:19 +02:00
|
|
|
}
|