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_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 5 #ifndef UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ |
6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 virtual ~GestureRecognizer() {} | 28 virtual ~GestureRecognizer() {} |
29 | 29 |
30 // Invoked before event dispatch. If the event is invalid given the current | 30 // Invoked before event dispatch. If the event is invalid given the current |
31 // touch sequence, returns false. | 31 // touch sequence, returns false. |
32 virtual bool ProcessTouchEventPreDispatch(TouchEvent* event, | 32 virtual bool ProcessTouchEventPreDispatch(TouchEvent* event, |
33 GestureConsumer* consumer) = 0; | 33 GestureConsumer* consumer) = 0; |
34 | 34 |
35 // Returns a list of zero or more GestureEvents. The caller is responsible for | 35 // Returns a list of zero or more GestureEvents. The caller is responsible for |
36 // freeing the returned events. Acks the first gesture packet in the queue. | 36 // freeing the returned events. Acks the first gesture packet in the queue. |
37 virtual Gestures* AckAsyncTouchEvent( | 37 virtual Gestures* AckAsyncTouchEvent(ui::EventResult result, |
38 const TouchEvent& event, | 38 GestureConsumer* consumer) = 0; |
39 ui::EventResult result, | |
40 GestureConsumer* consumer) = 0; | |
41 | 39 |
42 // Returns a list of zero or more GestureEvents. The caller is responsible for | 40 // Returns a list of zero or more GestureEvents. The caller is responsible for |
43 // freeing the returned events. Acks the last gesture packet in the queue. | 41 // freeing the returned events. Acks the last gesture packet in the queue. |
44 virtual Gestures* AckSyncTouchEvent(const uint64 unique_event_id, | 42 virtual Gestures* AckSyncTouchEvent(const uint64 unique_event_id, |
45 ui::EventResult result, | 43 ui::EventResult result, |
46 GestureConsumer* consumer) = 0; | 44 GestureConsumer* consumer) = 0; |
47 | 45 |
48 // This is called when the consumer is destroyed. So this should cleanup any | 46 // This is called when the consumer is destroyed. So this should cleanup any |
49 // internal state maintained for |consumer|. Returns true iff there was | 47 // internal state maintained for |consumer|. Returns true iff there was |
50 // state relating to |consumer| to clean up. | 48 // state relating to |consumer| to clean up. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 92 |
95 // Unsubscribes |helper| from async gesture dispatch. | 93 // Unsubscribes |helper| from async gesture dispatch. |
96 // Since the GestureRecognizer does not own the |helper|, it is not deleted | 94 // Since the GestureRecognizer does not own the |helper|, it is not deleted |
97 // and must be cleaned up appropriately by the caller. | 95 // and must be cleaned up appropriately by the caller. |
98 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) = 0; | 96 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) = 0; |
99 }; | 97 }; |
100 | 98 |
101 } // namespace ui | 99 } // namespace ui |
102 | 100 |
103 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 101 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ |
OLD | NEW |