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

KHTML

  • 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
36namespace DOM {
37
38class DOMString;
39class AttrImpl;
40class Element;
41class ElementImpl;
42class NamedAttrMapImpl;
43class DocumentImpl;
44
88class 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
98public:
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
172protected:
173
174 Attr( AttrImpl *_impl );
175};
176
177class NodeList;
178class Attr;
179class DOMString;
180
209class 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
217public:
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);
681protected:
682 Element(ElementImpl *_impl);
683};
684
685} //namespace
686#endif
DOM::Attr
The Attr interface represents an attribute in an Element object.
Definition: dom_element.h:89
DOM::Attr::Attr
Attr(const Node &other)
Definition: dom_element.h:100
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:61
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::DocumentFragment
DocumentFragment is a "lightweight" or "minimal" Document object.
Definition: dom_doc.h:1042
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
DOM::Element
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition: dom_element.h:210
DOM::Element::Element
Element(const Node &other)
Definition: dom_element.h:219
DOM::Element::contentEditable
bool contentEditable() const
not part of the official DOM
DOM::Element::setContentEditable
void setContentEditable(bool enabled)
not part of the official DOM
DOM::HTMLDocument
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
Definition: html_document.h:74
DOM::NodeList
The NodeList interface provides the abstraction of an ordered collection of nodes,...
Definition: dom_node.h:964
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:271
css_value.h
dom_node.h
khtml_export.h
DOM
This library provides a full-featured HTML parser and widget.
Definition: design.h:55
name
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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