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_hypertext_get_n_links:
28 * @obj: a pointer to the #AtspiHypertext implementor on which to operate.
30 * Get the total number of #AtspiHyperlinks which an
31 * #AtspiHypertext implementor has.
33 * Returns: a #gint indicating the number of #AtspiHyperlinks
34 * of the #AtspiHypertext implementor, or -1 if
35 * the number cannot be determined (for example, if the
36 * #AtspiHypertext object is so large that it is not
37 * all currently in the memory cache).
40 atspi_hypertext_get_n_links (AtspiHypertext *obj, GError **error)
42 dbus_int32_t retval = 0;
44 g_return_val_if_fail (obj != NULL, FALSE);
46 _atspi_dbus_call (obj, atspi_interface_hypertext, "GetNLinks", error, "=>i", &retval);
52 * atspi_hypertext_get_link:
53 * @obj: a pointer to the #AtspiHypertext implementor on which to operate.
54 * @link_index: a (zero-index) integer indicating which hyperlink to query.
56 * Get the #AtspiHyperlink object at a specified index.
58 * Returns: (transfer full): the #AtspiHyperlink object specified by
62 atspi_hypertext_get_link (AtspiHypertext *obj, gint link_index, GError **error)
64 dbus_int32_t d_link_index = link_index;
67 g_return_val_if_fail (obj != NULL, NULL);
69 reply = _atspi_dbus_call_partial (obj, atspi_interface_hypertext, "GetLink", error, "i", d_link_index);
71 return _atspi_dbus_return_hyperlink_from_message (reply);
75 * atspi_hypertext_get_link_index:
76 * @obj: a pointer to the #AtspiHypertext implementor on which to operate.
77 * @character_offset: an integer specifying the character offset to query.
79 * Get the index of the #AtspiHyperlink object at a specified
82 * Returns: the linkIndex of the #AtspiHyperlink active at
83 * character offset @character_offset, or -1 if there is
84 * no hyperlink at the specified character offset.
87 atspi_hypertext_get_link_index (AtspiHypertext *obj,
88 gint character_offset,
91 dbus_int32_t d_character_offset = character_offset;
92 dbus_int32_t retval = -1;
94 g_return_val_if_fail (obj != NULL, -1);
96 _atspi_dbus_call (obj, atspi_interface_hypertext, "GetLinkIndex", error, "i=>i", d_character_offset, &retval);
102 atspi_hypertext_base_init (AtspiHypertext *klass)
107 atspi_hypertext_get_type (void)
109 static GType type = 0;
112 static const GTypeInfo tinfo =
114 sizeof (AtspiHypertext),
115 (GBaseInitFunc) atspi_hypertext_base_init,
116 (GBaseFinalizeFunc) NULL,
119 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiHypertext", &tinfo, 0);