KHtml

render_flow.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright (C) 1999-2003 Lars Knoll ([email protected])
5  * (C) 1999-2003 Antti Koivisto ([email protected])
6  * (C) 2002-2003 Dirk Mueller ([email protected])
7  * (C) 2003 Apple Computer, Inc.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public License
20  * along with this library; see the file COPYING.LIB. If not, write to
21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  *
24  */
25 #ifndef RENDER_FLOW_H
26 #define RENDER_FLOW_H
27 
28 #include "render_box.h"
29 #include "bidi.h"
30 #include "render_line.h"
31 
32 namespace khtml
33 {
34 
44 class RenderFlow : public RenderBox
45 {
46 public:
47  RenderFlow(DOM::NodeImpl *node)
48  : RenderBox(node)
49  {
50  m_continuation = nullptr;
51  m_firstLineBox = nullptr;
52  m_lastLineBox = nullptr;
53  }
54 
55  RenderFlow *continuation() const override
56  {
57  return m_continuation;
58  }
59  void setContinuation(RenderFlow *c)
60  {
61  m_continuation = c;
62  }
63  RenderFlow *continuationBefore(const RenderObject *beforeChild);
64 
65  void addChildWithContinuation(RenderObject *newChild, RenderObject *beforeChild);
66  virtual void addChildToFlow(RenderObject *newChild, RenderObject *beforeChild) = 0;
67  void addChild(RenderObject *newChild, RenderObject *beforeChild = nullptr) override;
68 
69  static RenderFlow *createFlow(DOM::NodeImpl *node, RenderStyle *style, RenderArena *arena);
70 
71  void detach() override;
72 
73  void attachLineBox(InlineFlowBox *box);
74  void extractLineBox(InlineFlowBox *box);
75 
76  virtual void deleteLastLineBox(RenderArena *arena = nullptr);
77  void deleteInlineBoxes(RenderArena *arena = nullptr) override;
78  void removeInlineBox(InlineBox *box) override;
79  void dirtyInlineBoxes(bool fullLayout, bool isRootLineBox = false) override;
80 
81  void dirtyLinesFromChangedChild(RenderObject *child) override;
82 
83  InlineFlowBox *firstLineBox() const
84  {
85  return m_firstLineBox;
86  }
87  InlineFlowBox *lastLineBox() const
88  {
89  return m_lastLineBox;
90  }
91 
92  QList< QRectF > getClientRects() override;
93 
94  InlineBox *createInlineBox(bool makePlaceHolderBox, bool isRootLineBox) override;
95 
96  void paintLines(PaintInfo &i, int _tx, int _ty);
97  bool hitTestLines(NodeInfo &i, int x, int y, int tx, int ty, HitTestAction hitTestAction);
98 
99  void repaint(Priority p = NormalPriority) override;
100 
101  int highestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const override;
102  int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const override;
103  int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const override;
104  int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const override;
105 
106 protected:
107  // An inline can be split with blocks occurring in between the inline content.
108  // When this occurs we need a pointer to our next object. We can basically be
109  // split into a sequence of inlines and blocks. The continuation will either be
110  // an anonymous block (that houses other blocks) or it will be an inline flow.
111  RenderFlow *m_continuation;
112 
113  // For block flows, each box represents the root inline box for a line in the
114  // paragraph.
115  // For inline flows, each box represents a portion of that inline.
116  InlineFlowBox *m_firstLineBox;
117  InlineFlowBox *m_lastLineBox;
118 };
119 
120 } //namespace
121 
122 #endif
This file is part of the HTML rendering engine for KDE.
all geometry managing stuff is only in the block elements.
Definition: render_flow.h:44
Base Class for all rendering tree objects.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 7 2020 22:44:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.