Interface ContentEditingController
-
- All Implemented Interfaces:
-
com.pspdfkit.ui.inspector.PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener
,com.pspdfkit.ui.special_mode.controller.base.FragmentSpecialModeController
,com.pspdfkit.ui.special_mode.controller.base.SpecialModeController
public interface ContentEditingController implements FragmentSpecialModeController, PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener
-
-
Method Summary
Modifier and Type Method Description abstract ContentEditingManager
getContentEditingManager()
Returns an content editing manager which you can use to register listeners from the controller. boolean
isUndoEnabled()
Checks whether the undo button is enabled abstract ContentEditingStylingBarItem
getActiveContentEditingStylingItem()
Get the ContentEditingStylingBarItem to determine which annotation inspector to display abstract ContentEditingFormatter
getCurrentFormatter()
Get the formatter that will be used to update the user selections on the UI boolean
isRedoEnabled()
Checks whether the redo button is enabled abstract boolean
isSaveEnabled()
Checks whether the save button is enabled. abstract boolean
hasUnsavedChanges()
Checks whether there are unsaved content changes. abstract void
clearContentEditing()
Called when the user clicks the clear button on the content editing styling bar abstract boolean
isClearContentEditingEnabled()
Check function for the ContentEditingStylingBar bar if it should enable or disable its "Clear" button. abstract void
displayFontNamesSheet(@Nullable() StyleInfo preselectStyle)
Called when the user clicks the font name button on the content editing styling bar abstract void
displayFontSizesSheet(@Nullable() StyleInfo preselectStyle)
Called when the user clicks the font size button on the content editing styling bar abstract void
displayColorPicker(@Nullable() StyleInfo preselectStyle)
Called when the user clicks the font color button on the content editing styling bar abstract void
displayLineSpacingSheet(@Nullable() Float preselectLineSpacing)
Called when the user clicks the line spacing button on the content editing styling bar abstract void
finishContentEditingSession()
Called to exit a current content editing session. abstract void
finishContentEditingSession(boolean saveContent)
Called to exit a current content editing session abstract UndoManager
getUndoManager()
Delivers the content editing undo manager abstract void
bindContentEditingInspectorController(@NonNull() ContentEditingInspectorController contentEditingInspectorController)
Binds to the content editing inspector controller for managing content editing views abstract void
unbindContentEditingInspectorController()
Unbinds from previously bound content editing inspector controller. abstract StyleInfo
getCurrentStyleInfo()
Returns the current style of the currently edited textblock for the current cursor position/selection, or null
if there's no such thingabstract TextBlockStyleInfo
getCurrentTextBlockStyleInfo()
Returns the global style properties of the currently edited textblock, or null
if there's no such thingabstract boolean
isBoldStyleButtonEnabled(@Nullable() StyleInfo styleInfo)
Evaluates the enabled state for the "bold" button in the ContentEditingStylingBar abstract boolean
isItalicStyleButtonEnabled(@Nullable() StyleInfo styleInfo)
Evaluates the enabled state for the "italic" button in the ContentEditingStylingBar -
-
Method Detail
-
getContentEditingManager
@NonNull() abstract ContentEditingManager getContentEditingManager()
Returns an content editing manager which you can use to register listeners from the controller.
- Returns:
ContentEditingManager managing the content editing listeners.
-
isUndoEnabled
boolean isUndoEnabled()
Checks whether the undo button is enabled
- Returns:
whether the undo button is enabled or not
-
getActiveContentEditingStylingItem
abstract ContentEditingStylingBarItem getActiveContentEditingStylingItem()
Get the ContentEditingStylingBarItem to determine which annotation inspector to display
- Returns:
the current styling item selected on the ContentEditingStylingBar
-
getCurrentFormatter
@Nullable() abstract ContentEditingFormatter getCurrentFormatter()
Get the formatter that will be used to update the user selections on the UI
- Returns:
the current formatter
-
isRedoEnabled
boolean isRedoEnabled()
Checks whether the redo button is enabled
- Returns:
whether the redo button is enabled or not
-
isSaveEnabled
abstract boolean isSaveEnabled()
Checks whether the save button is enabled.
- Returns:
true
if the save button is enabled, otherwisefalse
-
hasUnsavedChanges
abstract boolean hasUnsavedChanges()
Checks whether there are unsaved content changes.
- Returns:
true
if there are unsaved changes, otherwisefalse
-
clearContentEditing
abstract void clearContentEditing()
Called when the user clicks the clear button on the content editing styling bar
-
isClearContentEditingEnabled
abstract boolean isClearContentEditingEnabled()
Check function for the ContentEditingStylingBar bar if it should enable or disable its "Clear" button.
- Returns:
true
if the button in the styling bar should be enabled.
-
displayFontNamesSheet
abstract void displayFontNamesSheet(@Nullable() StyleInfo preselectStyle)
Called when the user clicks the font name button on the content editing styling bar
-
displayFontSizesSheet
abstract void displayFontSizesSheet(@Nullable() StyleInfo preselectStyle)
Called when the user clicks the font size button on the content editing styling bar
-
displayColorPicker
abstract void displayColorPicker(@Nullable() StyleInfo preselectStyle)
Called when the user clicks the font color button on the content editing styling bar
-
displayLineSpacingSheet
abstract void displayLineSpacingSheet(@Nullable() Float preselectLineSpacing)
Called when the user clicks the line spacing button on the content editing styling bar
-
finishContentEditingSession
abstract void finishContentEditingSession()
Called to exit a current content editing session. If there are unsaved changes, a dialog is shown asking how to proceed.
-
finishContentEditingSession
abstract void finishContentEditingSession(boolean saveContent)
Called to exit a current content editing session
- Parameters:
saveContent
- passtrue
if any modified content should be saved back to the document.
-
getUndoManager
@NonNull() abstract UndoManager getUndoManager()
Delivers the content editing undo manager
-
bindContentEditingInspectorController
abstract void bindContentEditingInspectorController(@NonNull() ContentEditingInspectorController contentEditingInspectorController)
Binds to the content editing inspector controller for managing content editing views
- Parameters:
contentEditingInspectorController
- Controller for managing the content editing styling bar
-
unbindContentEditingInspectorController
abstract void unbindContentEditingInspectorController()
Unbinds from previously bound content editing inspector controller.
-
getCurrentStyleInfo
@Nullable() abstract StyleInfo getCurrentStyleInfo()
Returns the current style of the currently edited textblock for the current cursor position/selection, or
null
if there's no such thing
-
getCurrentTextBlockStyleInfo
@Nullable() abstract TextBlockStyleInfo getCurrentTextBlockStyleInfo()
Returns the global style properties of the currently edited textblock, or
null
if there's no such thing
-
isBoldStyleButtonEnabled
abstract boolean isBoldStyleButtonEnabled(@Nullable() StyleInfo styleInfo)
Evaluates the enabled state for the "bold" button in the ContentEditingStylingBar
- Parameters:
styleInfo
- current styleInfo to be displayed in the styling bar- Returns:
true
if the "bold" button should be enabled,false
otherwise.
-
isItalicStyleButtonEnabled
abstract boolean isItalicStyleButtonEnabled(@Nullable() StyleInfo styleInfo)
Evaluates the enabled state for the "italic" button in the ContentEditingStylingBar
- Parameters:
styleInfo
- current styleInfo to be displayed in the styling bar- Returns:
true
if the "italic" button should be enabled,false
otherwise.
-
-
-
-