fix logic
[personal-kdelibs.git] / khtml / rendering / render_br.h
blob7f2e482edf8fe8a92fe2b799e2019f747a4fdcf5
1 /*
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., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef RENDER_BR_H
23 #define RENDER_BR_H
25 #include "render_text.h"
27 namespace DOM {
28 class Position;
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
35 namespace khtml {
37 class RenderBR : public RenderText
39 public:
40 RenderBR(DOM::NodeImpl* node);
41 virtual ~RenderBR();
43 virtual const char *renderName() const { return "RenderBR"; }
45 virtual void paint( PaintInfo&, int, int) {}
47 virtual unsigned int width(unsigned int, unsigned int, const Font *) const { return 0; }
48 virtual unsigned int width( unsigned int, unsigned int, bool) const { return 0; }
49 virtual short width() const { return RenderText::width(); }
51 virtual int height() const { return 0; }
53 // overrides
54 virtual void calcMinMaxWidth() {}
55 virtual short minWidth() const { return 0; }
56 virtual int maxWidth() const { return 0; }
58 virtual FindSelectionResult checkSelectionPoint( int _x, int _y, int _tx, int _ty,
59 DOM::NodeImpl*& node, int & offset,
60 SelPointState & );
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);
69 #if 0
70 virtual void caretPos(int offset, int flags, int &_x, int &_y, int &width, int &height) const;
71 #endif
73 virtual InlineBox *inlineBox(long offset);
78 #endif