Text

The ATK interface implemented by components with text content.

#AtkText should be implemented by #AtkObjects on behalf of widgets that have text content which is either attributed or otherwise non-trivial. #AtkObjects whose text content is simple, unattributed, and very brief may expose that content via #atk_object_get_name instead; however if the text is editable, multi-line, typically longer than three or four words, attributed, selectable, or if the object already uses the 'name' ATK property for other information, the #AtkText interface should be used to expose the text content. In the case of editable text content, #AtkEditableText (a subtype of the #AtkText interface) should be implemented instead.

#AtkText provides not only traversal facilities and change notification for text content, but also caret tracking and glyph bounding box calculations. Note that the text strings are exposed as UTF-8, and are therefore potentially multi-byte, and caret-to-byte offset mapping makes no assumptions about the character length; also bounding box glyph-to-offset mapping may be complex for languages which use ligatures.

interface Text {}

Members

Functions

addSelection
bool addSelection(int startOffset, int endOffset)

Adds a selection bounded by the specified offsets.

connectTextAttributesChanged
ulong connectTextAttributesChanged(T callback, Flag!"After" after)

Connect to TextAttributesChanged signal.

connectTextCaretMoved
ulong connectTextCaretMoved(T callback, Flag!"After" after)

Connect to TextCaretMoved signal.

connectTextChanged
ulong connectTextChanged(string detail, T callback, Flag!"After" after)

Connect to TextChanged signal.

connectTextInsert
ulong connectTextInsert(string detail, T callback, Flag!"After" after)

Connect to TextInsert signal.

connectTextRemove
ulong connectTextRemove(string detail, T callback, Flag!"After" after)

Connect to TextRemove signal.

connectTextSelectionChanged
ulong connectTextSelectionChanged(T callback, Flag!"After" after)

Connect to TextSelectionChanged signal.

getBoundedRanges
atk.text_range.TextRange[] getBoundedRanges(atk.types.TextRectangle rect, atk.types.CoordType coordType, atk.types.TextClipType xClipType, atk.types.TextClipType yClipType)

Get the ranges of text in the specified bounding box.

getCaretOffset
int getCaretOffset()

Gets the offset of the position of the caret (cursor).

getCharacterAtOffset
dchar getCharacterAtOffset(int offset)

Gets the specified text.

getCharacterCount
int getCharacterCount()

Gets the character count.

getCharacterExtents
void getCharacterExtents(int offset, int x, int y, int width, int height, atk.types.CoordType coords)

If the extent can not be obtained (e.g. missing support), all of x, y, width, height are set to -1.

getNSelections
int getNSelections()

Gets the number of selected regions.

getOffsetAtPoint
int getOffsetAtPoint(int x, int y, atk.types.CoordType coords)

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.

getRangeExtents
void getRangeExtents(int startOffset, int endOffset, atk.types.CoordType coordType, atk.types.TextRectangle rect)

Get the bounding box for text within the specified range.

getSelection
string getSelection(int selectionNum, int startOffset, int endOffset)

Gets the text from the specified selection.

getStringAtOffset
string getStringAtOffset(int offset, atk.types.TextGranularity granularity, int startOffset, int endOffset)

Gets a portion of the text exposed through an #AtkText according to a given offset and a specific granularity, along with the start and end offsets defining the boundaries of such a portion of text.

getText
string getText(int startOffset, int endOffset)

Gets the specified text.

getTextAfterOffset
string getTextAfterOffset(int offset, atk.types.TextBoundary boundaryType, int startOffset, int endOffset)

Gets the specified text.

getTextAtOffset
string getTextAtOffset(int offset, atk.types.TextBoundary boundaryType, int startOffset, int endOffset)

Gets the specified text.

getTextBeforeOffset
string getTextBeforeOffset(int offset, atk.types.TextBoundary boundaryType, int startOffset, int endOffset)

Gets the specified text.

scrollSubstringTo
bool scrollSubstringTo(int startOffset, int endOffset, atk.types.ScrollType type)

Makes a substring of text visible on the screen by scrolling all necessary parents.

scrollSubstringToPoint
bool scrollSubstringToPoint(int startOffset, int endOffset, atk.types.CoordType coords, int x, int y)

Move the top-left of a substring of text to a given position of the screen by scrolling all necessary parents.

setCaretOffset
bool setCaretOffset(int offset)

Sets the caret (cursor) position to the specified offset.

setSelection
bool setSelection(int selectionNum, int startOffset, int endOffset)

Changes the start and end offset of the specified selection.

textRemoveSelection
bool textRemoveSelection(int selectionNum)

Removes the specified selection.