OLD | NEW |
1 // Copyright (c) 2011 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_AURA_EVENT_FILTER_H_ | 5 #ifndef UI_AURA_EVENT_FILTER_H_ |
6 #define UI_AURA_EVENT_FILTER_H_ | 6 #define UI_AURA_EVENT_FILTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
11 #include "ui/base/events.h" | 11 #include "ui/base/events.h" |
12 | 12 |
13 namespace aura { | 13 namespace aura { |
14 | 14 |
| 15 class GestureEvent; |
15 class KeyEvent; | 16 class KeyEvent; |
16 class MouseEvent; | 17 class MouseEvent; |
17 class TouchEvent; | 18 class TouchEvent; |
18 class Window; | 19 class Window; |
19 | 20 |
20 // An object that filters events sent to an owner window. The filter can stop | 21 // An object that filters events sent to an owner window. The filter can stop |
21 // further processing of events. | 22 // further processing of events. |
22 // | 23 // |
23 // When the Desktop receives an event, it determines the "target window" for | 24 // When the Desktop receives an event, it determines the "target window" for |
24 // the event, this is typically the visible window whose bounds most tightly | 25 // the event, this is typically the visible window whose bounds most tightly |
(...skipping 21 matching lines...) Expand all Loading... |
46 // that further processing can occur. | 47 // that further processing can occur. |
47 | 48 |
48 virtual bool PreHandleKeyEvent(Window* target, KeyEvent* event) = 0; | 49 virtual bool PreHandleKeyEvent(Window* target, KeyEvent* event) = 0; |
49 virtual bool PreHandleMouseEvent(Window* target, MouseEvent* event) = 0; | 50 virtual bool PreHandleMouseEvent(Window* target, MouseEvent* event) = 0; |
50 | 51 |
51 // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is | 52 // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is |
52 // consumed. | 53 // consumed. |
53 virtual ui::TouchStatus PreHandleTouchEvent(Window* target, | 54 virtual ui::TouchStatus PreHandleTouchEvent(Window* target, |
54 TouchEvent* event) = 0; | 55 TouchEvent* event) = 0; |
55 | 56 |
| 57 // Returns a value other than ui::GESTURE_STATUS_UNKNOWN if the gesture is |
| 58 // consumed. |
| 59 virtual ui::GestureStatus PreHandleGestureEvent(Window* target, |
| 60 GestureEvent* event) = 0; |
| 61 |
56 protected: | 62 protected: |
57 Window* owner() { return owner_; } | 63 Window* owner() { return owner_; } |
58 | 64 |
59 private: | 65 private: |
60 Window* owner_; | 66 Window* owner_; |
61 | 67 |
62 DISALLOW_COPY_AND_ASSIGN(EventFilter); | 68 DISALLOW_COPY_AND_ASSIGN(EventFilter); |
63 }; | 69 }; |
64 | 70 |
65 } // namespace aura | 71 } // namespace aura |
66 | 72 |
67 #endif // UI_AURA_EVENT_FILTER_H_ | 73 #endif // UI_AURA_EVENT_FILTER_H_ |
OLD | NEW |