TouchEventEmitter.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #include <react/components/view/TouchEvent.h>
  9. #include <react/core/EventEmitter.h>
  10. #include <react/core/LayoutMetrics.h>
  11. #include <react/core/ReactPrimitives.h>
  12. #include <react/debug/DebugStringConvertible.h>
  13. namespace facebook {
  14. namespace react {
  15. class TouchEventEmitter;
  16. using SharedTouchEventEmitter = std::shared_ptr<TouchEventEmitter const>;
  17. class TouchEventEmitter : public EventEmitter {
  18. public:
  19. using EventEmitter::EventEmitter;
  20. void onTouchStart(TouchEvent const &event) const;
  21. void onTouchMove(TouchEvent const &event) const;
  22. void onTouchEnd(TouchEvent const &event) const;
  23. void onTouchCancel(TouchEvent const &event) const;
  24. private:
  25. void dispatchTouchEvent(
  26. std::string const &type,
  27. TouchEvent const &event,
  28. EventPriority const &priority) const;
  29. };
  30. } // namespace react
  31. } // namespace facebook