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