#include <PlaceholderController.h>
|
| 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 |
| |
A PlaceholderController allows to add and update placeholders in an editor.
- Since
- 3.2
◆ ~PlaceholderController()
| virtual myscript::iink::PlaceholderController::~PlaceholderController |
( |
| ) |
|
|
virtualdefault |
◆ add()
Adds a new placeholder image to the part.
- Parameters
-
| box | the position of the new image (view coordinates in pixel). |
| inputFile | the image file to add. |
| mimeType | the mime type that specifies the format of inputFile. |
| userData | custom additional data. |
| selectOnAdd | true to select the image when it is added, otherwise false. |
| interactivityOptions | the allowed interactivity features. |
- Returns
- the block associated with the newly added placeholder.
- Exceptions
-
| std::invalid_argument | when the dimensions of box are not valid. |
| std::invalid_argument | when mimeType is not an image type. |
| std::runtime_error | when inputFile is not the path to a valid image file. |
| std::runtime_error | when editor is not associated with a Raw Content part. |
| std::runtime_error | when an I/O operation fails. |
◆ update()
Updates the specified placeholder image and moves it to the front.
- Parameters
-
| placeholder | the placeholder image to update. |
| box | the position of the new image (view coordinates in pixel). |
| inputFile | the image file to add. |
| mimeType | the mime type that specifies the format of inputFile. |
| userData | custom additional data. |
- Exceptions
-
| std::invalid_argument | when placeholder is not a valid placeholder image. |
| std::invalid_argument | when the dimensions of box are not valid. |
| std::runtime_error | when inputFile is not the path to a valid image file. |
| std::invalid_argument | when mimeType is not an image type. |
| std::runtime_error | when 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
-
| placeholder | the placeholder image to update. |
| userData | custom additional data. |
- Exceptions
-
| std::invalid_argument | when placeholder is not a valid placeholder image. |
| std::runtime_error | when 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
-
| placeholder | the placeholder image. |
- Returns
- the user data.
- Exceptions
-
| std::invalid_argument | when placeholder is not a valid placeholder image. |
| std::runtime_error | when 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
-
| placeholder | the placeholder image to update. |
| visible | true to set the placeholder image visible, otherwise it will be set invisible |
- Exceptions
-
| std::invalid_argument | when placeholder is not a valid placeholder image. |
| std::runtime_error | when 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
-
| placeholder | the placeholder image to update. |
- Returns
true if the placeholder image is visible, otherwise false.
- Exceptions
-
| std::invalid_argument | when placeholder is not a valid placeholder image. |
| std::runtime_error | when 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
-
| selection | the content selection. |
- Returns
true if selection is a placeholder, otherwise false.
- Exceptions
-
| std::runtime_error | when editor is not associated with a Raw Content part. |
The documentation for this class was generated from the following file: