HTML Frames fixes
[kdelibs.git] / khtml / html / html_baseimpl.h
blob78b35cee904ce33e89d43e7746f9a620c6411563
1 /*
2 * This file is part of the DOM implementation for KDE.
4 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
5 * (C) 2000-2003 Dirk Mueller (mueller@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * (C) 2000 Simon Hausmann <hausmann@kde.org>
8 * Copyright (C) 2002 Apple Computer, Inc.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public License
21 * along with this library; see the file COPYING.LIB. If not, write to
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
27 #ifndef HTML_BASEIMPL_H
28 #define HTML_BASEIMPL_H
30 #include "html/dtd.h"
31 #include "html/html_elementimpl.h"
32 #include "html/html_objectimpl.h"
33 #include "misc/khtmllayout.h"
35 class KHTMLPart;
37 namespace khtml {
38 class RenderFrameSet;
39 class RenderFrame;
40 class RenderPartObject;
43 namespace DOM {
45 class DOMString;
46 class CSSStyleSheetImpl;
47 class HTMLFrameElement;
49 // -------------------------------------------------------------------------
51 class HTMLBodyElementImpl : public HTMLElementImpl
53 public:
54 HTMLBodyElementImpl(DocumentImpl *doc);
55 ~HTMLBodyElementImpl();
57 virtual Id id() const;
59 DOMString aLink() const;
60 void setALink( const DOMString &value );
61 DOMString bgColor() const;
62 void setBgColor( const DOMString &value );
63 DOMString link() const;
64 void setLink( const DOMString &value );
65 DOMString text() const;
66 void setText( const DOMString &value );
67 DOMString vLink() const;
68 void setVLink( const DOMString &value );
70 virtual void parseAttribute(AttributeImpl *);
71 virtual void attach();
73 virtual void insertedIntoDocument();
74 virtual void removedFromDocument();
76 CSSStyleSheetImpl *sheet() const { return m_styleSheet; }
78 protected:
79 CSSStyleSheetImpl *m_styleSheet;
80 bool m_bgSet;
81 bool m_fgSet;
84 // -------------------------------------------------------------------------
86 class HTMLFrameElementImpl : public HTMLPartContainerElementImpl
88 friend class khtml::RenderFrame;
89 friend class khtml::RenderPartObject;
91 public:
92 HTMLFrameElementImpl(DocumentImpl *doc);
94 ~HTMLFrameElementImpl();
96 virtual Id id() const;
98 virtual void parseAttribute(AttributeImpl *);
99 virtual void attach();
100 virtual void defaultEventHandler(EventImpl *evt);
102 bool noResize() { return noresize; }
103 void setLocation( const DOMString& str );
105 virtual bool isFocusable() const;
106 virtual void setFocus(bool);
108 DocumentImpl* contentDocument() const;
109 KHTMLPart* contentPart() const;
111 DOMString url;
112 DOMString name; //Computed name for the frame map
114 int marginWidth;
115 int marginHeight;
116 Qt::ScrollBarPolicy scrolling;
118 bool frameBorder : 1;
119 bool frameBorderSet : 1;
120 bool noresize : 1;
122 void ensureUniqueName();
123 virtual void computeContent();
124 virtual void setWidgetNotify(QWidget *widget);
127 // -------------------------------------------------------------------------
129 class HTMLFrameSetElementImpl : public HTMLElementImpl
131 friend class khtml::RenderFrameSet;
132 public:
133 HTMLFrameSetElementImpl(DocumentImpl *doc);
135 ~HTMLFrameSetElementImpl();
137 virtual Id id() const;
139 virtual void parseAttribute(AttributeImpl *);
140 virtual void attach();
142 virtual void defaultEventHandler(EventImpl *evt);
144 bool frameBorder() { return frameborder; }
145 bool noResize() { return noresize; }
147 int totalRows() const { return m_totalRows; }
148 int totalCols() const { return m_totalCols; }
149 int border() const { return m_border; }
150 virtual void detach();
152 virtual void recalcStyle( StyleChange ch );
154 protected:
155 khtml::Length* m_rows;
156 khtml::Length* m_cols;
158 int m_totalRows;
159 int m_totalCols;
160 int m_border;
162 bool frameborder : 1;
163 bool frameBorderSet : 1;
164 bool noresize : 1;
165 bool m_resizing : 1; // is the user resizing currently
167 EventListener* m_onLoad;
168 EventListener* m_onUnLoad;
171 // -------------------------------------------------------------------------
173 class HTMLHeadElementImpl : public HTMLElementImpl
175 public:
176 HTMLHeadElementImpl(DocumentImpl *doc)
177 : HTMLElementImpl(doc) {}
179 virtual Id id() const;
182 // -------------------------------------------------------------------------
184 class HTMLHtmlElementImpl : public HTMLElementImpl
186 public:
187 HTMLHtmlElementImpl(DocumentImpl *doc)
188 : HTMLElementImpl(doc) {}
190 virtual Id id() const;
194 // -------------------------------------------------------------------------
196 class HTMLIFrameElementImpl : public HTMLFrameElementImpl
198 public:
199 HTMLIFrameElementImpl(DocumentImpl *doc);
201 ~HTMLIFrameElementImpl();
203 virtual Id id() const;
205 virtual void parseAttribute(AttributeImpl *attr);
206 virtual void attach();
208 virtual void computeContent();
209 virtual void setWidgetNotify(QWidget *widget);
210 protected:
212 void updateFrame();
213 bool m_frame;
217 } //namespace
219 #endif