| 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 22 matching lines...) Expand all Loading... |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 enum ButtonType { | 35 enum ButtonType { |
| 36 BUTTON_PRIMARY = 1 << 0, | 36 BUTTON_PRIMARY = 1 << 0, |
| 37 BUTTON_SECONDARY = 1 << 1, | 37 BUTTON_SECONDARY = 1 << 1, |
| 38 BUTTON_TERTIARY = 1 << 2, | 38 BUTTON_TERTIARY = 1 << 2, |
| 39 BUTTON_BACK = 1 << 3, | 39 BUTTON_BACK = 1 << 3, |
| 40 BUTTON_FORWARD = 1 << 4, | 40 BUTTON_FORWARD = 1 << 4, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 // The implementer promises that |GetPointerId()| will never exceed this. | 43 // The implementer promises that |GetPointerId()| will never exceed |
| 44 enum { MAX_POINTER_ID = 31 }; | 44 // MAX_POINTER_ID. |
| 45 enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 12 }; |
| 45 | 46 |
| 46 virtual ~MotionEvent() {} | 47 virtual ~MotionEvent() {} |
| 47 | 48 |
| 48 virtual int GetId() const = 0; | 49 virtual int GetId() const = 0; |
| 49 virtual Action GetAction() const = 0; | 50 virtual Action GetAction() const = 0; |
| 50 // Only valid if |GetAction()| returns ACTION_POINTER_UP or | 51 // Only valid if |GetAction()| returns ACTION_POINTER_UP or |
| 51 // ACTION_POINTER_DOWN. | 52 // ACTION_POINTER_DOWN. |
| 52 virtual int GetActionIndex() const = 0; | 53 virtual int GetActionIndex() const = 0; |
| 53 virtual size_t GetPointerCount() const = 0; | 54 virtual size_t GetPointerCount() const = 0; |
| 54 virtual int GetPointerId(size_t pointer_index) const = 0; | 55 virtual int GetPointerId(size_t pointer_index) const = 0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 GESTURE_DETECTION_EXPORT bool operator==(const MotionEvent& lhs, | 94 GESTURE_DETECTION_EXPORT bool operator==(const MotionEvent& lhs, |
| 94 const MotionEvent& rhs); | 95 const MotionEvent& rhs); |
| 95 GESTURE_DETECTION_EXPORT bool operator!=(const MotionEvent& lhs, | 96 GESTURE_DETECTION_EXPORT bool operator!=(const MotionEvent& lhs, |
| 96 const MotionEvent& rhs); | 97 const MotionEvent& rhs); |
| 97 | 98 |
| 98 } // namespace ui | 99 } // namespace ui |
| 99 | 100 |
| 100 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 101 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| OLD | NEW |