#ifndef GamepadEvent_h
#define GamepadEvent_h
#include "core/events/Event.h"
#include "modules/gamepad/Gamepad.h"
namespace WebCore {
struct GamepadEventInit : public EventInit {
GamepadEventInit();
RefPtrWillBeMember<Gamepad> gamepad;
};
class GamepadEvent FINAL : public Event {
public:
static PassRefPtrWillBeRawPtr<GamepadEvent> create()
{
return adoptRefWillBeNoop(new GamepadEvent);
}
static PassRefPtrWillBeRawPtr<GamepadEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Gamepad> gamepad)
{
return adoptRefWillBeNoop(new GamepadEvent(type, canBubble, cancelable, gamepad));
}
static PassRefPtrWillBeRawPtr<GamepadEvent> create(const AtomicString& type, const GamepadEventInit& initializer)
{
return adoptRefWillBeNoop(new GamepadEvent(type, initializer));
}
virtual ~GamepadEvent();
Gamepad* gamepad() const { return m_gamepad.get(); }
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual void trace(Visitor*) OVERRIDE;
private:
GamepadEvent();
GamepadEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Gamepad>);
GamepadEvent(const AtomicString&, const GamepadEventInit&);
RefPtrWillBeMember<Gamepad> m_gamepad;
};
}
#endif