seat_observer.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017 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 COMPONENTS_EXO_SEAT_OBSERVER_H_
  5. #define COMPONENTS_EXO_SEAT_OBSERVER_H_
  6. namespace aura {
  7. class Window;
  8. }
  9. namespace exo {
  10. class Pointer;
  11. class Surface;
  12. // Observers can listen to various events on the Seats.
  13. class SeatObserver {
  14. public:
  15. // Called when a new surface receives keyboard focus.
  16. virtual void OnSurfaceFocused(Surface* gained_focus,
  17. Surface* lost_focus,
  18. bool has_focused_client) = 0;
  19. // Called when a pointer is captured by the given window.
  20. virtual void OnPointerCaptureEnabled(Pointer* pointer,
  21. aura::Window* capture_window) {}
  22. // Called when the given pointer is no longer captured by the given window.
  23. virtual void OnPointerCaptureDisabled(Pointer* pointer,
  24. aura::Window* capture_window) {}
  25. // Called when the keyboard modifiers is updated.
  26. virtual void OnKeyboardModifierUpdated() {}
  27. protected:
  28. virtual ~SeatObserver() = default;
  29. };
  30. } // namespace exo
  31. #endif // COMPONENTS_EXO_SEAT_OBSERVER_H_