#include <OffscreenEditor.h>
The OffscreenEditor is a service allowing offscreen interactivity. It is the entry point to edit an associated part and receive change notifications.
- Since
- 2.1
◆ ~OffscreenEditor()
| virtual myscript::iink::OffscreenEditor::~OffscreenEditor |
( |
| ) |
|
|
virtualdefault |
◆ addListener()
Adds the specified listener to this offscreen editor.
- Parameters
-
| listener | the listener to be added. |
◆ removeListener()
Removes the specified listener from this offscreen editor.
- Parameters
-
| listener | the listener to be removed. |
◆ setGestureHandler()
Registers the specified gesture handler to this offscreen editor.
- Parameters
-
| handler | the gesture handler to be used. |
- Exceptions
-
| std::invalid_argument | when handler is nullptr. |
◆ removeGestureHandler()
| virtual void myscript::iink::OffscreenEditor::removeGestureHandler |
( |
| ) |
|
|
pure virtual |
Removes the gesture handler from this offscreen editor if any.
◆ getEngine()
| virtual std::shared_ptr<Engine> myscript::iink::OffscreenEditor::getEngine |
( |
| ) |
|
|
pure virtual |
Returns the Engine to which this offscreen editor is attached.
- Returns
- the engine.
◆ getConfiguration()
| virtual std::shared_ptr<Configuration> myscript::iink::OffscreenEditor::getConfiguration |
( |
| ) |
|
|
pure virtual |
Returns the configuration associated with this offscreen editor.
- Returns
- the offscreen editor configuration.
◆ getHistoryManager()
| virtual std::shared_ptr<HistoryManager> myscript::iink::OffscreenEditor::getHistoryManager |
( |
| ) |
|
|
pure virtual |
Returns the HistoryManager to which this offscreen editor is attached if any.
- Returns
- the history manager or
nullptr.
- Since
- 3.0
◆ getMathSolverController()
| virtual std::shared_ptr<MathSolverController> myscript::iink::OffscreenEditor::getMathSolverController |
( |
| ) |
|
|
pure virtual |
Returns the MathSolverController associated with this offscreen editor.
- Returns
- the math solver controller.
- Since
- 4.0
◆ getScaleX()
| virtual float myscript::iink::OffscreenEditor::getScaleX |
( |
| ) |
const |
|
pure virtual |
Returns the scale to convert input horizontal coordinates unit into mm, such that (X coordinate unit * scaleX = mm).
- Returns
- the horizontal scale.
◆ getScaleY()
| virtual float myscript::iink::OffscreenEditor::getScaleY |
( |
| ) |
const |
|
pure virtual |
Returns the scale to convert input vertical coordinates unit into mm, such that (Y coordinate unit * scaleY = mm).
- Returns
- the vertical scale.
◆ getPart()
| virtual std::shared_ptr<ContentPart> myscript::iink::OffscreenEditor::getPart |
( |
| ) |
|
|
pure virtual |
Returns the part managed by this offscreen editor.
- Returns
- the part.
◆ setPart()
| virtual void myscript::iink::OffscreenEditor::setPart |
( |
std::shared_ptr< ContentPart > |
part | ) |
|
|
pure virtual |
Sets the part managed by this offscreen editor.
- Parameters
-
- Exceptions
-
| std::runtime_error | when no IFontMetricProvider has been set, via setFontMetricsProvider(). |
| std::runtime_error | when part type is not supported. |
| std::runtime_error | when part is already bound. |
| std::runtime_error | when this offscreen editor cannot be configured. |
◆ clear()
| virtual void myscript::iink::OffscreenEditor::clear |
( |
| ) |
|
|
pure virtual |
Removes all content.
- Note
- this function will wait for pending gestures recognition.
◆ isIdle()
| virtual bool myscript::iink::OffscreenEditor::isIdle |
( |
| ) |
|
|
pure virtual |
Checks whether modification operations are over.
- Returns
true if no operation is ongoing, false otherwise.
◆ waitForIdle()
| virtual void myscript::iink::OffscreenEditor::waitForIdle |
( |
| ) |
|
|
pure virtual |
Waits until modification operations are over.
◆ getRootBlockId()
| virtual String myscript::iink::OffscreenEditor::getRootBlockId |
( |
| ) |
|
|
pure virtual |
Returns the block id at the root of the current part.
- Returns
- the root block id, empty if none.
◆ addStrokes()
| virtual std::vector<String> myscript::iink::OffscreenEditor::addStrokes |
( |
const std::vector< PointerEvent > & |
events, |
|
|
bool |
processGestures = true |
|
) |
| |
|
pure virtual |
Adds strokes.
- Note
- if associated with a history manager, adding strokes with gesture processing will create one undo stack changeset per stroke while adding strokes without will create one undo stack changeset for the whole batch.
- Parameters
-
| events | the strokes pointer events (with coordinates in input units). |
| processGestures | tells whether to process gestures or not. |
- Returns
- the new item ids.
- Exceptions
-
| std::runtime_error | when offscreen editor is not associated with a part. |
| std::invalid_argument | when events is empty. |
| std::invalid_argument | when a pointer event contains incorrect data. |
| std::invalid_argument | when a stroke has too many points. |
| std::invalid_argument | when events contain more than 20 strokes and processGestures is true. |
| pointer_sequence_error | when events sequence is not allowed. |
◆ replaceStrokes()
| virtual std::vector<String> myscript::iink::OffscreenEditor::replaceStrokes |
( |
const std::vector< String > & |
itemIds, |
|
|
const std::vector< PointerEvent > & |
events |
|
) |
| |
|
pure virtual |
Replaces strokes.
- Note
- if associated with a history manager, this function will wait for the specified items to be processed to erase them.
- Parameters
-
| itemIds | the item ids to replace. Unknown ids are ignored. |
| events | the replacing strokes pointer events (with coordinates in input units). |
- Returns
- the replacing item ids.
- Exceptions
-
| std::runtime_error | when offscreen editor is not associated with a part. |
| std::invalid_argument | when itemIds is empty. |
| std::invalid_argument | when events is empty. |
| std::invalid_argument | when a pointer event contains incorrect data. |
| std::invalid_argument | when a stroke has too many points. |
| pointer_sequence_error | when events sequence is not allowed. |
◆ erase()
| virtual void myscript::iink::OffscreenEditor::erase |
( |
const std::vector< String > & |
itemIds | ) |
|
|
pure virtual |
Erases the specified items.
- Note
- if associated with a history manager, this function will wait for the specified items to be processed to erase them.
- Parameters
-
| itemIds | the item ids to erase. Unknown ids are ignored. |
- Exceptions
-
| std::runtime_error | when offscreen editor is not associated with a part. |
◆ getTransformStatus()
Checks if a transformation is allowed on the specified items.
- Note
- this function will wait for items pending gesture recognition to get their transform status.
- Parameters
-
| itemIds | the item ids on which to check the transformation. |
| transform | the transformation to check. |
- Returns
- an error code from enum
TransformError.
- Exceptions
-
| std::runtime_error | when editor is not associated with a part. |
| std::invalid_argument | when item ids are not valid. |
◆ transform()
Transforms the specified items (does nothing if transform is identity).
- Note
- this function will wait for items pending gesture recognition to transform them.
- Parameters
-
| itemIds | the item ids on which to apply the transformation. |
| transform | the transformation to apply. |
- Exceptions
-
| std::invalid_argument | when item ids are not valid. |
| std::invalid_argument | when transform is not valid for this operation. |
| std::runtime_error | when editor is not associated with a part. |
| std::runtime_error | when the transform is not allowed on the item ids. |
◆ getAvailableItemsTypes()
| virtual std::vector<String> myscript::iink::OffscreenEditor::getAvailableItemsTypes |
( |
const std::vector< String > & |
itemIds | ) |
|
|
pure virtual |
Returns the available types for the specified items.
- Note
- this function will wait for pending gesture recognition before returning available types.
- Parameters
-
| itemIds | the item ids to request types for. |
- Returns
- an array of the available types.
- Exceptions
-
| std::invalid_argument | when item ids are not valid. |
| std::runtime_error | when offscreen editor is not associated with a part. |
- Since
- 3.1
◆ setItemsType()
| virtual void myscript::iink::OffscreenEditor::setItemsType |
( |
const std::vector< String > & |
itemIds, |
|
|
const String & |
type, |
|
|
bool |
forceSingleBlock |
|
) |
| |
|
pure virtual |
Sets the classification of the specified items to a given type.
- Note
- this function will wait for pending gesture recognition before changing items type.
- Parameters
-
| itemIds | the item ids to classify. |
| type | the content type to set. See getAvailableItemsTypes(). |
| forceSingleBlock | true to force converting the items to a single block, otherwise false. |
- Exceptions
-
| std::invalid_argument | when item ids are not valid. |
| std::runtime_error | when offscreen editor is not associated with a part. |
| std::invalid_argument | when items are not compatible with the type. |
- Since
- 3.1
◆ getSupportedExportMimeTypes()
| virtual std::vector<MimeType> myscript::iink::OffscreenEditor::getSupportedExportMimeTypes |
( |
const std::vector< String > & |
itemIds | ) |
|
|
pure virtual |
Returns the supported export formats for the specified items.
- Parameters
-
| itemIds | the item ids to request export mime types for, empty means full part. |
- Returns
- an array of the supported mime types, empty if not associated with a part.
- Exceptions
-
| std::invalid_argument | when item ids are not valid. |
◆ export_()
| virtual String myscript::iink::OffscreenEditor::export_ |
( |
const std::vector< String > & |
itemIds, |
|
|
MimeType |
mimeType, |
|
|
std::shared_ptr< ParameterSet > |
overrideConfiguration = nullptr |
|
) |
| |
|
pure virtual |
Exports the specified items.
- Note
- the method is named
export_ because the C++ standard defines export as a keyword.
- Parameters
-
| itemIds | the item ids to export, empty means full part. |
| mimeType | the mime type that specifies the output format. |
| overrideConfiguration | the extra configuration used when exporting. |
- Returns
- the exported content.
- Exceptions
-
| std::invalid_argument | when item ids are not valid. |
| std::runtime_error | when offscreen editor is not associated with a part. |
| std::runtime_error | when the specified mime type is not supported. |
| std::runtime_error | when an I/O operation fails. |
| std::runtime_error | when there are some ongoing operations on the part that prevent export, see isIdle(). |
| std::invalid_argument | when overrideConfiguration is invalid. |
The documentation for this class was generated from the following file: