#if ENABLE(SVG)
#include "TimeScheduler.h"
#include "Timer.h"
#include <wtf/HashSet.h>
#include <wtf/HashMap.h>
namespace WebCore {
class SVGElement;
class SVGAnimationElement;
typedef HashSet<SVGAnimationElement*> SVGNotifySet;
class SVGTimer : private Timer<TimeScheduler>
{
public:
SVGTimer(TimeScheduler*, double interval, bool singleShot);
void start();
using Timer<TimeScheduler>::stop;
using Timer<TimeScheduler>::isActive;
void notifyAll();
void addNotify(SVGAnimationElement*, bool enabled = false);
void removeNotify(SVGAnimationElement*);
static SVGTimer* downcast(Timer<TimeScheduler>* t) { return static_cast<SVGTimer*>(t); }
private:
typedef HashMap<SVGElement*, Vector<SVGAnimationElement*> > TargetAnimationMap;
TargetAnimationMap animationsByElement(double elapsedTime);
void applyAnimations(double elapsedSeconds, const SVGTimer::TargetAnimationMap& targetMap);
TimeScheduler* m_scheduler;
double m_interval;
bool m_singleShot;
SVGNotifySet m_notifySet;
SVGNotifySet m_enabledNotifySet;
};
}
#endif // ENABLE(SVG)