MeasurementValueConfigurationEditor

Interface that allows you to modify the list of MeasurementValueConfigurations stored in the document. You can obtain an instance of it by calling PdfFragment.getMeasurementValueConfigurationEditor

Types

Link copied to clipboard
interface ChangeListener

Listener interface to observe changes in the document's MeasurementValueConfiguration list

Properties

Link copied to clipboard

Query all MeasurementValueConfigurations currently existing in the document.

Functions

Link copied to clipboard
abstract fun add(value: MeasurementValueConfiguration, addToUndo: Boolean)

Adds the value configuration to the document's configuration list. No checks are being made, no dialogs displayed.

abstract fun add(context: Context, value: MeasurementValueConfiguration, onSelectedExistingConfiguration: MeasurementValueConfigurationPickerListener): Boolean

Adds the provided configuration to the document. If it's already present in the document, a dialog is displayed and this function returns false. If the user decides via the dialog to use the already existing configuration, value will not be added to the document, onDeletedUsedConfiguration is called with the existing configuration as parameter and this function returns false.

Link copied to clipboard

Register a ChangeListener to get notified when the document's MeasurementValueConfiguration list get's updated. If the provider has been registered previously, this method will be a no-op.

Link copied to clipboard

Similar as MeasurementValueConfigurationEditor.getUsageCount but returns a list of all annotations that

Link copied to clipboard
abstract suspend fun getUsageCount(configuration: MeasurementValueConfiguration): Int

Checks how many annotations are using the provided configuration.

Link copied to clipboard
abstract fun modify(context: Context, oldValue: MeasurementValueConfiguration, newValue: MeasurementValueConfiguration, onSelectedExistingConfiguration: MeasurementValueConfigurationPickerListener): Boolean

Modifies an existing MeasurementValueConfiguration in the current document. Any measurement annotations that use the original configuration will be updated, too. On top of that, it is checked if the modified value matches an already existing configuration. In that case a dialog is displayed and asks how to proceed. If the dialog is confirmed with "Use Existing" the provided callback onSelectedExistingConfiguration informs about the used configuration. The original configuration will be deleted in this case.

abstract fun modify(oldValue: MeasurementValueConfiguration, newValue: MeasurementValueConfiguration, modifyAssociatedAnnotations: Boolean, addToUndo: Boolean)

Replaces the oldValue configuration straightforward in the document's configuration list with newValue. No checks are being made, no dialogs displayed.

Link copied to clipboard
abstract fun remove(context: Context, value: MeasurementValueConfiguration)

Deletes the provided configuration from the document. If it's currently in use by any measurement annotations, a dialog is displayed. If the user decides via the dialog to delete the configuration anyways, the operation proceeds and will also delete those affected annotations.

abstract fun remove(value: MeasurementValueConfiguration, deleteAssociatedAnnotations: Boolean, addToUndo: Boolean)

Deletes the value configuration from the document's configuration list. No checks are being made, no dialogs displayed.

Link copied to clipboard

Remove a previously registered ChangeListener. If the listener hasn't been registered previously, this method will be a no-op.

Link copied to clipboard
abstract fun startCalibrationTool()

Starts the scale calibration tool. (Same as activating the calibration tool from the AnnotationCreationToolBar)