24 #include "dom/html_misc.h"
25 #include "dom/html_table.h"
26 #include "dom/dom_exception.h"
28 #include "html/html_miscimpl.h"
29 #include "html/html_tableimpl.h"
30 #include "misc/htmlhashes.h"
34 HTMLTableCaptionElement::HTMLTableCaptionElement() :
HTMLElement()
42 HTMLTableCaptionElement::HTMLTableCaptionElement(HTMLTableCaptionElementImpl *impl) :
HTMLElement(impl)
48 assignOther( other, ID_CAPTION );
54 HTMLElement::operator = (other);
58 HTMLTableCaptionElement::~HTMLTableCaptionElement()
65 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
70 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
75 HTMLTableCellElement::HTMLTableCellElement() :
HTMLElement()
83 HTMLTableCellElement::HTMLTableCellElement(HTMLTableCellElementImpl *impl) :
HTMLElement(impl)
89 if( other.elementId() != ID_TD &&
90 other.elementId() != ID_TH )
92 if ( impl ) impl->deref();
95 Node::operator = (other);
102 HTMLElement::operator = (other);
106 HTMLTableCellElement::~HTMLTableCellElement()
113 return ((HTMLTableCellElementImpl *)impl)->cellIndex();
118 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
124 return ((ElementImpl *)impl)->getAttribute(ATTR_ABBR);
129 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ABBR, value);
135 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
140 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
146 return ((ElementImpl *)impl)->getAttribute(ATTR_AXIS);
151 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_AXIS, value);
157 return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
162 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
168 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
173 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
179 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
184 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
190 return ((ElementImpl *)impl)->getAttribute(ATTR_COLSPAN).toInt();
196 DOMString value(TQString::number(_colSpan));
197 ((ElementImpl *)impl)->setAttribute(ATTR_COLSPAN,value);
204 return ((ElementImpl *)impl)->getAttribute(ATTR_HEADERS);
209 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEADERS, value);
215 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT);
220 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value);
225 if(!impl)
return false;
226 return !((ElementImpl *)impl)->getAttribute(ATTR_NOWRAP).isNull();
232 ((ElementImpl *)impl)->setAttribute(ATTR_NOWRAP, _noWrap ?
"" : 0);
238 return ((ElementImpl *)impl)->getAttribute(ATTR_ROWSPAN).toInt();
244 DOMString value(TQString::number(_rowSpan));
245 ((ElementImpl *)impl)->setAttribute(ATTR_ROWSPAN,value);
252 return ((ElementImpl *)impl)->getAttribute(ATTR_SCOPE);
257 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCOPE, value);
263 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
268 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
274 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
279 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
284 HTMLTableColElement::HTMLTableColElement() :
HTMLElement()
292 HTMLTableColElement::HTMLTableColElement(HTMLTableColElementImpl *impl) :
HTMLElement(impl)
298 if( other.elementId() != ID_COL &&
299 other.elementId() != ID_COLGROUP )
301 if ( impl ) impl->deref();
304 Node::operator = (other);
311 HTMLElement::operator = (other);
315 HTMLTableColElement::~HTMLTableColElement()
322 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
327 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
333 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
338 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
344 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
349 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
355 return ((ElementImpl *)impl)->getAttribute(ATTR_SPAN).toInt();
361 DOMString value(TQString::number(_span));
362 ((ElementImpl *)impl)->setAttribute(ATTR_SPAN,value);
369 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
374 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
380 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
385 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
390 HTMLTableElement::HTMLTableElement() :
HTMLElement()
398 HTMLTableElement::HTMLTableElement(HTMLTableElementImpl *impl) :
HTMLElement(impl)
404 assignOther( other, ID_TABLE );
410 HTMLElement::operator = (other);
414 HTMLTableElement::~HTMLTableElement()
421 return ((HTMLTableElementImpl *)impl)->caption();
427 ((HTMLTableElementImpl *)impl)
428 ->setCaption( ((HTMLTableCaptionElementImpl *)_caption.impl) );
434 return ((HTMLTableElementImpl *)impl)->tHead();
441 ((HTMLTableElementImpl *)impl)
442 ->setTHead( ((HTMLTableSectionElementImpl *)_tHead.impl) );
448 return ((HTMLTableElementImpl *)impl)->tFoot();
455 ((HTMLTableElementImpl *)impl)
456 ->setTFoot( ((HTMLTableSectionElementImpl *)_tFoot.impl) );
474 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
479 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
485 return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
490 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
496 return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER);
501 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value);
507 return ((ElementImpl *)impl)->getAttribute(ATTR_CELLPADDING);
512 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CELLPADDING, value);
518 return ((ElementImpl *)impl)->getAttribute(ATTR_CELLSPACING);
523 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CELLSPACING, value);
529 return ((ElementImpl *)impl)->getAttribute(ATTR_FRAME);
534 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FRAME, value);
540 return ((ElementImpl *)impl)->getAttribute(ATTR_RULES);
545 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_RULES, value);
551 return ((ElementImpl *)impl)->getAttribute(ATTR_SUMMARY);
556 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SUMMARY, value);
562 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
567 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
573 return ((HTMLTableElementImpl *)impl)->createTHead( );
579 ((HTMLTableElementImpl *)impl)->deleteTHead( );
585 return ((HTMLTableElementImpl *)impl)->createTFoot( );
591 ((HTMLTableElementImpl *)impl)->deleteTFoot( );
597 return ((HTMLTableElementImpl *)impl)->createCaption( );
603 ((HTMLTableElementImpl *)impl)->deleteCaption( );
609 int exceptioncode = 0;
610 HTMLElementImpl* ret = ((HTMLTableElementImpl *)impl)->insertRow( index, exceptioncode );
618 int exceptioncode = 0;
620 ((HTMLTableElementImpl *)impl)->deleteRow( index, exceptioncode );
627 HTMLTableRowElement::HTMLTableRowElement() :
HTMLElement()
635 HTMLTableRowElement::HTMLTableRowElement(HTMLTableRowElementImpl *impl) :
HTMLElement(impl)
641 assignOther( other, ID_TR );
647 HTMLElement::operator = (other);
651 HTMLTableRowElement::~HTMLTableRowElement()
658 return ((HTMLTableRowElementImpl *)impl)->rowIndex();
663 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
669 return ((HTMLTableRowElementImpl *)impl)->sectionRowIndex();
674 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
685 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
691 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
696 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
702 return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
707 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
713 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
718 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
724 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
729 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
735 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
740 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
746 int exceptioncode = 0;
747 HTMLElementImpl* ret = ((HTMLTableRowElementImpl *)impl)->insertCell( index, exceptioncode );
755 int exceptioncode = 0;
757 ((HTMLTableRowElementImpl *)impl)->deleteCell( index, exceptioncode );
764 HTMLTableSectionElement::HTMLTableSectionElement() :
HTMLElement()
772 HTMLTableSectionElement::HTMLTableSectionElement(HTMLTableSectionElementImpl *impl) :
HTMLElement(impl)
778 if(other.elementId() != ID_TBODY &&
779 other.elementId() != ID_THEAD &&
780 other.elementId() != ID_TFOOT )
782 if ( impl ) impl->deref();
785 Node::operator = (other);
792 HTMLElement::operator = (other);
796 HTMLTableSectionElement::~HTMLTableSectionElement()
803 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
808 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
814 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAR);
819 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAR, value);
825 return ((ElementImpl *)impl)->getAttribute(ATTR_CHAROFF);
830 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHAROFF, value);
836 return ((ElementImpl *)impl)->getAttribute(ATTR_VALIGN);
841 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALIGN, value);
853 int exceptioncode = 0;
854 HTMLElementImpl* ret = ((HTMLTableSectionElementImpl *)impl)->insertRow( index, exceptioncode );
862 int exceptioncode = 0;
864 ((HTMLTableSectionElementImpl *)impl)->deleteRow( index, exceptioncode );