1 /* ATK - The Accessibility Toolkit for GTK+
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #include "atkhypertext.h"
22 struct _AtkHypertextIfaceClass
27 typedef struct _AtkHypertextIfaceClass AtkHypertextIfaceClass;
29 static void atk_hypertext_interface_init (AtkHypertextIfaceClass *klass);
31 static gpointer parent_class = NULL;
35 atk_hypertext_get_type ()
37 static GType type = 0;
40 static const GTypeInfo tinfo =
42 sizeof (AtkHypertextIface),
45 (GInterfaceInitFunc) atk_hypertext_interface_init,
48 type = g_type_register_static (G_TYPE_INTERFACE, "AtkHypertext", &tinfo, 0);
59 atk_hypertext_interface_init (AtkHypertextIfaceClass *klass)
61 parent_class = g_type_class_ref (ATK_TYPE_HYPERTEXT);
65 *atk_hypertext_get_link:
66 *@hypertext: an #AtkHypertext
67 *@link_index: the index of the link to be returned
69 * Gets the link in this hypertext document at index
72 *Returns: the link in this hypertext document at
76 atk_hypertext_get_link (AtkHypertext *hypertext,
79 AtkHypertextIface *iface;
81 g_return_val_if_fail (hypertext != NULL, NULL);
82 g_return_val_if_fail (ATK_IS_HYPERTEXT (hypertext), NULL);
84 iface = ATK_HYPERTEXT_GET_IFACE (hypertext);
87 return (*(iface->get_link)) (hypertext, link_index);
93 *atk_hypertext_get_n_links:
94 *@hypertext: an #AtkHypertext
96 * Gets the number of links within this hypertext document.
98 *Returns: the number of links within this hypertext document
101 atk_hypertext_get_n_links (AtkHypertext *hypertext)
103 AtkHypertextIface *iface;
105 g_return_val_if_fail (hypertext != NULL, 0);
106 g_return_val_if_fail (ATK_IS_HYPERTEXT (hypertext), 0);
108 iface = ATK_HYPERTEXT_GET_IFACE (hypertext);
110 if (iface->get_n_links)
111 return (*(iface->get_n_links)) (hypertext);
117 *atk_hypertext_get_link_index:
118 *@hypertext: an #AtkHypertext
119 *@char_index: a character index
121 * Gets the index into the array of hyperlinks that is associated with
122 * @char_index character index, or -1 if there is no hyperlink associated with
125 * Returns: the index into the array of hyperlinks that is associated with
126 * @char_index character index, or -1 if there is no hyperlink associated with
130 atk_hypertext_get_link_index (AtkHypertext *hypertext,
133 AtkHypertextIface *iface;
135 g_return_val_if_fail (hypertext != NULL, -1);
136 g_return_val_if_fail (ATK_IS_HYPERTEXT (hypertext), -1);
138 iface = ATK_HYPERTEXT_GET_IFACE (hypertext);
140 if (iface->get_link_index)
141 return (*(iface->get_link_index)) (hypertext, char_index);