• 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_doc.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_Document_h_
30 #define _DOM_Document_h_
31 
32 #include <dom/dom_node.h>
33 #include <dom/css_stylesheet.h>
34 
35 class KHTMLView;
36 class KHTMLPart;
37 
38 namespace DOM {
39 
40 class DOMString;
41 class DocumentType;
42 class NodeList;
43 class CDATASection;
44 class Comment;
45 class DocumentFragment;
46 class Text;
47 class DOMImplementation;
48 class Element;
49 class Attr;
50 class EntityReference;
51 class ProcessingInstruction;
52 class DocumentImpl;
53 class Range;
54 class NodeIterator;
55 class TreeWalker;
56 class NodeFilter;
57 class DOMImplementationImpl;
58 class DocumentTypeImpl;
59 class Event;
60 class AbstractView;
61 class CSSStyleDeclaration;
62 class HTMLElementImpl;
63 class HTMLFrameElement;
64 class HTMLElementImpl;
65 class HTMLIFrameElement;
66 class HTMLObjectElement;
67 class HTMLDocument;
68 
77 class KHTML_EXPORT DOMImplementation
78 {
79  friend class Document;
80 public:
81  DOMImplementation();
82  DOMImplementation(const DOMImplementation &other);
83 
84  DOMImplementation & operator = (const DOMImplementation &other);
85  ~DOMImplementation();
86 
103  bool hasFeature ( const DOMString &feature, const DOMString &version );
104 
130  DocumentType createDocumentType ( const DOMString &qualifiedName,
131  const DOMString &publicId,
132  const DOMString &systemId );
133 
164  Document createDocument ( const DOMString &namespaceURI,
165  const DOMString &qualifiedName,
166  const DocumentType &doctype );
167 
182  DOMImplementation getInterface(const DOMString &feature) const;
183 
200  CSSStyleSheet createCSSStyleSheet(const DOMString &title, const DOMString &media);
201 
217  HTMLDocument createHTMLDocument(const DOMString& title);
218 
223  DOMImplementationImpl *handle() const;
224  bool isNull() const;
225 
226 protected:
227  DOMImplementation(DOMImplementationImpl *i);
228  DOMImplementationImpl *impl;
229 };
230 
245 class KHTML_EXPORT Document : public Node
246 {
247  friend class ::KHTMLView;
248  friend class ::KHTMLPart;
249  friend class AbstractView;
250  friend class DOMImplementation;
251  friend class HTMLFrameElement;
252  friend class HTMLIFrameElement;
253  friend class HTMLObjectElement;
254 
255 public:
256  Document();
261  Document(bool);
262  Document(const Document &other);
263  Document(const Node &other) : Node()
264  {(*this)=other;}
265 
266  Document & operator = (const Node &other);
267  Document & operator = (const Document &other);
268 
269  ~Document();
270 
280  DocumentType doctype() const;
281 
288  DOMImplementation implementation() const;
289 
296  Element documentElement() const;
297 
316  Element createElement ( const DOMString &tagName );
317 
336  Element createElementNS( const DOMString &namespaceURI,
337  const DOMString &qualifiedName );
338 
345  DocumentFragment createDocumentFragment ( );
346 
355  Text createTextNode ( const DOMString &data );
356 
366  Comment createComment ( const DOMString &data );
367 
381  CDATASection createCDATASection ( const DOMString &data );
382 
401  ProcessingInstruction createProcessingInstruction ( const DOMString &target,
402  const DOMString &data );
403 
418  Attr createAttribute ( const DOMString &name );
419 
448  Attr createAttributeNS( const DOMString &namespaceURI,
449  const DOMString &qualifiedName );
450 
466  EntityReference createEntityReference ( const DOMString &name );
467 
481  Element getElementById ( const DOMString &elementId ) const;
482 
498  NodeList getElementsByTagName ( const DOMString &tagname );
499 
516  NodeList getElementsByTagNameNS( const DOMString &namespaceURI,
517  const DOMString &localName );
518 
536  NodeList getElementsByClassName ( const DOMString &className );
537 
631  Node importNode( const Node & importedNode, bool deep );
632 
637  bool isHTMLDocument() const;
638 
650  Range createRange();
651 
679  NodeIterator createNodeIterator(Node root, unsigned long whatToShow,
680  NodeFilter filter,
681  bool entityReferenceExpansion);
682 
713  TreeWalker createTreeWalker(Node root, unsigned long whatToShow,
714  NodeFilter filter,
715  bool entityReferenceExpansion);
716 
744  Event createEvent(const DOMString &eventType);
745 
752  AbstractView defaultView() const;
753 
764  StyleSheetList styleSheets() const;
765 
771  DOMString preferredStylesheetSet();
772  DOMString selectedStylesheetSet();
773  void setSelectedStylesheetSet(const DOMString& aString);
774 
789  void addStyleSheet(const StyleSheet &sheet);
790 
803  void removeStyleSheet(const StyleSheet &sheet);
804 
808  KHTMLView *view() const;
809 
824  CSSStyleDeclaration getOverrideStyle(const Element &elt,
825  const DOMString &pseudoElt);
826 
836  bool async() const;
837 
848  void setAsync( bool );
849 
850 
860  void abort();
861 
898  void load( const DOMString &uri );
899 
919  void loadXML( const DOMString &source );
920 
929  Element querySelector(const DOMString& query) const;
930 
941  NodeList querySelectorAll(const DOMString& query) const;
942 
951  bool designMode() const;
952 
959  void setDesignMode(bool enable);
960 
966  DOMString completeURL(const DOMString& url);
967 
968  DOMString toString() const;
969 
970 
976  bool execCommand(const DOMString &command, bool userInterface, const DOMString &value);
977  bool queryCommandEnabled(const DOMString &command);
978  bool queryCommandIndeterm(const DOMString &command);
979  bool queryCommandState(const DOMString &command);
980  bool queryCommandSupported(const DOMString &command);
981  DOMString queryCommandValue(const DOMString &command);
982 
989  void updateRendering();
990 
991  Document( DocumentImpl *i);
992 protected:
993 
994  friend class Node;
995 };
996 
997 class DocumentFragmentImpl;
998 
1041 class KHTML_EXPORT DocumentFragment : public Node
1042 {
1043  friend class Document;
1044  friend class HTMLElementImpl;
1045  friend class Range;
1046 
1047 public:
1048  DocumentFragment();
1049  DocumentFragment(const DocumentFragment &other);
1050  DocumentFragment(const Node &other) : Node()
1051  {(*this)=other;}
1052 
1053  DocumentFragment & operator = (const Node &other);
1054  DocumentFragment & operator = (const DocumentFragment &other);
1055 
1056  ~DocumentFragment();
1057 
1066  Element querySelector(const DOMString& query) const;
1067 
1078  NodeList querySelectorAll(const DOMString& query) const;
1079 protected:
1080  DocumentFragment(DocumentFragmentImpl *i);
1081 };
1082 
1083 class NamedNodeMap;
1084 class DOMString;
1085 
1099 class KHTML_EXPORT DocumentType : public Node
1100 {
1101  friend class Document;
1102  friend class DOMImplementation;
1103 public:
1104  DocumentType();
1105  DocumentType(const DocumentType &other);
1106 
1107  DocumentType(const Node &other) : Node()
1108  {(*this)=other;}
1109  DocumentType & operator = (const Node &other);
1110  DocumentType & operator = (const DocumentType &other);
1111 
1112  ~DocumentType();
1113 
1119  DOMString name() const;
1120 
1135  NamedNodeMap entities() const;
1136 
1146  NamedNodeMap notations() const;
1147 
1153  DOMString publicId() const;
1154 
1160  DOMString systemId() const;
1161 
1171  DOMString internalSubset() const;
1172 
1173 protected:
1174  DocumentType(DocumentTypeImpl *impl);
1175 };
1176 
1177 } //namespace
1178 #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:270
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::DocumentFragment::DocumentFragment
DocumentFragment(const Node &other)
Definition: dom_doc.h:1050
DOM::AbstractView
Introduced in DOM Level 2.
Definition: dom2_views.h:41
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:206
name
const char * name(StandardAction id)
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:1041
KHTMLView
Renders and displays HTML in a QScrollArea.
Definition: khtmlview.h:92
DOM::Document::Document
Document(const Node &other)
Definition: dom_doc.h:263
DOM::HTMLFrameElement
Create a frame.
Definition: html_base.h:162
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:62
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i...
Definition: css_stylesheet.h:218
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:209
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:338
dom_node.h
DOM::Attr
The Attr interface represents an attribute in an Element object.
Definition: dom_element.h:88
DOM::StyleSheetList
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets...
Definition: css_stylesheet.h:323
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:183
DOM::DocumentType
Each Document has a doctype attribute whose value is either null or a DocumentType object...
Definition: dom_doc.h:1099
DOM::HTMLObjectElement
Generic embedded object.
Definition: html_object.h:266
css_stylesheet.h
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
DOM::Event
Introduced in DOM Level 2.
Definition: dom2_events.h:117
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:59
DOM::DocumentType::DocumentType
DocumentType(const Node &other)
Definition: dom_doc.h:1107
DOM::HTMLIFrameElement
Inline subwindows.
Definition: html_base.h:361
DOM::Range
Definition: dom2_range.h:79
DOM::DOMImplementation::impl
DOMImplementationImpl * impl
Definition: dom_doc.h:228
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