KHtml

render_br.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright (C) 2000 Lars Knoll ([email protected])
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 #ifndef RENDER_BR_H
23 #define RENDER_BR_H
24 
25 #include "render_text.h"
26 
27 /*
28  * The whole class here is a hack to get <br> working, as long as we don't have support for
29  * CSS2 :before and :after pseudo elements
30  */
31 namespace khtml
32 {
33 
34 class RenderBR : public RenderText
35 {
36 public:
37  RenderBR(DOM::NodeImpl *node);
38  virtual ~RenderBR();
39 
40  const char *renderName() const override
41  {
42  return "RenderBR";
43  }
44 
45  void paint(PaintInfo &, int, int) override {}
46 
47  unsigned int width(unsigned int, unsigned int, const Font *) const override
48  {
49  return 0;
50  }
51  unsigned int width(unsigned int, unsigned int, bool) const override
52  {
53  return 0;
54  }
55  short width() const override
56  {
57  return RenderText::width();
58  }
59 
60  int height() const override
61  {
62  return 0;
63  }
64 
65  // overrides
66  void calcMinMaxWidth() override {}
67  short minWidth() const override
68  {
69  return 0;
70  }
71  int maxWidth() const override
72  {
73  return 0;
74  }
75 
76  FindSelectionResult checkSelectionPoint(int _x, int _y, int _tx, int _ty,
77  DOM::NodeImpl *&node, int &offset,
78  SelPointState &) override;
79 
80  bool isBR() const override
81  {
82  return true;
83  }
84 
85  long caretMinOffset() const override;
86  long caretMaxOffset() const override;
87  unsigned long caretMaxRenderedOffset() const override;
88 
89  RenderPosition positionForCoordinates(int _x, int _y) override;
90 #if 0
91  virtual void caretPos(int offset, int flags, int &_x, int &_y, int &width, int &height) const;
92 #endif
93 
94  InlineBox *inlineBox(long offset) override;
95 
96 };
97 
98 }
99 #endif
This file is part of the HTML rendering engine for KDE.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.