tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GamepadHapticActuator.h (1615B)


      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/. */
      6 
      7 #ifndef mozilla_dom_gamepad_GamepadHapticActuator_h
      8 #define mozilla_dom_gamepad_GamepadHapticActuator_h
      9 
     10 #include "mozilla/dom/Gamepad.h"
     11 #include "mozilla/dom/GamepadHandle.h"
     12 #include "mozilla/dom/GamepadHapticActuatorBinding.h"
     13 #include "nsCOMPtr.h"
     14 #include "nsWrapperCache.h"
     15 
     16 namespace mozilla::dom {
     17 class Promise;
     18 
     19 class GamepadHapticActuator : public nsISupports, public nsWrapperCache {
     20 public:
     21  GamepadHapticActuator(nsISupports* aParent, GamepadHandle aGamepadHandle,
     22                        uint32_t aIndex);
     23 
     24  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     25  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GamepadHapticActuator)
     26 
     27  nsISupports* GetParentObject() const;
     28 
     29  virtual JSObject* WrapObject(JSContext* aCx,
     30                               JS::Handle<JSObject*> aGivenProto) override;
     31 
     32  already_AddRefed<Promise> Pulse(double aValue, double aDuration,
     33                                  ErrorResult& aRv);
     34 
     35  GamepadHapticActuatorType Type() const;
     36 
     37  void Set(const GamepadHapticActuator* aOther);
     38 
     39 private:
     40  virtual ~GamepadHapticActuator() = default;
     41 
     42 protected:
     43  nsCOMPtr<nsISupports> mParent;
     44  GamepadHandle mGamepadHandle;
     45  GamepadHapticActuatorType mType;
     46  uint32_t mIndex;
     47 };
     48 
     49 }  // namespace mozilla::dom
     50 
     51 #endif  // mozilla_dom_gamepad_GamepadHapticActuator_h