]>
git.saurik.com Git - iphone-api.git/blob - WebCore/RenderTableSection.h
2 * This file is part of the DOM implementation for KDE.
4 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
5 * (C) 1997 Torben Weis (weis@kde.org)
6 * (C) 1998 Waldo Bastian (bastian@kde.org)
7 * (C) 1999 Lars Knoll (knoll@kde.org)
8 * (C) 1999 Antti Koivisto (koivisto@kde.org)
9 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
27 #ifndef RenderTableSection_h
28 #define RenderTableSection_h
30 #include "RenderTable.h"
31 #include <wtf/Vector.h>
35 class RenderTableCell
;
38 class RenderTableSection
: public RenderContainer
{
40 RenderTableSection(Node
*);
41 ~RenderTableSection();
43 virtual const char* renderName() const { return isAnonymous() ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
45 virtual bool isTableSection() const { return true; }
47 virtual void destroy();
49 virtual void addChild(RenderObject
* child
, RenderObject
* beforeChild
= 0);
51 virtual int getBaselineOfFirstLineBox() const;
53 void addCell(RenderTableCell
*, RenderTableRow
* row
);
57 int layoutRows(int height
);
59 RenderTable
* table() const { return static_cast<RenderTable
*>(parent()); }
62 RenderTableCell
* cell
;
63 bool inColSpan
; // true for columns after the first in a colspan
66 typedef Vector
<CellStruct
> Row
;
70 RenderTableRow
* rowRenderer
;
75 CellStruct
& cellAt(int row
, int col
) { return (*m_grid
[row
].row
)[col
]; }
76 const CellStruct
& cellAt(int row
, int col
) const { return (*m_grid
[row
].row
)[col
]; }
78 void appendColumn(int pos
);
79 void splitColumn(int pos
, int newSize
);
81 virtual int overflowWidth(bool includeInterior
= true) const { return (!includeInterior
&& hasOverflowClip()) ? width() : m_overflowWidth
; }
82 virtual int overflowLeft(bool includeInterior
= true) const { return (!includeInterior
&& hasOverflowClip()) ? 0 : m_overflowLeft
; }
83 virtual int overflowHeight(bool includeInterior
= true) const { return (!includeInterior
&& hasOverflowClip()) ? height() : m_overflowHeight
; }
84 virtual int overflowTop(bool includeInterior
= true) const { return (!includeInterior
&& hasOverflowClip()) ? 0 : m_overflowTop
; }
86 virtual int lowestPosition(bool includeOverflowInterior
, bool includeSelf
) const;
87 virtual int rightmostPosition(bool includeOverflowInterior
, bool includeSelf
) const;
88 virtual int leftmostPosition(bool includeOverflowInterior
, bool includeSelf
) const;
90 int calcOuterBorderTop() const;
91 int calcOuterBorderBottom() const;
92 int calcOuterBorderLeft(bool rtl
) const;
93 int calcOuterBorderRight(bool rtl
) const;
94 void recalcOuterBorder();
96 int outerBorderTop() const { return m_outerBorderTop
; }
97 int outerBorderBottom() const { return m_outerBorderBottom
; }
98 int outerBorderLeft() const { return m_outerBorderLeft
; }
99 int outerBorderRight() const { return m_outerBorderRight
; }
101 virtual void paint(PaintInfo
&, int tx
, int ty
);
102 virtual void paintObject(PaintInfo
&, int tx
, int ty
);
104 virtual void imageChanged(WrappedImagePtr
, const IntRect
* = 0);
106 int numRows() const { return m_gridRows
; }
107 int numColumns() const;
109 void recalcCellsIfNeeded()
111 if (m_needsCellRecalc
)
115 bool needsCellRecalc() const { return m_needsCellRecalc
; }
116 void setNeedsCellRecalc()
118 m_needsCellRecalc
= true;
119 table()->setNeedsSectionRecalc();
122 int getBaseline(int row
) { return m_grid
[row
].baseline
; }
124 virtual RenderObject
* removeChildNode(RenderObject
*, bool fullRemove
= true);
126 virtual bool nodeAtPoint(const HitTestRequest
&, HitTestResult
&, int x
, int y
, int tx
, int ty
, HitTestAction
);
129 virtual int lineHeight(bool, bool) const { return 0; }
130 virtual void position(InlineBox
*) { }
132 bool ensureRows(int);
135 Vector
<RowStruct
> m_grid
;
137 Vector
<int> m_rowPos
;
139 // the current insertion position
142 bool m_needsCellRecalc
;
144 int m_outerBorderLeft
;
145 int m_outerBorderRight
;
146 int m_outerBorderTop
;
147 int m_outerBorderBottom
;
151 int m_overflowHeight
;
152 bool m_hasOverflowingCell
;
155 } // namespace WebCore
157 #endif // RenderTableSection_h