#ifndef SVGPathTraversalStateBuilder_h
#define SVGPathTraversalStateBuilder_h
#include "core/svg/SVGPathConsumer.h"
#include "core/svg/SVGPoint.h"
namespace WebCore {
class PathTraversalState;
class SVGPathTraversalStateBuilder FINAL : public SVGPathConsumer {
public:
SVGPathTraversalStateBuilder();
unsigned pathSegmentIndex();
float totalLength();
FloatPoint currentPoint();
void setCurrentTraversalState(PathTraversalState* traversalState) { m_traversalState = traversalState; }
void setDesiredLength(float);
virtual void incrementPathSegmentCount() OVERRIDE;
virtual bool continueConsuming() OVERRIDE;
virtual void cleanup() OVERRIDE { m_traversalState = 0; }
private:
virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) OVERRIDE;
virtual void lineTo(const FloatPoint&, PathCoordinateMode) OVERRIDE;
virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) OVERRIDE;
virtual void closePath() OVERRIDE;
private:
virtual void lineToHorizontal(float, PathCoordinateMode) OVERRIDE { ASSERT_NOT_REACHED(); }
virtual void lineToVertical(float, PathCoordinateMode) OVERRIDE { ASSERT_NOT_REACHED(); }
virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) OVERRIDE { ASSERT_NOT_REACHED(); }
virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) OVERRIDE { ASSERT_NOT_REACHED(); }
virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) OVERRIDE { ASSERT_NOT_REACHED(); }
virtual void arcTo(float, float, float, bool, bool, const FloatPoint&, PathCoordinateMode) OVERRIDE { ASSERT_NOT_REACHED(); }
PathTraversalState* m_traversalState;
};
}
#endif