2 * Copyright 2008 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 const IHTMLTableRowVtbl *lpHTMLTableRowVtbl;
39 nsIDOMHTMLTableRowElement *nsrow;
42 #define HTMLTABLEROW(x) (&(x)->lpHTMLTableRowVtbl)
44 #define HTMLTABLEROW_THIS(iface) DEFINE_THIS(HTMLTableRow, HTMLTableRow, iface)
46 static HRESULT WINAPI HTMLTableRow_QueryInterface(IHTMLTableRow *iface,
47 REFIID riid, void **ppv)
49 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
51 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
54 static ULONG WINAPI HTMLTableRow_AddRef(IHTMLTableRow *iface)
56 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
58 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
61 static ULONG WINAPI HTMLTableRow_Release(IHTMLTableRow *iface)
63 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
65 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
68 static HRESULT WINAPI HTMLTableRow_GetTypeInfoCount(IHTMLTableRow *iface, UINT *pctinfo)
70 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
71 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
74 static HRESULT WINAPI HTMLTableRow_GetTypeInfo(IHTMLTableRow *iface, UINT iTInfo,
75 LCID lcid, ITypeInfo **ppTInfo)
77 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
78 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
81 static HRESULT WINAPI HTMLTableRow_GetIDsOfNames(IHTMLTableRow *iface, REFIID riid,
82 LPOLESTR *rgszNames, UINT cNames,
83 LCID lcid, DISPID *rgDispId)
85 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
86 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
89 static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMember,
90 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
91 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
93 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
94 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
95 pVarResult, pExcepInfo, puArgErr);
98 static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
100 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
101 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
105 static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
107 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
108 FIXME("(%p)->(%p)\n", This, p);
112 static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
114 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
115 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
119 static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
121 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
122 FIXME("(%p)->(%p)\n", This, p);
126 static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v)
128 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
129 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
133 static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p)
135 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
136 FIXME("(%p)->(%p)\n", This, p);
140 static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v)
142 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
143 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
147 static HRESULT WINAPI HTMLTableRow_get_borderColor(IHTMLTableRow *iface, VARIANT *p)
149 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, p);
154 static HRESULT WINAPI HTMLTableRow_put_borderColorLight(IHTMLTableRow *iface, VARIANT v)
156 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
157 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
161 static HRESULT WINAPI HTMLTableRow_get_borderColorLight(IHTMLTableRow *iface, VARIANT *p)
163 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
164 FIXME("(%p)->(%p)\n", This, p);
168 static HRESULT WINAPI HTMLTableRow_put_borderColorDark(IHTMLTableRow *iface, VARIANT v)
170 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
171 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
175 static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VARIANT *p)
177 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
178 FIXME("(%p)->(%p)\n", This, p);
182 static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p)
184 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
185 FIXME("(%p)->(%p)\n", This, p);
189 static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p)
191 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
192 FIXME("(%p)->(%p)\n", This, p);
196 static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p)
198 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
199 nsIDOMHTMLCollection *nscol;
202 TRACE("(%p)->(%p)\n", This, p);
204 nsres = nsIDOMHTMLTableRowElement_GetCells(This->nsrow, &nscol);
205 if(NS_FAILED(nsres)) {
206 ERR("GetCells failed: %08x\n", nsres);
210 *p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)HTMLTABLEROW(This), nscol);
212 nsIDOMHTMLCollection_Release(nscol);
216 static HRESULT WINAPI HTMLTableRow_insertCell(IHTMLTableRow *iface, LONG index, IDispatch **row)
218 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
219 FIXME("(%p)->(%d %p)\n", This, index, row);
223 static HRESULT WINAPI HTMLTableRow_deleteCell(IHTMLTableRow *iface, LONG index)
225 HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
226 FIXME("(%p)->(%d)\n", This, index);
230 #undef HTMLTABLEROW_THIS
232 static const IHTMLTableRowVtbl HTMLTableRowVtbl = {
233 HTMLTableRow_QueryInterface,
235 HTMLTableRow_Release,
236 HTMLTableRow_GetTypeInfoCount,
237 HTMLTableRow_GetTypeInfo,
238 HTMLTableRow_GetIDsOfNames,
240 HTMLTableRow_put_align,
241 HTMLTableRow_get_align,
242 HTMLTableRow_put_vAlign,
243 HTMLTableRow_get_vAlign,
244 HTMLTableRow_put_bgColor,
245 HTMLTableRow_get_bgColor,
246 HTMLTableRow_put_borderColor,
247 HTMLTableRow_get_borderColor,
248 HTMLTableRow_put_borderColorLight,
249 HTMLTableRow_get_borderColorLight,
250 HTMLTableRow_put_borderColorDark,
251 HTMLTableRow_get_borderColorDark,
252 HTMLTableRow_get_rowIndex,
253 HTMLTableRow_get_selectionRowIndex,
254 HTMLTableRow_get_cells,
255 HTMLTableRow_insertCell,
256 HTMLTableRow_deleteCell
259 #define HTMLTABLEROW_NODE_THIS(iface) DEFINE_THIS2(HTMLTableRow, element.node, iface)
261 static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
263 HTMLTableRow *This = HTMLTABLEROW_NODE_THIS(iface);
267 if(IsEqualGUID(&IID_IUnknown, riid)) {
268 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
269 *ppv = HTMLTABLEROW(This);
270 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
271 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
272 *ppv = HTMLTABLEROW(This);
273 }else if(IsEqualGUID(&IID_IHTMLTableRow, riid)) {
274 TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This, ppv);
275 *ppv = HTMLTABLEROW(This);
279 IUnknown_AddRef((IUnknown*)*ppv);
283 return HTMLElement_QI(&This->element.node, riid, ppv);
286 static void HTMLTableRow_destructor(HTMLDOMNode *iface)
288 HTMLTableRow *This = HTMLTABLEROW_NODE_THIS(iface);
291 nsIDOMHTMLTableRowElement_Release(This->nsrow);
293 HTMLElement_destructor(&This->element.node);
296 #undef HTMLTABLEROW_NODE_THIS
298 static const NodeImplVtbl HTMLTableRowImplVtbl = {
300 HTMLTableRow_destructor
303 static const tid_t HTMLTableRow_iface_tids[] = {
313 static dispex_static_data_t HTMLTableRow_dispex = {
315 DispHTMLTableRow_tid,
317 HTMLTableRow_iface_tids
320 HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem)
322 HTMLTableRow *ret = heap_alloc_zero(sizeof(HTMLTableRow));
325 ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl;
326 ret->element.node.vtbl = &HTMLTableRowImplVtbl;
328 init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLTABLEROW(ret), &HTMLTableRow_dispex);
329 HTMLElement_Init(&ret->element);
331 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
333 ERR("Could not get nsIDOMHTMLTableRowElement iface: %08x\n", nsres);
335 return &ret->element;