File indexing completed on 2024-04-28 15:22:59
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 * This file includes excerpts from the Document Object Model (DOM) 0022 * Level 1 Specification (Recommendation) 0023 * https://www.w3.org/TR/REC-DOM-Level-1/ 0024 * Copyright © World Wide Web Consortium , (Massachusetts Institute of 0025 * Technology , Institut National de Recherche en Informatique et en 0026 * Automatique , Keio University ). All Rights Reserved. 0027 * 0028 */ 0029 0030 #ifndef HTML_BASE_H 0031 #define HTML_BASE_H 0032 0033 #include <khtml_export.h> 0034 #include <dom/html_element.h> 0035 0036 namespace DOM 0037 { 0038 0039 class HTMLBodyElementImpl; 0040 class DOMString; 0041 0042 /** 0043 * The HTML document body. This element is always present in the DOM 0044 * API, even if the tags are not present in the source document. See 0045 * the <a 0046 * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-BODY"> 0047 * BODY element definition </a> in HTML 4.0. 0048 * 0049 */ 0050 class KHTML_EXPORT HTMLBodyElement : public HTMLElement 0051 { 0052 public: 0053 HTMLBodyElement(); 0054 HTMLBodyElement(const HTMLBodyElement &other); 0055 HTMLBodyElement(const Node &other) : HTMLElement() 0056 { 0057 (*this) = other; 0058 } 0059 protected: 0060 HTMLBodyElement(HTMLBodyElementImpl *impl); 0061 public: 0062 0063 HTMLBodyElement &operator = (const HTMLBodyElement &other); 0064 HTMLBodyElement &operator = (const Node &other); 0065 0066 ~HTMLBodyElement(); 0067 0068 /** 0069 * Color of active links (after mouse-button down, but before 0070 * mouse-button up). See the <a 0071 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-alink"> 0072 * alink attribute definition </a> in HTML 4.0. This attribute is 0073 * deprecated in HTML 4.0. 0074 * 0075 */ 0076 DOMString aLink() const; 0077 0078 /** 0079 * see aLink 0080 */ 0081 void setALink(const DOMString &); 0082 0083 /** 0084 * URI of the background texture tile image. See the <a 0085 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-background"> 0086 * background attribute definition </a> in HTML 4.0. This 0087 * attribute is deprecated in HTML 4.0. 0088 * 0089 */ 0090 DOMString background() const; 0091 0092 /** 0093 * see background 0094 */ 0095 void setBackground(const DOMString &); 0096 0097 /** 0098 * Document background color. See the <a 0099 * href="https://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor"> 0100 * bgcolor attribute definition </a> in HTML 4.0. This attribute 0101 * is deprecated in HTML 4.0. 0102 * 0103 */ 0104 DOMString bgColor() const; 0105 0106 /** 0107 * see bgColor 0108 */ 0109 void setBgColor(const DOMString &); 0110 0111 /** 0112 * Color of links that are not active and unvisited. See the <a 0113 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-link"> 0114 * link attribute definition </a> in HTML 4.0. This attribute is 0115 * deprecated in HTML 4.0. 0116 * 0117 */ 0118 DOMString link() const; 0119 0120 /** 0121 * see link 0122 */ 0123 void setLink(const DOMString &); 0124 0125 /** 0126 * Document text color. See the <a 0127 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-text"> 0128 * text attribute definition </a> in HTML 4.0. This attribute is 0129 * deprecated in HTML 4.0. 0130 * 0131 */ 0132 DOMString text() const; 0133 0134 /** 0135 * see text 0136 */ 0137 void setText(const DOMString &); 0138 0139 /** 0140 * Color of links that have been visited by the user. See the <a 0141 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-vlink"> 0142 * vlink attribute definition </a> in HTML 4.0. This attribute is 0143 * deprecated in HTML 4.0. 0144 * 0145 */ 0146 DOMString vLink() const; 0147 0148 /** 0149 * see vLink 0150 */ 0151 void setVLink(const DOMString &); 0152 }; 0153 0154 // -------------------------------------------------------------------------- 0155 0156 class HTMLFrameElementImpl; 0157 class DOMString; 0158 0159 /** 0160 * Create a frame. See the <a 0161 * href="https://www.w3.org/TR/REC-html40/present/frames.html#edef-FRAME"> 0162 * FRAME element definition </a> in HTML 4.0. 0163 * 0164 */ 0165 class KHTML_EXPORT HTMLFrameElement : public HTMLElement 0166 { 0167 public: 0168 HTMLFrameElement(); 0169 HTMLFrameElement(const HTMLFrameElement &other); 0170 HTMLFrameElement(const Node &other) : HTMLElement() 0171 { 0172 (*this) = other; 0173 } 0174 protected: 0175 HTMLFrameElement(HTMLFrameElementImpl *impl); 0176 public: 0177 0178 HTMLFrameElement &operator = (const HTMLFrameElement &other); 0179 HTMLFrameElement &operator = (const Node &other); 0180 0181 ~HTMLFrameElement(); 0182 0183 /** 0184 * Request frame borders. See the <a 0185 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-frameborder"> 0186 * frameborder attribute definition </a> in HTML 4.0. 0187 * 0188 */ 0189 DOMString frameBorder() const; 0190 0191 /** 0192 * see frameBorder 0193 */ 0194 void setFrameBorder(const DOMString &); 0195 0196 /** 0197 * URI designating a long description of this image or frame. See 0198 * the <a 0199 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-longdesc-FRAME"> 0200 * longdesc attribute definition </a> in HTML 4.0. 0201 * 0202 */ 0203 DOMString longDesc() const; 0204 0205 /** 0206 * see longDesc 0207 */ 0208 void setLongDesc(const DOMString &); 0209 0210 /** 0211 * Frame margin height, in pixels. See the <a 0212 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-marginheight"> 0213 * marginheight attribute definition </a> in HTML 4.0. 0214 * 0215 */ 0216 DOMString marginHeight() const; 0217 0218 /** 0219 * see marginHeight 0220 */ 0221 void setMarginHeight(const DOMString &); 0222 0223 /** 0224 * Frame margin width, in pixels. See the <a 0225 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-marginwidth"> 0226 * marginwidth attribute definition </a> in HTML 4.0. 0227 * 0228 */ 0229 DOMString marginWidth() const; 0230 0231 /** 0232 * see marginWidth 0233 */ 0234 void setMarginWidth(const DOMString &); 0235 0236 /** 0237 * The frame name (object of the \c target attribute). 0238 * See the <a 0239 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-name-FRAME"> 0240 * name attribute definition </a> in HTML 4.0. 0241 * 0242 */ 0243 DOMString name() const; 0244 0245 /** 0246 * see name 0247 */ 0248 void setName(const DOMString &); 0249 0250 /** 0251 * When true, forbid user from resizing frame. See the <a 0252 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-noresize"> 0253 * noresize attribute definition </a> in HTML 4.0. 0254 * 0255 */ 0256 bool noResize() const; 0257 0258 /** 0259 * see noResize 0260 */ 0261 void setNoResize(bool); 0262 0263 /** 0264 * Specify whether or not the frame should have scrollbars. See 0265 * the <a 0266 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-scrolling"> 0267 * scrolling attribute definition </a> in HTML 4.0. 0268 * 0269 */ 0270 DOMString scrolling() const; 0271 0272 /** 0273 * see scrolling 0274 */ 0275 void setScrolling(const DOMString &); 0276 0277 /** 0278 * A URI designating the initial frame contents. See the <a 0279 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-src-FRAME"> 0280 * src attribute definition </a> in HTML 4.0. 0281 * 0282 */ 0283 DOMString src() const; 0284 0285 /** 0286 * see src 0287 */ 0288 void setSrc(const DOMString &); 0289 0290 /** 0291 * Introduced in DOM Level 2 0292 * 0293 * Returns the document this frame contains, if there is any and 0294 * it is available, a Null document otherwise. The attribute is 0295 * read-only. 0296 * 0297 * @return The content Document if available. 0298 */ 0299 Document contentDocument() const; 0300 }; 0301 0302 // -------------------------------------------------------------------------- 0303 0304 class HTMLFrameSetElementImpl; 0305 class DOMString; 0306 0307 /** 0308 * Create a grid of frames. See the <a 0309 * href="https://www.w3.org/TR/REC-html40/present/frames.html#edef-FRAMESET"> 0310 * FRAMESET element definition </a> in HTML 4.0. 0311 * 0312 */ 0313 class KHTML_EXPORT HTMLFrameSetElement : public HTMLElement 0314 { 0315 public: 0316 HTMLFrameSetElement(); 0317 HTMLFrameSetElement(const HTMLFrameSetElement &other); 0318 HTMLFrameSetElement(const Node &other) : HTMLElement() 0319 { 0320 (*this) = other; 0321 } 0322 protected: 0323 HTMLFrameSetElement(HTMLFrameSetElementImpl *impl); 0324 public: 0325 0326 HTMLFrameSetElement &operator = (const HTMLFrameSetElement &other); 0327 HTMLFrameSetElement &operator = (const Node &other); 0328 0329 ~HTMLFrameSetElement(); 0330 0331 /** 0332 * The number of columns of frames in the frameset. See the <a 0333 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-cols-FRAMESET"> 0334 * cols attribute definition </a> in HTML 4.0. 0335 * 0336 */ 0337 DOMString cols() const; 0338 0339 /** 0340 * see cols 0341 */ 0342 void setCols(const DOMString &); 0343 0344 /** 0345 * The number of rows of frames in the frameset. See the <a 0346 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-rows-FRAMESET"> 0347 * rows attribute definition </a> in HTML 4.0. 0348 * 0349 */ 0350 DOMString rows() const; 0351 0352 /** 0353 * see rows 0354 */ 0355 void setRows(const DOMString &); 0356 }; 0357 0358 // -------------------------------------------------------------------------- 0359 0360 class HTMLIFrameElementImpl; 0361 0362 /** 0363 * Inline subwindows. See the <a 0364 * href="https://www.w3.org/TR/REC-html40/present/frames.html#edef-IFRAME"> 0365 * IFRAME element definition </a> in HTML 4.0. 0366 * 0367 */ 0368 class KHTML_EXPORT HTMLIFrameElement : public HTMLElement 0369 { 0370 public: 0371 HTMLIFrameElement(); 0372 HTMLIFrameElement(const HTMLIFrameElement &other); 0373 HTMLIFrameElement(const Node &other) : HTMLElement() 0374 { 0375 (*this) = other; 0376 } 0377 protected: 0378 HTMLIFrameElement(HTMLIFrameElementImpl *impl); 0379 public: 0380 0381 HTMLIFrameElement &operator = (const HTMLIFrameElement &other); 0382 HTMLIFrameElement &operator = (const Node &other); 0383 0384 ~HTMLIFrameElement(); 0385 0386 /** 0387 * Aligns this object (vertically or horizontally) with respect to 0388 * its surrounding text. See the <a 0389 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG"> 0390 * align attribute definition </a> in HTML 4.0. This attribute is 0391 * deprecated in HTML 4.0. 0392 * 0393 */ 0394 DOMString align() const; 0395 0396 /** 0397 * see align 0398 */ 0399 void setAlign(const DOMString &); 0400 0401 /** 0402 * Request frame borders. See the <a 0403 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-frameborder"> 0404 * frameborder attribute definition </a> in HTML 4.0. 0405 * 0406 */ 0407 DOMString frameBorder() const; 0408 0409 /** 0410 * see frameBorder 0411 */ 0412 void setFrameBorder(const DOMString &); 0413 0414 /** 0415 * Frame height. See the <a 0416 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-height-IFRAME"> 0417 * height attribute definition </a> in HTML 4.0. 0418 * 0419 */ 0420 DOMString height() const; 0421 0422 /** 0423 * see height 0424 */ 0425 void setHeight(const DOMString &); 0426 0427 /** 0428 * URI designating a long description of this image or frame. See 0429 * the <a 0430 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-longdesc-IFRAME"> 0431 * longdesc attribute definition </a> in HTML 4.0. 0432 * 0433 */ 0434 DOMString longDesc() const; 0435 0436 /** 0437 * see longDesc 0438 */ 0439 void setLongDesc(const DOMString &); 0440 0441 /** 0442 * Frame margin height, in pixels. See the <a 0443 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-marginheight"> 0444 * marginheight attribute definition </a> in HTML 4.0. 0445 * 0446 */ 0447 DOMString marginHeight() const; 0448 0449 /** 0450 * see marginHeight 0451 */ 0452 void setMarginHeight(const DOMString &); 0453 0454 /** 0455 * Frame margin width, in pixels. See the <a 0456 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-marginwidth"> 0457 * marginwidth attribute definition </a> in HTML 4.0. 0458 * 0459 */ 0460 DOMString marginWidth() const; 0461 0462 /** 0463 * see marginWidth 0464 */ 0465 void setMarginWidth(const DOMString &); 0466 0467 /** 0468 * The frame name (object of the \c target attribute). 0469 * See the <a 0470 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-name-IFRAME"> 0471 * name attribute definition </a> in HTML 4.0. 0472 * 0473 */ 0474 DOMString name() const; 0475 0476 /** 0477 * see name 0478 */ 0479 void setName(const DOMString &); 0480 0481 /** 0482 * Specify whether or not the frame should have scrollbars. See 0483 * the <a 0484 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-scrolling"> 0485 * scrolling attribute definition </a> in HTML 4.0. 0486 * 0487 */ 0488 DOMString scrolling() const; 0489 0490 /** 0491 * see scrolling 0492 */ 0493 void setScrolling(const DOMString &); 0494 0495 /** 0496 * A URI designating the initial frame contents. See the <a 0497 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-src-FRAME"> 0498 * src attribute definition </a> in HTML 4.0. 0499 * 0500 */ 0501 DOMString src() const; 0502 0503 /** 0504 * see src 0505 */ 0506 void setSrc(const DOMString &); 0507 0508 /** 0509 * Frame width. See the <a 0510 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-width-IFRAME"> 0511 * width attribute definition </a> in HTML 4.0. 0512 * 0513 */ 0514 DOMString width() const; 0515 0516 /** 0517 * see width 0518 */ 0519 void setWidth(const DOMString &); 0520 0521 /** 0522 * Introduced in DOM Level 2 0523 * 0524 * Returns the document this iframe contains, if there is any and 0525 * it is available, a Null document otherwise. The attribute is 0526 * read-only. 0527 * 0528 * @return The content Document if available. 0529 */ 0530 Document contentDocument() const; 0531 }; 0532 0533 // -------------------------------------------------------------------------- 0534 0535 class HTMLHeadElementImpl; 0536 class DOMString; 0537 0538 /** 0539 * Document head information. See the <a 0540 * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-HEAD"> 0541 * HEAD element definition </a> in HTML 4.0. 0542 * 0543 */ 0544 class KHTML_EXPORT HTMLHeadElement : public HTMLElement 0545 { 0546 public: 0547 HTMLHeadElement(); 0548 HTMLHeadElement(const HTMLHeadElement &other); 0549 HTMLHeadElement(const Node &other) : HTMLElement() 0550 { 0551 (*this) = other; 0552 } 0553 protected: 0554 HTMLHeadElement(HTMLHeadElementImpl *impl); 0555 public: 0556 0557 HTMLHeadElement &operator = (const HTMLHeadElement &other); 0558 HTMLHeadElement &operator = (const Node &other); 0559 0560 ~HTMLHeadElement(); 0561 0562 /** 0563 * URI designating a metadata profile. See the <a 0564 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-profile"> 0565 * profile attribute definition </a> in HTML 4.0. 0566 * 0567 */ 0568 DOMString profile() const; 0569 0570 /** 0571 * see profile 0572 */ 0573 void setProfile(const DOMString &); 0574 }; 0575 0576 // -------------------------------------------------------------------------- 0577 0578 class HTMLHtmlElementImpl; 0579 class DOMString; 0580 0581 /** 0582 * Root of an HTML document. See the <a 0583 * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-HTML"> 0584 * HTML element definition </a> in HTML 4.0. 0585 * 0586 */ 0587 class KHTML_EXPORT HTMLHtmlElement : public HTMLElement 0588 { 0589 public: 0590 HTMLHtmlElement(); 0591 HTMLHtmlElement(const HTMLHtmlElement &other); 0592 HTMLHtmlElement(const Node &other) : HTMLElement() 0593 { 0594 (*this) = other; 0595 } 0596 protected: 0597 HTMLHtmlElement(HTMLHtmlElementImpl *impl); 0598 public: 0599 0600 HTMLHtmlElement &operator = (const HTMLHtmlElement &other); 0601 HTMLHtmlElement &operator = (const Node &other); 0602 0603 ~HTMLHtmlElement(); 0604 0605 /** 0606 * Version information about the document's DTD. See the <a 0607 * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-version"> 0608 * version attribute definition </a> in HTML 4.0. This attribute 0609 * is deprecated in HTML 4.0. 0610 * 0611 */ 0612 DOMString version() const; 0613 0614 /** 0615 * see version 0616 */ 0617 void setVersion(const DOMString &); 0618 }; 0619 0620 } //namespace 0621 0622 #endif