Class gui.TextController
Defined in: TextController.js.
Constructor Attributes | Constructor Name and Description |
---|---|
gui.TextController(session, sessionConstraints, sessionContext, inputMemberId, directStyleOp, paragraphStyleOps)
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
createRemoveSelectionOps(range)
Creates operations to remove the provided selection and update the destination
paragraph's style if necessary.
|
<inner> |
createStepIterator(cursorNode)
Checks if there are any walkable positions in the specified direction within
the current root, starting at the specified node.
|
destroy(callback,)
|
|
<inner> |
domToCursorRange(range, subTree, withRootFilter)
Return the equivalent cursor range of the specified DOM range.
|
Insert a paragraph break at the current cursor location.
|
|
<inner> |
insertText(text)
Removes currently selected text (if any) before inserting the supplied text.
|
<inner> |
onCursorEvent(cursor)
|
Removes the currently selected content
|
|
Removes the currently selected content.
|
|
Removes the currently selected content.
|
|
<inner> |
removeTextInDirection(isForward)
Remove the current selection, or if the cursor is collapsed, remove the next step
in the specified direction.
|
<inner> |
toForwardSelection(selection)
Ensures the provided selection is a "forward" selection (i.e.
|
<inner> |
Class Detail
gui.TextController(session, sessionConstraints, sessionContext, inputMemberId, directStyleOp, paragraphStyleOps)
- Parameters:
- {!ops.Session} session
- {!gui.SessionConstraints} sessionConstraints
- {!gui.SessionContext} sessionContext
- {!string} inputMemberId
- {function(!number|!number|!boolean):ops.Operation} directStyleOp
- {function(!number):!Array.} paragraphStyleOps
Method Detail
<inner>
{!Array.}
createRemoveSelectionOps(range)
Creates operations to remove the provided selection and update the destination
paragraph's style if necessary.
- Parameters:
- {!Range} range
- Returns:
- {!Array.}
<inner>
{!core.StepIterator}
createStepIterator(cursorNode)
Checks if there are any walkable positions in the specified direction within
the current root, starting at the specified node.
The iterator is constrained within the root element for the current cursor position so
iteration will stop once the root is entirely walked in the requested direction
- Parameters:
- {!Element} cursorNode
- Returns:
- {!core.StepIterator}
{undefined}
destroy(callback,)
- Parameters:
- {!function(!Error=)} callback,
- passing an error object in case of error
- Returns:
- {undefined}
<inner>
{!{position: !number|length: !number}}
domToCursorRange(range, subTree, withRootFilter)
Return the equivalent cursor range of the specified DOM range.
This is found by rounding the range's start and end DOM points to the closest step as defined by the document's
position filter (and optionally the root filter as well).
- Parameters:
- {!Range} range
- Range to convert to an equivalent cursor selection
- {!Element} subTree
- Subtree to limit step searches within. E.g., limit to steps within a certain paragraph.
- {!boolean} withRootFilter
- Specify true to restrict steps to be within the same root as the range's start container.
- Returns:
- {!{position: !number|length: !number}}
{!boolean}
enqueueParagraphSplittingOps()
Insert a paragraph break at the current cursor location. Will remove any currently selected text first
- Returns:
- {!boolean}
<inner>
{undefined}
insertText(text)
Removes currently selected text (if any) before inserting the supplied text.
- Parameters:
- {!string} text
- Returns:
- {undefined}
{!boolean}
isEnabled()
- Returns:
- {!boolean}
<inner>
{undefined}
onCursorEvent(cursor)
- Parameters:
- {!ops.OdtCursor} cursor
- Returns:
- {undefined}
{!boolean}
removeCurrentSelection()
Removes the currently selected content
- Returns:
- {!boolean}
{!boolean}
removeTextByBackspaceKey()
Removes the currently selected content. If no content is selected and there is at least
one character to the left of the current selection, that character will be removed instead.
- Returns:
- {!boolean}
{!boolean}
removeTextByDeleteKey()
Removes the currently selected content. If no content is selected and there is at least
one character to the right of the current selection, that character will be removed instead.
- Returns:
- {!boolean}
<inner>
{!boolean}
removeTextInDirection(isForward)
Remove the current selection, or if the cursor is collapsed, remove the next step
in the specified direction.
- Parameters:
- {!boolean} isForward
- True indicates delete the next step. False indicates delete the previous step
- Returns:
- {!boolean}
<inner>
{!{position: number|length: number}}
toForwardSelection(selection)
Ensures the provided selection is a "forward" selection (i.e., length is positive)
- Parameters:
- {!{position: number|length: number}} selection
- Returns:
- {!{position: number|length: number}}
<inner>
{undefined}
updateEnabledState()
- Returns:
- {undefined}