#ifndef AnimatableLengthBox_h
#define AnimatableLengthBox_h
#include "core/animation/AnimatableValue.h"
namespace WebCore {
class AnimatableLengthBox FINAL : public AnimatableValue {
public:
virtual ~AnimatableLengthBox() { }
static PassRefPtrWillBeRawPtr<AnimatableLengthBox> create(PassRefPtrWillBeRawPtr<AnimatableValue> left, PassRefPtrWillBeRawPtr<AnimatableValue> right, PassRefPtrWillBeRawPtr<AnimatableValue> top, PassRefPtrWillBeRawPtr<AnimatableValue> bottom)
{
return adoptRefWillBeNoop(new AnimatableLengthBox(left, right, top, bottom));
}
const AnimatableValue* left() const { return m_left.get(); }
const AnimatableValue* right() const { return m_right.get(); }
const AnimatableValue* top() const { return m_top.get(); }
const AnimatableValue* bottom() const { return m_bottom.get(); }
virtual void trace(Visitor*) OVERRIDE;
protected:
virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
virtual PassRefPtrWillBeRawPtr<AnimatableValue> addWith(const AnimatableValue*) const OVERRIDE;
private:
AnimatableLengthBox(PassRefPtrWillBeRawPtr<AnimatableValue> left, PassRefPtrWillBeRawPtr<AnimatableValue> right, PassRefPtrWillBeRawPtr<AnimatableValue> top, PassRefPtrWillBeRawPtr<AnimatableValue> bottom)
: m_left(left)
, m_right(right)
, m_top(top)
, m_bottom(bottom)
{
}
virtual AnimatableType type() const OVERRIDE { return TypeLengthBox; }
virtual bool equalTo(const AnimatableValue*) const OVERRIDE;
RefPtrWillBeMember<AnimatableValue> m_left;
RefPtrWillBeMember<AnimatableValue> m_right;
RefPtrWillBeMember<AnimatableValue> m_top;
RefPtrWillBeMember<AnimatableValue> m_bottom;
};
DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLengthBox, isLengthBox());
}
#endif