| 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_GESTURES_GESTURE_RECOGNIZER_H_ | 5 #ifndef UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ | 
| 6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ | 6 #define UI_BASE_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 14 matching lines...) Expand all  Loading... | 
| 25   virtual ~GestureRecognizer() {} | 25   virtual ~GestureRecognizer() {} | 
| 26 | 26 | 
| 27   // Invoked for each touch event that could contribute to the current gesture. | 27   // Invoked for each touch event that could contribute to the current gesture. | 
| 28   // Returns list of  zero or more GestureEvents identified after processing | 28   // Returns list of  zero or more GestureEvents identified after processing | 
| 29   // TouchEvent. | 29   // TouchEvent. | 
| 30   // Caller would be responsible for freeing up Gestures. | 30   // Caller would be responsible for freeing up Gestures. | 
| 31   virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event, | 31   virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event, | 
| 32                                                 ui::EventResult result, | 32                                                 ui::EventResult result, | 
| 33                                                 GestureConsumer* consumer) = 0; | 33                                                 GestureConsumer* consumer) = 0; | 
| 34 | 34 | 
| 35   // Touch-events can be queued to be played back at a later time. The queues | 35   virtual void CleanupStateForConsumer(GestureConsumer* consumer) = 0; | 
| 36   // are identified by the target window. |  | 
| 37   virtual void QueueTouchEventForGesture(GestureConsumer* consumer, |  | 
| 38                                          const TouchEvent& event) = 0; |  | 
| 39 |  | 
| 40   // Process the touch-event in the queue for the window. Returns a list of |  | 
| 41   // zero or more GestureEvents identified after processing the queueud |  | 
| 42   // TouchEvent. Caller is responsible for freeing up Gestures. |  | 
| 43   virtual Gestures* AdvanceTouchQueue(GestureConsumer* consumer, |  | 
| 44                                       bool processed) = 0; |  | 
| 45 |  | 
| 46   // Flushes the touch event queue (or removes the queue) for the window. |  | 
| 47   virtual void FlushTouchQueue(GestureConsumer* consumer) = 0; |  | 
| 48 | 36 | 
| 49   // Return the window which should handle this TouchEvent, in the case where | 37   // Return the window which should handle this TouchEvent, in the case where | 
| 50   // the touch is already associated with a target. | 38   // the touch is already associated with a target. | 
| 51   // Otherwise, returns null. | 39   // Otherwise, returns null. | 
| 52   virtual GestureConsumer* GetTouchLockedTarget(TouchEvent* event) = 0; | 40   virtual GestureConsumer* GetTouchLockedTarget(TouchEvent* event) = 0; | 
| 53 | 41 | 
| 54   // Return the window which should handle this GestureEvent. | 42   // Return the window which should handle this GestureEvent. | 
| 55   virtual GestureConsumer* GetTargetForGestureEvent(GestureEvent* event) = 0; | 43   virtual GestureConsumer* GetTargetForGestureEvent(GestureEvent* event) = 0; | 
| 56 | 44 | 
| 57   // If there is an active touch within | 45   // If there is an active touch within | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 68   // If a gesture is underway for |consumer| |point| is set to the last touch | 56   // If a gesture is underway for |consumer| |point| is set to the last touch | 
| 69   // point and true is returned. If no touch events have been processed for | 57   // point and true is returned. If no touch events have been processed for | 
| 70   // |consumer| false is returned and |point| is untouched. | 58   // |consumer| false is returned and |point| is untouched. | 
| 71   virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, | 59   virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, | 
| 72                                           gfx::Point* point) = 0; | 60                                           gfx::Point* point) = 0; | 
| 73 }; | 61 }; | 
| 74 | 62 | 
| 75 }  // namespace ui | 63 }  // namespace ui | 
| 76 | 64 | 
| 77 #endif  // UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ | 65 #endif  // UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ | 
| OLD | NEW | 
|---|