2 * This file is part of the DOM implementation for KDE.
4 * (C) 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., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, 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 <dom/html_element.h>
33 #include <qvaluelist.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 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 * 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.
98 DOMString size() const;
103 void setSize( const DOMString & );
106 // --------------------------------------------------------------------------
109 * An <code> HTMLCollection </code> is a list of nodes. An individual
110 * node may be accessed by either ordinal index or the node's <code>
111 * name </code> or <code> id </code> attributes. Note: Collections in
112 * the HTML DOM are assumed to be live meaning that they are
113 * automatically updated when the underlying document is changed.
118 friend class HTMLDocument;
119 friend class HTMLSelectElement;
120 friend class HTMLImageElement;
121 friend class HTMLMapElement;
122 friend class HTMLTableElement;
123 friend class HTMLTableRowElement;
124 friend class HTMLTableSectionElement;
125 friend class HTMLElement;
129 HTMLCollection(const HTMLCollection &other);
130 HTMLCollection(NodeImpl *base, int type);
134 HTMLCollection & operator = (const HTMLCollection &other);
139 * This attribute specifies the length or size of the list.
142 unsigned long length() const;
145 * This method retrieves a node specified by ordinal index. Nodes
146 * are numbered in tree order (depth-first traversal order).
148 * @param index The index of the node to be fetched. The index
151 * @return The <code> Node </code> at the corresponding position
152 * upon success. A value of <code> null </code> is returned if the
153 * index is out of range.
156 Node item ( unsigned long index ) const;
159 * This method retrieves a <code> Node </code> using a name. It
160 * first searches for a <code> Node </code> with a matching <code>
161 * id </code> attribute. If it doesn't find one, it then searches
162 * for a <code> Node </code> with a matching <code> name </code>
163 * attribute, but only on those elements that are allowed a name
166 * @param name The name of the <code> Node </code> to be fetched.
168 * @return The <code> Node </code> with a <code> name </code> or
169 * <code> id </code> attribute whose value corresponds to the
170 * specified string. Upon failure (e.g., no node with this name
171 * exists), returns <code> null </code> .
174 Node namedItem ( const DOMString &name ) const;
178 * not part of the DOM
181 HTMLCollectionImpl *handle() const;
184 Node firstItem() const;
185 Node nextItem() const;
186 // In case of multiple items named the same way
187 Node nextNamedItem( const DOMString &name ) const;
189 QValueList<Node> namedItems( const DOMString &name ) const;
192 HTMLCollectionImpl *impl;
195 class HTMLFormCollection : public HTMLCollection
197 friend class HTMLFormElement;
199 HTMLFormCollection(NodeImpl *base);