KHtml

html_image.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * This file includes excerpts from the Document Object Model (DOM)
22  * Level 1 Specification (Recommendation)
23  * https://www.w3.org/TR/REC-DOM-Level-1/
24  * Copyright © World Wide Web Consortium , (Massachusetts Institute of
25  * Technology , Institut National de Recherche en Informatique et en
26  * Automatique , Keio University ). All Rights Reserved.
27  *
28  */
29 #ifndef HTML_IMAGE_H
30 #define HTML_IMAGE_H
31 
32 #include <dom/html_element.h>
33 
34 namespace DOM
35 {
36 
37 class HTMLAreaElementImpl;
38 class DOMString;
39 
40 /**
41  * Client-side image map area definition. See the <a
42  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-AREA">
43  * AREA element definition </a> in HTML 4.0.
44  *
45  */
46 class KHTML_EXPORT HTMLAreaElement : public HTMLElement
47 {
48 public:
50  HTMLAreaElement(const HTMLAreaElement &other);
51  HTMLAreaElement(const Node &other) : HTMLElement()
52  {
53  (*this) = other;
54  }
55 protected:
56  HTMLAreaElement(HTMLAreaElementImpl *impl);
57 public:
58 
59  HTMLAreaElement &operator = (const HTMLAreaElement &other);
60  HTMLAreaElement &operator = (const Node &other);
61 
62  ~HTMLAreaElement();
63 
64  /**
65  * A single character access key to give access to the form
66  * control. See the <a
67  * href="https://www.w3.org/TR/REC-html40/interact/forms.html#adef-accesskey">
68  * accesskey attribute definition </a> in HTML 4.0.
69  *
70  */
71  DOMString accessKey() const;
72 
73  /**
74  * see accessKey
75  */
76  void setAccessKey(const DOMString &);
77 
78  /**
79  * Alternate text for user agents not rendering the normal content
80  * of this element. See the <a
81  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt">
82  * alt attribute definition </a> in HTML 4.0.
83  *
84  */
85  DOMString alt() const;
86 
87  /**
88  * see alt
89  */
90  void setAlt(const DOMString &);
91 
92  /**
93  * Comma-separated list of lengths, defining an active region
94  * geometry. See also \c shape for the shape of the
95  * region. See the <a
96  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-coords">
97  * coords attribute definition </a> in HTML 4.0.
98  *
99  */
100  DOMString coords() const;
101 
102  /**
103  * see coords
104  */
105  void setCoords(const DOMString &);
106 
107  /**
108  * The URI of the linked resource. See the <a
109  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-href">
110  * href attribute definition </a> in HTML 4.0.
111  *
112  */
113  DOMString href() const;
114 
115  /**
116  * see href
117  */
118  void setHref(const DOMString &);
119 
120  /**
121  * Specifies that this area is inactive, i.e., has no associated
122  * action. See the <a
123  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-nohref">
124  * nohref attribute definition </a> in HTML 4.0.
125  *
126  */
127  bool noHref() const;
128 
129  /**
130  * see noHref
131  */
132  void setNoHref(bool);
133 
134  /**
135  * The shape of the active area. The coordinates are given by
136  * \c coords . See the <a
137  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-shape">
138  * shape attribute definition </a> in HTML 4.0.
139  *
140  */
141  DOMString shape() const;
142 
143  /**
144  * see shape
145  */
146  void setShape(const DOMString &);
147 
148  /**
149  * Index that represents the element's position in the tabbing
150  * order. See the <a
151  * href="https://www.w3.org/TR/REC-html40/interact/forms.html#adef-tabindex">
152  * tabindex attribute definition </a> in HTML 4.0.
153  *
154  */
155  long tabIndex() const;
156 
157  /**
158  * see tabIndex
159  */
160  void setTabIndex(long);
161 
162  /**
163  * Frame to render the resource in. See the <a
164  * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
165  * target attribute definition </a> in HTML 4.0.
166  *
167  */
168  DOMString target() const;
169 
170  /**
171  * see target
172  */
173  void setTarget(const DOMString &);
174 };
175 
176 // --------------------------------------------------------------------------
177 
178 class HTMLImageElementImpl;
179 
180 /**
181  * Embedded image. See the <a
182  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG">
183  * IMG element definition </a> in HTML 4.0.
184  *
185  */
186 class KHTML_EXPORT HTMLImageElement : public HTMLElement
187 {
188 public:
190  HTMLImageElement(const HTMLImageElement &other);
191  HTMLImageElement(const Node &other) : HTMLElement()
192  {
193  (*this) = other;
194  }
195 protected:
196  HTMLImageElement(HTMLImageElementImpl *impl);
197 public:
198 
199  HTMLImageElement &operator = (const HTMLImageElement &other);
200  HTMLImageElement &operator = (const Node &other);
201 
202  ~HTMLImageElement();
203 
204  /**
205  * The name of the element (for backwards compatibility).
206  *
207  */
208  DOMString name() const;
209 
210  /**
211  * see name
212  */
213  void setName(const DOMString &);
214 
215  /**
216  * Aligns this object (vertically or horizontally) with respect to
217  * its surrounding text. See the <a
218  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG">
219  * align attribute definition </a> in HTML 4.0. This attribute is
220  * deprecated in HTML 4.0.
221  *
222  */
223  DOMString align() const;
224 
225  /**
226  * see align
227  */
228  void setAlign(const DOMString &);
229 
230  /**
231  * Alternate text for user agents not rendering the normal content
232  * of this element. See the <a
233  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt">
234  * alt attribute definition </a> in HTML 4.0.
235  *
236  */
237  DOMString alt() const;
238 
239  /**
240  * see alt
241  */
242  void setAlt(const DOMString &);
243 
244  /**
245  * Width of border around image. See the <a
246  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-border-IMG">
247  * border attribute definition </a> in HTML 4.0. This attribute is
248  * deprecated in HTML 4.0.
249  *
250  */
251  DOMString getBorder() const;
252 
253  /**
254  * see border
255  */
256  void setBorder(const DOMString &);
257 
258  /**
259  * @deprecated
260  */
261 #ifndef KHTML_NO_DEPRECATED
262  KHTML_DEPRECATED long border() const;
263 #endif
264 
265  /**
266  * @deprecated
267  */
268 #ifndef KHTML_NO_DEPRECATED
269  KHTML_DEPRECATED void setBorder(long);
270 #endif
271 
272  /**
273  * Override height. See the <a
274  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-height-IMG">
275  * height attribute definition </a> in HTML 4.0.
276  *
277  */
278  long height() const;
279 
280  /**
281  * see height
282  */
283  void setHeight(long);
284 
285  /**
286  * Horizontal space to the left and right of this image. See the
287  * <a
288  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-hspace">
289  * hspace attribute definition </a> in HTML 4.0. This attribute is
290  * deprecated in HTML 4.0.
291  *
292  */
293  long hspace() const;
294 
295  /**
296  * see hspace
297  */
298  void setHspace(long);
299 
300  /**
301  * Use server-side image map. See the <a
302  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-ismap">
303  * ismap attribute definition </a> in HTML 4.0.
304  *
305  */
306  bool isMap() const;
307 
308  /**
309  * see isMap
310  */
311  void setIsMap(bool);
312 
313  /**
314  * URI designating a long description of this image or frame. See
315  * the <a
316  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-longdesc-IMG">
317  * longdesc attribute definition </a> in HTML 4.0.
318  *
319  */
320  DOMString longDesc() const;
321 
322  /**
323  * see longDesc
324  */
325  void setLongDesc(const DOMString &);
326 
327  /**
328  * URI designating the source of this image. See the <a
329  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-src-IMG">
330  * src attribute definition </a> in HTML 4.0.
331  *
332  */
333  DOMString src() const;
334 
335  /**
336  * see src
337  */
338  void setSrc(const DOMString &);
339 
340  /**
341  * Use client-side image map. See the <a
342  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-usemap">
343  * usemap attribute definition </a> in HTML 4.0.
344  *
345  */
346  DOMString useMap() const;
347 
348  /**
349  * see useMap
350  */
351  void setUseMap(const DOMString &);
352 
353  /**
354  * Vertical space above and below this image. See the <a
355  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-vspace">
356  * vspace attribute definition </a> in HTML 4.0. This attribute is
357  * deprecated in HTML 4.0.
358  *
359  */
360  long vspace() const;
361 
362  /**
363  * see vspace
364  */
365  void setVspace(long);
366 
367  /**
368  * Override width. See the <a
369  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-width-IMG">
370  * width attribute definition </a> in HTML 4.0.
371  *
372  */
373  long width() const;
374 
375  /**
376  * see width
377  */
378  void setWidth(long);
379 
380  /**
381  * Nonstandard extension to DOM::ImgElement
382  */
383  long x() const;
384  long y() const;
385 };
386 
387 // --------------------------------------------------------------------------
388 
389 class HTMLMapElementImpl;
390 class HTMLCollection;
391 class DOMString;
392 
393 /**
394  * Client-side image map. See the <a
395  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#edef-MAP">
396  * MAP element definition </a> in HTML 4.0.
397  *
398  */
399 class KHTML_EXPORT HTMLMapElement : public HTMLElement
400 {
401 public:
402  HTMLMapElement();
403  HTMLMapElement(const HTMLMapElement &other);
404  HTMLMapElement(const Node &other) : HTMLElement()
405  {
406  (*this) = other;
407  }
408 protected:
409  HTMLMapElement(HTMLMapElementImpl *impl);
410 public:
411 
412  HTMLMapElement &operator = (const HTMLMapElement &other);
413  HTMLMapElement &operator = (const Node &other);
414 
415  ~HTMLMapElement();
416 
417  /**
418  * The list of areas defined for the image map.
419  *
420  */
421  HTMLCollection areas() const;
422 
423  /**
424  * Names the map (for use with \c usemap ). See the <a
425  * href="https://www.w3.org/TR/REC-html40/struct/objects.html#adef-name-MAP">
426  * name attribute definition </a> in HTML 4.0.
427  *
428  */
429  DOMString name() const;
430 
431  /**
432  * see name
433  */
434  void setName(const DOMString &);
435 };
436 
437 } //namespace
438 
439 #endif
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
Client-side image map area definition.
Definition: html_image.h:46
An HTMLCollection is a list of nodes.
Definition: html_misc.h:133
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
Embedded image.
Definition: html_image.h:186
This library provides a full-featured HTML parser and widget.
Client-side image map.
Definition: html_image.h:399
All HTML element interfaces derive from this class.
Definition: html_element.h:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Oct 15 2021 22:48:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.