Foxit PDF SDK  9.1
<IToolHandler> Protocol Reference

The tool handler, it handles the gesture and touch events, which a tool should always implement most of them. More...

Inheritance diagram for <IToolHandler>:

Instance Methods

(NSString *) - getName
 Get the tool name. More...
 
(BOOL) - isEnabled
 If the tool handler is enabled. More...
 
(void) - onActivate
 If the tool handler is activated. More...
 
(void) - onDeactivate
 If the tool handler is deactivated. More...
 
(void) - onDraw:inContext:
 Drawing event on the specified page. More...
 
(BOOL) - onPageViewLongPress:recognizer:
 Long press gesture on the specified page. More...
 
(BOOL) - onPageViewPan:recognizer:
 Pan gesture on the specified page. More...
 
(BOOL) - onPageViewShouldBegin:recognizer:
 Should being gesture on the specified page. More...
 
(BOOL) - onPageViewTap:recognizer:
 Tap gesture on the specified page. More...
 
(BOOL) - onPageViewTouchesBegan:touches:withEvent:
 Touches began on the specified page. More...
 
(BOOL) - onPageViewTouchesCancelled:touches:withEvent:
 Touches cancelled on the specified page. More...
 
(BOOL) - onPageViewTouchesEnded:touches:withEvent:
 Touches ended on the specified page. More...
 
(BOOL) - onPageViewTouchesMoved:touches:withEvent:
 Touches moved on the specified page. More...
 
(BOOL) - shouldDrawAnnot:inPDFViewCtrl:
 Should pdfViewCtrl draw annot, if NO annot handler will draw annot by itself in onDraw:inContext:annot:. More...
 

Properties

FSReadToolSettingstoolSettings
 Get/set the tool settings. More...
 
FSAnnotType type
 Get/set the current annot type if it's an annotation tool handler. More...
 

Detailed Description

The tool handler, it handles the gesture and touch events, which a tool should always implement most of them.

Method Documentation

◆ getName

- (NSString *) getName

Get the tool name.

Returns
Tool name.

◆ isEnabled

- (BOOL) isEnabled

If the tool handler is enabled.

Returns
Whether the tool handler is enable or not.

◆ onActivate

- (void) onActivate

If the tool handler is activated.

◆ onDeactivate

- (void) onDeactivate

If the tool handler is deactivated.

◆ onDraw:inContext:

- (void) onDraw: (int)  pageIndex
inContext: (CGContextRef)  context 

Drawing event on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]contextDrawing context.

◆ onPageViewLongPress:recognizer:

- (BOOL) onPageViewLongPress: (int)  pageIndex
recognizer: (UILongPressGestureRecognizer *)  recognizer 

Long press gesture on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]recognizerLong press gesture.
Returns
Whether the long press gesture on the specified page responds or not.

◆ onPageViewPan:recognizer:

- (BOOL) onPageViewPan: (int)  pageIndex
recognizer: (UIPanGestureRecognizer *)  recognizer 

Pan gesture on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]recognizerPan gesture.
Returns
Whether the pan gesture on the specified page responds or not.

◆ onPageViewShouldBegin:recognizer:

- (BOOL) onPageViewShouldBegin: (int)  pageIndex
recognizer: (UIGestureRecognizer *)  gestureRecognizer 

Should being gesture on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]gestureRecognizerResponsive gesture.
Returns
Whether should begin gesture on the specified page gesture on the specified page.

◆ onPageViewTap:recognizer:

- (BOOL) onPageViewTap: (int)  pageIndex
recognizer: (UITapGestureRecognizer *_Nullable)  recognizer 

Tap gesture on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]recognizerTap gesture.
Returns
Whether the tap gesture on the specified page responds or not.

◆ onPageViewTouchesBegan:touches:withEvent:

- (BOOL) onPageViewTouchesBegan: (int)  pageIndex
touches: (NSSet *)  touches
withEvent: (UIEvent *)  event 

Touches began on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]touchesTouch set.
[in]eventTouch event.
Returns
Whether touch began on the specified page responds or not.

◆ onPageViewTouchesCancelled:touches:withEvent:

- (BOOL) onPageViewTouchesCancelled: (int)  pageIndex
touches: (NSSet *)  touches
withEvent: (UIEvent *)  event 

Touches cancelled on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]touchesTouch set.
[in]eventTouch event.
Returns
Whether touch cancelled on the specified page responds or not.

◆ onPageViewTouchesEnded:touches:withEvent:

- (BOOL) onPageViewTouchesEnded: (int)  pageIndex
touches: (NSSet *)  touches
withEvent: (UIEvent *)  event 

Touches ended on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]touchesTouch set.
[in]eventTouch event.
Returns
Whether touch ended on the specified page responds or not.

◆ onPageViewTouchesMoved:touches:withEvent:

- (BOOL) onPageViewTouchesMoved: (int)  pageIndex
touches: (NSSet *)  touches
withEvent: (UIEvent *)  event 

Touches moved on the specified page.

Parameters
[in]pageIndexThe pdf page index,0 for the first page.
[in]touchesTouch set.
[in]eventTouch event.
Returns
Whether touch moved on the specified page responds or not.

◆ shouldDrawAnnot:inPDFViewCtrl:

- (BOOL) shouldDrawAnnot: (FSAnnot *)  annot
inPDFViewCtrl: (FSPDFViewCtrl *)  pdfViewCtrl 

Should pdfViewCtrl draw annot, if NO annot handler will draw annot by itself in onDraw:inContext:annot:.

Parameters
[in]annotAnnot to draw.
[in]pdfViewCtrlThe pdf view control.
Returns
Whether should draw annot by pdf view control.

Property Documentation

◆ toolSettings

- (FSReadToolSettings*) toolSettings
readwriteoptionalnonatomicweak

Get/set the tool settings.

◆ type

- (FSAnnotType) type
readwritenonatomicassign

Get/set the current annot type if it's an annotation tool handler.