DeviceProximityEvent.h [plain text]
#ifndef DeviceProximityEvent_h
#define DeviceProximityEvent_h
#if ENABLE(PROXIMITY_EVENTS)
#include "Event.h"
namespace WebCore {
struct DeviceProximityEventInit : public EventInit {
DeviceProximityEventInit()
: value(std::numeric_limits<double>::infinity())
, min(-std::numeric_limits<double>::infinity())
, max(std::numeric_limits<double>::infinity())
{
bubbles = true;
};
double value;
double min;
double max;
};
class DeviceProximityEvent : public Event {
public:
~DeviceProximityEvent() { }
static PassRef<DeviceProximityEvent> create()
{
return adoptRef(*new DeviceProximityEvent());
}
static PassRef<DeviceProximityEvent> create(const AtomicString& eventType, const double value, const double min, const double max)
{
return adoptRef(*new DeviceProximityEvent(eventType, value, min, max));
}
static PassRef<DeviceProximityEvent> create(const AtomicString& type, const DeviceProximityEventInit& initializer)
{
return adoptRef(*new DeviceProximityEvent(type, initializer));
}
double value() { return m_value; }
double min() { return m_min; }
double max() { return m_max; }
virtual EventInterface eventInterface() const { return DeviceProximityEventInterfaceType; }
private:
DeviceProximityEvent();
DeviceProximityEvent(const AtomicString& eventType, const double value, const double min, const double max);
DeviceProximityEvent(const AtomicString& eventType, const DeviceProximityEventInit&);
double m_value;
double m_min;
double m_max;
};
}
#endif // DeviceProximityEvent_h
#endif // PROXIMITY_EVENTS