TextT

#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.

template TextT (
TStruct
) {}

Members

Functions

addOnTextAttributesChanged
void addOnTextAttributesChanged(void delegate(TextIF) dlg, ConnectFlags connectFlags)

The "text-attributes-changed" signal is emitted when the text attributes of the text of an object which implements AtkText changes.

addOnTextCaretMoved
void addOnTextCaretMoved(void delegate(int, TextIF) dlg, ConnectFlags connectFlags)

The "text-caret-moved" signal is emitted when the caret position of the text of an object which implements AtkText changes.

addOnTextChanged
void addOnTextChanged(void delegate(int, int, TextIF) dlg, ConnectFlags connectFlags)

The "text-changed" signal is emitted when the text of the object which implements the AtkText interface changes, This signal will have a detail which is either "insert" or "delete" which identifies whether the text change was an insertion or a deletion.

addOnTextInsert
void addOnTextInsert(void delegate(int, int, string, TextIF) dlg, ConnectFlags connectFlags)

The "text-insert" signal is emitted when a new text is inserted. If the signal was not triggered by the user (e.g. typing or pasting text), the "system" detail should be included.

addOnTextRemove
void addOnTextRemove(void delegate(int, int, string, TextIF) dlg, ConnectFlags connectFlags)

The "text-remove" signal is emitted when a new text is removed. If the signal was not triggered by the user (e.g. typing or pasting text), the "system" detail should be included.

addOnTextSelectionChanged
void addOnTextSelectionChanged(void delegate(TextIF) dlg, ConnectFlags connectFlags)

The "text-selection-changed" signal is emitted when the selected text of an object which implements AtkText changes.

addSelection
bool addSelection(int startOffset, int endOffset)

Adds a selection bounded by the specified offsets.

getBoundedRanges
AtkTextRange*[] getBoundedRanges(AtkTextRectangle* rect, AtkCoordType coordType, AtkTextClipType xClipType, AtkTextClipType yClipType)

Get the ranges of text in the specified bounding box.

getCaretOffset
int getCaretOffset()

Gets the offset 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, AtkCoordType coords)

Get the bounding box containing the glyph representing the character at a particular text offset.

getDefaultAttributes
AtkAttributeSet* getDefaultAttributes()

Creates an #AtkAttributeSet which consists of the default values of attributes for the text. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

getNSelections
int getNSelections()

Gets the number of selected regions.

getOffsetAtPoint
int getOffsetAtPoint(int x, int y, AtkCoordType 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, AtkCoordType coordType, AtkTextRectangle* rect)

Get the bounding box for text within the specified range.

getRunAttributes
AtkAttributeSet* getRunAttributes(int offset, int startOffset, int endOffset)

Creates an #AtkAttributeSet 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. Note that @end_offset is the offset of the first character after the range. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

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

Gets the text from the specified selection.

getStringAtOffset
string getStringAtOffset(int offset, AtkTextGranularity 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, AtkTextBoundary boundaryType, int startOffset, int endOffset)

Gets the specified text.

getTextAtOffset
string getTextAtOffset(int offset, AtkTextBoundary boundaryType, int startOffset, int endOffset)

Gets the specified text.

getTextBeforeOffset
string getTextBeforeOffset(int offset, AtkTextBoundary boundaryType, int startOffset, int endOffset)

Gets the specified text.

getTextStruct
AtkText* getTextStruct()

Get the main Gtk struct

removeSelection
bool removeSelection(int selectionNum)

Removes the specified selection.

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.

Properties

onTextAttributesChangedListeners
void delegate(TextIF)[] onTextAttributesChangedListeners [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
onTextCaretMovedListeners
void delegate(int, TextIF)[] onTextCaretMovedListeners [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
onTextChangedListeners
void delegate(int, int, TextIF)[] onTextChangedListeners [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
onTextInsertListeners
void delegate(int, int, string, TextIF)[] onTextInsertListeners [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
onTextRemoveListeners
void delegate(int, int, string, TextIF)[] onTextRemoveListeners [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
onTextSelectionChangedListeners
void delegate(TextIF)[] onTextSelectionChangedListeners [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

attributeForName
AtkTextAttribute attributeForName(string name)

Get the #AtkTextAttribute type corresponding to a text attribute name.

attributeGetName
string attributeGetName(AtkTextAttribute attr)

Gets the name corresponding to the #AtkTextAttribute

attributeGetValue
string attributeGetValue(AtkTextAttribute attr, int index)

Gets the value for the index of the #AtkTextAttribute

attributeRegister
AtkTextAttribute attributeRegister(string name)

Associate @name with a new #AtkTextAttribute

attributeSetFree
void attributeSetFree(AtkAttributeSet* attribSet)

Frees the memory used by an #AtkAttributeSet, including all its #AtkAttributes.

callBackTextAttributesChanged
void callBackTextAttributesChanged(AtkText* textStruct, TextIF _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextCaretMoved
void callBackTextCaretMoved(AtkText* textStruct, int arg1, TextIF _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextChanged
void callBackTextChanged(AtkText* textStruct, int arg1, int arg2, TextIF _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextInsert
void callBackTextInsert(AtkText* textStruct, int arg1, int arg2, char* arg3, TextIF _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextRemove
void callBackTextRemove(AtkText* textStruct, int arg1, int arg2, char* arg3, TextIF _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextSelectionChanged
void callBackTextSelectionChanged(AtkText* textStruct, TextIF _text)
Undocumented in source. Be warned that the author may not have intended to support it.
freeRanges
void freeRanges(AtkTextRange*[] ranges)

Frees the memory associated with an array of AtkTextRange. It is assumed that the array was returned by the function atk_text_get_bounded_ranges and is NULL terminated.

Variables

_onTextAttributesChangedListeners
void delegate(TextIF)[] _onTextAttributesChangedListeners;
Undocumented in source.
_onTextCaretMovedListeners
void delegate(int, TextIF)[] _onTextCaretMovedListeners;
Undocumented in source.
_onTextChangedListeners
void delegate(int, int, TextIF)[] _onTextChangedListeners;
Undocumented in source.
_onTextInsertListeners
void delegate(int, int, string, TextIF)[] _onTextInsertListeners;
Undocumented in source.
_onTextRemoveListeners
void delegate(int, int, string, TextIF)[] _onTextRemoveListeners;
Undocumented in source.
_onTextSelectionChangedListeners
void delegate(TextIF)[] _onTextSelectionChangedListeners;
Undocumented in source.
connectedSignals
int[string] connectedSignals;
Undocumented in source.

Meta