| AT-SPI C Bindings Reference Manual | ||||
|---|---|---|---|---|
enum AccessibleTextBoundaryType; enum AccessibleTextClipType;void AccessibleText_ref (AccessibleText *obj);void AccessibleText_unref (AccessibleText *obj);SPIBoolean AccessibleText_addSelection (AccessibleText *obj, longint startOffset, longint endOffset);char * AccessibleText_getAttributes (AccessibleText *obj, longint offset, longint *startOffset, longint *endOffset);AccessibleTextRange ** AccessibleText_getBoundedRanges (AccessibleText *obj, longint x, longint y, longint width, longint height, AccessibleCoordType type, AccessibleTextClipType clipTypeX, AccessibleTextClipType clipTypeY);long AccessibleText_getCaretOffset (AccessibleText *obj);long AccessibleText_getCharacterCount (AccessibleText *obj);void AccessibleText_getCharacterExtents (AccessibleText *obj, longint offset, longint *x, longint *y, longint *width, longint *height, AccessibleCoordType type);long AccessibleText_getNSelections (AccessibleText *obj);long AccessibleText_getOffsetAtPoint (AccessibleText *obj, longint x, longint y, AccessibleCoordType type);void AccessibleText_getRangeExtents (AccessibleText *obj, longint startOffset, longint endOffset, longint *x, longint *y, longint *width, longint *height, AccessibleCoordType type);void AccessibleText_getSelection (AccessibleText *obj, longint selectionNum, longint *startOffset, longint *endOffset);char * AccessibleText_getText (AccessibleText *obj, longint startOffset, longint endOffset);char * AccessibleText_getTextBeforeOffset (AccessibleText *obj, longint offset, AccessibleTextBoundaryType type, longint *startOffset, longint *endOffset);char * AccessibleText_getTextAfterOffset (AccessibleText *obj, longint offset, AccessibleTextBoundaryType type, longint *startOffset, longint *endOffset);char * AccessibleText_getTextAtOffset (AccessibleText *obj, longint offset, AccessibleTextBoundaryType type, longint *startOffset, longint *endOffset);SPIBoolean AccessibleText_removeSelection (AccessibleText *obj, longint selectionNum);SPIBoolean AccessibleText_setCaretOffset (AccessibleText *obj, longint newOffset);SPIBoolean AccessibleText_setSelection (AccessibleText *obj, longint selectionNum, longint startOffset, longint endOffset); unsignedlong AccessibleText_getCharacterAtOffset (AccessibleText *obj, longint offset);char * AccessibleText_getDefaultAttributes (AccessibleText *obj);AccessibleAttributeSet * AccessibleText_getAttributeRun (AccessibleText *obj, longint offset, longint *startOffset, longint *endOffset, longint includeDefaults);AccessibleAttributeSet * AccessibleText_getDefaultAttributeSet (AccessibleText *obj);void AccessibleTextRange_freeRanges (AccessibleTextRange **ranges);
typedef enum
{
SPI_TEXT_BOUNDARY_CHAR,
SPI_TEXT_BOUNDARY_CURSOR_POS,
SPI_TEXT_BOUNDARY_WORD_START,
SPI_TEXT_BOUNDARY_WORD_END,
SPI_TEXT_BOUNDARY_SENTENCE_START,
SPI_TEXT_BOUNDARY_SENTENCE_END,
SPI_TEXT_BOUNDARY_LINE_START,
SPI_TEXT_BOUNDARY_LINE_END,
SPI_TEXT_BOUNDARY_ATTRIBUTE_RANGE
} AccessibleTextBoundaryType;
Text boundary types used for specifying boundaries for regions of text.
typedef enum
{
SPI_TEXT_CLIP_NONE,
SPI_TEXT_CLIP_MIN,
SPI_TEXT_CLIP_MAX,
SPI_TEXT_CLIP_BOTH
} AccessibleTextClipType;
Describes the type of clipping required.
void AccessibleText_ref (AccessibleText *obj);
Increment the reference count for an
obj : |
a pointer to the |
void AccessibleText_unref (AccessibleText *obj);
Decrement the reference count for an
obj : |
a pointer to the Accessible object on which to operate. |
SPIBoolean AccessibleText_addSelection (AccessibleText *obj, longint startOffset, longint endOffset);
Select some text (add a text selection) in an
obj : |
a pointer to the |
startOffset : |
the starting offset of the desired new selection. |
endOffset : |
the offset of the first character after the new selection. |
| Returns : | |
char * AccessibleText_getAttributes (AccessibleText *obj, longint offset, longint *startOffset, longint *endOffset);
Get the attributes applied to a range of text from an
obj : |
a pointer to the |
offset : |
a long integer indicating the offset from which the attribute search is based. |
startOffset : |
a |
endOffset : |
a |
| Returns : | a text string describing the attributes occurring within the
attribute run containing offset, encoded as UTF-8.
|
AccessibleTextRange ** AccessibleText_getBoundedRanges (AccessibleText *obj, longint x, longint y, longint width, longint height, AccessibleCoordType type, AccessibleTextClipType clipTypeX, AccessibleTextClipType clipTypeY);
Get the ranges of text from an x, y) and (x+width, y+height).
Since: AT-SPI 1.2
obj : |
a pointer to the |
x : |
the 'starting' x coordinate of the bounding box. |
y : |
the 'starting' y coordinate of the bounding box. |
width : |
the x extent of the bounding box. |
height : |
the y extent of the bounding box. |
type : |
an AccessibleCoordType indicating the coordinate system to use for the returned values. |
clipTypeX : |
an AccessibleTextClipType indicating how to treat characters that intersect the bounding box's x extents. |
clipTypeY : |
an AccessibleTextClipType indicating how to treat characters that intersect the bounding box's y extents. |
| Returns : | a null-terminated list of pointers to AccessibleTextRange structs detailing the bounded text. |
long AccessibleText_getCaretOffset (AccessibleText *obj);
Get the current offset of the text caret in an
obj : |
a pointer to the |
| Returns : | a long integer indicating the current position of the text caret. |
long AccessibleText_getCharacterCount (AccessibleText *obj);
Get the character count of an
obj : |
a pointer to the |
| Returns : | a long integer indicating the total number of
characters in the |
void AccessibleText_getCharacterExtents (AccessibleText *obj, longint offset, longint *x, longint *y, longint *width, longint *height, AccessibleCoordType type);
Get the bounding box containing the glyph representing the character at a particular text offset.
obj : |
a pointer to the |
offset : |
an integer indicating the offset of the text character for whom boundary information is requested. |
x : |
a pointer to a long integer into which the nominal x coordinate of the corresponding glyph will be returned. |
y : |
a pointer to a long integer into which the nominal y coordinate of the corresponding glyph will be returned. |
width : |
a pointer to a long integer into which the width of the corresponding glyph will be returned. |
height : |
a pointer to a long integer into which the height of the corresponding glyph will be returned. |
type : |
an AccessibleCoordType indicating the coordinate system to use for the returned values. |
long AccessibleText_getNSelections (AccessibleText *obj);
Get the number of active non-contiguous selections for an
obj : |
a pointer to the |
| Returns : | a long integer indicating the current
number of non-contiguous text selections active
within an |
long AccessibleText_getOffsetAtPoint (AccessibleText *obj, longint x, longint y, AccessibleCoordType type);
Get the bounding box for a glyph at a certain
obj : |
a pointer to the |
x : |
the x coordinate of the point to be queried. |
y : |
the y coordinate of the point to be queried. |
type : |
an AccessibleCoordType indicating the coordinate system in which the values should be returned. |
| Returns : | the offset (as a long integer) at the point (x, y)
in the specified coordinate system.
|
void AccessibleText_getRangeExtents (AccessibleText *obj, longint startOffset, longint endOffset, longint *x, longint *y, longint *width, longint *height, AccessibleCoordType type);
Get the bounding box for text within a range in an
Since: AT-SPI 1.2
obj : |
a pointer to the |
startOffset : |
an integer indicating the offset of the first text character for whom boundary information is requested. |
endOffset : |
an integer indicating the offset of the text character after the last character for whom boundary information is requested. |
x : |
a pointer to a long integer into which the nominal x coordinate of the corresponding bounding box will be returned. |
y : |
a pointer to a long integer into which the nominal y coordinate of the corresponding bounding box will be returned. |
width : |
a pointer to a long integer into which the width of the corresponding bounding box will be returned. |
height : |
a pointer to a long integer into which the height of the corresponding bounding box will be returned. |
type : |
an AccessibleCoordType indicating the coordinate system to use for the returned values. |
void AccessibleText_getSelection (AccessibleText *obj, longint selectionNum, longint *startOffset, longint *endOffset);
Get the bounds of the selectionNum-th active text selection for an
obj : |
a pointer to the |
selectionNum : |
an integer indicating which selection to query. |
startOffset : |
a pointer to a long integer into which the start offset of the selection will be returned. |
endOffset : |
a pointer to a long integer into which the start offset of the selection will be returned. |
char * AccessibleText_getText (AccessibleText *obj, longint startOffset, longint endOffset);
Get a range of text from an
obj : |
a pointer to the |
startOffset : |
a |
endOffset : |
a |
| Returns : | a text string containing characters from startOffset
to endOffset-1, inclusive, encoded as UTF-8.
|
char * AccessibleText_getTextBeforeOffset (AccessibleText *obj, longint offset, AccessibleTextBoundaryType type, longint *startOffset, longint *endOffset);
Get delimited text from an
obj : |
a pointer to the |
offset : |
a long integer indicating the offset from which the delimiter search is based. |
type : |
an AccessibleTextBoundaryType indicating whether the desired text string is a word, sentence, line, or attribute run. |
startOffset : |
a pointer to a long integer which is assigned the
starting offset of the returned string, relative to the
original |
endOffset : |
a pointer to a long integer which is assigned the
ending offset of the returned string, relative to the original
|
| Returns : | a UTF-8 string representing the delimited text, both of whose delimiting boundaries are before the current offset, or an empty string if no such text exists. |
char * AccessibleText_getTextAfterOffset (AccessibleText *obj, longint offset, AccessibleTextBoundaryType type, longint *startOffset, longint *endOffset);
Get delimited text from an
obj : |
a pointer to the |
offset : |
a long integer indicating the offset from which the delimiter search is based. |
type : |
an AccessibleTextBoundaryType indicating whether the desired text string is a word, sentence, line, or attribute run. |
startOffset : |
a pointer to a long integer which is assigned the
starting offset of the returned string, relative to the
original |
endOffset : |
a pointer to a long integer which is assigned the
ending offset of the returned string, relative to the original
|
| Returns : | a UTF-8 string representing the delimited text, both of whose delimiting boundaries are after or inclusive of the current offset, or an empty string if no such text exists. |
char * AccessibleText_getTextAtOffset (AccessibleText *obj, longint offset, AccessibleTextBoundaryType type, longint *startOffset, longint *endOffset);
Get delimited text from an
obj : |
a pointer to the |
offset : |
a long integer indicating the offset from which the delimiter search is based. |
type : |
an AccessibleTextBoundaryType indicating whether the desired text string is a word, sentence, line, or attribute run. |
startOffset : |
a pointer to a long integer which is assigned the
starting offset of the returned string, relative to the
original |
endOffset : |
a pointer to a long integer which is assigned the
ending offset of the returned string, relative to the original
|
| Returns : | a UTF-8 string representing the delimited text, whose delimiting boundaries bracket the current offset, or an empty string if no such text exists. |
SPIBoolean AccessibleText_removeSelection (AccessibleText *obj, longint selectionNum);
De-select a text selection.
obj : |
a pointer to the |
selectionNum : |
an integer indicating which (possibly of several) text selection to remove. |
| Returns : | |
SPIBoolean AccessibleText_setCaretOffset (AccessibleText *obj, longint newOffset);
Set the text caret position for an
obj : |
a pointer to the |
newOffset : |
the offset to which the text caret is to be moved. |
| Returns : | |
SPIBoolean AccessibleText_setSelection (AccessibleText *obj, longint selectionNum, longint startOffset, longint endOffset);
Change the bounds of an existing
obj : |
a pointer to the |
selectionNum : |
a zero-offset index indicating which text selection to modify. |
startOffset : |
a long int, the new starting offset for the selection. |
endOffset : |
a long int, the desired new offset of the first character after the selection. |
| Returns : | |
unsignedlong AccessibleText_getCharacterAtOffset (AccessibleText *obj, longint offset);
Get the character at a given offset for an
obj : |
a pointer to the |
offset : |
a long integer indicating the text offset where the desired character is located. |
| Returns : | an |
char * AccessibleText_getDefaultAttributes (AccessibleText *obj);
Get the default attributes applied to an
Since: AT-SPI 1.4
obj : |
a pointer to the |
| Returns : | a text string describing the default attributes applied to a text object, (exclusive of explicitly-set attributes), encoded as UTF-8. |
AccessibleAttributeSet * AccessibleText_getAttributeRun (AccessibleText *obj, longint offset, longint *startOffset, longint *endOffset, longint includeDefaults);
Since: AT-SPI 1.7
obj : |
a pointer to the |
offset : |
a long integer indicating the offset from which the attribute search is based. |
startOffset : |
a |
endOffset : |
a |
includeDefaults : |
a |
| Returns : | the AttributeSet defined at offset, optionally including the 'default' attributes. |
AccessibleAttributeSet * AccessibleText_getDefaultAttributeSet (AccessibleText *obj);
Since: AT-SPI 1.7
obj : |
a pointer to the |
| Returns : | an AttributeSet containing the text attributes
which apply to all text in the object by virtue of the
default settings of the document, view, or user agent; e.g.
those attributes which are implied rather than explicitly
applied to the text object. For instance, an object whose
entire text content has been explicitly marked as 'bold'
will report the 'bold' attribute via getAttributeRun() |
void AccessibleTextRange_freeRanges (AccessibleTextRange **ranges);
Free the memory used by a list of AccessibleTextRange structs. The argument passed in should be an array of pointers AccessibleTextRange structs.
Since: AT-SPI 1.2
ranges : |
a pointer to an array of AccessibleTextRange structs. |