#ifndef SVGString_h
#define SVGString_h
#include "core/svg/properties/SVGProperty.h"
namespace WebCore {
class SVGString : public SVGPropertyBase {
public:
typedef void TearOffType;
typedef String PrimitiveType;
static PassRefPtr<SVGString> create()
{
return adoptRef(new SVGString());
}
static PassRefPtr<SVGString> create(const String& value)
{
return adoptRef(new SVGString(value));
}
PassRefPtr<SVGString> clone() const { return create(m_value); }
virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String& value) const OVERRIDE
{
return create(value);
}
virtual String valueAsString() const OVERRIDE { return m_value; }
void setValueAsString(const String& value, ExceptionState&) { m_value = value; }
virtual void add(PassRefPtr<SVGPropertyBase>, SVGElement*) OVERRIDE;
virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBase> to, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement*) OVERRIDE;
virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*) OVERRIDE;
const String& value() const { return m_value; }
void setValue(const String& value) { m_value = value; }
static AnimatedPropertyType classType() { return AnimatedString; }
private:
SVGString()
: SVGPropertyBase(classType())
{
}
explicit SVGString(const String& value)
: SVGPropertyBase(classType())
, m_value(value)
{
}
String m_value;
};
inline PassRefPtr<SVGString> toSVGString(PassRefPtr<SVGPropertyBase> passBase)
{
RefPtr<SVGPropertyBase> base = passBase;
ASSERT(base->type() == SVGString::classType());
return static_pointer_cast<SVGString>(base.release());
}
}
#endif