2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
24 #include "bindings/core/v8/ScriptWrappable.h"
25 #include "wtf/RefCounted.h"
26 #include "wtf/text/WTFString.h"
30 enum ListModification {
31 ListModificationUnknown = 0,
32 ListModificationInsert = 1,
33 ListModificationReplace = 2,
34 ListModificationRemove = 3,
35 ListModificationAppend = 4
45 PathSegCurveToCubicAbs = 6,
46 PathSegCurveToCubicRel = 7,
47 PathSegCurveToQuadraticAbs = 8,
48 PathSegCurveToQuadraticRel = 9,
51 PathSegLineToHorizontalAbs = 12,
52 PathSegLineToHorizontalRel = 13,
53 PathSegLineToVerticalAbs = 14,
54 PathSegLineToVerticalRel = 15,
55 PathSegCurveToCubicSmoothAbs = 16,
56 PathSegCurveToCubicSmoothRel = 17,
57 PathSegCurveToQuadraticSmoothAbs = 18,
58 PathSegCurveToQuadraticSmoothRel = 19
61 class SVGPropertyBase;
65 class SVGPathSeg : public RefCounted<SVGPathSeg>, public ScriptWrappable {
67 // SVGPathSeg itself is used as a tear-off type.
68 // FIXME: A tear-off type should be introduced to distinguish animVal/baseVal
69 typedef SVGPathSeg TearOffType;
71 explicit SVGPathSeg(SVGPathElement* contextElement);
73 virtual ~SVGPathSeg() { }
75 // Forward declare these enums in the w3c naming scheme, for IDL generation
77 PATHSEG_UNKNOWN = PathSegUnknown,
78 PATHSEG_CLOSEPATH = PathSegClosePath,
79 PATHSEG_MOVETO_ABS = PathSegMoveToAbs,
80 PATHSEG_MOVETO_REL = PathSegMoveToRel,
81 PATHSEG_LINETO_ABS = PathSegLineToAbs,
82 PATHSEG_LINETO_REL = PathSegLineToRel,
83 PATHSEG_CURVETO_CUBIC_ABS = PathSegCurveToCubicAbs,
84 PATHSEG_CURVETO_CUBIC_REL = PathSegCurveToCubicRel,
85 PATHSEG_CURVETO_QUADRATIC_ABS = PathSegCurveToQuadraticAbs,
86 PATHSEG_CURVETO_QUADRATIC_REL = PathSegCurveToQuadraticRel,
87 PATHSEG_ARC_ABS = PathSegArcAbs,
88 PATHSEG_ARC_REL = PathSegArcRel,
89 PATHSEG_LINETO_HORIZONTAL_ABS = PathSegLineToHorizontalAbs,
90 PATHSEG_LINETO_HORIZONTAL_REL = PathSegLineToHorizontalRel,
91 PATHSEG_LINETO_VERTICAL_ABS = PathSegLineToVerticalAbs,
92 PATHSEG_LINETO_VERTICAL_REL = PathSegLineToVerticalRel,
93 PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = PathSegCurveToCubicSmoothAbs,
94 PATHSEG_CURVETO_CUBIC_SMOOTH_REL = PathSegCurveToCubicSmoothRel,
95 PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = PathSegCurveToQuadraticSmoothAbs,
96 PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = PathSegCurveToQuadraticSmoothRel
99 virtual unsigned short pathSegType() const = 0;
100 virtual String pathSegTypeAsLetter() const = 0;
102 SVGPropertyBase* ownerList() const
107 void setOwnerList(SVGPropertyBase* ownerList)
109 // Previous owner list must be cleared before setting new owner list.
110 ASSERT((!ownerList && m_ownerList) || (ownerList && !m_ownerList));
112 m_ownerList = ownerList;
115 void setContextElement(SVGElement* contextElement)
117 m_contextElement = contextElement;
120 static PassRefPtr<SVGPathSeg> create() { ASSERT_NOT_REACHED(); return nullptr; }
121 PassRefPtr<SVGPathSeg> clone() { ASSERT_NOT_REACHED(); return nullptr; }
127 // FIXME: oilpan: These are kept as raw ptrs to break reference cycle. Should be Member in oilpan.
128 SVGPropertyBase* m_ownerList;
129 SVGElement* m_contextElement;