KHTML
html_base.cpp
Go to the documentation of this file.
00001 00021 // -------------------------------------------------------------------------- 00022 00023 #include "html_base.h" 00024 #include "dom_doc.h" 00025 #include <xml/dom_docimpl.h> 00026 #include <html/html_baseimpl.h> 00027 00028 using namespace DOM; 00029 00030 HTMLBodyElement::HTMLBodyElement() : HTMLElement() 00031 { 00032 } 00033 00034 HTMLBodyElement::HTMLBodyElement(const HTMLBodyElement &other) : HTMLElement(other) 00035 { 00036 } 00037 00038 HTMLBodyElement::HTMLBodyElement(HTMLBodyElementImpl *impl) : HTMLElement(impl) 00039 { 00040 } 00041 00042 HTMLBodyElement &HTMLBodyElement::operator = (const Node &other) 00043 { 00044 assignOther( other, ID_BODY ); 00045 return *this; 00046 } 00047 00048 HTMLBodyElement &HTMLBodyElement::operator = (const HTMLBodyElement &other) 00049 { 00050 HTMLElement::operator = (other); 00051 return *this; 00052 } 00053 00054 HTMLBodyElement::~HTMLBodyElement() 00055 { 00056 } 00057 00058 DOMString HTMLBodyElement::aLink() const 00059 { 00060 return impl ? ((HTMLBodyElementImpl*)impl)->aLink() : DOMString(); 00061 } 00062 00063 void HTMLBodyElement::setALink( const DOMString &value ) 00064 { 00065 if(impl) ((HTMLBodyElementImpl *)impl)->setALink(value); 00066 } 00067 00068 DOMString HTMLBodyElement::background() const 00069 { 00070 return impl ? ((ElementImpl *)impl)->getAttribute(ATTR_BACKGROUND) : DOMString(); 00071 } 00072 00073 void HTMLBodyElement::setBackground( const DOMString &value ) 00074 { 00075 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BACKGROUND, value); 00076 } 00077 00078 DOMString HTMLBodyElement::bgColor() const 00079 { 00080 return impl ? ((HTMLBodyElementImpl*)impl)->bgColor() : DOMString(); 00081 } 00082 00083 void HTMLBodyElement::setBgColor( const DOMString &value ) 00084 { 00085 if(impl) ((HTMLBodyElementImpl *)impl)->setBgColor(value); 00086 } 00087 00088 DOMString HTMLBodyElement::link() const 00089 { 00090 return impl ? ((HTMLBodyElementImpl*)impl)->link() : DOMString(); 00091 } 00092 00093 void HTMLBodyElement::setLink( const DOMString &value ) 00094 { 00095 if(impl) ((HTMLBodyElementImpl *)impl)->setLink(value); 00096 } 00097 00098 DOMString HTMLBodyElement::text() const 00099 { 00100 return impl ? ((HTMLBodyElementImpl*)impl)->text() : DOMString(); 00101 } 00102 00103 void HTMLBodyElement::setText( const DOMString &value ) 00104 { 00105 if(impl) ((HTMLBodyElementImpl *)impl)->setText(value); 00106 } 00107 00108 DOMString HTMLBodyElement::vLink() const 00109 { 00110 return impl ? ((HTMLBodyElementImpl*)impl)->vLink() : DOMString(); 00111 } 00112 00113 void HTMLBodyElement::setVLink( const DOMString &value ) 00114 { 00115 if(impl) ((HTMLBodyElementImpl *)impl)->setVLink(value); 00116 } 00117 00118 // -------------------------------------------------------------------------- 00119 00120 HTMLFrameElement::HTMLFrameElement() : HTMLElement() 00121 { 00122 } 00123 00124 HTMLFrameElement::HTMLFrameElement(const HTMLFrameElement &other) : HTMLElement(other) 00125 { 00126 } 00127 00128 HTMLFrameElement::HTMLFrameElement(HTMLFrameElementImpl *impl) : HTMLElement(impl) 00129 { 00130 } 00131 00132 HTMLFrameElement &HTMLFrameElement::operator = (const Node &other) 00133 { 00134 assignOther( other, ID_FRAME ); 00135 return *this; 00136 } 00137 00138 HTMLFrameElement &HTMLFrameElement::operator = (const HTMLFrameElement &other) 00139 { 00140 HTMLElement::operator = (other); 00141 return *this; 00142 } 00143 00144 HTMLFrameElement::~HTMLFrameElement() 00145 { 00146 } 00147 00148 DOMString HTMLFrameElement::frameBorder() const 00149 { 00150 if(!impl) return DOMString(); 00151 return ((ElementImpl *)impl)->getAttribute(ATTR_FRAMEBORDER); 00152 } 00153 00154 void HTMLFrameElement::setFrameBorder( const DOMString &value ) 00155 { 00156 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FRAMEBORDER, value); 00157 } 00158 00159 DOMString HTMLFrameElement::longDesc() const 00160 { 00161 if(!impl) return DOMString(); 00162 return ((ElementImpl *)impl)->getAttribute(ATTR_LONGDESC); 00163 } 00164 00165 void HTMLFrameElement::setLongDesc( const DOMString &value ) 00166 { 00167 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_LONGDESC, value); 00168 } 00169 00170 DOMString HTMLFrameElement::marginHeight() const 00171 { 00172 if(!impl) return DOMString(); 00173 return ((ElementImpl *)impl)->getAttribute(ATTR_MARGINHEIGHT); 00174 } 00175 00176 void HTMLFrameElement::setMarginHeight( const DOMString &value ) 00177 { 00178 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MARGINHEIGHT, value); 00179 } 00180 00181 DOMString HTMLFrameElement::marginWidth() const 00182 { 00183 if(!impl) return DOMString(); 00184 return ((ElementImpl *)impl)->getAttribute(ATTR_MARGINWIDTH); 00185 } 00186 00187 void HTMLFrameElement::setMarginWidth( const DOMString &value ) 00188 { 00189 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MARGINWIDTH, value); 00190 } 00191 00192 DOMString HTMLFrameElement::name() const 00193 { 00194 if(!impl) return DOMString(); 00195 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 00196 } 00197 00198 void HTMLFrameElement::setName( const DOMString &value ) 00199 { 00200 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 00201 } 00202 00203 bool HTMLFrameElement::noResize() const 00204 { 00205 if(!impl) return false; 00206 return !((ElementImpl *)impl)->getAttribute(ATTR_NORESIZE).isNull(); 00207 } 00208 00209 void HTMLFrameElement::setNoResize( bool _noResize ) 00210 { 00211 if(impl) 00212 { 00213 DOMString str; 00214 if( _noResize ) 00215 str = ""; 00216 ((ElementImpl *)impl)->setAttribute(ATTR_NORESIZE, str); 00217 } 00218 } 00219 00220 DOMString HTMLFrameElement::scrolling() const 00221 { 00222 if(!impl) return DOMString(); 00223 return ((ElementImpl *)impl)->getAttribute(ATTR_SCROLLING); 00224 } 00225 00226 void HTMLFrameElement::setScrolling( const DOMString &value ) 00227 { 00228 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCROLLING, value); 00229 } 00230 00231 DOMString HTMLFrameElement::src() const 00232 { 00233 if(!impl) return DOMString(); 00234 return ((ElementImpl *)impl)->getAttribute(ATTR_SRC); 00235 } 00236 00237 void HTMLFrameElement::setSrc( const DOMString &value ) 00238 { 00239 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SRC, value); 00240 } 00241 00242 Document HTMLFrameElement::contentDocument() const 00243 { 00244 if (impl) return static_cast<HTMLFrameElementImpl*>(impl)->contentDocument(); 00245 return Document(); 00246 } 00247 00248 // -------------------------------------------------------------------------- 00249 00250 HTMLIFrameElement::HTMLIFrameElement() : HTMLElement() 00251 { 00252 } 00253 00254 HTMLIFrameElement::HTMLIFrameElement(const HTMLIFrameElement &other) : HTMLElement(other) 00255 { 00256 } 00257 00258 HTMLIFrameElement::HTMLIFrameElement(HTMLIFrameElementImpl *impl) : HTMLElement(impl) 00259 { 00260 } 00261 00262 HTMLIFrameElement &HTMLIFrameElement::operator = (const Node &other) 00263 { 00264 assignOther( other, ID_IFRAME ); 00265 return *this; 00266 } 00267 00268 HTMLIFrameElement &HTMLIFrameElement::operator = (const HTMLIFrameElement &other) 00269 { 00270 HTMLElement::operator = (other); 00271 return *this; 00272 } 00273 00274 HTMLIFrameElement::~HTMLIFrameElement() 00275 { 00276 } 00277 00278 DOMString HTMLIFrameElement::align() const 00279 { 00280 if(!impl) return DOMString(); 00281 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN); 00282 } 00283 00284 void HTMLIFrameElement::setAlign( const DOMString &value ) 00285 { 00286 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value); 00287 } 00288 00289 DOMString HTMLIFrameElement::frameBorder() const 00290 { 00291 if(!impl) return DOMString(); 00292 return ((ElementImpl *)impl)->getAttribute(ATTR_FRAMEBORDER); 00293 } 00294 00295 void HTMLIFrameElement::setFrameBorder( const DOMString &value ) 00296 { 00297 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FRAMEBORDER, value); 00298 } 00299 00300 DOMString HTMLIFrameElement::height() const 00301 { 00302 if(!impl) return DOMString(); 00303 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT); 00304 } 00305 00306 void HTMLIFrameElement::setHeight( const DOMString &value ) 00307 { 00308 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value); 00309 } 00310 00311 DOMString HTMLIFrameElement::longDesc() const 00312 { 00313 if(!impl) return DOMString(); 00314 return ((ElementImpl *)impl)->getAttribute(ATTR_LONGDESC); 00315 } 00316 00317 void HTMLIFrameElement::setLongDesc( const DOMString &value ) 00318 { 00319 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_LONGDESC, value); 00320 } 00321 00322 DOMString HTMLIFrameElement::marginHeight() const 00323 { 00324 if(!impl) return DOMString(); 00325 return ((ElementImpl *)impl)->getAttribute(ATTR_MARGINHEIGHT); 00326 } 00327 00328 void HTMLIFrameElement::setMarginHeight( const DOMString &value ) 00329 { 00330 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MARGINHEIGHT, value); 00331 } 00332 00333 DOMString HTMLIFrameElement::marginWidth() const 00334 { 00335 if(!impl) return DOMString(); 00336 return ((ElementImpl *)impl)->getAttribute(ATTR_MARGINWIDTH); 00337 } 00338 00339 void HTMLIFrameElement::setMarginWidth( const DOMString &value ) 00340 { 00341 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MARGINWIDTH, value); 00342 } 00343 00344 DOMString HTMLIFrameElement::name() const 00345 { 00346 if(!impl) return DOMString(); 00347 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 00348 } 00349 00350 void HTMLIFrameElement::setName( const DOMString &value ) 00351 { 00352 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 00353 } 00354 00355 DOMString HTMLIFrameElement::scrolling() const 00356 { 00357 if(!impl) return DOMString(); 00358 return ((ElementImpl *)impl)->getAttribute(ATTR_SCROLLING); 00359 } 00360 00361 void HTMLIFrameElement::setScrolling( const DOMString &value ) 00362 { 00363 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCROLLING, value); 00364 } 00365 00366 DOMString HTMLIFrameElement::src() const 00367 { 00368 if(!impl) return DOMString(); 00369 DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC); 00370 return !s.isNull() ? impl->document()->completeURL( s.string() ) : s; 00371 } 00372 00373 void HTMLIFrameElement::setSrc( const DOMString &value ) 00374 { 00375 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SRC, value); 00376 } 00377 00378 DOMString HTMLIFrameElement::width() const 00379 { 00380 if(!impl) return DOMString(); 00381 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH); 00382 } 00383 00384 void HTMLIFrameElement::setWidth( const DOMString &value ) 00385 { 00386 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value); 00387 } 00388 00389 Document HTMLIFrameElement::contentDocument() const 00390 { 00391 if (impl) return static_cast<HTMLIFrameElementImpl*>(impl)->contentDocument(); 00392 return Document(); 00393 } 00394 00395 // -------------------------------------------------------------------------- 00396 00397 HTMLFrameSetElement::HTMLFrameSetElement() : HTMLElement() 00398 { 00399 } 00400 00401 HTMLFrameSetElement::HTMLFrameSetElement(const HTMLFrameSetElement &other) : HTMLElement(other) 00402 { 00403 } 00404 00405 HTMLFrameSetElement::HTMLFrameSetElement(HTMLFrameSetElementImpl *impl) : HTMLElement(impl) 00406 { 00407 } 00408 00409 HTMLFrameSetElement &HTMLFrameSetElement::operator = (const Node &other) 00410 { 00411 assignOther( other, ID_FRAMESET ); 00412 return *this; 00413 } 00414 00415 HTMLFrameSetElement &HTMLFrameSetElement::operator = (const HTMLFrameSetElement &other) 00416 { 00417 HTMLElement::operator = (other); 00418 return *this; 00419 } 00420 00421 HTMLFrameSetElement::~HTMLFrameSetElement() 00422 { 00423 } 00424 00425 DOMString HTMLFrameSetElement::cols() const 00426 { 00427 if(!impl) return DOMString(); 00428 return ((ElementImpl *)impl)->getAttribute(ATTR_COLS); 00429 } 00430 00431 void HTMLFrameSetElement::setCols( const DOMString &value ) 00432 { 00433 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLS, value); 00434 } 00435 00436 DOMString HTMLFrameSetElement::rows() const 00437 { 00438 if(!impl) return DOMString(); 00439 return ((ElementImpl *)impl)->getAttribute(ATTR_ROWS); 00440 } 00441 00442 void HTMLFrameSetElement::setRows( const DOMString &value ) 00443 { 00444 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ROWS, value); 00445 } 00446 00447 // -------------------------------------------------------------------------- 00448 00449 HTMLHeadElement::HTMLHeadElement() : HTMLElement() 00450 { 00451 } 00452 00453 HTMLHeadElement::HTMLHeadElement(const HTMLHeadElement &other) : HTMLElement(other) 00454 { 00455 } 00456 00457 HTMLHeadElement::HTMLHeadElement(HTMLHeadElementImpl *impl) : HTMLElement(impl) 00458 { 00459 } 00460 00461 HTMLHeadElement &HTMLHeadElement::operator = (const Node &other) 00462 { 00463 assignOther( other, ID_HEAD ); 00464 return *this; 00465 } 00466 00467 HTMLHeadElement &HTMLHeadElement::operator = (const HTMLHeadElement &other) 00468 { 00469 HTMLElement::operator = (other); 00470 return *this; 00471 } 00472 00473 HTMLHeadElement::~HTMLHeadElement() 00474 { 00475 } 00476 00477 DOMString HTMLHeadElement::profile() const 00478 { 00479 if(!impl) return DOMString(); 00480 return ((ElementImpl *)impl)->getAttribute(ATTR_PROFILE); 00481 } 00482 00483 void HTMLHeadElement::setProfile( const DOMString &value ) 00484 { 00485 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_PROFILE, value); 00486 } 00487 00488 // -------------------------------------------------------------------------- 00489 00490 HTMLHtmlElement::HTMLHtmlElement() : HTMLElement() 00491 { 00492 } 00493 00494 HTMLHtmlElement::HTMLHtmlElement(const HTMLHtmlElement &other) : HTMLElement(other) 00495 { 00496 } 00497 00498 HTMLHtmlElement::HTMLHtmlElement(HTMLHtmlElementImpl *impl) : HTMLElement(impl) 00499 { 00500 } 00501 00502 HTMLHtmlElement &HTMLHtmlElement::operator = (const Node &other) 00503 { 00504 assignOther( other, ID_HTML ); 00505 return *this; 00506 } 00507 00508 HTMLHtmlElement &HTMLHtmlElement::operator = (const HTMLHtmlElement &other) 00509 { 00510 HTMLElement::operator = (other); 00511 return *this; 00512 } 00513 00514 HTMLHtmlElement::~HTMLHtmlElement() 00515 { 00516 } 00517 00518 DOMString HTMLHtmlElement::version() const 00519 { 00520 if(!impl) return DOMString(); 00521 return ((ElementImpl *)impl)->getAttribute(ATTR_VERSION); 00522 } 00523 00524 void HTMLHtmlElement::setVersion( const DOMString &value ) 00525 { 00526 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VERSION, value); 00527 } 00528
KDE 4.6 API Reference