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