## AtkText AtkText — The ATK interface implemented by components with text content. |

## Functions

gchar * | atk_text_get_text ()
gunichar | atk_text_get_character_at_offset ()
gchar * | atk_text_get_text_after_offset ()
gchar * | atk_text_get_text_at_offset ()
gchar * | atk_text_get_text_before_offset ()
gchar * | atk_text_get_string_at_offset ()
gint | atk_text_get_caret_offset ()
void | atk_text_get_character_extents ()
AtkAttributeSet * | atk_text_get_run_attributes ()
AtkAttributeSet * | atk_text_get_default_attributes ()
gint | atk_text_get_character_count ()
gint | atk_text_get_offset_at_point ()
AtkTextRange ** | atk_text_get_bounded_ranges ()
void | atk_text_get_range_extents ()
void | atk_text_free_ranges ()
gint | atk_text_get_n_selections ()
gchar * | atk_text_get_selection ()
gboolean | atk_text_add_selection ()
gboolean | atk_text_remove_selection ()
gboolean | atk_text_set_selection ()
gboolean | atk_text_set_caret_offset ()
void | atk_attribute_set_free ()
AtkTextAttribute | atk_text_attribute_register ()
const gchar * | atk_text_attribute_get_name ()
AtkTextAttribute | atk_text_attribute_for_name ()
const gchar * | atk_text_attribute_get_value ()

## Signals

void | text-attributes-changed | Run Last
void | text-caret-moved | Run Last
void | text-changed | Has Details
void | text-insert | Has Details
void | text-remove | Has Details
void | text-selection-changed | Run Last

## Types and Values

| AtkText
struct | AtkTextIface
enum | AtkTextBoundary
enum | AtkTextGranularity
enum | AtkTextClipType
struct | AtkTextRange
struct | AtkTextRectangle
enum | AtkTextAttribute

## Object Hierarchy

        GBoxed
        ╰── AtkTextRange
        GEnum
        ├── AtkTextAttribute
        ├── AtkTextBoundary
        ├── AtkTextClipType
        ╰── AtkTextGranularity
        GInterface
        ╰── AtkText

## Known Implementations

AtkText is implemented by AtkNoOpObject.

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

## Functions

### atk_text_get_text ()

    gchar *
    atk_text_get_text (AtkText *text,
                       gint start_offset,
                       gint end_offset);

Gets the specified text.

#### Parameters

text | an AtkText |
start_offset | start position |
end_offset | end position, or -1 for the end of the string. |

#### Returns

a newly allocated string containing the text from `start_offset` up to, but not including `end_offset` . Use `g_free()` to free the returned string.

### atk_text_get_character_at_offset ()

    gunichar
    atk_text_get_character_at_offset (AtkText *text,
                                      gint offset);

Gets the specified text.

#### Parameters

text | an AtkText |
offset | position |

#### Returns

the character at `offset` .

### atk_text_get_text_after_offset ()

    gchar *
    atk_text_get_text_after_offset (AtkText *text,
                                    gint offset,
                                    AtkTextBoundary boundary_type,
                                    gint *start_offset,
                                    gint *end_offset);

`atk_text_get_text_after_offset` has been deprecated since version 2.9.3 and should not be used in newly-written code.

Please use `atk_text_get_string_at_offset()` instead.

Gets the specified text.

#### Parameters

text | an AtkText |
offset | position |
boundary_type | An AtkTextBoundary |
start_offset | the start offset of the returned string. | [out]
end_offset | the offset of the first character after the returned substring. | [out]

#### Returns

a newly allocated string containing the text after `offset` bounded by the specified `boundary_type` . Use `g_free()` to free the returned string.

### atk_text_get_text_at_offset ()

    gchar *
    atk_text_get_text_at_offset (AtkText *text,
                                 gint offset,
                                 AtkTextBoundary boundary_type,
                                 gint *start_offset,
                                 gint *end_offset);

`atk_text_get_text_at_offset` is deprecated and should not be used in newly-written code.

This method is deprecated since ATK version 2.9.4. Please use `atk_text_get_string_at_offset()` instead.

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_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_LINE_START the returned string is from the line start at or before the offset to the line start after the offset.

#### Parameters

text | an AtkText |
offset | position |
boundary_type | An AtkTextBoundary |
start_offset | the start offset of the returned string. | [out]
end_offset | the offset of the first character after the returned substring. | [out]

#### Returns

a newly allocated string containing the text at `offset` bounded by the specified `boundary_type` . Use `g_free()` to free the returned string.

### atk_text_get_text_before_offset ()

    gchar *
    atk_text_get_text_before_offset (AtkText *text,
                                     gint offset,
                                     AtkTextBoundary boundary_type,
                                     gint *start_offset,
                                     gint *end_offset);

`atk_text_get_text_before_offset` has been deprecated since version 2.9.3 and should not be used in newly-written code.

Please use `atk_text_get_string_at_offset()` instead.

Gets the specified text.

#### Parameters

text | an AtkText |
offset | position |
boundary_type | An AtkTextBoundary |
start_offset | the start offset of the returned string. | [out]
end_offset | the offset of the first character after the returned substring. | [out]

#### Returns

a newly allocated string containing the text before `offset` bounded by the specified `boundary_type` . Use `g_free()` to free the returned string.

### atk_text_get_string_at_offset ()

    gchar *
    atk_text_get_string_at_offset (AtkText *text,
                                   gint offset,
                                   AtkTextGranularity granularity,
                                   gint *start_offset,
                                   gint *end_offset);

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.

If `granularity` is ATK_TEXT_GRANULARITY_CHAR the character at the offset is returned.

If `granularity` is ATK_TEXT_GRANULARITY_WORD 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 `granularity` is ATK_TEXT_GRANULARITY_SENTENCE 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 `granularity` is ATK_TEXT_GRANULARITY_LINE the returned string is from the line start at or before the offset to the line start after the offset.

If `granularity` is ATK_TEXT_GRANULARITY_PARAGRAPH the returned string is from the start of the paragraph at or before the offset to the start of the following paragraph after the offset.

#### Parameters

text | an AtkText |
offset | position |
granularity | An AtkTextGranularity |
start_offset | the start offset of the returned string, or -1 if an error has occurred (e.g. invalid offset, not implemented). | [out]
end_offset | the offset of the first character after the returned string, or -1 if an error has occurred (e.g. invalid offset, not implemented). | [out]

#### Returns

a newly allocated string containing the text at the `offset` bounded by the specified `granularity` . Use `g_free()` to free the returned string. Returns `NULL` if the offset is invalid or no implementation is available.

[nullable]

Since: 2.10

### atk_text_get_caret_offset ()

    gint
    atk_text_get_caret_offset (AtkText *text);

Gets the offset position of the caret (cursor).

#### Parameters

text | an AtkText |

#### Returns

the offset position of the caret (cursor).

### atk_text_get_character_extents ()

    void
    atk_text_get_character_extents (AtkText *text,
                                    gint offset,
                                    gint *x,
                                    gint *y,
                                    gint *width,
                                    gint *height,
                                    AtkCoordType coords);

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

#### Parameters

text | an AtkText |
offset | The offset of the text character for which bounding information is required. |
x | Pointer for the x cordinate of the bounding box. | [out][optional]
y | Pointer for the y cordinate of the bounding box. | [out][optional]
width | Pointer for the width of the bounding box. | [out][optional]
height | Pointer for the height of the bounding box. | [out][optional]
coords | specify whether coordinates are relative to the screen or widget window |

### atk_text_get_run_attributes ()

    AtkAttributeSet *
    atk_text_get_run_attributes (AtkText *text,
                                 gint offset,
                                 gint *start_offset,
                                 gint *end_offset);

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.

#### Parameters

text | an AtkText |
offset | the offset at which to get the attributes, -1 means the offset of the character to be inserted at the caret location. |
start_offset | the address to put the start offset of the range. | [out]
end_offset | the address to put the end offset of the range. | [out]

#### Returns

an AtkAttributeSet which contains the attributes explicitly set at `offset` . This AtkAttributeSet should be freed by a call to `atk_attribute_set_free()`.

[transfer full]

### atk_text_get_default_attributes ()

    AtkAttributeSet *
    atk_text_get_default_attributes (AtkText *text);

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.

#### Parameters

text | an AtkText |

#### Returns

an AtkAttributeSet which contains the default values of attributes. at `offset` . this atkattributeset should be freed by a call to `atk_attribute_set_free()`.

[transfer full]

### atk_text_get_character_count ()

    gint
    atk_text_get_character_count (AtkText *text);

Gets the character count.

#### Parameters

text | an AtkText |

#### Returns

the number of characters.

### atk_text_get_offset_at_point ()

    gint
    atk_text_get_offset_at_point (AtkText *text,
                                  gint x,
                                  gint 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` .

#### Parameters

text | an AtkText |
x | screen x-position of character |
y | screen y-position of character |
coords | specify whether coordinates are relative to the screen or widget window |

#### Returns

the offset to the character which is located at the specified `x` and `y` coordinates.

### atk_text_get_bounded_ranges ()

    AtkTextRange **
    atk_text_get_bounded_ranges (AtkText *text,
                                 AtkTextRectangle *rect,
                                 AtkCoordType coord_type,
                                 AtkTextClipType x_clip_type,
                                 AtkTextClipType y_clip_type);

Get the ranges of text in the specified bounding box.

#### Parameters

text | an AtkText |
rect | An AtkTextRectangle giving the dimensions of the bounding box. |
coord_type | Specify whether coordinates are relative to the screen or widget window. |
x_clip_type | Specify the horizontal clip type. |
y_clip_type | Specify the vertical clip type. |

#### Returns

Array of AtkTextRange. The last element of the array returned by this function will be NULL.

[array zero-terminated=1]

Since: 1.3

### atk_text_get_range_extents ()

    void
    atk_text_get_range_extents (AtkText *text,
                                gint start_offset,
                                gint end_offset,
                                AtkCoordType coord_type,
                                AtkTextRectangle *rect);

Get the bounding box for text within the specified range.

#### Parameters

text | an AtkText |
start_offset | The offset of the first text character for which boundary information is required. |
end_offset | The offset of the text character after the last character for which boundary information is required. |
coord_type | Specify whether coordinates are relative to the screen or widget window. |
rect | A pointer to a AtkTextRectangle which is filled in by this function. | [out]

Since: 1.3

### atk_text_free_ranges ()

    void
    atk_text_free_ranges (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.

#### Parameters

ranges | A pointer to an array of AtkTextRange which is to be freed. | [array]

Since: 1.3

### atk_text_get_n_selections ()

    gint
    atk_text_get_n_selections (AtkText *text);

Gets the number of selected regions.

#### Parameters

text | an AtkText |

#### Returns

The number of selected regions, or -1 if a failure occurred.

### atk_text_get_selection ()

    gchar *
    atk_text_get_selection (AtkText *text,
                            gint selection_num,
                            gint *start_offset,
                            gint *end_offset);

Gets the text from the specified selection.

#### Parameters

text | an AtkText |
selection_num | The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering. |
start_offset | passes back the start position of the selected region. | [out]
end_offset | passes back the end position of (e.g. offset immediately past) the selected region. | [out]

#### Returns

a newly allocated string containing the selected text. Use `g_free()` to free the returned string.

### atk_text_add_selection ()

    gboolean
    atk_text_add_selection (AtkText *text,
                            gint start_offset,
                            gint end_offset);

Adds a selection bounded by the specified offsets.

#### Parameters

text | an AtkText |
start_offset | the start position of the selected region |
end_offset | the offset of the first character after the selected region. |

#### Returns

`TRUE` if success, `FALSE` otherwise

### atk_text_remove_selection ()

    gboolean
    atk_text_remove_selection (AtkText *text,
                               gint selection_num);

Removes the specified selection.

#### Parameters

text | an AtkText |
selection_num | The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering. |

#### Returns

`TRUE` if success, `FALSE` otherwise

### atk_text_set_selection ()

    gboolean
    atk_text_set_selection (AtkText *text,
                            gint selection_num,
                            gint start_offset,
                            gint end_offset);

Changes the start and end offset of the specified selection.

#### Parameters

text | an AtkText |
selection_num | The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering. |
start_offset | the new start position of the selection |
end_offset | the new end position of (e.g. offset immediately past) the selection |

#### Returns

`TRUE` if success, `FALSE` otherwise

### atk_text_set_caret_offset ()

    gboolean
    atk_text_set_caret_offset (AtkText *text,
                               gint offset);

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

#### Parameters

text | an AtkText |
offset | position |

#### Returns

`TRUE` if success, `FALSE` otherwise.

### atk_attribute_set_free ()

    void
    atk_attribute_set_free (AtkAttributeSet *attrib_set);

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

#### Parameters

attrib_set | The AtkAttributeSet to free |

### atk_text_attribute_register ()

    AtkTextAttribute
    atk_text_attribute_register (const gchar *name);

Associate `name` with a new AtkTextAttribute

#### Parameters

name | a name string |

#### Returns

an AtkTextAttribute associated with `name`

### atk_text_attribute_get_name ()

    const gchar *
    atk_text_attribute_get_name (AtkTextAttribute attr);

Gets the name corresponding to the AtkTextAttribute

#### Parameters

attr | The AtkTextAttribute whose name is required |

#### Returns

a string containing the name; this string should not be freed

### atk_text_attribute_for_name ()

    AtkTextAttribute
    atk_text_attribute_for_name (const gchar *name);

Get the AtkTextAttribute type corresponding to a text attribute name.

#### Parameters

name | a string which is the (non-localized) name of an ATK text attribute. |

#### Returns

the AtkTextAttribute enumerated type corresponding to the specified name, or ATK_TEXT_ATTRIBUTE_INVALID if no matching text attribute is found.

### atk_text_attribute_get_value ()

    const gchar *
    atk_text_attribute_get_value (AtkTextAttribute attr,
                                  gint index_);

Gets the value for the index of the AtkTextAttribute

#### Parameters

attr | The AtkTextAttribute for which a value is required |
index_ | The index of the required value |

#### Returns

a string containing the value; this string should not be freed; `NULL` is returned if there are no values maintained for the attr value.

[nullable]

## Types and Values

### AtkText

    typedef struct _AtkText AtkText;

### struct AtkTextIface

    struct AtkTextIface {
      GTypeInterface parent;

      gchar*         (* get_text)                     (AtkText          *text,
                                                       gint             start_offset,
                                                       gint             end_offset);
      gchar*         (* get_text_after_offset)        (AtkText          *text,
                                                       gint             offset,
                                                       AtkTextBoundary  boundary_type,
    						   gint             *start_offset,
    						   gint             *end_offset);
      gchar*         (* get_text_at_offset)           (AtkText          *text,
                                                       gint             offset,
                                                       AtkTextBoundary  boundary_type,
    						   gint             *start_offset,
    						   gint             *end_offset);
      gunichar       (* get_character_at_offset)      (AtkText          *text,
                                                       gint             offset);
      gchar*         (* get_text_before_offset)       (AtkText          *text,
                                                       gint             offset,
                                                       AtkTextBoundary  boundary_type,
     						   gint             *start_offset,
    						   gint             *end_offset);
      gint           (* get_caret_offset)             (AtkText          *text);
      AtkAttributeSet* (* get_run_attributes)         (AtkText	    *text,
    						   gint	  	    offset,
    						   gint             *start_offset,
    						   gint	 	    *end_offset);
      AtkAttributeSet* (* get_default_attributes)     (AtkText	    *text);
      void           (* get_character_extents)        (AtkText          *text,
                                                       gint             offset,
                                                       gint             *x,
                                                       gint             *y,
                                                       gint             *width,
                                                       gint             *height,
                                                       AtkCoordType	    coords);
      gint           (* get_character_count)          (AtkText          *text);
      gint           (* get_offset_at_point)          (AtkText          *text,
                                                       gint             x,
                                                       gint             y,
                                                       AtkCoordType	    coords);
      gint		 (* get_n_selections)		  (AtkText          *text);
      gchar*         (* get_selection)	          (AtkText          *text,
    						   gint		    selection_num,
    						   gint		    *start_offset,
    						   gint		    *end_offset);
      gboolean       (* add_selection)		  (AtkText          *text,
    						   gint		    start_offset,
    						   gint		    end_offset);
      gboolean       (* remove_selection)		  (AtkText          *text,
    						   gint             selection_num);
      gboolean       (* set_selection)		  (AtkText          *text,
    						   gint		    selection_num,
    						   gint		    start_offset,
    						   gint		    end_offset);
      gboolean       (* set_caret_offset)             (AtkText          *text,
                                                       gint             offset);

      /*
       * signal handlers
       */
      void		 (* text_changed)                 (AtkText          *text,
                                                       gint             position,
                                                       gint             length);
      void           (* text_caret_moved)             (AtkText          *text,
                                                       gint             location);
      void           (* text_selection_changed)       (AtkText          *text);

      void           (* text_attributes_changed)      (AtkText          *text);

      void           (* get_range_extents)            (AtkText          *text,
                                                       gint             start_offset,
                                                       gint             end_offset,
                                                       AtkCoordType     coord_type,
                                                       AtkTextRectangle *rect);

      AtkTextRange** (* get_bounded_ranges)           (AtkText          *text,
                                                       AtkTextRectangle *rect,
                                                       AtkCoordType     coord_type,
                                                       AtkTextClipType  x_clip_type,
                                                       AtkTextClipType  y_clip_type);

      gchar*         (* get_string_at_offset)         (AtkText            *text,
                                                       gint               offset,
                                                       AtkTextGranularity granularity,
                                                       gint               *start_offset,
                                                       gint               *end_offset);
    };

#### Members

GTypeInterface `parent`; |  |
`get_text` () |  |
`get_text_after_offset` () | Gets specified text. This virtual function is deprecated and it should not be overridden. |
`get_text_at_offset` () | Gets specified text. This virtual function is deprecated and it should not be overridden. |
`get_character_at_offset` () |  |
`get_text_before_offset` () | Gets specified text. This virtual function is deprecated and it should not be overridden. |
`get_caret_offset` () |  |
`get_run_attributes` () |  |
`get_default_attributes` () |  |
`get_character_extents` () |  |
`get_character_count` () |  |
`get_offset_at_point` () |  |
`get_n_selections` () |  |
`get_selection` () |  |
`add_selection` () |  |
`remove_selection` () |  |
`set_selection` () |  |
`set_caret_offset` () |  |
`text_changed` () | the signal handler which is executed when there is a text change. This virtual function is deprecated sice 2.9.4 and it should not be overriden. |
`text_caret_moved` () |  |
`text_selection_changed` () |  |
`text_attributes_changed` () |  |
`get_range_extents` () |  |
`get_bounded_ranges` () |  |
`get_string_at_offset` () | 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. |

### enum AtkTextBoundary

Text boundary types used for specifying boundaries for regions of text. This enumeration is deprecated since 2.9.4 and should not be used. Use AtkTextGranularity with atk_text_get_string_at_offset instead.

#### Members

ATK_TEXT_BOUNDARY_CHAR | Boundary is the boundary between characters (including non-printing characters) |
ATK_TEXT_BOUNDARY_WORD_START | Boundary is the start (i.e. first character) of a word. |
ATK_TEXT_BOUNDARY_WORD_END | Boundary is the end (i.e. last character) of a word. |
ATK_TEXT_BOUNDARY_SENTENCE_START | Boundary is the first character in a sentence. |
ATK_TEXT_BOUNDARY_SENTENCE_END | Boundary is the last (terminal) character in a sentence; in languages which use "sentence stop" punctuation such as English, the boundary is thus the '.', '?', or similar terminal punctuation character. |
ATK_TEXT_BOUNDARY_LINE_START | Boundary is the initial character of the content or a character immediately following a newline, linefeed, or return character. |
ATK_TEXT_BOUNDARY_LINE_END | Boundary is the linefeed, or return character. |

### enum AtkTextGranularity

Text granularity types used for specifying the granularity of the region of text we are interested in.

#### Members

ATK_TEXT_GRANULARITY_CHAR | Granularity is defined by the boundaries between characters (including non-printing characters) |
ATK_TEXT_GRANULARITY_WORD | Granularity is defined by the boundaries of a word, starting at the beginning of the current word and finishing at the beginning of the following one, if present. |
ATK_TEXT_GRANULARITY_SENTENCE | Granularity is defined by the boundaries of a sentence, starting at the beginning of the current sentence and finishing at the beginning of the following one, if present. |
ATK_TEXT_GRANULARITY_LINE | Granularity is defined by the boundaries of a line, starting at the beginning of the current line and finishing at the beginning of the following one, if present. |
ATK_TEXT_GRANULARITY_PARAGRAPH | Granularity is defined by the boundaries of a paragraph, starting at the beginning of the current paragraph and finishing at the beginning of the following one, if present. |

### enum AtkTextClipType

Describes the type of clipping required.

#### Members

ATK_TEXT_CLIP_NONE | No clipping to be done |
ATK_TEXT_CLIP_MIN | Text clipped by min coordinate is omitted |
ATK_TEXT_CLIP_MAX | Text clipped by max coordinate is omitted |
ATK_TEXT_CLIP_BOTH | Only text fully within mix/max bound is retained |

### struct AtkTextRange

    struct AtkTextRange {
      AtkTextRectangle bounds;
      gint start_offset;
      gint end_offset;
      gchar* content;
    };

A structure used to describe a text range.

#### Members

AtkTextRectangle `bounds`; | A rectangle giving the bounds of the text range |
gint `start_offset`; | The start offset of a AtkTextRange |
gint `end_offset`; | The end offset of a AtkTextRange |
gchar *`content`; | The text in the text range |

### struct AtkTextRectangle

    struct AtkTextRectangle {
      gint x;
      gint y;
      gint width;
      gint height;
    };

A structure used to store a rectangle used by AtkText.

#### Members

gint `x`; | The horizontal coordinate of a rectangle |
gint `y`; | The vertical coordinate of a rectangle |
gint `width`; | The width of a rectangle |
gint `height`; | The height of a rectangle |

### enum AtkTextAttribute

Describes the text attributes supported

#### Members

ATK_TEXT_ATTR_INVALID | Invalid attribute, like bad spelling or grammar. |
ATK_TEXT_ATTR_LEFT_MARGIN | The pixel width of the left margin |
ATK_TEXT_ATTR_RIGHT_MARGIN | The pixel width of the right margin |
ATK_TEXT_ATTR_INDENT | The number of pixels that the text is indented |
ATK_TEXT_ATTR_INVISIBLE | Either "true" or "false" indicating whether text is visible or not |
ATK_TEXT_ATTR_EDITABLE | Either "true" or "false" indicating whether text is editable or not |
ATK_TEXT_ATTR_PIXELS_ABOVE_LINES | Pixels of blank space to leave above each newline-terminated line. |
ATK_TEXT_ATTR_PIXELS_BELOW_LINES | Pixels of blank space to leave below each newline-terminated line. |
ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP | Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph). |
ATK_TEXT_ATTR_BG_FULL_HEIGHT | "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character. |
ATK_TEXT_ATTR_RISE | Number of pixels that the characters are risen above the baseline |
ATK_TEXT_ATTR_UNDERLINE | "none", "single", "double", "low", or "error" |
ATK_TEXT_ATTR_STRIKETHROUGH | "true" or "false" whether the text is strikethrough |
ATK_TEXT_ATTR_SIZE | The size of the characters in points. eg: 10 |
ATK_TEXT_ATTR_SCALE | The scale of the characters. The value is a string representation of a double |
ATK_TEXT_ATTR_WEIGHT | The weight of the characters. |
ATK_TEXT_ATTR_LANGUAGE | The language used |
ATK_TEXT_ATTR_FAMILY_NAME | The font family name |
ATK_TEXT_ATTR_BG_COLOR | The background color. The value is an RGB value of the format "`u`,`u`,`u`" |
ATK_TEXT_ATTR_FG_COLOR | The foreground color. The value is an RGB value of the format "`u`,`u`,`u`" |
ATK_TEXT_ATTR_BG_STIPPLE | "true" if a GdkBitmap is set for stippling the background color. |
ATK_TEXT_ATTR_FG_STIPPLE | "true" if a GdkBitmap is set for stippling the foreground color. |
ATK_TEXT_ATTR_WRAP_MODE | The wrap mode of the text, if any. Values are "none", "char", "word", or "word_char". |
ATK_TEXT_ATTR_DIRECTION | The direction of the text, if set. Values are "none", "ltr" or "rtl" |
ATK_TEXT_ATTR_JUSTIFICATION | The justification of the text, if set. Values are "left", "right", "center" or "fill" |
ATK_TEXT_ATTR_STRETCH | The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded" |
ATK_TEXT_ATTR_VARIANT | The capitalization variant of the text, if set. Values are "normal" or "small_caps" |
ATK_TEXT_ATTR_STYLE | The slant style of the text, if set. Values are "normal", "oblique" or "italic" |
ATK_TEXT_ATTR_LAST_DEFINED | not a valid text attribute, used for finding end of enumeration |

## Signal Details

### The `“text-attributes-changed”` signal

    void
    user_function (AtkText *atktext,
                   gpointer user_data)

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

#### Parameters

atktext | the object which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“text-caret-moved”` signal

    void
    user_function (AtkText *atktext,
                   gint     arg1,
                   gpointer user_data)

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

#### Parameters

atktext | the object which received the signal. |
arg1 | The new position of the text caret. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“text-changed”` signal

    void
    user_function (AtkText *atktext,
                   gint     arg1,
                   gint     arg2,
                   gpointer user_data)

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.

`AtkText::text-changed` has been deprecated since version 2.9.4 and should not be used in newly-written code.

Use “text-insert” or “text-remove” instead.

#### Parameters

atktext | the object which received the signal. |
arg1 | The position (character offset) of the insertion or deletion. |
arg2 | The length (in characters) of text inserted or deleted. |
user_data | user data set when the signal handler was connected. |

Flags: Has Details

### The `“text-insert”` signal

    void
    user_function (AtkText *atktext,
                   gint     arg1,
                   gint     arg2,
                   gchar   *arg3,
                   gpointer user_data)

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.

#### Parameters

atktext | the object which received the signal. |
arg1 | The position (character offset) of the insertion. |
arg2 | The length (in characters) of text inserted. |
arg3 | The new text inserted |
user_data | user data set when the signal handler was connected. |

Flags: Has Details

### The `“text-remove”` signal

    void
    user_function (AtkText *atktext,
                   gint     arg1,
                   gint     arg2,
                   gchar   *arg3,
                   gpointer user_data)

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.

#### Parameters

atktext | the object which received the signal. |
arg1 | The position (character offset) of the removal. |
arg2 | The length (in characters) of text removed. |
arg3 | The old text removed |
user_data | user data set when the signal handler was connected. |

Flags: Has Details

### The `“text-selection-changed”` signal

    void
    user_function (AtkText *atktext,
                   gpointer user_data)

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

#### Parameters

atktext | the object which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last