KHtml

html_head.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_HEAD_H
30 #define HTML_HEAD_H
31 
32 #include <dom/html_element.h>
33 #include <dom/css_stylesheet.h>
34 
35 namespace DOM
36 {
37 
38 class HTMLBaseElementImpl;
39 class DOMString;
40 
41 /**
42  * Document base URI. See the <a
43  * href="https://www.w3.org/TR/REC-html40/struct/links.html#edef-BASE">
44  * BASE element definition </a> in HTML 4.0.
45  *
46  */
47 class KHTML_EXPORT HTMLBaseElement : public HTMLElement
48 {
49 public:
51  HTMLBaseElement(const HTMLBaseElement &other);
52  HTMLBaseElement(const Node &other) : HTMLElement()
53  {
54  (*this) = other;
55  }
56 protected:
57  HTMLBaseElement(HTMLBaseElementImpl *impl);
58 public:
59 
60  HTMLBaseElement &operator = (const HTMLBaseElement &other);
61  HTMLBaseElement &operator = (const Node &other);
62 
63  ~HTMLBaseElement();
64 
65  /**
66  * The base URI See the <a
67  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-href-BASE">
68  * href attribute definition </a> in HTML 4.0.
69  *
70  */
71  DOMString href() const;
72 
73  /**
74  * see href
75  */
76  void setHref(const DOMString &);
77 
78  /**
79  * The default target frame. See the <a
80  * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
81  * target attribute definition </a> in HTML 4.0.
82  *
83  */
84  DOMString target() const;
85 
86  /**
87  * see target
88  */
89  void setTarget(const DOMString &);
90 };
91 
92 // --------------------------------------------------------------------------
93 
94 class HTMLLinkElementImpl;
95 
96 /**
97  * The \c LINK element specifies a link to an external
98  * resource, and defines this document's relationship to that resource
99  * (or vice versa). See the <a
100  * href="https://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK">
101  * LINK element definition </a> in HTML 4.0.
102  *
103  */
104 class KHTML_EXPORT HTMLLinkElement : public HTMLElement
105 {
106 public:
107  HTMLLinkElement();
108  HTMLLinkElement(const HTMLLinkElement &other);
109  HTMLLinkElement(const Node &other) : HTMLElement()
110  {
111  (*this) = other;
112  }
113 protected:
114  HTMLLinkElement(HTMLLinkElementImpl *impl);
115 public:
116 
117  HTMLLinkElement &operator = (const HTMLLinkElement &other);
118  HTMLLinkElement &operator = (const Node &other);
119 
120  ~HTMLLinkElement();
121 
122  /**
123  * Enables/disables the link. This is currently only used for
124  * style sheet links, and may be used to activate or deactivate
125  * style sheets.
126  *
127  */
128  bool disabled() const;
129 
130  /**
131  * see disabled
132  */
133  void setDisabled(bool);
134 
135  /**
136  * The character encoding of the resource being linked to. See the
137  * <a
138  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-charset">
139  * charset attribute definition </a> in HTML 4.0.
140  *
141  */
142  DOMString charset() const;
143 
144  /**
145  * see charset
146  */
147  void setCharset(const DOMString &);
148 
149  /**
150  * The URI of the linked resource. See the <a
151  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-href">
152  * href attribute definition </a> in HTML 4.0.
153  *
154  */
155  DOMString href() const;
156 
157  /**
158  * see href
159  */
160  void setHref(const DOMString &);
161 
162  /**
163  * Language code of the linked resource. See the <a
164  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-hreflang">
165  * hreflang attribute definition </a> in HTML 4.0.
166  *
167  */
168  DOMString hreflang() const;
169 
170  /**
171  * see hreflang
172  */
173  void setHreflang(const DOMString &);
174 
175  /**
176  * Designed for use with one or more target media. See the <a
177  * href="https://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
178  * media attribute definition </a> in HTML 4.0.
179  *
180  */
181  DOMString media() const;
182 
183  /**
184  * see media
185  */
186  void setMedia(const DOMString &);
187 
188  /**
189  * Forward link type. See the <a
190  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-rel">
191  * rel attribute definition </a> in HTML 4.0.
192  *
193  */
194  DOMString rel() const;
195 
196  /**
197  * see rel
198  */
199  void setRel(const DOMString &);
200 
201  /**
202  * Reverse link type. See the <a
203  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-rev">
204  * rev attribute definition </a> in HTML 4.0.
205  *
206  */
207  DOMString rev() const;
208 
209  /**
210  * see rev
211  */
212  void setRev(const DOMString &);
213 
214  /**
215  * Frame to render the resource in. See the <a
216  * href="https://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
217  * target attribute definition </a> in HTML 4.0.
218  *
219  */
220  DOMString target() const;
221 
222  /**
223  * see target
224  */
225  void setTarget(const DOMString &);
226 
227  /**
228  * Advisory content type. See the <a
229  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-type-A">
230  * type attribute definition </a> in HTML 4.0.
231  *
232  */
233  DOMString type() const;
234 
235  /**
236  * see type
237  */
238  void setType(const DOMString &);
239 
240  /**
241  * Introduced in DOM Level 2
242  * This method is from the LinkStyle interface
243  *
244  * The style sheet.
245  */
246  StyleSheet sheet() const;
247 
248 };
249 
250 // --------------------------------------------------------------------------
251 
252 class HTMLMetaElementImpl;
253 
254 /**
255  * This contains generic meta-information about the document. See the
256  * <a
257  * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-META">
258  * META element definition </a> in HTML 4.0.
259  *
260  */
261 class KHTML_EXPORT HTMLMetaElement : public HTMLElement
262 {
263 public:
264  HTMLMetaElement();
265  HTMLMetaElement(const HTMLMetaElement &other);
266  HTMLMetaElement(const Node &other) : HTMLElement()
267  {
268  (*this) = other;
269  }
270 protected:
271  HTMLMetaElement(HTMLMetaElementImpl *impl);
272 public:
273 
274  HTMLMetaElement &operator = (const HTMLMetaElement &other);
275  HTMLMetaElement &operator = (const Node &other);
276 
277  ~HTMLMetaElement();
278 
279  /**
280  * Associated information. See the <a
281  * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-content">
282  * content attribute definition </a> in HTML 4.0.
283  *
284  */
285  DOMString content() const;
286 
287  /**
288  * see content
289  */
290  void setContent(const DOMString &);
291 
292  /**
293  * HTTP response header name. See the <a
294  * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-http-equiv">
295  * http-equiv attribute definition </a> in HTML 4.0.
296  *
297  */
298  DOMString httpEquiv() const;
299 
300  /**
301  * see httpEquiv
302  */
303  void setHttpEquiv(const DOMString &);
304 
305  /**
306  * Meta information name. See the <a
307  * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-name-META">
308  * name attribute definition </a> in HTML 4.0.
309  *
310  */
311  DOMString name() const;
312 
313  /**
314  * see name
315  */
316  void setName(const DOMString &);
317 
318  /**
319  * Select form of content. See the <a
320  * href="https://www.w3.org/TR/REC-html40/struct/global.html#adef-scheme">
321  * scheme attribute definition </a> in HTML 4.0.
322  *
323  */
324  DOMString scheme() const;
325 
326  /**
327  * see scheme
328  */
329  void setScheme(const DOMString &);
330 };
331 
332 // --------------------------------------------------------------------------
333 
334 class HTMLScriptElementImpl;
335 
336 /**
337  * Script statements. See the <a
338  * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#edef-SCRIPT">
339  * SCRIPT element definition </a> in HTML 4.0.
340  *
341  */
342 class KHTML_EXPORT HTMLScriptElement : public HTMLElement
343 {
344 public:
346  HTMLScriptElement(const HTMLScriptElement &other);
347  HTMLScriptElement(const Node &other) : HTMLElement()
348  {
349  (*this) = other;
350  }
351 protected:
352  HTMLScriptElement(HTMLScriptElementImpl *impl);
353 public:
354 
355  HTMLScriptElement &operator = (const HTMLScriptElement &other);
356  HTMLScriptElement &operator = (const Node &other);
357 
359 
360  /**
361  * The script content of the element.
362  *
363  */
364  DOMString text() const;
365 
366  /**
367  * see text
368  */
369  void setText(const DOMString &);
370 
371  /**
372  * Reserved for future use.
373  *
374  */
375  DOMString htmlFor() const;
376 
377  /**
378  * see htmlFor
379  */
380  void setHtmlFor(const DOMString &);
381 
382  /**
383  * Reserved for future use.
384  *
385  */
386  DOMString event() const;
387 
388  /**
389  * see event
390  */
391  void setEvent(const DOMString &);
392 
393  /**
394  * The character encoding of the linked resource. See the <a
395  * href="https://www.w3.org/TR/REC-html40/struct/links.html#adef-charset">
396  * charset attribute definition </a> in HTML 4.0.
397  *
398  */
399  DOMString charset() const;
400 
401  /**
402  * see charset
403  */
404  void setCharset(const DOMString &);
405 
406  /**
407  * Indicates that the user agent can defer processing of the
408  * script. See the <a
409  * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#adef-defer">
410  * defer attribute definition </a> in HTML 4.0.
411  *
412  */
413  bool defer() const;
414 
415  /**
416  * see defer
417  */
418  void setDefer(bool);
419 
420  /**
421  * URI designating an external script. See the <a
422  * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#adef-src-SCRIPT">
423  * src attribute definition </a> in HTML 4.0.
424  *
425  */
426  DOMString src() const;
427 
428  /**
429  * see src
430  */
431  void setSrc(const DOMString &);
432 
433  /**
434  * The content type of the script language. See the <a
435  * href="https://www.w3.org/TR/REC-html40/interact/scripts.html#adef-type-SCRIPT">
436  * type attribute definition </a> in HTML 4.0.
437  *
438  */
439  DOMString type() const;
440 
441  /**
442  * see type
443  */
444  void setType(const DOMString &);
445 };
446 
447 // --------------------------------------------------------------------------
448 
449 class HTMLStyleElementImpl;
450 
451 /**
452  * Style information. A more detailed style sheet object model is
453  * planned to be defined in a separate document. See the <a
454  * href="https://www.w3.org/TR/REC-html40/present/styles.html#edef-STYLE">
455  * STYLE element definition </a> in HTML 4.0.
456  *
457  */
458 class KHTML_EXPORT HTMLStyleElement : public HTMLElement
459 {
460 public:
462  HTMLStyleElement(const HTMLStyleElement &other);
463  HTMLStyleElement(const Node &other) : HTMLElement()
464  {
465  (*this) = other;
466  }
467 protected:
468  HTMLStyleElement(HTMLStyleElementImpl *impl);
469 public:
470 
471  HTMLStyleElement &operator = (const HTMLStyleElement &other);
472  HTMLStyleElement &operator = (const Node &other);
473 
474  ~HTMLStyleElement();
475 
476  /**
477  * Enables/disables the style sheet.
478  *
479  */
480  bool disabled() const;
481 
482  /**
483  * see disabled
484  */
485  void setDisabled(bool);
486 
487  /**
488  * Designed for use with one or more target media. See the <a
489  * href="https://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
490  * media attribute definition </a> in HTML 4.0.
491  *
492  */
493  DOMString media() const;
494 
495  /**
496  * see media
497  */
498  void setMedia(const DOMString &);
499 
500  /**
501  * The style sheet language (Internet media type). See the <a
502  * href="https://www.w3.org/TR/REC-html40/present/styles.html#adef-type-STYLE">
503  * type attribute definition </a> in HTML 4.0.
504  *
505  */
506  DOMString type() const;
507 
508  /**
509  * see type
510  */
511  void setType(const DOMString &);
512 
513  /**
514  * Introduced in DOM Level 2
515  * This method is from the LinkStyle interface
516  *
517  * The style sheet.
518  */
519  StyleSheet sheet() const;
520 
521 };
522 
523 // --------------------------------------------------------------------------
524 
525 class HTMLTitleElementImpl;
526 
527 /**
528  * The document title. See the <a
529  * href="https://www.w3.org/TR/REC-html40/struct/global.html#edef-TITLE">
530  * TITLE element definition </a> in HTML 4.0.
531  *
532  */
533 class KHTML_EXPORT HTMLTitleElement : public HTMLElement
534 {
535 public:
537  HTMLTitleElement(const HTMLTitleElement &other);
538  HTMLTitleElement(const Node &other) : HTMLElement()
539  {
540  (*this) = other;
541  }
542 protected:
543  HTMLTitleElement(HTMLTitleElementImpl *impl);
544 public:
545 
546  HTMLTitleElement &operator = (const HTMLTitleElement &other);
547  HTMLTitleElement &operator = (const Node &other);
548 
549  ~HTMLTitleElement();
550 
551  /**
552  * The specified title as a string.
553  *
554  */
555  DOMString text() const;
556 
557  /**
558  * see text
559  */
560  void setText(const DOMString &);
561 };
562 
563 } //namespace
564 
565 #endif
All HTML element interfaces derive from this class.
Definition: html_element.h:70
Script statements.
Definition: html_head.h:342
This library provides a full-featured HTML parser and widget.
The StyleSheet interface is the abstract base interface for any type of style sheet.
The document title.
Definition: html_head.h:533
Style information.
Definition: html_head.h:458
This contains generic meta-information about the document.
Definition: html_head.h:261
The LINK element specifies a link to an external resource, and defines this document's relationship t...
Definition: html_head.h:104
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
void setTarget(const SkyPoint &targetCoord)
Document base URI.
Definition: html_head.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:55:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.