windowscodecs: Implement MetadataReaderInfo_GetSpecVersion.
[wine/multimedia.git] / dlls / mshtml / htmltable.c
blobc17463426d9de0eaef39664147d94a6fefa6040d
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>
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 struct HTMLTable {
36 HTMLElement element;
38 IHTMLTable IHTMLTable_iface;
39 IHTMLTable2 IHTMLTable2_iface;
40 IHTMLTable3 IHTMLTable3_iface;
42 ConnectionPoint cp;
43 nsIDOMHTMLTableElement *nstable;
46 static inline HTMLTable *impl_from_IHTMLTable(IHTMLTable *iface)
48 return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable_iface);
51 static inline HTMLTable *impl_from_IHTMLTable2(IHTMLTable2 *iface)
53 return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable2_iface);
56 static inline HTMLTable *impl_from_IHTMLTable3(IHTMLTable3 *iface)
58 return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable3_iface);
61 static HRESULT WINAPI HTMLTable_QueryInterface(IHTMLTable *iface,
62 REFIID riid, void **ppv)
64 HTMLTable *This = impl_from_IHTMLTable(iface);
66 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
69 static ULONG WINAPI HTMLTable_AddRef(IHTMLTable *iface)
71 HTMLTable *This = impl_from_IHTMLTable(iface);
73 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
76 static ULONG WINAPI HTMLTable_Release(IHTMLTable *iface)
78 HTMLTable *This = impl_from_IHTMLTable(iface);
80 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
83 static HRESULT WINAPI HTMLTable_GetTypeInfoCount(IHTMLTable *iface, UINT *pctinfo)
85 HTMLTable *This = impl_from_IHTMLTable(iface);
86 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
89 static HRESULT WINAPI HTMLTable_GetTypeInfo(IHTMLTable *iface, UINT iTInfo,
90 LCID lcid, ITypeInfo **ppTInfo)
92 HTMLTable *This = impl_from_IHTMLTable(iface);
93 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
94 ppTInfo);
97 static HRESULT WINAPI HTMLTable_GetIDsOfNames(IHTMLTable *iface, REFIID riid,
98 LPOLESTR *rgszNames, UINT cNames,
99 LCID lcid, DISPID *rgDispId)
101 HTMLTable *This = impl_from_IHTMLTable(iface);
102 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
103 cNames, lcid, rgDispId);
106 static HRESULT WINAPI HTMLTable_Invoke(IHTMLTable *iface, DISPID dispIdMember,
107 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
108 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
110 HTMLTable *This = impl_from_IHTMLTable(iface);
111 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
112 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
115 static HRESULT WINAPI HTMLTable_put_cols(IHTMLTable *iface, LONG v)
117 HTMLTable *This = impl_from_IHTMLTable(iface);
118 FIXME("(%p)->(%d)\n", This, v);
119 return E_NOTIMPL;
122 static HRESULT WINAPI HTMLTable_get_cols(IHTMLTable *iface, LONG *p)
124 HTMLTable *This = impl_from_IHTMLTable(iface);
125 FIXME("(%p)->(%p)\n", This, p);
126 return E_NOTIMPL;
129 static HRESULT WINAPI HTMLTable_put_border(IHTMLTable *iface, VARIANT v)
131 HTMLTable *This = impl_from_IHTMLTable(iface);
132 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
133 return E_NOTIMPL;
136 static HRESULT WINAPI HTMLTable_get_border(IHTMLTable *iface, VARIANT *p)
138 HTMLTable *This = impl_from_IHTMLTable(iface);
139 FIXME("(%p)->(%p)\n", This, p);
140 return E_NOTIMPL;
143 static HRESULT WINAPI HTMLTable_put_frame(IHTMLTable *iface, BSTR v)
145 HTMLTable *This = impl_from_IHTMLTable(iface);
146 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
147 return E_NOTIMPL;
150 static HRESULT WINAPI HTMLTable_get_frame(IHTMLTable *iface, BSTR *p)
152 HTMLTable *This = impl_from_IHTMLTable(iface);
153 FIXME("(%p)->(%p)\n", This, p);
154 return E_NOTIMPL;
157 static HRESULT WINAPI HTMLTable_put_rules(IHTMLTable *iface, BSTR v)
159 HTMLTable *This = impl_from_IHTMLTable(iface);
160 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
161 return E_NOTIMPL;
164 static HRESULT WINAPI HTMLTable_get_rules(IHTMLTable *iface, BSTR *p)
166 HTMLTable *This = impl_from_IHTMLTable(iface);
167 FIXME("(%p)->(%p)\n", This, p);
168 return E_NOTIMPL;
171 static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v)
173 HTMLTable *This = impl_from_IHTMLTable(iface);
174 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
175 return E_NOTIMPL;
178 static HRESULT WINAPI HTMLTable_get_cellSpacing(IHTMLTable *iface, VARIANT *p)
180 HTMLTable *This = impl_from_IHTMLTable(iface);
181 FIXME("(%p)->(%p)\n", This, p);
182 return E_NOTIMPL;
185 static HRESULT WINAPI HTMLTable_put_cellPadding(IHTMLTable *iface, VARIANT v)
187 HTMLTable *This = impl_from_IHTMLTable(iface);
188 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
189 return E_NOTIMPL;
192 static HRESULT WINAPI HTMLTable_get_cellPadding(IHTMLTable *iface, VARIANT *p)
194 HTMLTable *This = impl_from_IHTMLTable(iface);
195 FIXME("(%p)->(%p)\n", This, p);
196 return E_NOTIMPL;
199 static HRESULT WINAPI HTMLTable_put_background(IHTMLTable *iface, BSTR v)
201 HTMLTable *This = impl_from_IHTMLTable(iface);
202 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
203 return E_NOTIMPL;
206 static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
208 HTMLTable *This = impl_from_IHTMLTable(iface);
209 FIXME("(%p)->(%p)\n", This, p);
210 return E_NOTIMPL;
213 static HRESULT WINAPI HTMLTable_put_bgColor(IHTMLTable *iface, VARIANT v)
215 HTMLTable *This = impl_from_IHTMLTable(iface);
216 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
217 return E_NOTIMPL;
220 static HRESULT WINAPI HTMLTable_get_bgColor(IHTMLTable *iface, VARIANT *p)
222 HTMLTable *This = impl_from_IHTMLTable(iface);
223 FIXME("(%p)->(%p)\n", This, p);
224 return E_NOTIMPL;
227 static HRESULT WINAPI HTMLTable_put_borderColor(IHTMLTable *iface, VARIANT v)
229 HTMLTable *This = impl_from_IHTMLTable(iface);
230 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
231 return E_NOTIMPL;
234 static HRESULT WINAPI HTMLTable_get_borderColor(IHTMLTable *iface, VARIANT *p)
236 HTMLTable *This = impl_from_IHTMLTable(iface);
237 FIXME("(%p)->(%p)\n", This, p);
238 return E_NOTIMPL;
241 static HRESULT WINAPI HTMLTable_put_borderColorLight(IHTMLTable *iface, VARIANT v)
243 HTMLTable *This = impl_from_IHTMLTable(iface);
244 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
245 return E_NOTIMPL;
248 static HRESULT WINAPI HTMLTable_get_borderColorLight(IHTMLTable *iface, VARIANT *p)
250 HTMLTable *This = impl_from_IHTMLTable(iface);
251 FIXME("(%p)->(%p)\n", This, p);
252 return E_NOTIMPL;
255 static HRESULT WINAPI HTMLTable_put_borderColorDark(IHTMLTable *iface, VARIANT v)
257 HTMLTable *This = impl_from_IHTMLTable(iface);
258 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
259 return E_NOTIMPL;
262 static HRESULT WINAPI HTMLTable_get_borderColorDark(IHTMLTable *iface, VARIANT *p)
264 HTMLTable *This = impl_from_IHTMLTable(iface);
265 FIXME("(%p)->(%p)\n", This, p);
266 return E_NOTIMPL;
269 static HRESULT WINAPI HTMLTable_put_align(IHTMLTable *iface, BSTR v)
271 HTMLTable *This = impl_from_IHTMLTable(iface);
272 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
273 return E_NOTIMPL;
276 static HRESULT WINAPI HTMLTable_get_align(IHTMLTable *iface, BSTR *p)
278 HTMLTable *This = impl_from_IHTMLTable(iface);
279 FIXME("(%p)->(%p)\n", This, p);
280 return E_NOTIMPL;
283 static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
285 HTMLTable *This = impl_from_IHTMLTable(iface);
286 FIXME("(%p)\n", This);
287 return E_NOTIMPL;
290 static HRESULT WINAPI HTMLTable_get_rows(IHTMLTable *iface, IHTMLElementCollection **p)
292 HTMLTable *This = impl_from_IHTMLTable(iface);
293 nsIDOMHTMLCollection *nscol;
294 nsresult nsres;
296 TRACE("(%p)->(%p)\n", This, p);
298 nsres = nsIDOMHTMLTableElement_GetRows(This->nstable, &nscol);
299 if(NS_FAILED(nsres)) {
300 ERR("GetRows failed: %08x\n", nsres);
301 return E_FAIL;
304 *p = create_collection_from_htmlcol(This->element.node.doc, 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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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)->(%s)\n", This, debugstr_variant(&v));
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 const NodeImplVtbl HTMLTableImplVtbl = {
746 HTMLTable_QI,
747 HTMLElement_destructor,
748 HTMLElement_clone,
749 HTMLElement_get_attr_col
752 static const tid_t HTMLTable_iface_tids[] = {
753 HTMLELEMENT_TIDS,
754 IHTMLTable_tid,
758 static dispex_static_data_t HTMLTable_dispex = {
759 NULL,
760 DispHTMLTable_tid,
761 NULL,
762 HTMLTable_iface_tids
765 HRESULT HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
767 HTMLTable *ret;
768 nsresult nsres;
770 ret = heap_alloc_zero(sizeof(HTMLTable));
771 if(!ret)
772 return E_OUTOFMEMORY;
774 ret->element.node.vtbl = &HTMLTableImplVtbl;
775 ret->IHTMLTable_iface.lpVtbl = &HTMLTableVtbl;
777 HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
779 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
781 /* Share the reference with nsnode */
782 assert(nsres == NS_OK && (nsIDOMNode*)ret->nstable == ret->element.node.nsnode);
783 nsIDOMNode_Release(ret->element.node.nsnode);
785 ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents, NULL);
787 *elem = &ret->element;
788 return S_OK;