#ifndef SVGMarkerElement_h
#define SVGMarkerElement_h
#include "bindings/v8/ExceptionState.h"
#include "core/svg/SVGAnimatedAngle.h"
#include "core/svg/SVGAnimatedBoolean.h"
#include "core/svg/SVGAnimatedEnumeration.h"
#include "core/svg/SVGAnimatedLength.h"
#include "core/svg/SVGElement.h"
#include "core/svg/SVGFitToViewBox.h"
namespace WebCore {
enum SVGMarkerUnitsType {
SVGMarkerUnitsUnknown = 0,
SVGMarkerUnitsUserSpaceOnUse,
SVGMarkerUnitsStrokeWidth
};
template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerUnitsType>();
class SVGMarkerElement FINAL : public SVGElement,
public SVGFitToViewBox {
public:
enum {
SVG_MARKERUNITS_UNKNOWN = SVGMarkerUnitsUnknown,
SVG_MARKERUNITS_USERSPACEONUSE = SVGMarkerUnitsUserSpaceOnUse,
SVG_MARKERUNITS_STROKEWIDTH = SVGMarkerUnitsStrokeWidth
};
enum {
SVG_MARKER_ORIENT_UNKNOWN = SVGMarkerOrientUnknown,
SVG_MARKER_ORIENT_AUTO = SVGMarkerOrientAuto,
SVG_MARKER_ORIENT_ANGLE = SVGMarkerOrientAngle
};
static PassRefPtr<SVGMarkerElement> create(Document&);
AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const;
void setOrientToAuto();
void setOrientToAngle(PassRefPtr<SVGAngleTearOff>);
SVGAnimatedLength* refX() const { return m_refX.get(); }
SVGAnimatedLength* refY() const { return m_refY.get(); }
SVGAnimatedLength* markerWidth() const { return m_markerWidth.get(); }
SVGAnimatedLength* markerHeight() const { return m_markerHeight.get(); }
SVGAnimatedEnumeration<SVGMarkerUnitsType>* markerUnits() { return m_markerUnits.get(); }
SVGAnimatedAngle* orientAngle() { return m_orientAngle.get(); }
SVGAnimatedEnumeration<SVGMarkerOrientType>* orientType() { return m_orientAngle->orientType(); }
private:
explicit SVGMarkerElement(Document&);
virtual bool needsPendingResourceHandling() const OVERRIDE { return false; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return true; }
virtual bool selfHasRelativeLengths() const OVERRIDE;
RefPtr<SVGAnimatedLength> m_refX;
RefPtr<SVGAnimatedLength> m_refY;
RefPtr<SVGAnimatedLength> m_markerWidth;
RefPtr<SVGAnimatedLength> m_markerHeight;
RefPtr<SVGAnimatedAngle> m_orientAngle;
RefPtr<SVGAnimatedEnumeration<SVGMarkerUnitsType> > m_markerUnits;
};
}
#endif