1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_gamepad_GamepadHapticActuator_h
8 #define mozilla_dom_gamepad_GamepadHapticActuator_h
11 #include "nsWrapperCache.h"
12 #include "mozilla/dom/GamepadHapticActuatorBinding.h"
13 #include "mozilla/dom/Gamepad.h"
14 #include "mozilla/dom/GamepadHandle.h"
16 namespace mozilla::dom
{
19 class GamepadHapticActuator
: public nsISupports
, public nsWrapperCache
{
21 GamepadHapticActuator(nsISupports
* aParent
, GamepadHandle aGamepadHandle
,
24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GamepadHapticActuator
)
27 nsISupports
* GetParentObject() const;
29 virtual JSObject
* WrapObject(JSContext
* aCx
,
30 JS::Handle
<JSObject
*> aGivenProto
) override
;
32 already_AddRefed
<Promise
> Pulse(double aValue
, double aDuration
,
35 GamepadHapticActuatorType
Type() const;
37 void Set(const GamepadHapticActuator
* aOther
);
40 virtual ~GamepadHapticActuator() = default;
43 nsCOMPtr
<nsISupports
> mParent
;
44 GamepadHandle mGamepadHandle
;
45 GamepadHapticActuatorType mType
;
49 } // namespace mozilla::dom
51 #endif // mozilla_dom_gamepad_GamepadHapticActuator_h