]> git.saurik.com Git - iphone-api.git/blob - WebCore/RenderBR.h
Adding the WebCore headers (for Cydget).
[iphone-api.git] / WebCore / RenderBR.h
1 /*
2 * This file is part of the DOM implementation for KDE.
3 *
4 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #ifndef RenderBR_h
24 #define RenderBR_h
25
26 #include "RenderText.h"
27
28 /*
29 * The whole class here is a hack to get <br> working, as long as we don't have support for
30 * CSS2 :before and :after pseudo elements
31 */
32 namespace WebCore {
33
34 class Position;
35
36 class RenderBR : public RenderText {
37 public:
38 RenderBR(Node*);
39 virtual ~RenderBR();
40
41 virtual const char* renderName() const { return "RenderBR"; }
42
43 virtual IntRect selectionRectForRepaint(RenderBox* /*repaintContainer*/, bool /*clipToVisibleContent*/) { return IntRect(); }
44
45 virtual unsigned width(unsigned /*from*/, unsigned /*len*/, const Font&, int /*xpos*/) const { return 0; }
46 virtual unsigned width(unsigned /*from*/, unsigned /*len*/, int /*xpos*/, bool /*firstLine = false*/) const { return 0; }
47
48 virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const;
49 virtual int baselinePosition(bool firstLine, bool isRootLineBox = false) const;
50
51 // overrides
52 virtual InlineBox* createInlineBox(bool, bool, bool isOnlyRun = false);
53
54 virtual bool isBR() const { return true; }
55
56 virtual int caretMinOffset() const;
57 virtual int caretMaxOffset() const;
58 virtual unsigned caretMaxRenderedOffset() const;
59
60 virtual VisiblePosition positionForCoordinates(int x, int y);
61
62 protected:
63 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
64
65 private:
66 mutable int m_lineHeight;
67 };
68
69 } // namespace WebCore
70
71 #endif // RenderBR_h