dom_node.h
/*
* This file is part of the DOM implementation for KDE.
*
* (C) 1999 Lars Knoll (knoll@kde.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* This file includes excerpts from the Document Object Model (DOM)
* Level 1 Specification (Recommendation)
* http://www.w3.org/TR/REC-DOM-Level-1/
* Copyright World Wide Web Consortium , (Massachusetts Institute of
* Technology , Institut National de Recherche en Informatique et en
* Automatique , Keio University ). All Rights Reserved.
*
* This file includes excerpts from the Document Object Model (DOM)
* Level 3 Core Specification (Recommendation)
* http://www.w3.org/TR/DOM-Level-3-Core/
* Copyright ©2004 W3C® (MIT, ERCIM, Keio), All Rights Reserved.
*/
#ifndef _DOM_Node_h_
#define _DOM_Node_h_
#include <qstring.h>
#include <kdelibs_export.h>
class QRect;
namespace KJS {
class HTMLDocument;
class Window;
}
namespace DOM {
class Node;
class DOMString;
class NodeImpl;
class NamedNodeMapImpl;
class EventListener;
class Event;
class KHTML_EXPORT NamedNodeMap
{
public:
NamedNodeMap();
NamedNodeMap(const NamedNodeMap &other);
NamedNodeMap & operator = (const NamedNodeMap &other);
~NamedNodeMap();
unsigned long length() const;
Node getNamedItem ( const DOMString &name ) const;
Node setNamedItem ( const Node &arg );
Node removeNamedItem ( const DOMString &name );
Node item ( unsigned long index ) const;
Node getNamedItemNS( const DOMString &namespaceURI,
const DOMString &localName ) const;
Node setNamedItemNS( const Node &arg );
Node removeNamedItemNS( const DOMString &namespaceURI,
const DOMString &localName );
NamedNodeMapImpl *handle() const { return impl; }
bool isNull() const { return !impl; }
protected:
NamedNodeMap( NamedNodeMapImpl *i);
NamedNodeMapImpl *impl;
friend class Node;
friend class DocumentType;
friend class NodeImpl;
};
class NamedNodeMap;
class NodeList;
class Document;
class DOMString;
class StyleSheet;
class NodeImpl;
class KHTML_EXPORT Node
{
friend class NamedNodeMap;
friend class NodeList;
friend class HTMLCollection;
friend class StyleSheet;
public:
Node() : impl(0) {}
Node(const Node &other);
Node( NodeImpl *_impl);
Node & operator = (const Node &other);
bool operator == (const Node &other) const;
bool operator != (const Node &other) const;
virtual ~Node();
enum NodeType {
ELEMENT_NODE = 1,
ATTRIBUTE_NODE = 2,
TEXT_NODE = 3,
CDATA_SECTION_NODE = 4,
ENTITY_REFERENCE_NODE = 5,
ENTITY_NODE = 6,
PROCESSING_INSTRUCTION_NODE = 7,
COMMENT_NODE = 8,
DOCUMENT_NODE = 9,
DOCUMENT_TYPE_NODE = 10,
DOCUMENT_FRAGMENT_NODE = 11,
NOTATION_NODE = 12
};
DOMString nodeName() const;
DOMString nodeValue() const;
void setNodeValue( const DOMString & );
unsigned short nodeType() const;
Node parentNode() const;
NodeList childNodes() const;
Node firstChild() const;
Node lastChild() const;
Node previousSibling() const;
Node nextSibling() const;
NamedNodeMap attributes() const;
Document ownerDocument() const;
Node insertBefore ( const Node &newChild, const Node &refChild );
Node replaceChild ( const Node &newChild, const Node &oldChild );
Node removeChild ( const Node &oldChild );
Node appendChild ( const Node &newChild );
bool hasChildNodes ( );
Node cloneNode ( bool deep );
void normalize ( );
bool isSupported( const DOMString &feature,
const DOMString &version ) const;
DOMString namespaceURI( ) const;
DOMString prefix( ) const;
void setPrefix(const DOMString &prefix );
DOMString localName( ) const;
bool hasAttributes ( );
DOMString textContent( ) const;
void setTextContent(const DOMString &content) const;
void addEventListener(const DOMString &type,
EventListener *listener,
const bool useCapture);
void removeEventListener(const DOMString &type,
EventListener *listener,
bool useCapture);
bool dispatchEvent(const Event &evt);
Q_UINT32 elementId() const;
bool isNull() const { return !impl; }
NodeImpl *handle() const { return impl; }
unsigned long index() const;
QString toHTML() KDE_DEPRECATED;
void applyChanges();
void getCursor(int offset, int &_x, int &_y, int &height) KDE_DEPRECATED;
QRect getRect();
protected:
NodeImpl *impl;
};
class NodeListImpl;
class KHTML_EXPORT NodeList
{
friend class Element;
friend class Node;
friend class Document;
friend class HTMLDocument;
friend class KJS::HTMLDocument;
friend class KJS::Window;
public:
NodeList();
NodeList(const NodeList &other);
NodeList & operator = (const NodeList &other);
~NodeList();
unsigned long length() const;
Node item ( unsigned long index ) const;
NodeListImpl *handle() const { return impl; }
bool isNull() const { return !impl; }
protected:
NodeList(const NodeListImpl *i);
NodeListImpl *impl;
};
typedef unsigned long long DOMTimeStamp;
} //namespace
#endif
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:274
DOM::HTMLDocument
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
Definition: html_document.h:73
DOM::Node::NodeType
NodeType
An integer indicating which type of node this is.
Definition: dom_node.h:385
DOM::NamedNodeMap
Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can b...
Definition: dom_node.h:66
DOM::HTMLCollection
An HTMLCollection is a list of nodes.
Definition: html_misc.h:126
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::Node::isNull
bool isNull() const
tests if this Node is 0.
Definition: dom_node.h:892
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::DocumentType
Each Document has a doctype attribute whose value is either null or a DocumentType object...
Definition: dom_doc.h:1028
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:931
DOM::EventListener
Introduced in DOM Level 2.
Definition: dom2_events.h:64
DOM::Event
Introduced in DOM Level 2.
Definition: dom2_events.h:111
DOM::StyleSheet
The StyleSheet interface is the abstract base interface for any type of style sheet.
Definition: css_stylesheet.h:58
DOM::DOMTimeStamp
unsigned long long DOMTimeStamp
A DOMTimeStamp represents a number of milliseconds.
Definition: dom_node.h:987

KDE Home | KDE Accessibility Home | Description of Access Keys