KHtml

html_table.cpp
1 /**
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
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  */
22 // --------------------------------------------------------------------------
23 
24 #include "html_table.h"
25 #include "html_misc.h"
26 #include "dom_exception.h"
27 
28 #include <html/html_miscimpl.h>
29 #include <html/html_tableimpl.h>
30 
31 using namespace DOM;
32 
33 HTMLTableCaptionElement::HTMLTableCaptionElement() : HTMLElement()
34 {
35 }
36 
37 HTMLTableCaptionElement::HTMLTableCaptionElement(const HTMLTableCaptionElement &other) : HTMLElement(other)
38 {
39 }
40 
41 HTMLTableCaptionElement::HTMLTableCaptionElement(HTMLTableCaptionElementImpl *impl) : HTMLElement(impl)
42 {
43 }
44 
45 HTMLTableCaptionElement &HTMLTableCaptionElement::operator = (const Node &other)
46 {
47  assignOther(other, ID_CAPTION);
48  return *this;
49 }
50 
51 HTMLTableCaptionElement &HTMLTableCaptionElement::operator = (const HTMLTableCaptionElement &other)
52 {
53  HTMLElement::operator = (other);
54  return *this;
55 }
56 
57 HTMLTableCaptionElement::~HTMLTableCaptionElement()
58 {
59 }
60 
62 {
63  if (!impl) {
64  return DOMString();
65  }
66  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
67 }
68 
70 {
71  if (impl) {
72  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
73  }
74 }
75 
76 // --------------------------------------------------------------------------
77 
78 HTMLTableCellElement::HTMLTableCellElement() : HTMLElement()
79 {
80 }
81 
82 HTMLTableCellElement::HTMLTableCellElement(const HTMLTableCellElement &other) : HTMLElement(other)
83 {
84 }
85 
86 HTMLTableCellElement::HTMLTableCellElement(HTMLTableCellElementImpl *impl) : HTMLElement(impl)
87 {
88 }
89 
90 HTMLTableCellElement &HTMLTableCellElement::operator = (const Node &other)
91 {
92  if (other.elementId() != ID_TD &&
93  other.elementId() != ID_TH) {
94  if (impl) {
95  impl->deref();
96  }
97  impl = nullptr;
98  } else {
99  Node::operator = (other);
100  }
101  return *this;
102 }
103 
104 HTMLTableCellElement &HTMLTableCellElement::operator = (const HTMLTableCellElement &other)
105 {
106  HTMLElement::operator = (other);
107  return *this;
108 }
109 
110 HTMLTableCellElement::~HTMLTableCellElement()
111 {
112 }
113 
115 {
116  if (!impl) {
117  return 0;
118  }
119  return ((HTMLTableCellElementImpl *)impl)->cellIndex();
120 }
121 
122 void HTMLTableCellElement::setCellIndex(long /*_cellIndex*/)
123 {
124  throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
125 }
126 
128 {
129  if (!impl) {
130  return DOMString();
131  }
132  return ((ElementImpl *)impl)->getAttribute(ATTR_ABBR);
133 }
134 
136 {
137  if (impl) {
138  ((ElementImpl *)impl)->setAttribute(ATTR_ABBR, value);
139  }
140 }
141 
143 {
144  if (!impl) {
145  return DOMString();
146  }
147  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
148 }
149 
151 {
152  if (impl) {
153  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
154  }
155 }
156 
158 {
159  if (!impl) {
160  return DOMString();
161  }
162  return ((ElementImpl *)impl)->getAttribute(ATTR_AXIS);
163 }
164 
166 {
167  if (impl) {
168  ((ElementImpl *)impl)->setAttribute(ATTR_AXIS, value);
169  }
170 }
171 
173 {
174  if (!impl) {
175  return DOMString();
176  }
177  return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
178 }
179 
181 {
182  if (impl) {
183  ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
184  }
185 }
186 
188 {
189  if (!impl) {
190  return DOMString();
191  }
192  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
193 }
194 
196 {
197  if (impl) {
198  ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
199  }
200 }
201 
203 {
204  if (!impl) {
205  return DOMString();
206  }
207  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
208 }
209 
211 {
212  if (impl) {
213  ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
214  }
215 }
216 
218 {
219  if (!impl) {
220  return 0;
221  }
222  return ((ElementImpl *)impl)->getAttribute(ATTR_COLSPAN).toInt();
223 }
224 
226 {
227  if (impl) {
228  DOMString value(QString::number(_colSpan));
229  ((ElementImpl *)impl)->setAttribute(ATTR_COLSPAN, value);
230  }
231 }
232 
234 {
235  if (!impl) {
236  return DOMString();
237  }
238  return ((ElementImpl *)impl)->getAttribute(ATTR_HEADERS);
239 }
240 
242 {
243  if (impl) {
244  ((ElementImpl *)impl)->setAttribute(ATTR_HEADERS, value);
245  }
246 }
247 
249 {
250  if (!impl) {
251  return DOMString();
252  }
253  return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT);
254 }
255 
257 {
258  if (impl) {
259  ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value);
260  }
261 }
262 
264 {
265  if (!impl) {
266  return false;
267  }
268  return !((ElementImpl *)impl)->getAttribute(ATTR_NOWRAP).isNull();
269 }
270 
272 {
273  if (impl) {
274  ((ElementImpl *)impl)->setAttribute(ATTR_NOWRAP, _noWrap ? "" : nullptr);
275  }
276 }
277 
279 {
280  if (!impl) {
281  return 0;
282  }
283  return ((ElementImpl *)impl)->getAttribute(ATTR_ROWSPAN).toInt();
284 }
285 
287 {
288  if (impl) {
289  DOMString value(QString::number(_rowSpan));
290  ((ElementImpl *)impl)->setAttribute(ATTR_ROWSPAN, value);
291  }
292 }
293 
295 {
296  if (!impl) {
297  return DOMString();
298  }
299  return ((ElementImpl *)impl)->getAttribute(ATTR_SCOPE);
300 }
301 
303 {
304  if (impl) {
305  ((ElementImpl *)impl)->setAttribute(ATTR_SCOPE, value);
306  }
307 }
308 
310 {
311  if (!impl) {
312  return DOMString();
313  }
314  return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
315 }
316 
318 {
319  if (impl) {
320  ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
321  }
322 }
323 
325 {
326  if (!impl) {
327  return DOMString();
328  }
329  return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
330 }
331 
333 {
334  if (impl) {
335  ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
336  }
337 }
338 
339 // --------------------------------------------------------------------------
340 
341 HTMLTableColElement::HTMLTableColElement() : HTMLElement()
342 {
343 }
344 
345 HTMLTableColElement::HTMLTableColElement(const HTMLTableColElement &other) : HTMLElement(other)
346 {
347 }
348 
349 HTMLTableColElement::HTMLTableColElement(HTMLTableColElementImpl *impl) : HTMLElement(impl)
350 {
351 }
352 
353 HTMLTableColElement &HTMLTableColElement::operator = (const Node &other)
354 {
355  if (other.elementId() != ID_COL &&
356  other.elementId() != ID_COLGROUP) {
357  if (impl) {
358  impl->deref();
359  }
360  impl = nullptr;
361  } else {
362  Node::operator = (other);
363  }
364  return *this;
365 }
366 
367 HTMLTableColElement &HTMLTableColElement::operator = (const HTMLTableColElement &other)
368 {
369  HTMLElement::operator = (other);
370  return *this;
371 }
372 
373 HTMLTableColElement::~HTMLTableColElement()
374 {
375 }
376 
378 {
379  if (!impl) {
380  return DOMString();
381  }
382  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
383 }
384 
386 {
387  if (impl) {
388  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
389  }
390 }
391 
393 {
394  if (!impl) {
395  return DOMString();
396  }
397  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
398 }
399 
401 {
402  if (impl) {
403  ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
404  }
405 }
406 
408 {
409  if (!impl) {
410  return DOMString();
411  }
412  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
413 }
414 
416 {
417  if (impl) {
418  ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
419  }
420 }
421 
423 {
424  if (!impl) {
425  return 0;
426  }
427  return ((ElementImpl *)impl)->getAttribute(ATTR_SPAN).toInt();
428 }
429 
431 {
432  if (impl) {
433  DOMString value(QString::number(_span));
434  ((ElementImpl *)impl)->setAttribute(ATTR_SPAN, value);
435  }
436 }
437 
439 {
440  if (!impl) {
441  return DOMString();
442  }
443  return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
444 }
445 
447 {
448  if (impl) {
449  ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
450  }
451 }
452 
454 {
455  if (!impl) {
456  return DOMString();
457  }
458  return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
459 }
460 
462 {
463  if (impl) {
464  ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
465  }
466 }
467 
468 // --------------------------------------------------------------------------
469 
470 HTMLTableElement::HTMLTableElement() : HTMLElement()
471 {
472 }
473 
474 HTMLTableElement::HTMLTableElement(const HTMLTableElement &other) : HTMLElement(other)
475 {
476 }
477 
478 HTMLTableElement::HTMLTableElement(HTMLTableElementImpl *impl) : HTMLElement(impl)
479 {
480 }
481 
482 HTMLTableElement &HTMLTableElement::operator = (const Node &other)
483 {
484  assignOther(other, ID_TABLE);
485  return *this;
486 }
487 
488 HTMLTableElement &HTMLTableElement::operator = (const HTMLTableElement &other)
489 {
490  HTMLElement::operator = (other);
491  return *this;
492 }
493 
494 HTMLTableElement::~HTMLTableElement()
495 {
496 }
497 
499 {
500  if (!impl) {
501  return nullptr;
502  }
503  return ((HTMLTableElementImpl *)impl)->caption();
504 }
505 
507 {
508  if (impl)
509  ((HTMLTableElementImpl *)impl)
510  ->setCaption(((HTMLTableCaptionElementImpl *)_caption.impl));
511 }
512 
514 {
515  if (!impl) {
516  return nullptr;
517  }
518  return ((HTMLTableElementImpl *)impl)->tHead();
519 }
520 
522 {
523 
524  if (impl)
525  ((HTMLTableElementImpl *)impl)
526  ->setTHead(((HTMLTableSectionElementImpl *)_tHead.impl));
527 }
528 
530 {
531  if (!impl) {
532  return nullptr;
533  }
534  return ((HTMLTableElementImpl *)impl)->tFoot();
535 }
536 
538 {
539 
540  if (impl)
541  ((HTMLTableElementImpl *)impl)
542  ->setTFoot(((HTMLTableSectionElementImpl *)_tFoot.impl));
543 }
544 
546 {
547  if (!impl) {
548  return HTMLCollection();
549  }
550  return HTMLCollection(impl, HTMLCollectionImpl::TABLE_ROWS);
551 }
552 
554 {
555  if (!impl) {
556  return HTMLCollection();
557  }
558  return HTMLCollection(impl, HTMLCollectionImpl::TABLE_TBODIES);
559 }
560 
562 {
563  if (!impl) {
564  return DOMString();
565  }
566  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
567 }
568 
570 {
571  if (impl) {
572  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
573  }
574 }
575 
577 {
578  if (!impl) {
579  return DOMString();
580  }
581  return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
582 }
583 
585 {
586  if (impl) {
587  ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
588  }
589 }
590 
592 {
593  if (!impl) {
594  return DOMString();
595  }
596  return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER);
597 }
598 
600 {
601  if (impl) {
602  ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value);
603  }
604 }
605 
607 {
608  if (!impl) {
609  return DOMString();
610  }
611  return ((ElementImpl *)impl)->getAttribute(ATTR_CELLPADDING);
612 }
613 
615 {
616  if (impl) {
617  ((ElementImpl *)impl)->setAttribute(ATTR_CELLPADDING, value);
618  }
619 }
620 
622 {
623  if (!impl) {
624  return DOMString();
625  }
626  return ((ElementImpl *)impl)->getAttribute(ATTR_CELLSPACING);
627 }
628 
630 {
631  if (impl) {
632  ((ElementImpl *)impl)->setAttribute(ATTR_CELLSPACING, value);
633  }
634 }
635 
637 {
638  if (!impl) {
639  return DOMString();
640  }
641  return ((ElementImpl *)impl)->getAttribute(ATTR_FRAME);
642 }
643 
645 {
646  if (impl) {
647  ((ElementImpl *)impl)->setAttribute(ATTR_FRAME, value);
648  }
649 }
650 
652 {
653  if (!impl) {
654  return DOMString();
655  }
656  return ((ElementImpl *)impl)->getAttribute(ATTR_RULES);
657 }
658 
660 {
661  if (impl) {
662  ((ElementImpl *)impl)->setAttribute(ATTR_RULES, value);
663  }
664 }
665 
667 {
668  if (!impl) {
669  return DOMString();
670  }
671  return ((ElementImpl *)impl)->getAttribute(ATTR_SUMMARY);
672 }
673 
675 {
676  if (impl) {
677  ((ElementImpl *)impl)->setAttribute(ATTR_SUMMARY, value);
678  }
679 }
680 
682 {
683  if (!impl) {
684  return DOMString();
685  }
686  return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
687 }
688 
690 {
691  if (impl) {
692  ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
693  }
694 }
695 
697 {
698  if (!impl) {
699  return nullptr;
700  }
701  return ((HTMLTableElementImpl *)impl)->createTHead();
702 }
703 
705 {
706  if (impl) {
707  ((HTMLTableElementImpl *)impl)->deleteTHead();
708  }
709 }
710 
712 {
713  if (!impl) {
714  return nullptr;
715  }
716  return ((HTMLTableElementImpl *)impl)->createTFoot();
717 }
718 
720 {
721  if (impl) {
722  ((HTMLTableElementImpl *)impl)->deleteTFoot();
723  }
724 }
725 
727 {
728  if (!impl) {
729  return nullptr;
730  }
731  return ((HTMLTableElementImpl *)impl)->createCaption();
732 }
733 
735 {
736  if (impl) {
737  ((HTMLTableElementImpl *)impl)->deleteCaption();
738  }
739 }
740 
742 {
743  if (!impl) {
744  return nullptr;
745  }
746  int exceptioncode = 0;
747  HTMLElementImpl *ret = ((HTMLTableElementImpl *)impl)->insertRow(index, exceptioncode);
748  if (exceptioncode) {
749  throw DOMException(exceptioncode);
750  }
751  return ret;
752 }
753 
755 {
756  int exceptioncode = 0;
757  if (impl) {
758  ((HTMLTableElementImpl *)impl)->deleteRow(index, exceptioncode);
759  }
760  if (exceptioncode) {
761  throw DOMException(exceptioncode);
762  }
763 }
764 
765 // --------------------------------------------------------------------------
766 
767 HTMLTableRowElement::HTMLTableRowElement() : HTMLElement()
768 {
769 }
770 
771 HTMLTableRowElement::HTMLTableRowElement(const HTMLTableRowElement &other) : HTMLElement(other)
772 {
773 }
774 
775 HTMLTableRowElement::HTMLTableRowElement(HTMLTableRowElementImpl *impl) : HTMLElement(impl)
776 {
777 }
778 
779 HTMLTableRowElement &HTMLTableRowElement::operator = (const Node &other)
780 {
781  assignOther(other, ID_TR);
782  return *this;
783 }
784 
785 HTMLTableRowElement &HTMLTableRowElement::operator = (const HTMLTableRowElement &other)
786 {
787  HTMLElement::operator = (other);
788  return *this;
789 }
790 
791 HTMLTableRowElement::~HTMLTableRowElement()
792 {
793 }
794 
796 {
797  if (!impl) {
798  return 0;
799  }
800  return ((HTMLTableRowElementImpl *)impl)->rowIndex();
801 }
802 
803 void HTMLTableRowElement::setRowIndex(long /*_rowIndex*/)
804 {
805  throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
806 }
807 
809 {
810  if (!impl) {
811  return 0;
812  }
813  return ((HTMLTableRowElementImpl *)impl)->sectionRowIndex();
814 }
815 
816 void HTMLTableRowElement::setSectionRowIndex(long /*_sectionRowIndex*/)
817 {
818  throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
819 }
820 
822 {
823  if (!impl) {
824  return HTMLCollection();
825  }
826  return HTMLCollection(impl, HTMLCollectionImpl::TR_CELLS);
827 }
828 
830 {
831  throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
832 }
833 
835 {
836  if (!impl) {
837  return DOMString();
838  }
839  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
840 }
841 
843 {
844  if (impl) {
845  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
846  }
847 }
848 
850 {
851  if (!impl) {
852  return DOMString();
853  }
854  return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
855 }
856 
858 {
859  if (impl) {
860  ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
861  }
862 }
863 
865 {
866  if (!impl) {
867  return DOMString();
868  }
869  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
870 }
871 
873 {
874  if (impl) {
875  ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
876  }
877 }
878 
880 {
881  if (!impl) {
882  return DOMString();
883  }
884  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
885 }
886 
888 {
889  if (impl) {
890  ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
891  }
892 }
893 
895 {
896  if (!impl) {
897  return DOMString();
898  }
899  return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
900 }
901 
903 {
904  if (impl) {
905  ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
906  }
907 }
908 
910 {
911  if (!impl) {
912  return nullptr;
913  }
914  int exceptioncode = 0;
915  HTMLElementImpl *ret = ((HTMLTableRowElementImpl *)impl)->insertCell(index, exceptioncode);
916  if (exceptioncode) {
917  throw DOMException(exceptioncode);
918  }
919  return ret;
920 }
921 
923 {
924  int exceptioncode = 0;
925  if (impl) {
926  ((HTMLTableRowElementImpl *)impl)->deleteCell(index, exceptioncode);
927  }
928  if (exceptioncode) {
929  throw DOMException(exceptioncode);
930  }
931 }
932 
933 // --------------------------------------------------------------------------
934 
935 HTMLTableSectionElement::HTMLTableSectionElement() : HTMLElement()
936 {
937 }
938 
939 HTMLTableSectionElement::HTMLTableSectionElement(const HTMLTableSectionElement &other) : HTMLElement(other)
940 {
941 }
942 
943 HTMLTableSectionElement::HTMLTableSectionElement(HTMLTableSectionElementImpl *impl) : HTMLElement(impl)
944 {
945 }
946 
947 HTMLTableSectionElement &HTMLTableSectionElement::operator = (const Node &other)
948 {
949  if (other.elementId() != ID_TBODY &&
950  other.elementId() != ID_THEAD &&
951  other.elementId() != ID_TFOOT) {
952  if (impl) {
953  impl->deref();
954  }
955  impl = nullptr;
956  } else {
957  Node::operator = (other);
958  }
959  return *this;
960 }
961 
962 HTMLTableSectionElement &HTMLTableSectionElement::operator = (const HTMLTableSectionElement &other)
963 {
964  HTMLElement::operator = (other);
965  return *this;
966 }
967 
968 HTMLTableSectionElement::~HTMLTableSectionElement()
969 {
970 }
971 
973 {
974  if (!impl) {
975  return DOMString();
976  }
977  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
978 }
979 
981 {
982  if (impl) {
983  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
984  }
985 }
986 
988 {
989  if (!impl) {
990  return DOMString();
991  }
992  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
993 }
994 
996 {
997  if (impl) {
998  ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
999  }
1000 }
1001 
1003 {
1004  if (!impl) {
1005  return DOMString();
1006  }
1007  return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
1008 }
1009 
1011 {
1012  if (impl) {
1013  ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
1014  }
1015 }
1016 
1018 {
1019  if (!impl) {
1020  return DOMString();
1021  }
1022  return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
1023 }
1024 
1026 {
1027  if (impl) {
1028  ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
1029  }
1030 }
1031 
1033 {
1034  if (!impl) {
1035  return HTMLCollection();
1036  }
1037  return HTMLCollection(impl, HTMLCollectionImpl::TSECTION_ROWS);
1038 }
1039 
1041 {
1042  if (!impl) {
1043  return nullptr;
1044  }
1045  int exceptioncode = 0;
1046  HTMLElementImpl *ret = ((HTMLTableSectionElementImpl *)impl)->insertRow(index, exceptioncode);
1047  if (exceptioncode) {
1048  throw DOMException(exceptioncode);
1049  }
1050  return ret;
1051 }
1052 
1054 {
1055  int exceptioncode = 0;
1056  if (impl) {
1057  ((HTMLTableSectionElementImpl *)impl)->deleteRow(index, exceptioncode);
1058  }
1059  if (exceptioncode) {
1060  throw DOMException(exceptioncode);
1061  }
1062 }
1063 
DOMString bgColor() const
Background color for rows.
Definition: html_table.cpp:849
void setColSpan(long)
see colSpan
Definition: html_table.cpp:225
HTMLCollection rows() const
The collection of rows in this table section.
void setSummary(const DOMString &)
see summary
Definition: html_table.cpp:674
DOMString chOff() const
Offset of alignment character.
void setAlign(const DOMString &)
see align
Definition: html_table.cpp:569
void setVAlign(const DOMString &)
see vAlign
Definition: html_table.cpp:317
QString number(int n, int base)
DOMString width() const
Default column width.
Definition: html_table.cpp:453
quint32 elementId() const
Definition: dom_node.cpp:509
All HTML element interfaces derive from this class.
Definition: html_element.h:70
void setHeight(const DOMString &)
see height
Definition: html_table.cpp:256
The object used to represent the TH and TD elements.
Definition: html_table.h:94
DOMString vAlign() const
Vertical alignment of data in cell.
Definition: html_table.cpp:309
void setCellSpacing(const DOMString &)
see cellSpacing
Definition: html_table.cpp:629
HTMLTableSectionElement tFoot() const
Returns the table's TFOOT , or null if none exists.
Definition: html_table.cpp:529
void setBgColor(const DOMString &)
see bgColor
Definition: html_table.cpp:857
long sectionRowIndex() const
The index of this row, relative to the current section ( THEAD , TFOOT , or TBODY ).
Definition: html_table.cpp:808
DOMString axis() const
Names group of related headers.
Definition: html_table.cpp:157
DOMString rules() const
Specifies which internal table borders to render.
Definition: html_table.cpp:651
DOMString chOff() const
Offset of alignment character.
Definition: html_table.cpp:879
void setTHead(const HTMLTableSectionElement &)
see tHead
Definition: html_table.cpp:521
void setSectionRowIndex(long)
see sectionRowIndex
Definition: html_table.cpp:816
void setVAlign(const DOMString &)
see vAlign
Definition: html_table.cpp:902
void deleteRow(long index)
Delete a table row.
Definition: html_table.cpp:754
long colSpan() const
Number of columns spanned by cell.
Definition: html_table.cpp:217
void deleteTFoot()
Delete the footer from the table, if one exists.
Definition: html_table.cpp:719
DOMString align() const
Horizontal alignment of data in cells.
Definition: html_table.cpp:972
void setSpan(long)
see span
Definition: html_table.cpp:430
This library provides a full-featured HTML parser and widget.
Table caption See the CAPTION element definition in HTML 4.0.
Definition: html_table.h:48
DOMString abbr() const
Abbreviation for header cells.
Definition: html_table.cpp:127
void setWidth(const DOMString &)
see width
Definition: html_table.cpp:461
An HTMLCollection is a list of nodes.
Definition: html_misc.h:133
void setAlign(const DOMString &)
see align
Definition: html_table.cpp:69
long rowSpan() const
Number of rows spanned by cell.
Definition: html_table.cpp:278
void setAxis(const DOMString &)
see axis
Definition: html_table.cpp:165
void deleteCell(long index)
Delete a cell from the current row.
Definition: html_table.cpp:922
long span() const
Indicates the number of columns in a group or affected by a grouping.
Definition: html_table.cpp:422
DOMString bgColor() const
Cell background color.
Definition: html_table.cpp:172
DOMString bgColor() const
Cell background color.
Definition: html_table.cpp:576
void setAlign(const DOMString &)
see align
Definition: html_table.cpp:842
void setCellIndex(long)
see cellIndex
Definition: html_table.cpp:122
void setRowSpan(long)
see rowSpan
Definition: html_table.cpp:286
void setRules(const DOMString &)
see rules
Definition: html_table.cpp:659
void setCh(const DOMString &)
see ch
Definition: html_table.cpp:872
void setChOff(const DOMString &)
see chOff
Definition: html_table.cpp:210
DOMString ch() const
Alignment character for cells in a column.
Definition: html_table.cpp:392
void setCellPadding(const DOMString &)
see cellPadding
Definition: html_table.cpp:614
The create* and delete* methods on the table allow authors to construct and modify tables.
Definition: html_table.h:448
HTMLElement insertRow(long index)
Insert a new empty row in the table.
Definition: html_table.cpp:741
void setBgColor(const DOMString &)
see bgColor
Definition: html_table.cpp:180
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impos...
Definition: dom_exception.h:58
long rowIndex() const
The index of this row, relative to the entire table.
Definition: html_table.cpp:795
DOMString vAlign() const
Vertical alignment of data within cells of this row.
Definition: html_table.cpp:894
void setAbbr(const DOMString &)
see abbr
Definition: html_table.cpp:135
void setRowIndex(long)
see rowIndex
Definition: html_table.cpp:803
void setCh(const DOMString &)
see ch
Definition: html_table.cpp:995
void setChOff(const DOMString &)
see chOff
Definition: html_table.cpp:887
bool noWrap() const
Suppress word wrapping.
Definition: html_table.cpp:263
DOMString ch() const
Alignment character for cells in a column.
Definition: html_table.cpp:864
unsigned long index() const
Definition: dom_node.cpp:517
DOMString chOff() const
Offset of alignment character.
Definition: html_table.cpp:202
void setTFoot(const HTMLTableSectionElement &)
see tFoot
Definition: html_table.cpp:537
HTMLElement insertCell(long index)
Insert an empty TD cell into this row.
Definition: html_table.cpp:909
DOMString vAlign() const
Vertical alignment of data in cells.
DOMString align() const
Horizontal alignment of cell data in column.
Definition: html_table.cpp:377
void deleteCaption()
Delete the table caption, if one exists.
Definition: html_table.cpp:734
void setVAlign(const DOMString &)
see vAlign
void setAlign(const DOMString &)
see align
Definition: html_table.cpp:385
DOMString align() const
Caption alignment with respect to the table.
Definition: html_table.cpp:61
void setCh(const DOMString &)
see ch
Definition: html_table.cpp:195
DOMString frame() const
Specifies which external table borders to render.
Definition: html_table.cpp:636
void setWidth(const DOMString &)
see width
Definition: html_table.cpp:332
Regroups the COL and COLGROUP elements.
Definition: html_table.h:327
The THEAD , TFOOT , and TBODY elements.
Definition: html_table.h:906
void setNoWrap(bool)
see noWrap
Definition: html_table.cpp:271
HTMLElement createTHead()
Create a table header row or return an existing one.
Definition: html_table.cpp:696
DOMString width() const
Cell width.
Definition: html_table.cpp:324
void setCaption(const HTMLTableCaptionElement &)
see caption
Definition: html_table.cpp:506
void setFrame(const DOMString &)
see frame
Definition: html_table.cpp:644
HTMLCollection tBodies() const
Returns a collection of the table bodies (including implicit ones).
Definition: html_table.cpp:553
void setBorder(const DOMString &)
see border
Definition: html_table.cpp:599
HTMLCollection rows() const
Returns a collection of all the rows in the table, including all in THEAD , TFOOT ,...
Definition: html_table.cpp:545
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOMString height() const
Cell height.
Definition: html_table.cpp:248
long cellIndex() const
The index of this cell in the row.
Definition: html_table.cpp:114
void setVAlign(const DOMString &)
see vAlign
Definition: html_table.cpp:446
DOMString cellSpacing() const
Specifies the horizontal and vertical separation between cells.
Definition: html_table.cpp:621
DOMString align() const
Specifies the table's position with respect to the rest of the document.
Definition: html_table.cpp:561
DOMString vAlign() const
Vertical alignment of cell data in column.
Definition: html_table.cpp:438
DOMString headers() const
List of id attribute values for header cells.
Definition: html_table.cpp:233
void setCh(const DOMString &)
see ch
Definition: html_table.cpp:400
DOMString ch() const
Alignment character for cells in a column.
Definition: html_table.cpp:187
void setAlign(const DOMString &)
see align
Definition: html_table.cpp:980
void setChOff(const DOMString &)
see chOff
HTMLTableCaptionElement caption() const
Returns the table's CAPTION , or void if none exists.
Definition: html_table.cpp:498
HTMLElement createTFoot()
Create a table footer row or return an existing one.
Definition: html_table.cpp:711
void setScope(const DOMString &)
see scope
Definition: html_table.cpp:302
DOMString align() const
Horizontal alignment of data within cells of this row.
Definition: html_table.cpp:834
A row in a table.
Definition: html_table.h:734
void setChOff(const DOMString &)
see chOff
Definition: html_table.cpp:415
void setHeaders(const DOMString &)
see headers
Definition: html_table.cpp:241
void setCells(const HTMLCollection &)
see cells
Definition: html_table.cpp:829
DOMString summary() const
Supplementary description about the purpose or structure of a table.
Definition: html_table.cpp:666
void deleteTHead()
Delete the header from the table, if one exists.
Definition: html_table.cpp:704
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
void setAlign(const DOMString &)
see align
Definition: html_table.cpp:150
void setWidth(const DOMString &)
see width
Definition: html_table.cpp:689
HTMLElement insertRow(long index)
Insert a row into this section.
DOMString scope() const
Scope covered by header cells.
Definition: html_table.cpp:294
DOMString chOff() const
Offset of alignment character.
Definition: html_table.cpp:407
void setBgColor(const DOMString &)
see bgColor
Definition: html_table.cpp:584
void deleteRow(long index)
Delete a row from this section.
HTMLCollection cells() const
The collection of cells in this row.
Definition: html_table.cpp:821
DOMString align() const
Horizontal alignment of data in cell.
Definition: html_table.cpp:142
DOMString ch() const
Alignment character for cells in a column.
Definition: html_table.cpp:987
HTMLElement createCaption()
Create a new table caption object or return an existing one.
Definition: html_table.cpp:726
DOMString cellPadding() const
Specifies the horizontal and vertical space between cell content and cell borders.
Definition: html_table.cpp:606
DOMString border() const
The width of the border around the table.
Definition: html_table.cpp:591
DOMString width() const
Specifies the desired table width.
Definition: html_table.cpp:681
HTMLTableSectionElement tHead() const
Returns the table's THEAD , or null if none exists.
Definition: html_table.cpp:513
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:55:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.