comctl32/tests: Make impl_from_IStream() static.
[wine/multimedia.git] / dlls / mshtml / htmltable.c
blob7490d986fa2a77e78353081547a5636bbcaea7af
1 /*
2 * Copyright 2007 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>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34 struct HTMLTable {
35 HTMLElement element;
37 IHTMLTable IHTMLTable_iface;
38 IHTMLTable2 IHTMLTable2_iface;
39 IHTMLTable3 IHTMLTable3_iface;
41 ConnectionPoint cp;
42 nsIDOMHTMLTableElement *nstable;
45 static inline HTMLTable *impl_from_IHTMLTable(IHTMLTable *iface)
47 return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable_iface);
50 static inline HTMLTable *impl_from_IHTMLTable2(IHTMLTable2 *iface)
52 return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable2_iface);
55 static inline HTMLTable *impl_from_IHTMLTable3(IHTMLTable3 *iface)
57 return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable3_iface);
60 static HRESULT WINAPI HTMLTable_QueryInterface(IHTMLTable *iface,
61 REFIID riid, void **ppv)
63 HTMLTable *This = impl_from_IHTMLTable(iface);
65 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
68 static ULONG WINAPI HTMLTable_AddRef(IHTMLTable *iface)
70 HTMLTable *This = impl_from_IHTMLTable(iface);
72 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
75 static ULONG WINAPI HTMLTable_Release(IHTMLTable *iface)
77 HTMLTable *This = impl_from_IHTMLTable(iface);
79 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
82 static HRESULT WINAPI HTMLTable_GetTypeInfoCount(IHTMLTable *iface, UINT *pctinfo)
84 HTMLTable *This = impl_from_IHTMLTable(iface);
85 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
88 static HRESULT WINAPI HTMLTable_GetTypeInfo(IHTMLTable *iface, UINT iTInfo,
89 LCID lcid, ITypeInfo **ppTInfo)
91 HTMLTable *This = impl_from_IHTMLTable(iface);
92 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
93 ppTInfo);
96 static HRESULT WINAPI HTMLTable_GetIDsOfNames(IHTMLTable *iface, REFIID riid,
97 LPOLESTR *rgszNames, UINT cNames,
98 LCID lcid, DISPID *rgDispId)
100 HTMLTable *This = impl_from_IHTMLTable(iface);
101 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
102 cNames, lcid, rgDispId);
105 static HRESULT WINAPI HTMLTable_Invoke(IHTMLTable *iface, DISPID dispIdMember,
106 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
107 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
109 HTMLTable *This = impl_from_IHTMLTable(iface);
110 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
111 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
114 static HRESULT WINAPI HTMLTable_put_cols(IHTMLTable *iface, LONG v)
116 HTMLTable *This = impl_from_IHTMLTable(iface);
117 FIXME("(%p)->(%d)\n", This, v);
118 return E_NOTIMPL;
121 static HRESULT WINAPI HTMLTable_get_cols(IHTMLTable *iface, LONG *p)
123 HTMLTable *This = impl_from_IHTMLTable(iface);
124 FIXME("(%p)->(%p)\n", This, p);
125 return E_NOTIMPL;
128 static HRESULT WINAPI HTMLTable_put_border(IHTMLTable *iface, VARIANT v)
130 HTMLTable *This = impl_from_IHTMLTable(iface);
131 FIXME("(%p)->(v)\n", This);
132 return E_NOTIMPL;
135 static HRESULT WINAPI HTMLTable_get_border(IHTMLTable *iface, VARIANT *p)
137 HTMLTable *This = impl_from_IHTMLTable(iface);
138 FIXME("(%p)->(%p)\n", This, p);
139 return E_NOTIMPL;
142 static HRESULT WINAPI HTMLTable_put_frame(IHTMLTable *iface, BSTR v)
144 HTMLTable *This = impl_from_IHTMLTable(iface);
145 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
146 return E_NOTIMPL;
149 static HRESULT WINAPI HTMLTable_get_frame(IHTMLTable *iface, BSTR *p)
151 HTMLTable *This = impl_from_IHTMLTable(iface);
152 FIXME("(%p)->(%p)\n", This, p);
153 return E_NOTIMPL;
156 static HRESULT WINAPI HTMLTable_put_rules(IHTMLTable *iface, BSTR v)
158 HTMLTable *This = impl_from_IHTMLTable(iface);
159 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
160 return E_NOTIMPL;
163 static HRESULT WINAPI HTMLTable_get_rules(IHTMLTable *iface, BSTR *p)
165 HTMLTable *This = impl_from_IHTMLTable(iface);
166 FIXME("(%p)->(%p)\n", This, p);
167 return E_NOTIMPL;
170 static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v)
172 HTMLTable *This = impl_from_IHTMLTable(iface);
173 FIXME("(%p)->(v)\n", This);
174 return E_NOTIMPL;
177 static HRESULT WINAPI HTMLTable_get_cellSpacing(IHTMLTable *iface, VARIANT *p)
179 HTMLTable *This = impl_from_IHTMLTable(iface);
180 FIXME("(%p)->(%p)\n", This, p);
181 return E_NOTIMPL;
184 static HRESULT WINAPI HTMLTable_put_cellPadding(IHTMLTable *iface, VARIANT v)
186 HTMLTable *This = impl_from_IHTMLTable(iface);
187 FIXME("(%p)->(v)\n", This);
188 return E_NOTIMPL;
191 static HRESULT WINAPI HTMLTable_get_cellPadding(IHTMLTable *iface, VARIANT *p)
193 HTMLTable *This = impl_from_IHTMLTable(iface);
194 FIXME("(%p)->(%p)\n", This, p);
195 return E_NOTIMPL;
198 static HRESULT WINAPI HTMLTable_put_background(IHTMLTable *iface, BSTR v)
200 HTMLTable *This = impl_from_IHTMLTable(iface);
201 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
202 return E_NOTIMPL;
205 static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
207 HTMLTable *This = impl_from_IHTMLTable(iface);
208 FIXME("(%p)->(%p)\n", This, p);
209 return E_NOTIMPL;
212 static HRESULT WINAPI HTMLTable_put_bgColor(IHTMLTable *iface, VARIANT v)
214 HTMLTable *This = impl_from_IHTMLTable(iface);
215 FIXME("(%p)->(v)\n", This);
216 return E_NOTIMPL;
219 static HRESULT WINAPI HTMLTable_get_bgColor(IHTMLTable *iface, VARIANT *p)
221 HTMLTable *This = impl_from_IHTMLTable(iface);
222 FIXME("(%p)->(%p)\n", This, p);
223 return E_NOTIMPL;
226 static HRESULT WINAPI HTMLTable_put_borderColor(IHTMLTable *iface, VARIANT v)
228 HTMLTable *This = impl_from_IHTMLTable(iface);
229 FIXME("(%p)->(v)\n", This);
230 return E_NOTIMPL;
233 static HRESULT WINAPI HTMLTable_get_borderColor(IHTMLTable *iface, VARIANT *p)
235 HTMLTable *This = impl_from_IHTMLTable(iface);
236 FIXME("(%p)->(%p)\n", This, p);
237 return E_NOTIMPL;
240 static HRESULT WINAPI HTMLTable_put_borderColorLight(IHTMLTable *iface, VARIANT v)
242 HTMLTable *This = impl_from_IHTMLTable(iface);
243 FIXME("(%p)->(v)\n", This);
244 return E_NOTIMPL;
247 static HRESULT WINAPI HTMLTable_get_borderColorLight(IHTMLTable *iface, VARIANT *p)
249 HTMLTable *This = impl_from_IHTMLTable(iface);
250 FIXME("(%p)->(%p)\n", This, p);
251 return E_NOTIMPL;
254 static HRESULT WINAPI HTMLTable_put_borderColorDark(IHTMLTable *iface, VARIANT v)
256 HTMLTable *This = impl_from_IHTMLTable(iface);
257 FIXME("(%p)->(v)\n", This);
258 return E_NOTIMPL;
261 static HRESULT WINAPI HTMLTable_get_borderColorDark(IHTMLTable *iface, VARIANT *p)
263 HTMLTable *This = impl_from_IHTMLTable(iface);
264 FIXME("(%p)->(%p)\n", This, p);
265 return E_NOTIMPL;
268 static HRESULT WINAPI HTMLTable_put_align(IHTMLTable *iface, BSTR v)
270 HTMLTable *This = impl_from_IHTMLTable(iface);
271 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
272 return E_NOTIMPL;
275 static HRESULT WINAPI HTMLTable_get_align(IHTMLTable *iface, BSTR *p)
277 HTMLTable *This = impl_from_IHTMLTable(iface);
278 FIXME("(%p)->(%p)\n", This, p);
279 return E_NOTIMPL;
282 static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
284 HTMLTable *This = impl_from_IHTMLTable(iface);
285 FIXME("(%p)\n", This);
286 return E_NOTIMPL;
289 static HRESULT WINAPI HTMLTable_get_rows(IHTMLTable *iface, IHTMLElementCollection **p)
291 HTMLTable *This = impl_from_IHTMLTable(iface);
292 nsIDOMHTMLCollection *nscol;
293 nsresult nsres;
295 TRACE("(%p)->(%p)\n", This, p);
297 nsres = nsIDOMHTMLTableElement_GetRows(This->nstable, &nscol);
298 if(NS_FAILED(nsres)) {
299 ERR("GetRows failed: %08x\n", nsres);
300 return E_FAIL;
303 *p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)&This->IHTMLTable_iface,
304 nscol);
306 nsIDOMHTMLCollection_Release(nscol);
307 return S_OK;
310 static HRESULT WINAPI HTMLTable_put_width(IHTMLTable *iface, VARIANT v)
312 HTMLTable *This = impl_from_IHTMLTable(iface);
313 FIXME("(%p)->(v)\n", This);
314 return E_NOTIMPL;
317 static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p)
319 HTMLTable *This = impl_from_IHTMLTable(iface);
320 FIXME("(%p)->(%p)\n", This, p);
321 return E_NOTIMPL;
324 static HRESULT WINAPI HTMLTable_put_height(IHTMLTable *iface, VARIANT v)
326 HTMLTable *This = impl_from_IHTMLTable(iface);
327 FIXME("(%p)->(v)\n", This);
328 return E_NOTIMPL;
331 static HRESULT WINAPI HTMLTable_get_height(IHTMLTable *iface, VARIANT *p)
333 HTMLTable *This = impl_from_IHTMLTable(iface);
334 FIXME("(%p)->(%p)\n", This, p);
335 return E_NOTIMPL;
338 static HRESULT WINAPI HTMLTable_put_dataPageSize(IHTMLTable *iface, LONG v)
340 HTMLTable *This = impl_from_IHTMLTable(iface);
341 FIXME("(%p)->(%d)\n", This, v);
342 return E_NOTIMPL;
345 static HRESULT WINAPI HTMLTable_get_dataPageSize(IHTMLTable *iface, LONG *p)
347 HTMLTable *This = impl_from_IHTMLTable(iface);
348 FIXME("(%p)->(%p)\n", This, p);
349 return E_NOTIMPL;
352 static HRESULT WINAPI HTMLTable_nextPage(IHTMLTable *iface)
354 HTMLTable *This = impl_from_IHTMLTable(iface);
355 FIXME("(%p)\n", This);
356 return E_NOTIMPL;
359 static HRESULT WINAPI HTMLTable_previousPage(IHTMLTable *iface)
361 HTMLTable *This = impl_from_IHTMLTable(iface);
362 FIXME("(%p)\n", This);
363 return E_NOTIMPL;
366 static HRESULT WINAPI HTMLTable_get_tHead(IHTMLTable *iface, IHTMLTableSection **p)
368 HTMLTable *This = impl_from_IHTMLTable(iface);
369 FIXME("(%p)->(%p)\n", This, p);
370 return E_NOTIMPL;
373 static HRESULT WINAPI HTMLTable_get_tFoot(IHTMLTable *iface, IHTMLTableSection **p)
375 HTMLTable *This = impl_from_IHTMLTable(iface);
376 FIXME("(%p)->(%p)\n", This, p);
377 return E_NOTIMPL;
380 static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementCollection **p)
382 HTMLTable *This = impl_from_IHTMLTable(iface);
383 FIXME("(%p)->(%p)\n", This, p);
384 return E_NOTIMPL;
387 static HRESULT WINAPI HTMLTable_get_caption(IHTMLTable *iface, IHTMLTableCaption **p)
389 HTMLTable *This = impl_from_IHTMLTable(iface);
390 FIXME("(%p)->(%p)\n", This, p);
391 return E_NOTIMPL;
394 static HRESULT WINAPI HTMLTable_createTHead(IHTMLTable *iface, IDispatch **head)
396 HTMLTable *This = impl_from_IHTMLTable(iface);
397 FIXME("(%p)->(%p)\n", This, head);
398 return E_NOTIMPL;
401 static HRESULT WINAPI HTMLTable_deleteTHead(IHTMLTable *iface)
403 HTMLTable *This = impl_from_IHTMLTable(iface);
404 FIXME("(%p)\n", This);
405 return E_NOTIMPL;
408 static HRESULT WINAPI HTMLTable_createTFoot(IHTMLTable *iface, IDispatch **foot)
410 HTMLTable *This = impl_from_IHTMLTable(iface);
411 FIXME("(%p)->(%p)\n", This, foot);
412 return E_NOTIMPL;
415 static HRESULT WINAPI HTMLTable_deleteTFoot(IHTMLTable *iface)
417 HTMLTable *This = impl_from_IHTMLTable(iface);
418 FIXME("(%p)\n", This);
419 return E_NOTIMPL;
422 static HRESULT WINAPI HTMLTable_createCaption(IHTMLTable *iface, IHTMLTableCaption **caption)
424 HTMLTable *This = impl_from_IHTMLTable(iface);
425 FIXME("(%p)->(%p)\n", This, caption);
426 return E_NOTIMPL;
429 static HRESULT WINAPI HTMLTable_deleteCaption(IHTMLTable *iface)
431 HTMLTable *This = impl_from_IHTMLTable(iface);
432 FIXME("(%p)\n", This);
433 return E_NOTIMPL;
436 static HRESULT WINAPI HTMLTable_insertRow(IHTMLTable *iface, LONG index, IDispatch **row)
438 HTMLTable *This = impl_from_IHTMLTable(iface);
439 FIXME("(%p)->(%d %p)\n", This, index, row);
440 return E_NOTIMPL;
443 static HRESULT WINAPI HTMLTable_deleteRow(IHTMLTable *iface, LONG index)
445 HTMLTable *This = impl_from_IHTMLTable(iface);
446 FIXME("(%p)->(%d)\n", This, index);
447 return E_NOTIMPL;
450 static HRESULT WINAPI HTMLTable_get_readyState(IHTMLTable *iface, BSTR *p)
452 HTMLTable *This = impl_from_IHTMLTable(iface);
453 FIXME("(%p)->(%p)\n", This, p);
454 return E_NOTIMPL;
457 static HRESULT WINAPI HTMLTable_put_onreadystatechange(IHTMLTable *iface, VARIANT v)
459 HTMLTable *This = impl_from_IHTMLTable(iface);
460 FIXME("(%p)->(v)\n", This);
461 return E_NOTIMPL;
464 static HRESULT WINAPI HTMLTable_get_onreadystatechange(IHTMLTable *iface, VARIANT *p)
466 HTMLTable *This = impl_from_IHTMLTable(iface);
467 FIXME("(%p)->(%p)\n", This, p);
468 return E_NOTIMPL;
471 static const IHTMLTableVtbl HTMLTableVtbl = {
472 HTMLTable_QueryInterface,
473 HTMLTable_AddRef,
474 HTMLTable_Release,
475 HTMLTable_GetTypeInfoCount,
476 HTMLTable_GetTypeInfo,
477 HTMLTable_GetIDsOfNames,
478 HTMLTable_Invoke,
479 HTMLTable_put_cols,
480 HTMLTable_get_cols,
481 HTMLTable_put_border,
482 HTMLTable_get_border,
483 HTMLTable_put_frame,
484 HTMLTable_get_frame,
485 HTMLTable_put_rules,
486 HTMLTable_get_rules,
487 HTMLTable_put_cellSpacing,
488 HTMLTable_get_cellSpacing,
489 HTMLTable_put_cellPadding,
490 HTMLTable_get_cellPadding,
491 HTMLTable_put_background,
492 HTMLTable_get_background,
493 HTMLTable_put_bgColor,
494 HTMLTable_get_bgColor,
495 HTMLTable_put_borderColor,
496 HTMLTable_get_borderColor,
497 HTMLTable_put_borderColorLight,
498 HTMLTable_get_borderColorLight,
499 HTMLTable_put_borderColorDark,
500 HTMLTable_get_borderColorDark,
501 HTMLTable_put_align,
502 HTMLTable_get_align,
503 HTMLTable_refresh,
504 HTMLTable_get_rows,
505 HTMLTable_put_width,
506 HTMLTable_get_width,
507 HTMLTable_put_height,
508 HTMLTable_get_height,
509 HTMLTable_put_dataPageSize,
510 HTMLTable_get_dataPageSize,
511 HTMLTable_nextPage,
512 HTMLTable_previousPage,
513 HTMLTable_get_tHead,
514 HTMLTable_get_tFoot,
515 HTMLTable_get_tBodies,
516 HTMLTable_get_caption,
517 HTMLTable_createTHead,
518 HTMLTable_deleteTHead,
519 HTMLTable_createTFoot,
520 HTMLTable_deleteTFoot,
521 HTMLTable_createCaption,
522 HTMLTable_deleteCaption,
523 HTMLTable_insertRow,
524 HTMLTable_deleteRow,
525 HTMLTable_get_readyState,
526 HTMLTable_put_onreadystatechange,
527 HTMLTable_get_onreadystatechange
530 /* IHTMLTable2 */
531 static HRESULT WINAPI HTMLTable2_QueryInterface(IHTMLTable2 *iface,
532 REFIID riid, void **ppv)
534 HTMLTable *This = impl_from_IHTMLTable2(iface);
536 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
539 static ULONG WINAPI HTMLTable2_AddRef(IHTMLTable2 *iface)
541 HTMLTable *This = impl_from_IHTMLTable2(iface);
543 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
546 static ULONG WINAPI HTMLTable2_Release(IHTMLTable2 *iface)
548 HTMLTable *This = impl_from_IHTMLTable2(iface);
550 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
553 static HRESULT WINAPI HTMLTable2_GetTypeInfoCount(IHTMLTable2 *iface, UINT *pctinfo)
555 HTMLTable *This = impl_from_IHTMLTable2(iface);
556 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
559 static HRESULT WINAPI HTMLTable2_GetTypeInfo(IHTMLTable2 *iface, UINT iTInfo,
560 LCID lcid, ITypeInfo **ppTInfo)
562 HTMLTable *This = impl_from_IHTMLTable2(iface);
563 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
564 ppTInfo);
567 static HRESULT WINAPI HTMLTable2_GetIDsOfNames(IHTMLTable2 *iface, REFIID riid,
568 LPOLESTR *rgszNames, UINT cNames,
569 LCID lcid, DISPID *rgDispId)
571 HTMLTable *This = impl_from_IHTMLTable2(iface);
572 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
573 cNames, lcid, rgDispId);
576 static HRESULT WINAPI HTMLTable2_Invoke(IHTMLTable2 *iface, DISPID dispIdMember,
577 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
578 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
580 HTMLTable *This = impl_from_IHTMLTable2(iface);
581 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
582 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
585 static HRESULT WINAPI HTMLTable2_firstPage(IHTMLTable2 *iface)
587 HTMLTable *This = impl_from_IHTMLTable2(iface);
588 FIXME("(%p)->()\n", This);
589 return E_NOTIMPL;
592 static HRESULT WINAPI HTMLTable2_lastPage(IHTMLTable2 *iface)
594 HTMLTable *This = impl_from_IHTMLTable2(iface);
595 FIXME("(%p)->()\n", This);
596 return E_NOTIMPL;
599 static HRESULT WINAPI HTMLTable2_cells(IHTMLTable2 *iface, IHTMLElementCollection **p)
601 HTMLTable *This = impl_from_IHTMLTable2(iface);
602 FIXME("(%p)->(%p)\n", This, p);
603 return E_NOTIMPL;
606 static HRESULT WINAPI HTMLTable2_moveRow(IHTMLTable2 *iface, LONG indexFrom, LONG indexTo, IDispatch **row)
608 HTMLTable *This = impl_from_IHTMLTable2(iface);
609 FIXME("(%p)->(%d %d %p)\n", This, indexFrom, indexTo, row);
610 return E_NOTIMPL;
614 static const IHTMLTable2Vtbl HTMLTable2Vtbl = {
615 HTMLTable2_QueryInterface,
616 HTMLTable2_AddRef,
617 HTMLTable2_Release,
618 HTMLTable2_GetTypeInfoCount,
619 HTMLTable2_GetTypeInfo,
620 HTMLTable2_GetIDsOfNames,
621 HTMLTable2_Invoke,
622 HTMLTable2_firstPage,
623 HTMLTable2_lastPage,
624 HTMLTable2_cells,
625 HTMLTable2_moveRow
628 /* IHTMLTable3 */
629 static HRESULT WINAPI HTMLTable3_QueryInterface(IHTMLTable3 *iface,
630 REFIID riid, void **ppv)
632 HTMLTable *This = impl_from_IHTMLTable3(iface);
634 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
637 static ULONG WINAPI HTMLTable3_AddRef(IHTMLTable3 *iface)
639 HTMLTable *This = impl_from_IHTMLTable3(iface);
641 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
644 static ULONG WINAPI HTMLTable3_Release(IHTMLTable3 *iface)
646 HTMLTable *This = impl_from_IHTMLTable3(iface);
648 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
651 static HRESULT WINAPI HTMLTable3_GetTypeInfoCount(IHTMLTable3 *iface, UINT *pctinfo)
653 HTMLTable *This = impl_from_IHTMLTable3(iface);
654 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
657 static HRESULT WINAPI HTMLTable3_GetTypeInfo(IHTMLTable3 *iface, UINT iTInfo,
658 LCID lcid, ITypeInfo **ppTInfo)
660 HTMLTable *This = impl_from_IHTMLTable3(iface);
661 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
662 ppTInfo);
665 static HRESULT WINAPI HTMLTable3_GetIDsOfNames(IHTMLTable3 *iface, REFIID riid,
666 LPOLESTR *rgszNames, UINT cNames,
667 LCID lcid, DISPID *rgDispId)
669 HTMLTable *This = impl_from_IHTMLTable3(iface);
670 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
671 cNames, lcid, rgDispId);
674 static HRESULT WINAPI HTMLTable3_Invoke(IHTMLTable3 *iface, DISPID dispIdMember,
675 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
676 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
678 HTMLTable *This = impl_from_IHTMLTable3(iface);
679 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
680 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
683 static HRESULT WINAPI HTMLTable3_put_summary(IHTMLTable3 *iface, BSTR v)
685 HTMLTable *This = impl_from_IHTMLTable3(iface);
686 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
687 return E_NOTIMPL;
690 static HRESULT WINAPI HTMLTable3_get_summary(IHTMLTable3 *iface, BSTR * p)
692 HTMLTable *This = impl_from_IHTMLTable3(iface);
693 FIXME("(%p)->(%p)\n", This, p);
694 return E_NOTIMPL;
697 static const IHTMLTable3Vtbl HTMLTable3Vtbl = {
698 HTMLTable3_QueryInterface,
699 HTMLTable3_AddRef,
700 HTMLTable3_Release,
701 HTMLTable3_GetTypeInfoCount,
702 HTMLTable3_GetTypeInfo,
703 HTMLTable3_GetIDsOfNames,
704 HTMLTable3_Invoke,
705 HTMLTable3_put_summary,
706 HTMLTable3_get_summary
709 static inline HTMLTable *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
711 return CONTAINING_RECORD(iface, HTMLTable, element.node);
714 static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
716 HTMLTable *This = impl_from_HTMLDOMNode(iface);
718 *ppv = NULL;
720 if(IsEqualGUID(&IID_IUnknown, riid)) {
721 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
722 *ppv = &This->IHTMLTable_iface;
723 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
724 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
725 *ppv = &This->IHTMLTable_iface;
726 }else if(IsEqualGUID(&IID_IHTMLTable, riid)) {
727 TRACE("(%p)->(IID_IHTMLTable %p)\n", This, ppv);
728 *ppv = &This->IHTMLTable_iface;
729 }else if(IsEqualGUID(&IID_IHTMLTable2, riid)) {
730 TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This, ppv);
731 *ppv = &This->IHTMLTable_iface;
732 }else if(IsEqualGUID(&IID_IHTMLTable3, riid)) {
733 TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This, ppv);
734 *ppv = &This->IHTMLTable_iface;
737 if(*ppv) {
738 IUnknown_AddRef((IUnknown*)*ppv);
739 return S_OK;
742 return HTMLElement_QI(&This->element.node, riid, ppv);
745 static void HTMLTable_destructor(HTMLDOMNode *iface)
747 HTMLTable *This = impl_from_HTMLDOMNode(iface);
749 if(This->nstable)
750 nsIDOMHTMLTableElement_Release(This->nstable);
752 HTMLElement_destructor(&This->element.node);
755 static const NodeImplVtbl HTMLTableImplVtbl = {
756 HTMLTable_QI,
757 HTMLTable_destructor,
758 HTMLElement_clone,
759 HTMLElement_get_attr_col
762 static const tid_t HTMLTable_iface_tids[] = {
763 HTMLELEMENT_TIDS,
764 IHTMLTable_tid,
768 static dispex_static_data_t HTMLTable_dispex = {
769 NULL,
770 DispHTMLTable_tid,
771 NULL,
772 HTMLTable_iface_tids
775 HRESULT HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
777 HTMLTable *ret;
778 nsresult nsres;
780 ret = heap_alloc_zero(sizeof(HTMLTable));
781 if(!ret)
782 return E_OUTOFMEMORY;
784 ret->element.node.vtbl = &HTMLTableImplVtbl;
785 ret->IHTMLTable_iface.lpVtbl = &HTMLTableVtbl;
787 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
788 if(NS_FAILED(nsres)) {
789 ERR("Could not get nsIDOMHTMLTableElement iface: %08x\n", nsres);
790 heap_free(ret);
791 return E_FAIL;
794 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
795 ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents, NULL);
797 *elem = &ret->element;
798 return S_OK;