| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "ui/events/gesture_detection/gesture_detection_export.h" | 14 #include "ui/events/gesture_detection/gesture_detection_export.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 // Abstract class for a generic motion-related event, patterned after that | 18 // Abstract class for a generic motion-related event, patterned after that |
| 19 // subset of Android's MotionEvent API used in gesture detection. | 19 // subset of Android's MotionEvent API used in gesture detection. |
| 20 class GESTURE_DETECTION_EXPORT MotionEvent { | 20 class GESTURE_DETECTION_EXPORT MotionEvent { |
| 21 public: | 21 public: |
| 22 enum Action { | 22 enum Action { |
| 23 ACTION_NONE, | 23 ACTION_NONE, |
| 24 ACTION_DOWN, | 24 ACTION_DOWN, |
| 25 ACTION_UP, | 25 ACTION_UP, |
| 26 ACTION_MOVE, | 26 ACTION_MOVE, |
| 27 ACTION_CANCEL, | 27 ACTION_CANCEL, |
| 28 ACTION_POINTER_DOWN, | 28 ACTION_POINTER_DOWN, |
| 29 ACTION_POINTER_UP, | 29 ACTION_POINTER_UP, |
| 30 ACTION_HOVER_ENTER, |
| 31 ACTION_HOVER_EXIT, |
| 32 ACTION_HOVER_MOVE, |
| 33 ACTION_BUTTON_PRESS, |
| 34 ACTION_BUTTON_RELEASE |
| 30 }; | 35 }; |
| 31 | 36 |
| 32 enum ToolType { | 37 enum ToolType { |
| 33 TOOL_TYPE_UNKNOWN, | 38 TOOL_TYPE_UNKNOWN, |
| 34 TOOL_TYPE_FINGER, | 39 TOOL_TYPE_FINGER, |
| 35 TOOL_TYPE_STYLUS, | 40 TOOL_TYPE_STYLUS, |
| 36 TOOL_TYPE_MOUSE, | 41 TOOL_TYPE_MOUSE, |
| 37 TOOL_TYPE_ERASER | 42 TOOL_TYPE_ERASER |
| 38 }; | 43 }; |
| 39 | 44 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // They guarantee only that the returned type will reflect the same | 123 // They guarantee only that the returned type will reflect the same |
| 119 // data exposed by the MotionEvent interface; no guarantees are made that the | 124 // data exposed by the MotionEvent interface; no guarantees are made that the |
| 120 // underlying implementation is identical to the source implementation. | 125 // underlying implementation is identical to the source implementation. |
| 121 std::unique_ptr<MotionEvent> Clone() const; | 126 std::unique_ptr<MotionEvent> Clone() const; |
| 122 std::unique_ptr<MotionEvent> Cancel() const; | 127 std::unique_ptr<MotionEvent> Cancel() const; |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 } // namespace ui | 130 } // namespace ui |
| 126 | 131 |
| 127 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 132 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| OLD | NEW |