#ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_
#define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_
#include "ui/events/gesture_detection/gesture_detection_export.h"
#include "ui/events/gesture_detection/gesture_event_data.h"
namespace ui {
class MotionEvent;
class GESTURE_DETECTION_EXPORT GestureEventDataPacket {
public:
enum GestureSource {
UNDEFINED = -1,
INVALID,
TOUCH_SEQUENCE_START,
TOUCH_SEQUENCE_END,
TOUCH_START,
TOUCH_MOVE,
TOUCH_END,
TOUCH_TIMEOUT,
};
GestureEventDataPacket();
GestureEventDataPacket(const GestureEventDataPacket& other);
~GestureEventDataPacket();
GestureEventDataPacket& operator=(const GestureEventDataPacket& other);
static GestureEventDataPacket FromTouch(const ui::MotionEvent& touch);
static GestureEventDataPacket FromTouchTimeout(
const GestureEventData& gesture);
void Push(const GestureEventData& gesture);
const GestureEventData& gesture(size_t i) const { return gestures_[i]; }
size_t gesture_count() const { return gesture_count_; }
GestureSource gesture_source() const { return gesture_source_; }
private:
explicit GestureEventDataPacket(GestureSource source);
enum { kMaxGesturesPerTouch = 5 };
GestureEventData gestures_[kMaxGesturesPerTouch];
size_t gesture_count_;
GestureSource gesture_source_;
};
}
#endif