GamepadEventChannelParent.h (2032B)
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 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #include "mozilla/dom/PGamepadEventChannelParent.h" 7 8 #ifndef mozilla_dom_GamepadEventChannelParent_h_ 9 # define mozilla_dom_GamepadEventChannelParent_h_ 10 11 namespace mozilla::dom { 12 13 class GamepadEventChannelParent final : public PGamepadEventChannelParent { 14 public: 15 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GamepadEventChannelParent, override) 16 17 static already_AddRefed<GamepadEventChannelParent> Create(); 18 void ActorDestroy(ActorDestroyReason aWhy) override; 19 20 mozilla::ipc::IPCResult RecvVibrateHaptic( 21 const Tainted<GamepadHandle>& aHandle, 22 const Tainted<uint32_t>& aHapticIndex, const Tainted<double>& aIntensity, 23 const Tainted<double>& aDuration, const uint32_t& aPromiseID); 24 mozilla::ipc::IPCResult RecvStopVibrateHaptic( 25 const Tainted<GamepadHandle>& aHandle); 26 mozilla::ipc::IPCResult RecvLightIndicatorColor( 27 const Tainted<GamepadHandle>& aHandle, 28 const Tainted<uint32_t>& aLightColorIndex, const uint8_t& aRed, 29 const uint8_t& aGreen, const uint8_t& aBlue, const uint32_t& aPromiseID); 30 void DispatchUpdateEvent(const GamepadChangeEvent& aEvent); 31 32 mozilla::ipc::IPCResult RecvRequestAllGamepads( 33 RequestAllGamepadsResolver&& aResolver); 34 35 GamepadEventChannelParent(const GamepadEventChannelParent&) = delete; 36 GamepadEventChannelParent(GamepadEventChannelParent&&) = delete; 37 GamepadEventChannelParent& operator=(const GamepadEventChannelParent&) = 38 delete; 39 GamepadEventChannelParent& operator=(GamepadEventChannelParent&&) = delete; 40 41 private: 42 GamepadEventChannelParent(); 43 ~GamepadEventChannelParent() = default; 44 45 bool mIsShutdown; 46 nsCOMPtr<nsIEventTarget> mBackgroundEventTarget; 47 }; 48 49 } // namespace mozilla::dom 50 51 #endif