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