nsIAccessiblePivot

The pivot interface encapsulates a reference to a single place in an accessible
subtree. The pivot is a point or a range in the accessible tree. This interface
provides traversal methods to move the pivot to next/prev state that complies
to a given rule.

Methods

setTextRange(aTextAccessible, aStartOffset, aEndOffset, aIsFromUserInput)

Set the pivot’s text range in a text accessible.

Parameters

aTextAccessible [in] the text accessible that contains the desired range.
aStartOffset [in] the start offset to set.
aEndOffset [in] the end offset to set.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true). @throws NS_ERROR_INVALID_ARG when the offset exceeds the accessible's character count.

moveNext(aRule, aAnchor, aIncludeStart, aIsFromUserInput)

Move pivot to next object, from current position or given anchor,
complying to given traversal rule.

Parameters

aRule [in] traversal rule to use.
aAnchor [in] accessible to start search from, if not provided, current position will be used.
aIncludeStart [in] include anchor accessible in search.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

Returns

true on success, false if there are no new nodes to traverse to.

movePrevious(aRule, aAnchor, aIncludeStart, aIsFromUserInput)

Move pivot to previous object, from current position or given anchor,
complying to given traversal rule.

Parameters

aRule [in] traversal rule to use.
aAnchor [in] accessible to start search from, if not provided, current position will be used.
aIncludeStart [in] include anchor accessible in search.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

Returns

true on success, false if there are no new nodes to traverse to.

moveFirst(aRule, aIsFromUserInput)

Move pivot to first object in subtree complying to given traversal rule.

Parameters

aRule [in] traversal rule to use.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

Returns

true on success, false if there are no new nodes to traverse to.

moveLast(aRule, aIsFromUserInput)

Move pivot to last object in subtree complying to given traversal rule.

Parameters

aRule [in] traversal rule to use.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

moveNextByText(aBoundary, aIsFromUserInput)

Move pivot to next text range.

Parameters

aBoundary [in] type of boundary for next text range, character, word, etc.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

Returns

true on success, false if there are is no more text.

movePreviousByText(aBoundary, aIsFromUserInput)

Move pivot to previous text range.

Parameters

aBoundary [in] type of boundary for next text range, character, word, etc.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

Returns

true on success, false if there are is no more text.

moveToPoint(aRule, aX, aY, aIgnoreNoMatch, aIsFromUserInput)

Move pivot to given coordinate in screen pixels.

Parameters

aRule [in] raversal rule to use.
aX [in] screen's x coordinate
aY [in] screen's y coordinate
aIgnoreNoMatch [in] don't unset position if no object was found at point.
aIsFromUserInput [in] the pivot changed because of direct user input (default is true).

Returns

true on success, false if the pivot has not been moved.

addObserver(aObserver)

Add an observer for pivot changes.

Parameters

aObserver [in] the observer object to be notified of pivot changes.

removeObserver(aObserver)

Remove an observer for pivot changes.

Parameters

aObserver [in] the observer object to remove from being notified.

Attributes

position

The accessible the pivot is currently pointed at.

root

The root of the subtree in which the pivot traverses.

modalRoot

The temporary modal root to which traversal is limited to.

startOffset

The start offset of the text range the pivot points at, otherwise -1.

endOffset

The end offset of the text range the pivot points at, otherwise -1.

Constants

CHAR_BOUNDARY

WORD_BOUNDARY

LINE_BOUNDARY

ATTRIBUTE_RANGE_BOUNDARY

REASON_NONE

REASON_NEXT

REASON_PREV

REASON_FIRST

REASON_LAST

REASON_TEXT

REASON_POINT