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 RenderTableCol(Node*);
38
children()39 const RenderObjectChildList* children() const { return &m_children; }
children()40 RenderObjectChildList* children() { return &m_children; }
41
42 virtual void calcPrefWidths();
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; }
lineHeight(bool)53 virtual int lineHeight(bool) const { return 0; }
54 virtual void updateFromElement();
55
56 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
57 virtual bool canHaveChildren() const;
requiresLayer()58 virtual bool requiresLayer() const { return false; }
59
60 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
61 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
62
63 RenderTable* table() const;
64
65 RenderObjectChildList m_children;
66 int m_span;
67 };
68
toRenderTableCol(RenderObject * object)69 inline RenderTableCol* toRenderTableCol(RenderObject* object)
70 {
71 ASSERT(!object || object->isTableCol());
72 return static_cast<RenderTableCol*>(object);
73 }
74
toRenderTableCol(const RenderObject * object)75 inline const RenderTableCol* toRenderTableCol(const RenderObject* object)
76 {
77 ASSERT(!object || object->isTableCol());
78 return static_cast<const RenderTableCol*>(object);
79 }
80
81 // This will catch anyone doing an unnecessary cast.
82 void toRenderTableCol(const RenderTableCol*);
83
84 }
85
86 #endif
87