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>
27 #include <atk/atkutil.h>
31 #endif /* __cplusplus */
33 typedef GSList AtkAttributeSet;
35 typedef struct _AtkAttribute {
40 #define ATK_TYPE_TEXT (atk_text_get_type ())
41 #define ATK_IS_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TEXT)
42 #define ATK_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TEXT, AtkText)
43 #define ATK_TEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TEXT, AtkTextIface))
45 #ifndef _TYPEDEF_ATK_TEXT_
46 #define _TYPEDEF_ATK_TEXT_
47 typedef struct _AtkText AtkText;
49 typedef struct _AtkTextIface AtkTextIface;
53 *@ATK_TEXT_BOUNDARY_CHAR:
54 *@ATK_TEXT_BOUNDARY_WORD_START:
55 *@ATK_TEXT_BOUNDARY_WORD_END:
56 *@ATK_TEXT_BOUNDARY_SENTENCE_START:
57 *@ATK_TEXT_BOUNDARY_SENTENCE_END:
58 *@ATK_TEXT_BOUNDARY_LINE_START:
59 *@ATK_TEXT_BOUNDARY_LINE_END:
61 *Text boundary types used for specifying boundaries for regions of text
64 ATK_TEXT_BOUNDARY_CHAR,
65 ATK_TEXT_BOUNDARY_WORD_START,
66 ATK_TEXT_BOUNDARY_WORD_END,
67 ATK_TEXT_BOUNDARY_SENTENCE_START,
68 ATK_TEXT_BOUNDARY_SENTENCE_END,
69 ATK_TEXT_BOUNDARY_LINE_START,
70 ATK_TEXT_BOUNDARY_LINE_END
75 GTypeInterface parent;
77 gchar* (* get_text) (AtkText *text,
80 gchar* (* get_text_after_offset) (AtkText *text,
82 AtkTextBoundary boundary_type,
85 gchar* (* get_text_at_offset) (AtkText *text,
87 AtkTextBoundary boundary_type,
90 gunichar (* get_character_at_offset) (AtkText *text,
92 gchar* (* get_text_before_offset) (AtkText *text,
94 AtkTextBoundary boundary_type,
97 gint (* get_caret_offset) (AtkText *text);
98 AtkAttributeSet* (* ref_run_attributes) (AtkText *text,
102 void (* get_character_extents) (AtkText *text,
108 AtkCoordType coords);
109 gint (* get_character_count) (AtkText *text);
110 gint (* get_offset_at_point) (AtkText *text,
113 AtkCoordType coords);
114 gint (* get_n_selections) (AtkText *text);
115 gchar* (* get_selection) (AtkText *text,
119 gboolean (* add_selection) (AtkText *text,
122 gboolean (* remove_selection) (AtkText *text,
124 gboolean (* set_selection) (AtkText *text,
128 gboolean (* set_caret_offset) (AtkText *text,
134 void (* text_changed) (AtkText *text);
135 void (* caret_changed) (AtkText *text,
139 GType atk_text_get_type (void);
143 * Additional AtkObject properties used by AtkText:
144 * "accessible_text" (accessible text has changed)
145 * "accessible_caret" (accessible text cursor position changed:
146 * editable text only)
149 gchar* atk_text_get_text (AtkText *text,
152 gunichar atk_text_get_character_at_offset (AtkText *text,
154 gchar* atk_text_get_text_after_offset (AtkText *text,
156 AtkTextBoundary boundary_type,
159 gchar* atk_text_get_text_at_offset (AtkText *text,
161 AtkTextBoundary boundary_type,
164 gchar* atk_text_get_text_before_offset (AtkText *text,
166 AtkTextBoundary boundary_type,
169 gint atk_text_get_caret_offset (AtkText *text);
170 void atk_text_get_character_extents (AtkText *text,
176 AtkCoordType coords);
177 AtkAttributeSet* atk_text_ref_run_attributes (AtkText *text,
181 gint atk_text_get_character_count (AtkText *text);
182 gint atk_text_get_offset_at_point (AtkText *text,
185 AtkCoordType coords);
186 gint atk_text_get_n_selections (AtkText *text);
187 gchar* atk_text_get_selection (AtkText *text,
191 gboolean atk_text_add_selection (AtkText *text,
194 gboolean atk_text_remove_selection (AtkText *text,
196 gboolean atk_text_set_selection (AtkText *text,
200 gboolean atk_text_set_caret_offset (AtkText *text,
202 void AtkAttributeSet_free (AtkAttributeSet *attrib_set);
206 #endif /* __cplusplus */
209 #endif /* __ATK_TEXT_H__ */