2 * This file is part of the DOM implementation for KDE.
4 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
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.
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.
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., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
25 #include "render_text.h"
32 * The whole class here is a hack to get <br> working, as long as we don't have support for
33 * CSS2 :before and :after pseudo elements
37 class RenderBR : public RenderText
40 RenderBR(DOM::NodeImpl* node);
43 virtual const char *renderName() const { return "RenderBR"; }
45 virtual QRect selectionRect() { return QRect(); }
47 virtual void paint(PaintInfo& i, int tx, int ty) {};
49 virtual unsigned int width(unsigned int, unsigned int, const Font *) const { return 0; }
50 virtual unsigned int width( unsigned int, unsigned int, bool) const { return 0; }
52 virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
53 virtual short baselinePosition( bool firstLine, bool isRootLineBox=false) const;
54 virtual void setStyle(RenderStyle* _style);
57 virtual InlineBox* createInlineBox(bool, bool, bool isOnlyRun = false);
58 virtual void calcMinMaxWidth() {}
59 virtual int minWidth() const { return 0; }
60 virtual int maxWidth() const { return 0; }
62 virtual bool isBR() const { return true; }
64 virtual long caretMinOffset() const;
65 virtual long caretMaxOffset() const;
66 virtual unsigned long caretMaxRenderedOffset() const;
68 virtual DOM::Position positionForCoordinates(int x, int y, EAffinity * = 0);
69 virtual QRect caretRect(int offset, EAffinity affinity = UPSTREAM, int *extraWidthToEndOfLine = 0);
71 virtual InlineBox *inlineBox(long offset, EAffinity affinity = UPSTREAM);
74 mutable short m_lineHeight;