1/*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 *           (C) 2000 Antti Koivisto (koivisto@kde.org)
4 *           (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB.  If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25#ifndef StyleRareInheritedData_h
26#define StyleRareInheritedData_h
27
28#include "core/css/StyleColor.h"
29#include "core/platform/Length.h"
30#include "wtf/PassRefPtr.h"
31#include "wtf/RefCounted.h"
32#include "wtf/text/AtomicString.h"
33
34#include "core/rendering/style/DataRef.h"
35#include "core/rendering/style/StyleVariableData.h"
36
37namespace WebCore {
38
39class CursorList;
40class QuotesData;
41class ShadowData;
42class StyleImage;
43
44// This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties.
45// By grouping them together, we save space, and only allocate this object when someone
46// actually uses one of these properties.
47class StyleRareInheritedData : public RefCounted<StyleRareInheritedData> {
48public:
49    static PassRefPtr<StyleRareInheritedData> create() { return adoptRef(new StyleRareInheritedData); }
50    PassRefPtr<StyleRareInheritedData> copy() const { return adoptRef(new StyleRareInheritedData(*this)); }
51    ~StyleRareInheritedData();
52
53    bool operator==(const StyleRareInheritedData& o) const;
54    bool operator!=(const StyleRareInheritedData& o) const
55    {
56        return !(*this == o);
57    }
58    bool shadowDataEquivalent(const StyleRareInheritedData&) const;
59
60    RefPtr<StyleImage> listStyleImage;
61
62    StyleColor textStrokeColor;
63    float textStrokeWidth;
64    StyleColor textFillColor;
65    StyleColor textEmphasisColor;
66
67    StyleColor visitedLinkTextStrokeColor;
68    StyleColor visitedLinkTextFillColor;
69    StyleColor visitedLinkTextEmphasisColor;
70
71    OwnPtr<ShadowData> textShadow; // Our text shadow information for shadowed text drawing.
72    AtomicString highlight; // Apple-specific extension for custom highlight rendering.
73
74    RefPtr<CursorList> cursorData;
75    Length indent;
76    float m_effectiveZoom;
77
78    // Paged media properties.
79    short widows;
80    short orphans;
81    unsigned m_hasAutoWidows : 1;
82    unsigned m_hasAutoOrphans : 1;
83
84    unsigned textSecurity : 2; // ETextSecurity
85    unsigned userModify : 2; // EUserModify (editing)
86    unsigned wordBreak : 2; // EWordBreak
87    unsigned overflowWrap : 1; // EOverflowWrap
88    unsigned lineBreak : 3; // LineBreak
89    unsigned resize : 2; // EResize
90    unsigned userSelect : 2; // EUserSelect
91    unsigned speak : 3; // ESpeak
92    unsigned hyphens : 2; // Hyphens
93    unsigned textEmphasisFill : 1; // TextEmphasisFill
94    unsigned textEmphasisMark : 3; // TextEmphasisMark
95    unsigned textEmphasisPosition : 1; // TextEmphasisPosition
96    unsigned m_textAlignLast : 3; // TextAlignLast
97    unsigned m_textOrientation : 2; // TextOrientation
98#if ENABLE(CSS3_TEXT)
99    unsigned m_textIndentLine : 1; // TextIndentEachLine
100#endif
101    unsigned m_lineBoxContain: 7; // LineBoxContain
102    // CSS Image Values Level 3
103    unsigned m_imageRendering : 2; // EImageRendering
104    unsigned m_lineSnap : 2; // LineSnap
105    unsigned m_lineAlign : 1; // LineAlign
106#if ENABLE(CSS3_TEXT)
107    unsigned m_textUnderlinePosition : 3; // TextUnderlinePosition
108#endif // CSS3_TEXT
109    unsigned m_rubyPosition : 1; // RubyPosition
110
111    AtomicString hyphenationString;
112    short hyphenationLimitBefore;
113    short hyphenationLimitAfter;
114    short hyphenationLimitLines;
115
116    AtomicString locale;
117
118    AtomicString textEmphasisCustomMark;
119    RefPtr<QuotesData> quotes;
120
121    AtomicString m_lineGrid;
122    unsigned m_tabSize;
123
124    StyleColor tapHighlightColor;
125
126    DataRef<StyleVariableData> m_variables;
127
128private:
129    StyleRareInheritedData();
130    StyleRareInheritedData(const StyleRareInheritedData&);
131};
132
133} // namespace WebCore
134
135#endif // StyleRareInheritedData_h
136