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
31 #include "html/html_elementimpl.h"
32 #include "html/html_objectimpl.h"
33 #include "misc/khtmllayout.h"
40 class RenderPartObject
;
46 class CSSStyleSheetImpl
;
47 class HTMLFrameElement
;
49 // -------------------------------------------------------------------------
51 class HTMLBodyElementImpl
: public HTMLElementImpl
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
; }
79 CSSStyleSheetImpl
*m_styleSheet
;
84 // -------------------------------------------------------------------------
86 class HTMLFrameElementImpl
: public HTMLPartContainerElementImpl
88 friend class khtml::RenderFrame
;
89 friend class khtml::RenderPartObject
;
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;
112 DOMString name
; //Computed name for the frame map
116 Qt::ScrollBarPolicy scrolling
;
118 bool frameBorder
: 1;
119 bool frameBorderSet
: 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
;
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
);
155 khtml::Length
* m_rows
;
156 khtml::Length
* m_cols
;
162 bool frameborder
: 1;
163 bool frameBorderSet
: 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
176 HTMLHeadElementImpl(DocumentImpl
*doc
)
177 : HTMLElementImpl(doc
) {}
179 virtual Id
id() const;
182 // -------------------------------------------------------------------------
184 class HTMLHtmlElementImpl
: public HTMLElementImpl
187 HTMLHtmlElementImpl(DocumentImpl
*doc
)
188 : HTMLElementImpl(doc
) {}
190 virtual Id
id() const;
194 // -------------------------------------------------------------------------
196 class HTMLIFrameElementImpl
: public HTMLFrameElementImpl
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
);