1/*
2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4 *
5 * Copyright 2002 Ximian, Inc.
6 * 2002 Sun Microsystems Inc.
7 *
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23 */
24
25#ifndef _ATSPI_DOCUMENT_H_
26#define _ATSPI_DOCUMENT_H_
27
28#include "glib-object.h"
29
30#include "atspi-constants.h"
31
32#include "atspi-types.h"
33
34G_BEGIN_DECLS
35
36#define ATSPI_TYPE_DOCUMENT (atspi_document_get_type ())
37#define ATSPI_IS_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DOCUMENT)
38#define ATSPI_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DOCUMENT, AtspiDocument)
39#define ATSPI_DOCUMENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATSPI_TYPE_DOCUMENT, AtspiDocument))
40
41GType atspi_document_get_type ();
42
43/**
44 * AtspiTextSelection:
45 * @start_object: the AtspiAccessible containing the start of the selection.
46 * @start_offset: the text offset of the beginning of the selection within
47 * @start_object.
48 * @end_object: the AtspiAccessible containing the end of the selection.
49 * @end_offset: the text offset of the end of the selection within @end_object.
50 * @start_is_active: a gboolean indicating whether the start of the selection
51 * is the active point.
52 *
53 * This structure represents a single text selection within a document. This
54 * selection is defined by two points in the content, where each one is defined
55 * by an AtkObject supporting the AtkText interface and a character offset
56 * relative to it.
57 *
58 * The end object must appear after the start object in the accessibility tree,
59 * i.e. the end object must be reachable from the start object by navigating
60 * forward (next, first child etc).
61 *
62 * This struct also contains a @start_is_active boolean, to communicate if the
63 * start of the selection is the active point or not.
64 *
65 * The active point corresponds to the user's focus or point of interest. The
66 * user moves the active point to expand or collapse the range. The anchor
67 * point is the other point of the range and typically remains constant. In
68 * most cases, anchor is the start of the range and active is the end. However,
69 * when selecting backwards (e.g. pressing shift+left arrow in a text field),
70 * the start of the range is the active point, as the user moves this to
71 * manipulate the selection.
72 *
73 * Since: 2.52
74 */
75typedef struct _AtspiTextSelection AtspiTextSelection;
76struct _AtspiTextSelection
77{
78 AtspiAccessible *start_object;
79 gint start_offset;
80 AtspiAccessible *end_object;
81 gint end_offset;
82 gboolean start_is_active;
83};
84
85struct _AtspiDocument
86{
87 GTypeInterface parent;
88};
89
90gchar *atspi_document_get_locale (AtspiDocument *obj, GError **error);
91
92#ifndef ATSPI_DISABLE_DEPRECATED
93gchar *atspi_document_get_attribute_value (AtspiDocument *obj, const gchar *attribute, GError **error);
94#endif
95
96gchar *atspi_document_get_document_attribute_value (AtspiDocument *obj, const gchar *attribute, GError **error);
97
98#ifndef ATSPI_DISABLE_DEPRECATED
99GHashTable *atspi_document_get_attributes (AtspiDocument *obj, GError **error);
100#endif
101
102GHashTable *atspi_document_get_document_attributes (AtspiDocument *obj, GError **error);
103
104gint atspi_document_get_page_count (AtspiDocument *obj, GError **error);
105gint atspi_document_get_current_page_number (AtspiDocument *obj, GError **error);
106
107GArray *atspi_document_get_text_selections (AtspiDocument *document, GError **error);
108
109gboolean atspi_document_set_text_selections (AtspiDocument *document, GArray *selections, GError **error);
110G_END_DECLS
111
112#endif /* _ATSPI_DOCUMENT_H_ */
113

source code of include/at-spi-2.0/atspi/atspi-document.h