KHTML
html_inline.cpp
Go to the documentation of this file.00001
00023
00024
00025 #include "html_inline.h"
00026 #include "dom_doc.h"
00027
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.isNull() ? impl->document()->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) ((HTMLAnchorElementImpl*)impl)->blur();
00202 }
00203
00204 void HTMLAnchorElement::focus( )
00205 {
00206 if (impl) ((HTMLAnchorElementImpl*)impl)->focus();
00207 }
00208
00209
00210
00211 HTMLBRElement::HTMLBRElement() : HTMLElement()
00212 {
00213 }
00214
00215 HTMLBRElement::HTMLBRElement(const HTMLBRElement &other) : HTMLElement(other)
00216 {
00217 }
00218
00219 HTMLBRElement::HTMLBRElement(HTMLBRElementImpl *impl) : HTMLElement(impl)
00220 {
00221 }
00222
00223 HTMLBRElement &HTMLBRElement::operator = (const Node &other)
00224 {
00225 assignOther( other, ID_BR );
00226 return *this;
00227 }
00228
00229 HTMLBRElement &HTMLBRElement::operator = (const HTMLBRElement &other)
00230 {
00231 HTMLElement::operator = (other);
00232 return *this;
00233 }
00234
00235 HTMLBRElement::~HTMLBRElement()
00236 {
00237 }
00238
00239 DOMString HTMLBRElement::clear() const
00240 {
00241 if(!impl) return DOMString();
00242 return ((ElementImpl *)impl)->getAttribute(ATTR_CLEAR);
00243 }
00244
00245 void HTMLBRElement::setClear( const DOMString &value )
00246 {
00247 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLEAR, value);
00248 }
00249
00250
00251
00252 HTMLFontElement::HTMLFontElement() : HTMLElement()
00253 {
00254 }
00255
00256 HTMLFontElement::HTMLFontElement(const HTMLFontElement &other) : HTMLElement(other)
00257 {
00258 }
00259
00260 HTMLFontElement::HTMLFontElement(HTMLFontElementImpl *impl) : HTMLElement(impl)
00261 {
00262 }
00263
00264 HTMLFontElement &HTMLFontElement::operator = (const Node &other)
00265 {
00266 assignOther( other, ID_FONT );
00267 return *this;
00268 }
00269
00270 HTMLFontElement &HTMLFontElement::operator = (const HTMLFontElement &other)
00271 {
00272 HTMLElement::operator = (other);
00273 return *this;
00274 }
00275
00276 HTMLFontElement::~HTMLFontElement()
00277 {
00278 }
00279
00280 DOMString HTMLFontElement::color() const
00281 {
00282 if(!impl) return DOMString();
00283 return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
00284 }
00285
00286 void HTMLFontElement::setColor( const DOMString &value )
00287 {
00288 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
00289 }
00290
00291 DOMString HTMLFontElement::face() const
00292 {
00293 if(!impl) return DOMString();
00294 return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
00295 }
00296
00297 void HTMLFontElement::setFace( const DOMString &value )
00298 {
00299 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
00300 }
00301
00302 DOMString HTMLFontElement::size() const
00303 {
00304 if(!impl) return DOMString();
00305 return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
00306 }
00307
00308 void HTMLFontElement::setSize( const DOMString &value )
00309 {
00310 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
00311 }
00312
00313
00314
00315
00316 HTMLModElement::HTMLModElement() : HTMLElement()
00317 {
00318 }
00319
00320 HTMLModElement::HTMLModElement(const HTMLModElement &other) : HTMLElement(other)
00321 {
00322 }
00323
00324 HTMLModElement::HTMLModElement(HTMLElementImpl *_impl)
00325 : HTMLElement()
00326 {
00327 if (_impl && (_impl->id() == ID_INS || _impl->id() == ID_DEL))
00328 impl = _impl;
00329 else
00330 impl = 0;
00331 if ( impl ) impl->ref();
00332 }
00333
00334 HTMLModElement &HTMLModElement::operator = (const Node &other)
00335 {
00336 if (other.handle() != handle()) {
00337 if( other.elementId() != ID_INS &&
00338 other.elementId() != ID_DEL )
00339 {
00340 if ( impl ) impl->deref();
00341 impl = 0;
00342 } else {
00343 Node::operator = (other);
00344 }
00345 }
00346 return *this;
00347 }
00348
00349 HTMLModElement &HTMLModElement::operator = (const HTMLModElement &other)
00350 {
00351 HTMLElement::operator = (other);
00352 return *this;
00353 }
00354
00355 HTMLModElement::~HTMLModElement()
00356 {
00357 }
00358
00359 DOMString HTMLModElement::cite() const
00360 {
00361 if(!impl) return DOMString();
00362 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
00363 }
00364
00365 void HTMLModElement::setCite( const DOMString &value )
00366 {
00367 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
00368 }
00369
00370 DOMString HTMLModElement::dateTime() const
00371 {
00372 if(!impl) return DOMString();
00373 return ((ElementImpl *)impl)->getAttribute(ATTR_DATETIME);
00374 }
00375
00376 void HTMLModElement::setDateTime( const DOMString &value )
00377 {
00378 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATETIME, value);
00379 }
00380
00381
00382
00383 HTMLQuoteElement::HTMLQuoteElement() : HTMLElement()
00384 {
00385 }
00386
00387 HTMLQuoteElement::HTMLQuoteElement(const HTMLQuoteElement &other) : HTMLElement(other)
00388 {
00389 }
00390
00391 HTMLQuoteElement::HTMLQuoteElement(HTMLGenericElementImpl *_impl)
00392 : HTMLElement()
00393 {
00394 if (_impl && _impl->id() == ID_Q)
00395 impl = _impl;
00396 else
00397 impl = 0;
00398 if ( impl ) impl->ref();
00399 }
00400
00401 HTMLQuoteElement &HTMLQuoteElement::operator = (const Node &other)
00402 {
00403 assignOther( other, ID_Q );
00404 return *this;
00405 }
00406
00407 HTMLQuoteElement &HTMLQuoteElement::operator = (const HTMLQuoteElement &other)
00408 {
00409 HTMLElement::operator = (other);
00410 return *this;
00411 }
00412
00413 HTMLQuoteElement::~HTMLQuoteElement()
00414 {
00415 }
00416
00417 DOMString HTMLQuoteElement::cite() const
00418 {
00419 if(!impl) return DOMString();
00420 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
00421 }
00422
00423 void HTMLQuoteElement::setCite( const DOMString &value )
00424 {
00425 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
00426 }
00427