MyScript Interactive Ink SDK 4.4.2
Public Member Functions | List of all members
myscript::iink::OffscreenEditor Class Referenceabstract

#include <OffscreenEditor.h>

Public Member Functions

virtual ~OffscreenEditor ()=default
 
virtual void addListener (std::shared_ptr< IOffscreenEditorListener > listener)=0
 
virtual void removeListener (std::shared_ptr< IOffscreenEditorListener > listener)=0
 
virtual void setGestureHandler (std::shared_ptr< IOffscreenGestureHandler > handler)=0
 
virtual void removeGestureHandler ()=0
 
virtual std::shared_ptr< Engine > getEngine ()=0
 
virtual std::shared_ptr< Configuration > getConfiguration ()=0
 
virtual std::shared_ptr< HistoryManager > getHistoryManager ()=0
 
virtual std::shared_ptr< MathSolverController > getMathSolverController ()=0
 
virtual float getScaleX () const =0
 
virtual float getScaleY () const =0
 
virtual std::shared_ptr< ContentPart > getPart ()=0
 
virtual void setPart (std::shared_ptr< ContentPart > part)=0
 
virtual void clear ()=0
 
virtual bool isIdle ()=0
 
virtual void waitForIdle ()=0
 
virtual String getRootBlockId ()=0
 
virtual std::vector< String > addStrokes (const std::vector< PointerEvent > &events, bool processGestures=true)=0
 
virtual std::vector< String > replaceStrokes (const std::vector< String > &itemIds, const std::vector< PointerEvent > &events)=0
 
virtual void erase (const std::vector< String > &itemIds)=0
 
virtual std::underlying_type< TransformError >::type getTransformStatus (const std::vector< String > &itemIds, const myscript::iink::graphics::Transform &transform)=0
 
virtual void transform (const std::vector< String > &itemIds, const myscript::iink::graphics::Transform &transform)=0
 
virtual std::vector< String > getAvailableItemsTypes (const std::vector< String > &itemIds)=0
 
virtual void setItemsType (const std::vector< String > &itemIds, const String &type, bool forceSingleBlock)=0
 
virtual std::vector< MimeType > getSupportedExportMimeTypes (const std::vector< String > &itemIds)=0
 
virtual String export_ (const std::vector< String > &itemIds, MimeType mimeType, std::shared_ptr< ParameterSet > overrideConfiguration=nullptr)=0
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~OffscreenEditor()

virtual myscript::iink::OffscreenEditor::~OffscreenEditor ( )
virtualdefault

Member Function Documentation

◆ addListener()

virtual void myscript::iink::OffscreenEditor::addListener ( std::shared_ptr< IOffscreenEditorListener >  listener)
pure virtual

Adds the specified listener to this offscreen editor.

Parameters
listenerthe listener to be added.

◆ removeListener()

virtual void myscript::iink::OffscreenEditor::removeListener ( std::shared_ptr< IOffscreenEditorListener >  listener)
pure virtual

Removes the specified listener from this offscreen editor.

Parameters
listenerthe listener to be removed.

◆ setGestureHandler()

virtual void myscript::iink::OffscreenEditor::setGestureHandler ( std::shared_ptr< IOffscreenGestureHandler >  handler)
pure virtual

Registers the specified gesture handler to this offscreen editor.

Parameters
handlerthe gesture handler to be used.
Exceptions
std::invalid_argumentwhen 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
partthe part.
Exceptions
std::runtime_errorwhen no IFontMetricProvider has been set, via setFontMetricsProvider().
std::runtime_errorwhen part type is not supported.
std::runtime_errorwhen part is already bound.
std::runtime_errorwhen 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
eventsthe strokes pointer events (with coordinates in input units).
processGesturestells whether to process gestures or not.
Returns
the new item ids.
Exceptions
std::runtime_errorwhen offscreen editor is not associated with a part.
std::invalid_argumentwhen events is empty.
std::invalid_argumentwhen a pointer event contains incorrect data.
std::invalid_argumentwhen a stroke has too many points.
std::invalid_argumentwhen events contain more than 20 strokes and processGestures is true.
pointer_sequence_errorwhen 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
itemIdsthe item ids to replace. Unknown ids are ignored.
eventsthe replacing strokes pointer events (with coordinates in input units).
Returns
the replacing item ids.
Exceptions
std::runtime_errorwhen offscreen editor is not associated with a part.
std::invalid_argumentwhen itemIds is empty.
std::invalid_argumentwhen events is empty.
std::invalid_argumentwhen a pointer event contains incorrect data.
std::invalid_argumentwhen a stroke has too many points.
pointer_sequence_errorwhen 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
itemIdsthe item ids to erase. Unknown ids are ignored.
Exceptions
std::runtime_errorwhen offscreen editor is not associated with a part.

◆ getTransformStatus()

virtual std::underlying_type< TransformError >::type myscript::iink::OffscreenEditor::getTransformStatus ( const std::vector< String > &  itemIds,
const myscript::iink::graphics::Transform &  transform 
)
pure virtual

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
itemIdsthe item ids on which to check the transformation.
transformthe transformation to check.
Returns
an error code from enum TransformError.
Exceptions
std::runtime_errorwhen editor is not associated with a part.
std::invalid_argumentwhen item ids are not valid.

◆ transform()

virtual void myscript::iink::OffscreenEditor::transform ( const std::vector< String > &  itemIds,
const myscript::iink::graphics::Transform &  transform 
)
pure virtual

Transforms the specified items (does nothing if transform is identity).

Note
this function will wait for items pending gesture recognition to transform them.
Parameters
itemIdsthe item ids on which to apply the transformation.
transformthe transformation to apply.
Exceptions
std::invalid_argumentwhen item ids are not valid.
std::invalid_argumentwhen transform is not valid for this operation.
std::runtime_errorwhen editor is not associated with a part.
std::runtime_errorwhen 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
itemIdsthe item ids to request types for.
Returns
an array of the available types.
Exceptions
std::invalid_argumentwhen item ids are not valid.
std::runtime_errorwhen 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
itemIdsthe item ids to classify.
typethe content type to set. See getAvailableItemsTypes().
forceSingleBlocktrue to force converting the items to a single block, otherwise false.
Exceptions
std::invalid_argumentwhen item ids are not valid.
std::runtime_errorwhen offscreen editor is not associated with a part.
std::invalid_argumentwhen 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
itemIdsthe 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_argumentwhen 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
itemIdsthe item ids to export, empty means full part.
mimeTypethe mime type that specifies the output format.
overrideConfigurationthe extra configuration used when exporting.
Returns
the exported content.
Exceptions
std::invalid_argumentwhen item ids are not valid.
std::runtime_errorwhen offscreen editor is not associated with a part.
std::runtime_errorwhen the specified mime type is not supported.
std::runtime_errorwhen an I/O operation fails.
std::runtime_errorwhen there are some ongoing operations on the part that prevent export, see isIdle().
std::invalid_argumentwhen overrideConfiguration is invalid.

The documentation for this class was generated from the following file: