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 Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 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 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, 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:
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.
58 * Rename to: atspi_document_get_document_attribute_value
61 atspi_document_get_attribute_value (AtspiDocument *obj,
65 return atspi_document_get_document_attribute_value (obj, attribute, error);
69 * atspi_document_get_document_attribute_value:
70 * @obj: a pointer to the #AtspiDocument object on which to operate.
71 * @attribute: a string indicating the name of a specific attribute.
73 * Gets the value of a single attribute, if specified for the document as a whole.
75 * Returns: a string corresponding to the value of the specified attribute, or
76 * an empty string if the attribute is unspecified for the object.
79 atspi_document_get_document_attribute_value (AtspiDocument *obj,
85 g_return_val_if_fail (obj != NULL, NULL);
87 _atspi_dbus_call (obj, atspi_interface_document, "GetAttributeValue", error, "s=>s", attribute, &retval);
90 retval = g_strdup ("");
97 * atspi_document_get_attributes:
98 * @obj: a pointer to the #AtspiDocument object on which to operate.
100 * Gets all constant attributes for the document as a whole. For attributes
101 * that change within the document content, see @atspi_text_get_attribute_run instead.
103 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
104 * containing the constant attributes of the document, as name-value pairs.
106 * Deprecated: 2.10: Use atspi_document_get_document_attributes instead.
107 * Rename to: atspi_document_get_document_attributes
110 atspi_document_get_attributes (AtspiDocument *obj, GError **error)
112 return atspi_document_get_document_attributes (obj, error);
116 * atspi_document_get_document_attributes:
117 * @obj: a pointer to the #AtspiDocument object on which to operate.
119 * Gets all constant attributes for the document as a whole. For attributes
120 * that change within the document content, see @atspi_text_get_attribute_run instead.
122 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
123 * containing the constant attributes of the document, as name-value pairs.
126 atspi_document_get_document_attributes (AtspiDocument *obj, GError **error)
128 DBusMessage *message;
130 g_return_val_if_fail (obj != NULL, NULL);
132 message = _atspi_dbus_call_partial (obj, atspi_interface_document, "GetAttributes", error, "");
133 return _atspi_dbus_return_hash_from_message (message);
137 * atspi_document_get_page_count:
138 * @obj: a pointer to the #AtspiDocument object to query.
140 * Gets the page count of an #AccessibleDocument object.
142 * Returns: a #gint indicating the page count of an
143 * #AccessibleDocument object.
146 atspi_document_get_page_count (AtspiDocument *obj, GError **error)
148 dbus_int32_t retval = 0;
150 g_return_val_if_fail (obj != NULL, -1);
152 _atspi_dbus_get_property (obj, atspi_interface_document, "PageCount", error, "i", &retval);
158 * atspi_document_get_current_page_number:
159 * @obj: a pointer to the #AtspiDocument object to query.
161 * Gets the current page number of an #AccessibleDocument object.
163 * Returns: a #gint indicating the current page number in the
164 * #AccessibleDocument object.
167 atspi_document_get_current_page_number (AtspiDocument *obj, GError **error)
169 dbus_int32_t retval = 0;
171 g_return_val_if_fail (obj != NULL, -1);
173 _atspi_dbus_get_property (obj, atspi_interface_document, "CurrentPageNumber", error, "i", &retval);
179 atspi_document_base_init (AtspiDocument *klass)
184 atspi_document_get_type (void)
186 static GType type = 0;
189 static const GTypeInfo tinfo =
191 sizeof (AtspiDocument),
192 (GBaseInitFunc) atspi_document_base_init,
193 (GBaseFinalizeFunc) NULL,
196 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiDocument", &tinfo, 0);