2 * This file is part of the DOM implementation for KDE.
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
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.
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.
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.
21 * This file includes excerpts from the Document Object Model (DOM)
22 * Level 1 Specification (Recommendation)
23 * http://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.
32 #include <dom/html_element.h>
33 #include <dom/css_stylesheet.h>
37 class HTMLBaseElementImpl
;
41 * Document base URI. See the <a
42 * href="http://www.w3.org/TR/REC-html40/struct/links.html#edef-BASE">
43 * BASE element definition </a> in HTML 4.0.
46 class KHTML_EXPORT HTMLBaseElement
: public HTMLElement
50 HTMLBaseElement(const HTMLBaseElement
&other
);
51 HTMLBaseElement(const Node
&other
) : HTMLElement()
54 HTMLBaseElement(HTMLBaseElementImpl
*impl
);
57 HTMLBaseElement
& operator = (const HTMLBaseElement
&other
);
58 HTMLBaseElement
& operator = (const Node
&other
);
63 * The base URI See the <a
64 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-href-BASE">
65 * href attribute definition </a> in HTML 4.0.
68 DOMString
href() const;
73 void setHref( const DOMString
& );
76 * The default target frame. See the <a
77 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
78 * target attribute definition </a> in HTML 4.0.
81 DOMString
target() const;
86 void setTarget( const DOMString
& );
89 // --------------------------------------------------------------------------
91 class HTMLLinkElementImpl
;
94 * The \c LINK element specifies a link to an external
95 * resource, and defines this document's relationship to that resource
96 * (or vice versa). See the <a
97 * href="http://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK">
98 * LINK element definition </a> in HTML 4.0.
101 class KHTML_EXPORT HTMLLinkElement
: public HTMLElement
105 HTMLLinkElement(const HTMLLinkElement
&other
);
106 HTMLLinkElement(const Node
&other
) : HTMLElement()
109 HTMLLinkElement(HTMLLinkElementImpl
*impl
);
112 HTMLLinkElement
& operator = (const HTMLLinkElement
&other
);
113 HTMLLinkElement
& operator = (const Node
&other
);
118 * Enables/disables the link. This is currently only used for
119 * style sheet links, and may be used to activate or deactivate
123 bool disabled() const;
128 void setDisabled( bool );
131 * The character encoding of the resource being linked to. See the
133 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-charset">
134 * charset attribute definition </a> in HTML 4.0.
137 DOMString
charset() const;
142 void setCharset( const DOMString
& );
145 * The URI of the linked resource. See the <a
146 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-href">
147 * href attribute definition </a> in HTML 4.0.
150 DOMString
href() const;
155 void setHref( const DOMString
& );
158 * Language code of the linked resource. See the <a
159 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-hreflang">
160 * hreflang attribute definition </a> in HTML 4.0.
163 DOMString
hreflang() const;
168 void setHreflang( const DOMString
& );
171 * Designed for use with one or more target media. See the <a
172 * href="http://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
173 * media attribute definition </a> in HTML 4.0.
176 DOMString
media() const;
181 void setMedia( const DOMString
& );
184 * Forward link type. See the <a
185 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-rel">
186 * rel attribute definition </a> in HTML 4.0.
189 DOMString
rel() const;
194 void setRel( const DOMString
& );
197 * Reverse link type. See the <a
198 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-rev">
199 * rev attribute definition </a> in HTML 4.0.
202 DOMString
rev() const;
207 void setRev( const DOMString
& );
210 * Frame to render the resource in. See the <a
211 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">
212 * target attribute definition </a> in HTML 4.0.
215 DOMString
target() const;
220 void setTarget( const DOMString
& );
223 * Advisory content type. See the <a
224 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-type-A">
225 * type attribute definition </a> in HTML 4.0.
228 DOMString
type() const;
233 void setType( const DOMString
& );
236 * Introduced in DOM Level 2
237 * This method is from the LinkStyle interface
241 StyleSheet
sheet() const;
245 // --------------------------------------------------------------------------
247 class HTMLMetaElementImpl
;
250 * This contains generic meta-information about the document. See the
252 * href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-META">
253 * META element definition </a> in HTML 4.0.
256 class KHTML_EXPORT HTMLMetaElement
: public HTMLElement
260 HTMLMetaElement(const HTMLMetaElement
&other
);
261 HTMLMetaElement(const Node
&other
) : HTMLElement()
264 HTMLMetaElement(HTMLMetaElementImpl
*impl
);
267 HTMLMetaElement
& operator = (const HTMLMetaElement
&other
);
268 HTMLMetaElement
& operator = (const Node
&other
);
273 * Associated information. See the <a
274 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-content">
275 * content attribute definition </a> in HTML 4.0.
278 DOMString
content() const;
283 void setContent( const DOMString
& );
286 * HTTP response header name. See the <a
287 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-http-equiv">
288 * http-equiv attribute definition </a> in HTML 4.0.
291 DOMString
httpEquiv() const;
296 void setHttpEquiv( const DOMString
& );
299 * Meta information name. See the <a
300 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-name-META">
301 * name attribute definition </a> in HTML 4.0.
304 DOMString
name() const;
309 void setName( const DOMString
& );
312 * Select form of content. See the <a
313 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-scheme">
314 * scheme attribute definition </a> in HTML 4.0.
317 DOMString
scheme() const;
322 void setScheme( const DOMString
& );
325 // --------------------------------------------------------------------------
327 class HTMLScriptElementImpl
;
330 * Script statements. See the <a
331 * href="http://www.w3.org/TR/REC-html40/interact/scripts.html#edef-SCRIPT">
332 * SCRIPT element definition </a> in HTML 4.0.
335 class KHTML_EXPORT HTMLScriptElement
: public HTMLElement
339 HTMLScriptElement(const HTMLScriptElement
&other
);
340 HTMLScriptElement(const Node
&other
) : HTMLElement()
343 HTMLScriptElement(HTMLScriptElementImpl
*impl
);
346 HTMLScriptElement
& operator = (const HTMLScriptElement
&other
);
347 HTMLScriptElement
& operator = (const Node
&other
);
349 ~HTMLScriptElement();
352 * The script content of the element.
355 DOMString
text() const;
360 void setText( const DOMString
& );
363 * Reserved for future use.
366 DOMString
htmlFor() const;
371 void setHtmlFor( const DOMString
& );
374 * Reserved for future use.
377 DOMString
event() const;
382 void setEvent( const DOMString
& );
385 * The character encoding of the linked resource. See the <a
386 * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-charset">
387 * charset attribute definition </a> in HTML 4.0.
390 DOMString
charset() const;
395 void setCharset( const DOMString
& );
398 * Indicates that the user agent can defer processing of the
400 * href="http://www.w3.org/TR/REC-html40/interact/scripts.html#adef-defer">
401 * defer attribute definition </a> in HTML 4.0.
409 void setDefer( bool );
412 * URI designating an external script. See the <a
413 * href="http://www.w3.org/TR/REC-html40/interact/scripts.html#adef-src-SCRIPT">
414 * src attribute definition </a> in HTML 4.0.
417 DOMString
src() const;
422 void setSrc( const DOMString
& );
425 * The content type of the script language. See the <a
426 * href="http://www.w3.org/TR/REC-html40/interact/scripts.html#adef-type-SCRIPT">
427 * type attribute definition </a> in HTML 4.0.
430 DOMString
type() const;
435 void setType( const DOMString
& );
438 // --------------------------------------------------------------------------
440 class HTMLStyleElementImpl
;
443 * Style information. A more detailed style sheet object model is
444 * planned to be defined in a separate document. See the <a
445 * href="http://www.w3.org/TR/REC-html40/present/styles.html#edef-STYLE">
446 * STYLE element definition </a> in HTML 4.0.
449 class KHTML_EXPORT HTMLStyleElement
: public HTMLElement
453 HTMLStyleElement(const HTMLStyleElement
&other
);
454 HTMLStyleElement(const Node
&other
) : HTMLElement()
457 HTMLStyleElement(HTMLStyleElementImpl
*impl
);
460 HTMLStyleElement
& operator = (const HTMLStyleElement
&other
);
461 HTMLStyleElement
& operator = (const Node
&other
);
466 * Enables/disables the style sheet.
469 bool disabled() const;
474 void setDisabled( bool );
477 * Designed for use with one or more target media. See the <a
478 * href="http://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
479 * media attribute definition </a> in HTML 4.0.
482 DOMString
media() const;
487 void setMedia( const DOMString
& );
490 * The style sheet language (Internet media type). See the <a
491 * href="http://www.w3.org/TR/REC-html40/present/styles.html#adef-type-STYLE">
492 * type attribute definition </a> in HTML 4.0.
495 DOMString
type() const;
500 void setType( const DOMString
& );
503 * Introduced in DOM Level 2
504 * This method is from the LinkStyle interface
508 StyleSheet
sheet() const;
512 // --------------------------------------------------------------------------
514 class HTMLTitleElementImpl
;
517 * The document title. See the <a
518 * href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-TITLE">
519 * TITLE element definition </a> in HTML 4.0.
522 class KHTML_EXPORT HTMLTitleElement
: public HTMLElement
526 HTMLTitleElement(const HTMLTitleElement
&other
);
527 HTMLTitleElement(const Node
&other
) : HTMLElement()
530 HTMLTitleElement(HTMLTitleElementImpl
*impl
);
533 HTMLTitleElement
& operator = (const HTMLTitleElement
&other
);
534 HTMLTitleElement
& operator = (const Node
&other
);
539 * The specified title as a string.
542 DOMString
text() const;
547 void setText( const DOMString
& );