KHtml

render_frames.h
1 /*
2  * This file is part of the KDE project.
3  *
4  * Copyright (C) 1999 Lars Knoll ([email protected])
5  * (C) 2000 Simon Hausmann <[email protected]>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 #ifndef __render_frames_h__
24 #define __render_frames_h__
25 
26 #include "rendering/render_replaced.h"
27 #include "xml/dom_nodeimpl.h"
28 #include "html/html_baseimpl.h"
29 
30 namespace DOM
31 {
32 class HTMLFrameElementImpl;
33 class HTMLElementImpl;
34 class MouseEventImpl;
35 }
36 
37 namespace khtml
38 {
39 class ChildFrame;
40 
41 class RenderFrameSet : public RenderBox
42 {
43  friend class DOM::HTMLFrameSetElementImpl;
44 public:
45  RenderFrameSet(DOM::HTMLFrameSetElementImpl *frameSet);
46 
47  virtual ~RenderFrameSet();
48 
49  const char *renderName() const override
50  {
51  return "RenderFrameSet";
52  }
53  bool isFrameSet() const override
54  {
55  return true;
56  }
57 
58  void layout() override;
59 
60  void positionFrames();
61  void paintFrameSetRules(QPainter *paint, const QRect &damageRect);
62 
63  bool resizing() const
64  {
65  return m_resizing;
66  }
67  bool noResize() const
68  {
69  return element()->noResize();
70  }
71 
72  bool userResize(DOM::MouseEventImpl *evt);
73  bool canResize(int _x, int _y);
74  void setResizing(bool e);
75 
76  Qt::CursorShape cursorShape() const
77  {
78  return m_cursor;
79  }
80 
81  bool nodeAtPoint(NodeInfo &info, int x, int y, int tx, int ty, HitTestAction hitTestAction, bool inside) override;
82 
83  DOM::HTMLFrameSetElementImpl *element() const
84  {
85  return static_cast<DOM::HTMLFrameSetElementImpl *>(RenderObject::element());
86  }
87 
88 #ifdef ENABLE_DUMP
89  void dump(QTextStream &stream, const QString &ind) const override;
90 #endif
91 
92 private:
93  Qt::CursorShape m_cursor;
94  int m_oldpos;
95  int m_gridLen[2];
96  int *m_gridDelta[2];
97  int *m_gridLayout[2];
98 
99  bool *m_hSplitVar; // is this split variable?
100  bool *m_vSplitVar;
101 
102  int m_hSplit; // the split currently resized
103  int m_vSplit;
104  int m_hSplitPos;
105  int m_vSplitPos;
106 
107  bool m_resizing;
108  bool m_paint;
109  bool m_clientresizing;
110 };
111 
112 class RenderPart : public khtml::RenderWidget
113 {
114  Q_OBJECT
115 public:
116  RenderPart(DOM::HTMLElementImpl *node);
117 
118  const char *renderName() const override
119  {
120  return "RenderPart";
121  }
122 
123  virtual void setWidget(QWidget *widget);
124 
125  short intrinsicWidth() const override;
126  int intrinsicHeight() const override;
127 
128 public Q_SLOTS:
129  virtual void slotViewCleared();
130 };
131 
132 class RenderFrame : public khtml::RenderPart
133 {
134  Q_OBJECT
135 public:
136  RenderFrame(DOM::HTMLFrameElementImpl *frame);
137 
138  const char *renderName() const override
139  {
140  return "RenderFrame";
141  }
142  bool isFrame() const override
143  {
144  return true;
145  }
146 
147  // frames never have padding
148  int paddingTop() const override
149  {
150  return 0;
151  }
152  int paddingBottom() const override
153  {
154  return 0;
155  }
156  int paddingLeft() const override
157  {
158  return 0;
159  }
160  int paddingRight() const override
161  {
162  return 0;
163  }
164 
165  DOM::HTMLFrameElementImpl *element() const
166  {
167  return static_cast<DOM::HTMLFrameElementImpl *>(RenderObject::element());
168  }
169 
170 public Q_SLOTS:
171  void slotViewCleared() override;
172 };
173 
174 // I can hardly call the class RenderObject ;-)
175 class RenderPartObject : public khtml::RenderPart
176 {
177  Q_OBJECT
178 public:
179  RenderPartObject(DOM::HTMLElementImpl *);
180 
181  const char *renderName() const override
182  {
183  return "RenderPartObject";
184  }
185 
186  void layout() override;
187 
188  bool canHaveBorder() const override
189  {
190  return true;
191  }
192 
193 public Q_SLOTS:
194  void slotViewCleared() override;
195 };
196 
197 }
198 
199 #endif
This file is part of the HTML rendering engine for KDE.
CursorShape
This library provides a full-featured HTML parser and widget.
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.