# OHOS::DragEvent - [Overview](#section1869934673165635) - [Summary](#section855427081165635) - [Public Member Functions](#pub-methods) ## **Overview** **Related Modules:** [Graphic](Graphic.md) **Description:** Defines a drag event, which indicates a certain movement \(more than 10 pixels\) after a view is pressed. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Public Member Functions

Function

Description

DragEvent (const Point &newPos, const Point &lastPos, const Point &totalLen)

A constructor used to create a DragEvent instance.

~DragEvent ()

virtual

A destructor used to delete the DragEvent instance.

GetLastPoint () const

const Point &

Obtains the coordinates of the last position in the drag event.

GetStartPoint () const

const Point &

Obtains the start coordinates in the drag event.

SetPreLastPoint (const Point &preLastPos)

void

Sets the coordinates of the stay position before the last position in the drag event.

GetPreLastPoint () const

const Point &

Obtains the coordinates of the stay position before the last position in the drag event.

GetDragDirection () const

uint8_t

Obtains the direction in the drag event.

GetDeltaX () const

int16_t

Obtains the difference between the current position and the last position of the view in the x-axis.

GetDeltaY () const

int16_t

Obtains the difference between the current position and the last position of the view in the y-axis.

Event ()

A default constructor used to create an Event instance.

Event (const Point &curPos)

A constructor used to create an Event instance.

~Event ()

virtual

A destructor used to delete the Event instance.

GetCurrentPos () const

const Point &

Obtains the position where an event occurs.

GetTimeStamp () const

const TimeType &

Obtains the timestamp when an event occurs.

SetTimeStamp (const TimeType &timeStamp)

void

Sets the timestamp when an event occurs.

operator new (size_t size)

void *

Overrides the new function.

operator delete (void *p)

void

Overrides the delete function.