File indexing completed on 2024-11-10 09:38:55

0001 /*
0002  * This file is part of the DOM implementation for KDE.
0003  *
0004  * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  *
0021  */
0022 #ifndef RENDER_BR_H
0023 #define RENDER_BR_H
0024 
0025 #include "render_text.h"
0026 
0027 /*
0028  * The whole class here is a hack to get <br> working, as long as we don't have support for
0029  * CSS2 :before and :after pseudo elements
0030  */
0031 namespace khtml
0032 {
0033 
0034 class RenderBR : public RenderText
0035 {
0036 public:
0037     RenderBR(DOM::NodeImpl *node);
0038     virtual ~RenderBR();
0039 
0040     const char *renderName() const override
0041     {
0042         return "RenderBR";
0043     }
0044 
0045     void paint(PaintInfo &, int, int) override {}
0046 
0047     unsigned int width(unsigned int, unsigned int, const Font *) const override
0048     {
0049         return 0;
0050     }
0051     unsigned int width(unsigned int, unsigned int, bool) const override
0052     {
0053         return 0;
0054     }
0055     short width() const override
0056     {
0057         return RenderText::width();
0058     }
0059 
0060     int height() const override
0061     {
0062         return 0;
0063     }
0064 
0065     // overrides
0066     void calcMinMaxWidth() override {}
0067     short minWidth() const override
0068     {
0069         return 0;
0070     }
0071     int maxWidth() const override
0072     {
0073         return 0;
0074     }
0075 
0076     FindSelectionResult checkSelectionPoint(int _x, int _y, int _tx, int _ty,
0077             DOM::NodeImpl *&node, int &offset,
0078             SelPointState &) override;
0079 
0080     bool isBR() const override
0081     {
0082         return true;
0083     }
0084 
0085     long caretMinOffset() const override;
0086     long caretMaxOffset() const override;
0087     unsigned long caretMaxRenderedOffset() const override;
0088 
0089     RenderPosition positionForCoordinates(int _x, int _y) override;
0090 #if 0
0091     virtual void caretPos(int offset, int flags, int &_x, int &_y, int &width, int &height) const;
0092 #endif
0093 
0094     InlineBox *inlineBox(long offset) override;
0095 
0096 };
0097 
0098 }
0099 #endif