atk.text

Module for [Text] interface

Types 2

interfaceText

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.

Methods
bool addSelection(int startOffset, int endOffset)Adds a selection bounded by the specified offsets.
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.
int getCaretOffset()Gets the offset of the position of the caret (cursor). Returns: the character offset of the position of the caret or -1 if the caret is not located inside the element or in the case of any other fa...
dchar getCharacterAtOffset(int offset)Gets the specified text.
int getCharacterCount()Gets the character count. Returns: the number of characters or -1 in case of failure.
void getCharacterExtents(int offset, out int x, out int y, out int width, out 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.
int getNSelections()Gets the number of selected regions. Returns: The number of selected regions, or -1 in the case of failure.
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.
void getRangeExtents(int startOffset, int endOffset, atk.types.CoordType coordType, out atk.types.TextRectangle rect)Get the bounding box for text within the specified range.
string getSelection(int selectionNum, out int startOffset, out int endOffset)Gets the text from the specified selection.
string getStringAtOffset(int offset, atk.types.TextGranularity granularity, out int startOffset, out 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.
string getText(int startOffset, int endOffset)Gets the specified text.
string getTextAfterOffset(int offset, atk.types.TextBoundary boundaryType, out int startOffset, out int endOffset)Gets the specified text.
string getTextAtOffset(int offset, atk.types.TextBoundary boundaryType, out int startOffset, out int endOffset)Gets the specified text.
string getTextBeforeOffset(int offset, atk.types.TextBoundary boundaryType, out int startOffset, out int endOffset)Gets the specified text.
bool textRemoveSelection(int selectionNum)Removes the specified selection.
bool scrollSubstringTo(int startOffset, int endOffset, atk.types.ScrollType type)Makes a substring of text visible on the screen by scrolling all necessary parents.
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.
bool setCaretOffset(int offset)Sets the caret (cursor) position to the specified offset.
bool setSelection(int selectionNum, int startOffset, int endOffset)Changes the start and end offset of the specified selection.
gulong connectTextAttributesChanged(T)(T callback, Flag!"After" after = No.After)Connect to `TextAttributesChanged` signal.
gulong connectTextCaretMoved(T)(T callback, Flag!"After" after = No.After)Connect to `TextCaretMoved` signal.
gulong connectTextChanged(T)(string detail = null, T callback, Flag!"After" after = No.After)Connect to `TextChanged` signal.
gulong connectTextInsert(T)(string detail = null, T callback, Flag!"After" after = No.After)Connect to `TextInsert` signal.
gulong connectTextRemove(T)(string detail = null, T callback, Flag!"After" after = No.After)Connect to `TextRemove` signal.
gulong connectTextSelectionChanged(T)(T callback, Flag!"After" after = No.After)Connect to `TextSelectionChanged` signal.
interfaceTextGidBuilderImpl(T)