Class Index | File Index

Classes


Class gui.Caret


Defined in: Caret.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
gui.Caret(cursor, avatarInitiallyVisible, blinkOnRangeSelect)
Class that represents a caret in a document.
Method Summary
Method Attributes Method Name and Description
<inner>  
 
destroy(callback)
<inner>  
destroy(callback)
<inner>  
Checks whether the caret is currently in view.
 
Scrolls the view on the canvas in such a way that the caret is completely visible, with a small margin around.
<inner>  
getCaretClientRectWithMargin(caretElement, margin)
Calculates the bounding client rect of the caret element, expanded with a specific margin
<inner>  
 
 
<inner>  
Get the client rectangle for the nearest selection point to the caret.
 
Recalculate the caret size and position (but don't scroll into view)
<inner>  
hasStateChanged(property)
Returns true if the requested property is different between the last state and the current state
 
hide()
 
 
 
<inner>  
Update all properties in the last state to match the current state
 
 
setColor(newColor)
 
 
 
show()
 
 
<inner>  
Synchronize the requested caret state & visible state
<inner>  
Tweak the height and top offset of the caret to display closely inline in the text block.
Class Detail
gui.Caret(cursor, avatarInitiallyVisible, blinkOnRangeSelect)
Class that represents a caret in a document. The caret is implemented by the left border of a span positioned absolutely to the cursor element, with a width of 0 px and a height of 1em (CSS rules). Blinking is done by switching the color of the border from transparent to the member color and back.
Parameters:
{!ops.OdtCursor} cursor
{boolean} avatarInitiallyVisible
Sets the initial visibility of the caret's avatar
{boolean} blinkOnRangeSelect
Specify that the caret should blink if a non-collapsed range is selected
Method Detail
<inner> {undefined} blinkCaret()
Returns:
{undefined}

{undefined} destroy(callback)
Parameters:
{!function(!Error=)} callback
Callback to call when the destroy is complete, passing an error object in case of error
Returns:
{undefined}

<inner> {undefined} destroy(callback)
Parameters:
{!function(!Object=)} callback
Returns:
{undefined}

<inner> {undefined} ensureVisible()
Checks whether the caret is currently in view. If the caret is not on screen, this will scroll the caret into view.
Returns:
{undefined}

{undefined} ensureVisible()
Scrolls the view on the canvas in such a way that the caret is completely visible, with a small margin around. The view on the canvas is only scrolled as much as needed. If the caret is already visible nothing will happen.
Returns:
{undefined}

<inner> {!{left:!number|top:!number|right:!number|bottom:!number}} getCaretClientRectWithMargin(caretElement, margin)
Calculates the bounding client rect of the caret element, expanded with a specific margin
Parameters:
{!Element} caretElement
{!{left:!number|top:!number|right:!number|bottom:!number}} margin
Returns:
{!{left:!number|top:!number|right:!number|bottom:!number}}

<inner> {?ClientRect} getCaretSizeFromCursor()
Returns:
{?ClientRect}

{!ops.OdtCursor} getCursor()
Returns:
{!ops.OdtCursor} }

{!Element} getFocusElement()
Returns:
{!Element}

<inner> {!{height: !number|top: !number|right: !number}} getSelectionRect()
Get the client rectangle for the nearest selection point to the caret. This works on the assumption that the next or previous sibling is likely to be a text node that will provide an accurate rectangle for the caret's desired position. The horizontal position of the caret is specified in the "right" property as a caret generally appears to the right of the character or object is represents.
Returns:
{!{height: !number|top: !number|right: !number}}

{undefined} handleUpdate()
Recalculate the caret size and position (but don't scroll into view)
Returns:
{undefined}

<inner> {!boolean} hasStateChanged(property)
Returns true if the requested property is different between the last state and the current state
Parameters:
{!string} property
Returns:
{!boolean}

{undefined} hide()
Returns:
{undefined}

{undefined} hideHandle()
Returns:
{undefined}

{undefined} refreshCursorBlinking()
Returns:
{undefined}

{undefined} removeFocus()
Returns:
{undefined}

<inner> {undefined} saveState()
Update all properties in the last state to match the current state
Returns:
{undefined}

{undefined} setAvatarImageUrl(url)
Parameters:
{string} url
Returns:
{undefined}

{undefined} setColor(newColor)
Parameters:
{string} newColor
Returns:
{undefined}

{undefined} setFocus()
Returns:
{undefined}

{undefined} setOverlayElement(element)
Parameters:
{!Element} element
Returns:
{undefined}

{undefined} show()
Returns:
{undefined}

{undefined} showHandle()
Returns:
{undefined}

{undefined} toggleHandleVisibility()
Returns:
{undefined}

<inner> {undefined} updateCaret()
Synchronize the requested caret state & visible state
Returns:
{undefined}

<inner> {undefined} updateOverlayHeightAndPosition()
Tweak the height and top offset of the caret to display closely inline in the text block. This uses ranges to account for line-height and text offsets. This adjustment is necessary as various combinations of fonts and line sizes otherwise cause the caret to appear above or below the natural line of the text. Fonts known to cause this problem: - STIXGeneral (MacOS, Chrome & Safari)
Returns:
{undefined}

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jul 17 2014 21:57:46 GMT+0200 (CEST)