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