3
0

InputChannelGesture.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzFramework/Input/Channels/InputChannel.h>
  10. ////////////////////////////////////////////////////////////////////////////////////////////////////
  11. namespace Gestures
  12. {
  13. ////////////////////////////////////////////////////////////////////////////////////////////////
  14. //! Base class for all gesture related input channels
  15. class InputChannelGesture : public AzFramework::InputChannel
  16. {
  17. public:
  18. ////////////////////////////////////////////////////////////////////////////////////////////
  19. //! Base class for gesture types that are exposed to the editor
  20. struct Type
  21. {
  22. ////////////////////////////////////////////////////////////////////////////////////////
  23. // Allocator
  24. AZ_CLASS_ALLOCATOR(Type, AZ::SystemAllocator);
  25. ////////////////////////////////////////////////////////////////////////////////////////
  26. // Type Info
  27. AZ_RTTI(Type, "{DA483C43-3CAC-4F27-97FD-4024C41E50B1}");
  28. ////////////////////////////////////////////////////////////////////////////////////////
  29. // Reflection
  30. static void Reflect(AZ::ReflectContext* context);
  31. ////////////////////////////////////////////////////////////////////////////////////////////
  32. //! Destructor
  33. virtual ~Type() = default;
  34. ////////////////////////////////////////////////////////////////////////////////////////
  35. //! Override to create the relevant gesture input channel
  36. //! \param[in] inputChannelId Id of the input channel to be created
  37. //! \param[in] inputDevice Input device that owns the input channel
  38. virtual InputChannelGesture* CreateInputChannel(const AzFramework::InputChannelId& channelId,
  39. const AzFramework::InputDevice& inputDevice) = 0;
  40. };
  41. ////////////////////////////////////////////////////////////////////////////////////////////
  42. // Allocator
  43. AZ_CLASS_ALLOCATOR(InputChannelGesture, AZ::SystemAllocator);
  44. ////////////////////////////////////////////////////////////////////////////////////////////
  45. // Type Info
  46. AZ_RTTI(InputChannelGesture, "{A26F1958-7AF7-48AB-87AA-12AD76088BCA}", InputChannel);
  47. ////////////////////////////////////////////////////////////////////////////////////////////
  48. //! Constructor
  49. //! \param[in] inputChannelId Id of the input channel being constructed
  50. //! \param[in] inputDevice Input device that owns the input channel
  51. explicit InputChannelGesture(const AzFramework::InputChannelId& inputChannelId,
  52. const AzFramework::InputDevice& inputDevice)
  53. : AzFramework::InputChannel(inputChannelId, inputDevice) {}
  54. ////////////////////////////////////////////////////////////////////////////////////////////
  55. // Disable copying
  56. AZ_DISABLE_COPY_MOVE(InputChannelGesture);
  57. ////////////////////////////////////////////////////////////////////////////////////////////
  58. //! Default destructor
  59. ~InputChannelGesture() override = default;
  60. };
  61. } // namespace Gestures