WriteopiaManager

class WriteopiaManager(stepsNormalizer: UnitsNormalizationMap = StepsMapNormalizationBuilder.reduceNormalizations { defaultNormalizers() }, movementHandler: MovementHandler = MovementHandler(), contentHandler: ContentHandler = ContentHandler( stepsNormalizer = stepsNormalizer ), focusHandler: FocusHandler = FocusHandler())

Constructors

Link copied to clipboard
constructor(stepsNormalizer: UnitsNormalizationMap = StepsMapNormalizationBuilder.reduceNormalizations { defaultNormalizers() }, movementHandler: MovementHandler = MovementHandler(), contentHandler: ContentHandler = ContentHandler( stepsNormalizer = stepsNormalizer ), focusHandler: FocusHandler = FocusHandler())

Functions

Link copied to clipboard
fun bulkDelete(positions: Iterable<Int>, stories: Map<Int, StoryStep>): Pair<Map<Int, StoryStep>, Map<Int, StoryStep>>

Deletes the whole selection. All StoryStep in the selection will be deleted.

Link copied to clipboard

At the moment it is only possible to check items not inside groups. Todo: Fix it!

Link copied to clipboard
fun changeStoryType(position: Int, storyType: StoryType, commandInfo: CommandInfo?, storyState: StoryState): StoryState

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.

Link copied to clipboard

Merges two StoryStep into a group. This can be used to merge two images into a message group or any other kind of group.

Link copied to clipboard
fun moveRequest(move: Action.Move, storyState: StoryState): StoryState

A request to move a content to a position.

Link copied to clipboard
fun newStory(documentId: String = GenerateId.generate(), title: String = ""): Pair<DocumentInfo, StoryState>
Link copied to clipboard
fun nextFocusOrCreate(position: Int, storyState: StoryState): StoryState

Moves the focus to the next available StoryStep if it can't find a step to focus, it creates a new StoryStep at the end of the document.

Link copied to clipboard
fun onDelete(deleteStory: Action.DeleteStory, storyState: StoryState): StoryState?

Deletes a StoryStep

Link copied to clipboard

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.