OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_EVENTS_EVENT_HANDLER_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_HANDLER_H_ |
6 #define UI_BASE_EVENTS_EVENT_HANDLER_H_ | 6 #define UI_BASE_EVENTS_EVENT_HANDLER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/base/events/event_constants.h" | 10 #include "ui/base/events/event_constants.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // ER_UNHANDLED for all events. | 25 // ER_UNHANDLED for all events. |
26 class UI_EXPORT EventHandler { | 26 class UI_EXPORT EventHandler { |
27 public: | 27 public: |
28 EventHandler(); | 28 EventHandler(); |
29 virtual ~EventHandler(); | 29 virtual ~EventHandler(); |
30 | 30 |
31 // This is called for all events. The default implementation routes the event | 31 // This is called for all events. The default implementation routes the event |
32 // to one of the event-specific callbacks (OnKeyEvent, OnMouseEvent etc.). If | 32 // to one of the event-specific callbacks (OnKeyEvent, OnMouseEvent etc.). If |
33 // this is overridden, then normally, the override should chain into the | 33 // this is overridden, then normally, the override should chain into the |
34 // default implementation for un-handled events. | 34 // default implementation for un-handled events. |
35 virtual EventResult OnEvent(Event* event); | 35 virtual void OnEvent(Event* event); |
36 | 36 |
37 virtual EventResult OnKeyEvent(KeyEvent* event); | 37 virtual EventResult OnKeyEvent(KeyEvent* event); |
38 | 38 |
39 virtual EventResult OnMouseEvent(MouseEvent* event); | 39 virtual EventResult OnMouseEvent(MouseEvent* event); |
40 | 40 |
41 virtual EventResult OnScrollEvent(ScrollEvent* event); | 41 virtual EventResult OnScrollEvent(ScrollEvent* event); |
42 | 42 |
43 virtual EventResult OnTouchEvent(TouchEvent* event); | 43 virtual EventResult OnTouchEvent(TouchEvent* event); |
44 | 44 |
45 virtual EventResult OnGestureEvent(GestureEvent* event); | 45 virtual EventResult OnGestureEvent(GestureEvent* event); |
46 }; | 46 }; |
47 | 47 |
48 typedef std::vector<EventHandler*> EventHandlerList; | 48 typedef std::vector<EventHandler*> EventHandlerList; |
49 | 49 |
50 } // namespace ui | 50 } // namespace ui |
51 | 51 |
52 #endif // UI_BASE_EVENTS_EVENT_HANDLER_H_ | 52 #endif // UI_BASE_EVENTS_EVENT_HANDLER_H_ |
OLD | NEW |