Writeopia State Manager
This is the entry class of the framework. It follows the Controller pattern, redirecting all the call to another class responsible for the part of the SDK requested.
Constructors
Properties
Functions
Adds a story in a position. Useful to add stories that were not created by the end user, but by an API call or different event.
Cancels the current selection.
At the moment it is only possible to check items not inside groups. Todo: Fix it!
Changes the story type. The type of a messages changes without changing the content of it. Commands normally change the type of a message. From a message to a unordered list item, for example.
A click at the end of the document. The focus should be moved to the first StoryStep that can receive the focus, from last to first.
Deletes the whole selection. All StoryStep in the selection will be deleted.
Return a list of consecutive selections, with start and end position and the merged text that is selected
Initializes a document passed as a parameter. This method should be used when you would like to load a document from a database and start editing it, instead of creating something new.
Merges two StoryStep into a group. This can be used to merge two images into a message group or any other kind of group.
A request to move a content to a position.
Creates a new story. Use this when you wouldn't like to load a documented previously saved.
Click lister when user clicks in the menu to add a check item
Clears the WriteopiaStateManager. Use this in the onCleared of your ViewModel.
Click lister when user clicks in the menu to add a code block
Creates a line break. When a line break happens, the line it divided into two StorySteps of the same, if possible, or the next line will be a Message.
Click lister when user clicks in the menu to add a list item
Add a StoryStep of a position into the selection list. Selected content can be used to perform bulk actions, like bulk edition and bulk deletion.
Saves the document automatically as it is changed. It uses the DocumentTracker passed in the constructor of WriteopiaStateManager