• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • khtml
  • dom
dom_element.h
Go to the documentation of this file.
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll (knoll@kde.org)
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  * 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.
27  *
28  */
29 #ifndef _DOM_ELEMENT_h_
30 #define _DOM_ELEMENT_h_
31 
32 #include <khtml_export.h>
33 #include <dom/dom_node.h>
34 #include <dom/css_value.h>
35 
36 namespace DOM {
37 
38 class DOMString;
39 class AttrImpl;
40 class Element;
41 class ElementImpl;
42 class NamedAttrMapImpl;
43 class DocumentImpl;
44 
88 class KHTML_EXPORT Attr : public Node
89 {
90  friend class Element;
91  friend class Document;
92  friend class DocumentImpl;
93  friend class HTMLDocument;
94  friend class ElementImpl;
95  friend class NamedAttrMapImpl;
96  friend class AttrImpl;
97 
98 public:
99  Attr();
100  Attr(const Node &other) : Node()
101  {(*this)=other;}
102  Attr(const Attr &other);
103 
104  Attr & operator = (const Node &other);
105  Attr & operator = (const Attr &other);
106 
107  ~Attr();
108 
113  DOMString name() const;
114 
146  bool specified() const;
147 
157  DOMString value() const;
158 
162  void setValue( const DOMString & );
163 
170  Element ownerElement() const;
171 
172 protected:
173 
174  Attr( AttrImpl *_impl );
175 };
176 
177 class NodeList;
178 class Attr;
179 class DOMString;
180 
209 class KHTML_EXPORT Element : public Node
210 {
211  friend class Document;
212  friend class DocumentFragment;
213  friend class HTMLDocument;
214 // friend class AttrImpl;
215  friend class Attr;
216 
217 public:
218  Element();
219  Element(const Node &other) : Node()
220  {(*this)=other;}
221  Element(const Element &other);
222 
223  Element & operator = (const Node &other);
224  Element & operator = (const Element &other);
225 
226  ~Element();
227 
238  DOMString tagName() const;
239 
250  DOMString getAttribute ( const DOMString &name );
251 
279  void setAttribute ( const DOMString &name, const DOMString &value );
280 
293  void removeAttribute ( const DOMString &name );
294 
305  Attr getAttributeNode ( const DOMString &name );
306 
332  Attr setAttributeNode ( const Attr &newAttr );
333 
350  Attr removeAttributeNode ( const Attr &oldAttr );
351 
364  NodeList getElementsByTagName ( const DOMString &name );
365 
380  NodeList getElementsByTagNameNS ( const DOMString &namespaceURI,
381  const DOMString &localName );
382 
400  NodeList getElementsByClassName ( const DOMString &className );
401 
417  DOMString getAttributeNS ( const DOMString &namespaceURI,
418  const DOMString &localName );
419 
458  void setAttributeNS ( const DOMString &namespaceURI,
459  const DOMString &qualifiedName,
460  const DOMString &value );
461 
479  void removeAttributeNS ( const DOMString &namespaceURI,
480  const DOMString &localName );
481 
495  Attr getAttributeNodeNS ( const DOMString &namespaceURI,
496  const DOMString &localName );
497 
523  Attr setAttributeNodeNS ( const Attr &newAttr );
524 
535  bool hasAttribute( const DOMString& name );
536 
551  bool hasAttributeNS ( const DOMString &namespaceURI,
552  const DOMString &localName );
553 
560  CSSStyleDeclaration style ( );
561 
569  Element firstElementChild ( ) const;
570 
578  Element lastElementChild ( ) const;
579 
588  Element previousElementSibling ( ) const;
589 
598  Element nextElementSibling ( ) const;
599 
607  unsigned long childElementCount ( ) const;
608 
617  Element querySelector(const DOMString& query) const;
618 
629  NodeList querySelectorAll(const DOMString& query) const;
630 
642  bool contentEditable() const;
643 
659  void setContentEditable(bool enabled);
660 
665  bool isHTMLElement() const;
666 
673  Element form() const;
674 
675  static bool khtmlValidAttrName(const DOMString &name);
676  static bool khtmlValidPrefix(const DOMString &name);
677  static bool khtmlValidQualifiedName(const DOMString &name);
678 
679  static bool khtmlMalformedQualifiedName(const DOMString &name);
680  static bool khtmlMalformedPrefix(const DOMString &name);
681 protected:
682  Element(ElementImpl *_impl);
683 };
684 
685 } //namespace
686 #endif
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:270
DOM::HTMLDocument
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
Definition: html_document.h:73
css_value.h
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:60
name
const char * name(StandardAction id)
DOM::DocumentFragment
DocumentFragment is a "lightweight" or "minimal" Document object.
Definition: dom_doc.h:1041
DOM::Element
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition: dom_element.h:209
dom_node.h
DOM::Attr
The Attr interface represents an attribute in an Element object.
Definition: dom_element.h:88
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:245
DOM::NodeList
The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented.
Definition: dom_node.h:963
khtml_export.h
DOM::Attr::Attr
Attr(const Node &other)
Definition: dom_element.h:100
DOM::Element::Element
Element(const Node &other)
Definition: dom_element.h:219
DOM::enabled
static bool enabled(KHTMLPart *)
Definition: jsediting.cpp:383
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal