mshtml: Get rid of no longer needed unk_ref from HTMLElementCollection.
[wine/multimedia.git] / dlls / mshtml / htmltable.c
blob79223be7e7bfac3ac49a21ad1fa7b9997b691e71
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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, nscol);
305 nsIDOMHTMLCollection_Release(nscol);
306 return S_OK;
309 static HRESULT WINAPI HTMLTable_put_width(IHTMLTable *iface, VARIANT v)
311 HTMLTable *This = impl_from_IHTMLTable(iface);
312 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
313 return E_NOTIMPL;
316 static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p)
318 HTMLTable *This = impl_from_IHTMLTable(iface);
319 FIXME("(%p)->(%p)\n", This, p);
320 return E_NOTIMPL;
323 static HRESULT WINAPI HTMLTable_put_height(IHTMLTable *iface, VARIANT v)
325 HTMLTable *This = impl_from_IHTMLTable(iface);
326 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
327 return E_NOTIMPL;
330 static HRESULT WINAPI HTMLTable_get_height(IHTMLTable *iface, VARIANT *p)
332 HTMLTable *This = impl_from_IHTMLTable(iface);
333 FIXME("(%p)->(%p)\n", This, p);
334 return E_NOTIMPL;
337 static HRESULT WINAPI HTMLTable_put_dataPageSize(IHTMLTable *iface, LONG v)
339 HTMLTable *This = impl_from_IHTMLTable(iface);
340 FIXME("(%p)->(%d)\n", This, v);
341 return E_NOTIMPL;
344 static HRESULT WINAPI HTMLTable_get_dataPageSize(IHTMLTable *iface, LONG *p)
346 HTMLTable *This = impl_from_IHTMLTable(iface);
347 FIXME("(%p)->(%p)\n", This, p);
348 return E_NOTIMPL;
351 static HRESULT WINAPI HTMLTable_nextPage(IHTMLTable *iface)
353 HTMLTable *This = impl_from_IHTMLTable(iface);
354 FIXME("(%p)\n", This);
355 return E_NOTIMPL;
358 static HRESULT WINAPI HTMLTable_previousPage(IHTMLTable *iface)
360 HTMLTable *This = impl_from_IHTMLTable(iface);
361 FIXME("(%p)\n", This);
362 return E_NOTIMPL;
365 static HRESULT WINAPI HTMLTable_get_tHead(IHTMLTable *iface, IHTMLTableSection **p)
367 HTMLTable *This = impl_from_IHTMLTable(iface);
368 FIXME("(%p)->(%p)\n", This, p);
369 return E_NOTIMPL;
372 static HRESULT WINAPI HTMLTable_get_tFoot(IHTMLTable *iface, IHTMLTableSection **p)
374 HTMLTable *This = impl_from_IHTMLTable(iface);
375 FIXME("(%p)->(%p)\n", This, p);
376 return E_NOTIMPL;
379 static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementCollection **p)
381 HTMLTable *This = impl_from_IHTMLTable(iface);
382 FIXME("(%p)->(%p)\n", This, p);
383 return E_NOTIMPL;
386 static HRESULT WINAPI HTMLTable_get_caption(IHTMLTable *iface, IHTMLTableCaption **p)
388 HTMLTable *This = impl_from_IHTMLTable(iface);
389 FIXME("(%p)->(%p)\n", This, p);
390 return E_NOTIMPL;
393 static HRESULT WINAPI HTMLTable_createTHead(IHTMLTable *iface, IDispatch **head)
395 HTMLTable *This = impl_from_IHTMLTable(iface);
396 FIXME("(%p)->(%p)\n", This, head);
397 return E_NOTIMPL;
400 static HRESULT WINAPI HTMLTable_deleteTHead(IHTMLTable *iface)
402 HTMLTable *This = impl_from_IHTMLTable(iface);
403 FIXME("(%p)\n", This);
404 return E_NOTIMPL;
407 static HRESULT WINAPI HTMLTable_createTFoot(IHTMLTable *iface, IDispatch **foot)
409 HTMLTable *This = impl_from_IHTMLTable(iface);
410 FIXME("(%p)->(%p)\n", This, foot);
411 return E_NOTIMPL;
414 static HRESULT WINAPI HTMLTable_deleteTFoot(IHTMLTable *iface)
416 HTMLTable *This = impl_from_IHTMLTable(iface);
417 FIXME("(%p)\n", This);
418 return E_NOTIMPL;
421 static HRESULT WINAPI HTMLTable_createCaption(IHTMLTable *iface, IHTMLTableCaption **caption)
423 HTMLTable *This = impl_from_IHTMLTable(iface);
424 FIXME("(%p)->(%p)\n", This, caption);
425 return E_NOTIMPL;
428 static HRESULT WINAPI HTMLTable_deleteCaption(IHTMLTable *iface)
430 HTMLTable *This = impl_from_IHTMLTable(iface);
431 FIXME("(%p)\n", This);
432 return E_NOTIMPL;
435 static HRESULT WINAPI HTMLTable_insertRow(IHTMLTable *iface, LONG index, IDispatch **row)
437 HTMLTable *This = impl_from_IHTMLTable(iface);
438 FIXME("(%p)->(%d %p)\n", This, index, row);
439 return E_NOTIMPL;
442 static HRESULT WINAPI HTMLTable_deleteRow(IHTMLTable *iface, LONG index)
444 HTMLTable *This = impl_from_IHTMLTable(iface);
445 FIXME("(%p)->(%d)\n", This, index);
446 return E_NOTIMPL;
449 static HRESULT WINAPI HTMLTable_get_readyState(IHTMLTable *iface, BSTR *p)
451 HTMLTable *This = impl_from_IHTMLTable(iface);
452 FIXME("(%p)->(%p)\n", This, p);
453 return E_NOTIMPL;
456 static HRESULT WINAPI HTMLTable_put_onreadystatechange(IHTMLTable *iface, VARIANT v)
458 HTMLTable *This = impl_from_IHTMLTable(iface);
459 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
460 return E_NOTIMPL;
463 static HRESULT WINAPI HTMLTable_get_onreadystatechange(IHTMLTable *iface, VARIANT *p)
465 HTMLTable *This = impl_from_IHTMLTable(iface);
466 FIXME("(%p)->(%p)\n", This, p);
467 return E_NOTIMPL;
470 static const IHTMLTableVtbl HTMLTableVtbl = {
471 HTMLTable_QueryInterface,
472 HTMLTable_AddRef,
473 HTMLTable_Release,
474 HTMLTable_GetTypeInfoCount,
475 HTMLTable_GetTypeInfo,
476 HTMLTable_GetIDsOfNames,
477 HTMLTable_Invoke,
478 HTMLTable_put_cols,
479 HTMLTable_get_cols,
480 HTMLTable_put_border,
481 HTMLTable_get_border,
482 HTMLTable_put_frame,
483 HTMLTable_get_frame,
484 HTMLTable_put_rules,
485 HTMLTable_get_rules,
486 HTMLTable_put_cellSpacing,
487 HTMLTable_get_cellSpacing,
488 HTMLTable_put_cellPadding,
489 HTMLTable_get_cellPadding,
490 HTMLTable_put_background,
491 HTMLTable_get_background,
492 HTMLTable_put_bgColor,
493 HTMLTable_get_bgColor,
494 HTMLTable_put_borderColor,
495 HTMLTable_get_borderColor,
496 HTMLTable_put_borderColorLight,
497 HTMLTable_get_borderColorLight,
498 HTMLTable_put_borderColorDark,
499 HTMLTable_get_borderColorDark,
500 HTMLTable_put_align,
501 HTMLTable_get_align,
502 HTMLTable_refresh,
503 HTMLTable_get_rows,
504 HTMLTable_put_width,
505 HTMLTable_get_width,
506 HTMLTable_put_height,
507 HTMLTable_get_height,
508 HTMLTable_put_dataPageSize,
509 HTMLTable_get_dataPageSize,
510 HTMLTable_nextPage,
511 HTMLTable_previousPage,
512 HTMLTable_get_tHead,
513 HTMLTable_get_tFoot,
514 HTMLTable_get_tBodies,
515 HTMLTable_get_caption,
516 HTMLTable_createTHead,
517 HTMLTable_deleteTHead,
518 HTMLTable_createTFoot,
519 HTMLTable_deleteTFoot,
520 HTMLTable_createCaption,
521 HTMLTable_deleteCaption,
522 HTMLTable_insertRow,
523 HTMLTable_deleteRow,
524 HTMLTable_get_readyState,
525 HTMLTable_put_onreadystatechange,
526 HTMLTable_get_onreadystatechange
529 /* IHTMLTable2 */
530 static HRESULT WINAPI HTMLTable2_QueryInterface(IHTMLTable2 *iface,
531 REFIID riid, void **ppv)
533 HTMLTable *This = impl_from_IHTMLTable2(iface);
535 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
538 static ULONG WINAPI HTMLTable2_AddRef(IHTMLTable2 *iface)
540 HTMLTable *This = impl_from_IHTMLTable2(iface);
542 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
545 static ULONG WINAPI HTMLTable2_Release(IHTMLTable2 *iface)
547 HTMLTable *This = impl_from_IHTMLTable2(iface);
549 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
552 static HRESULT WINAPI HTMLTable2_GetTypeInfoCount(IHTMLTable2 *iface, UINT *pctinfo)
554 HTMLTable *This = impl_from_IHTMLTable2(iface);
555 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
558 static HRESULT WINAPI HTMLTable2_GetTypeInfo(IHTMLTable2 *iface, UINT iTInfo,
559 LCID lcid, ITypeInfo **ppTInfo)
561 HTMLTable *This = impl_from_IHTMLTable2(iface);
562 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
563 ppTInfo);
566 static HRESULT WINAPI HTMLTable2_GetIDsOfNames(IHTMLTable2 *iface, REFIID riid,
567 LPOLESTR *rgszNames, UINT cNames,
568 LCID lcid, DISPID *rgDispId)
570 HTMLTable *This = impl_from_IHTMLTable2(iface);
571 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
572 cNames, lcid, rgDispId);
575 static HRESULT WINAPI HTMLTable2_Invoke(IHTMLTable2 *iface, DISPID dispIdMember,
576 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
577 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
579 HTMLTable *This = impl_from_IHTMLTable2(iface);
580 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
581 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
584 static HRESULT WINAPI HTMLTable2_firstPage(IHTMLTable2 *iface)
586 HTMLTable *This = impl_from_IHTMLTable2(iface);
587 FIXME("(%p)->()\n", This);
588 return E_NOTIMPL;
591 static HRESULT WINAPI HTMLTable2_lastPage(IHTMLTable2 *iface)
593 HTMLTable *This = impl_from_IHTMLTable2(iface);
594 FIXME("(%p)->()\n", This);
595 return E_NOTIMPL;
598 static HRESULT WINAPI HTMLTable2_cells(IHTMLTable2 *iface, IHTMLElementCollection **p)
600 HTMLTable *This = impl_from_IHTMLTable2(iface);
601 FIXME("(%p)->(%p)\n", This, p);
602 return E_NOTIMPL;
605 static HRESULT WINAPI HTMLTable2_moveRow(IHTMLTable2 *iface, LONG indexFrom, LONG indexTo, IDispatch **row)
607 HTMLTable *This = impl_from_IHTMLTable2(iface);
608 FIXME("(%p)->(%d %d %p)\n", This, indexFrom, indexTo, row);
609 return E_NOTIMPL;
613 static const IHTMLTable2Vtbl HTMLTable2Vtbl = {
614 HTMLTable2_QueryInterface,
615 HTMLTable2_AddRef,
616 HTMLTable2_Release,
617 HTMLTable2_GetTypeInfoCount,
618 HTMLTable2_GetTypeInfo,
619 HTMLTable2_GetIDsOfNames,
620 HTMLTable2_Invoke,
621 HTMLTable2_firstPage,
622 HTMLTable2_lastPage,
623 HTMLTable2_cells,
624 HTMLTable2_moveRow
627 /* IHTMLTable3 */
628 static HRESULT WINAPI HTMLTable3_QueryInterface(IHTMLTable3 *iface,
629 REFIID riid, void **ppv)
631 HTMLTable *This = impl_from_IHTMLTable3(iface);
633 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
636 static ULONG WINAPI HTMLTable3_AddRef(IHTMLTable3 *iface)
638 HTMLTable *This = impl_from_IHTMLTable3(iface);
640 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
643 static ULONG WINAPI HTMLTable3_Release(IHTMLTable3 *iface)
645 HTMLTable *This = impl_from_IHTMLTable3(iface);
647 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
650 static HRESULT WINAPI HTMLTable3_GetTypeInfoCount(IHTMLTable3 *iface, UINT *pctinfo)
652 HTMLTable *This = impl_from_IHTMLTable3(iface);
653 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
656 static HRESULT WINAPI HTMLTable3_GetTypeInfo(IHTMLTable3 *iface, UINT iTInfo,
657 LCID lcid, ITypeInfo **ppTInfo)
659 HTMLTable *This = impl_from_IHTMLTable3(iface);
660 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
661 ppTInfo);
664 static HRESULT WINAPI HTMLTable3_GetIDsOfNames(IHTMLTable3 *iface, REFIID riid,
665 LPOLESTR *rgszNames, UINT cNames,
666 LCID lcid, DISPID *rgDispId)
668 HTMLTable *This = impl_from_IHTMLTable3(iface);
669 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
670 cNames, lcid, rgDispId);
673 static HRESULT WINAPI HTMLTable3_Invoke(IHTMLTable3 *iface, DISPID dispIdMember,
674 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
675 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
677 HTMLTable *This = impl_from_IHTMLTable3(iface);
678 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
679 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
682 static HRESULT WINAPI HTMLTable3_put_summary(IHTMLTable3 *iface, BSTR v)
684 HTMLTable *This = impl_from_IHTMLTable3(iface);
685 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
686 return E_NOTIMPL;
689 static HRESULT WINAPI HTMLTable3_get_summary(IHTMLTable3 *iface, BSTR * p)
691 HTMLTable *This = impl_from_IHTMLTable3(iface);
692 FIXME("(%p)->(%p)\n", This, p);
693 return E_NOTIMPL;
696 static const IHTMLTable3Vtbl HTMLTable3Vtbl = {
697 HTMLTable3_QueryInterface,
698 HTMLTable3_AddRef,
699 HTMLTable3_Release,
700 HTMLTable3_GetTypeInfoCount,
701 HTMLTable3_GetTypeInfo,
702 HTMLTable3_GetIDsOfNames,
703 HTMLTable3_Invoke,
704 HTMLTable3_put_summary,
705 HTMLTable3_get_summary
708 static inline HTMLTable *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
710 return CONTAINING_RECORD(iface, HTMLTable, element.node);
713 static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
715 HTMLTable *This = impl_from_HTMLDOMNode(iface);
717 *ppv = NULL;
719 if(IsEqualGUID(&IID_IUnknown, riid)) {
720 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
721 *ppv = &This->IHTMLTable_iface;
722 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
723 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
724 *ppv = &This->IHTMLTable_iface;
725 }else if(IsEqualGUID(&IID_IHTMLTable, riid)) {
726 TRACE("(%p)->(IID_IHTMLTable %p)\n", This, ppv);
727 *ppv = &This->IHTMLTable_iface;
728 }else if(IsEqualGUID(&IID_IHTMLTable2, riid)) {
729 TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This, ppv);
730 *ppv = &This->IHTMLTable_iface;
731 }else if(IsEqualGUID(&IID_IHTMLTable3, riid)) {
732 TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This, ppv);
733 *ppv = &This->IHTMLTable_iface;
736 if(*ppv) {
737 IUnknown_AddRef((IUnknown*)*ppv);
738 return S_OK;
741 return HTMLElement_QI(&This->element.node, riid, ppv);
744 static void HTMLTable_destructor(HTMLDOMNode *iface)
746 HTMLTable *This = impl_from_HTMLDOMNode(iface);
748 if(This->nstable)
749 nsIDOMHTMLTableElement_Release(This->nstable);
751 HTMLElement_destructor(&This->element.node);
754 static const NodeImplVtbl HTMLTableImplVtbl = {
755 HTMLTable_QI,
756 HTMLTable_destructor,
757 HTMLElement_clone,
758 HTMLElement_get_attr_col
761 static const tid_t HTMLTable_iface_tids[] = {
762 HTMLELEMENT_TIDS,
763 IHTMLTable_tid,
767 static dispex_static_data_t HTMLTable_dispex = {
768 NULL,
769 DispHTMLTable_tid,
770 NULL,
771 HTMLTable_iface_tids
774 HRESULT HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
776 HTMLTable *ret;
777 nsresult nsres;
779 ret = heap_alloc_zero(sizeof(HTMLTable));
780 if(!ret)
781 return E_OUTOFMEMORY;
783 ret->element.node.vtbl = &HTMLTableImplVtbl;
784 ret->IHTMLTable_iface.lpVtbl = &HTMLTableVtbl;
786 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
787 if(NS_FAILED(nsres)) {
788 ERR("Could not get nsIDOMHTMLTableElement iface: %08x\n", nsres);
789 heap_free(ret);
790 return E_FAIL;
793 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
794 ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents, NULL);
796 *elem = &ret->element;
797 return S_OK;