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 00032 using namespace DOM; 00033 00034 HTMLAnchorElement::HTMLAnchorElement() : HTMLElement() 00035 { 00036 } 00037 00038 HTMLAnchorElement::HTMLAnchorElement(const HTMLAnchorElement &other) : HTMLElement(other) 00039 { 00040 } 00041 00042 HTMLAnchorElement::HTMLAnchorElement(HTMLAnchorElementImpl *impl) : HTMLElement(impl) 00043 { 00044 } 00045 00046 HTMLAnchorElement &HTMLAnchorElement::operator = (const Node &other) 00047 { 00048 assignOther( other, ID_A ); 00049 return *this; 00050 } 00051 00052 HTMLAnchorElement &HTMLAnchorElement::operator = (const HTMLAnchorElement &other) 00053 { 00054 HTMLElement::operator = (other); 00055 return *this; 00056 } 00057 00058 HTMLAnchorElement::~HTMLAnchorElement() 00059 { 00060 } 00061 00062 DOMString HTMLAnchorElement::accessKey() const 00063 { 00064 if(!impl) return DOMString(); 00065 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY); 00066 } 00067 00068 void HTMLAnchorElement::setAccessKey( const DOMString &value ) 00069 { 00070 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value); 00071 } 00072 00073 DOMString HTMLAnchorElement::charset() const 00074 { 00075 if(!impl) return DOMString(); 00076 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET); 00077 } 00078 00079 void HTMLAnchorElement::setCharset( const DOMString &value ) 00080 { 00081 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value); 00082 } 00083 00084 DOMString HTMLAnchorElement::coords() const 00085 { 00086 if(!impl) return DOMString(); 00087 return ((ElementImpl *)impl)->getAttribute(ATTR_COORDS); 00088 } 00089 00090 void HTMLAnchorElement::setCoords( const DOMString &value ) 00091 { 00092 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COORDS, value); 00093 } 00094 00095 DOMString HTMLAnchorElement::href() const 00096 { 00097 if(!impl) return DOMString(); 00098 DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF); 00099 return !href.isNull() ? impl->document()->completeURL(href.string()) : 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) ((HTMLAnchorElementImpl*)impl)->blur(); 00201 } 00202 00203 void HTMLAnchorElement::focus( ) 00204 { 00205 if (impl) ((HTMLAnchorElementImpl*)impl)->focus(); 00206 } 00207 00208 // -------------------------------------------------------------------------- 00209 00210 HTMLBRElement::HTMLBRElement() : HTMLElement() 00211 { 00212 } 00213 00214 HTMLBRElement::HTMLBRElement(const HTMLBRElement &other) : HTMLElement(other) 00215 { 00216 } 00217 00218 HTMLBRElement::HTMLBRElement(HTMLBRElementImpl *impl) : HTMLElement(impl) 00219 { 00220 } 00221 00222 HTMLBRElement &HTMLBRElement::operator = (const Node &other) 00223 { 00224 assignOther( other, ID_BR ); 00225 return *this; 00226 } 00227 00228 HTMLBRElement &HTMLBRElement::operator = (const HTMLBRElement &other) 00229 { 00230 HTMLElement::operator = (other); 00231 return *this; 00232 } 00233 00234 HTMLBRElement::~HTMLBRElement() 00235 { 00236 } 00237 00238 DOMString HTMLBRElement::clear() const 00239 { 00240 if(!impl) return DOMString(); 00241 return ((ElementImpl *)impl)->getAttribute(ATTR_CLEAR); 00242 } 00243 00244 void HTMLBRElement::setClear( const DOMString &value ) 00245 { 00246 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLEAR, value); 00247 } 00248 00249 // -------------------------------------------------------------------------- 00250 00251 HTMLFontElement::HTMLFontElement() : HTMLElement() 00252 { 00253 } 00254 00255 HTMLFontElement::HTMLFontElement(const HTMLFontElement &other) : HTMLElement(other) 00256 { 00257 } 00258 00259 HTMLFontElement::HTMLFontElement(HTMLFontElementImpl *impl) : HTMLElement(impl) 00260 { 00261 } 00262 00263 HTMLFontElement &HTMLFontElement::operator = (const Node &other) 00264 { 00265 assignOther( other, ID_FONT ); 00266 return *this; 00267 } 00268 00269 HTMLFontElement &HTMLFontElement::operator = (const HTMLFontElement &other) 00270 { 00271 HTMLElement::operator = (other); 00272 return *this; 00273 } 00274 00275 HTMLFontElement::~HTMLFontElement() 00276 { 00277 } 00278 00279 DOMString HTMLFontElement::color() const 00280 { 00281 if(!impl) return DOMString(); 00282 return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR); 00283 } 00284 00285 void HTMLFontElement::setColor( const DOMString &value ) 00286 { 00287 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value); 00288 } 00289 00290 DOMString HTMLFontElement::face() const 00291 { 00292 if(!impl) return DOMString(); 00293 return ((ElementImpl *)impl)->getAttribute(ATTR_FACE); 00294 } 00295 00296 void HTMLFontElement::setFace( const DOMString &value ) 00297 { 00298 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value); 00299 } 00300 00301 DOMString HTMLFontElement::size() const 00302 { 00303 if(!impl) return DOMString(); 00304 return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE); 00305 } 00306 00307 void HTMLFontElement::setSize( const DOMString &value ) 00308 { 00309 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value); 00310 } 00311 00312 00313 // -------------------------------------------------------------------------- 00314 00315 HTMLModElement::HTMLModElement() : HTMLElement() 00316 { 00317 } 00318 00319 HTMLModElement::HTMLModElement(const HTMLModElement &other) : HTMLElement(other) 00320 { 00321 } 00322 00323 HTMLModElement::HTMLModElement(HTMLElementImpl *_impl) 00324 : HTMLElement() 00325 { 00326 if (_impl && (_impl->id() == ID_INS || _impl->id() == ID_DEL)) 00327 impl = _impl; 00328 else 00329 impl = 0; 00330 if ( impl ) impl->ref(); 00331 } 00332 00333 HTMLModElement &HTMLModElement::operator = (const Node &other) 00334 { 00335 if (other.handle() != handle()) { 00336 if( other.elementId() != ID_INS && 00337 other.elementId() != ID_DEL ) 00338 { 00339 if ( impl ) impl->deref(); 00340 impl = 0; 00341 } else { 00342 Node::operator = (other); 00343 } 00344 } 00345 return *this; 00346 } 00347 00348 HTMLModElement &HTMLModElement::operator = (const HTMLModElement &other) 00349 { 00350 HTMLElement::operator = (other); 00351 return *this; 00352 } 00353 00354 HTMLModElement::~HTMLModElement() 00355 { 00356 } 00357 00358 DOMString HTMLModElement::cite() const 00359 { 00360 if(!impl) return DOMString(); 00361 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE); 00362 } 00363 00364 void HTMLModElement::setCite( const DOMString &value ) 00365 { 00366 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value); 00367 } 00368 00369 DOMString HTMLModElement::dateTime() const 00370 { 00371 if(!impl) return DOMString(); 00372 return ((ElementImpl *)impl)->getAttribute(ATTR_DATETIME); 00373 } 00374 00375 void HTMLModElement::setDateTime( const DOMString &value ) 00376 { 00377 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATETIME, value); 00378 } 00379 00380 // -------------------------------------------------------------------------- 00381 00382 HTMLQuoteElement::HTMLQuoteElement() : HTMLElement() 00383 { 00384 } 00385 00386 HTMLQuoteElement::HTMLQuoteElement(const HTMLQuoteElement &other) : HTMLElement(other) 00387 { 00388 } 00389 00390 HTMLQuoteElement::HTMLQuoteElement(HTMLGenericElementImpl *_impl) 00391 : HTMLElement() 00392 { 00393 if (_impl && _impl->id() == ID_Q) 00394 impl = _impl; 00395 else 00396 impl = 0; 00397 if ( impl ) impl->ref(); 00398 } 00399 00400 HTMLQuoteElement &HTMLQuoteElement::operator = (const Node &other) 00401 { 00402 assignOther( other, ID_Q ); 00403 return *this; 00404 } 00405 00406 HTMLQuoteElement &HTMLQuoteElement::operator = (const HTMLQuoteElement &other) 00407 { 00408 HTMLElement::operator = (other); 00409 return *this; 00410 } 00411 00412 HTMLQuoteElement::~HTMLQuoteElement() 00413 { 00414 } 00415 00416 DOMString HTMLQuoteElement::cite() const 00417 { 00418 if(!impl) return DOMString(); 00419 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE); 00420 } 00421 00422 void HTMLQuoteElement::setCite( const DOMString &value ) 00423 { 00424 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value); 00425 } 00426
KDE 4.6 API Reference