Package com.myscript.iink
Interface IGestureHandler
public interface IGestureHandler
The listener interface for handling gesture events.
- Since:
- 2.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NotNull GestureAction
onDoubleTap
(@NotNull Editor editor, PointerTool tool, @NotNull String[] gestureStrokeIds, float x, float y) Invoked when a double tap has been detected.@NotNull GestureAction
onInsert
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, @NotNull NativeObjectHandle<ContentSelection> before, @NotNull NativeObjectHandle<ContentSelection> after) Invoked when an insert gesture has been drawn between two portions of a text line, or at the beginning or end of a line.@NotNull GestureAction
onJoin
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, @NotNull NativeObjectHandle<ContentSelection> before, @NotNull NativeObjectHandle<ContentSelection> after) Invoked when a join gesture has been drawn between two portions of a text line, or at the beginning or end of a line.@NotNull GestureAction
onLongPress
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, float x, float y) Invoked when a long press has been detected.@NotNull GestureAction
onScratch
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been scratched.@NotNull GestureAction
onStrikethrough
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been striked through.@NotNull GestureAction
onSurround
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been surrounded.@NotNull GestureAction
onTap
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, float x, float y) Invoked when a tap has been detected.@NotNull GestureAction
onUnderline
(@NotNull Editor editor, PointerTool tool, @NotNull String gestureStrokeId, @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been underlined.
-
Method Details
-
onTap
@NotNull @NotNull GestureAction onTap(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, float x, float y) Invoked when a tap has been detected.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.x
- the tap x position (view coordinate in px).y
- the tap y position (view coordinate in px).- Returns:
- the GestureAction to perform.
-
onDoubleTap
@NotNull @NotNull GestureAction onDoubleTap(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String[] gestureStrokeIds, float x, float y) Invoked when a double tap has been detected.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeIds
- the id of the gesture strokes.x
- the double tap x position (view coordinate in px).y
- the double tap y position (view coordinate in px).- Returns:
- the GestureAction to perform.
-
onLongPress
@NotNull @NotNull GestureAction onLongPress(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, float x, float y) Invoked when a long press has been detected.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.x
- the long press x position (view coordinate in px).y
- the long press y position (view coordinate in px).- Returns:
- the GestureAction to perform.
-
onUnderline
@NotNull @NotNull GestureAction onUnderline(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, @NotNull @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been underlined. To activate underline detection in a Raw Content part, add "underline" to the "raw-content.pen.gestures" configuration list.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.selection
- the underlined portion of text.- Returns:
- the GestureAction to perform.
-
onSurround
@NotNull @NotNull GestureAction onSurround(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, @NotNull @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been surrounded. To activate surround detection in a Raw Content part, add "surround" to the "raw-content.pen.gestures" configuration list.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.selection
- the surrounded portion of text.- Returns:
- the GestureAction to perform.
-
onJoin
@NotNull @NotNull GestureAction onJoin(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, @NotNull @NotNull NativeObjectHandle<ContentSelection> before, @NotNull @NotNull NativeObjectHandle<ContentSelection> after) Invoked when a join gesture has been drawn between two portions of a text line, or at the beginning or end of a line. To activate join detection in a Raw Content part, add "join" to the "raw-content.pen.gestures" configuration list.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.before
- the portion of the text line before the join gesture.after
- the portion of the text line after the join gesture.- Returns:
- the GestureAction to perform.
-
onInsert
@NotNull @NotNull GestureAction onInsert(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, @NotNull @NotNull NativeObjectHandle<ContentSelection> before, @NotNull @NotNull NativeObjectHandle<ContentSelection> after) Invoked when an insert gesture has been drawn between two portions of a text line, or at the beginning or end of a line. To activate insert detection in a Raw Content part, add "insert" to the "raw-content.pen.gestures" configuration list.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.before
- the portion of the text line before the insert gesture.after
- the portion of the text line after the insert gesture.- Returns:
- the GestureAction to perform.
-
onStrikethrough
@NotNull @NotNull GestureAction onStrikethrough(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, @NotNull @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been striked through. To activate strikethrough detection in a Raw Content part, add "strike-through" to the "raw-content.pen.gestures" configuration list.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.selection
- the striked through portion of text.- Returns:
- the GestureAction to perform.
-
onScratch
@NotNull @NotNull GestureAction onScratch(@NotNull @NotNull Editor editor, PointerTool tool, @NotNull @NotNull String gestureStrokeId, @NotNull @NotNull NativeObjectHandle<ContentSelection> selection) Invoked when a portion of text has been scratched. To activate scratch detection in a Raw Content part, add "scratch-out" to the "raw-content.pen.gestures" configuration list.- Parameters:
editor
- the editor.tool
- the tool used to perform the gesture.gestureStrokeId
- the id of the gesture stroke.selection
- the scratched portion of text.- Returns:
- the GestureAction to perform.
-