File indexing completed on 2024-04-28 15:23:01

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 #ifndef HTML_HEAD_H
0030 #define HTML_HEAD_H
0031 
0032 #include <dom/html_element.h>
0033 #include <dom/css_stylesheet.h>
0034 
0035 namespace DOM
0036 {
0037 
0038 class HTMLBaseElementImpl;
0039 class DOMString;
0040 
0041 /**
0042  * Document base URI. See the <a
0043  * href="https://www.w3.org/TR/REC-html40/struct/links.html#edef-BASE">
0044  * BASE element definition </a> in HTML 4.0.
0045  *
0046  */
0047 class KHTML_EXPORT HTMLBaseElement : public HTMLElement
0048 {
0049 public:
0050     HTMLBaseElement();
0051     HTMLBaseElement(const HTMLBaseElement &other);
0052     HTMLBaseElement(const Node &other) : HTMLElement()
0053     {
0054         (*this) = other;
0055     }
0056 protected:
0057     HTMLBaseElement(HTMLBaseElementImpl *impl);
0058 public:
0059 
0060     HTMLBaseElement &operator = (const HTMLBaseElement &other);
0061     HTMLBaseElement &operator = (const Node &other);
0062 
0063     ~HTMLBaseElement();
0064 
0065     /**
0066      * The base URI See the <a
0067      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-href-BASE">
0068      * href attribute definition </a> in HTML 4.0.
0069      *
0070      */
0071     DOMString href() const;
0072 
0073     /**
0074      * see href
0075      */
0076     void setHref(const DOMString &);
0077 
0078     /**
0079      * The default target frame. See the <a
0080      * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
0081      * target attribute definition </a> in HTML 4.0.
0082      *
0083      */
0084     DOMString target() const;
0085 
0086     /**
0087      * see target
0088      */
0089     void setTarget(const DOMString &);
0090 };
0091 
0092 // --------------------------------------------------------------------------
0093 
0094 class HTMLLinkElementImpl;
0095 
0096 /**
0097  * The \c LINK element specifies a link to an external
0098  * resource, and defines this document's relationship to that resource
0099  * (or vice versa). See the <a
0100  * href="https://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK">
0101  * LINK element definition </a> in HTML 4.0.
0102  *
0103  */
0104 class KHTML_EXPORT HTMLLinkElement : public HTMLElement
0105 {
0106 public:
0107     HTMLLinkElement();
0108     HTMLLinkElement(const HTMLLinkElement &other);
0109     HTMLLinkElement(const Node &other) : HTMLElement()
0110     {
0111         (*this) = other;
0112     }
0113 protected:
0114     HTMLLinkElement(HTMLLinkElementImpl *impl);
0115 public:
0116 
0117     HTMLLinkElement &operator = (const HTMLLinkElement &other);
0118     HTMLLinkElement &operator = (const Node &other);
0119 
0120     ~HTMLLinkElement();
0121 
0122     /**
0123      * Enables/disables the link. This is currently only used for
0124      * style sheet links, and may be used to activate or deactivate
0125      * style sheets.
0126      *
0127      */
0128     bool disabled() const;
0129 
0130     /**
0131      * see disabled
0132      */
0133     void setDisabled(bool);
0134 
0135     /**
0136      * The character encoding of the resource being linked to. See the
0137      * <a
0138      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-charset">
0139      * charset attribute definition </a> in HTML 4.0.
0140      *
0141      */
0142     DOMString charset() const;
0143 
0144     /**
0145      * see charset
0146      */
0147     void setCharset(const DOMString &);
0148 
0149     /**
0150      * The URI of the linked resource. See the <a
0151      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-href">
0152      * href attribute definition </a> in HTML 4.0.
0153      *
0154      */
0155     DOMString href() const;
0156 
0157     /**
0158      * see href
0159      */
0160     void setHref(const DOMString &);
0161 
0162     /**
0163      * Language code of the linked resource. See the <a
0164      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-hreflang">
0165      * hreflang attribute definition </a> in HTML 4.0.
0166      *
0167      */
0168     DOMString hreflang() const;
0169 
0170     /**
0171      * see hreflang
0172      */
0173     void setHreflang(const DOMString &);
0174 
0175     /**
0176      * Designed for use with one or more target media. See the <a
0177      * href="https://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
0178      * media attribute definition </a> in HTML 4.0.
0179      *
0180      */
0181     DOMString media() const;
0182 
0183     /**
0184      * see media
0185      */
0186     void setMedia(const DOMString &);
0187 
0188     /**
0189      * Forward link type. See the <a
0190      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-rel">
0191      * rel attribute definition </a> in HTML 4.0.
0192      *
0193      */
0194     DOMString rel() const;
0195 
0196     /**
0197      * see rel
0198      */
0199     void setRel(const DOMString &);
0200 
0201     /**
0202      * Reverse link type. See the <a
0203      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-rev">
0204      * rev attribute definition </a> in HTML 4.0.
0205      *
0206      */
0207     DOMString rev() const;
0208 
0209     /**
0210      * see rev
0211      */
0212     void setRev(const DOMString &);
0213 
0214     /**
0215      * Frame to render the resource in. See the <a
0216      * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
0217      * target attribute definition </a> in HTML 4.0.
0218      *
0219      */
0220     DOMString target() const;
0221 
0222     /**
0223      * see target
0224      */
0225     void setTarget(const DOMString &);
0226 
0227     /**
0228      * Advisory content type. See the <a
0229      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-type-A">
0230      * type attribute definition </a> in HTML 4.0.
0231      *
0232      */
0233     DOMString type() const;
0234 
0235     /**
0236      * see type
0237      */
0238     void setType(const DOMString &);
0239 
0240     /**
0241      * Introduced in DOM Level 2
0242      * This method is from the LinkStyle interface
0243      *
0244      * The style sheet.
0245      */
0246     StyleSheet sheet() const;
0247 
0248 };
0249 
0250 // --------------------------------------------------------------------------
0251 
0252 class HTMLMetaElementImpl;
0253 
0254 /**
0255  * This contains generic meta-information about the document. See the
0256  * <a
0257  * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-META">
0258  * META element definition </a> in HTML 4.0.
0259  *
0260  */
0261 class KHTML_EXPORT HTMLMetaElement : public HTMLElement
0262 {
0263 public:
0264     HTMLMetaElement();
0265     HTMLMetaElement(const HTMLMetaElement &other);
0266     HTMLMetaElement(const Node &other) : HTMLElement()
0267     {
0268         (*this) = other;
0269     }
0270 protected:
0271     HTMLMetaElement(HTMLMetaElementImpl *impl);
0272 public:
0273 
0274     HTMLMetaElement &operator = (const HTMLMetaElement &other);
0275     HTMLMetaElement &operator = (const Node &other);
0276 
0277     ~HTMLMetaElement();
0278 
0279     /**
0280      * Associated information. See the <a
0281      * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-content">
0282      * content attribute definition </a> in HTML 4.0.
0283      *
0284      */
0285     DOMString content() const;
0286 
0287     /**
0288      * see content
0289      */
0290     void setContent(const DOMString &);
0291 
0292     /**
0293      * HTTP response header name. See the <a
0294      * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-http-equiv">
0295      * http-equiv attribute definition </a> in HTML 4.0.
0296      *
0297      */
0298     DOMString httpEquiv() const;
0299 
0300     /**
0301      * see httpEquiv
0302      */
0303     void setHttpEquiv(const DOMString &);
0304 
0305     /**
0306      * Meta information name. See the <a
0307      * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-name-META">
0308      * name attribute definition </a> in HTML 4.0.
0309      *
0310      */
0311     DOMString name() const;
0312 
0313     /**
0314      * see name
0315      */
0316     void setName(const DOMString &);
0317 
0318     /**
0319      * Select form of content. See the <a
0320      * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-scheme">
0321      * scheme attribute definition </a> in HTML 4.0.
0322      *
0323      */
0324     DOMString scheme() const;
0325 
0326     /**
0327      * see scheme
0328      */
0329     void setScheme(const DOMString &);
0330 };
0331 
0332 // --------------------------------------------------------------------------
0333 
0334 class HTMLScriptElementImpl;
0335 
0336 /**
0337  * Script statements. See the <a
0338  * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#edef-SCRIPT">
0339  * SCRIPT element definition </a> in HTML 4.0.
0340  *
0341  */
0342 class KHTML_EXPORT HTMLScriptElement : public HTMLElement
0343 {
0344 public:
0345     HTMLScriptElement();
0346     HTMLScriptElement(const HTMLScriptElement &other);
0347     HTMLScriptElement(const Node &other) : HTMLElement()
0348     {
0349         (*this) = other;
0350     }
0351 protected:
0352     HTMLScriptElement(HTMLScriptElementImpl *impl);
0353 public:
0354 
0355     HTMLScriptElement &operator = (const HTMLScriptElement &other);
0356     HTMLScriptElement &operator = (const Node &other);
0357 
0358     ~HTMLScriptElement();
0359 
0360     /**
0361      * The script content of the element.
0362      *
0363      */
0364     DOMString text() const;
0365 
0366     /**
0367      * see text
0368      */
0369     void setText(const DOMString &);
0370 
0371     /**
0372      * Reserved for future use.
0373      *
0374      */
0375     DOMString htmlFor() const;
0376 
0377     /**
0378      * see htmlFor
0379      */
0380     void setHtmlFor(const DOMString &);
0381 
0382     /**
0383      * Reserved for future use.
0384      *
0385      */
0386     DOMString event() const;
0387 
0388     /**
0389      * see event
0390      */
0391     void setEvent(const DOMString &);
0392 
0393     /**
0394      * The character encoding of the linked resource. See the <a
0395      * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-charset">
0396      * charset attribute definition </a> in HTML 4.0.
0397      *
0398      */
0399     DOMString charset() const;
0400 
0401     /**
0402      * see charset
0403      */
0404     void setCharset(const DOMString &);
0405 
0406     /**
0407      * Indicates that the user agent can defer processing of the
0408      * script. See the <a
0409      * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#adef-defer">
0410      * defer attribute definition </a> in HTML 4.0.
0411      *
0412      */
0413     bool defer() const;
0414 
0415     /**
0416      * see defer
0417      */
0418     void setDefer(bool);
0419 
0420     /**
0421      * URI designating an external script. See the <a
0422      * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#adef-src-SCRIPT">
0423      * src attribute definition </a> in HTML 4.0.
0424      *
0425      */
0426     DOMString src() const;
0427 
0428     /**
0429      * see src
0430      */
0431     void setSrc(const DOMString &);
0432 
0433     /**
0434      * The content type of the script language. See the <a
0435      * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#adef-type-SCRIPT">
0436      * type attribute definition </a> in HTML 4.0.
0437      *
0438      */
0439     DOMString type() const;
0440 
0441     /**
0442      * see type
0443      */
0444     void setType(const DOMString &);
0445 };
0446 
0447 // --------------------------------------------------------------------------
0448 
0449 class HTMLStyleElementImpl;
0450 
0451 /**
0452  * Style information. A more detailed style sheet object model is
0453  * planned to be defined in a separate document. See the <a
0454  * href="https://www.w3.org/TR/REC-html40/present/styles.html#edef-STYLE">
0455  * STYLE element definition </a> in HTML 4.0.
0456  *
0457  */
0458 class KHTML_EXPORT HTMLStyleElement : public HTMLElement
0459 {
0460 public:
0461     HTMLStyleElement();
0462     HTMLStyleElement(const HTMLStyleElement &other);
0463     HTMLStyleElement(const Node &other) : HTMLElement()
0464     {
0465         (*this) = other;
0466     }
0467 protected:
0468     HTMLStyleElement(HTMLStyleElementImpl *impl);
0469 public:
0470 
0471     HTMLStyleElement &operator = (const HTMLStyleElement &other);
0472     HTMLStyleElement &operator = (const Node &other);
0473 
0474     ~HTMLStyleElement();
0475 
0476     /**
0477      * Enables/disables the style sheet.
0478      *
0479      */
0480     bool disabled() const;
0481 
0482     /**
0483      * see disabled
0484      */
0485     void setDisabled(bool);
0486 
0487     /**
0488      * Designed for use with one or more target media. See the <a
0489      * href="https://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
0490      * media attribute definition </a> in HTML 4.0.
0491      *
0492      */
0493     DOMString media() const;
0494 
0495     /**
0496      * see media
0497      */
0498     void setMedia(const DOMString &);
0499 
0500     /**
0501      * The style sheet language (Internet media type). See the <a
0502      * href="https://www.w3.org/TR/REC-html40/present/styles.html#adef-type-STYLE">
0503      * type attribute definition </a> in HTML 4.0.
0504      *
0505      */
0506     DOMString type() const;
0507 
0508     /**
0509      * see type
0510      */
0511     void setType(const DOMString &);
0512 
0513     /**
0514      * Introduced in DOM Level 2
0515      * This method is from the LinkStyle interface
0516      *
0517      * The style sheet.
0518      */
0519     StyleSheet sheet() const;
0520 
0521 };
0522 
0523 // --------------------------------------------------------------------------
0524 
0525 class HTMLTitleElementImpl;
0526 
0527 /**
0528  * The document title. See the <a
0529  * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-TITLE">
0530  * TITLE element definition </a> in HTML 4.0.
0531  *
0532  */
0533 class KHTML_EXPORT HTMLTitleElement : public HTMLElement
0534 {
0535 public:
0536     HTMLTitleElement();
0537     HTMLTitleElement(const HTMLTitleElement &other);
0538     HTMLTitleElement(const Node &other) : HTMLElement()
0539     {
0540         (*this) = other;
0541     }
0542 protected:
0543     HTMLTitleElement(HTMLTitleElementImpl *impl);
0544 public:
0545 
0546     HTMLTitleElement &operator = (const HTMLTitleElement &other);
0547     HTMLTitleElement &operator = (const Node &other);
0548 
0549     ~HTMLTitleElement();
0550 
0551     /**
0552      * The specified title as a string.
0553      *
0554      */
0555     DOMString text() const;
0556 
0557     /**
0558      * see text
0559      */
0560     void setText(const DOMString &);
0561 };
0562 
0563 } //namespace
0564 
0565 #endif