# khtml Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# 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     DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
    00100     return href.length() ? impl->getDocument()->completeURL(href.string()) : href;
    00101 }
    00102
    00103 void HTMLAnchorElement::setHref( const DOMString &value )
    00104 {
    00105     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
    00106 }
    00107
    00108 DOMString HTMLAnchorElement::hreflang() const
    00109 {
    00110     if(!impl) return DOMString();
    00111     return ((ElementImpl *)impl)->getAttribute(ATTR_HREFLANG);
    00112 }
    00113
    00114 void HTMLAnchorElement::setHreflang( const DOMString &value )
    00115 {
    00116     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREFLANG, value);
    00117 }
    00118
    00119 DOMString HTMLAnchorElement::name() const
    00120 {
    00121     if(!impl) return DOMString();
    00122     return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
    00123 }
    00124
    00125 void HTMLAnchorElement::setName( const DOMString &value )
    00126 {
    00127     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
    00128 }
    00129
    00130 DOMString HTMLAnchorElement::rel() const
    00131 {
    00132     if(!impl) return DOMString();
    00133     return ((ElementImpl *)impl)->getAttribute(ATTR_REL);
    00134 }
    00135
    00136 void HTMLAnchorElement::setRel( const DOMString &value )
    00137 {
    00138     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REL, value);
    00139 }
    00140
    00141 DOMString HTMLAnchorElement::rev() const
    00142 {
    00143     if(!impl) return DOMString();
    00144     return ((ElementImpl *)impl)->getAttribute(ATTR_REV);
    00145 }
    00146
    00147 void HTMLAnchorElement::setRev( const DOMString &value )
    00148 {
    00149     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REV, value);
    00150 }
    00151
    00152 DOMString HTMLAnchorElement::shape() const
    00153 {
    00154     if(!impl) return DOMString();
    00155     return ((ElementImpl *)impl)->getAttribute(ATTR_SHAPE);
    00156 }
    00157
    00158 void HTMLAnchorElement::setShape( const DOMString &value )
    00159 {
    00160     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SHAPE, value);
    00161 }
    00162
    00163 long HTMLAnchorElement::tabIndex() const
    00164 {
    00165     if(!impl) return 0;
    00166     return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt();
    00167 }
    00168
    00169 void HTMLAnchorElement::setTabIndex( long _tabIndex )
    00170 {
    00171     if(impl) {
    00172         DOMString value(QString::number(_tabIndex));
    00173         ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value);
    00174     }
    00175 }
    00176
    00177 DOMString HTMLAnchorElement::target() const
    00178 {
    00179     if(!impl) return DOMString();
    00180     return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
    00181 }
    00182
    00183 void HTMLAnchorElement::setTarget( const DOMString &value )
    00184 {
    00185     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
    00186 }
    00187
    00188 DOMString HTMLAnchorElement::type() const
    00189 {
    00190     if(!impl) return DOMString();
    00191     return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
    00192 }
    00193
    00194 void HTMLAnchorElement::setType( const DOMString &value )
    00195 {
    00196     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
    00197 }
    00198
    00199 void HTMLAnchorElement::blur(  )
    00200 {
    00201     if(impl && impl->getDocument()->focusNode()==impl)
    00202         impl->getDocument()->setFocusNode(0);
    00203 }
    00204
    00205 void HTMLAnchorElement::focus(  )
    00206 {
    00207     if(impl)
    00208         impl->getDocument()->setFocusNode(static_cast<ElementImpl*>(impl));
    00209 }
    00210
    00211 // --------------------------------------------------------------------------
    00212
    00213 HTMLBRElement::HTMLBRElement() : HTMLElement()
    00214 {
    00215 }
    00216
    00217 HTMLBRElement::HTMLBRElement(const HTMLBRElement &other) : HTMLElement(other)
    00218 {
    00219 }
    00220
    00221 HTMLBRElement::HTMLBRElement(HTMLBRElementImpl *impl) : HTMLElement(impl)
    00222 {
    00223 }
    00224
    00225 HTMLBRElement &HTMLBRElement::operator = (const Node &other)
    00226 {
    00227     assignOther( other, ID_BR );
    00228     return *this;
    00229 }
    00230
    00231 HTMLBRElement &HTMLBRElement::operator = (const HTMLBRElement &other)
    00232 {
    00233     HTMLElement::operator = (other);
    00234     return *this;
    00235 }
    00236
    00237 HTMLBRElement::~HTMLBRElement()
    00238 {
    00239 }
    00240
    00241 DOMString HTMLBRElement::clear() const
    00242 {
    00243     if(!impl) return DOMString();
    00244     return ((ElementImpl *)impl)->getAttribute(ATTR_CLEAR);
    00245 }
    00246
    00247 void HTMLBRElement::setClear( const DOMString &value )
    00248 {
    00249     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLEAR, value);
    00250 }
    00251
    00252 // --------------------------------------------------------------------------
    00253
    00254 HTMLFontElement::HTMLFontElement() : HTMLElement()
    00255 {
    00256 }
    00257
    00258 HTMLFontElement::HTMLFontElement(const HTMLFontElement &other) : HTMLElement(other)
    00259 {
    00260 }
    00261
    00262 HTMLFontElement::HTMLFontElement(HTMLFontElementImpl *impl) : HTMLElement(impl)
    00263 {
    00264 }
    00265
    00266 HTMLFontElement &HTMLFontElement::operator = (const Node &other)
    00267 {
    00268     assignOther( other, ID_FONT );
    00269     return *this;
    00270 }
    00271
    00272 HTMLFontElement &HTMLFontElement::operator = (const HTMLFontElement &other)
    00273 {
    00274     HTMLElement::operator = (other);
    00275     return *this;
    00276 }
    00277
    00278 HTMLFontElement::~HTMLFontElement()
    00279 {
    00280 }
    00281
    00282 DOMString HTMLFontElement::color() const
    00283 {
    00284     if(!impl) return DOMString();
    00285     return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
    00286 }
    00287
    00288 void HTMLFontElement::setColor( const DOMString &value )
    00289 {
    00290     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
    00291 }
    00292
    00293 DOMString HTMLFontElement::face() const
    00294 {
    00295     if(!impl) return DOMString();
    00296     return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
    00297 }
    00298
    00299 void HTMLFontElement::setFace( const DOMString &value )
    00300 {
    00301     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
    00302 }
    00303
    00304 DOMString HTMLFontElement::size() const
    00305 {
    00306     if(!impl) return DOMString();
    00307     return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
    00308 }
    00309
    00310 void HTMLFontElement::setSize( const DOMString &value )
    00311 {
    00312     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
    00313 }
    00314
    00315
    00316 // --------------------------------------------------------------------------
    00317
    00318 HTMLModElement::HTMLModElement() : HTMLElement()
    00319 {
    00320 }
    00321
    00322 HTMLModElement::HTMLModElement(const HTMLModElement &other) : HTMLElement(other)
    00323 {
    00324 }
    00325
    00326 HTMLModElement::HTMLModElement(HTMLElementImpl *_impl)
    00327     : HTMLElement()
    00328 {
    00329     if (_impl && (_impl->id() == ID_INS || _impl->id() == ID_DEL))
    00330         impl = _impl;
    00331     else
    00332         impl = 0;
    00333     if ( impl ) impl->ref();
    00334 }
    00335
    00336 HTMLModElement &HTMLModElement::operator = (const Node &other)
    00337 {
    00338     if (other.handle() != handle()) {
    00339         if( other.elementId() != ID_INS &&
    00340             other.elementId() != ID_DEL )
    00341         {
    00342             if ( impl ) impl->deref();
    00343             impl = 0;
    00344         } else {
    00345             Node::operator = (other);
    00346         }
    00347     }
    00348     return *this;
    00349 }
    00350
    00351 HTMLModElement &HTMLModElement::operator = (const HTMLModElement &other)
    00352 {
    00353     HTMLElement::operator = (other);
    00354     return *this;
    00355 }
    00356
    00357 HTMLModElement::~HTMLModElement()
    00358 {
    00359 }
    00360
    00361 DOMString HTMLModElement::cite() const
    00362 {
    00363     if(!impl) return DOMString();
    00364     return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
    00365 }
    00366
    00367 void HTMLModElement::setCite( const DOMString &value )
    00368 {
    00369     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
    00370 }
    00371
    00372 DOMString HTMLModElement::dateTime() const
    00373 {
    00374     if(!impl) return DOMString();
    00375     return ((ElementImpl *)impl)->getAttribute(ATTR_DATETIME);
    00376 }
    00377
    00378 void HTMLModElement::setDateTime( const DOMString &value )
    00379 {
    00380     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATETIME, value);
    00381 }
    00382
    00383 // --------------------------------------------------------------------------
    00384
    00385 HTMLQuoteElement::HTMLQuoteElement() : HTMLElement()
    00386 {
    00387 }
    00388
    00389 HTMLQuoteElement::HTMLQuoteElement(const HTMLQuoteElement &other) : HTMLElement(other)
    00390 {
    00391 }
    00392
    00393 HTMLQuoteElement::HTMLQuoteElement(HTMLGenericElementImpl *_impl)
    00394     : HTMLElement()
    00395 {
    00396     if (_impl && _impl->id() == ID_Q)
    00397         impl = _impl;
    00398     else
    00399         impl = 0;
    00400     if ( impl ) impl->ref();
    00401 }
    00402
    00403 HTMLQuoteElement &HTMLQuoteElement::operator = (const Node &other)
    00404 {
    00405     assignOther( other, ID_Q );
    00406     return *this;
    00407 }
    00408
    00409 HTMLQuoteElement &HTMLQuoteElement::operator = (const HTMLQuoteElement &other)
    00410 {
    00411     HTMLElement::operator = (other);
    00412     return *this;
    00413 }
    00414
    00415 HTMLQuoteElement::~HTMLQuoteElement()
    00416 {
    00417 }
    00418
    00419 DOMString HTMLQuoteElement::cite() const
    00420 {
    00421     if(!impl) return DOMString();
    00422     return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
    00423 }
    00424
    00425 void HTMLQuoteElement::setCite( const DOMString &value )
    00426 {
    00427     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
    00428 }
    00429

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