fix logic
[personal-kdelibs.git] / khtml / dom / html_base.h
blobe5c4d761c8666da4e60ae7e302d8a2e6e7e8d51a
1 /*
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.
30 #ifndef HTML_BASE_H
31 #define HTML_BASE_H
33 #include <khtml_export.h>
34 #include <dom/html_element.h>
36 namespace DOM {
38 class HTMLBodyElementImpl;
39 class DOMString;
41 /**
42 * The HTML document body. This element is always present in the DOM
43 * API, even if the tags are not present in the source document. See
44 * the <a
45 * href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-BODY">
46 * BODY element definition </a> in HTML 4.0.
49 class KHTML_EXPORT HTMLBodyElement : public HTMLElement
51 public:
52 HTMLBodyElement();
53 HTMLBodyElement(const HTMLBodyElement &other);
54 HTMLBodyElement(const Node &other) : HTMLElement()
55 {(*this)=other;}
56 protected:
57 HTMLBodyElement(HTMLBodyElementImpl *impl);
58 public:
60 HTMLBodyElement & operator = (const HTMLBodyElement &other);
61 HTMLBodyElement & operator = (const Node &other);
63 ~HTMLBodyElement();
65 /**
66 * Color of active links (after mouse-button down, but before
67 * mouse-button up). See the <a
68 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-alink">
69 * alink attribute definition </a> in HTML 4.0. This attribute is
70 * deprecated in HTML 4.0.
73 DOMString aLink() const;
75 /**
76 * see aLink
78 void setALink( const DOMString & );
80 /**
81 * URI of the background texture tile image. See the <a
82 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-background">
83 * background attribute definition </a> in HTML 4.0. This
84 * attribute is deprecated in HTML 4.0.
87 DOMString background() const;
89 /**
90 * see background
92 void setBackground( const DOMString & );
94 /**
95 * Document background color. See the <a
96 * href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
97 * bgcolor attribute definition </a> in HTML 4.0. This attribute
98 * is deprecated in HTML 4.0.
101 DOMString bgColor() const;
104 * see bgColor
106 void setBgColor( const DOMString & );
109 * Color of links that are not active and unvisited. See the <a
110 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-link">
111 * link attribute definition </a> in HTML 4.0. This attribute is
112 * deprecated in HTML 4.0.
115 DOMString link() const;
118 * see link
120 void setLink( const DOMString & );
123 * Document text color. See the <a
124 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-text">
125 * text attribute definition </a> in HTML 4.0. This attribute is
126 * deprecated in HTML 4.0.
129 DOMString text() const;
132 * see text
134 void setText( const DOMString & );
137 * Color of links that have been visited by the user. See the <a
138 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-vlink">
139 * vlink attribute definition </a> in HTML 4.0. This attribute is
140 * deprecated in HTML 4.0.
143 DOMString vLink() const;
146 * see vLink
148 void setVLink( const DOMString & );
151 // --------------------------------------------------------------------------
153 class HTMLFrameElementImpl;
154 class DOMString;
157 * Create a frame. See the <a
158 * href="http://www.w3.org/TR/REC-html40/present/frames.html#edef-FRAME">
159 * FRAME element definition </a> in HTML 4.0.
162 class KHTML_EXPORT HTMLFrameElement : public HTMLElement
164 public:
165 HTMLFrameElement();
166 HTMLFrameElement(const HTMLFrameElement &other);
167 HTMLFrameElement(const Node &other) : HTMLElement()
168 {(*this)=other;}
169 protected:
170 HTMLFrameElement(HTMLFrameElementImpl *impl);
171 public:
173 HTMLFrameElement & operator = (const HTMLFrameElement &other);
174 HTMLFrameElement & operator = (const Node &other);
176 ~HTMLFrameElement();
179 * Request frame borders. See the <a
180 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-frameborder">
181 * frameborder attribute definition </a> in HTML 4.0.
184 DOMString frameBorder() const;
187 * see frameBorder
189 void setFrameBorder( const DOMString & );
192 * URI designating a long description of this image or frame. See
193 * the <a
194 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-longdesc-FRAME">
195 * longdesc attribute definition </a> in HTML 4.0.
198 DOMString longDesc() const;
201 * see longDesc
203 void setLongDesc( const DOMString & );
206 * Frame margin height, in pixels. See the <a
207 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-marginheight">
208 * marginheight attribute definition </a> in HTML 4.0.
211 DOMString marginHeight() const;
214 * see marginHeight
216 void setMarginHeight( const DOMString & );
219 * Frame margin width, in pixels. See the <a
220 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-marginwidth">
221 * marginwidth attribute definition </a> in HTML 4.0.
224 DOMString marginWidth() const;
227 * see marginWidth
229 void setMarginWidth( const DOMString & );
232 * The frame name (object of the \c target attribute).
233 * See the <a
234 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-name-FRAME">
235 * name attribute definition </a> in HTML 4.0.
238 DOMString name() const;
241 * see name
243 void setName( const DOMString & );
246 * When true, forbid user from resizing frame. See the <a
247 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-noresize">
248 * noresize attribute definition </a> in HTML 4.0.
251 bool noResize() const;
254 * see noResize
256 void setNoResize( bool );
259 * Specify whether or not the frame should have scrollbars. See
260 * the <a
261 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-scrolling">
262 * scrolling attribute definition </a> in HTML 4.0.
265 DOMString scrolling() const;
268 * see scrolling
270 void setScrolling( const DOMString & );
273 * A URI designating the initial frame contents. See the <a
274 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-src-FRAME">
275 * src attribute definition </a> in HTML 4.0.
278 DOMString src() const;
281 * see src
283 void setSrc( const DOMString & );
286 * Introduced in DOM Level 2
288 * Returns the document this frame contains, if there is any and
289 * it is available, a Null document otherwise. The attribute is
290 * read-only.
292 * @return The content Document if available.
294 Document contentDocument() const;
297 // --------------------------------------------------------------------------
299 class HTMLFrameSetElementImpl;
300 class DOMString;
303 * Create a grid of frames. See the <a
304 * href="http://www.w3.org/TR/REC-html40/present/frames.html#edef-FRAMESET">
305 * FRAMESET element definition </a> in HTML 4.0.
308 class KHTML_EXPORT HTMLFrameSetElement : public HTMLElement
310 public:
311 HTMLFrameSetElement();
312 HTMLFrameSetElement(const HTMLFrameSetElement &other);
313 HTMLFrameSetElement(const Node &other) : HTMLElement()
314 {(*this)=other;}
315 protected:
316 HTMLFrameSetElement(HTMLFrameSetElementImpl *impl);
317 public:
319 HTMLFrameSetElement & operator = (const HTMLFrameSetElement &other);
320 HTMLFrameSetElement & operator = (const Node &other);
322 ~HTMLFrameSetElement();
325 * The number of columns of frames in the frameset. See the <a
326 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-cols-FRAMESET">
327 * cols attribute definition </a> in HTML 4.0.
330 DOMString cols() const;
333 * see cols
335 void setCols( const DOMString & );
338 * The number of rows of frames in the frameset. See the <a
339 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-rows-FRAMESET">
340 * rows attribute definition </a> in HTML 4.0.
343 DOMString rows() const;
346 * see rows
348 void setRows( const DOMString & );
351 // --------------------------------------------------------------------------
353 class HTMLIFrameElementImpl;
356 * Inline subwindows. See the <a
357 * href="http://www.w3.org/TR/REC-html40/present/frames.html#edef-IFRAME">
358 * IFRAME element definition </a> in HTML 4.0.
361 class KHTML_EXPORT HTMLIFrameElement : public HTMLElement
363 public:
364 HTMLIFrameElement();
365 HTMLIFrameElement(const HTMLIFrameElement &other);
366 HTMLIFrameElement(const Node &other) : HTMLElement()
367 {(*this)=other;}
368 protected:
369 HTMLIFrameElement(HTMLIFrameElementImpl *impl);
370 public:
372 HTMLIFrameElement & operator = (const HTMLIFrameElement &other);
373 HTMLIFrameElement & operator = (const Node &other);
375 ~HTMLIFrameElement();
378 * Aligns this object (vertically or horizontally) with respect to
379 * its surrounding text. See the <a
380 * href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG">
381 * align attribute definition </a> in HTML 4.0. This attribute is
382 * deprecated in HTML 4.0.
385 DOMString align() const;
388 * see align
390 void setAlign( const DOMString & );
393 * Request frame borders. See the <a
394 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-frameborder">
395 * frameborder attribute definition </a> in HTML 4.0.
398 DOMString frameBorder() const;
401 * see frameBorder
403 void setFrameBorder( const DOMString & );
406 * Frame height. See the <a
407 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-height-IFRAME">
408 * height attribute definition </a> in HTML 4.0.
411 DOMString height() const;
414 * see height
416 void setHeight( const DOMString & );
419 * URI designating a long description of this image or frame. See
420 * the <a
421 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-longdesc-IFRAME">
422 * longdesc attribute definition </a> in HTML 4.0.
425 DOMString longDesc() const;
428 * see longDesc
430 void setLongDesc( const DOMString & );
433 * Frame margin height, in pixels. See the <a
434 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-marginheight">
435 * marginheight attribute definition </a> in HTML 4.0.
438 DOMString marginHeight() const;
441 * see marginHeight
443 void setMarginHeight( const DOMString & );
446 * Frame margin width, in pixels. See the <a
447 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-marginwidth">
448 * marginwidth attribute definition </a> in HTML 4.0.
451 DOMString marginWidth() const;
454 * see marginWidth
456 void setMarginWidth( const DOMString & );
459 * The frame name (object of the \c target attribute).
460 * See the <a
461 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-name-IFRAME">
462 * name attribute definition </a> in HTML 4.0.
465 DOMString name() const;
468 * see name
470 void setName( const DOMString & );
473 * Specify whether or not the frame should have scrollbars. See
474 * the <a
475 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-scrolling">
476 * scrolling attribute definition </a> in HTML 4.0.
479 DOMString scrolling() const;
482 * see scrolling
484 void setScrolling( const DOMString & );
487 * A URI designating the initial frame contents. See the <a
488 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-src-FRAME">
489 * src attribute definition </a> in HTML 4.0.
492 DOMString src() const;
495 * see src
497 void setSrc( const DOMString & );
500 * Frame width. See the <a
501 * href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-width-IFRAME">
502 * width attribute definition </a> in HTML 4.0.
505 DOMString width() const;
508 * see width
510 void setWidth( const DOMString & );
513 * Introduced in DOM Level 2
515 * Returns the document this iframe contains, if there is any and
516 * it is available, a Null document otherwise. The attribute is
517 * read-only.
519 * @return The content Document if available.
521 Document contentDocument() const;
524 // --------------------------------------------------------------------------
526 class HTMLHeadElementImpl;
527 class DOMString;
530 * Document head information. See the <a
531 * href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-HEAD">
532 * HEAD element definition </a> in HTML 4.0.
535 class KHTML_EXPORT HTMLHeadElement : public HTMLElement
537 public:
538 HTMLHeadElement();
539 HTMLHeadElement(const HTMLHeadElement &other);
540 HTMLHeadElement(const Node &other) : HTMLElement()
541 {(*this)=other;}
542 protected:
543 HTMLHeadElement(HTMLHeadElementImpl *impl);
544 public:
546 HTMLHeadElement & operator = (const HTMLHeadElement &other);
547 HTMLHeadElement & operator = (const Node &other);
549 ~HTMLHeadElement();
552 * URI designating a metadata profile. See the <a
553 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-profile">
554 * profile attribute definition </a> in HTML 4.0.
557 DOMString profile() const;
560 * see profile
562 void setProfile( const DOMString & );
565 // --------------------------------------------------------------------------
567 class HTMLHtmlElementImpl;
568 class DOMString;
571 * Root of an HTML document. See the <a
572 * href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-HTML">
573 * HTML element definition </a> in HTML 4.0.
576 class KHTML_EXPORT HTMLHtmlElement : public HTMLElement
578 public:
579 HTMLHtmlElement();
580 HTMLHtmlElement(const HTMLHtmlElement &other);
581 HTMLHtmlElement(const Node &other) : HTMLElement()
582 {(*this)=other;}
583 protected:
584 HTMLHtmlElement(HTMLHtmlElementImpl *impl);
585 public:
587 HTMLHtmlElement & operator = (const HTMLHtmlElement &other);
588 HTMLHtmlElement & operator = (const Node &other);
590 ~HTMLHtmlElement();
593 * Version information about the document's DTD. See the <a
594 * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-version">
595 * version attribute definition </a> in HTML 4.0. This attribute
596 * is deprecated in HTML 4.0.
599 DOMString version() const;
602 * see version
604 void setVersion( const DOMString & );
607 } //namespace
609 #endif