| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EVENT_UTILS_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_UTILS_H_ |
| 6 #define UI_BASE_EVENTS_EVENT_UTILS_H_ | 6 #define UI_BASE_EVENTS_EVENT_UTILS_H_ |
| 7 | 7 |
| 8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
| 9 #include "ui/base/events/event_constants.h" | 9 #include "ui/base/events/event_constants.h" |
| 10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); | 86 UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); |
| 87 | 87 |
| 88 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. | 88 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. |
| 89 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); | 89 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); |
| 90 | 90 |
| 91 // Gets the fling velocity from a native event. is_cancel is set to true if | 91 // Gets the fling velocity from a native event. is_cancel is set to true if |
| 92 // this was a tap down, intended to stop an ongoing fling. | 92 // this was a tap down, intended to stop an ongoing fling. |
| 93 UI_EXPORT bool GetFlingData(const base::NativeEvent& native_event, | 93 UI_EXPORT bool GetFlingData(const base::NativeEvent& native_event, |
| 94 float* vx, | 94 float* vx, |
| 95 float* vy, | 95 float* vy, |
| 96 float* vx_ordinal, |
| 97 float* vy_ordinal, |
| 96 bool* is_cancel); | 98 bool* is_cancel); |
| 97 | 99 |
| 98 // Returns whether this is a scroll event and optionally gets the amount to be | 100 // Returns whether this is a scroll event and optionally gets the amount to be |
| 99 // scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL. | 101 // scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL. |
| 100 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, | 102 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, |
| 101 float* x_offset, | 103 float* x_offset, |
| 102 float* y_offset, | 104 float* y_offset, |
| 105 float* x_offset_ordinal, |
| 106 float* y_offset_ordinal, |
| 103 int* finger_count); | 107 int* finger_count); |
| 104 | 108 |
| 105 UI_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, | 109 UI_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, |
| 106 double* start_time, | 110 double* start_time, |
| 107 double* end_time); | 111 double* end_time); |
| 108 | 112 |
| 109 // Enable/disable natural scrolling for touchpads. | 113 // Enable/disable natural scrolling for touchpads. |
| 110 UI_EXPORT void SetNaturalScroll(bool enabled); | 114 UI_EXPORT void SetNaturalScroll(bool enabled); |
| 111 | 115 |
| 112 // In natural scrolling enabled for touchpads? | 116 // In natural scrolling enabled for touchpads? |
| (...skipping 22 matching lines...) Expand all Loading... |
| 135 // Returns true if default post-target handling was canceled for |event| after | 139 // Returns true if default post-target handling was canceled for |event| after |
| 136 // its dispatch to its target. | 140 // its dispatch to its target. |
| 137 UI_EXPORT bool EventCanceledDefaultHandling(const Event& event); | 141 UI_EXPORT bool EventCanceledDefaultHandling(const Event& event); |
| 138 | 142 |
| 139 // Registers a custom event type. | 143 // Registers a custom event type. |
| 140 UI_EXPORT int RegisterCustomEventType(); | 144 UI_EXPORT int RegisterCustomEventType(); |
| 141 | 145 |
| 142 } // namespace ui | 146 } // namespace ui |
| 143 | 147 |
| 144 #endif // UI_BASE_EVENTS_EVENT_UTILS_H_ | 148 #endif // UI_BASE_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |