| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_EVENTS_H_ | 5 #ifndef UI_BASE_EVENTS_H_ |
| 6 #define UI_BASE_EVENTS_H_ | 6 #define UI_BASE_EVENTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
| 10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 ET_TOUCH_RELEASED, | 31 ET_TOUCH_RELEASED, |
| 32 ET_TOUCH_PRESSED, | 32 ET_TOUCH_PRESSED, |
| 33 ET_TOUCH_MOVED, | 33 ET_TOUCH_MOVED, |
| 34 ET_TOUCH_STATIONARY, | 34 ET_TOUCH_STATIONARY, |
| 35 ET_TOUCH_CANCELLED, | 35 ET_TOUCH_CANCELLED, |
| 36 ET_DROP_TARGET_EVENT, | 36 ET_DROP_TARGET_EVENT, |
| 37 ET_FOCUS_CHANGE, | 37 ET_FOCUS_CHANGE, |
| 38 ET_SCROLL, | 38 ET_SCROLL, |
| 39 ET_TRANSLATED_KEY_PRESS, | 39 ET_TRANSLATED_KEY_PRESS, |
| 40 ET_TRANSLATED_KEY_RELEASE, | 40 ET_TRANSLATED_KEY_RELEASE, |
| 41 |
| 42 // GestureEvent types |
| 43 ET_GESTURE_SCROLL_BEGIN, |
| 44 ET_GESTURE_SCROLL_END, |
| 45 ET_GESTURE_SCROLL_UPDATE, |
| 46 ET_GESTURE_TAP, |
| 47 ET_GESTURE_TAP_DOWN, |
| 48 ET_GESTURE_DOUBLE_TAP, |
| 41 }; | 49 }; |
| 42 | 50 |
| 43 // Event flags currently supported | 51 // Event flags currently supported |
| 44 enum EventFlags { | 52 enum EventFlags { |
| 45 EF_CAPS_LOCK_DOWN = 1 << 0, | 53 EF_CAPS_LOCK_DOWN = 1 << 0, |
| 46 EF_SHIFT_DOWN = 1 << 1, | 54 EF_SHIFT_DOWN = 1 << 1, |
| 47 EF_CONTROL_DOWN = 1 << 2, | 55 EF_CONTROL_DOWN = 1 << 2, |
| 48 EF_ALT_DOWN = 1 << 3, | 56 EF_ALT_DOWN = 1 << 3, |
| 49 EF_LEFT_MOUSE_BUTTON = 1 << 4, | 57 EF_LEFT_MOUSE_BUTTON = 1 << 4, |
| 50 EF_MIDDLE_MOUSE_BUTTON = 1 << 5, | 58 EF_MIDDLE_MOUSE_BUTTON = 1 << 5, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 69 TOUCH_STATUS_CANCEL, // The touch event was cancelled, but didn't | 77 TOUCH_STATUS_CANCEL, // The touch event was cancelled, but didn't |
| 70 // terminate the touch sequence. | 78 // terminate the touch sequence. |
| 71 TOUCH_STATUS_SYNTH_MOUSE // The touch event was not processed, but a | 79 TOUCH_STATUS_SYNTH_MOUSE // The touch event was not processed, but a |
| 72 // synthetic mouse event generated from the | 80 // synthetic mouse event generated from the |
| 73 // unused touch event was handled. | 81 // unused touch event was handled. |
| 74 }; | 82 }; |
| 75 | 83 |
| 76 // Updates the list of devices for cached properties. | 84 // Updates the list of devices for cached properties. |
| 77 UI_EXPORT void UpdateDeviceList(); | 85 UI_EXPORT void UpdateDeviceList(); |
| 78 | 86 |
| 87 enum GestureStatus { |
| 88 GESTURE_STATUS_UNKNOWN = 0, // Unknown Gesture status. This is used to |
| 89 // indicate that the Gesture event was not |
| 90 // handled. |
| 91 GESTURE_STATUS_CONSUMED, // The Gesture event got consumed. |
| 92 GESTURE_STATUS_SYNTH_MOUSE // The Gesture event was not processed, but a |
| 93 // synthetic mouse event generated from the |
| 94 // unused Gesture event was handled. |
| 95 }; |
| 96 |
| 79 // Get the EventType from a native event. | 97 // Get the EventType from a native event. |
| 80 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); | 98 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); |
| 81 | 99 |
| 82 // Get the EventFlags from a native event. | 100 // Get the EventFlags from a native event. |
| 83 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); | 101 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); |
| 84 | 102 |
| 85 // Get the location from a native event. The coordinate system of the resultant | 103 // Get the location from a native event. The coordinate system of the resultant |
| 86 // |Point| has the origin at top-left of the "root window". The nature of | 104 // |Point| has the origin at top-left of the "root window". The nature of |
| 87 // this "root window" and how it maps to platform-specific drawing surfaces is | 105 // this "root window" and how it maps to platform-specific drawing surfaces is |
| 88 // defined in ui/aura/root_window.* and ui/aura/root_window_host*. | 106 // defined in ui/aura/root_window.* and ui/aura/root_window_host*. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, | 143 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, |
| 126 float* x_offset, | 144 float* x_offset, |
| 127 float* y_offset); | 145 float* y_offset); |
| 128 | 146 |
| 129 // Creates and returns no-op event. | 147 // Creates and returns no-op event. |
| 130 UI_EXPORT base::NativeEvent CreateNoopEvent(); | 148 UI_EXPORT base::NativeEvent CreateNoopEvent(); |
| 131 | 149 |
| 132 } // namespace ui | 150 } // namespace ui |
| 133 | 151 |
| 134 #endif // UI_BASE_EVENTS_H_ | 152 #endif // UI_BASE_EVENTS_H_ |
| OLD | NEW |