Use "= default" to denote default constructor or destructor
[WebKit-https.git] / Source / WebCore / svg / SVGPathSeg.h
1 /*
2  * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3  * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 #pragma once
22
23 #include <wtf/RefCounted.h>
24 #include <wtf/text/WTFString.h>
25
26 namespace WebCore {
27
28 enum SVGPathSegType {
29     PathSegUnknown = 0,
30     PathSegClosePath = 1,
31     PathSegMoveToAbs = 2,
32     PathSegMoveToRel = 3,
33     PathSegLineToAbs = 4,
34     PathSegLineToRel = 5,
35     PathSegCurveToCubicAbs = 6,
36     PathSegCurveToCubicRel = 7,
37     PathSegCurveToQuadraticAbs = 8,
38     PathSegCurveToQuadraticRel = 9,
39     PathSegArcAbs = 10,
40     PathSegArcRel = 11,
41     PathSegLineToHorizontalAbs = 12,
42     PathSegLineToHorizontalRel = 13,
43     PathSegLineToVerticalAbs = 14,
44     PathSegLineToVerticalRel = 15,
45     PathSegCurveToCubicSmoothAbs = 16,
46     PathSegCurveToCubicSmoothRel = 17,
47     PathSegCurveToQuadraticSmoothAbs = 18,
48     PathSegCurveToQuadraticSmoothRel = 19
49 };
50
51 enum SVGPathSegRole {
52     PathSegUnalteredRole = 0,
53     PathSegNormalizedRole = 1,
54     PathSegUndefinedRole = 2
55 };
56
57 class SVGPathSeg : public RefCounted<SVGPathSeg> {
58 public:
59     SVGPathSeg() = default;
60     virtual ~SVGPathSeg() = default;
61
62     // Forward declare these enums in the w3c naming scheme, for IDL generation
63     enum {
64         PATHSEG_UNKNOWN = PathSegUnknown,
65         PATHSEG_CLOSEPATH = PathSegClosePath,
66         PATHSEG_MOVETO_ABS = PathSegMoveToAbs,
67         PATHSEG_MOVETO_REL = PathSegMoveToRel,
68         PATHSEG_LINETO_ABS = PathSegLineToAbs,
69         PATHSEG_LINETO_REL = PathSegLineToRel,
70         PATHSEG_CURVETO_CUBIC_ABS = PathSegCurveToCubicAbs,
71         PATHSEG_CURVETO_CUBIC_REL = PathSegCurveToCubicRel,
72         PATHSEG_CURVETO_QUADRATIC_ABS = PathSegCurveToQuadraticAbs,
73         PATHSEG_CURVETO_QUADRATIC_REL = PathSegCurveToQuadraticRel,
74         PATHSEG_ARC_ABS = PathSegArcAbs,
75         PATHSEG_ARC_REL = PathSegArcRel,
76         PATHSEG_LINETO_HORIZONTAL_ABS = PathSegLineToHorizontalAbs,
77         PATHSEG_LINETO_HORIZONTAL_REL = PathSegLineToHorizontalRel,
78         PATHSEG_LINETO_VERTICAL_ABS = PathSegLineToVerticalAbs,
79         PATHSEG_LINETO_VERTICAL_REL = PathSegLineToVerticalRel,
80         PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = PathSegCurveToCubicSmoothAbs,
81         PATHSEG_CURVETO_CUBIC_SMOOTH_REL = PathSegCurveToCubicSmoothRel,
82         PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = PathSegCurveToQuadraticSmoothAbs,
83         PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = PathSegCurveToQuadraticSmoothRel
84     };
85
86     virtual unsigned short pathSegType() const = 0;
87     virtual String pathSegTypeAsLetter() const = 0;
88 };
89
90 } // namespace WebCore