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_AURA_GESTURES_GESTURE_POINT_H_ | 5 #ifndef UI_AURA_GESTURES_GESTURE_POINT_H_ |
6 #define UI_AURA_GESTURES_GESTURE_POINT_H_ | 6 #define UI_AURA_GESTURES_GESTURE_POINT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Updates states depending on the event and the gesture-state. | 39 // Updates states depending on the event and the gesture-state. |
40 void UpdateValues(const TouchEvent& event, GestureState state); | 40 void UpdateValues(const TouchEvent& event, GestureState state); |
41 | 41 |
42 // Responds according to the state of the gesture point (i.e. the point can | 42 // Responds according to the state of the gesture point (i.e. the point can |
43 // represent a click or scroll etc.) | 43 // represent a click or scroll etc.) |
44 bool IsInClickWindow(const TouchEvent& event) const; | 44 bool IsInClickWindow(const TouchEvent& event) const; |
45 bool IsInDoubleClickWindow(const TouchEvent& event) const; | 45 bool IsInDoubleClickWindow(const TouchEvent& event) const; |
46 bool IsInScrollWindow(const TouchEvent& event) const; | 46 bool IsInScrollWindow(const TouchEvent& event) const; |
47 bool IsInFlickWindow(const TouchEvent& event) const; | 47 bool IsInFlickWindow(const TouchEvent& event) const; |
| 48 bool DidScroll(const TouchEvent& event) const; |
48 | 49 |
49 const gfx::Point& first_touch_position() const { | 50 const gfx::Point& first_touch_position() const { |
50 return first_touch_position_; | 51 return first_touch_position_; |
51 } | 52 } |
52 | 53 |
53 double last_touch_time() const { return last_touch_time_; } | 54 double last_touch_time() const { return last_touch_time_; } |
54 const gfx::Point& last_touch_position() const { return last_touch_position_; } | 55 const gfx::Point& last_touch_position() const { return last_touch_position_; } |
55 | 56 |
56 double x_delta() const { | 57 double x_delta() const { |
57 return last_touch_position_.x() - first_touch_position_.x(); | 58 return last_touch_position_.x() - first_touch_position_.x(); |
(...skipping 24 matching lines...) Expand all Loading... |
82 | 83 |
83 float x_velocity_; | 84 float x_velocity_; |
84 float y_velocity_; | 85 float y_velocity_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(GesturePoint); | 87 DISALLOW_COPY_AND_ASSIGN(GesturePoint); |
87 }; | 88 }; |
88 | 89 |
89 } // namespace aura | 90 } // namespace aura |
90 | 91 |
91 #endif // UI_AURA_GESTURES_GESTURE_POINT_H_ | 92 #endif // UI_AURA_GESTURES_GESTURE_POINT_H_ |
OLD | NEW |