~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/rendering/AutoTableLayout.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2002 Lars Knoll (knoll@kde.org)
 
3
 *           (C) 2002 Dirk Mueller (mueller@kde.org)
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Library General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2 of the License.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Library General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Library General Public License
 
16
 * along with this library; see the file COPYING.LIB.  If not, write to
 
17
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
 * Boston, MA 02110-1301, USA.
 
19
 */
 
20
 
 
21
#ifndef AutoTableLayout_h
 
22
#define AutoTableLayout_h
 
23
 
 
24
#include "LayoutUnit.h"
 
25
#include "Length.h"
 
26
#include "TableLayout.h"
 
27
#include <wtf/Vector.h>
 
28
 
 
29
namespace WebCore {
 
30
 
 
31
class RenderTable;
 
32
class RenderTableCell;
 
33
 
 
34
class AutoTableLayout : public TableLayout {
 
35
public:
 
36
    AutoTableLayout(RenderTable*);
 
37
    ~AutoTableLayout();
 
38
 
 
39
    virtual void computePreferredLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth);
 
40
    virtual void layout();
 
41
 
 
42
private:
 
43
    void fullRecalc();
 
44
    void recalcColumn(unsigned effCol);
 
45
 
 
46
    int calcEffectiveLogicalWidth();
 
47
 
 
48
    void insertSpanCell(RenderTableCell*);
 
49
 
 
50
    struct Layout {
 
51
        Layout()
 
52
            : minLogicalWidth(0)
 
53
            , maxLogicalWidth(0)
 
54
            , effectiveMinLogicalWidth(0)
 
55
            , effectiveMaxLogicalWidth(0)
 
56
            , computedLogicalWidth(0)
 
57
            , emptyCellsOnly(true)
 
58
        {
 
59
        }
 
60
 
 
61
        Length logicalWidth;
 
62
        Length effectiveLogicalWidth;
 
63
        int minLogicalWidth;
 
64
        int maxLogicalWidth;
 
65
        int effectiveMinLogicalWidth;
 
66
        int effectiveMaxLogicalWidth;
 
67
        int computedLogicalWidth;
 
68
        bool emptyCellsOnly;
 
69
    };
 
70
 
 
71
    Vector<Layout, 4> m_layoutStruct;
 
72
    Vector<RenderTableCell*, 4> m_spanCells;
 
73
    bool m_hasPercent : 1;
 
74
    mutable bool m_effectiveLogicalWidthDirty : 1;
 
75
};
 
76
 
 
77
} // namespace WebCore
 
78
 
 
79
#endif // AutoTableLayout_h