]>
git.saurik.com Git - iphone-api.git/blob - WebCore/CharacterData.h
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
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.
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.
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.
23 #ifndef CharacterData_h
24 #define CharacterData_h
26 #include "EventTargetNode.h"
30 class CharacterData
: public EventTargetNode
{
32 CharacterData(Document
*, const String
& text
, bool isText
= false);
33 CharacterData(Document
*, bool isText
= false);
34 virtual ~CharacterData();
36 // DOM methods & attributes for CharacterData
38 String
data() const { return m_data
; }
39 void setData(const String
&, ExceptionCode
&);
40 unsigned length() const { return m_data
->length(); }
41 String
substringData(unsigned offset
, unsigned count
, ExceptionCode
&);
42 void appendData(const String
&, ExceptionCode
&);
43 void insertData(unsigned offset
, const String
&, ExceptionCode
&);
44 void deleteData(unsigned offset
, unsigned count
, ExceptionCode
&);
45 void replaceData(unsigned offset
, unsigned count
, const String
&arg
, ExceptionCode
&);
47 bool containsOnlyWhitespace() const;
49 // DOM methods overridden from parent classes
51 virtual String
nodeValue() const;
52 virtual void setNodeValue(const String
&, ExceptionCode
&);
54 // Other methods (not part of DOM)
56 virtual bool isCharacterDataNode() const { return true; }
57 virtual int maxCharacterOffset() const;
58 StringImpl
* string() { return m_data
.get(); }
60 virtual bool offsetInCharacters() const;
61 virtual bool rendererIsNeeded(RenderStyle
*);
64 RefPtr
<StringImpl
> m_data
;
66 void dispatchModifiedEvent(StringImpl
* oldValue
);
69 void checkCharDataOperation(unsigned offset
, ExceptionCode
&);
72 } // namespace WebCore
74 #endif // CharacterData_h