2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001, 2002 Sun Microsystems Inc.,
6 * Copyright 2001, 2002 Ximian, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
24 #include "atspi-private.h"
27 * atspi_document_get_locale:
28 * @obj: a pointer to the #AtspiDocument object on which to operate.
30 * Gets the locale associated with the document's content,
31 * e.g. the locale for LOCALE_TYPE_MESSAGES.
33 * Returns: a string compliant with the POSIX standard for locale description.
36 atspi_document_get_locale (AtspiDocument *obj, GError **error)
40 g_return_val_if_fail (obj != NULL, g_strdup ("C"));
42 _atspi_dbus_call (obj, atspi_interface_document, "GetLocale", error, "=>s", &retval);
48 * atspi_document_get_attribute_value: (rename-to atspi_document_get_document_attribute_value)
49 * @obj: a pointer to the #AtspiDocument object on which to operate.
50 * @attribute: a string indicating the name of a specific attribute.
52 * Gets the value of a single attribute, if specified for the document as a whole.
54 * Returns: a string corresponding to the value of the specified attribute, or
55 * an empty string if the attribute is unspecified for the object.
57 * Deprecated: 2.10: Use atspi_document_get_document_attribute_value instead.
60 atspi_document_get_attribute_value (AtspiDocument *obj,
64 return atspi_document_get_document_attribute_value (obj, attribute, error);
68 * atspi_document_get_document_attribute_value:
69 * @obj: a pointer to the #AtspiDocument object on which to operate.
70 * @attribute: a string indicating the name of a specific attribute.
72 * Gets the value of a single attribute, if specified for the document as a whole.
74 * Returns: a string corresponding to the value of the specified attribute, or
75 * an empty string if the attribute is unspecified for the object.
78 atspi_document_get_document_attribute_value (AtspiDocument *obj,
84 g_return_val_if_fail (obj != NULL, NULL);
86 _atspi_dbus_call (obj, atspi_interface_document, "GetAttributeValue", error, "s=>s", attribute, &retval);
89 retval = g_strdup ("");
96 * atspi_document_get_attributes: (rename-to atspi_document_get_document_attributes)
97 * @obj: a pointer to the #AtspiDocument object on which to operate.
99 * Gets all constant attributes for the document as a whole. For attributes
100 * that change within the document content, see @atspi_text_get_attribute_run instead.
102 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
103 * containing the constant attributes of the document, as name-value pairs.
105 * Deprecated: 2.10: Use atspi_document_get_document_attributes instead.
108 atspi_document_get_attributes (AtspiDocument *obj, GError **error)
110 return atspi_document_get_document_attributes (obj, error);
114 * atspi_document_get_document_attributes:
115 * @obj: a pointer to the #AtspiDocument object on which to operate.
117 * Gets all constant attributes for the document as a whole. For attributes
118 * that change within the document content, see @atspi_text_get_attribute_run instead.
120 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
121 * containing the constant attributes of the document, as name-value pairs.
124 atspi_document_get_document_attributes (AtspiDocument *obj, GError **error)
126 DBusMessage *message;
128 g_return_val_if_fail (obj != NULL, NULL);
130 message = _atspi_dbus_call_partial (obj, atspi_interface_document, "GetAttributes", error, "");
131 return _atspi_dbus_return_hash_from_message (message);
135 * atspi_document_get_page_count:
136 * @obj: a pointer to the #AtspiDocument object to query.
138 * Gets the page count of an #AccessibleDocument object.
140 * Returns: a #gint indicating the page count of an
141 * #AccessibleDocument object.
144 atspi_document_get_page_count (AtspiDocument *obj, GError **error)
146 dbus_int32_t retval = 0;
148 g_return_val_if_fail (obj != NULL, -1);
150 _atspi_dbus_get_property (obj, atspi_interface_document, "PageCount", error, "i", &retval);
156 * atspi_document_get_current_page_number:
157 * @obj: a pointer to the #AtspiDocument object to query.
159 * Gets the current page number of an #AccessibleDocument object.
161 * Returns: a #gint indicating the current page number in the
162 * #AccessibleDocument object.
165 atspi_document_get_current_page_number (AtspiDocument *obj, GError **error)
167 dbus_int32_t retval = 0;
169 g_return_val_if_fail (obj != NULL, -1);
171 _atspi_dbus_get_property (obj, atspi_interface_document, "CurrentPageNumber", error, "i", &retval);
177 atspi_document_base_init (AtspiDocument *klass)
182 atspi_document_get_type (void)
184 static GType type = 0;
187 static const GTypeInfo tinfo =
189 sizeof (AtspiDocument),
190 (GBaseInitFunc) atspi_document_base_init,
191 (GBaseFinalizeFunc) NULL,
194 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiDocument", &tinfo, 0);