File indexing completed on 2024-04-28 11:37:47
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_IMAGE_H 0030 #define HTML_IMAGE_H 0031 0032 #include <dom/html_element.h> 0033 0034 namespace DOM 0035 { 0036 0037 class HTMLAreaElementImpl; 0038 class DOMString; 0039 0040 /** 0041 * Client-side image map area definition. See the <a 0042 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-AREA"> 0043 * AREA element definition </a> in HTML 4.0. 0044 * 0045 */ 0046 class KHTML_EXPORT HTMLAreaElement : public HTMLElement 0047 { 0048 public: 0049 HTMLAreaElement(); 0050 HTMLAreaElement(const HTMLAreaElement &other); 0051 HTMLAreaElement(const Node &other) : HTMLElement() 0052 { 0053 (*this) = other; 0054 } 0055 protected: 0056 HTMLAreaElement(HTMLAreaElementImpl *impl); 0057 public: 0058 0059 HTMLAreaElement &operator = (const HTMLAreaElement &other); 0060 HTMLAreaElement &operator = (const Node &other); 0061 0062 ~HTMLAreaElement(); 0063 0064 /** 0065 * A single character access key to give access to the form 0066 * control. See the <a 0067 * href="https://www.w3.org/TR/REC-html40/interact/forms.html#adef-accesskey"> 0068 * accesskey attribute definition </a> in HTML 4.0. 0069 * 0070 */ 0071 DOMString accessKey() const; 0072 0073 /** 0074 * see accessKey 0075 */ 0076 void setAccessKey(const DOMString &); 0077 0078 /** 0079 * Alternate text for user agents not rendering the normal content 0080 * of this element. See the <a 0081 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt"> 0082 * alt attribute definition </a> in HTML 4.0. 0083 * 0084 */ 0085 DOMString alt() const; 0086 0087 /** 0088 * see alt 0089 */ 0090 void setAlt(const DOMString &); 0091 0092 /** 0093 * Comma-separated list of lengths, defining an active region 0094 * geometry. See also \c shape for the shape of the 0095 * region. See the <a 0096 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-coords"> 0097 * coords attribute definition </a> in HTML 4.0. 0098 * 0099 */ 0100 DOMString coords() const; 0101 0102 /** 0103 * see coords 0104 */ 0105 void setCoords(const DOMString &); 0106 0107 /** 0108 * The URI of the linked resource. See the <a 0109 * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-href"> 0110 * href attribute definition </a> in HTML 4.0. 0111 * 0112 */ 0113 DOMString href() const; 0114 0115 /** 0116 * see href 0117 */ 0118 void setHref(const DOMString &); 0119 0120 /** 0121 * Specifies that this area is inactive, i.e., has no associated 0122 * action. See the <a 0123 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-nohref"> 0124 * nohref attribute definition </a> in HTML 4.0. 0125 * 0126 */ 0127 bool noHref() const; 0128 0129 /** 0130 * see noHref 0131 */ 0132 void setNoHref(bool); 0133 0134 /** 0135 * The shape of the active area. The coordinates are given by 0136 * \c coords . See the <a 0137 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-shape"> 0138 * shape attribute definition </a> in HTML 4.0. 0139 * 0140 */ 0141 DOMString shape() const; 0142 0143 /** 0144 * see shape 0145 */ 0146 void setShape(const DOMString &); 0147 0148 /** 0149 * Index that represents the element's position in the tabbing 0150 * order. See the <a 0151 * href="https://www.w3.org/TR/REC-html40/interact/forms.html#adef-tabindex"> 0152 * tabindex attribute definition </a> in HTML 4.0. 0153 * 0154 */ 0155 long tabIndex() const; 0156 0157 /** 0158 * see tabIndex 0159 */ 0160 void setTabIndex(long); 0161 0162 /** 0163 * Frame to render the resource in. See the <a 0164 * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-target"> 0165 * target attribute definition </a> in HTML 4.0. 0166 * 0167 */ 0168 DOMString target() const; 0169 0170 /** 0171 * see target 0172 */ 0173 void setTarget(const DOMString &); 0174 }; 0175 0176 // -------------------------------------------------------------------------- 0177 0178 class HTMLImageElementImpl; 0179 0180 /** 0181 * Embedded image. See the <a 0182 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG"> 0183 * IMG element definition </a> in HTML 4.0. 0184 * 0185 */ 0186 class KHTML_EXPORT HTMLImageElement : public HTMLElement 0187 { 0188 public: 0189 HTMLImageElement(); 0190 HTMLImageElement(const HTMLImageElement &other); 0191 HTMLImageElement(const Node &other) : HTMLElement() 0192 { 0193 (*this) = other; 0194 } 0195 protected: 0196 HTMLImageElement(HTMLImageElementImpl *impl); 0197 public: 0198 0199 HTMLImageElement &operator = (const HTMLImageElement &other); 0200 HTMLImageElement &operator = (const Node &other); 0201 0202 ~HTMLImageElement(); 0203 0204 /** 0205 * The name of the element (for backwards compatibility). 0206 * 0207 */ 0208 DOMString name() const; 0209 0210 /** 0211 * see name 0212 */ 0213 void setName(const DOMString &); 0214 0215 /** 0216 * Aligns this object (vertically or horizontally) with respect to 0217 * its surrounding text. See the <a 0218 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG"> 0219 * align attribute definition </a> in HTML 4.0. This attribute is 0220 * deprecated in HTML 4.0. 0221 * 0222 */ 0223 DOMString align() const; 0224 0225 /** 0226 * see align 0227 */ 0228 void setAlign(const DOMString &); 0229 0230 /** 0231 * Alternate text for user agents not rendering the normal content 0232 * of this element. See the <a 0233 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt"> 0234 * alt attribute definition </a> in HTML 4.0. 0235 * 0236 */ 0237 DOMString alt() const; 0238 0239 /** 0240 * see alt 0241 */ 0242 void setAlt(const DOMString &); 0243 0244 /** 0245 * Width of border around image. See the <a 0246 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-border-IMG"> 0247 * border attribute definition </a> in HTML 4.0. This attribute is 0248 * deprecated in HTML 4.0. 0249 * 0250 */ 0251 DOMString getBorder() const; 0252 0253 /** 0254 * see border 0255 */ 0256 void setBorder(const DOMString &); 0257 0258 /** 0259 * @deprecated 0260 */ 0261 #ifndef KHTML_NO_DEPRECATED 0262 KHTML_DEPRECATED long border() const; 0263 #endif 0264 0265 /** 0266 * @deprecated 0267 */ 0268 #ifndef KHTML_NO_DEPRECATED 0269 KHTML_DEPRECATED void setBorder(long); 0270 #endif 0271 0272 /** 0273 * Override height. See the <a 0274 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-height-IMG"> 0275 * height attribute definition </a> in HTML 4.0. 0276 * 0277 */ 0278 long height() const; 0279 0280 /** 0281 * see height 0282 */ 0283 void setHeight(long); 0284 0285 /** 0286 * Horizontal space to the left and right of this image. See the 0287 * <a 0288 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-hspace"> 0289 * hspace attribute definition </a> in HTML 4.0. This attribute is 0290 * deprecated in HTML 4.0. 0291 * 0292 */ 0293 long hspace() const; 0294 0295 /** 0296 * see hspace 0297 */ 0298 void setHspace(long); 0299 0300 /** 0301 * Use server-side image map. See the <a 0302 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-ismap"> 0303 * ismap attribute definition </a> in HTML 4.0. 0304 * 0305 */ 0306 bool isMap() const; 0307 0308 /** 0309 * see isMap 0310 */ 0311 void setIsMap(bool); 0312 0313 /** 0314 * URI designating a long description of this image or frame. See 0315 * the <a 0316 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-longdesc-IMG"> 0317 * longdesc attribute definition </a> in HTML 4.0. 0318 * 0319 */ 0320 DOMString longDesc() const; 0321 0322 /** 0323 * see longDesc 0324 */ 0325 void setLongDesc(const DOMString &); 0326 0327 /** 0328 * URI designating the source of this image. See the <a 0329 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-src-IMG"> 0330 * src attribute definition </a> in HTML 4.0. 0331 * 0332 */ 0333 DOMString src() const; 0334 0335 /** 0336 * see src 0337 */ 0338 void setSrc(const DOMString &); 0339 0340 /** 0341 * Use client-side image map. See the <a 0342 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-usemap"> 0343 * usemap attribute definition </a> in HTML 4.0. 0344 * 0345 */ 0346 DOMString useMap() const; 0347 0348 /** 0349 * see useMap 0350 */ 0351 void setUseMap(const DOMString &); 0352 0353 /** 0354 * Vertical space above and below this image. See the <a 0355 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-vspace"> 0356 * vspace attribute definition </a> in HTML 4.0. This attribute is 0357 * deprecated in HTML 4.0. 0358 * 0359 */ 0360 long vspace() const; 0361 0362 /** 0363 * see vspace 0364 */ 0365 void setVspace(long); 0366 0367 /** 0368 * Override width. See the <a 0369 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-width-IMG"> 0370 * width attribute definition </a> in HTML 4.0. 0371 * 0372 */ 0373 long width() const; 0374 0375 /** 0376 * see width 0377 */ 0378 void setWidth(long); 0379 0380 /** 0381 * Nonstandard extension to DOM::ImgElement 0382 */ 0383 long x() const; 0384 long y() const; 0385 }; 0386 0387 // -------------------------------------------------------------------------- 0388 0389 class HTMLMapElementImpl; 0390 class HTMLCollection; 0391 class DOMString; 0392 0393 /** 0394 * Client-side image map. See the <a 0395 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-MAP"> 0396 * MAP element definition </a> in HTML 4.0. 0397 * 0398 */ 0399 class KHTML_EXPORT HTMLMapElement : public HTMLElement 0400 { 0401 public: 0402 HTMLMapElement(); 0403 HTMLMapElement(const HTMLMapElement &other); 0404 HTMLMapElement(const Node &other) : HTMLElement() 0405 { 0406 (*this) = other; 0407 } 0408 protected: 0409 HTMLMapElement(HTMLMapElementImpl *impl); 0410 public: 0411 0412 HTMLMapElement &operator = (const HTMLMapElement &other); 0413 HTMLMapElement &operator = (const Node &other); 0414 0415 ~HTMLMapElement(); 0416 0417 /** 0418 * The list of areas defined for the image map. 0419 * 0420 */ 0421 HTMLCollection areas() const; 0422 0423 /** 0424 * Names the map (for use with \c usemap ). See the <a 0425 * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-name-MAP"> 0426 * name attribute definition </a> in HTML 4.0. 0427 * 0428 */ 0429 DOMString name() const; 0430 0431 /** 0432 * see name 0433 */ 0434 void setName(const DOMString &); 0435 }; 0436 0437 } //namespace 0438 0439 #endif