ole32: Don't store file size in FileLockBytesImpl.
[wine/multimedia.git] / dlls / mshtml / htmltablecell.c
blob7b8d2fc1acd705ed85b0267ef5bac3417c6a2b80
1 /*
2 * Copyright 2012 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
19 #include <stdarg.h>
20 #include <assert.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 typedef struct {
36 HTMLElement element;
38 IHTMLTableCell IHTMLTableCell_iface;
40 nsIDOMHTMLTableCellElement *nscell;
41 } HTMLTableCell;
43 static inline HTMLTableCell *impl_from_IHTMLTableCell(IHTMLTableCell *iface)
45 return CONTAINING_RECORD(iface, HTMLTableCell, IHTMLTableCell_iface);
48 static HRESULT WINAPI HTMLTableCell_QueryInterface(IHTMLTableCell *iface, REFIID riid, void **ppv)
50 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
52 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
55 static ULONG WINAPI HTMLTableCell_AddRef(IHTMLTableCell *iface)
57 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
59 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
62 static ULONG WINAPI HTMLTableCell_Release(IHTMLTableCell *iface)
64 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
66 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
69 static HRESULT WINAPI HTMLTableCell_GetTypeInfoCount(IHTMLTableCell *iface, UINT *pctinfo)
71 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
72 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
75 static HRESULT WINAPI HTMLTableCell_GetTypeInfo(IHTMLTableCell *iface, UINT iTInfo,
76 LCID lcid, ITypeInfo **ppTInfo)
78 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
79 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
80 ppTInfo);
83 static HRESULT WINAPI HTMLTableCell_GetIDsOfNames(IHTMLTableCell *iface, REFIID riid,
84 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
86 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
87 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
88 cNames, lcid, rgDispId);
91 static HRESULT WINAPI HTMLTableCell_Invoke(IHTMLTableCell *iface, DISPID dispIdMember, REFIID riid,
92 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
93 UINT *puArgErr)
95 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
96 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
97 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
100 static HRESULT WINAPI HTMLTableCell_put_rowSpan(IHTMLTableCell *iface, LONG v)
102 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
103 FIXME("(%p)->(%d)\n", This, v);
104 return E_NOTIMPL;
107 static HRESULT WINAPI HTMLTableCell_get_rowSpan(IHTMLTableCell *iface, LONG *p)
109 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
110 FIXME("(%p)->(%p)\n", This, p);
111 return E_NOTIMPL;
114 static HRESULT WINAPI HTMLTableCell_put_colSpan(IHTMLTableCell *iface, LONG v)
116 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
117 FIXME("(%p)->(%d)\n", This, v);
118 return E_NOTIMPL;
121 static HRESULT WINAPI HTMLTableCell_get_colSpan(IHTMLTableCell *iface, LONG *p)
123 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
124 FIXME("(%p)->(%p)\n", This, p);
125 return E_NOTIMPL;
128 static HRESULT WINAPI HTMLTableCell_put_align(IHTMLTableCell *iface, BSTR v)
130 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
131 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
132 return E_NOTIMPL;
135 static HRESULT WINAPI HTMLTableCell_get_align(IHTMLTableCell *iface, BSTR *p)
137 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
138 FIXME("(%p)->(%p)\n", This, p);
139 return E_NOTIMPL;
142 static HRESULT WINAPI HTMLTableCell_put_vAlign(IHTMLTableCell *iface, BSTR v)
144 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
145 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
146 return E_NOTIMPL;
149 static HRESULT WINAPI HTMLTableCell_get_vAlign(IHTMLTableCell *iface, BSTR *p)
151 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
152 FIXME("(%p)->(%p)\n", This, p);
153 return E_NOTIMPL;
156 static HRESULT WINAPI HTMLTableCell_put_bgColor(IHTMLTableCell *iface, VARIANT v)
158 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
159 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
160 return E_NOTIMPL;
163 static HRESULT WINAPI HTMLTableCell_get_bgColor(IHTMLTableCell *iface, VARIANT *p)
165 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
166 FIXME("(%p)->(%p)\n", This, p);
167 return E_NOTIMPL;
170 static HRESULT WINAPI HTMLTableCell_put_noWrap(IHTMLTableCell *iface, VARIANT_BOOL v)
172 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
173 FIXME("(%p)->(%x)\n", This, v);
174 return E_NOTIMPL;
177 static HRESULT WINAPI HTMLTableCell_get_noWrap(IHTMLTableCell *iface, VARIANT_BOOL *p)
179 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
180 FIXME("(%p)->(%p)\n", This, p);
181 return E_NOTIMPL;
184 static HRESULT WINAPI HTMLTableCell_put_background(IHTMLTableCell *iface, BSTR v)
186 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
187 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
188 return E_NOTIMPL;
191 static HRESULT WINAPI HTMLTableCell_get_background(IHTMLTableCell *iface, BSTR *p)
193 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
194 FIXME("(%p)->(%p)\n", This, p);
195 return E_NOTIMPL;
198 static HRESULT WINAPI HTMLTableCell_put_borderColor(IHTMLTableCell *iface, VARIANT v)
200 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
201 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
202 return E_NOTIMPL;
205 static HRESULT WINAPI HTMLTableCell_get_borderColor(IHTMLTableCell *iface, VARIANT *p)
207 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
208 FIXME("(%p)->(%p)\n", This, p);
209 return E_NOTIMPL;
212 static HRESULT WINAPI HTMLTableCell_put_borderColorLight(IHTMLTableCell *iface, VARIANT v)
214 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
215 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
216 return E_NOTIMPL;
219 static HRESULT WINAPI HTMLTableCell_get_borderColorLight(IHTMLTableCell *iface, VARIANT *p)
221 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
222 FIXME("(%p)->(%p)\n", This, p);
223 return E_NOTIMPL;
226 static HRESULT WINAPI HTMLTableCell_put_borderColorDark(IHTMLTableCell *iface, VARIANT v)
228 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
229 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
230 return E_NOTIMPL;
233 static HRESULT WINAPI HTMLTableCell_get_borderColorDark(IHTMLTableCell *iface, VARIANT *p)
235 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
236 FIXME("(%p)->(%p)\n", This, p);
237 return E_NOTIMPL;
240 static HRESULT WINAPI HTMLTableCell_put_width(IHTMLTableCell *iface, VARIANT v)
242 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
243 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
244 return E_NOTIMPL;
247 static HRESULT WINAPI HTMLTableCell_get_width(IHTMLTableCell *iface, VARIANT *p)
249 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
250 FIXME("(%p)->(%p)\n", This, p);
251 return E_NOTIMPL;
254 static HRESULT WINAPI HTMLTableCell_put_height(IHTMLTableCell *iface, VARIANT v)
256 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
257 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
258 return E_NOTIMPL;
261 static HRESULT WINAPI HTMLTableCell_get_height(IHTMLTableCell *iface, VARIANT *p)
263 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
264 FIXME("(%p)->(%p)\n", This, p);
265 return E_NOTIMPL;
268 static HRESULT WINAPI HTMLTableCell_get_cellIndex(IHTMLTableCell *iface, LONG *p)
270 HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
271 FIXME("(%p)->(%p)\n", This, p);
272 return E_NOTIMPL;
275 static const IHTMLTableCellVtbl HTMLTableCellVtbl = {
276 HTMLTableCell_QueryInterface,
277 HTMLTableCell_AddRef,
278 HTMLTableCell_Release,
279 HTMLTableCell_GetTypeInfoCount,
280 HTMLTableCell_GetTypeInfo,
281 HTMLTableCell_GetIDsOfNames,
282 HTMLTableCell_Invoke,
283 HTMLTableCell_put_rowSpan,
284 HTMLTableCell_get_rowSpan,
285 HTMLTableCell_put_colSpan,
286 HTMLTableCell_get_colSpan,
287 HTMLTableCell_put_align,
288 HTMLTableCell_get_align,
289 HTMLTableCell_put_vAlign,
290 HTMLTableCell_get_vAlign,
291 HTMLTableCell_put_bgColor,
292 HTMLTableCell_get_bgColor,
293 HTMLTableCell_put_noWrap,
294 HTMLTableCell_get_noWrap,
295 HTMLTableCell_put_background,
296 HTMLTableCell_get_background,
297 HTMLTableCell_put_borderColor,
298 HTMLTableCell_get_borderColor,
299 HTMLTableCell_put_borderColorLight,
300 HTMLTableCell_get_borderColorLight,
301 HTMLTableCell_put_borderColorDark,
302 HTMLTableCell_get_borderColorDark,
303 HTMLTableCell_put_width,
304 HTMLTableCell_get_width,
305 HTMLTableCell_put_height,
306 HTMLTableCell_get_height,
307 HTMLTableCell_get_cellIndex
310 static inline HTMLTableCell *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
312 return CONTAINING_RECORD(iface, HTMLTableCell, element.node);
315 static HRESULT HTMLTableCell_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
317 HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
319 if(IsEqualGUID(&IID_IUnknown, riid)) {
320 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
321 *ppv = &This->IHTMLTableCell_iface;
322 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
323 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
324 *ppv = &This->IHTMLTableCell_iface;
325 }else if(IsEqualGUID(&IID_IHTMLTableCell, riid)) {
326 TRACE("(%p)->(IID_IHTMLTableCell %p)\n", This, ppv);
327 *ppv = &This->IHTMLTableCell_iface;
328 }else {
329 return HTMLElement_QI(&This->element.node, riid, ppv);
332 IUnknown_AddRef((IUnknown*)*ppv);
333 return S_OK;
336 static void HTMLTableCell_destructor(HTMLDOMNode *iface)
338 HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
340 HTMLElement_destructor(&This->element.node);
343 static const NodeImplVtbl HTMLTableCellImplVtbl = {
344 HTMLTableCell_QI,
345 HTMLTableCell_destructor,
346 HTMLElement_cpc,
347 HTMLElement_clone,
348 HTMLElement_handle_event,
349 HTMLElement_get_attr_col
352 static const tid_t HTMLTableCell_iface_tids[] = {
353 HTMLELEMENT_TIDS,
354 IHTMLTableCell_tid,
358 static dispex_static_data_t HTMLTableCell_dispex = {
359 NULL,
360 DispHTMLTableCell_tid,
361 NULL,
362 HTMLTableCell_iface_tids
365 HRESULT HTMLTableCell_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
367 HTMLTableCell *ret;
368 nsresult nsres;
370 ret = heap_alloc_zero(sizeof(*ret));
371 if(!ret)
372 return E_OUTOFMEMORY;
374 ret->IHTMLTableCell_iface.lpVtbl = &HTMLTableCellVtbl;
375 ret->element.node.vtbl = &HTMLTableCellImplVtbl;
377 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableCell_dispex);
379 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableCellElement, (void**)&ret->nscell);
381 /* Share nscell reference with nsnode */
382 assert(nsres == NS_OK && (nsIDOMNode*)ret->nscell == ret->element.node.nsnode);
383 nsIDOMNode_Release(ret->element.node.nsnode);
385 *elem = &ret->element;
386 return S_OK;