2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 Based on khtml code by:
7 Copyright (C) 2000-2003 Lars Knoll (knoll@kde.org)
8 (C) 2000 Antti Koivisto (koivisto@kde.org)
9 (C) 2000-2003 Dirk Mueller (mueller@kde.org)
10 (C) 2002-2003 Apple Computer, Inc.
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License as published by the Free Software Foundation; either
15 version 2 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Library General Public License for more details.
22 You should have received a copy of the GNU Library General Public License
23 along with this library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA.
28 #ifndef SVGRenderStyleDefs_h
29 #define SVGRenderStyleDefs_h
32 #include "SVGLength.h"
34 #include "ShadowData.h"
35 #include <wtf/OwnPtr.h>
36 #include <wtf/PassOwnPtr.h>
37 #include <wtf/RefCounted.h>
38 #include <wtf/RefPtr.h>
43 BS_BASELINE, BS_SUB, BS_SUPER, BS_LENGTH
47 TA_START, TA_MIDDLE, TA_END
50 enum EColorInterpolation {
51 CI_AUTO, CI_SRGB, CI_LINEARRGB
54 enum EColorRendering {
55 CR_AUTO, CR_OPTIMIZESPEED, CR_OPTIMIZEQUALITY
57 enum EShapeRendering {
58 SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION
62 WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB
65 enum EGlyphOrientation {
66 GO_0DEG, GO_90DEG, GO_180DEG, GO_270DEG, GO_AUTO
69 enum EAlignmentBaseline {
70 AB_AUTO, AB_BASELINE, AB_BEFORE_EDGE, AB_TEXT_BEFORE_EDGE,
71 AB_MIDDLE, AB_CENTRAL, AB_AFTER_EDGE, AB_TEXT_AFTER_EDGE,
72 AB_IDEOGRAPHIC, AB_ALPHABETIC, AB_HANGING, AB_MATHEMATICAL
75 enum EDominantBaseline {
76 DB_AUTO, DB_USE_SCRIPT, DB_NO_CHANGE, DB_RESET_SIZE,
77 DB_IDEOGRAPHIC, DB_ALPHABETIC, DB_HANGING, DB_MATHEMATICAL,
78 DB_CENTRAL, DB_MIDDLE, DB_TEXT_AFTER_EDGE, DB_TEXT_BEFORE_EDGE
90 // Inherited/Non-Inherited Style Datastructures
91 class StyleFillData : public RefCounted<StyleFillData> {
93 static PassRefPtr<StyleFillData> create() { return adoptRef(new StyleFillData); }
94 PassRefPtr<StyleFillData> copy() const { return adoptRef(new StyleFillData(*this)); }
96 bool operator==(const StyleFillData&) const;
97 bool operator!=(const StyleFillData& other) const
99 return !(*this == other);
103 SVGPaint::SVGPaintType paintType;
109 StyleFillData(const StyleFillData&);
112 class StyleStrokeData : public RefCounted<StyleStrokeData> {
114 static PassRefPtr<StyleStrokeData> create() { return adoptRef(new StyleStrokeData); }
115 PassRefPtr<StyleStrokeData> copy() const { return adoptRef(new StyleStrokeData(*this)); }
117 bool operator==(const StyleStrokeData&) const;
118 bool operator!=(const StyleStrokeData& other) const
120 return !(*this == other);
127 SVGLength dashOffset;
128 Vector<SVGLength> dashArray;
130 SVGPaint::SVGPaintType paintType;
136 StyleStrokeData(const StyleStrokeData&);
139 class StyleStopData : public RefCounted<StyleStopData> {
141 static PassRefPtr<StyleStopData> create() { return adoptRef(new StyleStopData); }
142 PassRefPtr<StyleStopData> copy() const { return adoptRef(new StyleStopData(*this)); }
144 bool operator==(const StyleStopData&) const;
145 bool operator!=(const StyleStopData& other) const
147 return !(*this == other);
155 StyleStopData(const StyleStopData&);
158 class StyleTextData : public RefCounted<StyleTextData> {
160 static PassRefPtr<StyleTextData> create() { return adoptRef(new StyleTextData); }
161 PassRefPtr<StyleTextData> copy() const { return adoptRef(new StyleTextData(*this)); }
163 bool operator==(const StyleTextData& other) const;
164 bool operator!=(const StyleTextData& other) const
166 return !(*this == other);
173 StyleTextData(const StyleTextData&);
176 // Note: the rule for this class is, *no inheritance* of these props
177 class StyleMiscData : public RefCounted<StyleMiscData> {
179 static PassRefPtr<StyleMiscData> create() { return adoptRef(new StyleMiscData); }
180 PassRefPtr<StyleMiscData> copy() const { return adoptRef(new StyleMiscData(*this)); }
182 bool operator==(const StyleMiscData&) const;
183 bool operator!=(const StyleMiscData& other) const
185 return !(*this == other);
192 // non-inherited text stuff lives here not in StyleTextData.
193 SVGLength baselineShiftValue;
197 StyleMiscData(const StyleMiscData&);
200 class StyleShadowSVGData : public RefCounted<StyleShadowSVGData> {
202 static PassRefPtr<StyleShadowSVGData> create() { return adoptRef(new StyleShadowSVGData); }
203 PassRefPtr<StyleShadowSVGData> copy() const { return adoptRef(new StyleShadowSVGData(*this)); }
205 bool operator==(const StyleShadowSVGData&) const;
206 bool operator!=(const StyleShadowSVGData& other) const
208 return !(*this == other);
211 OwnPtr<ShadowData> shadow;
214 StyleShadowSVGData();
215 StyleShadowSVGData(const StyleShadowSVGData&);
218 // Non-inherited resources
219 class StyleResourceData : public RefCounted<StyleResourceData> {
221 static PassRefPtr<StyleResourceData> create() { return adoptRef(new StyleResourceData); }
222 PassRefPtr<StyleResourceData> copy() const { return adoptRef(new StyleResourceData(*this)); }
224 bool operator==(const StyleResourceData&) const;
225 bool operator!=(const StyleResourceData& other) const
227 return !(*this == other);
236 StyleResourceData(const StyleResourceData&);
239 // Inherited resources
240 class StyleInheritedResourceData : public RefCounted<StyleInheritedResourceData> {
242 static PassRefPtr<StyleInheritedResourceData> create() { return adoptRef(new StyleInheritedResourceData); }
243 PassRefPtr<StyleInheritedResourceData> copy() const { return adoptRef(new StyleInheritedResourceData(*this)); }
245 bool operator==(const StyleInheritedResourceData&) const;
246 bool operator!=(const StyleInheritedResourceData& other) const
248 return !(*this == other);
256 StyleInheritedResourceData();
257 StyleInheritedResourceData(const StyleInheritedResourceData&);
260 } // namespace WebCore
262 #endif // ENABLE(SVG)
263 #endif // SVGRenderStyleDefs_h