1/*
2 * This file is part of the DOM implementation for KDE.
3 *
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 * This file includes excerpts from the Document Object Model (DOM)
22 * Level 1 Specification (Recommendation)
23 * http://www.w3.org/TR/REC-DOM-Level-1/
24 * Copyright © World Wide Web Consortium , (Massachusetts Institute of
25 * Technology , Institut National de Recherche en Informatique et en
26 * Automatique , Keio University ). All Rights Reserved.
27 *
28 */
29#ifndef HTML_TABLE_H
30#define HTML_TABLE_H
31
32// --------------------------------------------------------------------------
33#include <khtml_export.h>
34#include <dom/html_element.h>
35
36namespace DOM {
37
38class HTMLTableCaptionElementImpl;
39class DOMString;
40
41/**
42 * Table caption See the <a
43 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-CAPTION">
44 * CAPTION element definition </a> in HTML 4.0.
45 *
46 */
47class KHTML_EXPORT HTMLTableCaptionElement : public HTMLElement
48{
49 friend class HTMLTableElement;
50
51public:
52 HTMLTableCaptionElement();
53 HTMLTableCaptionElement(const HTMLTableCaptionElement &other);
54 HTMLTableCaptionElement(const Node &other) : HTMLElement()
55 {(*this)=other;}
56protected:
57 HTMLTableCaptionElement(HTMLTableCaptionElementImpl *impl);
58public:
59
60 HTMLTableCaptionElement & operator = (const HTMLTableCaptionElement &other);
61 HTMLTableCaptionElement & operator = (const Node &other);
62
63 ~HTMLTableCaptionElement();
64
65 /**
66 * Caption alignment with respect to the table. See the <a
67 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-CAPTION">
68 * align attribute definition </a> in HTML 4.0. This attribute is
69 * deprecated in HTML 4.0.
70 *
71 */
72 DOMString align() const;
73
74 /**
75 * see align
76 */
77 void setAlign( const DOMString & );
78};
79
80// --------------------------------------------------------------------------
81
82class HTMLTableCellElementImpl;
83
84/**
85 * The object used to represent the \c TH and \c TD
86 * elements. See the <a
87 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TD">
88 * TD element definition </a> in HTML 4.0.
89 *
90 */
91class KHTML_EXPORT HTMLTableCellElement : public HTMLElement
92{
93 friend class HTMLTableElement;
94
95public:
96 HTMLTableCellElement();
97 HTMLTableCellElement(const HTMLTableCellElement &other);
98 HTMLTableCellElement(const Node &other) : HTMLElement()
99 {(*this)=other;}
100protected:
101 HTMLTableCellElement(HTMLTableCellElementImpl *impl);
102public:
103
104 HTMLTableCellElement & operator = (const HTMLTableCellElement &other);
105 HTMLTableCellElement & operator = (const Node &other);
106
107 ~HTMLTableCellElement();
108
109 /**
110 * The index of this cell in the row.
111 *
112 */
113 long cellIndex() const;
114
115 /**
116 * see cellIndex
117 *
118 * This function is obsolete - the cellIndex property is actually supposed to be read-only
119 * (http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
120 */
121 void setCellIndex( long );
122
123 /**
124 * Abbreviation for header cells. See the <a
125 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-abbr">
126 * abbr attribute definition </a> in HTML 4.0.
127 *
128 */
129 DOMString abbr() const;
130
131 /**
132 * see abbr
133 */
134 void setAbbr( const DOMString & );
135
136 /**
137 * Horizontal alignment of data in cell. See the <a
138 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TD">
139 * align attribute definition </a> in HTML 4.0.
140 *
141 */
142 DOMString align() const;
143
144 /**
145 * see align
146 */
147 void setAlign( const DOMString & );
148
149 /**
150 * Names group of related headers. See the <a
151 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-axis">
152 * axis attribute definition </a> in HTML 4.0.
153 *
154 */
155 DOMString axis() const;
156
157 /**
158 * see axis
159 */
160 void setAxis( const DOMString & );
161
162 /**
163 * Cell background color. See the <a
164 * href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
165 * bgcolor attribute definition </a> in HTML 4.0. This attribute
166 * is deprecated in HTML 4.0.
167 *
168 */
169 DOMString bgColor() const;
170
171 /**
172 * see bgColor
173 */
174 void setBgColor( const DOMString & );
175
176 /**
177 * Alignment character for cells in a column. See the <a
178 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
179 * char attribute definition </a> in HTML 4.0.
180 *
181 */
182 DOMString ch() const;
183
184 /**
185 * see ch
186 */
187 void setCh( const DOMString & );
188
189 /**
190 * Offset of alignment character. See the <a
191 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
192 * charoff attribute definition </a> in HTML 4.0.
193 *
194 */
195 DOMString chOff() const;
196
197 /**
198 * see chOff
199 */
200 void setChOff( const DOMString & );
201
202 /**
203 * Number of columns spanned by cell. See the <a
204 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-colspan">
205 * colspan attribute definition </a> in HTML 4.0.
206 *
207 */
208 long colSpan() const;
209
210 /**
211 * see colSpan
212 */
213 void setColSpan( long );
214
215 /**
216 * List of \c id attribute values for header cells.
217 * See the <a
218 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-headers">
219 * headers attribute definition </a> in HTML 4.0.
220 *
221 */
222 DOMString headers() const;
223
224 /**
225 * see headers
226 */
227 void setHeaders( const DOMString & );
228
229 /**
230 * Cell height. See the <a
231 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-height-TH">
232 * height attribute definition </a> in HTML 4.0. This attribute is
233 * deprecated in HTML 4.0.
234 *
235 */
236 DOMString height() const;
237
238 /**
239 * see height
240 */
241 void setHeight( const DOMString & );
242
243 /**
244 * Suppress word wrapping. See the <a
245 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-nowrap">
246 * nowrap attribute definition </a> in HTML 4.0. This attribute is
247 * deprecated in HTML 4.0.
248 *
249 */
250 bool noWrap() const;
251
252 /**
253 * see noWrap
254 */
255 void setNoWrap( bool );
256
257 /**
258 * Number of rows spanned by cell. See the <a
259 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-rowspan">
260 * rowspan attribute definition </a> in HTML 4.0.
261 *
262 */
263 long rowSpan() const;
264
265 /**
266 * see rowSpan
267 */
268 void setRowSpan( long );
269
270 /**
271 * Scope covered by header cells. See the <a
272 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-scope">
273 * scope attribute definition </a> in HTML 4.0.
274 *
275 */
276 DOMString scope() const;
277
278 /**
279 * see scope
280 */
281 void setScope( const DOMString & );
282
283 /**
284 * Vertical alignment of data in cell. See the <a
285 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-valign">
286 * valign attribute definition </a> in HTML 4.0.
287 *
288 */
289 DOMString vAlign() const;
290
291 /**
292 * see vAlign
293 */
294 void setVAlign( const DOMString & );
295
296 /**
297 * Cell width. See the <a
298 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-TH">
299 * width attribute definition </a> in HTML 4.0. This attribute is
300 * deprecated in HTML 4.0.
301 *
302 */
303 DOMString width() const;
304
305 /**
306 * see width
307 */
308 void setWidth( const DOMString & );
309};
310
311// --------------------------------------------------------------------------
312
313class HTMLTableColElementImpl;
314
315/**
316 * Regroups the \c COL and \c COLGROUP
317 * elements. See the <a
318 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-COL">
319 * COL element definition </a> in HTML 4.0.
320 *
321 */
322class KHTML_EXPORT HTMLTableColElement : public HTMLElement
323{
324 friend class HTMLTableElement;
325
326public:
327 HTMLTableColElement();
328 HTMLTableColElement(const HTMLTableColElement &other);
329 HTMLTableColElement(const Node &other) : HTMLElement()
330 {(*this)=other;}
331protected:
332 HTMLTableColElement(HTMLTableColElementImpl *impl);
333public:
334
335 HTMLTableColElement & operator = (const HTMLTableColElement &other);
336 HTMLTableColElement & operator = (const Node &other);
337
338 ~HTMLTableColElement();
339
340 /**
341 * Horizontal alignment of cell data in column. See the <a
342 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TD">
343 * align attribute definition </a> in HTML 4.0.
344 *
345 */
346 DOMString align() const;
347
348 /**
349 * see align
350 */
351 void setAlign( const DOMString & );
352
353 /**
354 * Alignment character for cells in a column. See the <a
355 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
356 * char attribute definition </a> in HTML 4.0.
357 *
358 */
359 DOMString ch() const;
360
361 /**
362 * see ch
363 */
364 void setCh( const DOMString & );
365
366 /**
367 * Offset of alignment character. See the <a
368 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
369 * charoff attribute definition </a> in HTML 4.0.
370 *
371 */
372 DOMString chOff() const;
373
374 /**
375 * see chOff
376 */
377 void setChOff( const DOMString & );
378
379 /**
380 * Indicates the number of columns in a group or affected by a
381 * grouping. See the <a
382 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-span-COL">
383 * span attribute definition </a> in HTML 4.0.
384 *
385 */
386 long span() const;
387
388 /**
389 * see span
390 */
391 void setSpan( long );
392
393 /**
394 * Vertical alignment of cell data in column. See the <a
395 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-valign">
396 * valign attribute definition </a> in HTML 4.0.
397 *
398 */
399 DOMString vAlign() const;
400
401 /**
402 * see vAlign
403 */
404 void setVAlign( const DOMString & );
405
406 /**
407 * Default column width. See the <a
408 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-COL">
409 * width attribute definition </a> in HTML 4.0.
410 *
411 */
412 DOMString width() const;
413
414 /**
415 * see width
416 */
417 void setWidth( const DOMString & );
418};
419
420// --------------------------------------------------------------------------
421
422class HTMLTableElementImpl;
423class HTMLCollection;
424class HTMLTableSectionElement;
425class HTMLTableCaptionElement;
426class HTMLElement;
427class DOMString;
428
429/**
430 * The create* and delete* methods on the table allow authors to
431 * construct and modify tables. HTML 4.0 specifies that only one of
432 * each of the \c CAPTION , \c THEAD , and
433 * \c TFOOT elements may exist in a table. Therefore, if
434 * one exists, and the createTHead() or createTFoot() method is
435 * called, the method returns the existing THead or TFoot element. See
436 * the <a
437 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TABLE">
438 * TABLE element definition </a> in HTML 4.0.
439 *
440 */
441class KHTML_EXPORT HTMLTableElement : public HTMLElement
442{
443public:
444 HTMLTableElement();
445 HTMLTableElement(const HTMLTableElement &other);
446 HTMLTableElement(const Node &other) : HTMLElement()
447 {(*this)=other;}
448
449protected:
450 HTMLTableElement(HTMLTableElementImpl *impl);
451public:
452
453 HTMLTableElement & operator = (const HTMLTableElement &other);
454 HTMLTableElement & operator = (const Node &other);
455
456 ~HTMLTableElement();
457
458 /**
459 * Returns the table's \c CAPTION , or void if none
460 * exists.
461 *
462 */
463 HTMLTableCaptionElement caption() const;
464
465 /**
466 * see caption
467 */
468 void setCaption( const HTMLTableCaptionElement & );
469
470 /**
471 * Returns the table's \c THEAD , or \c null
472 * if none exists.
473 *
474 */
475 HTMLTableSectionElement tHead() const;
476
477 /**
478 * see tHead
479 */
480 void setTHead( const HTMLTableSectionElement & );
481
482 /**
483 * Returns the table's \c TFOOT , or \c null
484 * if none exists.
485 *
486 */
487 HTMLTableSectionElement tFoot() const;
488
489 /**
490 * see tFoot
491 */
492 void setTFoot( const HTMLTableSectionElement & );
493
494 /**
495 * Returns a collection of all the rows in the table, including
496 * all in \c THEAD , \c TFOOT , all
497 * \c TBODY elements.
498 *
499 */
500 HTMLCollection rows() const;
501
502 /**
503 * Returns a collection of the table bodies (including implicit ones).
504 *
505 */
506 HTMLCollection tBodies() const;
507
508 /**
509 * Specifies the table's position with respect to the rest of the
510 * document. See the <a
511 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TABLE">
512 * align attribute definition </a> in HTML 4.0. This attribute is
513 * deprecated in HTML 4.0.
514 *
515 */
516 DOMString align() const;
517
518 /**
519 * see align
520 */
521 void setAlign( const DOMString & );
522
523 /**
524 * Cell background color. See the <a
525 * href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
526 * bgcolor attribute definition </a> in HTML 4.0. This attribute
527 * is deprecated in HTML 4.0.
528 *
529 */
530 DOMString bgColor() const;
531
532 /**
533 * see bgColor
534 */
535 void setBgColor( const DOMString & );
536
537 /**
538 * The width of the border around the table. See the <a
539 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-border-TABLE">
540 * border attribute definition </a> in HTML 4.0.
541 *
542 */
543 DOMString border() const;
544
545 /**
546 * see border
547 */
548 void setBorder( const DOMString & );
549
550 /**
551 * Specifies the horizontal and vertical space between cell
552 * content and cell borders. See the <a
553 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellpadding">
554 * cellpadding attribute definition </a> in HTML 4.0.
555 *
556 */
557 DOMString cellPadding() const;
558
559 /**
560 * see cellPadding
561 */
562 void setCellPadding( const DOMString & );
563
564 /**
565 * Specifies the horizontal and vertical separation between cells.
566 * See the <a
567 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellspacing">
568 * cellspacing attribute definition </a> in HTML 4.0.
569 *
570 */
571 DOMString cellSpacing() const;
572
573 /**
574 * see cellSpacing
575 */
576 void setCellSpacing( const DOMString & );
577
578 /**
579 * Specifies which external table borders to render. See the <a
580 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-frame">
581 * frame attribute definition </a> in HTML 4.0.
582 *
583 */
584 DOMString frame() const;
585
586 /**
587 * see frame
588 */
589 void setFrame( const DOMString & );
590
591 /**
592 * Specifies which internal table borders to render. See the <a
593 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-rules">
594 * rules attribute definition </a> in HTML 4.0.
595 *
596 */
597 DOMString rules() const;
598
599 /**
600 * see rules
601 */
602 void setRules( const DOMString & );
603
604 /**
605 * Supplementary description about the purpose or structure of a
606 * table. See the <a
607 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-summary">
608 * summary attribute definition </a> in HTML 4.0.
609 *
610 */
611 DOMString summary() const;
612
613 /**
614 * see summary
615 */
616 void setSummary( const DOMString & );
617
618 /**
619 * Specifies the desired table width. See the <a
620 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-TABLE">
621 * width attribute definition </a> in HTML 4.0.
622 *
623 */
624 DOMString width() const;
625
626 /**
627 * see width
628 */
629 void setWidth( const DOMString & );
630
631 /**
632 * Create a table header row or return an existing one.
633 *
634 * @return A new table header element ( \c THEAD ).
635 *
636 */
637 HTMLElement createTHead ( );
638
639 /**
640 * Delete the header from the table, if one exists.
641 *
642 * @return
643 *
644 */
645 void deleteTHead ( );
646
647 /**
648 * Create a table footer row or return an existing one.
649 *
650 * @return A footer element ( \c TFOOT ).
651 *
652 */
653 HTMLElement createTFoot ( );
654
655 /**
656 * Delete the footer from the table, if one exists.
657 *
658 * @return
659 *
660 */
661 void deleteTFoot ( );
662
663 /**
664 * Create a new table caption object or return an existing one.
665 *
666 * @return A \c CAPTION element.
667 *
668 */
669 HTMLElement createCaption ( );
670
671 /**
672 * Delete the table caption, if one exists.
673 *
674 * @return
675 *
676 */
677 void deleteCaption ( );
678
679 /**
680 * Insert a new empty row in the table.
681 * The new row is inserted immediately before and in the same section
682 * as the current indexth row in the table. If index is -1 or equal
683 * to the number of rows, the new row is appended. In addition, when
684 * the table is empty the row is inserted into a TBODY which is created
685 * and inserted into the table.
686 * Note. A table row cannot
687 * be empty according to HTML 4.0 Recommendation.
688 *
689 * @param index The row number where to insert a new row.
690 * The index starts from 0 and is relative to the logical order
691 * (not document order) of all the rows contained inside the table.
692 *
693 * @return The newly created row.
694 *
695 */
696 HTMLElement insertRow ( long index );
697
698 /**
699 * Delete a table row.
700 *
701 * @param index The index of the row to be deleted.
702 * This index starts from 0 and is relative to the logical order
703 * (not document order) of all the rows contained inside the table.
704 * If the index is -1 the last row in the table is deleted.
705 *
706 * @return
707 *
708 */
709 void deleteRow ( long index );
710};
711
712// --------------------------------------------------------------------------
713
714class HTMLTableRowElementImpl;
715class HTMLCollection;
716class HTMLElement;
717class DOMString;
718
719/**
720 * A row in a table. See the <a
721 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TR">
722 * TR element definition </a> in HTML 4.0.
723 *
724 */
725class KHTML_EXPORT HTMLTableRowElement : public HTMLElement
726{
727 friend class HTMLTableElement;
728
729public:
730 HTMLTableRowElement();
731 HTMLTableRowElement(const HTMLTableRowElement &other);
732 HTMLTableRowElement(const Node &other) : HTMLElement()
733 {(*this)=other;}
734
735protected:
736 HTMLTableRowElement(HTMLTableRowElementImpl *impl);
737public:
738
739 HTMLTableRowElement & operator = (const HTMLTableRowElement &other);
740 HTMLTableRowElement & operator = (const Node &other);
741
742 ~HTMLTableRowElement();
743
744 /**
745 * The index of this row, relative to the entire table.
746 * This is in logical order and not in document order.
747 * The rowIndex does take into account sections
748 * (THEAD, TFOOT or TBODY) within the table,
749 * placing THEAD rows first in the index, followed by
750 * TBODY rows, followed by TFOOT rows.
751 */
752 long rowIndex() const;
753
754 /**
755 * see rowIndex
756 *
757 * This function is obsolete - the rowIndex property is actually supposed to be read-only
758 * (http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
759 */
760 void setRowIndex( long );
761
762 /**
763 * The index of this row, relative to the current section (
764 * \c THEAD , \c TFOOT , or \c TBODY
765 * ).
766 *
767 */
768 long sectionRowIndex() const;
769
770 /**
771 * see sectionRowIndex
772 *
773 * This function is obsolete - the sectionRowIndex property is actually supposed to be read-only
774 * (http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
775 */
776 void setSectionRowIndex( long );
777
778 /**
779 * The collection of cells in this row.
780 *
781 */
782 HTMLCollection cells() const;
783
784 /**
785 * see cells
786 *
787 * This function is obsolete - the cells property is actually supposed to be read-only
788 * (http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
789 */
790 void setCells( const HTMLCollection & );
791
792 /**
793 * Horizontal alignment of data within cells of this row. See the
794 * <a
795 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TD">
796 * align attribute definition </a> in HTML 4.0.
797 *
798 */
799 DOMString align() const;
800
801 /**
802 * see align
803 */
804 void setAlign( const DOMString & );
805
806 /**
807 * Background color for rows. See the <a
808 * href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
809 * bgcolor attribute definition </a> in HTML 4.0. This attribute
810 * is deprecated in HTML 4.0.
811 *
812 */
813 DOMString bgColor() const;
814
815 /**
816 * see bgColor
817 */
818 void setBgColor( const DOMString & );
819
820 /**
821 * Alignment character for cells in a column. See the <a
822 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
823 * char attribute definition </a> in HTML 4.0.
824 *
825 */
826 DOMString ch() const;
827
828 /**
829 * see ch
830 */
831 void setCh( const DOMString & );
832
833 /**
834 * Offset of alignment character. See the <a
835 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
836 * charoff attribute definition </a> in HTML 4.0.
837 *
838 */
839 DOMString chOff() const;
840
841 /**
842 * see chOff
843 */
844 void setChOff( const DOMString & );
845
846 /**
847 * Vertical alignment of data within cells of this row. See the <a
848 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-valign">
849 * valign attribute definition </a> in HTML 4.0.
850 *
851 */
852 DOMString vAlign() const;
853
854 /**
855 * see vAlign
856 */
857 void setVAlign( const DOMString & );
858
859 /**
860 * Insert an empty \c TD cell into this row.
861 * If index is -1 or equal to the number of cells, the new
862 * cell is appended.
863 *
864 * @param index The place to insert the cell.
865 *
866 * @return The newly created cell.
867 *
868 */
869 HTMLElement insertCell ( long index );
870
871 /**
872 * Delete a cell from the current row.
873 *
874 * @param index The index of the cell to delete, starting from 0.
875 * If the index is -1 the last cell in the row is deleted.
876 *
877 * @return
878 *
879 */
880 void deleteCell ( long index );
881};
882
883// --------------------------------------------------------------------------
884
885class HTMLTableSectionElementImpl;
886class HTMLCollection;
887class HTMLElement;
888class DOMString;
889
890/**
891 * The \c THEAD , \c TFOOT , and \c TBODY
892 * elements.
893 *
894 */
895class KHTML_EXPORT HTMLTableSectionElement : public HTMLElement
896{
897 friend class HTMLTableElement;
898
899public:
900 HTMLTableSectionElement();
901 HTMLTableSectionElement(const HTMLTableSectionElement &other);
902 HTMLTableSectionElement(const Node &other) : HTMLElement()
903 {(*this)=other;}
904
905
906protected:
907 HTMLTableSectionElement(HTMLTableSectionElementImpl *impl);
908public:
909
910 HTMLTableSectionElement & operator = (const HTMLTableSectionElement &other);
911 HTMLTableSectionElement & operator = (const Node &other);
912
913 ~HTMLTableSectionElement();
914
915 /**
916 * Horizontal alignment of data in cells. See the \c align
917 * attribute for HTMLTheadElement for details.
918 *
919 */
920 DOMString align() const;
921
922 /**
923 * see align
924 */
925 void setAlign( const DOMString & );
926
927 /**
928 * Alignment character for cells in a column. See the <a
929 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
930 * char attribute definition </a> in HTML 4.0.
931 *
932 */
933 DOMString ch() const;
934
935 /**
936 * see ch
937 */
938 void setCh( const DOMString & );
939
940 /**
941 * Offset of alignment character. See the <a
942 * href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
943 * charoff attribute definition </a> in HTML 4.0.
944 *
945 */
946 DOMString chOff() const;
947
948 /**
949 * see chOff
950 */
951 void setChOff( const DOMString & );
952
953 /**
954 * Vertical alignment of data in cells. See the \c valign
955 * attribute for HTMLTheadElement for details.
956 *
957 */
958 DOMString vAlign() const;
959
960 /**
961 * see vAlign
962 */
963 void setVAlign( const DOMString & );
964
965 /**
966 * The collection of rows in this table section.
967 *
968 */
969 HTMLCollection rows() const;
970
971 /**
972 * Insert a row into this section.
973 * The new row is inserted immediately before the current indexth
974 * row in this section. If index is -1 or equal to the number of rows
975 * in this sectino, the new row is appended.
976 *
977 * @param index The row number where to insert a new row.
978 *
979 * @return The newly created row.
980 *
981 */
982 HTMLElement insertRow ( long index );
983
984 /**
985 * Delete a row from this section.
986 *
987 * @param index The index of the row to be deleted,
988 * or -1 to delete the last row. This index starts from 0 and is relative only
989 * to the rows contained inside this section, not all the rows in the table.
990 *
991 */
992 void deleteRow ( long index );
993};
994
995} //namespace
996
997#endif
998