khtml Library API Documentation

dom_element.h

00001 /*
00002  * This file is part of the DOM implementation for KDE.
00003  *
00004  * (C) 1999 Lars Knoll (knoll@kde.org)
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  * Boston, MA 02111-1307, USA.
00020  *
00021  * This file includes excerpts from the Document Object Model (DOM)
00022  * Level 1 Specification (Recommendation)
00023  * http://www.w3.org/TR/REC-DOM-Level-1/
00024  * Copyright © World Wide Web Consortium , (Massachusetts Institute of
00025  * Technology , Institut National de Recherche en Informatique et en
00026  * Automatique , Keio University ). All Rights Reserved.
00027  *
00028  */
00029 #ifndef _DOM_ELEMENT_h_
00030 #define _DOM_ELEMENT_h_
00031 
00032 #include <dom/dom_node.h>
00033 #include <dom/css_value.h>
00034 
00035 namespace DOM {
00036 
00037 class DOMString;
00038 class AttrImpl;
00039 class Element;
00040 class ElementImpl;
00041 class NamedAttrMapImpl;
00042 class DocumentImpl;
00043 
00087 class Attr : public Node
00088 {
00089     friend class Element;
00090     friend class Document;
00091     friend class DocumentImpl;
00092     friend class HTMLDocument;
00093     friend class ElementImpl;
00094     friend class NamedAttrMapImpl;
00095     friend class AttrImpl;
00096 
00097 public:
00098     Attr();
00099     Attr(const Node &other) : Node()
00100         {(*this)=other;}
00101     Attr(const Attr &other);
00102 
00103     Attr & operator = (const Node &other);
00104     Attr & operator = (const Attr &other);
00105 
00106     ~Attr();
00107 
00112     DOMString name() const;
00113 
00145     bool specified() const;
00146 
00156     DOMString value() const;
00157 
00161     void setValue( const DOMString & );
00162 
00169     Element ownerElement() const;
00170 
00171 protected:
00172 
00173     Attr( AttrImpl *_impl );
00174 };
00175 
00176 class NodeList;
00177 class Attr;
00178 class DOMString;
00179 
00208 class Element : public Node
00209 {
00210     friend class Document;
00211     friend class HTMLDocument;
00212 //    friend class AttrImpl;
00213     friend class Attr;
00214 
00215 public:
00216     Element();
00217     Element(const Node &other) : Node()
00218         {(*this)=other;}
00219     Element(const Element &other);
00220 
00221     Element & operator = (const Node &other);
00222     Element & operator = (const Element &other);
00223 
00224     ~Element();
00225 
00236     DOMString tagName() const;
00237 
00248     DOMString getAttribute ( const DOMString &name );
00249 
00277     void setAttribute ( const DOMString &name, const DOMString &value );
00278 
00291     void removeAttribute ( const DOMString &name );
00292 
00303     Attr getAttributeNode ( const DOMString &name );
00304 
00330     Attr setAttributeNode ( const Attr &newAttr );
00331 
00348     Attr removeAttributeNode ( const Attr &oldAttr );
00349 
00362     NodeList getElementsByTagName ( const DOMString &name );
00363 
00378     NodeList getElementsByTagNameNS ( const DOMString &namespaceURI,
00379                                       const DOMString &localName );
00380 
00396     DOMString getAttributeNS ( const DOMString &namespaceURI,
00397                                const DOMString &localName );
00398 
00437     void setAttributeNS ( const DOMString &namespaceURI,
00438                           const DOMString &qualifiedName,
00439                           const DOMString &value );
00440 
00458     void removeAttributeNS ( const DOMString &namespaceURI,
00459                              const DOMString &localName );
00460 
00474     Attr getAttributeNodeNS ( const DOMString &namespaceURI,
00475                               const DOMString &localName );
00476 
00502     Attr setAttributeNodeNS ( const Attr &newAttr );
00503 
00514     bool hasAttribute( const DOMString& name );
00515 
00530     bool hasAttributeNS ( const DOMString &namespaceURI,
00531                           const DOMString &localName );
00532 
00539     CSSStyleDeclaration style (  );
00540     
00553     bool contentEditable() const;
00554 
00571     void setContentEditable(bool enabled);
00572 
00577     bool isHTMLElement() const;
00578 
00585     Element form() const;
00586 
00587     static bool khtmlValidAttrName(const DOMString &name);
00588     static bool khtmlValidPrefix(const DOMString &name);
00589     static bool khtmlValidQualifiedName(const DOMString &name);
00590 
00591     static bool khtmlMalformedQualifiedName(const DOMString &name);
00592     static bool khtmlMalformedPrefix(const DOMString &name);
00593 protected:
00594     Element(ElementImpl *_impl);
00595 };
00596 
00597 } //namespace
00598 #endif
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Aug 4 05:28:52 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003