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_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 // Convenience methods to cast |this| to a GestureEvent. IsGestureEvent() | 198 // Convenience methods to cast |this| to a GestureEvent. IsGestureEvent() |
199 // must be true as a precondition to calling these methods. | 199 // must be true as a precondition to calling these methods. |
200 GestureEvent* AsGestureEvent(); | 200 GestureEvent* AsGestureEvent(); |
201 const GestureEvent* AsGestureEvent() const; | 201 const GestureEvent* AsGestureEvent() const; |
202 | 202 |
203 // Returns true if the event has a valid |native_event_|. | 203 // Returns true if the event has a valid |native_event_|. |
204 bool HasNativeEvent() const; | 204 bool HasNativeEvent() const; |
205 | 205 |
| 206 // Marks the event as not participating in synchronous gesture recognition. |
| 207 void DisableSynchronousHandling(); |
| 208 bool synchronous_handling_disabled() const { |
| 209 return !!(result_ & ER_DISABLE_SYNC_HANDLING); |
| 210 } |
| 211 |
206 // Immediately stops the propagation of the event. This must be called only | 212 // Immediately stops the propagation of the event. This must be called only |
207 // from an EventHandler during an event-dispatch. Any event handler that may | 213 // from an EventHandler during an event-dispatch. Any event handler that may |
208 // be in the list will not receive the event after this is called. | 214 // be in the list will not receive the event after this is called. |
209 // Note that StopPropagation() can be called only for cancelable events. | 215 // Note that StopPropagation() can be called only for cancelable events. |
210 void StopPropagation(); | 216 void StopPropagation(); |
211 bool stopped_propagation() const { return !!(result_ & ER_CONSUMED); } | 217 bool stopped_propagation() const { return !!(result_ & ER_CONSUMED); } |
212 | 218 |
213 // Marks the event as having been handled. A handled event does not reach the | 219 // Marks the event as having been handled. A handled event does not reach the |
214 // next event phase. For example, if an event is handled during the pre-target | 220 // next event phase. For example, if an event is handled during the pre-target |
215 // phase, then the event is dispatched to all pre-target handlers, but not to | 221 // phase, then the event is dispatched to all pre-target handlers, but not to |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 | 813 |
808 const GestureEventDetails& details() const { return details_; } | 814 const GestureEventDetails& details() const { return details_; } |
809 | 815 |
810 private: | 816 private: |
811 GestureEventDetails details_; | 817 GestureEventDetails details_; |
812 }; | 818 }; |
813 | 819 |
814 } // namespace ui | 820 } // namespace ui |
815 | 821 |
816 #endif // UI_EVENTS_EVENT_H_ | 822 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |