HTML Frames fixes
[kdelibs.git] / khtml / rendering / render_frames.h
blob8d0dc3bd3afae37fc94152f0781f0157367da364
1 /*
2 * This file is part of the KDE project.
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 2000 Simon Hausmann <hausmann@kde.org>
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.
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.
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.
23 #ifndef __render_frames_h__
24 #define __render_frames_h__
26 #include "rendering/render_replaced.h"
27 #include "xml/dom_nodeimpl.h"
28 #include "html/html_baseimpl.h"
30 namespace DOM
32 class HTMLFrameElementImpl;
33 class HTMLElementImpl;
34 class MouseEventImpl;
37 namespace khtml
39 class ChildFrame;
41 class RenderFrameSet : public RenderBox
43 friend class DOM::HTMLFrameSetElementImpl;
44 public:
45 RenderFrameSet( DOM::HTMLFrameSetElementImpl *frameSet );
47 virtual ~RenderFrameSet();
49 virtual const char *renderName() const { return "RenderFrameSet"; }
50 virtual bool isFrameSet() const { return true; }
52 virtual void layout();
54 void positionFrames( );
55 void paintFrameSetRules( QPainter *paint, const QRect& damageRect );
57 bool resizing() const { return m_resizing; }
58 bool noResize() const { return element()->noResize(); }
60 bool userResize( DOM::MouseEventImpl *evt );
61 bool canResize( int _x, int _y);
62 void setResizing(bool e);
64 Qt::CursorShape cursorShape() const { return m_cursor; }
66 bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction hitTestAction, bool inside);
68 DOM::HTMLFrameSetElementImpl *element() const
69 { return static_cast<DOM::HTMLFrameSetElementImpl*>(RenderObject::element()); }
71 #ifdef ENABLE_DUMP
72 virtual void dump(QTextStream &stream, const QString &ind) const;
73 #endif
75 private:
76 Qt::CursorShape m_cursor;
77 int m_oldpos;
78 int m_gridLen[2];
79 int* m_gridDelta[2];
80 int* m_gridLayout[2];
82 bool *m_hSplitVar; // is this split variable?
83 bool *m_vSplitVar;
85 int m_hSplit; // the split currently resized
86 int m_vSplit;
87 int m_hSplitPos;
88 int m_vSplitPos;
90 bool m_resizing;
91 bool m_paint;
92 bool m_clientresizing;
95 class RenderPart : public khtml::RenderWidget
97 Q_OBJECT
98 public:
99 RenderPart(DOM::HTMLElementImpl* node);
101 virtual const char *renderName() const { return "RenderPart"; }
103 virtual void setWidget( QWidget *widget );
105 virtual short intrinsicWidth() const;
106 virtual int intrinsicHeight() const;
108 public Q_SLOTS:
109 virtual void slotViewCleared();
112 class RenderFrame : public khtml::RenderPart
114 Q_OBJECT
115 public:
116 RenderFrame( DOM::HTMLFrameElementImpl *frame );
118 virtual const char *renderName() const { return "RenderFrame"; }
119 virtual bool isFrame() const { return true; }
121 // frames never have padding
122 virtual int paddingTop() const { return 0; }
123 virtual int paddingBottom() const { return 0; }
124 virtual int paddingLeft() const { return 0; }
125 virtual int paddingRight() const { return 0; }
127 DOM::HTMLFrameElementImpl *element() const
128 { return static_cast<DOM::HTMLFrameElementImpl*>(RenderObject::element()); }
130 public Q_SLOTS:
131 void slotViewCleared();
134 // I can hardly call the class RenderObject ;-)
135 class RenderPartObject : public khtml::RenderPart
137 Q_OBJECT
138 public:
139 RenderPartObject( DOM::HTMLElementImpl * );
141 virtual const char *renderName() const { return "RenderPartObject"; }
143 virtual void layout( );
145 virtual bool canHaveBorder() const { return true; }
147 public Q_SLOTS:
148 void slotViewCleared();
153 #endif