#ifndef DeviceMotionEvent_h
#define DeviceMotionEvent_h
#include "core/events/Event.h"
#include "heap/Handle.h"
namespace WebCore {
class DeviceAcceleration;
class DeviceMotionData;
class DeviceRotationRate;
class DeviceMotionEvent FINAL : public Event {
public:
virtual ~DeviceMotionEvent();
static PassRefPtrWillBeRawPtr<DeviceMotionEvent> create()
{
return adoptRefWillBeNoop(new DeviceMotionEvent);
}
static PassRefPtrWillBeRawPtr<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
{
return adoptRefWillBeNoop(new DeviceMotionEvent(eventType, deviceMotionData));
}
void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData*);
DeviceMotionData* deviceMotionData() const { return m_deviceMotionData.get(); }
DeviceAcceleration* acceleration();
DeviceAcceleration* accelerationIncludingGravity();
DeviceRotationRate* rotationRate();
double interval(bool& isNull) const;
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual void trace(Visitor*) OVERRIDE;
private:
DeviceMotionEvent();
DeviceMotionEvent(const AtomicString& eventType, DeviceMotionData*);
RefPtrWillBeMember<DeviceMotionData> m_deviceMotionData;
RefPtrWillBeMember<DeviceAcceleration> m_acceleration;
RefPtrWillBeMember<DeviceAcceleration> m_accelerationIncludingGravity;
RefPtrWillBeMember<DeviceRotationRate> m_rotationRate;
};
DEFINE_TYPE_CASTS(DeviceMotionEvent, Event, event, event->interfaceName() == EventNames::DeviceMotionEvent, event.interfaceName() == EventNames::DeviceMotionEvent);
}
#endif