com.pdftron.pdf.PDFViewCtrl.ToolManager |
Known Indirect Subclasses |
Tool manager interface that is used for creating tools. PDFViewCtrl uses this interface to interact with user-defined functional modules.
Note also that if the implementation of onMove(android.view.MotionEvent, android.view.MotionEvent, float, float)
returns true, the subsequent code of #onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float)
won't be executed, preventing the view from being scrolled.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean | isCreatingAnnotation() | ||||||||||
abstract void |
onAnnotPainterUpdated(int page, long which, CurvePainter painter)
Called when annotation
CurvePainter has been updated. | ||||||||||
abstract void |
onChangePointerIcon(PointerIcon pointerIcon)
The implementation should change the pointer icon.
| ||||||||||
abstract void |
onClose()
Called by PDFViewCtrl to indicate the tool is being closed, e.g.,
when the current document is being closed.
| ||||||||||
abstract void |
onConfigurationChanged(Configuration newConfig)
Called when configuration is changed.
| ||||||||||
abstract void |
onControlReady()
Called by PDFViewCtrl to indicate that the control is ready to be
used by the ToolManager.
| ||||||||||
abstract void |
onCustomEvent(Object obj)
Called by PDFViewCtrl in the next message loop of the main thread.
| ||||||||||
abstract void |
onDestroy()
Called when
destroy() is called. | ||||||||||
abstract void |
onDocumentDownloadEvent(PDFViewCtrl.DownloadState state, int page_num, int page_downloaded, int page_count, String message)
Called when an update from document downloading is available, which
can be started by
openUrlAsync(String, String, String, HTTPRequestOptions) | ||||||||||
abstract boolean |
onDoubleTap(MotionEvent e)
Called at the beginning when double tap event is triggered.
| ||||||||||
abstract void |
onDoubleTapEnd(MotionEvent e)
Called at the end when
onDoubleTap(android.view.MotionEvent)
is triggered. | ||||||||||
abstract boolean | onDoubleTapEvent(MotionEvent e) | ||||||||||
abstract void | onDoubleTapZoomAnimationBegin() | ||||||||||
abstract void | onDoubleTapZoomAnimationEnd() | ||||||||||
abstract boolean |
onDown(MotionEvent e)
Called when down event is triggered.
| ||||||||||
abstract void |
onDraw(Canvas canvas, Matrix tfm)
Called by PDFViewCtrl to draw tool's content, if there is any.
| ||||||||||
abstract boolean |
onDrawEdgeEffects(Canvas canvas, int width, int verticalOffset)
Called when edge effect is drawn in onDraw.
| ||||||||||
abstract boolean |
onFlingStop()
Called when a fling motion stops by itself (not by a touching event).
| ||||||||||
abstract boolean |
onGenericMotionEvent(MotionEvent e)
called when generic motion event is called
| ||||||||||
abstract boolean |
onKeyUp(int keyCode, KeyEvent event)
Called when a key is released
| ||||||||||
abstract void |
onLayout(boolean changed, int l, int t, int r, int b)
Called when PDFViewCtrl's onLayout(), e.g., android.view.View.onLayout(), is triggered,
or PDFViewCtrl's page presentation mode or page view mode is changed by
setPagePresentationMode(PagePresentationMode) or
setPageViewMode(PageViewMode) . | ||||||||||
abstract boolean |
onLongPress(MotionEvent e)
Called when long press event is triggered.
| ||||||||||
abstract boolean |
onMove(MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)
Called when #onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float)
is triggered.
| ||||||||||
abstract void |
onPageTurning(int old_page, int cur_page)
Called when turning pages in non-continuous page presentation mode.
| ||||||||||
abstract void |
onPause()
Called when
pause() is called. | ||||||||||
abstract boolean |
onPointerDown(MotionEvent e)
Called when non-primary pointer down event is triggered.
| ||||||||||
abstract void |
onPostSingleTapConfirmed()
Called about 200ms after
onSingleTapConfirmed(android.view.MotionEvent)
is called. | ||||||||||
abstract void |
onPullEdgeEffects(int which_edge, float delta_distance)
Called when edge effect should occur.
| ||||||||||
abstract void |
onReleaseEdgeEffects()
Called when edge effect is released in onUp.
| ||||||||||
abstract void | onRenderingFinished() | ||||||||||
abstract void |
onResume()
Called when
resume() is called. | ||||||||||
abstract boolean |
onScale(float x, float y)
Called when #onScale(android.view.ScaleGestureDetector)
is triggered.
| ||||||||||
abstract boolean |
onScaleBegin(float x, float y)
Called when #onScaleBegin(android.view.ScaleGestureDetector)
is triggered.
| ||||||||||
abstract boolean |
onScaleEnd(float x, float y)
Called when #onScaleEnd(android.view.ScaleGestureDetector)
is triggered.
| ||||||||||
abstract void |
onScrollChanged(int l, int t, int oldl, int oldt)
Called in response to an internal scroll in PDFViewCtrl.
| ||||||||||
abstract void |
onSetDoc()
Called by PDFViewCtrl after {link
setDoc(PDFDoc)
is called and the document is set within PDFViewCtrl. | ||||||||||
abstract boolean |
onShowPress(MotionEvent e)
Called when show press event is triggered.
| ||||||||||
abstract boolean |
onSingleTapConfirmed(MotionEvent e)
Called when single tap confirmed event is triggered.
| ||||||||||
abstract boolean |
onSingleTapUp(MotionEvent e)
Called when single tap up event is triggered.
| ||||||||||
abstract boolean |
onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
Called when up event is triggered.
|
Called when annotation CurvePainter
has been updated.
Called from background thread.
page | the page number |
---|---|
which | the annotation key |
The implementation should change the pointer icon.
pointerIcon | The pointer icon |
---|
Called by PDFViewCtrl to indicate the tool is being closed, e.g., when the current document is being closed. Tool should clean up at this moment, e.g., closing its menu.
Called when configuration is changed. This event can be used to perform some action when the device's configuration changes.
newConfig | the new device configuration |
---|
Called by PDFViewCtrl to indicate that the control is ready to be used by the ToolManager. This event is triggered after the layout phase is complete, making it safe to use the other events. Note this is also called every time a new doc is set in PDFViewCtrl.
Called by PDFViewCtrl in the next message loop of the main thread.
This callback can be registered through
postCustomEvent(Object)
method. Note
that this function is called only once per posting.
obj | the Object passed in when calling
postCustomEvent(Object) .
|
---|
Called when an update from document downloading is available, which
can be started by openUrlAsync(String, String, String, HTTPRequestOptions)
state | the state of the update. |
---|---|
page_num | the number of the page that was just downloaded. Meaningful
if type is PAGE . |
page_downloaded | the total number of pages that have been downloaded |
page_count | the page count of the associated document |
message | error message in case the download has failed |
Called at the beginning when double tap event is triggered.
Note: By default, PDFViewCtrl changes the zoom when double tapping. But since Tool.onDoubleTap() is called before the zoom is changed, calling getZoom() in this callback would return the old zoom factor.
Called at the end when onDoubleTap(android.view.MotionEvent)
is triggered.
Note: By default, PDFViewCtrl changes the zoom when double tapping. Since Tool.onDoubleTapEnd() is called after the zoom is changed, calling getZoom() in this callback would return the new zoom factor.
Called when down event is triggered.
Called by PDFViewCtrl to draw tool's content, if there is any. Note that this is called after all the document content is drawn; therefore the content drawn in this function will be on top of the document content.
canvas | The android.graphics.Canvas object to draw on PDFViewCtrl. |
---|---|
tfm | The extra transformation matrix applied to 'canvas'. This matrix is normally an identity matrix unless when the built-in page sliding is in process. The inverse of this matrix can be temporarily applied to 'canvas' in order to make the content drawn in this function appear stationary during sliding. |
Called when edge effect is drawn in onDraw.
canvas | canvas used to draw edge effect |
---|---|
width | width of the edge effect |
verticalOffset | vertical offset to draw edge effect |
Called when a fling motion stops by itself (not by a touching event).
called when generic motion event is called
e | the up motion event |
---|
Called when a key is released
keyCode | A key code that represents the button pressed, from android.view.KeyEvent. |
---|---|
event | The KeyEvent object that defines the button action. |
Called when PDFViewCtrl's onLayout(), e.g., android.view.View.onLayout(), is triggered,
or PDFViewCtrl's page presentation mode or page view mode is changed by
setPagePresentationMode(PagePresentationMode)
or
setPageViewMode(PageViewMode)
.
changed | This is a new size or position for this view. |
---|---|
l | Left position, relative to parent. |
t | Top position, relative to parent. |
r | Right position, relative to parent. |
b | Bottom position, relative to parent. |
Called when long press event is triggered.
Called when #onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float) is triggered.
Called when turning pages in non-continuous page presentation mode.
Note: Note that the event will be fired when the page is already turned, and not while it is being 'turned'.
Called when non-primary pointer down event is triggered.
Called about 200ms after onSingleTapConfirmed(android.view.MotionEvent)
is called.
Since onSingleTapConfirmed() event is typically the last event, it is difficult for a tool to trigger post behaviors if the tool is only initiated in onSingleTapConfirmed(). Therefore, PDFViewCtrl implements this callback function after onSingleTapConfirmed() is called to provide the tool a chance to implement post behaviors. For example, if a user clicks on a link, the tool could highlight the link in onSingleTapConfirmed() and then navigate to the link in onPostSingleTapConfirmed().
Note: If a new event is triggered by a user after onSingleTapConfirmed() is called but before onPostSingleTapConfirmed() is called, PDFViewCtrl ensures onPostSingleTapConfirmed() is called immediately before the new event. In other words, the 200ms delay is ignored.
Called when edge effect should occur.
which_edge | -1 for left edge, 1 for right edge |
---|---|
delta_distance | distance of edge effect |
Called when edge effect is released in onUp.
Called when #onScale(android.view.ScaleGestureDetector) is triggered.
Called when #onScaleBegin(android.view.ScaleGestureDetector) is triggered.
Called when #onScaleEnd(android.view.ScaleGestureDetector) is triggered.
Called in response to an internal scroll in PDFViewCtrl. This can be used to detect PDFViewCtrl is scrolling after a fling, for example.
l | current horizontal scroll origin |
---|---|
t | current vertical scroll origin |
oldl | previous horizontal scroll origin |
oldt | previous vertical scroll origin |
Called by PDFViewCtrl after {link setDoc(PDFDoc)
is called and the document is set within PDFViewCtrl.
Called when show press event is triggered.
Called when single tap confirmed event is triggered.
Called when single tap up event is triggered.
Called when up event is triggered.
e | the up motion event |
---|---|
priorEventMode | indicates the prior event type. |