khtml Library API Documentation

html_inline.cpp

00001 
00024 // --------------------------------------------------------------------------
00025 
00026 #include "dom/dom_doc.h"
00027 #include "dom/html_inline.h"
00028 #include "html/html_inlineimpl.h"
00029 #include "html/html_baseimpl.h"
00030 #include "xml/dom_docimpl.h"
00031 #include "misc/htmlhashes.h"
00032 
00033 using namespace DOM;
00034 
00035 HTMLAnchorElement::HTMLAnchorElement() : HTMLElement()
00036 {
00037 }
00038 
00039 HTMLAnchorElement::HTMLAnchorElement(const HTMLAnchorElement &other) : HTMLElement(other)
00040 {
00041 }
00042 
00043 HTMLAnchorElement::HTMLAnchorElement(HTMLAnchorElementImpl *impl) : HTMLElement(impl)
00044 {
00045 }
00046 
00047 HTMLAnchorElement &HTMLAnchorElement::operator = (const Node &other)
00048 {
00049     assignOther( other, ID_A );
00050     return *this;
00051 }
00052 
00053 HTMLAnchorElement &HTMLAnchorElement::operator = (const HTMLAnchorElement &other)
00054 {
00055     HTMLElement::operator = (other);
00056     return *this;
00057 }
00058 
00059 HTMLAnchorElement::~HTMLAnchorElement()
00060 {
00061 }
00062 
00063 DOMString HTMLAnchorElement::accessKey() const
00064 {
00065     if(!impl) return DOMString();
00066     return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
00067 }
00068 
00069 void HTMLAnchorElement::setAccessKey( const DOMString &value )
00070 {
00071     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value);
00072 }
00073 
00074 DOMString HTMLAnchorElement::charset() const
00075 {
00076     if(!impl) return DOMString();
00077     return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
00078 }
00079 
00080 void HTMLAnchorElement::setCharset( const DOMString &value )
00081 {
00082     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
00083 }
00084 
00085 DOMString HTMLAnchorElement::coords() const
00086 {
00087     if(!impl) return DOMString();
00088     return ((ElementImpl *)impl)->getAttribute(ATTR_COORDS);
00089 }
00090 
00091 void HTMLAnchorElement::setCoords( const DOMString &value )
00092 {
00093     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COORDS, value);
00094 }
00095 
00096 DOMString HTMLAnchorElement::href() const
00097 {
00098     if(!impl) return DOMString();
00099     return ((ElementImpl *)impl)->getAttribute(ATTR_HREF);
00100 }
00101 
00102 void HTMLAnchorElement::setHref( const DOMString &value )
00103 {
00104     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
00105 }
00106 
00107 DOMString HTMLAnchorElement::hreflang() const
00108 {
00109     if(!impl) return DOMString();
00110     return ((ElementImpl *)impl)->getAttribute(ATTR_HREFLANG);
00111 }
00112 
00113 void HTMLAnchorElement::setHreflang( const DOMString &value )
00114 {
00115     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREFLANG, value);
00116 }
00117 
00118 DOMString HTMLAnchorElement::name() const
00119 {
00120     if(!impl) return DOMString();
00121     return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
00122 }
00123 
00124 void HTMLAnchorElement::setName( const DOMString &value )
00125 {
00126     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
00127 }
00128 
00129 DOMString HTMLAnchorElement::rel() const
00130 {
00131     if(!impl) return DOMString();
00132     return ((ElementImpl *)impl)->getAttribute(ATTR_REL);
00133 }
00134 
00135 void HTMLAnchorElement::setRel( const DOMString &value )
00136 {
00137     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REL, value);
00138 }
00139 
00140 DOMString HTMLAnchorElement::rev() const
00141 {
00142     if(!impl) return DOMString();
00143     return ((ElementImpl *)impl)->getAttribute(ATTR_REV);
00144 }
00145 
00146 void HTMLAnchorElement::setRev( const DOMString &value )
00147 {
00148     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REV, value);
00149 }
00150 
00151 DOMString HTMLAnchorElement::shape() const
00152 {
00153     if(!impl) return DOMString();
00154     return ((ElementImpl *)impl)->getAttribute(ATTR_SHAPE);
00155 }
00156 
00157 void HTMLAnchorElement::setShape( const DOMString &value )
00158 {
00159     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SHAPE, value);
00160 }
00161 
00162 long HTMLAnchorElement::tabIndex() const
00163 {
00164     if(!impl) return 0;
00165     return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt();
00166 }
00167 
00168 void HTMLAnchorElement::setTabIndex( long _tabIndex )
00169 {
00170     if(impl) {
00171     DOMString value(QString::number(_tabIndex));
00172         ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value);
00173     }
00174 }
00175 
00176 DOMString HTMLAnchorElement::target() const
00177 {
00178     if(!impl) return DOMString();
00179     return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
00180 }
00181 
00182 void HTMLAnchorElement::setTarget( const DOMString &value )
00183 {
00184     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
00185 }
00186 
00187 DOMString HTMLAnchorElement::type() const
00188 {
00189     if(!impl) return DOMString();
00190     return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
00191 }
00192 
00193 void HTMLAnchorElement::setType( const DOMString &value )
00194 {
00195     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
00196 }
00197 
00198 void HTMLAnchorElement::blur(  )
00199 {
00200     if(impl && impl->getDocument()->focusNode()==impl)
00201         impl->getDocument()->setFocusNode(0);
00202 }
00203 
00204 void HTMLAnchorElement::focus(  )
00205 {
00206     if(impl)
00207         impl->getDocument()->setFocusNode(static_cast<ElementImpl*>(impl));
00208 }
00209 
00210 // --------------------------------------------------------------------------
00211 
00212 HTMLBRElement::HTMLBRElement() : HTMLElement()
00213 {
00214 }
00215 
00216 HTMLBRElement::HTMLBRElement(const HTMLBRElement &other) : HTMLElement(other)
00217 {
00218 }
00219 
00220 HTMLBRElement::HTMLBRElement(HTMLBRElementImpl *impl) : HTMLElement(impl)
00221 {
00222 }
00223 
00224 HTMLBRElement &HTMLBRElement::operator = (const Node &other)
00225 {
00226     assignOther( other, ID_BR );
00227     return *this;
00228 }
00229 
00230 HTMLBRElement &HTMLBRElement::operator = (const HTMLBRElement &other)
00231 {
00232     HTMLElement::operator = (other);
00233     return *this;
00234 }
00235 
00236 HTMLBRElement::~HTMLBRElement()
00237 {
00238 }
00239 
00240 DOMString HTMLBRElement::clear() const
00241 {
00242     if(!impl) return DOMString();
00243     return ((ElementImpl *)impl)->getAttribute(ATTR_CLEAR);
00244 }
00245 
00246 void HTMLBRElement::setClear( const DOMString &value )
00247 {
00248     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLEAR, value);
00249 }
00250 
00251 // --------------------------------------------------------------------------
00252 
00253 HTMLFontElement::HTMLFontElement() : HTMLElement()
00254 {
00255 }
00256 
00257 HTMLFontElement::HTMLFontElement(const HTMLFontElement &other) : HTMLElement(other)
00258 {
00259 }
00260 
00261 HTMLFontElement::HTMLFontElement(HTMLFontElementImpl *impl) : HTMLElement(impl)
00262 {
00263 }
00264 
00265 HTMLFontElement &HTMLFontElement::operator = (const Node &other)
00266 {
00267     assignOther( other, ID_FONT );
00268     return *this;
00269 }
00270 
00271 HTMLFontElement &HTMLFontElement::operator = (const HTMLFontElement &other)
00272 {
00273     HTMLElement::operator = (other);
00274     return *this;
00275 }
00276 
00277 HTMLFontElement::~HTMLFontElement()
00278 {
00279 }
00280 
00281 DOMString HTMLFontElement::color() const
00282 {
00283     if(!impl) return DOMString();
00284     return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
00285 }
00286 
00287 void HTMLFontElement::setColor( const DOMString &value )
00288 {
00289     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
00290 }
00291 
00292 DOMString HTMLFontElement::face() const
00293 {
00294     if(!impl) return DOMString();
00295     return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
00296 }
00297 
00298 void HTMLFontElement::setFace( const DOMString &value )
00299 {
00300     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
00301 }
00302 
00303 DOMString HTMLFontElement::size() const
00304 {
00305     if(!impl) return DOMString();
00306     return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
00307 }
00308 
00309 void HTMLFontElement::setSize( const DOMString &value )
00310 {
00311     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
00312 }
00313 
00314 
00315 // --------------------------------------------------------------------------
00316 
00317 HTMLModElement::HTMLModElement() : HTMLElement()
00318 {
00319 }
00320 
00321 HTMLModElement::HTMLModElement(const HTMLModElement &other) : HTMLElement(other)
00322 {
00323 }
00324 
00325 HTMLModElement::HTMLModElement(HTMLElementImpl *_impl)
00326     : HTMLElement()
00327 {
00328     if (_impl && (_impl->id() == ID_INS || _impl->id() == ID_DEL))
00329         impl = _impl;
00330     else
00331         impl = 0;
00332     if ( impl ) impl->ref();
00333 }
00334 
00335 HTMLModElement &HTMLModElement::operator = (const Node &other)
00336 {
00337     if (other.handle() != handle()) {
00338         if( other.elementId() != ID_INS &&
00339             other.elementId() != ID_DEL )
00340         {
00341             if ( impl ) impl->deref();
00342             impl = 0;
00343         } else {
00344             Node::operator = (other);
00345         }
00346     }
00347     return *this;
00348 }
00349 
00350 HTMLModElement &HTMLModElement::operator = (const HTMLModElement &other)
00351 {
00352     HTMLElement::operator = (other);
00353     return *this;
00354 }
00355 
00356 HTMLModElement::~HTMLModElement()
00357 {
00358 }
00359 
00360 DOMString HTMLModElement::cite() const
00361 {
00362     if(!impl) return DOMString();
00363     return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
00364 }
00365 
00366 void HTMLModElement::setCite( const DOMString &value )
00367 {
00368     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
00369 }
00370 
00371 DOMString HTMLModElement::dateTime() const
00372 {
00373     if(!impl) return DOMString();
00374     return ((ElementImpl *)impl)->getAttribute(ATTR_DATETIME);
00375 }
00376 
00377 void HTMLModElement::setDateTime( const DOMString &value )
00378 {
00379     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATETIME, value);
00380 }
00381 
00382 // --------------------------------------------------------------------------
00383 
00384 HTMLQuoteElement::HTMLQuoteElement() : HTMLElement()
00385 {
00386 }
00387 
00388 HTMLQuoteElement::HTMLQuoteElement(const HTMLQuoteElement &other) : HTMLElement(other)
00389 {
00390 }
00391 
00392 HTMLQuoteElement::HTMLQuoteElement(HTMLGenericElementImpl *_impl)
00393     : HTMLElement()
00394 {
00395     if (_impl && _impl->id() == ID_Q)
00396         impl = _impl;
00397     else
00398         impl = 0;
00399     if ( impl ) impl->ref();
00400 }
00401 
00402 HTMLQuoteElement &HTMLQuoteElement::operator = (const Node &other)
00403 {
00404     assignOther( other, ID_Q );
00405     return *this;
00406 }
00407 
00408 HTMLQuoteElement &HTMLQuoteElement::operator = (const HTMLQuoteElement &other)
00409 {
00410     HTMLElement::operator = (other);
00411     return *this;
00412 }
00413 
00414 HTMLQuoteElement::~HTMLQuoteElement()
00415 {
00416 }
00417 
00418 DOMString HTMLQuoteElement::cite() const
00419 {
00420     if(!impl) return DOMString();
00421     return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
00422 }
00423 
00424 void HTMLQuoteElement::setCite( const DOMString &value )
00425 {
00426     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
00427 }
00428 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:37 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001