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 typedef GSList AtkAttributeSet;
34 typedef struct _AtkAttribute {
39 #define ATK_TYPE_TEXT (atk_text_get_type ())
40 #define ATK_IS_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TEXT)
41 #define ATK_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TEXT, AtkText)
42 #define ATK_TEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TEXT, AtkTextIface))
44 #ifndef _TYPEDEF_ATK_TEXT_
45 #define _TYPEDEF_ATK_TEXT_
46 typedef struct _AtkText AtkText;
48 typedef struct _AtkTextIface AtkTextIface;
53 *@ATK_XY_SCREEN: specifies xy coordinates relative to the screen
54 *@ATK_XY_WINDOW: specifies xy coordinates relative to the widgets
57 *Specifies how xy coordinates are to be interpreted
66 *@ATK_TEXT_BOUNDARY_CHAR:
67 *@ATK_TEXT_BOUNDARY_WORD_START:
68 *@ATK_TEXT_BOUNDARY_WORD_END:
69 *@ATK_TEXT_BOUNDARY_SENTENCE_START:
70 *@ATK_TEXT_BOUNDARY_SENTENCE_END:
71 *@ATK_TEXT_BOUNDARY_LINE_START:
72 *@ATK_TEXT_BOUNDARY_LINE_END:
74 *Text boundary types used for specifying boundaries for regions of text
77 ATK_TEXT_BOUNDARY_CHAR,
78 ATK_TEXT_BOUNDARY_WORD_START,
79 ATK_TEXT_BOUNDARY_WORD_END,
80 ATK_TEXT_BOUNDARY_SENTENCE_START,
81 ATK_TEXT_BOUNDARY_SENTENCE_END,
82 ATK_TEXT_BOUNDARY_LINE_START,
83 ATK_TEXT_BOUNDARY_LINE_END
88 GTypeInterface parent;
90 gchar* (* get_text) (AtkText *text,
93 gchar* (* get_text_after_offset) (AtkText *text,
95 AtkTextBoundary boundary_type,
98 gchar* (* get_text_at_offset) (AtkText *text,
100 AtkTextBoundary boundary_type,
103 gunichar (* get_character_at_offset) (AtkText *text,
105 gchar* (* get_text_before_offset) (AtkText *text,
107 AtkTextBoundary boundary_type,
110 gint (* get_caret_offset) (AtkText *text);
111 AtkAttributeSet* (* ref_run_attributes) (AtkText *text,
115 void (* get_character_extents) (AtkText *text,
122 gint (* get_character_count) (AtkText *text);
123 gint (* get_offset_at_point) (AtkText *text,
127 gint (* get_n_selections) (AtkText *text);
128 gchar* (* get_selection) (AtkText *text,
132 gboolean (* add_selection) (AtkText *text,
135 gboolean (* remove_selection) (AtkText *text,
137 gboolean (* set_selection) (AtkText *text,
141 gboolean (* set_caret_offset) (AtkText *text,
143 void (* text_changed) (AtkText *text);
144 void (* caret_changed) (AtkText *text,
147 GType atk_text_get_type (void);
151 * Additional AtkObject properties used by AtkText:
152 * "accessible_text" (accessible text has changed)
153 * "accessible_caret" (accessible text cursor position changed:
154 * editable text only)
157 gchar* atk_text_get_text (AtkText *text,
160 gunichar atk_text_get_character_at_offset (AtkText *text,
162 gchar* atk_text_get_text_after_offset (AtkText *text,
164 AtkTextBoundary boundary_type,
167 gchar* atk_text_get_text_at_offset (AtkText *text,
169 AtkTextBoundary boundary_type,
172 gchar* atk_text_get_text_before_offset (AtkText *text,
174 AtkTextBoundary boundary_type,
177 gint atk_text_get_caret_offset (AtkText *text);
178 void atk_text_get_character_extents (AtkText *text,
185 AtkAttributeSet* atk_text_ref_run_attributes (AtkText *text,
189 gint atk_text_get_character_count (AtkText *text);
190 gint atk_text_get_offset_at_point (AtkText *text,
194 gint atk_text_get_n_selections (AtkText *text);
195 gchar* atk_text_get_selection (AtkText *text,
199 gboolean atk_text_add_selection (AtkText *text,
202 gboolean atk_text_remove_selection (AtkText *text,
204 gboolean atk_text_set_selection (AtkText *text,
208 gboolean atk_text_set_caret_offset (AtkText *text,
210 void AtkAttributeSet_free (AtkAttributeSet *attrib_set);
214 #endif /* __cplusplus */
217 #endif /* __ATK_TEXT_H__ */