• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_H_
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_H_
7 
8 #include "base/time/time.h"
9 #include "ui/events/event_constants.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h"
11 #include "ui/events/gesture_event_details.h"
12 
13 namespace ui {
14 
15 class GestureEventDataPacket;
16 
17 struct GESTURE_DETECTION_EXPORT GestureEventData {
18   GestureEventData(const GestureEventDetails&,
19                    int motion_event_id,
20                    base::TimeTicks time,
21                    float x,
22                    float y,
23                    float raw_x,
24                    float raw_y,
25                    size_t touch_point_count,
26                    const gfx::RectF& bounding_box);
27   GestureEventData(EventType type, const GestureEventData&);
28 
typeGestureEventData29   EventType type() const { return details.type(); }
30 
31   GestureEventDetails details;
32   int motion_event_id;
33   base::TimeTicks time;
34   float x;
35   float y;
36   float raw_x;
37   float raw_y;
38 
39  private:
40   friend class GestureEventDataPacket;
41 
42   // Initializes type to GESTURE_TYPE_INVALID.
43   GestureEventData();
44 };
45 
46 }  //  namespace ui
47 
48 #endif  // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_H_
49