ContentHandler

class ContentHandler(focusableTypes: Set<Int> = setOf( StoryTypes.TITLE.type.number, StoryTypes.TEXT.type.number, StoryTypes.H1.type.number, StoryTypes.H2.type.number, StoryTypes.H3.type.number, StoryTypes.H4.type.number, StoryTypes.CHECK_ITEM.type.number, StoryTypes.UNORDERED_LIST_ITEM.type.number, ), stepsNormalizer: UnitsNormalizationMap, lineBreakMap: (StoryType) -> StoryType = ::defaultLineBreakMap)

Class dedicated to handle adding, deleting or changing StorySteps

Constructors

Link copied to clipboard
constructor(focusableTypes: Set<Int> = setOf( StoryTypes.TITLE.type.number, StoryTypes.TEXT.type.number, StoryTypes.H1.type.number, StoryTypes.H2.type.number, StoryTypes.H3.type.number, StoryTypes.H4.type.number, StoryTypes.CHECK_ITEM.type.number, StoryTypes.UNORDERED_LIST_ITEM.type.number, ), stepsNormalizer: UnitsNormalizationMap, lineBreakMap: (StoryType) -> StoryType = ::defaultLineBreakMap)

Functions

Link copied to clipboard
fun addNewContent(currentStory: Map<Int, StoryStep>, newStoryUnit: StoryStep, position: Int): Map<Int, StoryStep>
Link copied to clipboard
fun addNewContentBulk(currentStory: Map<Int, StoryStep>, newStory: Map<Int, StoryStep>): Map<Int, StoryStep>
Link copied to clipboard
fun bulkDeletion(positions: Iterable<Int>, stories: Map<Int, StoryStep>): Pair<Map<Int, StoryStep>, Map<Int, StoryStep>>

Delete story steps in bulk. Returns a pair with first the new state of stories and the deleted stories.

Link copied to clipboard
fun changeStoryStepState(currentStory: Map<Int, StoryStep>, newState: StoryStep, position: Int): StoryState?
Link copied to clipboard
fun changeStoryType(currentStory: Map<Int, StoryStep>, type: StoryType, position: Int, commandInfo: CommandInfo?): StoryState
Link copied to clipboard
fun deleteStory(deleteInfo: Action.DeleteStory, history: Map<Int, StoryStep>): StoryState?
Link copied to clipboard
fun onLineBreak(currentStory: Map<Int, StoryStep>, lineBreakInfo: Action.LineBreak): Pair<Pair<Int, StoryStep>, StoryState>?