Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: ui/aura/event_filter.h

Issue 10827145: Convert Aura to use ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/event.cc ('k') | ui/aura/event_filter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "ui/aura/aura_export.h" 9 #include "ui/aura/aura_export.h"
10 #include "ui/base/events.h" 10 #include "ui/base/events.h"
11 11
12 namespace ui {
13 class GestureEventImpl;
14 class KeyEvent;
15 class MouseEvent;
16 class TouchEventImpl;
17 }
18
12 namespace aura { 19 namespace aura {
13 20
14 class GestureEvent;
15 class KeyEvent;
16 class MouseEvent;
17 class TouchEvent;
18 class Window; 21 class Window;
19 22
20 // An object that filters events sent to an owner window. The filter can stop 23 // An object that filters events sent to an owner window. The filter can stop
21 // further processing of events. 24 // further processing of events.
22 // 25 //
23 // When the Desktop receives an event, it determines the "target window" for 26 // 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 27 // the event, this is typically the visible window whose bounds most tightly
25 // enclose the event coordinates, in the case of mouse events, or the focused 28 // enclose the event coordinates, in the case of mouse events, or the focused
26 // window, in the case of key events. 29 // window, in the case of key events.
27 // 30 //
28 // The Desktop then walks up the hierarchy from the target to its own window, 31 // The Desktop then walks up the hierarchy from the target to its own window,
29 // collecting a list of EventFilters. This list is notified in reverse order 32 // collecting a list of EventFilters. This list is notified in reverse order
30 // (i.e. descending, from the Desktop's own event filter). Each filter gets a 33 // (i.e. descending, from the Desktop's own event filter). Each filter gets a
31 // chance to prevent further processing of the event and/or take other actions. 34 // chance to prevent further processing of the event and/or take other actions.
32 class AURA_EXPORT EventFilter { 35 class AURA_EXPORT EventFilter {
33 public: 36 public:
34 virtual ~EventFilter() {} 37 virtual ~EventFilter() {}
35 38
36 // Parameters: a |target| Window and the |event|. The target window is the 39 // Parameters: a |target| Window and the |event|. The target window is the
37 // window the event was targeted at. If |event| is a LocatedEvent, its 40 // window the event was targeted at. If |event| is a LocatedEvent, its
38 // coordinates are relative to |target|. 41 // coordinates are relative to |target|.
39 42
40 // For all PreHandle*() functions that return a bool, return true if the 43 // For all PreHandle*() functions that return a bool, return true if the
41 // filter consumes the event and further processing (by the target, for 44 // filter consumes the event and further processing (by the target, for
42 // example) is not performed. Return false if the filter does not consume the 45 // example) is not performed. Return false if the filter does not consume the
43 // event and further processing is performed. Note that in this case the 46 // event and further processing is performed. Note that in this case the
44 // filter may still perform some action, the return value simply indicates 47 // filter may still perform some action, the return value simply indicates
45 // that further processing can occur. 48 // that further processing can occur.
46 49
47 virtual bool PreHandleKeyEvent(Window* target, KeyEvent* event) = 0; 50 virtual bool PreHandleKeyEvent(Window* target, ui::KeyEvent* event) = 0;
48 virtual bool PreHandleMouseEvent(Window* target, MouseEvent* event) = 0; 51 virtual bool PreHandleMouseEvent(Window* target, ui::MouseEvent* event) = 0;
49 52
50 // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is 53 // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is
51 // consumed. 54 // consumed.
52 virtual ui::TouchStatus PreHandleTouchEvent(Window* target, 55 virtual ui::TouchStatus PreHandleTouchEvent(Window* target,
53 TouchEvent* event) = 0; 56 ui::TouchEventImpl* event) = 0;
54 57
55 // Returns a value other than ui::GESTURE_STATUS_UNKNOWN if the gesture is 58 // Returns a value other than ui::GESTURE_STATUS_UNKNOWN if the gesture is
56 // consumed. 59 // consumed.
57 virtual ui::GestureStatus PreHandleGestureEvent(Window* target, 60 virtual ui::GestureStatus PreHandleGestureEvent(
58 GestureEvent* event) = 0; 61 Window* target,
62 ui::GestureEventImpl* event) = 0;
59 }; 63 };
60 64
61 } // namespace aura 65 } // namespace aura
62 66
63 #endif // UI_AURA_EVENT_FILTER_H_ 67 #endif // UI_AURA_EVENT_FILTER_H_
OLDNEW
« no previous file with comments | « ui/aura/event.cc ('k') | ui/aura/event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698