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_CONSTANTS_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_CONSTANTS_H_ |
tfarina
2012/11/03 12:40:04
Looking at this, we could split this file into:
ev
Ben Goodger (Google)
2012/11/03 16:09:26
good idea. can be done in a subsequent cl.
| |
6 #define UI_BASE_EVENTS_EVENT_CONSTANTS_H_ | 6 #define UI_BASE_EVENTS_EVENT_CONSTANTS_H_ |
7 | 7 |
8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
9 #include "ui/base/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include <windows.h> | 13 #include <windows.h> |
14 #endif | 14 #endif |
15 | 15 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 | 109 |
110 // Phase of the event dispatch. | 110 // Phase of the event dispatch. |
111 enum EventPhase { | 111 enum EventPhase { |
112 EP_PREDISPATCH, | 112 EP_PREDISPATCH, |
113 EP_PRETARGET, | 113 EP_PRETARGET, |
114 EP_TARGET, | 114 EP_TARGET, |
115 EP_POSTTARGET, | 115 EP_POSTTARGET, |
116 EP_POSTDISPATCH | 116 EP_POSTDISPATCH |
117 }; | 117 }; |
118 | 118 |
119 enum TouchStatus { | |
120 TOUCH_STATUS_UNKNOWN = 0, // Unknown touch status. This is used to indicate | |
121 // that the touch event was not handled. | |
122 TOUCH_STATUS_START, // The touch event initiated a touch sequence. | |
123 TOUCH_STATUS_CONTINUE, // The touch event is part of a previously | |
124 // started touch sequence. | |
125 TOUCH_STATUS_END, // The touch event ended the touch sequence. | |
126 TOUCH_STATUS_QUEUED, // The touch event has not been processed yet, but | |
127 // may be processed asynchronously later. This also | |
128 // places a lock on touch-events (i.e. all | |
129 // subsequent touch-events should be sent to the | |
130 // current handler). | |
131 TOUCH_STATUS_QUEUED_END, // Similar to TOUCH_STATUS_QUEUED, except that | |
132 // subsequent touch-events can be sent to any | |
133 // handler. | |
134 }; | |
135 | |
136 // Returns an equivalent EventResult from a TouchStatus. | |
137 UI_EXPORT EventResult EventResultFromTouchStatus(TouchStatus status); | |
138 | |
139 // Updates the list of devices for cached properties. | 119 // Updates the list of devices for cached properties. |
140 UI_EXPORT void UpdateDeviceList(); | 120 UI_EXPORT void UpdateDeviceList(); |
141 | 121 |
142 // Get the EventType from a native event. | 122 // Get the EventType from a native event. |
143 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); | 123 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); |
144 | 124 |
145 // Get the EventFlags from a native event. | 125 // Get the EventFlags from a native event. |
146 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); | 126 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); |
147 | 127 |
148 UI_EXPORT base::TimeDelta EventTimeFromNative( | 128 UI_EXPORT base::TimeDelta EventTimeFromNative( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 UI_EXPORT int GetModifiersFromKeyState(); | 213 UI_EXPORT int GetModifiersFromKeyState(); |
234 | 214 |
235 // Returns true if |message| identifies a mouse event that was generated as the | 215 // Returns true if |message| identifies a mouse event that was generated as the |
236 // result of a touch event. | 216 // result of a touch event. |
237 UI_EXPORT bool IsMouseEventFromTouch(UINT message); | 217 UI_EXPORT bool IsMouseEventFromTouch(UINT message); |
238 #endif | 218 #endif |
239 | 219 |
240 } // namespace ui | 220 } // namespace ui |
241 | 221 |
242 #endif // UI_BASE_EVENTS_EVENT_CONSTANTS_H_ | 222 #endif // UI_BASE_EVENTS_EVENT_CONSTANTS_H_ |
OLD | NEW |