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

#include <PlaceholderController.h>

Public Member Functions

virtual ~PlaceholderController ()=default
 
virtual std::shared_ptr< ContentBlock > add (const graphics::Rectangle &box, const String &inputFile, MimeType mimeType, const String &userData, bool selectOnAdd, const PlaceholderInteractivityOptions &interactivityOptions)=0
 
virtual void update (std::shared_ptr< ContentSelection > placeholder, const graphics::Rectangle &box, const String &inputFile, MimeType mimeType, const String &userData)=0
 
virtual void setUserData (std::shared_ptr< ContentSelection > placeholder, const String &userData)=0
 
virtual String getUserData (std::shared_ptr< ContentSelection > placeholder)=0
 
virtual void setVisible (std::shared_ptr< ContentSelection > placeholder, bool visible)=0
 
virtual bool isVisible (std::shared_ptr< ContentSelection > placeholder)=0
 
virtual bool isPlaceholder (std::shared_ptr< ContentSelection > selection)=0
 

Detailed Description

A PlaceholderController allows to add and update placeholders in an editor.

Since
3.2

Constructor & Destructor Documentation

◆ ~PlaceholderController()

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

Member Function Documentation

◆ add()

virtual std::shared_ptr< ContentBlock > myscript::iink::PlaceholderController::add ( const graphics::Rectangle &  box,
const String &  inputFile,
MimeType  mimeType,
const String &  userData,
bool  selectOnAdd,
const PlaceholderInteractivityOptions &  interactivityOptions 
)
pure virtual

Adds a new placeholder image to the part.

Parameters
boxthe position of the new image (view coordinates in pixel).
inputFilethe image file to add.
mimeTypethe mime type that specifies the format of inputFile.
userDatacustom additional data.
selectOnAddtrue to select the image when it is added, otherwise false.
interactivityOptionsthe allowed interactivity features.
Returns
the block associated with the newly added placeholder.
Exceptions
std::invalid_argumentwhen the dimensions of box are not valid.
std::invalid_argumentwhen mimeType is not an image type.
std::runtime_errorwhen inputFile is not the path to a valid image file.
std::runtime_errorwhen editor is not associated with a Raw Content part.
std::runtime_errorwhen an I/O operation fails.

◆ update()

virtual void myscript::iink::PlaceholderController::update ( std::shared_ptr< ContentSelection >  placeholder,
const graphics::Rectangle &  box,
const String &  inputFile,
MimeType  mimeType,
const String &  userData 
)
pure virtual

Updates the specified placeholder image and moves it to the front.

Parameters
placeholderthe placeholder image to update.
boxthe position of the new image (view coordinates in pixel).
inputFilethe image file to add.
mimeTypethe mime type that specifies the format of inputFile.
userDatacustom additional data.
Exceptions
std::invalid_argumentwhen placeholder is not a valid placeholder image.
std::invalid_argumentwhen the dimensions of box are not valid.
std::runtime_errorwhen inputFile is not the path to a valid image file.
std::invalid_argumentwhen mimeType is not an image type.
std::runtime_errorwhen editor is not associated with a Raw Content part.

◆ setUserData()

virtual void myscript::iink::PlaceholderController::setUserData ( std::shared_ptr< ContentSelection >  placeholder,
const String &  userData 
)
pure virtual

Sets the custom user data of a placeholder image.

Parameters
placeholderthe placeholder image to update.
userDatacustom additional data.
Exceptions
std::invalid_argumentwhen placeholder is not a valid placeholder image.
std::runtime_errorwhen editor is not associated with a Raw Content part.

◆ getUserData()

virtual String myscript::iink::PlaceholderController::getUserData ( std::shared_ptr< ContentSelection >  placeholder)
pure virtual

Returns the user data corresponding to a placeholder image.

Parameters
placeholderthe placeholder image.
Returns
the user data.
Exceptions
std::invalid_argumentwhen placeholder is not a valid placeholder image.
std::runtime_errorwhen editor is not associated with a Raw Content part.

◆ setVisible()

virtual void myscript::iink::PlaceholderController::setVisible ( std::shared_ptr< ContentSelection >  placeholder,
bool  visible 
)
pure virtual

Set a placeholder image visibility.

Parameters
placeholderthe placeholder image to update.
visibletrue to set the placeholder image visible, otherwise it will be set invisible
Exceptions
std::invalid_argumentwhen placeholder is not a valid placeholder image.
std::runtime_errorwhen editor is not associated with a Raw Content part.

◆ isVisible()

virtual bool myscript::iink::PlaceholderController::isVisible ( std::shared_ptr< ContentSelection >  placeholder)
pure virtual

Returns the visibility of a placeholder image.

Parameters
placeholderthe placeholder image to update.
Returns
true if the placeholder image is visible, otherwise false.
Exceptions
std::invalid_argumentwhen placeholder is not a valid placeholder image.
std::runtime_errorwhen editor is not associated with a Raw Content part.

◆ isPlaceholder()

virtual bool myscript::iink::PlaceholderController::isPlaceholder ( std::shared_ptr< ContentSelection >  selection)
pure virtual

Indicates whether a content selection is a placeholder.

Parameters
selectionthe content selection.
Returns
true if selection is a placeholder, otherwise false.
Exceptions
std::runtime_errorwhen editor is not associated with a Raw Content part.

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