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