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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); | 85 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); |
86 | 86 |
87 // Gets the fling velocity from a native event. is_cancel is set to true if | 87 // Gets the fling velocity from a native event. is_cancel is set to true if |
88 // this was a tap down, intended to stop an ongoing fling. | 88 // this was a tap down, intended to stop an ongoing fling. |
89 UI_EXPORT bool GetFlingData(const base::NativeEvent& native_event, | 89 UI_EXPORT bool GetFlingData(const base::NativeEvent& native_event, |
90 float* vx, | 90 float* vx, |
91 float* vy, | 91 float* vy, |
92 bool* is_cancel); | 92 bool* is_cancel); |
93 | 93 |
94 // Returns whether this is a scroll event and optionally gets the amount to be | 94 // Returns whether this is a scroll event and optionally gets the amount to be |
95 // scrolled. |x_offset| and |y_offset| can be NULL. | 95 // scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL. |
96 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, | 96 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, |
97 float* x_offset, | 97 float* x_offset, |
98 float* y_offset); | 98 float* y_offset, |
| 99 int* finger_count); |
99 | 100 |
100 UI_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, | 101 UI_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, |
101 double* start_time, | 102 double* start_time, |
102 double* end_time); | 103 double* end_time); |
103 | 104 |
104 // Enable/disable natural scrolling for touchpads. | 105 // Enable/disable natural scrolling for touchpads. |
105 UI_EXPORT void SetNaturalScroll(bool enabled); | 106 UI_EXPORT void SetNaturalScroll(bool enabled); |
106 | 107 |
107 // In natural scrolling enabled for touchpads? | 108 // In natural scrolling enabled for touchpads? |
108 UI_EXPORT bool IsNaturalScrollEnabled(); | 109 UI_EXPORT bool IsNaturalScrollEnabled(); |
(...skipping 21 matching lines...) Expand all Loading... |
130 // Returns true if default post-target handling was canceled for |event| after | 131 // Returns true if default post-target handling was canceled for |event| after |
131 // its dispatch to its target. | 132 // its dispatch to its target. |
132 UI_EXPORT bool EventCanceledDefaultHandling(const Event& event); | 133 UI_EXPORT bool EventCanceledDefaultHandling(const Event& event); |
133 | 134 |
134 // Registers a custom event type. | 135 // Registers a custom event type. |
135 UI_EXPORT int RegisterCustomEventType(); | 136 UI_EXPORT int RegisterCustomEventType(); |
136 | 137 |
137 } // namespace ui | 138 } // namespace ui |
138 | 139 |
139 #endif // UI_BASE_EVENTS_EVENT_UTILS_H_ | 140 #endif // UI_BASE_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |