Changes to introspection generation to remove DOCTYPE and XML
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_hyperlink.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001, 2002 Sun Microsystems Inc.,
6  * Copyright 2001, 2002 Ximian, Inc.
7  *
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.
12  *
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.
17  *
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.
22  */
23
24 #include <cspi/spi-private.h>
25
26 /**
27  * AccessibleHyperlink_ref:
28  * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
29  *
30  * Increment the reference count for an #AccessibleHyperlink object.
31  **/
32 void
33 AccessibleHyperlink_ref (AccessibleHyperlink *obj)
34 {
35   cspi_object_ref (obj);
36 }
37
38 /**
39  * AccessibleHyperlink_unref:
40  * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
41  *
42  * Decrement the reference count for an #AccessibleHyperlink object.
43  **/
44 void
45 AccessibleHyperlink_unref (AccessibleHyperlink *obj)
46 {
47   cspi_object_ref (obj);
48 }
49
50 /**
51  * AccessibleHyperlink_getNAnchors:
52  * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
53  *
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().
59  *
60  * Returns: a #long indicating the number of anchors in this hyperlink.
61  **/
62 long
63 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj)
64 {
65   long retval;
66
67   cspi_return_val_if_fail (obj != NULL, -1);
68
69   retval =
70     Accessibility_Hyperlink__get_nAnchors (CSPI_OBJREF (obj), cspi_ev ());
71
72   cspi_return_val_if_ev ("getNAnchors", -1);
73
74   return retval;
75 }
76
77 /**
78  * AccessibleHyperlink_getURI:
79  * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
80  * @i: a (zero-index) long integer indicating which hyperlink anchor to query.
81  *
82  * Get the URI associated with a particular hyperlink anchor.  
83  *
84  * Returns: a UTF-8 string giving the URI of the @ith hyperlink anchor.
85  **/
86 char *
87 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
88                             long int             i)
89 {
90   char *retval;
91
92   cspi_return_val_if_fail (obj != NULL, NULL);
93
94   retval =
95     Accessibility_Hyperlink_getURI (CSPI_OBJREF (obj),
96                                     i, cspi_ev ());
97
98   cspi_return_val_if_ev ("getURI", NULL);
99
100   return retval;
101 }
102
103 /**
104  * AccessibleHyperlink_getObject:
105  * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
106  * @i: a (zero-index) long integer indicating which hyperlink anchor to query.
107  *
108  * Get the object associated with a particular hyperlink anchor, as an #Accessible. 
109  *
110  * Returns: an #Accessible that represents the object associated with the @ith anchor
111  *        of the specified #AccessibleHyperlink.
112  **/
113 Accessible*
114 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
115                                long int             i)
116 {
117   cspi_return_val_if_fail (obj != NULL, NULL);
118
119   return cspi_object_add (
120     Accessibility_Hyperlink_getObject (CSPI_OBJREF (obj),
121                                        i, cspi_ev ()));
122 }
123
124 /**
125  * AccessibleHyperlink_getIndexRange:
126  * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
127  * @startIndex: a pointer to a long integer into which the starting
128  *       offset of the text associated with this #AccessibleHyperlink is returned.
129  * @endIndex: a pointer to a long integer into which the offset of the first character
130  *       after the text associated with this #AccessibleHyperlink is returned.
131  *
132  *
133  * Get the starting and ending character offsets of the text range associated with
134  *       a #AccessibleHyperlink, in its originating #AccessibleHypertext.
135  **/
136 void
137 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
138                                    long int *startIndex,
139                                    long int *endIndex)
140 {
141   CORBA_long si, ei;
142
143   cspi_return_if_fail (obj != NULL);
144
145 si = Accessibility_Hyperlink__get_startIndex (CSPI_OBJREF (obj), cspi_ev ());
146  cspi_return_if_ev ("startIndex");
147  ei = Accessibility_Hyperlink__get_endIndex (CSPI_OBJREF (obj), cspi_ev ());
148
149  cspi_return_if_ev ("endIndex");
150  *startIndex = si;
151  *endIndex = ei; 
152 }
153
154 /**
155  * AccessibleHyperlink_isValid:
156  * @obj: a pointer to the #AccessibleHyperlink on which to operate.
157  *
158  * Tell whether an #AccessibleHyperlink object is still valid with respect to its
159  *          originating hypertext object.
160  *
161  * Returns: #TRUE of the specified #AccessibleHyperlink is still valid with respect
162  *          to its originating #AccessibleHypertext object, #FALSE otherwise.
163  **/
164 SPIBoolean
165 AccessibleHyperlink_isValid (AccessibleHyperlink *obj)
166 {
167   SPIBoolean retval;
168
169   cspi_return_val_if_fail (obj != NULL, FALSE);
170
171   retval =
172     Accessibility_Hyperlink_isValid (CSPI_OBJREF (obj), cspi_ev ());
173
174   cspi_return_val_if_ev ("isValid", FALSE);
175
176   return retval;
177 }
178
179