dom_doc.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.
*/
#ifndef _DOM_Document_h_
#define _DOM_Document_h_
#include <dom/dom_node.h>
#include <dom/css_stylesheet.h>
class KHTMLView;
class KHTMLPart;
namespace DOM {
class DOMString;
class DocumentType;
class NodeList;
class CDATASection;
class Comment;
class DocumentFragment;
class Text;
class DOMImplementation;
class Element;
class Attr;
class EntityReference;
class ProcessingInstruction;
class DocumentImpl;
class Range;
class NodeIterator;
class TreeWalker;
class NodeFilter;
class DOMImplementationImpl;
class DocumentTypeImpl;
class Event;
class AbstractView;
class CSSStyleDeclaration;
class HTMLElementImpl;
class HTMLFrameElement;
class HTMLElementImpl;
class HTMLIFrameElement;
class HTMLObjectElement;
class HTMLDocument;
class KHTML_EXPORT DOMImplementation
{
friend class Document;
public:
DOMImplementation();
DOMImplementation(const DOMImplementation &other);
DOMImplementation & operator = (const DOMImplementation &other);
~DOMImplementation();
bool hasFeature ( const DOMString &feature, const DOMString &version );
DocumentType createDocumentType ( const DOMString &qualifiedName,
const DOMString &publicId,
const DOMString &systemId );
Document createDocument ( const DOMString &namespaceURI,
const DOMString &qualifiedName,
const DocumentType &doctype );
DOMImplementation getInterface(const DOMString &feature) const;
CSSStyleSheet createCSSStyleSheet(const DOMString &title, const DOMString &media);
HTMLDocument createHTMLDocument(const DOMString& title);
DOMImplementationImpl *handle() const;
bool isNull() const;
protected:
DOMImplementation(DOMImplementationImpl *i);
DOMImplementationImpl *impl;
};
class KHTML_EXPORT Document : public Node
{
friend class ::KHTMLView;
friend class ::KHTMLPart;
friend class AbstractView;
friend class DOMImplementation;
friend class HTMLFrameElement;
friend class HTMLIFrameElement;
friend class HTMLObjectElement;
public:
Document();
Document(bool);
Document(const Document &other);
Document(const Node &other) : Node()
{(*this)=other;}
Document & operator = (const Node &other);
Document & operator = (const Document &other);
~Document();
DocumentType doctype() const;
DOMImplementation implementation() const;
Element documentElement() const;
Element createElement ( const DOMString &tagName );
Element createElementNS( const DOMString &namespaceURI,
const DOMString &qualifiedName );
DocumentFragment createDocumentFragment ( );
Text createTextNode ( const DOMString &data );
Comment createComment ( const DOMString &data );
CDATASection createCDATASection ( const DOMString &data );
ProcessingInstruction createProcessingInstruction ( const DOMString &target,
const DOMString &data );
Attr createAttribute ( const DOMString &name );
Attr createAttributeNS( const DOMString &namespaceURI,
const DOMString &qualifiedName );
EntityReference createEntityReference ( const DOMString &name );
Element getElementById ( const DOMString &elementId ) const;
NodeList getElementsByTagName ( const DOMString &tagname );
NodeList getElementsByTagNameNS( const DOMString &namespaceURI,
const DOMString &localName );
Node importNode( const Node & importedNode, bool deep );
bool isHTMLDocument() const;
Range createRange();
NodeIterator createNodeIterator(Node root, unsigned long whatToShow,
NodeFilter filter,
bool entityReferenceExpansion);
TreeWalker createTreeWalker(Node root, unsigned long whatToShow,
NodeFilter filter,
bool entityReferenceExpansion);
Event createEvent(const DOMString &eventType);
AbstractView defaultView() const;
StyleSheetList styleSheets() const;
DOMString preferredStylesheetSet();
DOMString selectedStylesheetSet();
void setSelectedStylesheetSet(const DOMString& aString);
void addStyleSheet(const StyleSheet &sheet);
void removeStyleSheet(const StyleSheet &sheet);
KHTMLView *view() const;
CSSStyleDeclaration getOverrideStyle(const Element &elt,
const DOMString &pseudoElt);
bool async() const;
void setAsync( bool );
void abort();
void load( const DOMString &uri );
void loadXML( const DOMString &source );
bool designMode() const;
void setDesignMode(bool enable);
DOMString completeURL(const DOMString& url);
DOMString toString() const;
void updateRendering();
Document( DocumentImpl *i);
protected:
friend class Node;
};
class DocumentFragmentImpl;
class KHTML_EXPORT DocumentFragment : public Node
{
friend class Document;
friend class HTMLElementImpl;
friend class Range;
public:
DocumentFragment();
DocumentFragment(const DocumentFragment &other);
DocumentFragment(const Node &other) : Node()
{(*this)=other;}
DocumentFragment & operator = (const Node &other);
DocumentFragment & operator = (const DocumentFragment &other);
~DocumentFragment();
protected:
DocumentFragment(DocumentFragmentImpl *i);
};
class NamedNodeMap;
class DOMString;
class KHTML_EXPORT DocumentType : public Node
{
friend class Document;
friend class DOMImplementation;
public:
DocumentType();
DocumentType(const DocumentType &other);
DocumentType(const Node &other) : Node()
{(*this)=other;}
DocumentType & operator = (const Node &other);
DocumentType & operator = (const DocumentType &other);
~DocumentType();
DOMString name() const;
NamedNodeMap entities() const;
NamedNodeMap notations() const;
DOMString publicId() const;
DOMString systemId() const;
DOMString internalSubset() const;
protected:
DocumentType(DocumentTypeImpl *impl);
};
} //namespace
#endif
DOM::ProcessingInstruction
The ProcessingInstruction interface represents a "processing instruction", used in XML as a way to ke...
Definition: dom_xml.h:259
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::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:60
DOM::AbstractView
Introduced in DOM Level 2.
Definition: dom2_views.h:41
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:184
DOM::DOMImplementation
The DOMImplementation interface provides a number of methods for performing operations that are indep...
Definition: dom_doc.h:77
DOM::DocumentFragment
DocumentFragment is a "lightweight" or "minimal" Document object.
Definition: dom_doc.h:991
KHTMLView
Renders and displays HTML in a QScrollView.
Definition: khtmlview.h:78
DOM::HTMLFrameElement
Create a frame.
Definition: html_base.h:163
DOM::EntityReference
EntityReference objects may be inserted into the structure model when an entity reference is in the s...
Definition: dom_xml.h:188
DOM::NamedNodeMap
Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can b...
Definition: dom_node.h:66
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i...
Definition: css_stylesheet.h:207
DOM::Comment
This represents the content of a comment, i.e., all the characters between the starting '
Definition: dom_text.h:223
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::Text
The Text interface represents the textual content (termed character data in XML) of an Element or At...
Definition: dom_text.h:269
DOM::TreeWalker
TreeWalker objects are used to navigate a document tree or subtree using the view of the document def...
Definition: dom2_traversal.h:339
DOM::Attr
The Attr interface represents an attribute in an Element object.
Definition: dom_element.h:89
DOM::StyleSheetList
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets...
Definition: css_stylesheet.h:309
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::CDATASection
CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...
Definition: dom_xml.h:66
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:245
DOM::NodeFilter
Filters are objects that know how to "filter out" nodes.
Definition: dom2_traversal.h:184
DOM::DocumentType
Each Document has a doctype attribute whose value is either null or a DocumentType object...
Definition: dom_doc.h:1028
DOM::HTMLObjectElement
Generic embedded object.
Definition: html_object.h:258
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::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::NodeIterator
NodeIterators are used to step through a set of nodes, e.g.
Definition: dom2_traversal.h:60
DOM::HTMLIFrameElement
Inline subwindows.
Definition: html_base.h:362

KDE Home | KDE Accessibility Home | Description of Access Keys