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.
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 long HTMLBaseFontElement::getSize() const
94 return ((ElementImpl
*)impl
)->getAttribute(ATTR_SIZE
).toInt();
97 void HTMLBaseFontElement::setSize( long _value
)
101 DOMString
value( QString::number( _value
) );
102 ((ElementImpl
*)impl
)->setAttribute(ATTR_SIZE
, value
);
107 // --------------------------------------------------------------------------
109 HTMLCollection::HTMLCollection()
114 HTMLCollection::HTMLCollection(HTMLCollectionImpl
* _impl
): impl(_impl
)
116 if (impl
) impl
->ref();
119 HTMLCollection::HTMLCollection(const HTMLCollection
&other
)
122 if(impl
) impl
->ref();
125 HTMLCollection::HTMLCollection(NodeImpl
*base
, int type
)
127 impl
= new HTMLCollectionImpl(base
, type
);
131 HTMLCollection
&HTMLCollection::operator = (const HTMLCollection
&other
)
133 if(impl
!= other
.impl
) {
134 if(impl
) impl
->deref();
136 if(impl
) impl
->ref();
141 HTMLCollection::~HTMLCollection()
143 if(impl
) impl
->deref();
146 unsigned long HTMLCollection::length() const
149 return ((HTMLCollectionImpl
*)impl
)->length();
152 Node
HTMLCollection::item( unsigned long index
) const
155 return ((HTMLCollectionImpl
*)impl
)->item( index
);
158 Node
HTMLCollection::namedItem( const DOMString
&name
) const
161 return ((HTMLCollectionImpl
*)impl
)->namedItem( name
);
164 Node
HTMLCollection::base() const
169 return static_cast<HTMLCollectionImpl
*>( impl
)->m_refNode
;
172 Node
HTMLCollection::firstItem() const
176 return static_cast<HTMLCollectionImpl
*>( impl
)->firstItem();
179 Node
HTMLCollection::nextItem() const
183 return static_cast<HTMLCollectionImpl
*>( impl
)->nextItem();
186 Node
HTMLCollection::nextNamedItem( const DOMString
&name
) const
190 return static_cast<HTMLCollectionImpl
*>( impl
)->nextNamedItem( name
);
193 HTMLCollectionImpl
*HTMLCollection::handle() const
198 bool HTMLCollection::isNull() const
204 // -----------------------------------------------------------------------------
206 HTMLFormCollection::HTMLFormCollection(NodeImpl
*base
)
209 impl
= new HTMLFormCollectionImpl(base
);