KHTML
dom_text.h
Go to the documentation of this file.00001 /* 00002 * This file is part of the DOM implementation for KDE. 00003 * 00004 * (C) 1999 Lars Knoll (knoll@kde.org) 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 * This file includes excerpts from the Document Object Model (DOM) 00022 * Level 1 Specification (Recommendation) 00023 * http://www.w3.org/TR/REC-DOM-Level-1/ 00024 * Copyright © World Wide Web Consortium , (Massachusetts Institute of 00025 * Technology , Institut National de Recherche en Informatique et en 00026 * Automatique , Keio University ). All Rights Reserved. 00027 * 00028 */ 00029 #ifndef _DOM_CharacterData_h_ 00030 #define _DOM_CharacterData_h_ 00031 00032 #include <dom/dom_node.h> 00033 00034 namespace DOM { 00035 00036 class DOMString; 00037 class CharacterDataImpl; 00038 00049 class KHTML_EXPORT CharacterData : public Node 00050 { 00051 friend class CharacterDataImpl; 00052 00053 public: 00054 CharacterData(); 00055 CharacterData(const CharacterData &other); 00056 CharacterData(const Node &other) : Node() 00057 {(*this)=other;} 00058 00059 CharacterData & operator = (const Node &other); 00060 CharacterData & operator = (const CharacterData &other); 00061 00062 ~CharacterData(); 00063 00080 DOMString data() const; 00081 00088 void setData( const DOMString & ); 00089 00097 unsigned long length() const; 00098 00120 DOMString substringData ( const unsigned long offset, const unsigned long count ); 00121 00136 void appendData ( const DOMString &arg ); 00137 00154 void insertData ( const unsigned long offset, const DOMString &arg ); 00155 00178 void deleteData ( const unsigned long offset, const unsigned long count ); 00179 00206 void replaceData ( const unsigned long offset, const unsigned long count, const DOMString &arg ); 00207 00208 protected: 00209 CharacterData(CharacterDataImpl *i); 00210 }; 00211 00212 00213 class CommentImpl; 00214 00223 class KHTML_EXPORT Comment : public CharacterData 00224 { 00225 friend class Document; 00226 friend class TextImpl; 00227 00228 public: 00229 Comment(); 00230 Comment(const Comment &other); 00231 Comment(const Node &other) : CharacterData() 00232 {(*this)=other;} 00233 00234 Comment & operator = (const Node &other); 00235 Comment & operator = (const Comment &other); 00236 00237 ~Comment(); 00238 00239 protected: 00240 Comment(CommentImpl *i); 00241 }; 00242 00243 class TextImpl; 00244 00269 class KHTML_EXPORT Text : public CharacterData 00270 { 00271 friend class Document; 00272 friend class TextImpl; 00273 00274 public: 00275 Text(); 00276 Text(const Text &other); 00277 Text(const Node &other) : CharacterData() 00278 {(*this)=other;} 00279 00280 Text & operator = (const Node &other); 00281 Text & operator = (const Text &other); 00282 00283 ~Text(); 00284 00304 Text splitText ( const unsigned long offset ); 00305 00306 protected: 00307 Text(TextImpl *i); 00308 00309 }; 00310 00311 } //namespace 00312 #endif