| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GESTURE_DETECTION_MOTION_EVENT_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| 6 #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/events/gesture_detection/gesture_detection_export.h" | 10 #include "ui/events/gesture_detection/gesture_detection_export.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 virtual ~MotionEvent() {} | 30 virtual ~MotionEvent() {} |
| 31 | 31 |
| 32 virtual Action GetAction() const = 0; | 32 virtual Action GetAction() const = 0; |
| 33 virtual int GetActionIndex() const = 0; | 33 virtual int GetActionIndex() const = 0; |
| 34 virtual size_t GetPointerCount() const = 0; | 34 virtual size_t GetPointerCount() const = 0; |
| 35 virtual int GetPointerId(size_t pointer_index) const = 0; | 35 virtual int GetPointerId(size_t pointer_index) const = 0; |
| 36 virtual float GetX(size_t pointer_index) const = 0; | 36 virtual float GetX(size_t pointer_index) const = 0; |
| 37 virtual float GetY(size_t pointer_index) const = 0; | 37 virtual float GetY(size_t pointer_index) const = 0; |
| 38 virtual float GetTouchMajor(size_t pointer_index) const = 0; | 38 virtual float GetTouchMajor(size_t pointer_index) const = 0; |
| 39 virtual float GetPressure(size_t pointer_index) const = 0; |
| 39 virtual base::TimeTicks GetEventTime() const = 0; | 40 virtual base::TimeTicks GetEventTime() const = 0; |
| 40 | 41 |
| 41 virtual size_t GetHistorySize() const = 0; | 42 virtual size_t GetHistorySize() const = 0; |
| 42 virtual base::TimeTicks GetHistoricalEventTime( | 43 virtual base::TimeTicks GetHistoricalEventTime( |
| 43 size_t historical_index) const = 0; | 44 size_t historical_index) const = 0; |
| 44 virtual float GetHistoricalTouchMajor(size_t pointer_index, | 45 virtual float GetHistoricalTouchMajor(size_t pointer_index, |
| 45 size_t historical_index) const = 0; | 46 size_t historical_index) const = 0; |
| 46 virtual float GetHistoricalX(size_t pointer_index, | 47 virtual float GetHistoricalX(size_t pointer_index, |
| 47 size_t historical_index) const = 0; | 48 size_t historical_index) const = 0; |
| 48 virtual float GetHistoricalY(size_t pointer_index, | 49 virtual float GetHistoricalY(size_t pointer_index, |
| 49 size_t historical_index) const = 0; | 50 size_t historical_index) const = 0; |
| 50 | 51 |
| 51 virtual scoped_ptr<MotionEvent> Clone() const = 0; | 52 virtual scoped_ptr<MotionEvent> Clone() const = 0; |
| 52 virtual scoped_ptr<MotionEvent> Cancel() const = 0; | 53 virtual scoped_ptr<MotionEvent> Cancel() const = 0; |
| 53 | 54 |
| 54 // Utility accessor methods for convenience. | 55 // Utility accessor methods for convenience. |
| 55 float GetX() const { return GetX(0); } | 56 float GetX() const { return GetX(0); } |
| 56 float GetY() const { return GetY(0); } | 57 float GetY() const { return GetY(0); } |
| 57 float GetRawX() const { return GetX(); } | 58 float GetRawX() const { return GetX(); } |
| 58 float GetRawY() const { return GetY(); } | 59 float GetRawY() const { return GetY(); } |
| 59 float GetTouchMajor() const { return GetTouchMajor(0); } | 60 float GetTouchMajor() const { return GetTouchMajor(0); } |
| 61 float GetPressure() const { return GetPressure(0); } |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 } // namespace ui | 64 } // namespace ui |
| 63 | 65 |
| 64 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 66 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| OLD | NEW |