accessibility_event_rewriter_delegate.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_ACCESSIBILITY_EVENT_REWRITER_DELEGATE_H_
  5. #define ASH_PUBLIC_CPP_ACCESSIBILITY_EVENT_REWRITER_DELEGATE_H_
  6. #include <memory>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. #include "ui/gfx/geometry/point_f.h"
  9. namespace ui {
  10. class Event;
  11. }
  12. namespace ash {
  13. enum class SwitchAccessCommand;
  14. enum class MagnifierCommand;
  15. // Allows a client to implement event processing for accessibility features;
  16. // used for ChromeVox and Switch Access.
  17. class ASH_PUBLIC_EXPORT AccessibilityEventRewriterDelegate {
  18. public:
  19. // Used to send key events to the ChromeVox extension. |capture| is true if
  20. // the rewriter discarded the event, false if the rewriter continues event
  21. // propagation.
  22. virtual void DispatchKeyEventToChromeVox(std::unique_ptr<ui::Event> event,
  23. bool capture) = 0;
  24. // Used to send mouse events to accessibility component extensions.
  25. virtual void DispatchMouseEvent(std::unique_ptr<ui::Event> event) = 0;
  26. // Sends a command to Switch Access.
  27. virtual void SendSwitchAccessCommand(SwitchAccessCommand command) = 0;
  28. // Sends a point to Switch Access's Point Scan.
  29. virtual void SendPointScanPoint(const gfx::PointF& point) = 0;
  30. // Sends a command to Magnifier.
  31. virtual void SendMagnifierCommand(MagnifierCommand command) = 0;
  32. protected:
  33. virtual ~AccessibilityEventRewriterDelegate() {}
  34. };
  35. } // namespace ash
  36. #endif // ASH_PUBLIC_CPP_ACCESSIBILITY_EVENT_REWRITER_DELEGATE_H_