2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved.
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.
21 #ifndef SVGPathStringSource_h
22 #define SVGPathStringSource_h
24 #include "core/svg/SVGPathSource.h"
25 #include "wtf/PassOwnPtr.h"
26 #include "wtf/text/WTFString.h"
30 class SVGPathStringSource FINAL : public SVGPathSource {
32 static PassOwnPtr<SVGPathStringSource> create(const String& string)
34 return adoptPtr(new SVGPathStringSource(string));
38 SVGPathStringSource(const String&);
40 virtual bool hasMoreData() const OVERRIDE;
41 virtual bool moveToNextToken() OVERRIDE;
42 virtual bool parseSVGSegmentType(SVGPathSegType&) OVERRIDE;
43 virtual SVGPathSegType nextCommand(SVGPathSegType previousCommand) OVERRIDE;
45 virtual bool parseMoveToSegment(FloatPoint&) OVERRIDE;
46 virtual bool parseLineToSegment(FloatPoint&) OVERRIDE;
47 virtual bool parseLineToHorizontalSegment(float&) OVERRIDE;
48 virtual bool parseLineToVerticalSegment(float&) OVERRIDE;
49 virtual bool parseCurveToCubicSegment(FloatPoint&, FloatPoint&, FloatPoint&) OVERRIDE;
50 virtual bool parseCurveToCubicSmoothSegment(FloatPoint&, FloatPoint&) OVERRIDE;
51 virtual bool parseCurveToQuadraticSegment(FloatPoint&, FloatPoint&) OVERRIDE;
52 virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&) OVERRIDE;
53 virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&) OVERRIDE;
59 const LChar* m_character8;
60 const UChar* m_character16;
63 const LChar* m_character8;
64 const UChar* m_character16;
70 #endif // SVGPathStringSource_h