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 29 matching lines...) Expand all Loading... | |
40 BUTTON_FORWARD = 1 << 4, | 40 BUTTON_FORWARD = 1 << 4, |
41 }; | 41 }; |
42 | 42 |
43 // The implementer promises that |GetPointerId()| will never exceed | 43 // The implementer promises that |GetPointerId()| will never exceed |
44 // MAX_POINTER_ID. | 44 // MAX_POINTER_ID. |
45 enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 16 }; | 45 enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 16 }; |
46 | 46 |
47 virtual ~MotionEvent() {} | 47 virtual ~MotionEvent() {} |
48 | 48 |
49 virtual int GetId() const = 0; | 49 virtual int GetId() const = 0; |
50 virtual uint32 GetUniqueId() const = 0; | |
jdduke (slow)
2015/03/13 21:48:27
I don't think we want both an id and a unique id..
tdresser
2015/03/16 12:24:12
We require the id to be stable across multiple eve
| |
50 virtual Action GetAction() const = 0; | 51 virtual Action GetAction() const = 0; |
51 // Only valid if |GetAction()| returns ACTION_POINTER_UP or | 52 // Only valid if |GetAction()| returns ACTION_POINTER_UP or |
52 // ACTION_POINTER_DOWN. | 53 // ACTION_POINTER_DOWN. |
53 virtual int GetActionIndex() const = 0; | 54 virtual int GetActionIndex() const = 0; |
54 virtual size_t GetPointerCount() const = 0; | 55 virtual size_t GetPointerCount() const = 0; |
55 virtual int GetPointerId(size_t pointer_index) const = 0; | 56 virtual int GetPointerId(size_t pointer_index) const = 0; |
56 virtual float GetX(size_t pointer_index) const = 0; | 57 virtual float GetX(size_t pointer_index) const = 0; |
57 virtual float GetY(size_t pointer_index) const = 0; | 58 virtual float GetY(size_t pointer_index) const = 0; |
58 virtual float GetRawX(size_t pointer_index) const = 0; | 59 virtual float GetRawX(size_t pointer_index) const = 0; |
59 virtual float GetRawY(size_t pointer_index) const = 0; | 60 virtual float GetRawY(size_t pointer_index) const = 0; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 // They guarantee only that the returned type will reflect the same | 105 // They guarantee only that the returned type will reflect the same |
105 // data exposed by the MotionEvent interface; no guarantees are made that the | 106 // data exposed by the MotionEvent interface; no guarantees are made that the |
106 // underlying implementation is identical to the source implementation. | 107 // underlying implementation is identical to the source implementation. |
107 scoped_ptr<MotionEvent> Clone() const; | 108 scoped_ptr<MotionEvent> Clone() const; |
108 scoped_ptr<MotionEvent> Cancel() const; | 109 scoped_ptr<MotionEvent> Cancel() const; |
109 }; | 110 }; |
110 | 111 |
111 } // namespace ui | 112 } // namespace ui |
112 | 113 |
113 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 114 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
OLD | NEW |