KHTML
dom_element.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _DOM_ELEMENT_h_
00030 #define _DOM_ELEMENT_h_
00031
00032 #include <khtml_export.h>
00033 #include <dom/dom_node.h>
00034 #include <dom/css_value.h>
00035
00036 namespace DOM {
00037
00038 class DOMString;
00039 class AttrImpl;
00040 class Element;
00041 class ElementImpl;
00042 class NamedAttrMapImpl;
00043 class DocumentImpl;
00044
00088 class KHTML_EXPORT Attr : public Node
00089 {
00090 friend class Element;
00091 friend class Document;
00092 friend class DocumentImpl;
00093 friend class HTMLDocument;
00094 friend class ElementImpl;
00095 friend class NamedAttrMapImpl;
00096 friend class AttrImpl;
00097
00098 public:
00099 Attr();
00100 Attr(const Node &other) : Node()
00101 {(*this)=other;}
00102 Attr(const Attr &other);
00103
00104 Attr & operator = (const Node &other);
00105 Attr & operator = (const Attr &other);
00106
00107 ~Attr();
00108
00113 DOMString name() const;
00114
00146 bool specified() const;
00147
00157 DOMString value() const;
00158
00162 void setValue( const DOMString & );
00163
00170 Element ownerElement() const;
00171
00172 protected:
00173
00174 Attr( AttrImpl *_impl );
00175 };
00176
00177 class NodeList;
00178 class Attr;
00179 class DOMString;
00180
00209 class KHTML_EXPORT Element : public Node
00210 {
00211 friend class Document;
00212 friend class HTMLDocument;
00213
00214 friend class Attr;
00215
00216 public:
00217 Element();
00218 Element(const Node &other) : Node()
00219 {(*this)=other;}
00220 Element(const Element &other);
00221
00222 Element & operator = (const Node &other);
00223 Element & operator = (const Element &other);
00224
00225 ~Element();
00226
00237 DOMString tagName() const;
00238
00249 DOMString getAttribute ( const DOMString &name );
00250
00278 void setAttribute ( const DOMString &name, const DOMString &value );
00279
00292 void removeAttribute ( const DOMString &name );
00293
00304 Attr getAttributeNode ( const DOMString &name );
00305
00331 Attr setAttributeNode ( const Attr &newAttr );
00332
00349 Attr removeAttributeNode ( const Attr &oldAttr );
00350
00363 NodeList getElementsByTagName ( const DOMString &name );
00364
00379 NodeList getElementsByTagNameNS ( const DOMString &namespaceURI,
00380 const DOMString &localName );
00381
00399 NodeList getElementsByClassName ( const DOMString &className );
00400
00416 DOMString getAttributeNS ( const DOMString &namespaceURI,
00417 const DOMString &localName );
00418
00457 void setAttributeNS ( const DOMString &namespaceURI,
00458 const DOMString &qualifiedName,
00459 const DOMString &value );
00460
00478 void removeAttributeNS ( const DOMString &namespaceURI,
00479 const DOMString &localName );
00480
00494 Attr getAttributeNodeNS ( const DOMString &namespaceURI,
00495 const DOMString &localName );
00496
00522 Attr setAttributeNodeNS ( const Attr &newAttr );
00523
00534 bool hasAttribute( const DOMString& name );
00535
00550 bool hasAttributeNS ( const DOMString &namespaceURI,
00551 const DOMString &localName );
00552
00559 CSSStyleDeclaration style ( );
00560
00568 Element firstElementChild ( ) const;
00569
00577 Element lastElementChild ( ) const;
00578
00587 Element previousElementSibling ( ) const;
00588
00597 Element nextElementSibling ( ) const;
00598
00606 unsigned long childElementCount ( ) const;
00607
00619 bool contentEditable() const;
00620
00636 void setContentEditable(bool enabled);
00637
00642 bool isHTMLElement() const;
00643
00650 Element form() const;
00651
00652 static bool khtmlValidAttrName(const DOMString &name);
00653 static bool khtmlValidPrefix(const DOMString &name);
00654 static bool khtmlValidQualifiedName(const DOMString &name);
00655
00656 static bool khtmlMalformedQualifiedName(const DOMString &name);
00657 static bool khtmlMalformedPrefix(const DOMString &name);
00658 protected:
00659 Element(ElementImpl *_impl);
00660 };
00661
00662 }
00663 #endif