2 * This file is part of the DOM implementation for KDE.
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
21 * This file includes excerpts from the Document Object Model (DOM)
22 * Level 1 Specification (Recommendation)
23 * http://www.w3.org/TR/REC-DOM-Level-1/
24 * Copyright © World Wide Web Consortium , (Massachusetts Institute of
25 * Technology , Institut National de Recherche en Informatique et en
26 * Automatique , Keio University ). All Rights Reserved.
32 #include <khtml_export.h>
33 #include <dom/html_element.h>
37 class HTMLBaseFontElementImpl
;
39 class HTMLCollectionImpl
;
42 * Base font. See the <a
43 * href="http://www.w3.org/TR/REC-html40/present/graphics.html#edef-BASEFONT">
44 * BASEFONT element definition </a> in HTML 4.0. This element is
45 * deprecated in HTML 4.0.
48 class KHTML_EXPORT HTMLBaseFontElement
: public HTMLElement
51 HTMLBaseFontElement();
52 HTMLBaseFontElement(const HTMLBaseFontElement
&other
);
53 HTMLBaseFontElement(const Node
&other
) : HTMLElement()
56 HTMLBaseFontElement(HTMLBaseFontElementImpl
*impl
);
59 HTMLBaseFontElement
& operator = (const HTMLBaseFontElement
&other
);
60 HTMLBaseFontElement
& operator = (const Node
&other
);
62 ~HTMLBaseFontElement();
65 * Font color. See the <a href="http://www.w3.org/TR/REC-html40/">
66 * color attribute definition </a> in HTML 4.0. This attribute is
67 * deprecated in HTML 4.0.
70 DOMString
color() const;
75 void setColor( const DOMString
& );
78 * Font face identifier. See the <a
79 * href="http://www.w3.org/TR/REC-html40/"> face attribute
80 * definition </a> in HTML 4.0. This attribute is deprecated in
84 DOMString
face() const;
89 void setFace( const DOMString
& );
92 * Computed Font size. See the <a
93 * href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-size-BASEFONT">
94 * size attribute definition </a> in HTML 4.0. This attribute is
95 * deprecated in HTML 4.0.
103 void setSize( long );
108 KDE_DEPRECATED DOMString
size() const;
113 KDE_DEPRECATED
void setSize( const DOMString
& );
116 // --------------------------------------------------------------------------
119 * An \c HTMLCollection is a list of nodes. An individual
120 * node may be accessed by either ordinal index or the node's
121 * \c name or \c id attributes. Note: Collections in
122 * the HTML DOM are assumed to be live meaning that they are
123 * automatically updated when the underlying document is changed.
126 class KHTML_EXPORT HTMLCollection
128 friend class HTMLDocument
;
129 friend class HTMLSelectElement
;
130 friend class HTMLImageElement
;
131 friend class HTMLMapElement
;
132 friend class HTMLTableElement
;
133 friend class HTMLTableRowElement
;
134 friend class HTMLTableSectionElement
;
135 friend class HTMLLayerElement
;
136 friend class HTMLElement
;
140 HTMLCollection(const HTMLCollection
&other
);
142 HTMLCollection(HTMLCollectionImpl
* impl
);
143 HTMLCollection(NodeImpl
*base
, int type
);
146 HTMLCollection
& operator = (const HTMLCollection
&other
);
151 * This attribute specifies the length or size of the list.
154 unsigned long length() const;
157 * This method retrieves a node specified by ordinal index. Nodes
158 * are numbered in tree order (depth-first traversal order).
160 * @param index The index of the node to be fetched. The index
163 * @return The \c Node at the corresponding position
164 * upon success. A value of \c null is returned if the
165 * index is out of range.
168 Node
item ( unsigned long index
) const;
171 * This method retrieves a \c Node using a name. It
172 * first searches for a \c Node with a matching
173 * \c id attribute. If it doesn't find one, it then searches
174 * for a \c Node with a matching \c name
175 * attribute, but only on those elements that are allowed a name
178 * @param name The name of the \c Node to be fetched.
180 * @return The \c Node with a \c name or
181 * \c id attribute whose value corresponds to the
182 * specified string. Upon failure (e.g., no node with this name
183 * exists), returns \c null .
186 Node
namedItem ( const DOMString
&name
) const;
190 * not part of the DOM
193 HTMLCollectionImpl
*handle() const;
196 Node
firstItem() const;
197 Node
nextItem() const;
198 // In case of multiple items named the same way
199 Node
nextNamedItem( const DOMString
&name
) const;
202 HTMLCollectionImpl
*impl
;
205 class KHTML_EXPORT HTMLFormCollection
: public HTMLCollection
207 friend class HTMLFormElement
;
209 HTMLFormCollection(NodeImpl
*base
);