Chromium Code Reviews| 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_EVENTS_EVENT_UTILS_H_ | 5 #ifndef UI_EVENTS_EVENT_UTILS_H_ |
| 6 #define UI_EVENTS_EVENT_UTILS_H_ | 6 #define UI_EVENTS_EVENT_UTILS_H_ |
| 7 | 7 |
| 8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
| 9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/events/events_export.h" | 12 #include "ui/events/events_export.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include <windows.h> | 15 #include <windows.h> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Point; | 19 class Point; |
| 20 class Vector2d; | 20 class Vector2d; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class TimeDelta; | 24 class TimeDelta; |
| 25 } | 25 } |
| 26 | 26 |
| 27 enum InternalDisplayHasTouchSupport { | |
| 28 INTERNAL_DISPLAY_HAS_TOUCH_SUPPORT, | |
| 29 INTERNAL_DISPLAY_NO_TOUCH_SUPPORT, | |
| 30 INTERNAL_DISPLAY_UNKNOWN_TOUCH_SUPPORT | |
| 31 }; | |
|
oshima
2014/01/14 22:35:01
can you just use gfx::Display:TouchSupport?
tdresser
2014/01/17 20:38:35
Oh, absolutely, thanks.
Done.
| |
| 32 | |
| 27 namespace ui { | 33 namespace ui { |
| 28 | 34 |
| 29 class Event; | 35 class Event; |
| 30 | 36 |
| 31 // Updates the list of devices for cached properties. | 37 // Updates the list of devices for cached properties. |
| 32 EVENTS_EXPORT void UpdateDeviceList(); | 38 EVENTS_EXPORT void UpdateDeviceList(); |
| 33 | 39 |
| 34 // Get the EventType from a native event. | 40 // Get the EventType from a native event. |
| 35 EVENTS_EXPORT EventType EventTypeFromNative( | 41 EVENTS_EXPORT EventType EventTypeFromNative( |
| 36 const base::NativeEvent& native_event); | 42 const base::NativeEvent& native_event); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 | 132 |
| 127 // Enable/disable natural scrolling for touchpads. | 133 // Enable/disable natural scrolling for touchpads. |
| 128 EVENTS_EXPORT void SetNaturalScroll(bool enabled); | 134 EVENTS_EXPORT void SetNaturalScroll(bool enabled); |
| 129 | 135 |
| 130 // In natural scrolling enabled for touchpads? | 136 // In natural scrolling enabled for touchpads? |
| 131 EVENTS_EXPORT bool IsNaturalScrollEnabled(); | 137 EVENTS_EXPORT bool IsNaturalScrollEnabled(); |
| 132 | 138 |
| 133 // Returns whether natural scrolling should be used for touchpad. | 139 // Returns whether natural scrolling should be used for touchpad. |
| 134 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); | 140 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); |
| 135 | 141 |
| 142 // Returns whether or not the internal display produces touch events. | |
| 143 EVENTS_EXPORT InternalDisplayHasTouchSupport InternalDisplaySupportsTouch(); | |
| 144 | |
| 136 // Was this event generated by a touchpad device? | 145 // Was this event generated by a touchpad device? |
| 137 // The caller is responsible for ensuring that this is a mouse/touchpad event | 146 // The caller is responsible for ensuring that this is a mouse/touchpad event |
| 138 // before calling this function. | 147 // before calling this function. |
| 139 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); | 148 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); |
| 140 | 149 |
| 141 // Returns true if event is noop. | 150 // Returns true if event is noop. |
| 142 EVENTS_EXPORT bool IsNoopEvent(const base::NativeEvent& event); | 151 EVENTS_EXPORT bool IsNoopEvent(const base::NativeEvent& event); |
| 143 | 152 |
| 144 // Creates and returns no-op event. | 153 // Creates and returns no-op event. |
| 145 EVENTS_EXPORT base::NativeEvent CreateNoopEvent(); | 154 EVENTS_EXPORT base::NativeEvent CreateNoopEvent(); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 157 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); | 166 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); |
| 158 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
| 159 #endif | 168 #endif |
| 160 | 169 |
| 161 // Registers a custom event type. | 170 // Registers a custom event type. |
| 162 EVENTS_EXPORT int RegisterCustomEventType(); | 171 EVENTS_EXPORT int RegisterCustomEventType(); |
| 163 | 172 |
| 164 } // namespace ui | 173 } // namespace ui |
| 165 | 174 |
| 166 #endif // UI_EVENTS_EVENT_UTILS_H_ | 175 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |