KHTML
html_object.cpp
Go to the documentation of this file.
00001 00023 #include "html_object.h" 00024 #include "dom_doc.h" 00025 00026 #include <html/html_objectimpl.h> 00027 00028 using namespace DOM; 00029 00030 HTMLAppletElement::HTMLAppletElement() : HTMLElement() 00031 { 00032 } 00033 00034 HTMLAppletElement::HTMLAppletElement(const HTMLAppletElement &other) 00035 : HTMLElement(other) 00036 { 00037 } 00038 00039 HTMLAppletElement::HTMLAppletElement(HTMLAppletElementImpl *impl) 00040 : HTMLElement(impl) 00041 { 00042 } 00043 00044 HTMLAppletElement &HTMLAppletElement::operator = (const Node &other) 00045 { 00046 assignOther( other, ID_APPLET ); 00047 return *this; 00048 } 00049 00050 HTMLAppletElement &HTMLAppletElement::operator = (const HTMLAppletElement &other) 00051 { 00052 HTMLElement::operator = (other); 00053 return *this; 00054 } 00055 00056 HTMLAppletElement::~HTMLAppletElement() 00057 { 00058 } 00059 00060 DOMString HTMLAppletElement::align() const 00061 { 00062 if(!impl) return DOMString(); 00063 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN); 00064 } 00065 00066 void HTMLAppletElement::setAlign( const DOMString &value ) 00067 { 00068 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value); 00069 } 00070 00071 DOMString HTMLAppletElement::alt() const 00072 { 00073 if(!impl) return DOMString(); 00074 return ((ElementImpl *)impl)->getAttribute(ATTR_ALT); 00075 } 00076 00077 void HTMLAppletElement::setAlt( const DOMString &value ) 00078 { 00079 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value); 00080 } 00081 00082 DOMString HTMLAppletElement::archive() const 00083 { 00084 if(!impl) return DOMString(); 00085 return ((ElementImpl *)impl)->getAttribute(ATTR_ARCHIVE); 00086 } 00087 00088 void HTMLAppletElement::setArchive( const DOMString &value ) 00089 { 00090 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ARCHIVE, value); 00091 } 00092 00093 DOMString HTMLAppletElement::code() const 00094 { 00095 if(!impl) return DOMString(); 00096 return ((ElementImpl *)impl)->getAttribute(ATTR_CODE); 00097 } 00098 00099 void HTMLAppletElement::setCode( const DOMString &value ) 00100 { 00101 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CODE, value); 00102 } 00103 00104 DOMString HTMLAppletElement::codeBase() const 00105 { 00106 if(!impl) return DOMString(); 00107 return ((ElementImpl *)impl)->getAttribute(ATTR_CODEBASE); 00108 } 00109 00110 void HTMLAppletElement::setCodeBase( const DOMString &value ) 00111 { 00112 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CODEBASE, value); 00113 } 00114 00115 DOMString HTMLAppletElement::height() const 00116 { 00117 if(!impl) return DOMString(); 00118 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT); 00119 } 00120 00121 void HTMLAppletElement::setHeight( const DOMString &value ) 00122 { 00123 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value); 00124 } 00125 00126 #ifndef KDE_NO_DEPRECATED 00127 DOMString HTMLAppletElement::hspace() const 00128 { 00129 if(!impl) return DOMString(); 00130 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE); 00131 } 00132 #endif 00133 00134 #ifndef KDE_NO_DEPRECATED 00135 void HTMLAppletElement::setHspace( const DOMString &value ) 00136 { 00137 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value); 00138 } 00139 #endif 00140 00141 long HTMLAppletElement::getHspace() const 00142 { 00143 if(!impl) return 0; 00144 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt(); 00145 } 00146 00147 void HTMLAppletElement::setHspace( long value ) 00148 { 00149 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); 00150 } 00151 00152 DOMString HTMLAppletElement::name() const 00153 { 00154 if(!impl) return DOMString(); 00155 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 00156 } 00157 00158 void HTMLAppletElement::setName( const DOMString &value ) 00159 { 00160 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 00161 } 00162 00163 DOMString HTMLAppletElement::object() const 00164 { 00165 if(!impl) return DOMString(); 00166 return ((ElementImpl *)impl)->getAttribute(ATTR_OBJECT); 00167 } 00168 00169 void HTMLAppletElement::setObject( const DOMString &value ) 00170 { 00171 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_OBJECT, value); 00172 } 00173 00174 #ifndef KDE_NO_DEPRECATED 00175 DOMString HTMLAppletElement::vspace() const 00176 { 00177 if(!impl) return DOMString(); 00178 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE); 00179 } 00180 #endif 00181 00182 #ifndef KDE_NO_DEPRECATED 00183 void HTMLAppletElement::setVspace( const DOMString &value ) 00184 { 00185 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value); 00186 } 00187 #endif 00188 00189 long HTMLAppletElement::getVspace() const 00190 { 00191 if(!impl) return 0; 00192 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt(); 00193 } 00194 00195 void HTMLAppletElement::setVspace( long value ) 00196 { 00197 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value)); 00198 } 00199 00200 00201 DOMString HTMLAppletElement::width() const 00202 { 00203 if(!impl) return DOMString(); 00204 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH); 00205 } 00206 00207 void HTMLAppletElement::setWidth( const DOMString &value ) 00208 { 00209 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value); 00210 } 00211 00212 // -------------------------------------------------------------------------- 00213 00214 HTMLObjectElement::HTMLObjectElement() : HTMLElement() 00215 { 00216 } 00217 00218 HTMLObjectElement::HTMLObjectElement(const HTMLObjectElement &other) : HTMLElement(other) 00219 { 00220 } 00221 00222 HTMLObjectElement::HTMLObjectElement(HTMLObjectElementImpl *impl) : HTMLElement(impl) 00223 { 00224 } 00225 00226 HTMLObjectElement &HTMLObjectElement::operator = (const Node &other) 00227 { 00228 assignOther( other, ID_OBJECT ); 00229 return *this; 00230 } 00231 00232 HTMLObjectElement &HTMLObjectElement::operator = (const HTMLObjectElement &other) 00233 { 00234 HTMLElement::operator = (other); 00235 return *this; 00236 } 00237 00238 HTMLObjectElement::~HTMLObjectElement() 00239 { 00240 } 00241 00242 HTMLFormElement HTMLObjectElement::form() const 00243 { 00244 if(!impl) return 0; 00245 return ((HTMLObjectElementImpl *)impl)->form(); 00246 } 00247 00248 DOMString HTMLObjectElement::code() const 00249 { 00250 if(!impl) return DOMString(); 00251 return ((ElementImpl *)impl)->getAttribute(ATTR_CODE); 00252 } 00253 00254 void HTMLObjectElement::setCode( const DOMString &value ) 00255 { 00256 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CODE, value); 00257 } 00258 00259 DOMString HTMLObjectElement::align() const 00260 { 00261 if(!impl) return DOMString(); 00262 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN); 00263 } 00264 00265 void HTMLObjectElement::setAlign( const DOMString &value ) 00266 { 00267 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value); 00268 } 00269 00270 DOMString HTMLObjectElement::archive() const 00271 { 00272 if(!impl) return DOMString(); 00273 return ((ElementImpl *)impl)->getAttribute(ATTR_ARCHIVE); 00274 } 00275 00276 void HTMLObjectElement::setArchive( const DOMString &value ) 00277 { 00278 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ARCHIVE, value); 00279 } 00280 00281 DOMString HTMLObjectElement::border() const 00282 { 00283 if(!impl) return DOMString(); 00284 return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER); 00285 } 00286 00287 void HTMLObjectElement::setBorder( const DOMString &value ) 00288 { 00289 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value); 00290 } 00291 00292 DOMString HTMLObjectElement::codeBase() const 00293 { 00294 if(!impl) return DOMString(); 00295 return ((ElementImpl *)impl)->getAttribute(ATTR_CODEBASE); 00296 } 00297 00298 void HTMLObjectElement::setCodeBase( const DOMString &value ) 00299 { 00300 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CODEBASE, value); 00301 } 00302 00303 DOMString HTMLObjectElement::codeType() const 00304 { 00305 if(!impl) return DOMString(); 00306 return ((ElementImpl *)impl)->getAttribute(ATTR_CODETYPE); 00307 } 00308 00309 void HTMLObjectElement::setCodeType( const DOMString &value ) 00310 { 00311 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CODETYPE, value); 00312 } 00313 00314 DOMString HTMLObjectElement::data() const 00315 { 00316 if(!impl) return DOMString(); 00317 return ((ElementImpl *)impl)->getAttribute(ATTR_DATA); 00318 } 00319 00320 void HTMLObjectElement::setData( const DOMString &value ) 00321 { 00322 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATA, value); 00323 } 00324 00325 bool HTMLObjectElement::declare() const 00326 { 00327 if(!impl) return 0; 00328 return !((ElementImpl *)impl)->getAttribute(ATTR_DECLARE).isNull(); 00329 } 00330 00331 void HTMLObjectElement::setDeclare( bool _declare ) 00332 { 00333 if(impl) 00334 { 00335 DOMString str; 00336 if( _declare ) 00337 str = ""; 00338 ((ElementImpl *)impl)->setAttribute(ATTR_DECLARE, str); 00339 } 00340 } 00341 00342 DOMString HTMLObjectElement::height() const 00343 { 00344 if(!impl) return DOMString(); 00345 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT); 00346 } 00347 00348 void HTMLObjectElement::setHeight( const DOMString &value ) 00349 { 00350 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value); 00351 } 00352 00353 #ifndef KDE_NO_DEPRECATED 00354 DOMString HTMLObjectElement::hspace() const 00355 { 00356 if(!impl) return DOMString(); 00357 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE); 00358 } 00359 #endif 00360 00361 #ifndef KDE_NO_DEPRECATED 00362 void HTMLObjectElement::setHspace( const DOMString &value ) 00363 { 00364 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value); 00365 } 00366 #endif 00367 00368 long HTMLObjectElement::getHspace() const 00369 { 00370 if(!impl) return 0; 00371 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt(); 00372 } 00373 00374 void HTMLObjectElement::setHspace( long value ) 00375 { 00376 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); 00377 } 00378 00379 DOMString HTMLObjectElement::name() const 00380 { 00381 if(!impl) return DOMString(); 00382 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 00383 } 00384 00385 void HTMLObjectElement::setName( const DOMString &value ) 00386 { 00387 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 00388 } 00389 00390 DOMString HTMLObjectElement::standby() const 00391 { 00392 if(!impl) return DOMString(); 00393 return ((ElementImpl *)impl)->getAttribute(ATTR_STANDBY); 00394 } 00395 00396 void HTMLObjectElement::setStandby( const DOMString &value ) 00397 { 00398 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_STANDBY, value); 00399 } 00400 00401 long HTMLObjectElement::tabIndex() const 00402 { 00403 if(!impl) return 0; 00404 return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt(); 00405 } 00406 00407 void HTMLObjectElement::setTabIndex( long _tabIndex ) 00408 { 00409 if(impl) { 00410 DOMString value(QString::number(_tabIndex)); 00411 ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value); 00412 } 00413 } 00414 00415 DOMString HTMLObjectElement::type() const 00416 { 00417 if(!impl) return DOMString(); 00418 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE); 00419 } 00420 00421 void HTMLObjectElement::setType( const DOMString &value ) 00422 { 00423 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value); 00424 } 00425 00426 DOMString HTMLObjectElement::useMap() const 00427 { 00428 if(!impl) return DOMString(); 00429 return ((ElementImpl *)impl)->getAttribute(ATTR_USEMAP); 00430 } 00431 00432 void HTMLObjectElement::setUseMap( const DOMString &value ) 00433 { 00434 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_USEMAP, value); 00435 } 00436 00437 #ifndef KDE_NO_DEPRECATED 00438 DOMString HTMLObjectElement::vspace() const 00439 { 00440 if(!impl) return DOMString(); 00441 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE); 00442 } 00443 #endif 00444 00445 #ifndef KDE_NO_DEPRECATED 00446 void HTMLObjectElement::setVspace( const DOMString &value ) 00447 { 00448 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value); 00449 } 00450 #endif 00451 00452 long HTMLObjectElement::getVspace() const 00453 { 00454 if(!impl) return 0; 00455 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt(); 00456 } 00457 00458 void HTMLObjectElement::setVspace( long value ) 00459 { 00460 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value)); 00461 } 00462 00463 DOMString HTMLObjectElement::width() const 00464 { 00465 if(!impl) return DOMString(); 00466 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH); 00467 } 00468 00469 void HTMLObjectElement::setWidth( const DOMString &value ) 00470 { 00471 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value); 00472 } 00473 00474 Document HTMLObjectElement::contentDocument() const 00475 { 00476 if (impl) return static_cast<HTMLObjectElementImpl*>(impl)->contentDocument(); 00477 return Document(); 00478 } 00479 00480 // -------------------------------------------------------------------------- 00481 00482 HTMLParamElement::HTMLParamElement() : HTMLElement() 00483 { 00484 } 00485 00486 HTMLParamElement::HTMLParamElement(const HTMLParamElement &other) : HTMLElement(other) 00487 { 00488 } 00489 00490 HTMLParamElement::HTMLParamElement(HTMLParamElementImpl *impl) : HTMLElement(impl) 00491 { 00492 } 00493 00494 HTMLParamElement &HTMLParamElement::operator = (const Node &other) 00495 { 00496 assignOther( other, ID_PARAM ); 00497 return *this; 00498 } 00499 00500 HTMLParamElement &HTMLParamElement::operator = (const HTMLParamElement &other) 00501 { 00502 HTMLElement::operator = (other); 00503 return *this; 00504 } 00505 00506 HTMLParamElement::~HTMLParamElement() 00507 { 00508 } 00509 00510 DOMString HTMLParamElement::name() const 00511 { 00512 if(!impl) return DOMString(); 00513 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 00514 } 00515 00516 void HTMLParamElement::setName( const DOMString &value ) 00517 { 00518 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 00519 } 00520 00521 DOMString HTMLParamElement::type() const 00522 { 00523 if(!impl) return DOMString(); 00524 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE); 00525 } 00526 00527 void HTMLParamElement::setType( const DOMString &value ) 00528 { 00529 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value); 00530 } 00531 00532 DOMString HTMLParamElement::value() const 00533 { 00534 if(!impl) return DOMString(); 00535 return ((ElementImpl *)impl)->getAttribute(ATTR_VALUE); 00536 } 00537 00538 void HTMLParamElement::setValue( const DOMString &value ) 00539 { 00540 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value); 00541 } 00542 00543 DOMString HTMLParamElement::valueType() const 00544 { 00545 if(!impl) return DOMString(); 00546 return ((ElementImpl *)impl)->getAttribute(ATTR_VALUETYPE); 00547 } 00548 00549 void HTMLParamElement::setValueType( const DOMString &value ) 00550 { 00551 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALUETYPE, value); 00552 } 00553
KDE 4.6 API Reference