2001-12-10 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_hyperlink.c
1 #include <cspi/spi-private.h>
2
3 /**
4  * AccessibleHyperlink_ref:
5  * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
6  *
7  * Increment the reference count for an #AccessibleHyperlink object.
8  *
9  * Returns: (no return code implemented yet).
10  *
11  **/
12 int
13 AccessibleHyperlink_ref (AccessibleHyperlink *obj)
14 {
15   cspi_object_ref (obj);
16   return 0;
17 }
18
19
20
21 /**
22  * AccessibleHyperlink_unref:
23  * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
24  *
25  * Decrement the reference count for an #AccessibleHyperlink object.
26  *
27  * Returns: (no return code implemented yet).
28  *
29  **/
30 int
31 AccessibleHyperlink_unref (AccessibleHyperlink *obj)
32 {
33   cspi_object_ref (obj);
34   return 0;
35 }
36
37 /**
38  * AccessibleHyperlink_getNAnchors:
39  * @obj: a pointer to the #AccessibleHyperlink object on which to operate.
40  *
41  * Get the total number of anchors which an #AccessibleHyperlink implementor has.
42  *       Though typical hyperlinks have only one anchor, client-side image maps and
43  *       other hypertext objects may potentially activate or refer to multiple
44  *       URIs.  For each anchor there is a corresponding URI and object.
45  * @see AccessibleHyperlink_getURI() and AccessibleHyperlink_getObject().
46  *
47  * Returns: a #long indicating the number of anchors in this hyperlink.
48  *
49  **/
50 long
51 AccessibleHyperlink_getNAnchors (AccessibleHyperlink *obj)
52 {
53   return (long)
54     Accessibility_Hyperlink__get_nAnchors (CSPI_OBJREF (obj), cspi_ev ());
55 }
56
57
58 /**
59  * AccessibleHyperlink_getURI:
60  * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
61  * @i: a (zero-index) long integer indicating which hyperlink anchor to query.
62  *
63  * Get the URI associated with a particular hyperlink anchor.  
64  *
65  * Returns: a UTF-8 string giving the URI of the @ith hyperlink anchor.
66  *
67  **/
68 char *
69 AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
70                             long int i)
71 {
72   return (char *)
73     Accessibility_Hyperlink_getURI (CSPI_OBJREF (obj),
74                                     (CORBA_long) i, cspi_ev ());
75 }
76
77 /**
78  * AccessibleHyperlink_getObject:
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 object associated with a particular hyperlink anchor, as an #Accessible. 
83  *
84  * Returns: an #Accessible that represents the object associated with the @ith anchor
85  *        of the specified #AccessibleHyperlink.
86  *
87  **/
88 Accessible*
89 AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
90                                long int i)
91 {
92   return cspi_object_add (
93     Accessibility_Hyperlink_getObject (CSPI_OBJREF (obj),
94                                        (CORBA_long) i, cspi_ev ()));
95 }
96
97 /**
98  * AccessibleHyperlink_getIndexRange:
99  * @obj: a pointer to the #AccessibleHyperlink implementor on which to operate.
100  * @startIndex: a pointer to a long integer into which the starting
101  *       offset of the text associated with this #AccessibleHyperlink is returned.
102  * @endIndex: a pointer to a long integer into which the offset of the first character
103  *       after the text associated with this #AccessibleHyperlink is returned.
104  *
105  *
106  * Get the starting and ending character offsets of the text range associated with
107  *       a #AccessibleHyperlink, in its originating #AccessibleHypertext.
108  *
109  **/
110 void
111 AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
112                                    long int *startIndex,
113                                    long int *endIndex)
114 {
115   *startIndex = (long)
116     Accessibility_Hyperlink__get_startIndex (CSPI_OBJREF (obj), cspi_ev ());
117   *endIndex = (long)
118     Accessibility_Hyperlink__get_endIndex (CSPI_OBJREF (obj), cspi_ev ());
119 }
120
121
122
123 /**
124  * AccessibleHyperlink_isValid:
125  * @obj: a pointer to the #AccessibleHyperlink on which to operate.
126  *
127  * Tell whether an #AccessibleHyperlink object is still valid with respect to its
128  *          originating hypertext object.
129  *
130  * Returns: #TRUE of the specified #AccessibleHyperlink is still valid with respect
131  *          to its originating #AccessibleHypertext object, #FALSE otherwise.
132  *
133  **/
134 SPIBoolean
135 AccessibleHyperlink_isValid (AccessibleHyperlink *obj)
136 {
137   return (SPIBoolean)
138     Accessibility_Hyperlink_isValid (CSPI_OBJREF (obj), cspi_ev ());
139 }
140
141