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

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

Issue 8364039: Initial views touchui GestureRecognizer support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added gesture tests in view_unittest Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include "base/event_types.h" 9 #include "base/event_types.h"
10 #include "ui/base/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
(...skipping 17 matching lines...) Expand all
28 ET_KEY_PRESSED, 28 ET_KEY_PRESSED,
29 ET_KEY_RELEASED, 29 ET_KEY_RELEASED,
30 ET_MOUSEWHEEL, 30 ET_MOUSEWHEEL,
31 ET_TOUCH_RELEASED, 31 ET_TOUCH_RELEASED,
32 ET_TOUCH_PRESSED, 32 ET_TOUCH_PRESSED,
33 ET_TOUCH_MOVED, 33 ET_TOUCH_MOVED,
34 ET_TOUCH_STATIONARY, 34 ET_TOUCH_STATIONARY,
35 ET_TOUCH_CANCELLED, 35 ET_TOUCH_CANCELLED,
36 ET_DROP_TARGET_EVENT, 36 ET_DROP_TARGET_EVENT,
37 ET_FOCUS_CHANGE, 37 ET_FOCUS_CHANGE,
38
39 // GestureEvent types.
40 ET_GESTURE_SCROLL_BEGIN,
41 ET_GESTURE_SCROLL_END,
42 ET_GESTURE_SCROLL_UPDATE,
43 ET_GESTURE_TAP,
rjkroege 2011/11/09 02:43:30 an alternative implementation of my desire for fla
Gajen 2011/11/10 15:52:55 I guess this is not needed now as New design imple
44 ET_GESTURE_TAP_DOWN,
45 ET_GESTURE_DOUBLE_TAP,
38 }; 46 };
39 47
40 // Event flags currently supported 48 // Event flags currently supported
41 enum EventFlags { 49 enum EventFlags {
42 EF_CAPS_LOCK_DOWN = 1 << 0, 50 EF_CAPS_LOCK_DOWN = 1 << 0,
43 EF_SHIFT_DOWN = 1 << 1, 51 EF_SHIFT_DOWN = 1 << 1,
44 EF_CONTROL_DOWN = 1 << 2, 52 EF_CONTROL_DOWN = 1 << 2,
45 EF_ALT_DOWN = 1 << 3, 53 EF_ALT_DOWN = 1 << 3,
46 EF_LEFT_BUTTON_DOWN = 1 << 4, 54 EF_LEFT_BUTTON_DOWN = 1 << 4,
47 EF_MIDDLE_BUTTON_DOWN = 1 << 5, 55 EF_MIDDLE_BUTTON_DOWN = 1 << 5,
(...skipping 15 matching lines...) Expand all
63 TOUCH_STATUS_CONTINUE, // The touch event is part of a previously 71 TOUCH_STATUS_CONTINUE, // The touch event is part of a previously
64 // started touch sequence. 72 // started touch sequence.
65 TOUCH_STATUS_END, // The touch event ended the touch sequence. 73 TOUCH_STATUS_END, // The touch event ended the touch sequence.
66 TOUCH_STATUS_CANCEL, // The touch event was cancelled, but didn't 74 TOUCH_STATUS_CANCEL, // The touch event was cancelled, but didn't
67 // terminate the touch sequence. 75 // terminate the touch sequence.
68 TOUCH_STATUS_SYNTH_MOUSE // The touch event was not processed, but a 76 TOUCH_STATUS_SYNTH_MOUSE // The touch event was not processed, but a
69 // synthetic mouse event generated from the 77 // synthetic mouse event generated from the
70 // unused touch event was handled. 78 // unused touch event was handled.
71 }; 79 };
72 80
81 enum GestureStatus {
82 GESTURE_STATUS_UNKNOWN = 0, // Unknown Gesture status. This is used to
83 // indicate that the Gesture event was not
84 // handled.
85 GESTURE_STATUS_CONSUMED, // The Gesture event got consumed.
86 GESTURE_STATUS_SYNTH_MOUSE // The Gesture event was not processed, but a
87 // synthetic mouse event generated from the
88 // unused Gesture event was handled.
89 };
90
73 // Get the EventType from a native event. 91 // Get the EventType from a native event.
74 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); 92 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event);
75 93
76 // Get the EventFlags from a native event. 94 // Get the EventFlags from a native event.
77 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); 95 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event);
78 96
79 // Get the location from a native event. 97 // Get the location from a native event.
80 UI_EXPORT gfx::Point EventLocationFromNative( 98 UI_EXPORT gfx::Point EventLocationFromNative(
81 const base::NativeEvent& native_event); 99 const base::NativeEvent& native_event);
82 100
(...skipping 16 matching lines...) Expand all
99 117
100 // Gets the angle of the major axis away from the X axis. Default is 0.0. 118 // Gets the angle of the major axis away from the X axis. Default is 0.0.
101 UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); 119 UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event);
102 120
103 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. 121 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0.
104 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); 122 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event);
105 123
106 } // namespace ui 124 } // namespace ui
107 125
108 #endif // UI_BASE_EVENTS_H_ 126 #endif // UI_BASE_EVENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698