# OHOS::UIView::OnTouchListener ## **Overview** **Related Modules:** [Graphic](Graphic.md) **Description:** Defines a touch event listener. You need to register this listener with the view to listen to touch events. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Public Member Functions

Public Member Function Name

Description

OnPress (UIView &view, const PressEvent &event)

virtual bool 

Called when a view is pressed.

OnRelease (UIView &view, const ReleaseEvent &event)

virtual bool 

Called when a view is released.

OnCancel (UIView &view, const CancelEvent &event)

virtual bool 

Called when a click event on a view is canceled.

~OnTouchListener ()

virtual 

A destructor used to delete the OnTouchListener instance.

operator new (size_t size)

void * 

Overrides the new function.

operator delete (void *p)

void 

Overrides the delete function.