public interface

TextSelectionController

implements FragmentSpecialModeController
com.pspdfkit.ui.special_mode.controller.TextSelectionController

Class Overview

Default controller given when entering text selection mode. Used to control text selection actions.

Summary

Nested Classes
interface TextSelectionController.OnSearchSelectedTextListener Listener invoked when TextSelectionController wants to perform search for the selected text. 
Public Methods
abstract void createLinkAboveSelectedText()
Creates link above the selected text.
abstract TextSelection getTextSelection()
Returns the current text selection.
abstract TextSelectionManager getTextSelectionManager()
Gets text selection manager for registering text selection listeners from the controller.
abstract void highlightSelectedText()
Highlight currently selected text.
abstract void highlightSelectedTextAndBeginCommenting()
Highlight the currently selected text and begin editing its comments.
abstract boolean isInstantHighlightCommentingEnabledByConfiguration()
Indicates whether Instant Comments on text highlights are enabled by configuration
abstract boolean isLinkCreationEnabledByConfiguration()
Indicates whether annotation editing is enabled by configuration and link annotations are editable.
abstract boolean isRedactionEnabledByConfiguration()
Indicates whether text redaction is enabled by configuration-
abstract boolean isTextExtractionEnabledByDocumentPermissions()
Indicates whether the text extraction is enabled by document permissions, meaning the document contains EXTRACT permission.
abstract boolean isTextHighlightingEnabledByConfiguration()
Indicates whether annotation editing (text highlights are annotations) is enabled by configuration.
abstract boolean isTextSharingEnabledByConfiguration()
Indicates whether text sharing is enabled by configuration.
abstract boolean isTextSpeakEnabledByDocumentPermissions()
Indicates whether the text extraction for accessibility purposes is enabled by document permissions, meaning the document contains EXTRACT_ACCESSIBILITY permission.
abstract void redactSelectedText()
Redact currently selected text.
abstract void searchSelectedText()
Search currently selected text.
abstract void setOnSearchSelectedTextListener(TextSelectionController.OnSearchSelectedTextListener searchSelectedTextListener)
Sets a new TextSelectionController.OnSearchSelectedTextListener or replaces an existing one.
abstract void setTextSelection(TextSelection textSelection)
Sets the selected text.
abstract void strikeoutSelectedText()
Strike out currently selected text.
abstract void underlineSelectedText()
Underline currently selected text.
[Expand]
Inherited Methods
From interface com.pspdfkit.ui.special_mode.controller.base.FragmentSpecialModeController
From interface com.pspdfkit.ui.special_mode.controller.base.SpecialModeController

Public Methods

public abstract void createLinkAboveSelectedText ()

Creates link above the selected text.

public abstract TextSelection getTextSelection ()

Returns the current text selection.

Returns
  • Currently selected text.

public abstract TextSelectionManager getTextSelectionManager ()

Gets text selection manager for registering text selection listeners from the controller.

Returns
  • A text selection manager for managing the text selection listeners.

public abstract void highlightSelectedText ()

Highlight currently selected text.

public abstract void highlightSelectedTextAndBeginCommenting ()

Highlight the currently selected text and begin editing its comments.

Only useful in the context of Instant.

public abstract boolean isInstantHighlightCommentingEnabledByConfiguration ()

Indicates whether Instant Comments on text highlights are enabled by configuration

Returns
  • true if creating an Instant Comment thread from a text highlight is enabled, false otherwise.

public abstract boolean isLinkCreationEnabledByConfiguration ()

Indicates whether annotation editing is enabled by configuration and link annotations are editable.

Returns
  • true if adding links is enabled by configuration, false otherwise.

public abstract boolean isRedactionEnabledByConfiguration ()

Indicates whether text redaction is enabled by configuration-

Returns
  • true if text redaction is enabled, false otherwise.

public abstract boolean isTextExtractionEnabledByDocumentPermissions ()

Indicates whether the text extraction is enabled by document permissions, meaning the document contains EXTRACT permission.

Returns
  • true if text extraction is enabled, false otherwise.

public abstract boolean isTextHighlightingEnabledByConfiguration ()

Indicates whether annotation editing (text highlights are annotations) is enabled by configuration.

Returns
  • true if adding highlight annotations is enabled by configuration, false otherwise.

public abstract boolean isTextSharingEnabledByConfiguration ()

Indicates whether text sharing is enabled by configuration.

Returns
  • true if text sharing is enabled by configuration, false otherwise.

public abstract boolean isTextSpeakEnabledByDocumentPermissions ()

Indicates whether the text extraction for accessibility purposes is enabled by document permissions, meaning the document contains EXTRACT_ACCESSIBILITY permission.

Returns
  • true if text extraction for accessibility purposes is enabled, false otherwise.

public abstract void redactSelectedText ()

Redact currently selected text.

public abstract void searchSelectedText ()

Search currently selected text.

public abstract void setOnSearchSelectedTextListener (TextSelectionController.OnSearchSelectedTextListener searchSelectedTextListener)

Sets a new TextSelectionController.OnSearchSelectedTextListener or replaces an existing one. This allows custom handling for selected text search.

Parameters
searchSelectedTextListener New listener or null to clear the listener.

public abstract void setTextSelection (TextSelection textSelection)

Sets the selected text.

Parameters
textSelection Text selection to select.

public abstract void strikeoutSelectedText ()

Strike out currently selected text.

public abstract void underlineSelectedText ()

Underline currently selected text.