1*c2c66affSColin Finck /*
2*c2c66affSColin Finck * Copyright 2012 Jacek Caban for CodeWeavers
3*c2c66affSColin Finck *
4*c2c66affSColin Finck * This library is free software; you can redistribute it and/or
5*c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
6*c2c66affSColin Finck * License as published by the Free Software Foundation; either
7*c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
8*c2c66affSColin Finck *
9*c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
10*c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
11*c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12*c2c66affSColin Finck * Lesser General Public License for more details.
13*c2c66affSColin Finck *
14*c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
15*c2c66affSColin Finck * License along with this library; if not, write to the Free Software
16*c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17*c2c66affSColin Finck */
18*c2c66affSColin Finck
19*c2c66affSColin Finck #include "mshtml_private.h"
20*c2c66affSColin Finck
21*c2c66affSColin Finck typedef struct {
22*c2c66affSColin Finck HTMLElement element;
23*c2c66affSColin Finck
24*c2c66affSColin Finck IHTMLTableCell IHTMLTableCell_iface;
25*c2c66affSColin Finck
26*c2c66affSColin Finck nsIDOMHTMLTableCellElement *nscell;
27*c2c66affSColin Finck } HTMLTableCell;
28*c2c66affSColin Finck
impl_from_IHTMLTableCell(IHTMLTableCell * iface)29*c2c66affSColin Finck static inline HTMLTableCell *impl_from_IHTMLTableCell(IHTMLTableCell *iface)
30*c2c66affSColin Finck {
31*c2c66affSColin Finck return CONTAINING_RECORD(iface, HTMLTableCell, IHTMLTableCell_iface);
32*c2c66affSColin Finck }
33*c2c66affSColin Finck
HTMLTableCell_QueryInterface(IHTMLTableCell * iface,REFIID riid,void ** ppv)34*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_QueryInterface(IHTMLTableCell *iface, REFIID riid, void **ppv)
35*c2c66affSColin Finck {
36*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
37*c2c66affSColin Finck
38*c2c66affSColin Finck return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
39*c2c66affSColin Finck }
40*c2c66affSColin Finck
HTMLTableCell_AddRef(IHTMLTableCell * iface)41*c2c66affSColin Finck static ULONG WINAPI HTMLTableCell_AddRef(IHTMLTableCell *iface)
42*c2c66affSColin Finck {
43*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
44*c2c66affSColin Finck
45*c2c66affSColin Finck return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
46*c2c66affSColin Finck }
47*c2c66affSColin Finck
HTMLTableCell_Release(IHTMLTableCell * iface)48*c2c66affSColin Finck static ULONG WINAPI HTMLTableCell_Release(IHTMLTableCell *iface)
49*c2c66affSColin Finck {
50*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
51*c2c66affSColin Finck
52*c2c66affSColin Finck return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
53*c2c66affSColin Finck }
54*c2c66affSColin Finck
HTMLTableCell_GetTypeInfoCount(IHTMLTableCell * iface,UINT * pctinfo)55*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_GetTypeInfoCount(IHTMLTableCell *iface, UINT *pctinfo)
56*c2c66affSColin Finck {
57*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
58*c2c66affSColin Finck return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
59*c2c66affSColin Finck }
60*c2c66affSColin Finck
HTMLTableCell_GetTypeInfo(IHTMLTableCell * iface,UINT iTInfo,LCID lcid,ITypeInfo ** ppTInfo)61*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_GetTypeInfo(IHTMLTableCell *iface, UINT iTInfo,
62*c2c66affSColin Finck LCID lcid, ITypeInfo **ppTInfo)
63*c2c66affSColin Finck {
64*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
65*c2c66affSColin Finck return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
66*c2c66affSColin Finck ppTInfo);
67*c2c66affSColin Finck }
68*c2c66affSColin Finck
HTMLTableCell_GetIDsOfNames(IHTMLTableCell * iface,REFIID riid,LPOLESTR * rgszNames,UINT cNames,LCID lcid,DISPID * rgDispId)69*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_GetIDsOfNames(IHTMLTableCell *iface, REFIID riid,
70*c2c66affSColin Finck LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
71*c2c66affSColin Finck {
72*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
73*c2c66affSColin Finck return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
74*c2c66affSColin Finck cNames, lcid, rgDispId);
75*c2c66affSColin Finck }
76*c2c66affSColin Finck
HTMLTableCell_Invoke(IHTMLTableCell * iface,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS * pDispParams,VARIANT * pVarResult,EXCEPINFO * pExcepInfo,UINT * puArgErr)77*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_Invoke(IHTMLTableCell *iface, DISPID dispIdMember, REFIID riid,
78*c2c66affSColin Finck LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
79*c2c66affSColin Finck UINT *puArgErr)
80*c2c66affSColin Finck {
81*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
82*c2c66affSColin Finck return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
83*c2c66affSColin Finck lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
84*c2c66affSColin Finck }
85*c2c66affSColin Finck
HTMLTableCell_put_rowSpan(IHTMLTableCell * iface,LONG v)86*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_rowSpan(IHTMLTableCell *iface, LONG v)
87*c2c66affSColin Finck {
88*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
89*c2c66affSColin Finck FIXME("(%p)->(%d)\n", This, v);
90*c2c66affSColin Finck return E_NOTIMPL;
91*c2c66affSColin Finck }
92*c2c66affSColin Finck
HTMLTableCell_get_rowSpan(IHTMLTableCell * iface,LONG * p)93*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_rowSpan(IHTMLTableCell *iface, LONG *p)
94*c2c66affSColin Finck {
95*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
96*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
97*c2c66affSColin Finck return E_NOTIMPL;
98*c2c66affSColin Finck }
99*c2c66affSColin Finck
HTMLTableCell_put_colSpan(IHTMLTableCell * iface,LONG v)100*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_colSpan(IHTMLTableCell *iface, LONG v)
101*c2c66affSColin Finck {
102*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
103*c2c66affSColin Finck FIXME("(%p)->(%d)\n", This, v);
104*c2c66affSColin Finck return E_NOTIMPL;
105*c2c66affSColin Finck }
106*c2c66affSColin Finck
HTMLTableCell_get_colSpan(IHTMLTableCell * iface,LONG * p)107*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_colSpan(IHTMLTableCell *iface, LONG *p)
108*c2c66affSColin Finck {
109*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
110*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
111*c2c66affSColin Finck return E_NOTIMPL;
112*c2c66affSColin Finck }
113*c2c66affSColin Finck
HTMLTableCell_put_align(IHTMLTableCell * iface,BSTR v)114*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_align(IHTMLTableCell *iface, BSTR v)
115*c2c66affSColin Finck {
116*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
117*c2c66affSColin Finck nsAString str;
118*c2c66affSColin Finck nsresult nsres;
119*c2c66affSColin Finck
120*c2c66affSColin Finck TRACE("(%p)->(%s)\n", This, debugstr_w(v));
121*c2c66affSColin Finck
122*c2c66affSColin Finck nsAString_InitDepend(&str, v);
123*c2c66affSColin Finck nsres = nsIDOMHTMLTableCellElement_SetAlign(This->nscell, &str);
124*c2c66affSColin Finck nsAString_Finish(&str);
125*c2c66affSColin Finck if (NS_FAILED(nsres)) {
126*c2c66affSColin Finck ERR("Set Align failed: %08x\n", nsres);
127*c2c66affSColin Finck return E_FAIL;
128*c2c66affSColin Finck }
129*c2c66affSColin Finck return S_OK;
130*c2c66affSColin Finck }
131*c2c66affSColin Finck
HTMLTableCell_get_align(IHTMLTableCell * iface,BSTR * p)132*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_align(IHTMLTableCell *iface, BSTR *p)
133*c2c66affSColin Finck {
134*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
135*c2c66affSColin Finck nsAString str;
136*c2c66affSColin Finck nsresult nsres;
137*c2c66affSColin Finck
138*c2c66affSColin Finck TRACE("(%p)->(%p)\n", This, p);
139*c2c66affSColin Finck
140*c2c66affSColin Finck nsAString_Init(&str, NULL);
141*c2c66affSColin Finck nsres = nsIDOMHTMLTableCellElement_GetAlign(This->nscell, &str);
142*c2c66affSColin Finck
143*c2c66affSColin Finck return return_nsstr(nsres, &str, p);
144*c2c66affSColin Finck }
145*c2c66affSColin Finck
HTMLTableCell_put_vAlign(IHTMLTableCell * iface,BSTR v)146*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_vAlign(IHTMLTableCell *iface, BSTR v)
147*c2c66affSColin Finck {
148*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
149*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_w(v));
150*c2c66affSColin Finck return E_NOTIMPL;
151*c2c66affSColin Finck }
152*c2c66affSColin Finck
HTMLTableCell_get_vAlign(IHTMLTableCell * iface,BSTR * p)153*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_vAlign(IHTMLTableCell *iface, BSTR *p)
154*c2c66affSColin Finck {
155*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
156*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
157*c2c66affSColin Finck return E_NOTIMPL;
158*c2c66affSColin Finck }
159*c2c66affSColin Finck
HTMLTableCell_put_bgColor(IHTMLTableCell * iface,VARIANT v)160*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_bgColor(IHTMLTableCell *iface, VARIANT v)
161*c2c66affSColin Finck {
162*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
163*c2c66affSColin Finck nsAString strColor;
164*c2c66affSColin Finck nsresult nsres;
165*c2c66affSColin Finck
166*c2c66affSColin Finck TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
167*c2c66affSColin Finck
168*c2c66affSColin Finck if(!variant_to_nscolor(&v, &strColor))
169*c2c66affSColin Finck return S_OK;
170*c2c66affSColin Finck
171*c2c66affSColin Finck nsres = nsIDOMHTMLTableCellElement_SetBgColor(This->nscell, &strColor);
172*c2c66affSColin Finck nsAString_Finish(&strColor);
173*c2c66affSColin Finck if(NS_FAILED(nsres)) {
174*c2c66affSColin Finck ERR("SetBgColor(%s) failed: %08x\n", debugstr_variant(&v), nsres);
175*c2c66affSColin Finck return E_FAIL;
176*c2c66affSColin Finck }
177*c2c66affSColin Finck
178*c2c66affSColin Finck return S_OK;
179*c2c66affSColin Finck }
180*c2c66affSColin Finck
HTMLTableCell_get_bgColor(IHTMLTableCell * iface,VARIANT * p)181*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_bgColor(IHTMLTableCell *iface, VARIANT *p)
182*c2c66affSColin Finck {
183*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
184*c2c66affSColin Finck nsAString strColor;
185*c2c66affSColin Finck nsresult nsres;
186*c2c66affSColin Finck HRESULT hres;
187*c2c66affSColin Finck
188*c2c66affSColin Finck TRACE("(%p)->(%p)\n", This, p);
189*c2c66affSColin Finck
190*c2c66affSColin Finck nsAString_Init(&strColor, NULL);
191*c2c66affSColin Finck nsres = nsIDOMHTMLTableCellElement_GetBgColor(This->nscell, &strColor);
192*c2c66affSColin Finck
193*c2c66affSColin Finck if(NS_SUCCEEDED(nsres)) {
194*c2c66affSColin Finck const PRUnichar *color;
195*c2c66affSColin Finck nsAString_GetData(&strColor, &color);
196*c2c66affSColin Finck V_VT(p) = VT_BSTR;
197*c2c66affSColin Finck hres = nscolor_to_str(color, &V_BSTR(p));
198*c2c66affSColin Finck }else {
199*c2c66affSColin Finck ERR("GetBgColor failed: %08x\n", nsres);
200*c2c66affSColin Finck hres = E_FAIL;
201*c2c66affSColin Finck }
202*c2c66affSColin Finck nsAString_Finish(&strColor);
203*c2c66affSColin Finck return hres;
204*c2c66affSColin Finck }
205*c2c66affSColin Finck
HTMLTableCell_put_noWrap(IHTMLTableCell * iface,VARIANT_BOOL v)206*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_noWrap(IHTMLTableCell *iface, VARIANT_BOOL v)
207*c2c66affSColin Finck {
208*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
209*c2c66affSColin Finck FIXME("(%p)->(%x)\n", This, v);
210*c2c66affSColin Finck return E_NOTIMPL;
211*c2c66affSColin Finck }
212*c2c66affSColin Finck
HTMLTableCell_get_noWrap(IHTMLTableCell * iface,VARIANT_BOOL * p)213*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_noWrap(IHTMLTableCell *iface, VARIANT_BOOL *p)
214*c2c66affSColin Finck {
215*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
216*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
217*c2c66affSColin Finck return E_NOTIMPL;
218*c2c66affSColin Finck }
219*c2c66affSColin Finck
HTMLTableCell_put_background(IHTMLTableCell * iface,BSTR v)220*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_background(IHTMLTableCell *iface, BSTR v)
221*c2c66affSColin Finck {
222*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
223*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_w(v));
224*c2c66affSColin Finck return E_NOTIMPL;
225*c2c66affSColin Finck }
226*c2c66affSColin Finck
HTMLTableCell_get_background(IHTMLTableCell * iface,BSTR * p)227*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_background(IHTMLTableCell *iface, BSTR *p)
228*c2c66affSColin Finck {
229*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
230*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
231*c2c66affSColin Finck return E_NOTIMPL;
232*c2c66affSColin Finck }
233*c2c66affSColin Finck
HTMLTableCell_put_borderColor(IHTMLTableCell * iface,VARIANT v)234*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_borderColor(IHTMLTableCell *iface, VARIANT v)
235*c2c66affSColin Finck {
236*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
237*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
238*c2c66affSColin Finck return E_NOTIMPL;
239*c2c66affSColin Finck }
240*c2c66affSColin Finck
HTMLTableCell_get_borderColor(IHTMLTableCell * iface,VARIANT * p)241*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_borderColor(IHTMLTableCell *iface, VARIANT *p)
242*c2c66affSColin Finck {
243*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
244*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
245*c2c66affSColin Finck return E_NOTIMPL;
246*c2c66affSColin Finck }
247*c2c66affSColin Finck
HTMLTableCell_put_borderColorLight(IHTMLTableCell * iface,VARIANT v)248*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_borderColorLight(IHTMLTableCell *iface, VARIANT v)
249*c2c66affSColin Finck {
250*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
251*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
252*c2c66affSColin Finck return E_NOTIMPL;
253*c2c66affSColin Finck }
254*c2c66affSColin Finck
HTMLTableCell_get_borderColorLight(IHTMLTableCell * iface,VARIANT * p)255*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_borderColorLight(IHTMLTableCell *iface, VARIANT *p)
256*c2c66affSColin Finck {
257*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
258*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
259*c2c66affSColin Finck return E_NOTIMPL;
260*c2c66affSColin Finck }
261*c2c66affSColin Finck
HTMLTableCell_put_borderColorDark(IHTMLTableCell * iface,VARIANT v)262*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_borderColorDark(IHTMLTableCell *iface, VARIANT v)
263*c2c66affSColin Finck {
264*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
265*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
266*c2c66affSColin Finck return E_NOTIMPL;
267*c2c66affSColin Finck }
268*c2c66affSColin Finck
HTMLTableCell_get_borderColorDark(IHTMLTableCell * iface,VARIANT * p)269*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_borderColorDark(IHTMLTableCell *iface, VARIANT *p)
270*c2c66affSColin Finck {
271*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
272*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
273*c2c66affSColin Finck return E_NOTIMPL;
274*c2c66affSColin Finck }
275*c2c66affSColin Finck
HTMLTableCell_put_width(IHTMLTableCell * iface,VARIANT v)276*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_width(IHTMLTableCell *iface, VARIANT v)
277*c2c66affSColin Finck {
278*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
279*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
280*c2c66affSColin Finck return E_NOTIMPL;
281*c2c66affSColin Finck }
282*c2c66affSColin Finck
HTMLTableCell_get_width(IHTMLTableCell * iface,VARIANT * p)283*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_width(IHTMLTableCell *iface, VARIANT *p)
284*c2c66affSColin Finck {
285*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
286*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
287*c2c66affSColin Finck return E_NOTIMPL;
288*c2c66affSColin Finck }
289*c2c66affSColin Finck
HTMLTableCell_put_height(IHTMLTableCell * iface,VARIANT v)290*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_put_height(IHTMLTableCell *iface, VARIANT v)
291*c2c66affSColin Finck {
292*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
293*c2c66affSColin Finck FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
294*c2c66affSColin Finck return E_NOTIMPL;
295*c2c66affSColin Finck }
296*c2c66affSColin Finck
HTMLTableCell_get_height(IHTMLTableCell * iface,VARIANT * p)297*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_height(IHTMLTableCell *iface, VARIANT *p)
298*c2c66affSColin Finck {
299*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
300*c2c66affSColin Finck FIXME("(%p)->(%p)\n", This, p);
301*c2c66affSColin Finck return E_NOTIMPL;
302*c2c66affSColin Finck }
303*c2c66affSColin Finck
HTMLTableCell_get_cellIndex(IHTMLTableCell * iface,LONG * p)304*c2c66affSColin Finck static HRESULT WINAPI HTMLTableCell_get_cellIndex(IHTMLTableCell *iface, LONG *p)
305*c2c66affSColin Finck {
306*c2c66affSColin Finck HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
307*c2c66affSColin Finck nsresult nsres;
308*c2c66affSColin Finck
309*c2c66affSColin Finck TRACE("(%p)->(%p)\n", This, p);
310*c2c66affSColin Finck nsres = nsIDOMHTMLTableCellElement_GetCellIndex(This->nscell, p);
311*c2c66affSColin Finck if (NS_FAILED(nsres)) {
312*c2c66affSColin Finck ERR("Get CellIndex failed: %08x\n", nsres);
313*c2c66affSColin Finck return E_FAIL;
314*c2c66affSColin Finck }
315*c2c66affSColin Finck
316*c2c66affSColin Finck return S_OK;
317*c2c66affSColin Finck }
318*c2c66affSColin Finck
319*c2c66affSColin Finck static const IHTMLTableCellVtbl HTMLTableCellVtbl = {
320*c2c66affSColin Finck HTMLTableCell_QueryInterface,
321*c2c66affSColin Finck HTMLTableCell_AddRef,
322*c2c66affSColin Finck HTMLTableCell_Release,
323*c2c66affSColin Finck HTMLTableCell_GetTypeInfoCount,
324*c2c66affSColin Finck HTMLTableCell_GetTypeInfo,
325*c2c66affSColin Finck HTMLTableCell_GetIDsOfNames,
326*c2c66affSColin Finck HTMLTableCell_Invoke,
327*c2c66affSColin Finck HTMLTableCell_put_rowSpan,
328*c2c66affSColin Finck HTMLTableCell_get_rowSpan,
329*c2c66affSColin Finck HTMLTableCell_put_colSpan,
330*c2c66affSColin Finck HTMLTableCell_get_colSpan,
331*c2c66affSColin Finck HTMLTableCell_put_align,
332*c2c66affSColin Finck HTMLTableCell_get_align,
333*c2c66affSColin Finck HTMLTableCell_put_vAlign,
334*c2c66affSColin Finck HTMLTableCell_get_vAlign,
335*c2c66affSColin Finck HTMLTableCell_put_bgColor,
336*c2c66affSColin Finck HTMLTableCell_get_bgColor,
337*c2c66affSColin Finck HTMLTableCell_put_noWrap,
338*c2c66affSColin Finck HTMLTableCell_get_noWrap,
339*c2c66affSColin Finck HTMLTableCell_put_background,
340*c2c66affSColin Finck HTMLTableCell_get_background,
341*c2c66affSColin Finck HTMLTableCell_put_borderColor,
342*c2c66affSColin Finck HTMLTableCell_get_borderColor,
343*c2c66affSColin Finck HTMLTableCell_put_borderColorLight,
344*c2c66affSColin Finck HTMLTableCell_get_borderColorLight,
345*c2c66affSColin Finck HTMLTableCell_put_borderColorDark,
346*c2c66affSColin Finck HTMLTableCell_get_borderColorDark,
347*c2c66affSColin Finck HTMLTableCell_put_width,
348*c2c66affSColin Finck HTMLTableCell_get_width,
349*c2c66affSColin Finck HTMLTableCell_put_height,
350*c2c66affSColin Finck HTMLTableCell_get_height,
351*c2c66affSColin Finck HTMLTableCell_get_cellIndex
352*c2c66affSColin Finck };
353*c2c66affSColin Finck
impl_from_HTMLDOMNode(HTMLDOMNode * iface)354*c2c66affSColin Finck static inline HTMLTableCell *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
355*c2c66affSColin Finck {
356*c2c66affSColin Finck return CONTAINING_RECORD(iface, HTMLTableCell, element.node);
357*c2c66affSColin Finck }
358*c2c66affSColin Finck
HTMLTableCell_QI(HTMLDOMNode * iface,REFIID riid,void ** ppv)359*c2c66affSColin Finck static HRESULT HTMLTableCell_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
360*c2c66affSColin Finck {
361*c2c66affSColin Finck HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
362*c2c66affSColin Finck
363*c2c66affSColin Finck if(IsEqualGUID(&IID_IUnknown, riid)) {
364*c2c66affSColin Finck TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
365*c2c66affSColin Finck *ppv = &This->IHTMLTableCell_iface;
366*c2c66affSColin Finck }else if(IsEqualGUID(&IID_IDispatch, riid)) {
367*c2c66affSColin Finck TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
368*c2c66affSColin Finck *ppv = &This->IHTMLTableCell_iface;
369*c2c66affSColin Finck }else if(IsEqualGUID(&IID_IHTMLTableCell, riid)) {
370*c2c66affSColin Finck TRACE("(%p)->(IID_IHTMLTableCell %p)\n", This, ppv);
371*c2c66affSColin Finck *ppv = &This->IHTMLTableCell_iface;
372*c2c66affSColin Finck }else {
373*c2c66affSColin Finck return HTMLElement_QI(&This->element.node, riid, ppv);
374*c2c66affSColin Finck }
375*c2c66affSColin Finck
376*c2c66affSColin Finck IUnknown_AddRef((IUnknown*)*ppv);
377*c2c66affSColin Finck return S_OK;
378*c2c66affSColin Finck }
379*c2c66affSColin Finck
HTMLTableCell_destructor(HTMLDOMNode * iface)380*c2c66affSColin Finck static void HTMLTableCell_destructor(HTMLDOMNode *iface)
381*c2c66affSColin Finck {
382*c2c66affSColin Finck HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
383*c2c66affSColin Finck
384*c2c66affSColin Finck HTMLElement_destructor(&This->element.node);
385*c2c66affSColin Finck }
386*c2c66affSColin Finck
HTMLTableCell_traverse(HTMLDOMNode * iface,nsCycleCollectionTraversalCallback * cb)387*c2c66affSColin Finck static void HTMLTableCell_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
388*c2c66affSColin Finck {
389*c2c66affSColin Finck HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
390*c2c66affSColin Finck
391*c2c66affSColin Finck if(This->nscell)
392*c2c66affSColin Finck note_cc_edge((nsISupports*)This->nscell, "This->nstablecell", cb);
393*c2c66affSColin Finck }
394*c2c66affSColin Finck
HTMLTableCell_unlink(HTMLDOMNode * iface)395*c2c66affSColin Finck static void HTMLTableCell_unlink(HTMLDOMNode *iface)
396*c2c66affSColin Finck {
397*c2c66affSColin Finck HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
398*c2c66affSColin Finck
399*c2c66affSColin Finck if(This->nscell) {
400*c2c66affSColin Finck nsIDOMHTMLTableCellElement *nscell = This->nscell;
401*c2c66affSColin Finck
402*c2c66affSColin Finck This->nscell = NULL;
403*c2c66affSColin Finck nsIDOMHTMLTableCellElement_Release(nscell);
404*c2c66affSColin Finck }
405*c2c66affSColin Finck }
406*c2c66affSColin Finck
407*c2c66affSColin Finck static const NodeImplVtbl HTMLTableCellImplVtbl = {
408*c2c66affSColin Finck HTMLTableCell_QI,
409*c2c66affSColin Finck HTMLTableCell_destructor,
410*c2c66affSColin Finck HTMLElement_cpc,
411*c2c66affSColin Finck HTMLElement_clone,
412*c2c66affSColin Finck HTMLElement_handle_event,
413*c2c66affSColin Finck HTMLElement_get_attr_col,
414*c2c66affSColin Finck NULL,
415*c2c66affSColin Finck NULL,
416*c2c66affSColin Finck NULL,
417*c2c66affSColin Finck NULL,
418*c2c66affSColin Finck NULL,
419*c2c66affSColin Finck NULL,
420*c2c66affSColin Finck NULL,
421*c2c66affSColin Finck NULL,
422*c2c66affSColin Finck NULL,
423*c2c66affSColin Finck HTMLTableCell_traverse,
424*c2c66affSColin Finck HTMLTableCell_unlink
425*c2c66affSColin Finck };
426*c2c66affSColin Finck
427*c2c66affSColin Finck static const tid_t HTMLTableCell_iface_tids[] = {
428*c2c66affSColin Finck HTMLELEMENT_TIDS,
429*c2c66affSColin Finck IHTMLTableCell_tid,
430*c2c66affSColin Finck 0
431*c2c66affSColin Finck };
432*c2c66affSColin Finck
433*c2c66affSColin Finck static dispex_static_data_t HTMLTableCell_dispex = {
434*c2c66affSColin Finck NULL,
435*c2c66affSColin Finck DispHTMLTableCell_tid,
436*c2c66affSColin Finck NULL,
437*c2c66affSColin Finck HTMLTableCell_iface_tids
438*c2c66affSColin Finck };
439*c2c66affSColin Finck
HTMLTableCell_Create(HTMLDocumentNode * doc,nsIDOMHTMLElement * nselem,HTMLElement ** elem)440*c2c66affSColin Finck HRESULT HTMLTableCell_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
441*c2c66affSColin Finck {
442*c2c66affSColin Finck HTMLTableCell *ret;
443*c2c66affSColin Finck nsresult nsres;
444*c2c66affSColin Finck
445*c2c66affSColin Finck ret = heap_alloc_zero(sizeof(*ret));
446*c2c66affSColin Finck if(!ret)
447*c2c66affSColin Finck return E_OUTOFMEMORY;
448*c2c66affSColin Finck
449*c2c66affSColin Finck ret->IHTMLTableCell_iface.lpVtbl = &HTMLTableCellVtbl;
450*c2c66affSColin Finck ret->element.node.vtbl = &HTMLTableCellImplVtbl;
451*c2c66affSColin Finck
452*c2c66affSColin Finck HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableCell_dispex);
453*c2c66affSColin Finck
454*c2c66affSColin Finck nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableCellElement, (void**)&ret->nscell);
455*c2c66affSColin Finck assert(nsres == NS_OK);
456*c2c66affSColin Finck
457*c2c66affSColin Finck *elem = &ret->element;
458*c2c66affSColin Finck return S_OK;
459*c2c66affSColin Finck }
460