KHtml

dom_text.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_CharacterData_h_
30 #define _DOM_CharacterData_h_
31 
32 #include <dom/dom_node.h>
33 
34 namespace DOM
35 {
36 
37 class DOMString;
38 class CharacterDataImpl;
39 
50 class KHTML_EXPORT CharacterData : public Node
51 {
52  friend class CharacterDataImpl;
53 
54 public:
55  CharacterData();
56  CharacterData(const CharacterData &other);
57  CharacterData(const Node &other) : Node()
58  {
59  (*this) = other;
60  }
61 
62  CharacterData &operator = (const Node &other);
63  CharacterData &operator = (const CharacterData &other);
64 
65  ~CharacterData();
66 
83  DOMString data() const;
84 
91  void setData(const DOMString &);
92 
100  unsigned long length() const;
101 
123  DOMString substringData(const unsigned long offset, const unsigned long count);
124 
139  void appendData(const DOMString &arg);
140 
157  void insertData(const unsigned long offset, const DOMString &arg);
158 
181  void deleteData(const unsigned long offset, const unsigned long count);
182 
209  void replaceData(const unsigned long offset, const unsigned long count, const DOMString &arg);
210 
211 protected:
212  CharacterData(CharacterDataImpl *i);
213 };
214 
215 class CommentImpl;
216 
225 class KHTML_EXPORT Comment : public CharacterData
226 {
227  friend class Document;
228  friend class TextImpl;
229 
230 public:
231  Comment();
232  Comment(const Comment &other);
233  Comment(const Node &other) : CharacterData()
234  {
235  (*this) = other;
236  }
237 
238  Comment &operator = (const Node &other);
239  Comment &operator = (const Comment &other);
240 
241  ~Comment();
242 
243 protected:
244  Comment(CommentImpl *i);
245 };
246 
247 class TextImpl;
248 
273 class KHTML_EXPORT Text : public CharacterData
274 {
275  friend class Document;
276  friend class TextImpl;
277 
278 public:
279  Text();
280  Text(const Text &other);
281  Text(const Node &other) : CharacterData()
282  {
283  (*this) = other;
284  }
285 
286  Text &operator = (const Node &other);
287  Text &operator = (const Text &other);
288 
289  ~Text();
290 
310  Text splitText(const unsigned long offset);
311 
312 protected:
313  Text(TextImpl *i);
314 
315 };
316 
317 } //namespace
318 #endif
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
This represents the content of a comment, i.e., all the characters between the starting &#39; <!– &#39; and ...
Definition: dom_text.h:225
The Text interface represents the textual content (termed character data in XML) of an Element or At...
Definition: dom_text.h:273
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
This library provides a full-featured HTML parser and widget.
The CharacterData interface extends Node with a set of attributes and methods for accessing character...
Definition: dom_text.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 5 2020 22:46:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.