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

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

Issue 10912063: events: Get rid of GestureStatus in favour of EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/base/events/event_handler.h » ('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_BASE_EVENTS_H_ 5 #ifndef UI_BASE_EVENTS_H_
6 #define UI_BASE_EVENTS_H_ 6 #define UI_BASE_EVENTS_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"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Flags specific to mouse events 88 // Flags specific to mouse events
89 enum MouseEventFlags { 89 enum MouseEventFlags {
90 EF_IS_DOUBLE_CLICK = 1 << 16, 90 EF_IS_DOUBLE_CLICK = 1 << 16,
91 EF_IS_TRIPLE_CLICK = 1 << 17, 91 EF_IS_TRIPLE_CLICK = 1 << 17,
92 EF_IS_NON_CLIENT = 1 << 18, 92 EF_IS_NON_CLIENT = 1 << 18,
93 EF_IS_SYNTHESIZED = 1 << 19, // Only for Aura. See ui/aura/root_window.h 93 EF_IS_SYNTHESIZED = 1 << 19, // Only for Aura. See ui/aura/root_window.h
94 EF_FROM_TOUCH = 1 << 20, // Indicates this mouse event is generated 94 EF_FROM_TOUCH = 1 << 20, // Indicates this mouse event is generated
95 // from an unconsumed touch/gesture event. 95 // from an unconsumed touch/gesture event.
96 }; 96 };
97 97
98 // Result of dispatching an event.
99 enum EventResult {
100 ER_UNHANDLED = 0, // The event hasn't been handled. The event can be
101 // propagated to other handlers.
102 ER_HANDLED, // The event has already been handled, but it can still be
103 // propagated to other handlers.
104 ER_CONSUMED, // The event has been handled, and it should not be
105 // propagated to other handlers.
106 };
107
98 enum TouchStatus { 108 enum TouchStatus {
99 TOUCH_STATUS_UNKNOWN = 0, // Unknown touch status. This is used to indicate 109 TOUCH_STATUS_UNKNOWN = 0, // Unknown touch status. This is used to indicate
100 // that the touch event was not handled. 110 // that the touch event was not handled.
101 TOUCH_STATUS_START, // The touch event initiated a touch sequence. 111 TOUCH_STATUS_START, // The touch event initiated a touch sequence.
102 TOUCH_STATUS_CONTINUE, // The touch event is part of a previously 112 TOUCH_STATUS_CONTINUE, // The touch event is part of a previously
103 // started touch sequence. 113 // started touch sequence.
104 TOUCH_STATUS_END, // The touch event ended the touch sequence. 114 TOUCH_STATUS_END, // The touch event ended the touch sequence.
105 TOUCH_STATUS_SYNTH_MOUSE, // The touch event was not processed, but a 115 TOUCH_STATUS_SYNTH_MOUSE, // The touch event was not processed, but a
106 // synthetic mouse event generated from the 116 // synthetic mouse event generated from the
107 // unused touch event was handled. 117 // unused touch event was handled.
108 TOUCH_STATUS_QUEUED, // The touch event has not been processed yet, but 118 TOUCH_STATUS_QUEUED, // The touch event has not been processed yet, but
109 // may be processed asynchronously later. This also 119 // may be processed asynchronously later. This also
110 // places a lock on touch-events (i.e. all 120 // places a lock on touch-events (i.e. all
111 // subsequent touch-events should be sent to the 121 // subsequent touch-events should be sent to the
112 // current handler). 122 // current handler).
113 TOUCH_STATUS_QUEUED_END, // Similar to TOUCH_STATUS_QUEUED, except that 123 TOUCH_STATUS_QUEUED_END, // Similar to TOUCH_STATUS_QUEUED, except that
114 // subsequent touch-events can be sent to any 124 // subsequent touch-events can be sent to any
115 // handler. 125 // handler.
116 }; 126 };
117 127
118 // Updates the list of devices for cached properties. 128 // Updates the list of devices for cached properties.
119 UI_EXPORT void UpdateDeviceList(); 129 UI_EXPORT void UpdateDeviceList();
120 130
121 enum GestureStatus {
122 GESTURE_STATUS_UNKNOWN = 0, // Unknown Gesture status. This is used to
123 // indicate that the Gesture event was not
124 // handled.
125 GESTURE_STATUS_CONSUMED, // The Gesture event got consumed.
126 };
127
128 // Get the EventType from a native event. 131 // Get the EventType from a native event.
129 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); 132 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event);
130 133
131 // Get the EventFlags from a native event. 134 // Get the EventFlags from a native event.
132 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); 135 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event);
133 136
134 UI_EXPORT base::TimeDelta EventTimeFromNative( 137 UI_EXPORT base::TimeDelta EventTimeFromNative(
135 const base::NativeEvent& native_event); 138 const base::NativeEvent& native_event);
136 139
137 // Get the location from a native event. The coordinate system of the resultant 140 // Get the location from a native event. The coordinate system of the resultant
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 UI_EXPORT int GetModifiersFromKeyState(); 222 UI_EXPORT int GetModifiersFromKeyState();
220 223
221 // Returns true if |message| identifies a mouse event that was generated as the 224 // Returns true if |message| identifies a mouse event that was generated as the
222 // result of a touch event. 225 // result of a touch event.
223 UI_EXPORT bool IsMouseEventFromTouch(UINT message); 226 UI_EXPORT bool IsMouseEventFromTouch(UINT message);
224 #endif 227 #endif
225 228
226 } // namespace ui 229 } // namespace ui
227 230
228 #endif // UI_BASE_EVENTS_H_ 231 #endif // UI_BASE_EVENTS_H_
OLDNEW
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/base/events/event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698