Interface TextSelectionController
-
- All Implemented Interfaces:
-
com.pspdfkit.ui.special_mode.controller.base.FragmentSpecialModeController
,com.pspdfkit.ui.special_mode.controller.base.SpecialModeController
public interface TextSelectionController implements FragmentSpecialModeController
Default controller given when entering text selection mode. Used to control text selection actions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
TextSelectionController.OnSearchSelectedTextListener
Listener invoked when TextSelectionController wants to perform search for the selected text.
-
Method Summary
Modifier and Type Method Description abstract void
setOnSearchSelectedTextListener(@Nullable() TextSelectionController.OnSearchSelectedTextListener searchSelectedTextListener)
Sets a new OnSearchSelectedTextListener or replaces an existing one. abstract TextSelection
getTextSelection()
Returns the current text selection. abstract void
setTextSelection(@Nullable() TextSelection textSelection)
Sets the selected text. abstract TextSelectionManager
getTextSelectionManager()
Gets text selection manager for registering text selection listeners from the controller. abstract void
highlightSelectedText()
Highlight currently selected text. void
highlightSelectedTextAndBeginCommenting()
Highlight the currently selected text and begin editing its comments. abstract void
redactSelectedText()
Redact currently selected text. abstract void
strikeoutSelectedText()
Strike out currently selected text. abstract void
underlineSelectedText()
Underline currently selected text. abstract void
searchSelectedText()
Search currently selected text. abstract void
createLinkAboveSelectedText()
Creates link above the selected text. abstract boolean
isTextHighlightingEnabledByConfiguration()
Indicates whether annotation editing (text highlights are annotations) is enabled by configuration. abstract boolean
isLinkCreationEnabledByConfiguration()
Indicates whether annotation editing is enabled by configuration and link annotations are editable. abstract boolean
isTextSharingEnabledByConfiguration()
Indicates whether text sharing 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
isTextSpeakEnabledByDocumentPermissions()
Indicates whether the text extraction for accessibility purposes is enabled by document permissions, meaning the document contains EXTRACT_ACCESSIBILITY permission. abstract boolean
isRedactionEnabledByConfiguration()
Indicates whether text redaction is enabled by configuration- boolean
isInstantHighlightCommentingEnabledByConfiguration()
Indicates whether Instant Comments on text highlights are enabled by configuration -
-
Method Detail
-
setOnSearchSelectedTextListener
abstract void setOnSearchSelectedTextListener(@Nullable() TextSelectionController.OnSearchSelectedTextListener searchSelectedTextListener)
Sets a new OnSearchSelectedTextListener or replaces an existing one. This allows custom handling for selected text search.
- Parameters:
searchSelectedTextListener
- New listener ornull
to clear the listener.
-
getTextSelection
@Nullable() abstract TextSelection getTextSelection()
Returns the current text selection.
- Returns:
Currently selected text.
-
setTextSelection
abstract void setTextSelection(@Nullable() TextSelection textSelection)
Sets the selected text.
- Parameters:
textSelection
- Text selection to select.
-
getTextSelectionManager
@NonNull() 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.
-
highlightSelectedText
abstract void highlightSelectedText()
Highlight currently selected text.
-
highlightSelectedTextAndBeginCommenting
void highlightSelectedTextAndBeginCommenting()
Highlight the currently selected text and begin editing its comments.
Only useful in the context of Instant.
-
redactSelectedText
abstract void redactSelectedText()
Redact currently selected text.
-
strikeoutSelectedText
abstract void strikeoutSelectedText()
Strike out currently selected text.
-
underlineSelectedText
abstract void underlineSelectedText()
Underline currently selected text.
-
searchSelectedText
abstract void searchSelectedText()
Search currently selected text.
-
createLinkAboveSelectedText
abstract void createLinkAboveSelectedText()
Creates link above the selected text.
-
isTextHighlightingEnabledByConfiguration
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.
-
isLinkCreationEnabledByConfiguration
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.
-
isTextSharingEnabledByConfiguration
abstract boolean isTextSharingEnabledByConfiguration()
Indicates whether text sharing is enabled by configuration.
- Returns:
true
if text sharing is enabled by configuration,false
otherwise.
-
isTextExtractionEnabledByDocumentPermissions
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.
-
isTextSpeakEnabledByDocumentPermissions
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.
-
isRedactionEnabledByConfiguration
abstract boolean isRedactionEnabledByConfiguration()
Indicates whether text redaction is enabled by configuration-
- Returns:
true
if text redaction is enabled,false
otherwise.
-
isInstantHighlightCommentingEnabledByConfiguration
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.
-
-
-
-