| # khtml Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# html_misc.cpp

    00001
    00023 // --------------------------------------------------------------------------
    00024
    00025 #include "dom/html_misc.h"
    00026 #include "html/html_miscimpl.h"
    00027 #include "misc/htmlhashes.h"
    00028
    00029 using namespace DOM;
    00030
    00031 HTMLBaseFontElement::HTMLBaseFontElement() : HTMLElement()
    00032 {
    00033 }
    00034
    00035 HTMLBaseFontElement::HTMLBaseFontElement(const HTMLBaseFontElement &other) : HTMLElement(other)
    00036 {
    00037 }
    00038
    00039 HTMLBaseFontElement::HTMLBaseFontElement(HTMLBaseFontElementImpl *impl) : HTMLElement(impl)
    00040 {
    00041 }
    00042
    00043 HTMLBaseFontElement &HTMLBaseFontElement::operator = (const Node &other)
    00044 {
    00045     assignOther( other, ID_BASEFONT );
    00046     return *this;
    00047 }
    00048
    00049 HTMLBaseFontElement &HTMLBaseFontElement::operator = (const HTMLBaseFontElement &other)
    00050 {
    00051     HTMLElement::operator = (other);
    00052     return *this;
    00053 }
    00054
    00055 HTMLBaseFontElement::~HTMLBaseFontElement()
    00056 {
    00057 }
    00058
    00059 DOMString HTMLBaseFontElement::color() const
    00060 {
    00061     if(!impl) return DOMString();
    00062     return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
    00063 }
    00064
    00065 void HTMLBaseFontElement::setColor( const DOMString &value )
    00066 {
    00067     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
    00068 }
    00069
    00070 DOMString HTMLBaseFontElement::face() const
    00071 {
    00072     if(!impl) return DOMString();
    00073     return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
    00074 }
    00075
    00076 void HTMLBaseFontElement::setFace( const DOMString &value )
    00077 {
    00078     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
    00079 }
    00080
    00081 DOMString HTMLBaseFontElement::size() const
    00082 {
    00083     if(!impl) return DOMString();
    00084     return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
    00085 }
    00086
    00087 void HTMLBaseFontElement::setSize( const DOMString &value )
    00088 {
    00089     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
    00090 }
    00091
    00092 long HTMLBaseFontElement::getSize() const
    00093 {
    00094     if(!impl) return 0;
    00095     return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
    00096 }
    00097
    00098 void HTMLBaseFontElement::setSize( long _value )
    00099 {
    00100     if ( impl )
    00101     {
    00102         DOMString value( QString::number( _value ) );
    00103         ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
    00104     }
    00105 }
    00106
    00107
    00108 // --------------------------------------------------------------------------
    00109
    00110 HTMLCollection::HTMLCollection()
    00111   : impl(0)
    00112 {
    00113 }
    00114
    00115 HTMLCollection::HTMLCollection(const HTMLCollection &other)
    00116 {
    00117     impl = other.impl;
    00118     if(impl) impl->ref();
    00119 }
    00120
    00121 HTMLCollection::HTMLCollection(NodeImpl *base, int type)
    00122 {
    00123     impl = new HTMLCollectionImpl(base, type);
    00124     impl->ref();
    00125 }
    00126
    00127 HTMLCollection &HTMLCollection::operator = (const HTMLCollection &other)
    00128 {
    00129     if(impl != other.impl) {
    00130         if(impl) impl->deref();
    00131         impl = other.impl;
    00132         if(impl) impl->ref();
    00133     }
    00134     return *this;
    00135 }
    00136
    00137 HTMLCollection::~HTMLCollection()
    00138 {
    00139     if(impl) impl->deref();
    00140 }
    00141
    00142 unsigned long HTMLCollection::length() const
    00143 {
    00144     if(!impl) return 0;
    00145     return ((HTMLCollectionImpl *)impl)->length();
    00146 }
    00147
    00148 Node HTMLCollection::item( unsigned long index ) const
    00149 {
    00150     if(!impl) return 0;
    00151     return ((HTMLCollectionImpl *)impl)->item( index );
    00152 }
    00153
    00154 Node HTMLCollection::namedItem( const DOMString &name ) const
    00155 {
    00156     if(!impl) return 0;
    00157     return ((HTMLCollectionImpl *)impl)->namedItem( name );
    00158 }
    00159
    00160 Node HTMLCollection::base() const
    00161 {
    00162     if ( !impl )
    00163         return 0;
    00164
    00165     return static_cast<HTMLCollectionImpl*>( impl )->base;
    00166 }
    00167
    00168 Node HTMLCollection::firstItem() const
    00169 {
    00170     if ( !impl )
    00171         return 0;
    00172     return static_cast<HTMLCollectionImpl*>( impl )->firstItem();
    00173 }
    00174
    00175 Node HTMLCollection::nextItem() const
    00176 {
    00177     if ( !impl )
    00178         return 0;
    00179     return static_cast<HTMLCollectionImpl*>( impl )->nextItem();
    00180 }
    00181
    00182 Node HTMLCollection::nextNamedItem( const DOMString &name ) const
    00183 {
    00184     if ( !impl )
    00185         return 0;
    00186     return static_cast<HTMLCollectionImpl*>( impl )->nextNamedItem( name );
    00187 }
    00188
    00189 HTMLCollectionImpl *HTMLCollection::handle() const
    00190 {
    00191     return impl;
    00192 }
    00193
    00194 bool HTMLCollection::isNull() const
    00195 {
    00196     return (impl == 0);
    00197 }
    00198
    00199
    00200 // -----------------------------------------------------------------------------
    00201
    00202 HTMLFormCollection::HTMLFormCollection(NodeImpl *base)
    00203     : HTMLCollection()
    00204 {
    00205     impl = new HTMLFormCollectionImpl(base);
    00206     impl->ref();
    00207 }
    00208

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:33:55 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001