Interface AnnotationEditingController
-
- All Implemented Interfaces:
-
com.pspdfkit.ui.special_mode.controller.base.FragmentSpecialModeController
,com.pspdfkit.ui.special_mode.controller.base.SpecialModeController
public interface AnnotationEditingController implements FragmentSpecialModeController
Default controller given when entering annotation editing mode. Used to control annotation editing mode actions.
-
-
Method Summary
Modifier and Type Method Description abstract List<Annotation>
getCurrentlySelectedAnnotations()
Returns currently edited annotation (if any). boolean
hasCurrentlySelectedAnnotations()
Returns whether there are any currently selected annotations. Annotation
getCurrentlySelectedAnnotation()
Returns the first of the currently edited annotations (if any). Annotation
getCurrentSingleSelectedAnnotation()
Returns the the currently edited annotation - only if there's just a single one being edited. abstract AnnotationManager
getAnnotationManager()
Returns an annotation manager which you can use to register listeners from the controller. void
saveCurrentlySelectedAnnotations()
Saves currently selected annotations to the document. void
saveCurrentlySelectedAnnotation()
Saves currently selected annotations to the document. abstract void
deleteCurrentlySelectedAnnotations()
Deletes currently selected annotations from the document. void
deleteCurrentlySelectedAnnotation()
Deletes currently selected annotations from the document. abstract boolean
shouldDisplayPicker()
Whether annotation inspector toolbar icon should be visible. abstract void
toggleAnnotationInspector()
Displays/hides an annotation inspector for the selected annotation. abstract void
bindAnnotationInspectorController(@NonNull() AnnotationInspectorController annotationInspectorController)
Binds to the annotation inspector controller for managing annotation inspector. abstract void
unbindAnnotationInspectorController()
Unbinds from previously bound annotation inspector controller. abstract PdfConfiguration
getConfiguration()
Returns an active configuration. abstract void
startRecording()
Starts recording the edits. abstract void
stopRecording()
Stops recording the edits, notifies the result and clears current record, so calling startRecording will start from clean state. abstract void
recordAnnotationZIndexEdit(@NonNull() Annotation annotation, int oldZIndex, int newZIndex)
Records the z-index being changed on the specified annotation. abstract void
showAnnotationEditor(@NonNull() Annotation annotation)
Shows annotation editor for the passed annotation. abstract void
enterAudioPlaybackMode()
Starts playback mode for the currently selected sound annotation. abstract void
enterAudioRecordingMode()
Starts recording mode for the currently selected sound annotation. abstract boolean
shouldDisplayPlayAudioButton()
Whether play button should be displayed for the selected sound annotation. abstract boolean
shouldDisplayRecordAudioButton()
Whether record button should be displayed for the selected sound annotation. abstract void
showEditedAnnotationPositionOnThePage(int pageIndex)
Temporarily hides the selected/edited annotation view and shows its relative position on the page. boolean
isDeleteEnabled()
Checks if all currently edited annotations can be deleted. abstract boolean
isDeleteEnabled(@Nullable() List<Annotation> annotations)
Checks if all provided annotations can be deleted. boolean
isCopyEnabled()
Checks if all currently edited annotations can be copied. abstract boolean
isCopyEnabled(@Nullable() List<Annotation> annotations)
Checks if all provided annotations can be copied. boolean
isCutEnabled()
Checks if all currently edited annotations can be cut. boolean
isCutEnabled(@Nullable() List<Annotation> annotations)
Checks if all provided annotations can be cut. -
-
Method Detail
-
getCurrentlySelectedAnnotations
@NonNull() abstract List<Annotation> getCurrentlySelectedAnnotations()
Returns currently edited annotation (if any).
- Returns:
All currently edited annotations. An empty list, if no annotation is currently being edited.
-
hasCurrentlySelectedAnnotations
boolean hasCurrentlySelectedAnnotations()
Returns whether there are any currently selected annotations.
- Returns:
true if there are currently selected annotations, false otherwise.
-
getCurrentlySelectedAnnotation
@Nullable()@Deprecated() Annotation getCurrentlySelectedAnnotation()
Returns the first of the currently edited annotations (if any).
- Returns:
Currently edited annotation, or
null
if none currently edited.
-
getCurrentSingleSelectedAnnotation
@Nullable() Annotation getCurrentSingleSelectedAnnotation()
Returns the the currently edited annotation - only if there's just a single one being edited.
-
getAnnotationManager
@NonNull() abstract AnnotationManager getAnnotationManager()
Returns an annotation manager which you can use to register listeners from the controller.
- Returns:
Annotation manager managing the annotation editing listeners.
-
saveCurrentlySelectedAnnotations
@Deprecated() void saveCurrentlySelectedAnnotations()
Saves currently selected annotations to the document.
-
saveCurrentlySelectedAnnotation
@Deprecated() void saveCurrentlySelectedAnnotation()
Saves currently selected annotations to the document.
-
deleteCurrentlySelectedAnnotations
abstract void deleteCurrentlySelectedAnnotations()
Deletes currently selected annotations from the document.
-
deleteCurrentlySelectedAnnotation
@Deprecated() void deleteCurrentlySelectedAnnotation()
Deletes currently selected annotations from the document.
-
shouldDisplayPicker
abstract boolean shouldDisplayPicker()
Whether annotation inspector toolbar icon should be visible.
-
toggleAnnotationInspector
abstract void toggleAnnotationInspector()
Displays/hides an annotation inspector for the selected annotation.
-
bindAnnotationInspectorController
abstract void bindAnnotationInspectorController(@NonNull() AnnotationInspectorController annotationInspectorController)
Binds to the annotation inspector controller for managing annotation inspector.
- Parameters:
annotationInspectorController
- Controller for managing annotation inspector.
-
unbindAnnotationInspectorController
abstract void unbindAnnotationInspectorController()
Unbinds from previously bound annotation inspector controller.
-
getConfiguration
@NonNull() abstract PdfConfiguration getConfiguration()
Returns an active configuration.
- Returns:
Current configuration.
-
startRecording
abstract void startRecording()
Starts recording the edits.
-
stopRecording
abstract void stopRecording()
Stops recording the edits, notifies the result and clears current record, so calling startRecording will start from clean state.
-
recordAnnotationZIndexEdit
abstract void recordAnnotationZIndexEdit(@NonNull() Annotation annotation, int oldZIndex, int newZIndex)
Records the z-index being changed on the specified annotation.
- Parameters:
annotation
- Annotation being reordered.oldZIndex
- Old z-index of the annotation.newZIndex
- New z-index of the annotation.
-
showAnnotationEditor
abstract void showAnnotationEditor(@NonNull() Annotation annotation)
Shows annotation editor for the passed annotation.
- Parameters:
annotation
- Annotation for which to show the editor.
-
enterAudioPlaybackMode
abstract void enterAudioPlaybackMode()
Starts playback mode for the currently selected sound annotation.
-
enterAudioRecordingMode
abstract void enterAudioRecordingMode()
Starts recording mode for the currently selected sound annotation.
-
shouldDisplayPlayAudioButton
abstract boolean shouldDisplayPlayAudioButton()
Whether play button should be displayed for the selected sound annotation.
-
shouldDisplayRecordAudioButton
abstract boolean shouldDisplayRecordAudioButton()
Whether record button should be displayed for the selected sound annotation.
-
showEditedAnnotationPositionOnThePage
abstract void showEditedAnnotationPositionOnThePage(int pageIndex)
Temporarily hides the selected/edited annotation view and shows its relative position on the page.
- Parameters:
pageIndex
- A page on which to temporarily hide the selected annotation views.
-
isDeleteEnabled
boolean isDeleteEnabled()
Checks if all currently edited annotations can be deleted.
- Returns:
true if all edited annotations can be deleted, false otherwise
-
isDeleteEnabled
abstract boolean isDeleteEnabled(@Nullable() List<Annotation> annotations)
Checks if all provided annotations can be deleted.
- Returns:
true if all annotations can be deleted, false otherwise
-
isCopyEnabled
boolean isCopyEnabled()
Checks if all currently edited annotations can be copied.
- Returns:
true if all annotations can be copied, false otherwise
-
isCopyEnabled
abstract boolean isCopyEnabled(@Nullable() List<Annotation> annotations)
Checks if all provided annotations can be copied.
- Returns:
true if all annotations can be copied, false otherwise
-
isCutEnabled
boolean isCutEnabled()
Checks if all currently edited annotations can be cut.
- Returns:
true if all annotations can be cut, false otherwise
-
isCutEnabled
boolean isCutEnabled(@Nullable() List<Annotation> annotations)
Checks if all provided annotations can be cut.
- Returns:
true if all annotations can be cut, false otherwise
-
-
-
-