1 /* ATK - The Accessibility Toolkit for GTK+
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __ATK_TEXT_H__
22 #define __ATK_TEXT_H__
24 #include <pango/pango.h>
25 #include <glib-object.h>
26 #include <atk/atkobject.h>
30 #endif /* __cplusplus */
32 #define ATK_TYPE_TEXT (atk_text_get_type ())
33 #define ATK_IS_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TEXT)
34 #define ATK_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TEXT, AtkText)
35 #define ATK_TEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TEXT, AtkTextIface))
37 #ifndef _TYPEDEF_ATK_TEXT_
38 #define _TYPEDEF_ATK_TEXT_
39 typedef struct _AtkText AtkText;
41 typedef struct _AtkTextIface AtkTextIface;
45 *@ATK_TEXT_BOUNDARY_CHAR:
46 *@ATK_TEXT_BOUNDARY_CURSOR_POS:
47 *@ATK_TEXT_BOUNDARY_WORD_START:
48 *@ATK_TEXT_BOUNDARY_WORD_END:
49 *@ATK_TEXT_BOUNDARY_SENTENCE_START:
50 *@ATK_TEXT_BOUNDARY_SENTENCE_END:
51 *@ATK_TEXT_BOUNDARY_LINE_START:
52 *@ATK_TEXT_BOUNDARY_LINE_END:
54 *Text boundary types used for specifying boundaries for regions of text
57 ATK_TEXT_BOUNDARY_CHAR,
58 ATK_TEXT_BOUNDARY_CURSOR_POS,
59 ATK_TEXT_BOUNDARY_WORD_START,
60 ATK_TEXT_BOUNDARY_WORD_END,
61 ATK_TEXT_BOUNDARY_SENTENCE_START,
62 ATK_TEXT_BOUNDARY_SENTENCE_END,
63 ATK_TEXT_BOUNDARY_LINE_START,
64 ATK_TEXT_BOUNDARY_LINE_END
69 GTypeInterface parent;
71 gchar* (* get_text) (AtkText *text,
74 gchar* (* get_text_after_offset) (AtkText *text,
76 AtkTextBoundary boundary_type);
77 gchar* (* get_text_at_offset) (AtkText *text,
79 AtkTextBoundary boundary_type);
80 gunichar (* get_character_at_offset) (AtkText *text,
82 gchar* (* get_text_before_offset) (AtkText *text,
84 AtkTextBoundary boundary_type);
85 gint (* get_caret_offset) (AtkText *text);
86 PangoAttrList* (* get_range_attributes) (AtkText *text,
89 void (* get_character_extents) (AtkText *text,
95 gint (* get_character_count) (AtkText *text);
96 gint (* get_offset_at_point) (AtkText *text,
99 gint (* get_n_selections) (AtkText *text);
100 gchar* (* get_selection) (AtkText *text,
104 gboolean (* add_selection) (AtkText *text,
107 gboolean (* remove_selection) (AtkText *text,
109 gboolean (* set_selection) (AtkText *text,
113 gboolean (* set_caret_offset) (AtkText *text,
115 void (* text_changed) (AtkText *text);
116 void (* caret_changed) (AtkText *text,
119 GType atk_text_get_type (void);
123 * Additional AtkObject properties used by AtkText:
124 * "accessible_text" (accessible text has changed)
125 * "accessible_caret" (accessible text cursor position changed:
126 * editable text only)
129 gchar* atk_text_get_text (AtkText *text,
132 gunichar atk_text_get_character_at_offset (AtkText *text,
134 gchar* atk_text_get_text_after_offset (AtkText *text,
136 AtkTextBoundary boundary_type);
137 gchar* atk_text_get_text_at_offset (AtkText *text,
139 AtkTextBoundary boundary_type);
140 gchar* atk_text_get_text_before_offset (AtkText *text,
142 AtkTextBoundary boundary_type);
143 gint atk_text_get_caret_offset (AtkText *text);
144 PangoAttrList* atk_text_get_range_attributes (AtkText *text,
147 void atk_text_get_character_extents (AtkText *text,
153 gint atk_text_get_character_count (AtkText *text);
154 gint atk_text_get_offset_at_point (AtkText *text,
157 gint atk_text_get_n_selections (AtkText *text);
158 gchar* atk_text_get_selection (AtkText *text,
162 gboolean atk_text_add_selection (AtkText *text,
165 gboolean atk_text_remove_selection (AtkText *text,
167 gboolean atk_text_set_selection (AtkText *text,
171 gboolean atk_text_set_caret_offset (AtkText *text,
176 #endif /* __cplusplus */
179 #endif /* __ATK_TEXT_H__ */