DeviceOrientationEvent.h [plain text]
#pragma once
#include "DeviceOrientationOrMotionEvent.h"
#include "Event.h"
namespace WebCore {
class DeviceOrientationData;
class DeviceOrientationEvent final : public Event, public DeviceOrientationOrMotionEvent {
WTF_MAKE_ISO_ALLOCATED(DeviceOrientationEvent);
public:
static Ref<DeviceOrientationEvent> create(const AtomString& eventType, DeviceOrientationData* orientation)
{
return adoptRef(*new DeviceOrientationEvent(eventType, orientation));
}
static Ref<DeviceOrientationEvent> createForBindings()
{
return adoptRef(*new DeviceOrientationEvent);
}
virtual ~DeviceOrientationEvent();
Optional<double> alpha() const;
Optional<double> beta() const;
Optional<double> gamma() const;
#if PLATFORM(IOS_FAMILY)
Optional<double> compassHeading() const;
Optional<double> compassAccuracy() const;
void initDeviceOrientationEvent(const AtomString& type, bool bubbles, bool cancelable, Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy);
#else
Optional<bool> absolute() const;
void initDeviceOrientationEvent(const AtomString& type, bool bubbles, bool cancelable, Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute);
#endif
private:
DeviceOrientationEvent();
DeviceOrientationEvent(const AtomString& eventType, DeviceOrientationData*);
EventInterface eventInterface() const override;
RefPtr<DeviceOrientationData> m_orientation;
};
}