Public Member Functions | Public Attributes

nsIAccessibleText Interface Reference

import "nsIAccessibleText.idl";

Inheritance diagram for nsIAccessibleText:
Collaboration diagram for nsIAccessibleText:

List of all members.

Public Member Functions

AString getText (in long startOffset, in long endOffset)
 String methods may need to return multibyte-encoded strings, since some locales can't be encoded using 16-bit chars.
AString getTextAfterOffset (in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
AString getTextAtOffset (in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
AString getTextBeforeOffset (in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset)
wchar getCharacterAtOffset (in long offset)
 It would be better to return an unsigned long here, to allow unicode chars > 16 bits.
nsIPersistentProperties getTextAttributes (in boolean includeDefAttrs, in long offset, out long rangeStartOffset, out long rangeEndOffset)
 Get the accessible start/end offsets around the given offset, return the text attributes for this range of text.
void getCharacterExtents (in long offset, out long x, out long y, out long width, out long height, in unsigned long coordType)
 Returns the bounding box of the specified position.
void getRangeExtents (in long startOffset, in long endOffset, out long x, out long y, out long width, out long height, in unsigned long coordType)
long getOffsetAtPoint (in long x, in long y, in unsigned long coordType)
 Get the text offset at the given point, or return -1 if no character exists at that point.
void getSelectionBounds (in long selectionNum, out long startOffset, out long endOffset)
void setSelectionBounds (in long selectionNum, in long startOffset, in long endOffset)
 Set the bounds for the given selection range.
void addSelection (in long startOffset, in long endOffset)
void removeSelection (in long selectionNum)
void scrollSubstringTo (in long startIndex, in long endIndex, in unsigned long scrollType)
 Makes a specific part of string visible on screen.
void scrollSubstringToPoint (in long startIndex, in long endIndex, in unsigned long coordinateType, in long x, in long y)
 Moves the top left of a substring to a specified location.

Public Attributes

const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1
const PRInt32 TEXT_OFFSET_CARET = -2
const nsAccessibleTextBoundary BOUNDARY_CHAR = 0
const nsAccessibleTextBoundary BOUNDARY_WORD_START = 1
const nsAccessibleTextBoundary BOUNDARY_WORD_END = 2
const nsAccessibleTextBoundary BOUNDARY_SENTENCE_START = 3
const nsAccessibleTextBoundary BOUNDARY_SENTENCE_END = 4
const nsAccessibleTextBoundary BOUNDARY_LINE_START = 5
const nsAccessibleTextBoundary BOUNDARY_LINE_END = 6
const nsAccessibleTextBoundary BOUNDARY_ATTRIBUTE_RANGE = 7
attribute long caretOffset
 The current current caret offset.
readonly attribute long characterCount
readonly attribute long selectionCount
readonly attribute
nsIPersistentProperties 
defaultTextAttributes
 Return the text attributes that apply to the entire accessible.

Member Function Documentation

void nsIAccessibleText::addSelection ( in long  startOffset,
in long  endOffset 
)
wchar nsIAccessibleText::getCharacterAtOffset ( in long  offset  ) 

It would be better to return an unsigned long here, to allow unicode chars > 16 bits.

void nsIAccessibleText::getCharacterExtents ( in long  offset,
out long  x,
out long  y,
out long  width,
out long  height,
in unsigned long  coordType 
)

Returns the bounding box of the specified position.

The virtual character after the last character of the represented text, i.e. the one at position length is a special case. It represents the current input position and will therefore typically be queried by AT more often than other positions. Because it does not represent an existing character its bounding box is defined in relation to preceding characters. It should be roughly equivalent to the bounding box of some character when inserted at the end of the text. Its height typically being the maximal height of all the characters in the text or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate.

Parameters:
offset - Index of the character for which to return its bounding box. The valid range is 0..length.
x - X coordinate of the bounding box of the referenced character.
y - Y coordinate of the bounding box of the referenced character.
width - Width of the bounding box of the referenced character.
height - Height of the bounding box of the referenced character.
coordType - Specifies if the coordinates are relative to the screen or to the parent window (see constants declared in nsIAccessibleCoordinateType).
long nsIAccessibleText::getOffsetAtPoint ( in long  x,
in long  y,
in unsigned long  coordType 
)

Get the text offset at the given point, or return -1 if no character exists at that point.

Parameters:
x - The position's x value for which to look up the index of the character that is rendered on to the display at that point.
y - The position's y value for which to look up the index of the character that is rendered on to the display at that point.
coordType - Screen coordinates or window coordinates (see constants declared in nsIAccessibleCoordinateType).
Returns:
offset - Index of the character under the given point or -1 if the point is invalid or there is no character under the point.
void nsIAccessibleText::getRangeExtents ( in long  startOffset,
in long  endOffset,
out long  x,
out long  y,
out long  width,
out long  height,
in unsigned long  coordType 
)
void nsIAccessibleText::getSelectionBounds ( in long  selectionNum,
out long  startOffset,
out long  endOffset 
)
AString nsIAccessibleText::getText ( in long  startOffset,
in long  endOffset 
)

String methods may need to return multibyte-encoded strings, since some locales can't be encoded using 16-bit chars.

So the methods below might return UTF-16 strings, or they could return "string" values which are UTF-8.

AString nsIAccessibleText::getTextAfterOffset ( in long  offset,
in nsAccessibleTextBoundary  boundaryType,
out long  startOffset,
out long  endOffset 
)
AString nsIAccessibleText::getTextAtOffset ( in long  offset,
in nsAccessibleTextBoundary  boundaryType,
out long  startOffset,
out long  endOffset 
)
nsIPersistentProperties nsIAccessibleText::getTextAttributes ( in boolean  includeDefAttrs,
in long  offset,
out long  rangeStartOffset,
out long  rangeEndOffset 
)

Get the accessible start/end offsets around the given offset, return the text attributes for this range of text.

Parameters:
includeDefAttrs [in] points whether text attributes applied to the entire accessible should be included or not.
offset [in] text offset
rangeStartOffset [out] start offset of the range of text
rangeEndOffset [out] end offset of the range of text
AString nsIAccessibleText::getTextBeforeOffset ( in long  offset,
in nsAccessibleTextBoundary  boundaryType,
out long  startOffset,
out long  endOffset 
)
void nsIAccessibleText::removeSelection ( in long  selectionNum  ) 
void nsIAccessibleText::scrollSubstringTo ( in long  startIndex,
in long  endIndex,
in unsigned long  scrollType 
)

Makes a specific part of string visible on screen.

Parameters:
startIndex 0-based character offset
endIndex 0-based character offset - the offset of the character just past the last character of the string
scrollType defines how to scroll (see nsIAccessibleScrollType for available constants)
void nsIAccessibleText::scrollSubstringToPoint ( in long  startIndex,
in long  endIndex,
in unsigned long  coordinateType,
in long  x,
in long  y 
)

Moves the top left of a substring to a specified location.

Parameters:
startIndex 0-based character offset
endIndex 0-based character offset - the offset of the character just past the last character of the string
coordinateType specifies the coordinates origin (for available constants refer to nsIAccessibleCoordinateType)
x defines the x coordinate
y defines the y coordinate
void nsIAccessibleText::setSelectionBounds ( in long  selectionNum,
in long  startOffset,
in long  endOffset 
)

Set the bounds for the given selection range.


Member Data Documentation

The current current caret offset.

If set < 0 then caret will be placed at the end of the text

readonly attribute long nsIAccessibleText::characterCount

Return the text attributes that apply to the entire accessible.

readonly attribute long nsIAccessibleText::selectionCount

The documentation for this interface was generated from the following file: