event_client.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2012 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 UI_AURA_CLIENT_EVENT_CLIENT_H_
  5. #define UI_AURA_CLIENT_EVENT_CLIENT_H_
  6. #include "ui/aura/aura_export.h"
  7. namespace ui {
  8. class EventTarget;
  9. }
  10. namespace aura {
  11. class Window;
  12. namespace client {
  13. // An interface implemented by an object that alters event processing.
  14. class AURA_EXPORT EventClient {
  15. public:
  16. // Returns true if events can be processed by |window| or any of its children.
  17. virtual bool GetCanProcessEventsWithinSubtree(const Window* window) const = 0;
  18. // Returns the top level EventTarget for the current environment.
  19. virtual ui::EventTarget* GetToplevelEventTarget() = 0;
  20. protected:
  21. virtual ~EventClient() {}
  22. };
  23. // Sets/Gets the event client on the root Window.
  24. AURA_EXPORT void SetEventClient(Window* root_window, EventClient* client);
  25. AURA_EXPORT EventClient* GetEventClient(const Window* root_window);
  26. } // namespace clients
  27. } // namespace aura
  28. #endif // UI_AURA_CLIENT_EVENT_CLIENT_H_