#ifndef SVGBoolean_h
#define SVGBoolean_h
#include "core/svg/properties/SVGProperty.h"
namespace WebCore {
class SVGBoolean : public SVGPropertyBase {
public:
typedef void TearOffType;
typedef bool PrimitiveType;
static PassRefPtr<SVGBoolean> create(bool value = false)
{
return adoptRef(new SVGBoolean(value));
}
PassRefPtr<SVGBoolean> clone() const { return create(m_value); }
virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String&) const OVERRIDE;
virtual String valueAsString() const OVERRIDE;
void setValueAsString(const String&, ExceptionState&);
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;
bool operator==(const SVGBoolean& other) const { return m_value == other.m_value; }
bool operator!=(const SVGBoolean& other) const { return !operator==(other); }
bool value() const { return m_value; }
void setValue(bool value) { m_value = value; }
static AnimatedPropertyType classType() { return AnimatedBoolean; }
private:
SVGBoolean(bool value)
: SVGPropertyBase(classType())
, m_value(value)
{
}
bool m_value;
};
inline PassRefPtr<SVGBoolean> toSVGBoolean(PassRefPtr<SVGPropertyBase> passBase)
{
RefPtr<SVGPropertyBase> base = passBase;
ASSERT(base->type() == SVGBoolean::classType());
return static_pointer_cast<SVGBoolean>(base.release());
}
}
#endif