~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/dom/CharacterData.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
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.
5
5
 *
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
25
25
 
26
 
#include "EventTargetNode.h"
 
26
#include "Node.h"
27
27
 
28
28
namespace WebCore {
29
29
 
30
 
class CharacterData : public EventTargetNode {
 
30
class CharacterData : public Node {
31
31
public:
32
 
    CharacterData(Document*, const String& text);
33
 
    CharacterData(Document*);
34
 
    virtual ~CharacterData();
35
 
 
36
 
    // DOM methods & attributes for CharacterData
37
 
 
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&);
46
40
 
47
41
    bool containsOnlyWhitespace() const;
48
42
 
49
 
    // DOM methods overridden from parent classes
50
 
 
 
43
    StringImpl* dataImpl() { return m_data.get(); }
 
44
 
 
45
protected:
 
46
    CharacterData(Document*, const String&, ConstructionType);
 
47
 
 
48
    virtual bool rendererIsNeeded(RenderStyle*);
 
49
 
 
50
    void setDataImpl(PassRefPtr<StringImpl> impl) { m_data = impl; }
 
51
    void dispatchModifiedEvent(StringImpl* oldValue);
 
52
 
 
53
private:
51
54
    virtual String nodeValue() const;
52
55
    virtual void setNodeValue(const String&, ExceptionCode&);
53
 
    
54
 
    // Other methods (not part of DOM)
55
 
 
56
56
    virtual bool isCharacterDataNode() const { return true; }
57
57
    virtual int maxCharacterOffset() const;
58
 
    StringImpl* string() { return m_data.get(); }
59
 
 
60
58
    virtual bool offsetInCharacters() const;
61
 
    virtual bool rendererIsNeeded(RenderStyle*);
62
 
 
63
 
protected:
 
59
 
 
60
    void checkCharDataOperation(unsigned offset, ExceptionCode&);
 
61
 
64
62
    RefPtr<StringImpl> m_data;
65
 
 
66
 
    void dispatchModifiedEvent(StringImpl* oldValue);
67
 
 
68
 
private:
69
 
    void checkCharDataOperation(unsigned offset, ExceptionCode&);
70
63
};
71
64
 
72
65
} // namespace WebCore