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

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/rendering/style/ContentData.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:
25
25
#ifndef ContentData_h
26
26
#define ContentData_h
27
27
 
 
28
#include "PlatformString.h"
28
29
#include "RenderStyleConstants.h"
 
30
#include "StringImpl.h"
 
31
#include "StyleImage.h"
29
32
#include <wtf/Noncopyable.h>
30
33
 
31
34
namespace WebCore {
32
35
 
33
36
class CounterContent;
34
 
class StringImpl;
35
 
class StyleImage;
36
37
 
37
38
struct ContentData : Noncopyable {
 
39
public:
38
40
    ContentData()
39
41
        : m_type(CONTENT_NONE)
40
42
        , m_next(0)
48
50
 
49
51
    void clear();
50
52
 
51
 
    ContentType m_type;
 
53
    bool isCounter() const { return m_type == CONTENT_COUNTER; }
 
54
    bool isImage() const { return m_type == CONTENT_OBJECT; }
 
55
    bool isNone() const { return m_type == CONTENT_NONE; }
 
56
    bool isText() const { return m_type == CONTENT_TEXT; }
 
57
 
 
58
    StyleContentType type() const { return m_type; }
 
59
 
 
60
    bool dataEquivalent(const ContentData&) const;
 
61
 
 
62
    StyleImage* image() const { return m_content.m_image; }
 
63
    void setImage(PassRefPtr<StyleImage> image)
 
64
    {
 
65
        deleteContent();
 
66
        m_type = CONTENT_OBJECT;
 
67
        m_content.m_image = image.releaseRef();
 
68
    }
 
69
 
 
70
    StringImpl* text() const { return m_content.m_text; }
 
71
    void setText(PassRefPtr<StringImpl> text)
 
72
    {
 
73
        deleteContent();
 
74
        m_type = CONTENT_TEXT;
 
75
        m_content.m_text = text.releaseRef();
 
76
    }
 
77
 
 
78
    CounterContent* counter() const { return m_content.m_counter; }
 
79
    void setCounter(CounterContent* counter)
 
80
    {
 
81
        deleteContent();
 
82
        m_type = CONTENT_COUNTER;
 
83
        m_content.m_counter = counter;
 
84
    }
 
85
 
 
86
    ContentData* next() const { return m_next; }
 
87
    void setNext(ContentData* next)
 
88
    {
 
89
        m_next = next;
 
90
    }
 
91
 
 
92
private:
 
93
    void deleteContent();
 
94
 
 
95
    StyleContentType m_type;
52
96
    union {
53
97
        StyleImage* m_image;
54
98
        StringImpl* m_text;