Renamed SpiAccessibleEventListener to (just) SpiEventListener.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_editabletext.c
1 /**
2  * AccessibleEditableText_ref:
3  * @obj: a pointer to the #AccessibleEditableText object on which to operate.
4  *
5  * Increment the reference count for an #AccessibleEditableText object.
6  *       Since AccessibleEditableText is derived from AccessibleText,
7  *       this is the same as AccessibleText_ref().
8  *
9  * Returns: (no return code implemented yet).
10  *
11  **/
12 int
13 AccessibleEditableText_ref (AccessibleEditableText *obj)
14 {
15   Accessibility_EditableText_ref (*obj, &ev);
16   return 0;
17 }
18
19
20
21 /**
22  * AccessibleEditableText_ref:
23  * @obj: a pointer to the #AccessibleEditableText object on which to operate.
24  *
25  * Decrement the reference count for an #AccessibleEdiitableText object.
26  *       Since AccessibleEditableText is derived from AccessibleText,
27  *       this is the same as AccessibleText_unref().
28  *
29  * Returns: (no return code implemented yet).
30  *
31  **/
32 int
33 AccessibleEditableText_unref (AccessibleEditableText *obj)
34 {
35   Accessibility_EditableText_unref (*obj, &ev);
36   return 0;
37 }
38
39
40
41 /**
42  * AccessibleEditableText_setAttributes:
43  * @obj: a pointer to the #AccessibleEditableText object to modify.
44  * @startOffset: a #long indicating the start of the desired text range.
45  * @endOffset: a #long indicating the first character past the desired range.
46  *
47  * Set the attributes applied to a range of text from an #AccessibleEditableText
48  *          object, and the bounds of the range.
49  *
50  * Returns: #TRUE if the operation was successful, otherwise #FALSE.
51  *
52  **/
53 boolean
54 AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
55                                       const char *attributes,
56                                       long int startPos,
57                                       long int endPos)
58 {
59   return (boolean)
60     Accessibility_EditableText_setAttributes (*obj,
61                                               (CORBA_char *) attributes,
62                                               (CORBA_long) startPos,
63                                               (CORBA_long) endPos, &ev);
64 }
65
66
67
68 /**
69  * AccessibleEditableText_setTextContents:
70  * @obj: a pointer to the #AccessibleEditableText object to modify.
71  * @newContents: a character string, encoded in UTF-8, which is to
72  *      become the new text contents of the #AccessibleEditableText object.
73  *
74  * Replace the entire text contents of an #AccessibleEditableText object.
75  *
76  * Returns: #TRUE if the operation was successful, otherwise #FALSE.
77  *
78  **/
79 boolean
80 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
81                                         const char *newContents)
82 {
83   Accessibility_EditableText_setTextContents (*obj,
84                                               (CORBA_char *) newContents, &ev);
85   return TRUE; /* TODO: make bonobo method return a boolean */
86 }
87
88
89
90 /**
91  * AccessibleEditableText_insertText:
92  * @obj: a pointer to the #AccessibleEditableText object to modify.
93  * @position: an integer indicating the character offset at which to insert
94  *       the new text.  
95  * @text: a char* pointer to the text to insert, in UTF-8 encoding.
96  * @length: (frankly I'm not sure this parameter should be here)
97  *
98  * Insert text into an #AccessibleEditableText object.
99  * As with all character offsets, the specified @position may not be the
100  *       same as the resulting byte offset, since the text is in a
101  *       variable-width encoding.
102  *
103  * Returns: #TRUE if the operation was successful, otherwise #FALSE.
104  *
105  **/
106 boolean
107 AccessibleEditableText_insertText (AccessibleEditableText *obj,
108                                    long int position,
109                                    char *text,
110                                    long int length)
111 {
112   Accessibility_EditableText_insertText (*obj,
113                                          (CORBA_long) position, (CORBA_char *) text,
114                                          (CORBA_long) length, &ev);
115   return TRUE;
116 }
117
118
119
120 /**
121  * AccessibleEditableText_copyText:
122  * @obj: a pointer to the #AccessibleEditableText object to modify.
123  * @startPos: an integer indicating the starting character offset
124  *       of the text to copy.
125  * @endPos: an integer indicating the offset of the first character
126  *       past the end of the text section to be copied.
127  *
128  * Copy text from an #AccessibleEditableText object into the clipboard.
129  *
130  * @see: AccessibleEditableText_pasteText 
131  *
132  * Returns: #TRUE if the operation was successful, otherwise #FALSE.
133  *
134  **/
135 boolean
136 AccessibleEditableText_copyText (AccessibleText *obj,
137                                  long int startPos,
138                                  long int endPos)
139 {
140   Accessibility_EditableText_copyText (*obj,
141                                        (CORBA_long) startPos, (CORBA_long) endPos, &ev);
142   return TRUE;
143 }
144
145
146 /**
147  * AccessibleEditableText_cutText:
148  * @obj: a pointer to the #AccessibleEditableText object to modify.
149  * @startPos: an integer indicating the starting character offset
150  *       of the text to cut.
151  * @endPos: an integer indicating the offset of the first character
152  *       past the end of the text section to be cut.
153  *
154  * Delete text from an #AccessibleEditableText object, copying the
155  *       excised portion into the clipboard.
156  *
157  * @see: AccessibleEditableText_pasteText
158  *
159  * Returns: #TRUE if operation was successful, #FALSE otherwise.
160  *
161  **/
162 boolean
163 AccessibleEditableText_cutText (AccessibleEditableText *obj,
164                                 long int startPos,
165                                 long int endPos)
166 {
167   Accessibility_EditableText_cutText (*obj,
168                                        (CORBA_long) startPos, (CORBA_long) endPos, &ev);
169   return TRUE;
170 }
171
172
173
174 /**
175  * AccessibleEditableText_deleteText:
176  * @obj: a pointer to the #AccessibleEditableText object to modify.
177  * @startPos: an integer indicating the starting character offset
178  *       of the text to delete.
179  * @endPos: an integer indicating the offset of the first character
180  *       past the end of the text section to be deleted.
181  *
182  * Delete text from an #AccessibleEditableText object, without copying the
183  *       excised portion into the clipboard.
184  *
185  * @see: AccessibleEditableText_cutText
186  *
187  * Returns: #TRUE if the operation was successful, otherwise #FALSE.
188  *
189  **/
190 boolean
191 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
192                                    long startPos,
193                                    long endPos)
194 {
195   Accessibility_EditableText_deleteText (*obj,
196                                        (CORBA_long) startPos, (CORBA_long) endPos, &ev);
197   return TRUE;
198 }
199
200
201
202 /**
203  * AccessibleEditableText_pasteText:
204  * @obj: a pointer to the #AccessibleEditableText object to modify.
205  * @position: an integer indicating the character offset at which to insert
206  *       the new text.  
207  *
208  * Insert text from the clipboard into an #AccessibleEditableText object.
209  * As with all character offsets, the specified @position may not be the
210  *       same as the resulting byte offset, since the text is in a
211  *       variable-width encoding.
212  *
213  * Returns: #TRUE if the operation was successful, otherwise #FALSE.
214  *
215  **/
216 boolean
217 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
218                                   long int position)
219 {
220   Accessibility_EditableText_pasteText (*obj,
221                                         (CORBA_long) position, &ev);
222   return TRUE;
223 }
224