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  * 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 // --------------------------------------------------------------------------
0031 
0032 #ifndef HTML_OBJECT_H
0033 #define HTML_OBJECT_H
0034 
0035 #include <dom/html_element.h>
0036 #include <dom/html_form.h>
0037 
0038 namespace DOM
0039 {
0040 
0041 class HTMLAppletElementImpl;
0042 
0043 /**
0044  * An embedded Java applet. See the <a
0045  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-APPLET">
0046  * APPLET element definition </a> in HTML 4.0. This element is
0047  * deprecated in HTML 4.0.
0048  *
0049  */
0050 class KHTML_EXPORT HTMLAppletElement : public HTMLElement
0051 {
0052 public:
0053     HTMLAppletElement();
0054     HTMLAppletElement(const HTMLAppletElement &other);
0055     HTMLAppletElement(const Node &other) : HTMLElement()
0056     {
0057         (*this) = other;
0058     }
0059 protected:
0060     HTMLAppletElement(HTMLAppletElementImpl *impl);
0061 public:
0062 
0063     HTMLAppletElement &operator = (const HTMLAppletElement &other);
0064     HTMLAppletElement &operator = (const Node &other);
0065 
0066     ~HTMLAppletElement();
0067 
0068     /**
0069      * Aligns this object (vertically or horizontally) with respect to
0070      * its surrounding text. See the <a
0071      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG">
0072      * align attribute definition </a> in HTML 4.0. This attribute is
0073      * deprecated in HTML 4.0.
0074      *
0075      */
0076     DOMString align() const;
0077 
0078     /**
0079      * see align
0080      */
0081     void setAlign(const DOMString &);
0082 
0083     /**
0084      * Alternate text for user agents not rendering the normal content
0085      * of this element. See the <a
0086      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt">
0087      * alt attribute definition </a> in HTML 4.0. This attribute is
0088      * deprecated in HTML 4.0.
0089      *
0090      */
0091     DOMString alt() const;
0092 
0093     /**
0094      * see alt
0095      */
0096     void setAlt(const DOMString &);
0097 
0098     /**
0099      * Comma-separated archive list. See the <a
0100      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-archive-APPLET">
0101      * archive attribute definition </a> in HTML 4.0. This attribute
0102      * is deprecated in HTML 4.0.
0103      *
0104      */
0105     DOMString archive() const;
0106 
0107     /**
0108      * see archive
0109      */
0110     void setArchive(const DOMString &);
0111 
0112     /**
0113      * Applet class file. See the <a
0114      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-code">
0115      * code attribute definition </a> in HTML 4.0. This attribute is
0116      * deprecated in HTML 4.0.
0117      *
0118      */
0119     DOMString code() const;
0120 
0121     /**
0122      * see code
0123      */
0124     void setCode(const DOMString &);
0125 
0126     /**
0127      * Optional base URI for applet. See the <a
0128      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-codebase-APPLET">
0129      * codebase attribute definition </a> in HTML 4.0. This attribute
0130      * is deprecated in HTML 4.0.
0131      *
0132      */
0133     DOMString codeBase() const;
0134 
0135     /**
0136      * see codeBase
0137      */
0138     void setCodeBase(const DOMString &value);
0139 
0140     /**
0141      * Override height. See the <a
0142      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-height-APPLET">
0143      * height attribute definition </a> in HTML 4.0. This attribute is
0144      * deprecated in HTML 4.0.
0145      *
0146      */
0147     DOMString height() const;
0148 
0149     /**
0150      * see height
0151      */
0152     void setHeight(const DOMString &);
0153 
0154     /**
0155      * Horizontal space, in pixels, to the left and right of this image, applet,
0156      * or object. See the <a
0157      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-hspace">
0158      * hspace attribute definition </a> in HTML 4.0. This attribute is
0159      * deprecated in HTML 4.0.
0160      *
0161      */
0162     long getHspace() const;
0163 
0164     /**
0165      * see hspace
0166      */
0167     void setHspace(long);
0168 
0169     /**
0170      * @deprecated
0171      */
0172 #ifndef KHTML_NO_DEPRECATED
0173     KHTML_DEPRECATED DOMString hspace() const;
0174 #endif
0175 
0176     /**
0177      * @deprecated
0178      */
0179 #ifndef KHTML_NO_DEPRECATED
0180     KHTML_DEPRECATED void setHspace(const DOMString &value);
0181 #endif
0182 
0183     /**
0184      * The name of the applet. See the <a
0185      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-name-APPLET">
0186      * name attribute definition </a> in HTML 4.0. This attribute is
0187      * deprecated in HTML 4.0.
0188      *
0189      */
0190     DOMString name() const;
0191 
0192     /**
0193      * see name
0194      */
0195     void setName(const DOMString &);
0196 
0197     /**
0198      * Serialized applet file. See the <a
0199      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-object">
0200      * object attribute definition </a> in HTML 4.0. This attribute is
0201      * deprecated in HTML 4.0.
0202      *
0203      */
0204     DOMString object() const;
0205 
0206     /**
0207      * see object
0208      */
0209     void setObject(const DOMString &);
0210 
0211     /**
0212      * Vertical space, in pixels, above and below this image, applet, or object.
0213      * See the <a
0214      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-vspace">
0215      * vspace attribute definition </a> in HTML 4.0. This attribute is
0216      * deprecated in HTML 4.0.
0217      *
0218      */
0219     long getVspace() const;
0220 
0221     /**
0222      * see vspace
0223      */
0224     void setVspace(long);
0225 
0226     /**
0227      * @deprecated
0228      */
0229 #ifndef KHTML_NO_DEPRECATED
0230     KHTML_DEPRECATED DOMString vspace() const;
0231 #endif
0232 
0233     /**
0234      * @deprecated
0235      */
0236 #ifndef KHTML_NO_DEPRECATED
0237     KHTML_DEPRECATED void setVspace(const DOMString &);
0238 #endif
0239 
0240     /**
0241      * Override width. See the <a
0242      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-width-APPLET">
0243      * width attribute definition </a> in HTML 4.0. This attribute is
0244      * deprecated in HTML 4.0.
0245      *
0246      */
0247     DOMString width() const;
0248 
0249     /**
0250      * see width
0251      */
0252     void setWidth(const DOMString &);
0253 };
0254 
0255 // --------------------------------------------------------------------------
0256 
0257 class HTMLObjectElementImpl;
0258 
0259 /**
0260  * Generic embedded object. Note. In principle, all properties on the
0261  * object element are read-write but in some environments some
0262  * properties may be read-only once the underlying object is
0263  * instantiated. See the <a
0264  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-OBJECT">
0265  * OBJECT element definition </a> in HTML 4.0.
0266  *
0267  */
0268 class KHTML_EXPORT HTMLObjectElement : public HTMLElement
0269 {
0270 public:
0271     HTMLObjectElement();
0272     HTMLObjectElement(const HTMLObjectElement &other);
0273     HTMLObjectElement(const Node &other) : HTMLElement()
0274     {
0275         (*this) = other;
0276     }
0277 protected:
0278     HTMLObjectElement(HTMLObjectElementImpl *impl);
0279 public:
0280 
0281     HTMLObjectElement &operator = (const HTMLObjectElement &other);
0282     HTMLObjectElement &operator = (const Node &other);
0283 
0284     ~HTMLObjectElement();
0285 
0286     /**
0287      * Returns the \c FORM element containing this
0288      * control. Returns null if this control is not within the context
0289      * of a form.
0290      *
0291      */
0292     HTMLFormElement form() const;
0293 
0294     /**
0295      * Applet class file. See the \c code attribute for
0296      * HTMLAppletElement.
0297      *
0298      */
0299     DOMString code() const;
0300 
0301     /**
0302      * see code
0303      */
0304     void setCode(const DOMString &);
0305 
0306     /**
0307      * Aligns this object (vertically or horizontally) with respect to
0308      * its surrounding text. See the <a
0309      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG">
0310      * align attribute definition </a> in HTML 4.0. This attribute is
0311      * deprecated in HTML 4.0.
0312      *
0313      */
0314     DOMString align() const;
0315 
0316     /**
0317      * see align
0318      */
0319     void setAlign(const DOMString &);
0320 
0321     /**
0322      * Space-separated list of archives. See the <a
0323      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-archive-OBJECT">
0324      * archive attribute definition </a> in HTML 4.0.
0325      *
0326      */
0327     DOMString archive() const;
0328 
0329     /**
0330      * see archive
0331      */
0332     void setArchive(const DOMString &);
0333 
0334     /**
0335      * Width of border around the object. See the <a
0336      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-border">
0337      * border attribute definition </a> in HTML 4.0. This attribute is
0338      * deprecated in HTML 4.0.
0339      *
0340      */
0341     DOMString border() const;
0342 
0343     /**
0344      * see border
0345      */
0346     void setBorder(const DOMString &);
0347 
0348     /**
0349      * Base URI for \c classid , \c data , and
0350      * \c archive attributes. See the <a
0351      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-codebase-OBJECT">
0352      * codebase attribute definition </a> in HTML 4.0.
0353      *
0354      */
0355     DOMString codeBase() const;
0356 
0357     /**
0358      * see codeBase
0359      */
0360     void setCodeBase(const DOMString &);
0361 
0362     /**
0363      * Content type for data downloaded via \c classid
0364      * attribute. See the <a
0365      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-codetype">
0366      * codetype attribute definition </a> in HTML 4.0.
0367      *
0368      */
0369     DOMString codeType() const;
0370 
0371     /**
0372      * see codeType
0373      */
0374     void setCodeType(const DOMString &);
0375 
0376     /**
0377      * A URI specifying the location of the object's data. See the <a
0378      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-data">
0379      * data attribute definition </a> in HTML 4.0.
0380      *
0381      */
0382     DOMString data() const;
0383 
0384     /**
0385      * see data
0386      */
0387     void setData(const DOMString &);
0388 
0389     /**
0390      * Declare (for future reference), but do not instantiate, this
0391      * object. See the <a
0392      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-declare">
0393      * declare attribute definition </a> in HTML 4.0.
0394      *
0395      */
0396     bool declare() const;
0397 
0398     /**
0399      * see declare
0400      */
0401     void setDeclare(bool);
0402 
0403     /**
0404      * Override height. See the <a
0405      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-height-IMG">
0406      * height attribute definition </a> in HTML 4.0.
0407      *
0408      */
0409     DOMString height() const;
0410 
0411     /**
0412      * see height
0413      */
0414     void setHeight(const DOMString &);
0415 
0416     /**
0417      * Horizontal space, in pixels, to the left and right of this image, applet,
0418      * or object. See the <a
0419      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-hspace">
0420      * hspace attribute definition </a> in HTML 4.0. This attribute is
0421      * deprecated in HTML 4.0.
0422      *
0423      */
0424     long getHspace() const;
0425 
0426     /**
0427      * see hspace
0428      */
0429     void setHspace(long);
0430 
0431     /**
0432      * @deprecated
0433      */
0434 #ifndef KHTML_NO_DEPRECATED
0435     KHTML_DEPRECATED DOMString hspace() const;
0436 #endif
0437 
0438     /**
0439      * @deprecated
0440      */
0441 #ifndef KHTML_NO_DEPRECATED
0442     KHTML_DEPRECATED void setHspace(const DOMString &);
0443 #endif
0444 
0445     /**
0446      * Form control or object name when submitted with a form. See the
0447      * <a
0448      * href="https://www.w3.org/TR/REC-html40/interact/forms.html#adef-name-INPUT">
0449      * name attribute definition </a> in HTML 4.0.
0450      *
0451      */
0452     DOMString name() const;
0453 
0454     /**
0455      * see name
0456      */
0457     void setName(const DOMString &);
0458 
0459     /**
0460      * Message to render while loading the object. See the <a
0461      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-standby">
0462      * standby attribute definition </a> in HTML 4.0.
0463      *
0464      */
0465     DOMString standby() const;
0466 
0467     /**
0468      * see standby
0469      */
0470     void setStandby(const DOMString &);
0471 
0472     /**
0473      * Index that represents the element's position in the tabbing
0474      * order. See the <a
0475      * href="https://www.w3.org/TR/REC-html40/interact/forms.html#adef-tabindex">
0476      * tabindex attribute definition </a> in HTML 4.0.
0477      *
0478      */
0479     long tabIndex() const;
0480 
0481     /**
0482      * see tabIndex
0483      */
0484     void setTabIndex(long);
0485 
0486     /**
0487      * Content type for data downloaded via \c data
0488      * attribute. See the <a
0489      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-type-OBJECT">
0490      * type attribute definition </a> in HTML 4.0.
0491      *
0492      */
0493     DOMString type() const;
0494 
0495     /**
0496      * see type
0497      */
0498     void setType(const DOMString &);
0499 
0500     /**
0501      * Use client-side image map. See the <a
0502      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-usemap">
0503      * usemap attribute definition </a> in HTML 4.0.
0504      *
0505      */
0506     DOMString useMap() const;
0507 
0508     /**
0509      * see useMap
0510      */
0511     void setUseMap(const DOMString &);
0512 
0513     /**
0514      * Vertical space, in pixels, above and below this image, applet, or object.
0515      * See the <a
0516      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-vspace">
0517      * vspace attribute definition </a> in HTML 4.0. This attribute is
0518      * deprecated in HTML 4.0.
0519      *
0520      */
0521     long getVspace() const;
0522 
0523     /**
0524      * see vspace
0525      */
0526     void setVspace(long);
0527 
0528     /**
0529      * @deprecated
0530      */
0531 #ifndef KHTML_NO_DEPRECATED
0532     KHTML_DEPRECATED DOMString vspace() const;
0533 #endif
0534 
0535     /**
0536      * @deprecated
0537      */
0538 #ifndef KHTML_NO_DEPRECATED
0539     KHTML_DEPRECATED void setVspace(const DOMString &);
0540 #endif
0541 
0542     /**
0543      * Override width. See the <a
0544      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-width-IMG">
0545      * width attribute definition </a> in HTML 4.0.
0546      *
0547      */
0548     DOMString width() const;
0549 
0550     /**
0551      * see width
0552      */
0553     void setWidth(const DOMString &);
0554 
0555     /**
0556      * Introduced in DOM Level 2
0557      *
0558      * Returns the document this iframe contains, if there is any and
0559      * it is available, a Null document otherwise. The attribute is
0560      * read-only.
0561      *
0562      * @return The content Document if available.
0563      */
0564     Document contentDocument() const;
0565 };
0566 
0567 // --------------------------------------------------------------------------
0568 
0569 class HTMLParamElementImpl;
0570 
0571 /**
0572  * Parameters fed to the \c OBJECT element. See the <a
0573  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-PARAM">
0574  * PARAM element definition </a> in HTML 4.0.
0575  *
0576  */
0577 class KHTML_EXPORT HTMLParamElement : public HTMLElement
0578 {
0579 public:
0580     HTMLParamElement();
0581     HTMLParamElement(const HTMLParamElement &other);
0582     HTMLParamElement(const Node &other) : HTMLElement()
0583     {
0584         (*this) = other;
0585     }
0586 protected:
0587     HTMLParamElement(HTMLParamElementImpl *impl);
0588 public:
0589 
0590     HTMLParamElement &operator = (const HTMLParamElement &other);
0591     HTMLParamElement &operator = (const Node &other);
0592 
0593     ~HTMLParamElement();
0594 
0595     /**
0596      * The name of a run-time parameter. See the <a
0597      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-name-PARAM">
0598      * name attribute definition </a> in HTML 4.0.
0599      *
0600      */
0601     DOMString name() const;
0602 
0603     /**
0604      * see name
0605      */
0606     void setName(const DOMString &);
0607 
0608     /**
0609      * Content type for the \c value attribute when
0610      * \c valuetype has the value "ref". See the <a
0611      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-type-PARAM">
0612      * type attribute definition </a> in HTML 4.0.
0613      *
0614      */
0615     DOMString type() const;
0616 
0617     /**
0618      * see type
0619      */
0620     void setType(const DOMString &);
0621 
0622     /**
0623      * The value of a run-time parameter. See the <a
0624      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-value-PARAM">
0625      * value attribute definition </a> in HTML 4.0.
0626      *
0627      */
0628     DOMString value() const;
0629 
0630     /**
0631      * see value
0632      */
0633     void setValue(const DOMString &);
0634 
0635     /**
0636      * Information about the meaning of the \c value
0637      * attribute value. See the <a
0638      * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-valuetype">
0639      * valuetype attribute definition </a> in HTML 4.0.
0640      *
0641      */
0642     DOMString valueType() const;
0643 
0644     /**
0645      * see valueType
0646      */
0647     void setValueType(const DOMString &);
0648 };
0649 
0650 } // namespace
0651 
0652 #endif