File indexing completed on 2024-04-28 15:23:03
0001 /** 0002 * This file is part of the DOM implementation for KDE. 0003 * 0004 * Copyright 1999 Lars Knoll (knoll@kde.org) 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Library General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Library General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Library General Public License 0017 * along with this library; see the file COPYING.LIB. If not, write to 0018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 * Boston, MA 02110-1301, USA. 0020 * 0021 */ 0022 0023 #include "html_object.h" 0024 #include "dom_doc.h" 0025 0026 #include <html/html_objectimpl.h> 0027 0028 using namespace DOM; 0029 0030 HTMLAppletElement::HTMLAppletElement() : HTMLElement() 0031 { 0032 } 0033 0034 HTMLAppletElement::HTMLAppletElement(const HTMLAppletElement &other) 0035 : HTMLElement(other) 0036 { 0037 } 0038 0039 HTMLAppletElement::HTMLAppletElement(HTMLAppletElementImpl *impl) 0040 : HTMLElement(impl) 0041 { 0042 } 0043 0044 HTMLAppletElement &HTMLAppletElement::operator = (const Node &other) 0045 { 0046 assignOther(other, ID_APPLET); 0047 return *this; 0048 } 0049 0050 HTMLAppletElement &HTMLAppletElement::operator = (const HTMLAppletElement &other) 0051 { 0052 HTMLElement::operator = (other); 0053 return *this; 0054 } 0055 0056 HTMLAppletElement::~HTMLAppletElement() 0057 { 0058 } 0059 0060 DOMString HTMLAppletElement::align() const 0061 { 0062 if (!impl) { 0063 return DOMString(); 0064 } 0065 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN); 0066 } 0067 0068 void HTMLAppletElement::setAlign(const DOMString &value) 0069 { 0070 if (impl) { 0071 ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value); 0072 } 0073 } 0074 0075 DOMString HTMLAppletElement::alt() const 0076 { 0077 if (!impl) { 0078 return DOMString(); 0079 } 0080 return ((ElementImpl *)impl)->getAttribute(ATTR_ALT); 0081 } 0082 0083 void HTMLAppletElement::setAlt(const DOMString &value) 0084 { 0085 if (impl) { 0086 ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value); 0087 } 0088 } 0089 0090 DOMString HTMLAppletElement::archive() const 0091 { 0092 if (!impl) { 0093 return DOMString(); 0094 } 0095 return ((ElementImpl *)impl)->getAttribute(ATTR_ARCHIVE); 0096 } 0097 0098 void HTMLAppletElement::setArchive(const DOMString &value) 0099 { 0100 if (impl) { 0101 ((ElementImpl *)impl)->setAttribute(ATTR_ARCHIVE, value); 0102 } 0103 } 0104 0105 DOMString HTMLAppletElement::code() const 0106 { 0107 if (!impl) { 0108 return DOMString(); 0109 } 0110 return ((ElementImpl *)impl)->getAttribute(ATTR_CODE); 0111 } 0112 0113 void HTMLAppletElement::setCode(const DOMString &value) 0114 { 0115 if (impl) { 0116 ((ElementImpl *)impl)->setAttribute(ATTR_CODE, value); 0117 } 0118 } 0119 0120 DOMString HTMLAppletElement::codeBase() const 0121 { 0122 if (!impl) { 0123 return DOMString(); 0124 } 0125 return ((ElementImpl *)impl)->getAttribute(ATTR_CODEBASE); 0126 } 0127 0128 void HTMLAppletElement::setCodeBase(const DOMString &value) 0129 { 0130 if (impl) { 0131 ((ElementImpl *)impl)->setAttribute(ATTR_CODEBASE, value); 0132 } 0133 } 0134 0135 DOMString HTMLAppletElement::height() const 0136 { 0137 if (!impl) { 0138 return DOMString(); 0139 } 0140 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT); 0141 } 0142 0143 void HTMLAppletElement::setHeight(const DOMString &value) 0144 { 0145 if (impl) { 0146 ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value); 0147 } 0148 } 0149 0150 #ifndef KHTML_NO_DEPRECATED 0151 DOMString HTMLAppletElement::hspace() const 0152 { 0153 if (!impl) { 0154 return DOMString(); 0155 } 0156 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE); 0157 } 0158 #endif 0159 0160 #ifndef KHTML_NO_DEPRECATED 0161 void HTMLAppletElement::setHspace(const DOMString &value) 0162 { 0163 if (impl) { 0164 ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value); 0165 } 0166 } 0167 #endif 0168 0169 long HTMLAppletElement::getHspace() const 0170 { 0171 if (!impl) { 0172 return 0; 0173 } 0174 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt(); 0175 } 0176 0177 void HTMLAppletElement::setHspace(long value) 0178 { 0179 if (impl) { 0180 ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); 0181 } 0182 } 0183 0184 DOMString HTMLAppletElement::name() const 0185 { 0186 if (!impl) { 0187 return DOMString(); 0188 } 0189 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 0190 } 0191 0192 void HTMLAppletElement::setName(const DOMString &value) 0193 { 0194 if (impl) { 0195 ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 0196 } 0197 } 0198 0199 DOMString HTMLAppletElement::object() const 0200 { 0201 if (!impl) { 0202 return DOMString(); 0203 } 0204 return ((ElementImpl *)impl)->getAttribute(ATTR_OBJECT); 0205 } 0206 0207 void HTMLAppletElement::setObject(const DOMString &value) 0208 { 0209 if (impl) { 0210 ((ElementImpl *)impl)->setAttribute(ATTR_OBJECT, value); 0211 } 0212 } 0213 0214 #ifndef KHTML_NO_DEPRECATED 0215 DOMString HTMLAppletElement::vspace() const 0216 { 0217 if (!impl) { 0218 return DOMString(); 0219 } 0220 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE); 0221 } 0222 #endif 0223 0224 #ifndef KHTML_NO_DEPRECATED 0225 void HTMLAppletElement::setVspace(const DOMString &value) 0226 { 0227 if (impl) { 0228 ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value); 0229 } 0230 } 0231 #endif 0232 0233 long HTMLAppletElement::getVspace() const 0234 { 0235 if (!impl) { 0236 return 0; 0237 } 0238 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt(); 0239 } 0240 0241 void HTMLAppletElement::setVspace(long value) 0242 { 0243 if (impl) { 0244 ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value)); 0245 } 0246 } 0247 0248 DOMString HTMLAppletElement::width() const 0249 { 0250 if (!impl) { 0251 return DOMString(); 0252 } 0253 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH); 0254 } 0255 0256 void HTMLAppletElement::setWidth(const DOMString &value) 0257 { 0258 if (impl) { 0259 ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value); 0260 } 0261 } 0262 0263 // -------------------------------------------------------------------------- 0264 0265 HTMLObjectElement::HTMLObjectElement() : HTMLElement() 0266 { 0267 } 0268 0269 HTMLObjectElement::HTMLObjectElement(const HTMLObjectElement &other) : HTMLElement(other) 0270 { 0271 } 0272 0273 HTMLObjectElement::HTMLObjectElement(HTMLObjectElementImpl *impl) : HTMLElement(impl) 0274 { 0275 } 0276 0277 HTMLObjectElement &HTMLObjectElement::operator = (const Node &other) 0278 { 0279 assignOther(other, ID_OBJECT); 0280 return *this; 0281 } 0282 0283 HTMLObjectElement &HTMLObjectElement::operator = (const HTMLObjectElement &other) 0284 { 0285 HTMLElement::operator = (other); 0286 return *this; 0287 } 0288 0289 HTMLObjectElement::~HTMLObjectElement() 0290 { 0291 } 0292 0293 HTMLFormElement HTMLObjectElement::form() const 0294 { 0295 if (!impl) { 0296 return nullptr; 0297 } 0298 return ((HTMLObjectElementImpl *)impl)->form(); 0299 } 0300 0301 DOMString HTMLObjectElement::code() const 0302 { 0303 if (!impl) { 0304 return DOMString(); 0305 } 0306 return ((ElementImpl *)impl)->getAttribute(ATTR_CODE); 0307 } 0308 0309 void HTMLObjectElement::setCode(const DOMString &value) 0310 { 0311 if (impl) { 0312 ((ElementImpl *)impl)->setAttribute(ATTR_CODE, value); 0313 } 0314 } 0315 0316 DOMString HTMLObjectElement::align() const 0317 { 0318 if (!impl) { 0319 return DOMString(); 0320 } 0321 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN); 0322 } 0323 0324 void HTMLObjectElement::setAlign(const DOMString &value) 0325 { 0326 if (impl) { 0327 ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value); 0328 } 0329 } 0330 0331 DOMString HTMLObjectElement::archive() const 0332 { 0333 if (!impl) { 0334 return DOMString(); 0335 } 0336 return ((ElementImpl *)impl)->getAttribute(ATTR_ARCHIVE); 0337 } 0338 0339 void HTMLObjectElement::setArchive(const DOMString &value) 0340 { 0341 if (impl) { 0342 ((ElementImpl *)impl)->setAttribute(ATTR_ARCHIVE, value); 0343 } 0344 } 0345 0346 DOMString HTMLObjectElement::border() const 0347 { 0348 if (!impl) { 0349 return DOMString(); 0350 } 0351 return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER); 0352 } 0353 0354 void HTMLObjectElement::setBorder(const DOMString &value) 0355 { 0356 if (impl) { 0357 ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value); 0358 } 0359 } 0360 0361 DOMString HTMLObjectElement::codeBase() const 0362 { 0363 if (!impl) { 0364 return DOMString(); 0365 } 0366 return ((ElementImpl *)impl)->getAttribute(ATTR_CODEBASE); 0367 } 0368 0369 void HTMLObjectElement::setCodeBase(const DOMString &value) 0370 { 0371 if (impl) { 0372 ((ElementImpl *)impl)->setAttribute(ATTR_CODEBASE, value); 0373 } 0374 } 0375 0376 DOMString HTMLObjectElement::codeType() const 0377 { 0378 if (!impl) { 0379 return DOMString(); 0380 } 0381 return ((ElementImpl *)impl)->getAttribute(ATTR_CODETYPE); 0382 } 0383 0384 void HTMLObjectElement::setCodeType(const DOMString &value) 0385 { 0386 if (impl) { 0387 ((ElementImpl *)impl)->setAttribute(ATTR_CODETYPE, value); 0388 } 0389 } 0390 0391 DOMString HTMLObjectElement::data() const 0392 { 0393 if (!impl) { 0394 return DOMString(); 0395 } 0396 return ((ElementImpl *)impl)->getAttribute(ATTR_DATA); 0397 } 0398 0399 void HTMLObjectElement::setData(const DOMString &value) 0400 { 0401 if (impl) { 0402 ((ElementImpl *)impl)->setAttribute(ATTR_DATA, value); 0403 } 0404 } 0405 0406 bool HTMLObjectElement::declare() const 0407 { 0408 if (!impl) { 0409 return 0; 0410 } 0411 return !((ElementImpl *)impl)->getAttribute(ATTR_DECLARE).isNull(); 0412 } 0413 0414 void HTMLObjectElement::setDeclare(bool _declare) 0415 { 0416 if (impl) { 0417 DOMString str; 0418 if (_declare) { 0419 str = ""; 0420 } 0421 ((ElementImpl *)impl)->setAttribute(ATTR_DECLARE, str); 0422 } 0423 } 0424 0425 DOMString HTMLObjectElement::height() const 0426 { 0427 if (!impl) { 0428 return DOMString(); 0429 } 0430 return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT); 0431 } 0432 0433 void HTMLObjectElement::setHeight(const DOMString &value) 0434 { 0435 if (impl) { 0436 ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value); 0437 } 0438 } 0439 0440 #ifndef KHTML_NO_DEPRECATED 0441 DOMString HTMLObjectElement::hspace() const 0442 { 0443 if (!impl) { 0444 return DOMString(); 0445 } 0446 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE); 0447 } 0448 #endif 0449 0450 #ifndef KHTML_NO_DEPRECATED 0451 void HTMLObjectElement::setHspace(const DOMString &value) 0452 { 0453 if (impl) { 0454 ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value); 0455 } 0456 } 0457 #endif 0458 0459 long HTMLObjectElement::getHspace() const 0460 { 0461 if (!impl) { 0462 return 0; 0463 } 0464 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt(); 0465 } 0466 0467 void HTMLObjectElement::setHspace(long value) 0468 { 0469 if (impl) { 0470 ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); 0471 } 0472 } 0473 0474 DOMString HTMLObjectElement::name() const 0475 { 0476 if (!impl) { 0477 return DOMString(); 0478 } 0479 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 0480 } 0481 0482 void HTMLObjectElement::setName(const DOMString &value) 0483 { 0484 if (impl) { 0485 ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 0486 } 0487 } 0488 0489 DOMString HTMLObjectElement::standby() const 0490 { 0491 if (!impl) { 0492 return DOMString(); 0493 } 0494 return ((ElementImpl *)impl)->getAttribute(ATTR_STANDBY); 0495 } 0496 0497 void HTMLObjectElement::setStandby(const DOMString &value) 0498 { 0499 if (impl) { 0500 ((ElementImpl *)impl)->setAttribute(ATTR_STANDBY, value); 0501 } 0502 } 0503 0504 long HTMLObjectElement::tabIndex() const 0505 { 0506 if (!impl) { 0507 return 0; 0508 } 0509 return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt(); 0510 } 0511 0512 void HTMLObjectElement::setTabIndex(long _tabIndex) 0513 { 0514 if (impl) { 0515 DOMString value(QString::number(_tabIndex)); 0516 ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX, value); 0517 } 0518 } 0519 0520 DOMString HTMLObjectElement::type() const 0521 { 0522 if (!impl) { 0523 return DOMString(); 0524 } 0525 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE); 0526 } 0527 0528 void HTMLObjectElement::setType(const DOMString &value) 0529 { 0530 if (impl) { 0531 ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value); 0532 } 0533 } 0534 0535 DOMString HTMLObjectElement::useMap() const 0536 { 0537 if (!impl) { 0538 return DOMString(); 0539 } 0540 return ((ElementImpl *)impl)->getAttribute(ATTR_USEMAP); 0541 } 0542 0543 void HTMLObjectElement::setUseMap(const DOMString &value) 0544 { 0545 if (impl) { 0546 ((ElementImpl *)impl)->setAttribute(ATTR_USEMAP, value); 0547 } 0548 } 0549 0550 #ifndef KHTML_NO_DEPRECATED 0551 DOMString HTMLObjectElement::vspace() const 0552 { 0553 if (!impl) { 0554 return DOMString(); 0555 } 0556 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE); 0557 } 0558 #endif 0559 0560 #ifndef KHTML_NO_DEPRECATED 0561 void HTMLObjectElement::setVspace(const DOMString &value) 0562 { 0563 if (impl) { 0564 ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value); 0565 } 0566 } 0567 #endif 0568 0569 long HTMLObjectElement::getVspace() const 0570 { 0571 if (!impl) { 0572 return 0; 0573 } 0574 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt(); 0575 } 0576 0577 void HTMLObjectElement::setVspace(long value) 0578 { 0579 if (impl) { 0580 ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value)); 0581 } 0582 } 0583 0584 DOMString HTMLObjectElement::width() const 0585 { 0586 if (!impl) { 0587 return DOMString(); 0588 } 0589 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH); 0590 } 0591 0592 void HTMLObjectElement::setWidth(const DOMString &value) 0593 { 0594 if (impl) { 0595 ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value); 0596 } 0597 } 0598 0599 Document HTMLObjectElement::contentDocument() const 0600 { 0601 if (impl) { 0602 return static_cast<HTMLObjectElementImpl *>(impl)->contentDocument(); 0603 } 0604 return Document(); 0605 } 0606 0607 // -------------------------------------------------------------------------- 0608 0609 HTMLParamElement::HTMLParamElement() : HTMLElement() 0610 { 0611 } 0612 0613 HTMLParamElement::HTMLParamElement(const HTMLParamElement &other) : HTMLElement(other) 0614 { 0615 } 0616 0617 HTMLParamElement::HTMLParamElement(HTMLParamElementImpl *impl) : HTMLElement(impl) 0618 { 0619 } 0620 0621 HTMLParamElement &HTMLParamElement::operator = (const Node &other) 0622 { 0623 assignOther(other, ID_PARAM); 0624 return *this; 0625 } 0626 0627 HTMLParamElement &HTMLParamElement::operator = (const HTMLParamElement &other) 0628 { 0629 HTMLElement::operator = (other); 0630 return *this; 0631 } 0632 0633 HTMLParamElement::~HTMLParamElement() 0634 { 0635 } 0636 0637 DOMString HTMLParamElement::name() const 0638 { 0639 if (!impl) { 0640 return DOMString(); 0641 } 0642 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME); 0643 } 0644 0645 void HTMLParamElement::setName(const DOMString &value) 0646 { 0647 if (impl) { 0648 ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value); 0649 } 0650 } 0651 0652 DOMString HTMLParamElement::type() const 0653 { 0654 if (!impl) { 0655 return DOMString(); 0656 } 0657 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE); 0658 } 0659 0660 void HTMLParamElement::setType(const DOMString &value) 0661 { 0662 if (impl) { 0663 ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value); 0664 } 0665 } 0666 0667 DOMString HTMLParamElement::value() const 0668 { 0669 if (!impl) { 0670 return DOMString(); 0671 } 0672 return ((ElementImpl *)impl)->getAttribute(ATTR_VALUE); 0673 } 0674 0675 void HTMLParamElement::setValue(const DOMString &value) 0676 { 0677 if (impl) { 0678 ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value); 0679 } 0680 } 0681 0682 DOMString HTMLParamElement::valueType() const 0683 { 0684 if (!impl) { 0685 return DOMString(); 0686 } 0687 return ((ElementImpl *)impl)->getAttribute(ATTR_VALUETYPE); 0688 } 0689 0690 void HTMLParamElement::setValueType(const DOMString &value) 0691 { 0692 if (impl) { 0693 ((ElementImpl *)impl)->setAttribute(ATTR_VALUETYPE, value); 0694 } 0695 } 0696