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.
58 atspi_document_get_attribute_value (AtspiDocument *obj,
64 g_return_val_if_fail (obj != NULL, NULL);
66 _atspi_dbus_call (obj, atspi_interface_document, "GetAttributeValue", error, "s=>s", attribute, &retval);
69 retval = g_strdup ("");
76 * atspi_document_get_attributes:
77 * @obj: a pointer to the #AtspiDocument object on which to operate.
79 * Gets all constant attributes for the document as a whole. For attributes
80 * that change within the document content, see @atspi_text_get_attribute_run instead.
82 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
83 * containing the constant attributes of the document, as name-value pairs.
86 atspi_document_get_attributes (AtspiDocument *obj, GError **error)
90 g_return_val_if_fail (obj != NULL, NULL);
92 message = _atspi_dbus_call_partial (obj, atspi_interface_document, "GetAttributes", error, "");
93 return _atspi_dbus_return_hash_from_message (message);
97 atspi_document_base_init (AtspiDocument *klass)
102 atspi_document_get_type (void)
104 static GType type = 0;
107 static const GTypeInfo tinfo =
109 sizeof (AtspiDocument),
110 (GBaseInitFunc) atspi_document_base_init,
111 (GBaseFinalizeFunc) NULL,
114 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiDocument", &tinfo, 0);