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