2
2
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
3
* (C) 1999 Antti Koivisto (koivisto@kde.org)
4
* Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4
* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
6
6
* This library is free software; you can redistribute it and/or
7
7
* modify it under the terms of the GNU Library General Public
23
23
#ifndef CharacterData_h
24
24
#define CharacterData_h
26
#include "EventTargetNode.h"
28
28
namespace WebCore {
30
class CharacterData : public EventTargetNode {
30
class CharacterData : public Node {
32
CharacterData(Document*, const String& text);
33
CharacterData(Document*);
34
virtual ~CharacterData();
36
// DOM methods & attributes for CharacterData
38
32
String data() const { return m_data; }
39
33
void setData(const String&, ExceptionCode&);
40
34
unsigned length() const { return m_data->length(); }
42
36
void appendData(const String&, ExceptionCode&);
43
37
void insertData(unsigned offset, const String&, ExceptionCode&);
44
38
void deleteData(unsigned offset, unsigned count, ExceptionCode&);
45
void replaceData(unsigned offset, unsigned count, const String &arg, ExceptionCode&);
39
void replaceData(unsigned offset, unsigned count, const String&, ExceptionCode&);
47
41
bool containsOnlyWhitespace() const;
49
// DOM methods overridden from parent classes
43
StringImpl* dataImpl() { return m_data.get(); }
46
CharacterData(Document*, const String&, ConstructionType);
48
virtual bool rendererIsNeeded(RenderStyle*);
50
void setDataImpl(PassRefPtr<StringImpl> impl) { m_data = impl; }
51
void dispatchModifiedEvent(StringImpl* oldValue);
51
54
virtual String nodeValue() const;
52
55
virtual void setNodeValue(const String&, ExceptionCode&);
54
// Other methods (not part of DOM)
56
56
virtual bool isCharacterDataNode() const { return true; }
57
57
virtual int maxCharacterOffset() const;
58
StringImpl* string() { return m_data.get(); }
60
58
virtual bool offsetInCharacters() const;
61
virtual bool rendererIsNeeded(RenderStyle*);
60
void checkCharDataOperation(unsigned offset, ExceptionCode&);
64
62
RefPtr<StringImpl> m_data;
66
void dispatchModifiedEvent(StringImpl* oldValue);
69
void checkCharDataOperation(unsigned offset, ExceptionCode&);
72
65
} // namespace WebCore