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.
22 // --------------------------------------------------------------------------
24 #include "dom/html_misc.h"
25 #include "html/html_miscimpl.h"
26 #include "misc/htmlhashes.h"
30 HTMLBaseFontElement::HTMLBaseFontElement() : HTMLElement()
34 HTMLBaseFontElement::HTMLBaseFontElement(const HTMLBaseFontElement &other) : HTMLElement(other)
38 HTMLBaseFontElement::HTMLBaseFontElement(HTMLBaseFontElementImpl *impl) : HTMLElement(impl)
42 HTMLBaseFontElement &HTMLBaseFontElement::operator = (const Node &other)
44 assignOther( other, ID_BASEFONT );
48 HTMLBaseFontElement &HTMLBaseFontElement::operator = (const HTMLBaseFontElement &other)
50 HTMLElement::operator = (other);
54 HTMLBaseFontElement::~HTMLBaseFontElement()
58 DOMString HTMLBaseFontElement::color() const
60 if(!impl) return DOMString();
61 return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
64 void HTMLBaseFontElement::setColor( const DOMString &value )
66 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
69 DOMString HTMLBaseFontElement::face() const
71 if(!impl) return DOMString();
72 return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
75 void HTMLBaseFontElement::setFace( const DOMString &value )
77 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
80 DOMString HTMLBaseFontElement::size() const
82 if(!impl) return DOMString();
83 return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
86 void HTMLBaseFontElement::setSize( const DOMString &value )
88 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
91 // --------------------------------------------------------------------------
93 HTMLCollection::HTMLCollection()
98 HTMLCollection::HTMLCollection(const HTMLCollection &other)
101 if(impl) impl->ref();
104 HTMLCollection::HTMLCollection(NodeImpl *base, int type)
106 impl = new HTMLCollectionImpl(base, type);
110 HTMLCollection &HTMLCollection::operator = (const HTMLCollection &other)
112 if(impl != other.impl) {
113 if(impl) impl->deref();
115 if(impl) impl->ref();
120 HTMLCollection::~HTMLCollection()
122 if(impl) impl->deref();
125 unsigned long HTMLCollection::length() const
128 return ((HTMLCollectionImpl *)impl)->length();
131 Node HTMLCollection::item( unsigned long index ) const
134 return ((HTMLCollectionImpl *)impl)->item( index );
137 Node HTMLCollection::namedItem( const DOMString &name ) const
140 return ((HTMLCollectionImpl *)impl)->namedItem( name );
143 Node HTMLCollection::base() const
148 return static_cast<HTMLCollectionImpl*>( impl )->base;
151 Node HTMLCollection::firstItem() const
155 return static_cast<HTMLCollectionImpl*>( impl )->firstItem();
158 Node HTMLCollection::nextItem() const
162 return static_cast<HTMLCollectionImpl*>( impl )->nextItem();
165 Node HTMLCollection::nextNamedItem( const DOMString &name ) const
169 return static_cast<HTMLCollectionImpl*>( impl )->nextNamedItem( name );
172 HTMLCollectionImpl *HTMLCollection::handle() const
177 bool HTMLCollection::isNull() const
183 // -----------------------------------------------------------------------------
185 HTMLFormCollection::HTMLFormCollection(NodeImpl *base)
188 impl = new HTMLFormCollectionImpl(base);