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 <cspi/spi-private.h>
27 * AccessibleHyperlink_ref:
28 * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
30 * Increment the reference count for an #AccessibleHyperlink object.
33 AccessibleHyperlink_ref (AccessibleHyperlink *obj)
35 cspi_object_ref (obj);
39 * AccessibleHyperlink_unref:
40 * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
42 * Decrement the reference count for an #AccessibleHyperlink object.
45 AccessibleHyperlink_unref (AccessibleHyperlink *obj)
47 cspi_object_unref (obj);
51 * AccessibleHyperlink_getNAnchors:
52 * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
54 * Get the total number of anchors which an #AccessibleHyperlink implementor has.
55 * Though typical hyperlinks have only one anchor, client-side image maps and
56 * other hypertext objects may potentially activate or refer to multiple
57 * URIs. For each anchor there is a corresponding URI and object.
58 * @see AccessibleHyperlink_getURI() and AccessibleHyperlink_getObject().
60 * Returns: a #long indicating the number of anchors in this hyperlink.
63 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj)
67 cspi_return_val_if_fail (obj != NULL, -1);
69 cspi_dbus_get_property (obj, spi_interface_hyperlink, "nAnchors", NULL, "n", &retval);
71 cspi_return_val_if_ev ("getNAnchors", -1);
77 * AccessibleHyperlink_getURI:
78 * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
79 * @i: a (zero-index) long integer indicating which hyperlink anchor to query.
81 * Get the URI associated with a particular hyperlink anchor.
83 * Returns: a UTF-8 string giving the URI of the @ith hyperlink anchor.
86 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
92 cspi_return_val_if_fail (obj != NULL, NULL);
94 cspi_dbus_call (obj, spi_interface_hyperlink, "getURI", NULL, "i=>s", d_i, &retval);
96 cspi_return_val_if_ev ("getURI", NULL);
102 * AccessibleHyperlink_getObject:
103 * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
104 * @i: a (zero-index) long integer indicating which hyperlink anchor to query.
106 * Get the object associated with a particular hyperlink anchor, as an #Accessible.
108 * Returns: an #Accessible that represents the object associated with the @ith anchor
109 * of the specified #AccessibleHyperlink.
112 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
115 dbus_int32_t d_i = i;
119 cspi_return_val_if_fail (obj != NULL, NULL);
121 cspi_dbus_call (obj, spi_interface_hyperlink, "getObject", NULL, "i=>o", d_i, &path);
122 retval = cspi_ref_related_accessible (obj, path);
127 * AccessibleHyperlink_getIndexRange:
128 * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
129 * @startIndex: a pointer to a long integer into which the starting
130 * offset of the text associated with this #AccessibleHyperlink is returned.
131 * @endIndex: a pointer to a long integer into which the offset of the first character
132 * after the text associated with this #AccessibleHyperlink is returned.
135 * Get the starting and ending character offsets of the text range associated with
136 * a #AccessibleHyperlink, in its originating #AccessibleHypertext.
139 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
140 long int *startIndex,
145 cspi_return_if_fail (obj != NULL);
147 cspi_dbus_get_property (obj, spi_interface_hyperlink, "startIndex", NULL, "i", &si);
148 cspi_return_if_ev ("startIndex");
149 cspi_dbus_get_property (obj, spi_interface_hyperlink, "endIndex", NULL, "i", &ei);
150 cspi_return_if_ev ("endIndex");
156 * AccessibleHyperlink_isValid:
157 * @obj: a pointer to the #AccessibleHyperlink on which to operate.
159 * Tell whether an #AccessibleHyperlink object is still valid with respect to its
160 * originating hypertext object.
162 * Returns: #TRUE of the specified #AccessibleHyperlink is still valid with respect
163 * to its originating #AccessibleHypertext object, #FALSE otherwise.
166 AccessibleHyperlink_isValid (AccessibleHyperlink *obj)
170 cspi_return_val_if_fail (obj != NULL, FALSE);
172 cspi_dbus_call (obj, spi_interface_hyperlink, "isValid", NULL, "=>b", &retval);
174 cspi_return_val_if_ev ("isValid", FALSE);