You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



interface nsIAccessibleText

nsIAccessibleText interface


Public Fields


[more] readonly attribute long caretOffset
Gets the offset of a caret
[more] readonly attribute long characterCount
A read only attribute.


Public Methods


[more] boolean setCaretOffset (in long offset)
Sets the caret (cursor) position to the specified offset
[more] DOMString getText (in long startOffset, in long endOffset)
Gets the text between the specified starting offset and the end offset
[more] AString getTextAfterOffset (in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
Gets the specified text.
[more] AString getTextAtOffset (in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
Gets the specified text.
[more] wchar getCharacterAtOffset (in long offset)
Gets the character at the specified offset
[more] nsISupports getAttributeRange (in long offset, out long rangeStartOffset, out long rangeEndOffset)
Creates a nsISupports which consists of the attributes explicitly set at the position offset in the text.
[more] AString getTextBeforeOffset (in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
Gets the specified text.
[more] void getCharacterExtents (in long offset, out long x, out long y, out long length, out long width, in nsAccessibleCoordType coordType)
Given an offset, the x, y, width, and length values are filled appropriately.
[more] long getOffsetAtPoint (in long x, in long y, in nsAccessibleCoordType coordType)
Gets the offset of the character located at coordinates x and y.
[more] void getSelectionBounds (in long selectionNum, out long startOffset, out long endOffset)
Gets the text from the specified selection.
[more] boolean setSelectionBounds (in long selectionNum, in long startOffset, in long endOffset)
Sets the start and end offset of the specified selection.
[more] boolean addSelection (in long selectionNum, in long startOffset, in long endOffset)
Adds a selection bounded by the specified offsets
[more] boolean removeSelection (in long selectionNum)
Removes a selection bounded by the specified offsets


Documentation

nsIAccessibleText interface
o readonly attribute long caretOffset
Gets the offset of a caret


o boolean setCaretOffset(in long offset)
Sets the caret (cursor) position to the specified offset

Parameters:
offset - specify the position of the caret
Returns:
a boolean result. TRUE if success, FALSE otherwise.

o readonly attribute long characterCount
A read only attribute. Gets the count of character in the specified text.


o DOMString getText(in long startOffset, in long endOffset)
Gets the text between the specified starting offset and the end offset

Parameters:
startOffset - indicate the starting position of the text
endOffset - indicate the end position of the text
Returns:
the text from startOffset up to endOffset

o AString getTextAfterOffset(in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
Gets the specified text.

Parameters:
offset - the position of the specified text
boundaryType - a nsAccessibleTextBoundary parameter showing the text boundary types
startOffset - the start offset of the returned string
endOffset - the end offset of the returned string
Returns:
the text in AString style after offset bounded by the specified boundaryType

o AString getTextAtOffset(in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
Gets the specified text.

Parameters:
offset - the position of specified text
boundaryType - indicate the text boundary types
startOffset - the starting position of the text
endOffset - the end position of the text
Returns:
the specified text at the offset in AString

o wchar getCharacterAtOffset(in long offset)
Gets the character at the specified offset

Parameters:
offset - indicate the position of the character
Returns:
the specified character

o nsISupports getAttributeRange(in long offset, out long rangeStartOffset, out long rangeEndOffset)
Creates a nsISupports which consists of the attributes explicitly set at the position offset in the text. start_offset and end_offset are set to the start and end of the range around offset where the attributes are invariant.

Parameters:
offset - the offset at which to get the attributes
rangeStartOffset - output the start offset of the range
rangeEndOffset - output the end offset of the range
Returns:
an nsISupports which contains the attributes explicitly set at offset.

o AString getTextBeforeOffset(in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
Gets the specified text.

Parameters:
offset - the position of specified text
boundaryType - indicate the text boundary types
startOffset - the starting position of the text
endOffset - the end position of the text
Returns:
the text before offset in AString style bounded by the specified boundary_type.

o void getCharacterExtents(in long offset, out long x, out long y, out long length, out long width, in nsAccessibleCoordType coordType)
Given an offset, the x, y, width, and length values are filled appropriately.

Parameters:
offset - the position of the given character
coordType - specify whether coordinates are relative to the screen or widget window
x - output the x value of the character
y - output the y value of the character @length output the length of the character @width output the width of the character

o long getOffsetAtPoint(in long x, in long y, in nsAccessibleCoordType coordType)
Gets the offset of the character located at coordinates x and y. x and y are interpreted as being relative to the screen or this widget's window depending on coords.

Parameters:
x - screen x-position of character
y - screen y-position of character
coordType - specify whether coordinates are relative to the screen or widget window

o void getSelectionBounds(in long selectionNum, out long startOffset, out long endOffset)
Gets the text from the specified selection.

Parameters:
selectionNum - The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.
startOffset - passes back the start position of the selected region
endOffset - passes back the end position of the selected region
Returns:
the text from the specified selection

o boolean setSelectionBounds(in long selectionNum, in long startOffset, in long endOffset)
Sets the start and end offset of the specified selection.

Parameters:
selectionNum - The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.
startOffset - the new start position of the selection
endOffset - the new end position of the selection
Returns:
the result of setting selection bounds. If success, returns true. Else returns false.

o boolean addSelection(in long selectionNum, in long startOffset, in long endOffset)
Adds a selection bounded by the specified offsets

Parameters:
selectionNum - The selection number.
startOffset - the start position of the selected region
endOffset - the end position of the selected region
Returns:
the result of adding selection. If success, returns true. Else returns false.

o boolean removeSelection(in long selectionNum)
Removes a selection bounded by the specified offsets

Parameters:
selectionNum - The selection number.
Returns:
the result of adding selection. If success, returns true. Else returns false.


This class has no child classes.


Alphabetic index



This page was generated with the help of DOC++ .