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