KHtml

dom_doc.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
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  * https://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 
41 class DOMString;
42 class DocumentType;
43 class NodeList;
44 class CDATASection;
45 class Comment;
46 class DocumentFragment;
47 class Text;
48 class DOMImplementation;
49 class Element;
50 class Attr;
51 class EntityReference;
52 class ProcessingInstruction;
53 class DocumentImpl;
54 class Range;
55 class NodeIterator;
56 class TreeWalker;
57 class NodeFilter;
58 class DOMImplementationImpl;
59 class DocumentTypeImpl;
60 class Event;
61 class AbstractView;
62 class CSSStyleDeclaration;
63 class HTMLElementImpl;
64 class HTMLFrameElement;
65 class HTMLElementImpl;
66 class HTMLIFrameElement;
67 class HTMLObjectElement;
68 class HTMLDocument;
69 
78 class KHTML_EXPORT DOMImplementation
79 {
80  friend class Document;
81 public:
84 
85  DOMImplementation &operator = (const DOMImplementation &other);
87 
104  bool hasFeature(const DOMString &feature, const DOMString &version);
105 
131  DocumentType createDocumentType(const DOMString &qualifiedName,
132  const DOMString &publicId,
133  const DOMString &systemId);
134 
165  Document createDocument(const DOMString &namespaceURI,
166  const DOMString &qualifiedName,
167  const DocumentType &doctype);
168 
183  DOMImplementation getInterface(const DOMString &feature) const;
184 
201  CSSStyleSheet createCSSStyleSheet(const DOMString &title, const DOMString &media);
202 
218  HTMLDocument createHTMLDocument(const DOMString &title);
219 
224  DOMImplementationImpl *handle() const;
225  bool isNull() const;
226 
227 protected:
228  DOMImplementation(DOMImplementationImpl *i);
229  DOMImplementationImpl *impl;
230 };
231 
246 class KHTML_EXPORT Document : public Node
247 {
248  friend class ::KHTMLView;
249  friend class ::KHTMLPart;
250  friend class AbstractView;
251  friend class DOMImplementation;
252  friend class HTMLFrameElement;
253  friend class HTMLIFrameElement;
254  friend class HTMLObjectElement;
255 
256 public:
257  Document();
262  Document(bool);
263  Document(const Document &other);
264  Document(const Node &other) : Node()
265  {
266  (*this) = other;
267  }
268 
269  Document &operator = (const Node &other);
270  Document &operator = (const Document &other);
271 
272  ~Document();
273 
283  DocumentType doctype() const;
284 
291  DOMImplementation implementation() const;
292 
299  Element documentElement() const;
300 
319  Element createElement(const DOMString &tagName);
320 
339  Element createElementNS(const DOMString &namespaceURI,
340  const DOMString &qualifiedName);
341 
348  DocumentFragment createDocumentFragment();
349 
358  Text createTextNode(const DOMString &data);
359 
369  Comment createComment(const DOMString &data);
370 
384  CDATASection createCDATASection(const DOMString &data);
385 
404  ProcessingInstruction createProcessingInstruction(const DOMString &target,
405  const DOMString &data);
406 
421  Attr createAttribute(const DOMString &name);
422 
451  Attr createAttributeNS(const DOMString &namespaceURI,
452  const DOMString &qualifiedName);
453 
469  EntityReference createEntityReference(const DOMString &name);
470 
484  Element getElementById(const DOMString &elementId) const;
485 
501  NodeList getElementsByTagName(const DOMString &tagname);
502 
519  NodeList getElementsByTagNameNS(const DOMString &namespaceURI,
520  const DOMString &localName);
521 
539  NodeList getElementsByClassName(const DOMString &className);
540 
634  Node importNode(const Node &importedNode, bool deep);
635 
640  bool isHTMLDocument() const;
641 
653  Range createRange();
654 
682  NodeIterator createNodeIterator(Node root, unsigned long whatToShow,
683  NodeFilter filter,
684  bool entityReferenceExpansion);
685 
716  TreeWalker createTreeWalker(Node root, unsigned long whatToShow,
717  NodeFilter filter,
718  bool entityReferenceExpansion);
719 
747  Event createEvent(const DOMString &eventType);
748 
755  AbstractView defaultView() const;
756 
767  StyleSheetList styleSheets() const;
768 
774  DOMString preferredStylesheetSet();
775  DOMString selectedStylesheetSet();
776  void setSelectedStylesheetSet(const DOMString &aString);
777 
792  void addStyleSheet(const StyleSheet &sheet);
793 
806  void removeStyleSheet(const StyleSheet &sheet);
807 
811  KHTMLView *view() const;
812 
827  CSSStyleDeclaration getOverrideStyle(const Element &elt,
828  const DOMString &pseudoElt);
829 
839  bool async() const;
840 
851  void setAsync(bool);
852 
862  void abort();
863 
900  void load(const DOMString &uri);
901 
921  void loadXML(const DOMString &source);
922 
931  Element querySelector(const DOMString &query) const;
932 
943  NodeList querySelectorAll(const DOMString &query) const;
944 
953  bool designMode() const;
954 
961  void setDesignMode(bool enable);
962 
968  DOMString completeURL(const DOMString &url);
969 
970  DOMString toString() const;
971 
977  bool execCommand(const DOMString &command, bool userInterface, const DOMString &value);
978  bool queryCommandEnabled(const DOMString &command);
979  bool queryCommandIndeterm(const DOMString &command);
980  bool queryCommandState(const DOMString &command);
981  bool queryCommandSupported(const DOMString &command);
982  DOMString queryCommandValue(const DOMString &command);
983 
990  void updateRendering();
991 
993 protected:
994 
995  friend class Node;
996 };
997 
998 class DocumentFragmentImpl;
999 
1042 class KHTML_EXPORT DocumentFragment : public Node
1043 {
1044  friend class Document;
1045  friend class HTMLElementImpl;
1046  friend class Range;
1047 
1048 public:
1049  DocumentFragment();
1050  DocumentFragment(const DocumentFragment &other);
1051  DocumentFragment(const Node &other) : Node()
1052  {
1053  (*this) = other;
1054  }
1055 
1056  DocumentFragment &operator = (const Node &other);
1057  DocumentFragment &operator = (const DocumentFragment &other);
1058 
1059  ~DocumentFragment();
1060 
1069  Element querySelector(const DOMString &query) const;
1070 
1081  NodeList querySelectorAll(const DOMString &query) const;
1082 protected:
1083  DocumentFragment(DocumentFragmentImpl *i);
1084 };
1085 
1086 class NamedNodeMap;
1087 class DOMString;
1088 
1102 class KHTML_EXPORT DocumentType : public Node
1103 {
1104  friend class Document;
1105  friend class DOMImplementation;
1106 public:
1107  DocumentType();
1108  DocumentType(const DocumentType &other);
1109 
1110  DocumentType(const Node &other) : Node()
1111  {
1112  (*this) = other;
1113  }
1114  DocumentType &operator = (const Node &other);
1115  DocumentType &operator = (const DocumentType &other);
1116 
1117  ~DocumentType();
1118 
1124  DOMString name() const;
1125 
1140  NamedNodeMap entities() const;
1141 
1151  NamedNodeMap notations() const;
1152 
1158  DOMString publicId() const;
1159 
1165  DOMString systemId() const;
1166 
1176  DOMString internalSubset() const;
1177 
1178 protected:
1179  DocumentType(DocumentTypeImpl *impl);
1180 };
1181 
1182 } //namespace
1183 #endif
The ProcessingInstruction interface represents a "processing instruction", used in XML as a way to ke...
Definition: dom_xml.h:264
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
Definition: html_document.h:74
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:59
Introduced in DOM Level 2.
Definition: dom2_views.h:42
This class is khtml&#39;s main class.
Definition: khtml_part.h:208
The DOMImplementation interface provides a number of methods for performing operations that are indep...
Definition: dom_doc.h:78
DocumentFragment is a "lightweight" or "minimal" Document object.
Definition: dom_doc.h:1042
Renders and displays HTML in a QScrollArea.
Definition: khtmlview.h:97
Create a frame.
Definition: html_base.h:165
EntityReference objects may be inserted into the structure model when an entity reference is in the s...
Definition: dom_xml.h:190
Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can b...
Definition: dom_node.h:64
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i...
This represents the content of a comment, i.e., all the characters between the starting &#39; <!– &#39; and ...
Definition: dom_text.h:225
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition: dom_element.h:212
Comment
The Text interface represents the textual content (termed character data in XML) of an Element or At...
Definition: dom_text.h:273
TreeWalker objects are used to navigate a document tree or subtree using the view of the document def...
The Attr interface represents an attribute in an Element object.
Definition: dom_element.h:89
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets...
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...
Definition: dom_xml.h:65
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
Filters are objects that know how to "filter out" nodes.
Each Document has a doctype attribute whose value is either null or a DocumentType object...
Definition: dom_doc.h:1102
Generic embedded object.
Definition: html_object.h:268
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:976
This library provides a full-featured HTML parser and widget.
Introduced in DOM Level 2.
Definition: dom2_events.h:116
The StyleSheet interface is the abstract base interface for any type of style sheet.
NodeIterators are used to step through a set of nodes, e.g.
Inline subwindows.
Definition: html_base.h:368
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 11 2020 22:47:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.