Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: ui/events/event_constants.h

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CONSTANTS_H_ 5 #ifndef UI_EVENTS_EVENT_CONSTANTS_H_
6 #define UI_EVENTS_EVENT_CONSTANTS_H_ 6 #define UI_EVENTS_EVENT_CONSTANTS_H_
7 7
8 namespace ui { 8 namespace ui {
9 9
10 // Event types. (prefixed because of a conflict with windows headers) 10 // Event types. (prefixed because of a conflict with windows headers)
11 enum EventType { 11 enum EventType {
12 ET_UNKNOWN = 0, 12 ET_UNKNOWN = 0,
13 ET_MOUSE_PRESSED, 13 ET_MOUSE_PRESSED,
14 ET_MOUSE_DRAGGED, 14 ET_MOUSE_DRAGGED,
15 ET_MOUSE_RELEASED, 15 ET_MOUSE_RELEASED,
16 ET_MOUSE_MOVED, 16 ET_MOUSE_MOVED,
17 ET_MOUSE_ENTERED, 17 ET_MOUSE_ENTERED,
18 ET_MOUSE_EXITED, 18 ET_MOUSE_EXITED,
19 ET_KEY_PRESSED, 19 ET_KEY_PRESSED,
20 ET_KEY_RELEASED, 20 ET_KEY_RELEASED,
21 ET_MOUSEWHEEL, 21 ET_MOUSEWHEEL,
22 ET_MOUSE_CAPTURE_CHANGED, // Event has no location. 22 ET_MOUSE_CAPTURE_CHANGED, // Event has no location.
23 ET_TOUCH_RELEASED, 23 ET_TOUCH_RELEASED,
24 ET_TOUCH_PRESSED, 24 ET_TOUCH_PRESSED,
25 ET_TOUCH_MOVED, 25 ET_TOUCH_MOVED,
26 ET_TOUCH_CANCELLED, 26 ET_TOUCH_CANCELLED,
27 ET_DROP_TARGET_EVENT, 27 ET_DROP_TARGET_EVENT,
28 ET_TRANSLATED_KEY_PRESS,
29 ET_TRANSLATED_KEY_RELEASE,
30 28
31 // GestureEvent types 29 // GestureEvent types
32 ET_GESTURE_SCROLL_BEGIN, 30 ET_GESTURE_SCROLL_BEGIN,
33 ET_GESTURE_TYPE_START = ET_GESTURE_SCROLL_BEGIN, 31 ET_GESTURE_TYPE_START = ET_GESTURE_SCROLL_BEGIN,
34 ET_GESTURE_SCROLL_END, 32 ET_GESTURE_SCROLL_END,
35 ET_GESTURE_SCROLL_UPDATE, 33 ET_GESTURE_SCROLL_UPDATE,
36 ET_GESTURE_TAP, 34 ET_GESTURE_TAP,
37 ET_GESTURE_TAP_DOWN, 35 ET_GESTURE_TAP_DOWN,
38 ET_GESTURE_TAP_CANCEL, 36 ET_GESTURE_TAP_CANCEL,
39 ET_GESTURE_TAP_UNCONFIRMED, // User tapped, but the tap delay hasn't expired. 37 ET_GESTURE_TAP_UNCONFIRMED, // User tapped, but the tap delay hasn't expired.
(...skipping 30 matching lines...) Expand all
70 // to track with the UMA system. 68 // to track with the UMA system.
71 ET_UMA_DATA, 69 ET_UMA_DATA,
72 70
73 // Must always be last. User namespace starts above this value. 71 // Must always be last. User namespace starts above this value.
74 // See ui::RegisterCustomEventType(). 72 // See ui::RegisterCustomEventType().
75 ET_LAST 73 ET_LAST
76 }; 74 };
77 75
78 // Event flags currently supported 76 // Event flags currently supported
79 enum EventFlags { 77 enum EventFlags {
80 EF_NONE = 0, // Used to denote no flags explicitly 78 EF_NONE = 0, // Used to denote no flags explicitly
81 EF_CAPS_LOCK_DOWN = 1 << 0, 79 EF_CAPS_LOCK_DOWN = 1 << 0,
82 EF_SHIFT_DOWN = 1 << 1, 80 EF_SHIFT_DOWN = 1 << 1,
83 EF_CONTROL_DOWN = 1 << 2, 81 EF_CONTROL_DOWN = 1 << 2,
84 EF_ALT_DOWN = 1 << 3, 82 EF_ALT_DOWN = 1 << 3,
85 EF_LEFT_MOUSE_BUTTON = 1 << 4, 83 EF_LEFT_MOUSE_BUTTON = 1 << 4,
86 EF_MIDDLE_MOUSE_BUTTON = 1 << 5, 84 EF_MIDDLE_MOUSE_BUTTON = 1 << 5,
87 EF_RIGHT_MOUSE_BUTTON = 1 << 6, 85 EF_RIGHT_MOUSE_BUTTON = 1 << 6,
88 EF_COMMAND_DOWN = 1 << 7, // GUI Key (e.g. Command on OS X keyboards, 86 EF_COMMAND_DOWN = 1 << 7, // GUI Key (e.g. Command on OS X
89 // Search on Chromebook keyboards, 87 // keyboards, Search on Chromebook
90 // Windows on MS-oriented keyboards) 88 // keyboards, Windows on MS-oriented
91 EF_EXTENDED = 1 << 8, // Windows extended key (see WM_KEYDOWN doc) 89 // keyboards)
92 EF_IS_SYNTHESIZED = 1 << 9, 90 EF_EXTENDED = 1 << 8, // Windows extended key (see WM_KEYDOWN
93 EF_ALTGR_DOWN = 1 << 10, 91 // doc)
94 EF_MOD3_DOWN = 1 << 11, 92 EF_IS_SYNTHESIZED = 1 << 9,
93 EF_ALTGR_DOWN = 1 << 10,
94 EF_MOD3_DOWN = 1 << 11,
95 EF_BACK_MOUSE_BUTTON = 1 << 12,
96 EF_FORWARD_MOUSE_BUTTON = 1 << 13,
95 }; 97 };
96 98
97 // Flags specific to key events 99 // Flags specific to key events
98 enum KeyEventFlags { 100 enum KeyEventFlags {
99 EF_NUMPAD_KEY = 1 << 16, // Key originates from number pad (Xkb only) 101 EF_IME_FABRICATED_KEY = 1 << 16, // Key event fabricated by the underlying
100 EF_IME_FABRICATED_KEY = 1 << 17, // Key event fabricated by the underlying
101 // IME without a user action. 102 // IME without a user action.
102 // (Linux X11 only) 103 // (Linux X11 only)
103 EF_IS_REPEAT = 1 << 18, 104 EF_IS_REPEAT = 1 << 17,
104 EF_FUNCTION_KEY = 1 << 19, // Key originates from function key row 105 EF_FINAL = 1 << 18, // Do not remap; the event was created with
105 EF_FINAL = 1 << 20, // Do not remap; the event was created with
106 // the desired final values. 106 // the desired final values.
107 }; 107 };
108 108
109 // Flags specific to mouse events 109 // Flags specific to mouse events
110 enum MouseEventFlags { 110 enum MouseEventFlags {
111 EF_IS_DOUBLE_CLICK = 1 << 16, 111 EF_IS_DOUBLE_CLICK = 1 << 16,
112 EF_IS_TRIPLE_CLICK = 1 << 17, 112 EF_IS_TRIPLE_CLICK = 1 << 17,
113 EF_IS_NON_CLIENT = 1 << 18, 113 EF_IS_NON_CLIENT = 1 << 18,
114 EF_FROM_TOUCH = 1 << 19, // Indicates this mouse event is generated 114 EF_FROM_TOUCH = 1 << 19, // Indicates this mouse event is generated
115 // from an unconsumed touch/gesture event. 115 // from an unconsumed touch/gesture event.
116 EF_TOUCH_ACCESSIBILITY = 1 << 20, // Indicates this event was generated from 116 EF_TOUCH_ACCESSIBILITY = 1 << 20, // Indicates this event was generated from
117 // touch accessibility mode. 117 // touch accessibility mode.
118 }; 118 };
119 119
120 // Result of dispatching an event. 120 // Result of dispatching an event.
121 enum EventResult { 121 enum EventResult {
122 ER_UNHANDLED = 0, // The event hasn't been handled. The event can be 122 ER_UNHANDLED = 0, // The event hasn't been handled. The event can be
123 // propagated to other handlers. 123 // propagated to other handlers.
124 ER_HANDLED = 1 << 0, // The event has already been handled, but it can 124 ER_HANDLED = 1 << 0, // The event has already been handled, but it can
125 // still be propagated to other handlers. 125 // still be propagated to other handlers.
126 ER_CONSUMED = 1 << 1, // The event has been handled, and it should not be 126 ER_CONSUMED = 1 << 1, // The event has been handled, and it should not be
127 // propagated to other handlers. 127 // propagated to other handlers.
128 ER_DISABLE_SYNC_HANDLING =
129 1 << 2, // The event shouldn't be handled synchronously. This
130 // happens if the event is being handled
131 // asynchronously, or if the event is invalid and
132 // shouldn't be handled at all.
128 }; 133 };
129 134
130 // Phase of the event dispatch. 135 // Phase of the event dispatch.
131 enum EventPhase { 136 enum EventPhase {
132 EP_PREDISPATCH, 137 EP_PREDISPATCH,
133 EP_PRETARGET, 138 EP_PRETARGET,
134 EP_TARGET, 139 EP_TARGET,
135 EP_POSTTARGET, 140 EP_POSTTARGET,
136 EP_POSTDISPATCH 141 EP_POSTDISPATCH
137 }; 142 };
138 143
139 // Device ID for Touch and Key Events. 144 // Device ID for Touch and Key Events.
140 enum EventDeviceId { 145 enum EventDeviceId {
141 ED_UNKNOWN_DEVICE = -1 146 ED_UNKNOWN_DEVICE = -1
142 }; 147 };
143 148
144 } // namespace ui 149 } // namespace ui
145 150
146 #endif // UI_EVENTS_EVENT_CONSTANTS_H_ 151 #endif // UI_EVENTS_EVENT_CONSTANTS_H_
OLDNEW
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698