SVGAnimatedStaticPropertyTearOff.h [plain text]
#ifndef SVGAnimatedStaticPropertyTearOff_h
#define SVGAnimatedStaticPropertyTearOff_h
#if ENABLE(SVG)
#include "SVGAnimatedProperty.h"
namespace WebCore {
template<typename PropertyType>
class SVGAnimatedStaticPropertyTearOff : public SVGAnimatedProperty {
public:
PropertyType& baseVal()
{
return m_property;
}
PropertyType& animVal()
{
return m_property;
}
void setBaseVal(const PropertyType& property)
{
m_property = property;
commitChange();
}
void setAnimVal(const PropertyType&) { }
private:
friend class SVGAnimatedProperty;
static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
{
ASSERT(contextElement);
return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, property));
}
SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
: SVGAnimatedProperty(contextElement, attributeName)
, m_property(property)
{
}
private:
PropertyType& m_property;
};
}
#endif // ENABLE(SVG)
#endif // SVGAnimatedStaticPropertyTearOff_h