1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_accessibility_XAccessibleEditableText_idl__
25#define __com_sun_star_accessibility_XAccessibleEditableText_idl__
26
27#ifndef __com_sun_star_accessibility_XAccessibleText_idl__
28#include <com/sun/star/accessibility/XAccessibleText.idl>
29#endif
30#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
31#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
32#endif
33#ifndef __com_sun_star_beans_PropertyValue_idl__
34#include <com/sun/star/beans/PropertyValue.idl>
35#endif
36
37module com { module sun { module star { module accessibility {
38
39/** Implement this interface to give read and write access to a text
40    representation.
41
42    <p>This interface is typically used in conjunction with the
43    <type>XAccessibleText</type> interface and extents it about the ability
44    to modify the text represented by that interface.</p>
45
46    @since OpenOffice 1.1.2
47*/
48published interface XAccessibleEditableText
49    : ::com::sun::star::accessibility::XAccessibleText
50{
51    /** Copies the text range into the clipboard.
52
53        <p>The specified text between and including the two given indices is
54        copied into the system clipboard and is deleted afterwards from the
55        text represented by this object.  This is equivalent to calling
56        first <member>XAccessibleText::copyText</member> and then
57        <member>XAccessibleEditableText::deleteText</member> with the given
58        start and end indices.</p>
59
60        <p>The text indices are interpreted like those in the
61        <member>XAccessibleText::getTextRange</member> method. </p>
62
63        @param nStartIndex
64            Start index of the text to moved into the clipboard.
65            The valid range is 0..length.
66
67        @param nEndIndex
68            End index of the text to moved into the clipboard.
69            The valid range is 0..length.
70
71        @return
72            Returns a flag that indicates whether the operation has been
73            executed successfully.
74
75        @throws ::com::sun::star::lang::IndexOutOfBoundsException
76            if the indices are invalid
77    */
78    boolean cutText ([in] long nStartIndex, [in] long nEndIndex)
79        raises (::com::sun::star::lang::IndexOutOfBoundsException);
80
81    /** Pastes text from the clipboard.
82
83        <p>The text in the system clipboard is pasted into the text
84        represented by this object at the given index.  This method is
85        similar to the <member>XAccessibleEditableText::insertText</member>
86        method.  If the index is not valid then the system clipboard text is
87        not inserted.</p>
88
89        @param nIndex
90            Index at which to insert the text from the system clipboard into
91            the text represented by this object.
92            The valid range is 0..length.
93
94        @return
95            Returns a flag that indicates whether the operation has been
96            executed successfully.
97
98        @throws ::com::sun::star::lang::IndexOutOfBoundsException
99            if the index is invalid
100    */
101    boolean pasteText ([in] long nIndex)
102        raises (::com::sun::star::lang::IndexOutOfBoundsException);
103
104    /** Deletes a range of text.
105
106        <p>The text between and including the two given indices is deleted
107        from the text represented by this object.</p>
108
109        <p>The text indices are interpreted like those in the
110        <member>XAccessibleText::getTextRange</member> method. </p>
111
112        @param nStartIndex
113            Start index of the text to be deleted.
114            The valid range is 0..length.
115
116        @param nEndIndex
117            End index of the text to be deleted.
118            The valid range is 0..length.
119
120        @return
121            Returns a flag that indicates whether the operation has been
122            executed successfully.
123
124        @throws ::com::sun::star::lang::IndexOutOfBoundsException
125            if the indices are invalid
126    */
127    boolean deleteText ([in] long nStartIndex, [in] long nEndIndex)
128        raises (::com::sun::star::lang::IndexOutOfBoundsException);
129
130    /** Inserts text at the specified position.
131
132        <p>The specified string is inserted at the given index into the text
133        represented by this object.</p>
134
135        @param sText
136            Text that is inserted.
137
138        @param nIndex
139            Index at which to insert the text.
140            The valid range is 0..length.
141
142        @return
143            Returns a flag that indicates whether the operation has been
144            executed successfully.
145
146        @throws ::com::sun::star::lang::IndexOutOfBoundsException
147            if the indices are invalid
148    */
149    boolean insertText ([in] string sText, [in] long nIndex)
150        raises (::com::sun::star::lang::IndexOutOfBoundsException);
151
152    /** Replaces text.
153
154        <p>The text between the two given indices is replaced
155        by the specified replacement string. This method is
156        equivalent to calling first
157        <member>XAccessibleEditableText::deleteText</member> with the two
158        indices and afterwards calling
159        <member>XAccessibleEditableText::insertText</member> with the
160        replacement text and the start index.</p>
161
162        <p>The text indices are interpreted like those in the
163        <member>XAccessibleText::getTextRange</member> method. </p>
164
165        @param nStartIndex
166            Start index of the text to be replaced.
167            The valid range is 0..length.
168
169        @param nEndIndex
170            Start index of the text to be replaced.
171            The valid range is 0..length.
172
173        @param sReplacement
174            The Text that replaces the text between the given indices.
175
176        @return
177            Returns a flag that indicates whether the operation has been
178            executed successfully.
179
180        @throws ::com::sun::star::lang::IndexOutOfBoundsException
181            if the indices are invalid
182    */
183    boolean replaceText ([in] long nStartIndex, [in] long nEndIndex,
184        [in] string sReplacement)
185        raises (::com::sun::star::lang::IndexOutOfBoundsException);
186
187    /** Replaces the attributes of a text range by the given set of
188        attributes.
189
190        <p>Sets the attributes for the text between and including the two
191        given indices to those given.  The old attributes of this text
192        portion are replaced by the new list of attributes.</p>
193
194        <p>The text indices are interpreted like those in the
195        <member>XAccessibleText::getTextRange</member> method. </p>
196
197        @param nStartIndex
198            Start index of the text whose attributes are modified.
199            The valid range is 0..length.
200
201        @param nEndIndex
202            Start index of the text whose attributes are modified.
203            The valid range is 0..length.
204
205        @param aAttributeSet
206            Set of attributes that replaces the old list of attributes of
207            the specified text portion.
208
209        @return
210            Returns a flag that indicates whether the operation has been
211            executed successfully.
212
213        @throws ::com::sun::star::lang::IndexOutOfBoundsException
214            if the indices are invalid
215    */
216    boolean setAttributes ([in] long nStartIndex, [in] long nEndIndex,
217        [in] sequence<::com::sun::star::beans::PropertyValue> aAttributeSet)
218        raises (::com::sun::star::lang::IndexOutOfBoundsException);
219
220    /** Replaces the whole text with the given text.
221
222        <p>The text content of this object is set to the given string.</p>
223
224        @param sText
225            The new text that replaces the old text.
226
227        @return
228            Returns a flag that indicates whether the operation has been
229            executed successfully.
230    */
231    boolean setText ([in] string sText);
232};
233
234}; }; }; };
235
236#endif
237