Text

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

class Text {}

Constructors

this
this(AtkText* atkText)

Sets our main struct and passes it to the parent class

Members

Functions

addOnTextAttributesChanged
void addOnTextAttributesChanged(void delegate(Text) 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(gint, Text) 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(gint, gint, Text) 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(gint, gint, string, Text) dlg, ConnectFlags connectFlags)
addOnTextRemove
void addOnTextRemove(void delegate(gint, gint, string, Text) dlg, ConnectFlags connectFlags)
addOnTextSelectionChanged
void addOnTextSelectionChanged(void delegate(Text) dlg, ConnectFlags connectFlags)

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

addOnTextUpdate
void addOnTextUpdate(void delegate(gint, gint, gint, string, Text) dlg, ConnectFlags connectFlags)
addSelection
int 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. Since 1.3

getCaretOffset
int getCaretOffset()

Gets the offset position of the caret (cursor).

getCharacterAtOffset
gunichar 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. Since 1.3

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.

getStruct
void* getStruct()

the main Gtk struct as a void*

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. If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character after the offset is returned. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start after the offset to the next word start. The returned string will contain the word after the offset if the offset is inside a word or if the offset is not inside a word. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end at or after the offset to the next work end. The returned string will contain the word after the offset if the offset is inside a word and will contain the word after the word after the offset if the offset is not inside a word. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start after the offset to the next sentence start. The returned string will contain the sentence after the offset if the offset is inside a sentence or if the offset is not inside a sentence. If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end at or after the offset to the next sentence end. The returned string will contain the sentence after the offset if the offset is inside a sentence and will contain the sentence after the sentence after the offset if the offset is not inside a sentence. If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start after the offset to the next line start. If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end at or after the offset to the next line end.

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

Gets the specified text. If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character at the offset is returned. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start at or before the offset to the word start after the offset. The returned string will contain the word at the offset if the offset is inside a word and will contain the word before the offset if the offset is not inside a word. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the offset to the word end at or after the offset. The returned string will contain the word at the offset if the offset is inside a word and will contain the word after to the offset if the offset is not inside a word. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start at or before the offset to the sentence start after the offset. The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence before the offset if the offset is not inside a sentence. If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end before the offset to the sentence end at or after the offset. The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence after the offset if the offset is not inside a sentence. If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start at or before the offset to the line start after the offset. If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end before the offset to the line end at or after the offset.

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

Gets the specified text. If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character before the offset is returned. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start before the word start before or at the offset to the word start before or at the offset. The returned string will contain the word before the offset if the offset is inside a word and will contain the word before the word before the offset if the offset is not inside a word. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the word end before the offset to the word end before the offset. The returned string will contain the word before the offset if the offset is inside a word or if the offset is not inside a word. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start before the sentence start before the offset to the sentence start before the offset. The returned string will contain the sentence before the offset if the offset is inside a sentence and will contain the sentence before the sentence before the offset if the offset is not inside a sentence. If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end before the sentence end at or before the offset to the sentence end at or before the offset. The returned string will contain the sentence before the offset if the offset is inside a sentence or if the offset is not inside a sentence. If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start before the line start ar or before the offset to the line start ar or before the offset. If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end before the line end before the offset to the line end before the offset.

getTextStruct
AtkText* getTextStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
removeSelection
int removeSelection(int selectionNum)

Removes the specified selection.

setCaretOffset
int setCaretOffset(int offset)

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

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

Changes the start and end offset of the specified selection.

Static functions

atkAttributeSetFree
void atkAttributeSetFree(AtkAttributeSet* attribSet)

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

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

callBackTextAttributesChanged
void callBackTextAttributesChanged(AtkText* atktextStruct, Text _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextCaretMoved
void callBackTextCaretMoved(AtkText* atktextStruct, gint arg1, Text _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextChanged
void callBackTextChanged(AtkText* atktextStruct, gint arg1, gint arg2, Text _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextInsert
void callBackTextInsert(AtkText* atktextStruct, gint arg1, gint arg2, gchar* arg3, Text _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextRemove
void callBackTextRemove(AtkText* atktextStruct, gint arg1, gint arg2, gchar* arg3, Text _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextSelectionChanged
void callBackTextSelectionChanged(AtkText* atktextStruct, Text _text)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackTextUpdate
void callBackTextUpdate(AtkText* atktextStruct, gint arg1, gint arg2, gint arg3, gchar* arg4, Text _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. Since 1.3

Variables

atkText
AtkText* atkText;

the main Gtk struct

connectedSignals
int[string] connectedSignals;
onTextAttributesChangedListeners
void delegate(Text)[] onTextAttributesChangedListeners;
Undocumented in source.
onTextCaretMovedListeners
void delegate(gint, Text)[] onTextCaretMovedListeners;
Undocumented in source.
onTextChangedListeners
void delegate(gint, gint, Text)[] onTextChangedListeners;
Undocumented in source.
onTextInsertListeners
void delegate(gint, gint, string, Text)[] onTextInsertListeners;
Undocumented in source.
onTextRemoveListeners
void delegate(gint, gint, string, Text)[] onTextRemoveListeners;
Undocumented in source.
onTextSelectionChangedListeners
void delegate(Text)[] onTextSelectionChangedListeners;
Undocumented in source.
onTextUpdateListeners
void delegate(gint, gint, gint, string, Text)[] onTextUpdateListeners;
Undocumented in source.

Meta