1 /*
2  * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3  *           (C) 1997 Torben Weis (weis@kde.org)
4  *           (C) 1998 Waldo Bastian (bastian@kde.org)
5  *           (C) 1999 Lars Knoll (knoll@kde.org)
6  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
7  * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
8  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public License
21  * along with this library; see the file COPYING.LIB.  If not, write to
22  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23  * Boston, MA 02110-1301, USA.
24  */
25 
26 #ifndef RenderTableCol_h
27 #define RenderTableCol_h
28 
29 #include "RenderBox.h"
30 
31 namespace WebCore {
32 
33 class RenderTable;
34 
35 class RenderTableCol : public RenderBox {
36 public:
37     explicit RenderTableCol(Node*);
38 
children()39     const RenderObjectChildList* children() const { return &m_children; }
children()40     RenderObjectChildList* children() { return &m_children; }
41 
42     virtual void computePreferredLogicalWidths();
43 
span()44     int span() const { return m_span; }
setSpan(int span)45     void setSpan(int span) { m_span = span; }
46 
47 private:
virtualChildren()48     virtual RenderObjectChildList* virtualChildren() { return children(); }
virtualChildren()49     virtual const RenderObjectChildList* virtualChildren() const { return children(); }
50 
renderName()51     virtual const char* renderName() const { return "RenderTableCol"; }
isTableCol()52     virtual bool isTableCol() const { return true; }
53     virtual void updateFromElement();
54 
55     virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
56     virtual bool canHaveChildren() const;
requiresLayer()57     virtual bool requiresLayer() const { return false; }
58 
59     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
60     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
61 
62     RenderTable* table() const;
63 
64     RenderObjectChildList m_children;
65     int m_span;
66 };
67 
toRenderTableCol(RenderObject * object)68 inline RenderTableCol* toRenderTableCol(RenderObject* object)
69 {
70     ASSERT(!object || object->isTableCol());
71     return static_cast<RenderTableCol*>(object);
72 }
73 
toRenderTableCol(const RenderObject * object)74 inline const RenderTableCol* toRenderTableCol(const RenderObject* object)
75 {
76     ASSERT(!object || object->isTableCol());
77     return static_cast<const RenderTableCol*>(object);
78 }
79 
80 // This will catch anyone doing an unnecessary cast.
81 void toRenderTableCol(const RenderTableCol*);
82 
83 }
84 
85 #endif
86