AtkText

Name

AtkText -- accessibility interface for text widgets

Synopsis



struct      AtkText;
struct      AtkTextIface;
enum        AtkTextBoundary;
gchar*      atk_text_get_text               (AtkText *text,
                                             gint start_offset,
                                             gint end_offset);
gunichar    atk_text_get_character_at_offset
                                            (AtkText *text,
                                             gint offset);
gchar*      atk_text_get_text_after_offset  (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type);
gchar*      atk_text_get_text_at_offset     (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type);
gchar*      atk_text_get_text_before_offset (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type);
gint        atk_text_get_caret_offset       (AtkText *text);
void        atk_text_get_character_extents  (AtkText *text,
                                             gint offset,
                                             gint *x,
                                             gint *y,
                                             gint *length,
                                             gint *width,
                                             AtkXYCoords coords);
AtkAttributeSet* atk_text_ref_run_attributes
                                            (AtkText *text,
                                             gint offset,
                                             gint *start_offset,
                                             gint *end_offset);
gint        atk_text_get_character_count    (AtkText *text);
gint        atk_text_get_offset_at_point    (AtkText *text,
                                             gint x,
                                             gint y,
                                             AtkXYCoords coords);
gint        atk_text_get_n_selections       (AtkText *text);
gchar*      atk_text_get_selection          (AtkText *text,
                                             gint selection_num,
                                             gint *start_offset,
                                             gint *end_offset);
gboolean    atk_text_add_selection          (AtkText *text,
                                             gint start_offset,
                                             gint end_offset);
gboolean    atk_text_remove_selection       (AtkText *text,
                                             gint selection_num);
gboolean    atk_text_set_selection          (AtkText *text,
                                             gint selection_num,
                                             gint start_offset,
                                             gint end_offset);
gboolean    atk_text_set_caret_offset       (AtkText *text,
                                             gint offset);

Description

AtkText provides an accessibility interface for text widgets

Details

struct AtkText

struct 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);
  gchar*         (* get_text_at_offset)           (AtkText          *text,
                                                   gint             offset,
                                                   AtkTextBoundary  boundary_type);
  gunichar       (* get_character_at_offset)      (AtkText          *text,
                                                   gint             offset);
  gchar*         (* get_text_before_offset)       (AtkText          *text,
                                                   gint             offset,
                                                   AtkTextBoundary  boundary_type);
  gint           (* get_caret_offset)             (AtkText          *text);
  AtkAttributeSet* (* ref_run_attributes)         (AtkText	    *text,
						   gint	  	    offset,
						   gint             *start_offset,
						   gint	 	    *end_offset);
  void           (* get_character_extents)        (AtkText          *text,
                                                   gint             offset,
                                                   gint             *x,
                                                   gint             *y,
                                                   gint             *length,
                                                   gint             *width,
                                                   AtkXYCoords	    coords);
  gint           (* get_character_count)          (AtkText          *text);
  gint           (* get_offset_at_point)          (AtkText          *text,
                                                   gint             x,
                                                   gint             y,
                                                   AtkXYCoords	    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);
  void		 (* text_changed)                 (AtkText          *text);
  void           (* caret_changed)                (AtkText          *text,
                                                   gint             location);
};


enum AtkTextBoundary

typedef enum {
  ATK_TEXT_BOUNDARY_CHAR,
  ATK_TEXT_BOUNDARY_CURSOR_POS,
  ATK_TEXT_BOUNDARY_WORD_START,
  ATK_TEXT_BOUNDARY_WORD_END,
  ATK_TEXT_BOUNDARY_SENTENCE_START,
  ATK_TEXT_BOUNDARY_SENTENCE_END,
  ATK_TEXT_BOUNDARY_LINE_START,
  ATK_TEXT_BOUNDARY_LINE_END
} AtkTextBoundary;

Text boundary types used for specifying boundaries for regions of text


atk_text_get_text ()

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

Gets the specified text.

text : an AtkText
start_offset : start position
end_offset : end position
Returns : the text from start_offset up to, but not including end_offset.


atk_text_get_character_at_offset ()

gunichar    atk_text_get_character_at_offset
                                            (AtkText *text,
                                             gint offset);

Gets the specified text.

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);

Gets the specified text. If the boundary type is ATK_TEXT_BOUNDARY_WORD_START or ATK_TEXT_BOUNDARY_WORD_END part of a word may be returned. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the start point will be the offset and will continue to the start of the next sentence. The first word may not be a complete word. Similarly for ATK_TEXT_BOUNDARY_SENTENCE_END, ATK_TEXT_BOUNDARY_LINE_START and ATK_TEXT_BOUNDARY_LINE_END

text : an AtkText
offset : position
boundary_type : An AtkTextBoundary
Returns : the text after offset up to the specified boundary_type.


atk_text_get_text_at_offset ()

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

Gets the specified text. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START or ATK_TEXT_BOUNDARY_WORD_END a complete word is returned; if the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START or ATK_TEXT_BOUNDARY_SENTENCE_END a complete sentence is returned; if the boundary type is ATK_TEXT_BOUNDARY_LINE_START or ATK_TEXT_BOUNDARY_LINE_END a complete line is returned.

text : an AtkText
offset : position
boundary_type : An AtkTextBoundary
Returns : the text at offset up to the specified boundary_type.


atk_text_get_text_before_offset ()

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

Gets the specified text. If the boundary type is ATK_TEXT_BOUNDARY_WORD_START or ATK_TEXT_BOUNDARY_WORD_END part of a word may be returned. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the start point will be at the start of the sentence, and will continue to the offset. The last word may not be a complete word. Similarly for ATK_TEXT_BOUNDARY_SENTENCE_END, ATK_TEXT_BOUNDARY_LINE_START and ATK_TEXT_BOUNDARY_LINE_END

text : an AtkText
offset : position
boundary_type : An AtkTextBoundary
Returns : the text before offset starting from the specified boundary_type.


atk_text_get_caret_offset ()

gint        atk_text_get_caret_offset       (AtkText *text);

Gets the offset position of the caret (cursor).

text : an AtkText
Returns : the offset position of the caret (cursor), or -1 if one does not exist (or is not supported by the widget).


atk_text_get_character_extents ()

void        atk_text_get_character_extents  (AtkText *text,
                                             gint offset,
                                             gint *x,
                                             gint *y,
                                             gint *length,
                                             gint *width,
                                             AtkXYCoords coords);

Given an offset, the x, y, length, and width values are filled appropriately.

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


atk_text_ref_run_attributes ()

AtkAttributeSet* atk_text_ref_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.

text : an AtkText
offset : the offset at which to get the attributes
start_offset : the address to put the start offset of the range
end_offset : the address to put the end offset of the range
Returns : an AtkAttributeSet which contains the attributes explicitly set at offset


atk_text_get_character_count ()

gint        atk_text_get_character_count    (AtkText *text);

Gets the character count.

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,
                                             AtkXYCoords 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.

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_n_selections ()

gint        atk_text_get_n_selections       (AtkText *text);

Gets the number of selected regions.

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.

text : an AtkText
selection_num : The selection number. The selected regions are assigned numbers that corrispond 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
end_offset : passes back the end position of the selected region
Returns : the selected text.


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.

text : an AtkText
start_offset : the start position of the selected region
end_offset : the end position of 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

text : an AtkText
selection_num : The selection number. The selected regions are assigned numbers that corrispond 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

text : an AtkText
selection_num : The selection number. The selected regions are assigned numbers that corrispond 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 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.

text : an AtkText
offset : position
Returns : TRUE if success, FALSE otherwise.