1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_accessibility_XAccessibleText_idl__
25*b1cdbd2cSJim Jagielski#define __com_sun_star_accessibility_XAccessibleText_idl__
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_accessibility_AccessibleTextType_idl__
28*b1cdbd2cSJim Jagielski#include <com/sun/star/accessibility/AccessibleTextType.idl>
29*b1cdbd2cSJim Jagielski#endif
30*b1cdbd2cSJim Jagielski
31*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_uno_XInterface_idl__
32*b1cdbd2cSJim Jagielski#include <com/sun/star/uno/XInterface.idl>
33*b1cdbd2cSJim Jagielski#endif
34*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_Point_idl__
35*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/Point.idl>
36*b1cdbd2cSJim Jagielski#endif
37*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_Rectangle_idl__
38*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/Rectangle.idl>
39*b1cdbd2cSJim Jagielski#endif
40*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
41*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
42*b1cdbd2cSJim Jagielski#endif
43*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
44*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/IllegalArgumentException.idl>
45*b1cdbd2cSJim Jagielski#endif
46*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_beans_PropertyValue_idl__
47*b1cdbd2cSJim Jagielski#include <com/sun/star/beans/PropertyValue.idl>
48*b1cdbd2cSJim Jagielski#endif
49*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_accessibility_TextSegment_idl__
50*b1cdbd2cSJim Jagielski#include <com/sun/star/accessibility/TextSegment.idl>
51*b1cdbd2cSJim Jagielski#endif
52*b1cdbd2cSJim Jagielski
53*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module accessibility {
54*b1cdbd2cSJim Jagielski
55*b1cdbd2cSJim Jagielski/** Implement this interface to give read-only access to a text.
56*b1cdbd2cSJim Jagielski
57*b1cdbd2cSJim Jagielski    <p>The <type>XAccessibleText</type> interface should be implemented by
58*b1cdbd2cSJim Jagielski    all UNO components that present textual information on the display like
59*b1cdbd2cSJim Jagielski    buttons, text entry fields, or text portions of the document window.
60*b1cdbd2cSJim Jagielski    The interface provides access to the text's content, attributes, and
61*b1cdbd2cSJim Jagielski    spatial location.  However, text can not be modified with this
62*b1cdbd2cSJim Jagielski    interface.  That is the task of the <type>XAccessibleEditableText</type>
63*b1cdbd2cSJim Jagielski    interface.</p>
64*b1cdbd2cSJim Jagielski
65*b1cdbd2cSJim Jagielski    <p>The text length, i.e. the number of characters in the text, is
66*b1cdbd2cSJim Jagielski    returned by <member>XAccessibleText::getCharacterCount</member>.
67*b1cdbd2cSJim Jagielski    All methods that operate on particular characters (e.g.
68*b1cdbd2cSJim Jagielski    <member>XAccessibleText::getCharacterAt</member>) use character
69*b1cdbd2cSJim Jagielski    indices from 0 to length-1. All methods that operate on character
70*b1cdbd2cSJim Jagielski    positions (e.g. <member>XAccessibleText::getTextRange</member>)
71*b1cdbd2cSJim Jagielski    use indices from 0 to length.</p>
72*b1cdbd2cSJim Jagielski
73*b1cdbd2cSJim Jagielski    <p>Please note that accessible text does not necessarily support
74*b1cdbd2cSJim Jagielski    selection.  In this case it should behave as if there where no
75*b1cdbd2cSJim Jagielski    selection.  An empty selection is used for example to express the
76*b1cdbd2cSJim Jagielski    current cursor position.</p>
77*b1cdbd2cSJim Jagielski
78*b1cdbd2cSJim Jagielski    @since OpenOffice 1.1.2
79*b1cdbd2cSJim Jagielski*/
80*b1cdbd2cSJim Jagielskipublished interface XAccessibleText : ::com::sun::star::uno::XInterface
81*b1cdbd2cSJim Jagielski{
82*b1cdbd2cSJim Jagielski    /** Return the position of the caret.
83*b1cdbd2cSJim Jagielski
84*b1cdbd2cSJim Jagielski        <p>Returns the offset of the caret.  The caret is often called text
85*b1cdbd2cSJim Jagielski        cursor.  The caret is actually the position between two characters.
86*b1cdbd2cSJim Jagielski        Its position/offset is that of the character to the right of it.</p>
87*b1cdbd2cSJim Jagielski
88*b1cdbd2cSJim Jagielski        @return
89*b1cdbd2cSJim Jagielski            The returned offset is relative to the text represented by this
90*b1cdbd2cSJim Jagielski            object.
91*b1cdbd2cSJim Jagielski    */
92*b1cdbd2cSJim Jagielski    long getCaretPosition ();
93*b1cdbd2cSJim Jagielski
94*b1cdbd2cSJim Jagielski    /** Set the position of the caret.
95*b1cdbd2cSJim Jagielski
96*b1cdbd2cSJim Jagielski        <p>The caret is often called text cursor.  The caret is actually the
97*b1cdbd2cSJim Jagielski        position between two characters.  Its position/offset is that of the
98*b1cdbd2cSJim Jagielski        character to the right of it.</p>
99*b1cdbd2cSJim Jagielski
100*b1cdbd2cSJim Jagielski        <p>Setting the caret position may or may not alter the current
101*b1cdbd2cSJim Jagielski        selection.  A change of the selection is notified to the
102*b1cdbd2cSJim Jagielski        accessibility event listeners with an
103*b1cdbd2cSJim Jagielski        <const>AccessibleEventId::ACCESSIBLE_SELECTION_EVENT</const>.</p>
104*b1cdbd2cSJim Jagielski
105*b1cdbd2cSJim Jagielski        <p>When the new caret position differs from the old one (which, of
106*b1cdbd2cSJim Jagielski        course, is the standard case) this is notified to the accessibility
107*b1cdbd2cSJim Jagielski        event listeners with an
108*b1cdbd2cSJim Jagielski        <const>AccessibleEventId::ACCESSIBLE_CARET_EVENT</const>.</p>
109*b1cdbd2cSJim Jagielski
110*b1cdbd2cSJim Jagielski        @param nIndex
111*b1cdbd2cSJim Jagielski            The new index of the caret.  This caret is actually placed to
112*b1cdbd2cSJim Jagielski            the left side of the character with that index.  An index of 0
113*b1cdbd2cSJim Jagielski            places the caret so that the next insertion goes before the
114*b1cdbd2cSJim Jagielski            first character.  An index of <member>getCharacterCount</member>
115*b1cdbd2cSJim Jagielski            leads to insertion after the last character.
116*b1cdbd2cSJim Jagielski
117*b1cdbd2cSJim Jagielski        @return
118*b1cdbd2cSJim Jagielski            Returns <TRUE/> if the caret has been moved and <FALSE/>
119*b1cdbd2cSJim Jagielski            otherwise.  A <TRUE/> value does not necessarily mean that the
120*b1cdbd2cSJim Jagielski            caret has been positioned exactly at the required position.
121*b1cdbd2cSJim Jagielski            If that position lies inside a read-only area the caret is
122*b1cdbd2cSJim Jagielski            positioned before or behind it.  Listen to the caret event to
123*b1cdbd2cSJim Jagielski            determine the new position.
124*b1cdbd2cSJim Jagielski
125*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
126*b1cdbd2cSJim Jagielski            if the index is not valid.
127*b1cdbd2cSJim Jagielski    */
128*b1cdbd2cSJim Jagielski    boolean setCaretPosition ([in] long nIndex)
129*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
130*b1cdbd2cSJim Jagielski
131*b1cdbd2cSJim Jagielski    /** Return the character at the specified position.
132*b1cdbd2cSJim Jagielski
133*b1cdbd2cSJim Jagielski        <p>Returns the character at the given index.</p>
134*b1cdbd2cSJim Jagielski
135*b1cdbd2cSJim Jagielski        @param nIndex
136*b1cdbd2cSJim Jagielski            The index of the character to return.
137*b1cdbd2cSJim Jagielski            The valid range is 0..length-1.
138*b1cdbd2cSJim Jagielski
139*b1cdbd2cSJim Jagielski        @return
140*b1cdbd2cSJim Jagielski            the character at the index nIndex.
141*b1cdbd2cSJim Jagielski
142*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
143*b1cdbd2cSJim Jagielski            if the index is invalid
144*b1cdbd2cSJim Jagielski    */
145*b1cdbd2cSJim Jagielski    char getCharacter ([in] long nIndex)
146*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
147*b1cdbd2cSJim Jagielski
148*b1cdbd2cSJim Jagielski    /** Get the attribute set for the specified position.
149*b1cdbd2cSJim Jagielski
150*b1cdbd2cSJim Jagielski        <p>Returns a set of attributes that are associated for the character
151*b1cdbd2cSJim Jagielski        at the given index.  To prevent the method from returning possibly
152*b1cdbd2cSJim Jagielski        large sets of attributes that the caller is not interested in the
153*b1cdbd2cSJim Jagielski        caller has to provide a list of attributes that he wants to be
154*b1cdbd2cSJim Jagielski        returned.</p>
155*b1cdbd2cSJim Jagielski
156*b1cdbd2cSJim Jagielski        @param nIndex
157*b1cdbd2cSJim Jagielski            The index of the character for which to return its attributes.
158*b1cdbd2cSJim Jagielski            The valid range is 0..length-1.
159*b1cdbd2cSJim Jagielski
160*b1cdbd2cSJim Jagielski        @param aRequestedAttributes
161*b1cdbd2cSJim Jagielski            This string sequence defines the set of attributes that the
162*b1cdbd2cSJim Jagielski            caller is interested in.  When there are attributes defined that
163*b1cdbd2cSJim Jagielski            are not listed in the sequence then they are not returned.  When
164*b1cdbd2cSJim Jagielski            there are requested attributes that are not defined for the
165*b1cdbd2cSJim Jagielski            character then they are ignored, too.
166*b1cdbd2cSJim Jagielski
167*b1cdbd2cSJim Jagielski            <p>An empty sequence signals the callers interest in all the
168*b1cdbd2cSJim Jagielski            attributes.  This is usefull in two cases: a) Simply as a way to
169*b1cdbd2cSJim Jagielski            avoid passing a potentially large array to the called object or
170*b1cdbd2cSJim Jagielski            b) when the caller does not know what attributes the called
171*b1cdbd2cSJim Jagielski            objects supports but is interested in all of them
172*b1cdbd2cSJim Jagielski            nevertheless.</p>
173*b1cdbd2cSJim Jagielski
174*b1cdbd2cSJim Jagielski        @return
175*b1cdbd2cSJim Jagielski            Returns the explicitly or implicitly (empty
176*b1cdbd2cSJim Jagielski            <arg>aRequestedAttributes</arg> argument) requested attributes
177*b1cdbd2cSJim Jagielski            of the specified character.  Each attribute is represented by a
178*b1cdbd2cSJim Jagielski            <type scope="::com::sun::star::beans">PropertyValue</type>
179*b1cdbd2cSJim Jagielski            object.  The returned list of attribute descriptions contains
180*b1cdbd2cSJim Jagielski            all attributes that are both members of the sequence of
181*b1cdbd2cSJim Jagielski            requested attributes and are defined for the character at the
182*b1cdbd2cSJim Jagielski            specified index.
183*b1cdbd2cSJim Jagielski
184*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
185*b1cdbd2cSJim Jagielski            if the index is invalid
186*b1cdbd2cSJim Jagielski    */
187*b1cdbd2cSJim Jagielski    sequence<::com::sun::star::beans::PropertyValue>
188*b1cdbd2cSJim Jagielski        getCharacterAttributes (
189*b1cdbd2cSJim Jagielski            [in] long nIndex,
190*b1cdbd2cSJim Jagielski            [in] sequence<string> aRequestedAttributes)
191*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
192*b1cdbd2cSJim Jagielski
193*b1cdbd2cSJim Jagielski
194*b1cdbd2cSJim Jagielski    /** Return the bounding box of the specified position.
195*b1cdbd2cSJim Jagielski
196*b1cdbd2cSJim Jagielski        <p>Returns the bounding box of the indexed character.</p>
197*b1cdbd2cSJim Jagielski
198*b1cdbd2cSJim Jagielski        <p>The virtual character after the last character of the represented
199*b1cdbd2cSJim Jagielski        text, i.e. the one at position length is a special case. It
200*b1cdbd2cSJim Jagielski        represents the current input position and will therefore typically
201*b1cdbd2cSJim Jagielski        be queried by AT more often than other positions.  Because it does
202*b1cdbd2cSJim Jagielski        not represent an existing character its bounding box is defined in
203*b1cdbd2cSJim Jagielski        relation to preceding characters.  It should be rougly equivalent to
204*b1cdbd2cSJim Jagielski        the bounding box of some character when inserted at the end of the
205*b1cdbd2cSJim Jagielski        text.  Its height typically being the maximal height of all the
206*b1cdbd2cSJim Jagielski        characters in the text or the height of the preceding character, its
207*b1cdbd2cSJim Jagielski        width being at least one pixel so that the bounding box is not
208*b1cdbd2cSJim Jagielski        degenerate.<br>
209*b1cdbd2cSJim Jagielski        Note that the index 'length' is not always valid.  Whether it is
210*b1cdbd2cSJim Jagielski        or not is implementation dependent.  It typically is when text is
211*b1cdbd2cSJim Jagielski        editable or otherwise when on the screen the caret can be placed
212*b1cdbd2cSJim Jagielski        behind the text.  You can be sure that the index is valid after you
213*b1cdbd2cSJim Jagielski        have received a <const scope="AccessibleEventId">CARET</const> event
214*b1cdbd2cSJim Jagielski        for this index.</p>
215*b1cdbd2cSJim Jagielski        @param nIndex
216*b1cdbd2cSJim Jagielski            Index of the character for which to return its bounding box.
217*b1cdbd2cSJim Jagielski            The valid range is 0..length.
218*b1cdbd2cSJim Jagielski
219*b1cdbd2cSJim Jagielski        @return
220*b1cdbd2cSJim Jagielski            The bounding box of the referenced character.  The bounding box
221*b1cdbd2cSJim Jagielski            of the virtual character at position length has to have
222*b1cdbd2cSJim Jagielski            non-empty dimensions.
223*b1cdbd2cSJim Jagielski
224*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
225*b1cdbd2cSJim Jagielski            if the index is invalid
226*b1cdbd2cSJim Jagielski    */
227*b1cdbd2cSJim Jagielski    ::com::sun::star::awt::Rectangle getCharacterBounds ([in] long nIndex)
228*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
229*b1cdbd2cSJim Jagielski
230*b1cdbd2cSJim Jagielski
231*b1cdbd2cSJim Jagielski    /** Return the number of characters in the represented text.
232*b1cdbd2cSJim Jagielski
233*b1cdbd2cSJim Jagielski        <p>Returns the number of characters in the text represented by this
234*b1cdbd2cSJim Jagielski        object or, in other words, the text length.</p>
235*b1cdbd2cSJim Jagielski
236*b1cdbd2cSJim Jagielski        @return
237*b1cdbd2cSJim Jagielski            Returns the number of characters of this object's text.  A zero
238*b1cdbd2cSJim Jagielski            value indicates an empty text.
239*b1cdbd2cSJim Jagielski    */
240*b1cdbd2cSJim Jagielski    long getCharacterCount ();
241*b1cdbd2cSJim Jagielski
242*b1cdbd2cSJim Jagielski
243*b1cdbd2cSJim Jagielski    /** Return the text position for the specified screen position.
244*b1cdbd2cSJim Jagielski
245*b1cdbd2cSJim Jagielski        <p>Given a point in local coordinates, i.e. relative to the
246*b1cdbd2cSJim Jagielski        coordinate system of the object, return the zero-based index of
247*b1cdbd2cSJim Jagielski        the character under that point.  The same functionality could be
248*b1cdbd2cSJim Jagielski        achieved by using the bounding boxes for each character as returned
249*b1cdbd2cSJim Jagielski        by <member>XAccessibleText::getCharacterBounds</member>. The method
250*b1cdbd2cSJim Jagielski        <member>XAccessibleText::getIndexAtPoint</member>, however, can be
251*b1cdbd2cSJim Jagielski        implemented in a more efficient way.</p>
252*b1cdbd2cSJim Jagielski
253*b1cdbd2cSJim Jagielski        @param aPoint
254*b1cdbd2cSJim Jagielski            The position for which to look up the index of the character
255*b1cdbd2cSJim Jagielski            that is rendered on to the display at that point.
256*b1cdbd2cSJim Jagielski
257*b1cdbd2cSJim Jagielski        @return
258*b1cdbd2cSJim Jagielski            Index of the character under the given point or -1 if the point
259*b1cdbd2cSJim Jagielski            is invalid or there is no character under the point.
260*b1cdbd2cSJim Jagielski    */
261*b1cdbd2cSJim Jagielski    long getIndexAtPoint ([in] ::com::sun::star::awt::Point aPoint);
262*b1cdbd2cSJim Jagielski
263*b1cdbd2cSJim Jagielski    /** Return the selected text.
264*b1cdbd2cSJim Jagielski
265*b1cdbd2cSJim Jagielski        <p>Returns the portion of the text that is selected.</p>
266*b1cdbd2cSJim Jagielski
267*b1cdbd2cSJim Jagielski        @return
268*b1cdbd2cSJim Jagielski            The returned text is the selected portion of the object's text.
269*b1cdbd2cSJim Jagielski            If no text is selected when this method is called or when
270*b1cdbd2cSJim Jagielski            selection is not supported an empty string is returned.
271*b1cdbd2cSJim Jagielski    */
272*b1cdbd2cSJim Jagielski    string getSelectedText ();
273*b1cdbd2cSJim Jagielski
274*b1cdbd2cSJim Jagielski    /** Return the position of the start of the selection.
275*b1cdbd2cSJim Jagielski
276*b1cdbd2cSJim Jagielski        <p>Returns the index of the start of the selected text.</p>
277*b1cdbd2cSJim Jagielski
278*b1cdbd2cSJim Jagielski        @return
279*b1cdbd2cSJim Jagielski            If there is no selection or selection is not supported the
280*b1cdbd2cSJim Jagielski            position of selection start and end will be the same undefined
281*b1cdbd2cSJim Jagielski            value.
282*b1cdbd2cSJim Jagielski    */
283*b1cdbd2cSJim Jagielski    long getSelectionStart ();
284*b1cdbd2cSJim Jagielski
285*b1cdbd2cSJim Jagielski    /** Return the position of the end of the selection.
286*b1cdbd2cSJim Jagielski
287*b1cdbd2cSJim Jagielski        <p>Returns the index of the end of the selected text.</p>
288*b1cdbd2cSJim Jagielski
289*b1cdbd2cSJim Jagielski        @return
290*b1cdbd2cSJim Jagielski            If there is no selection or selection is not supported the
291*b1cdbd2cSJim Jagielski            position of selection start and end will be the same undefined
292*b1cdbd2cSJim Jagielski            value.
293*b1cdbd2cSJim Jagielski    */
294*b1cdbd2cSJim Jagielski    long getSelectionEnd ();
295*b1cdbd2cSJim Jagielski
296*b1cdbd2cSJim Jagielski    /** Set a new selection.
297*b1cdbd2cSJim Jagielski
298*b1cdbd2cSJim Jagielski        <p>Sets the selected text portion according to the given indices.
299*b1cdbd2cSJim Jagielski        The old selection is replaced by the new selection.</p>
300*b1cdbd2cSJim Jagielski
301*b1cdbd2cSJim Jagielski        <p>The selection encompasses the same string of text that
302*b1cdbd2cSJim Jagielski        <member>XAccessibleText::getTextRange</member> would have
303*b1cdbd2cSJim Jagielski        selected. See there for details.</p>
304*b1cdbd2cSJim Jagielski
305*b1cdbd2cSJim Jagielski        <p>Setting the selection may or may not change the caret position.
306*b1cdbd2cSJim Jagielski        Typically the caret is moved to the position after the second
307*b1cdbd2cSJim Jagielski        argument.  When the caret is moved this is notified to the
308*b1cdbd2cSJim Jagielski        accessibility event listeners with an
309*b1cdbd2cSJim Jagielski        <const>AccessibleEventId::ACCESSIBLE_CARET_EVENT</const>.</p>
310*b1cdbd2cSJim Jagielski
311*b1cdbd2cSJim Jagielski        @param nStartIndex
312*b1cdbd2cSJim Jagielski            The first character of the new selection.
313*b1cdbd2cSJim Jagielski            The valid range is 0..length.
314*b1cdbd2cSJim Jagielski
315*b1cdbd2cSJim Jagielski        @parm nEndIndex
316*b1cdbd2cSJim Jagielski            The position after the last character of the new selection.
317*b1cdbd2cSJim Jagielski            The valid range is 0..length.
318*b1cdbd2cSJim Jagielski
319*b1cdbd2cSJim Jagielski        @return
320*b1cdbd2cSJim Jagielski            Returns <TRUE/> if the selection has been set successfully and
321*b1cdbd2cSJim Jagielski            <FALSE/> otherwise or when selection is not supported.
322*b1cdbd2cSJim Jagielski
323*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
324*b1cdbd2cSJim Jagielski            if the indices are invalid
325*b1cdbd2cSJim Jagielski    */
326*b1cdbd2cSJim Jagielski    boolean setSelection ([in] long nStartIndex, [in] long nEndIndex)
327*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
328*b1cdbd2cSJim Jagielski
329*b1cdbd2cSJim Jagielski    /** Return the whole text.
330*b1cdbd2cSJim Jagielski
331*b1cdbd2cSJim Jagielski        <p>Returns the complete text.  This is equivalent to a call to
332*b1cdbd2cSJim Jagielski        <member>XAccessibleText::getTextRange</member> with the arguments
333*b1cdbd2cSJim Jagielski        zero and <code>getCharacterCount()-1</code>.</p>
334*b1cdbd2cSJim Jagielski
335*b1cdbd2cSJim Jagielski        @return
336*b1cdbd2cSJim Jagielski            Returns a string that contains the complete text.
337*b1cdbd2cSJim Jagielski    */
338*b1cdbd2cSJim Jagielski    string getText ();
339*b1cdbd2cSJim Jagielski
340*b1cdbd2cSJim Jagielski    /** Return the specified text range.
341*b1cdbd2cSJim Jagielski
342*b1cdbd2cSJim Jagielski        <p>Returns the substring between the two given indices.</p>
343*b1cdbd2cSJim Jagielski
344*b1cdbd2cSJim Jagielski        <p>The substring starts with the character at nStartIndex
345*b1cdbd2cSJim Jagielski        (inclusive) and up to the character at nEndIndex (exclusive),
346*b1cdbd2cSJim Jagielski        if nStartIndex is less or equal nEndIndex.  If nEndIndex is
347*b1cdbd2cSJim Jagielski        lower than nStartIndex, the result is the same as a call with
348*b1cdbd2cSJim Jagielski        the two arguments being exchanged.</p>
349*b1cdbd2cSJim Jagielski
350*b1cdbd2cSJim Jagielski        <p>The whole text can be requested by passing the indices zero and
351*b1cdbd2cSJim Jagielski        <code>getCharacterCount()</code>.  If both indices have the same
352*b1cdbd2cSJim Jagielski        value, an empty string is returned.</p>
353*b1cdbd2cSJim Jagielski
354*b1cdbd2cSJim Jagielski        @param nStartIndex
355*b1cdbd2cSJim Jagielski            Index of the first character to include in the returned string.
356*b1cdbd2cSJim Jagielski            The valid range is 0..length.
357*b1cdbd2cSJim Jagielski
358*b1cdbd2cSJim Jagielski        @param nEndIndex
359*b1cdbd2cSJim Jagielski            Index of the last character to exclude in the returned string.
360*b1cdbd2cSJim Jagielski            The valid range is 0..length.
361*b1cdbd2cSJim Jagielski
362*b1cdbd2cSJim Jagielski        @return
363*b1cdbd2cSJim Jagielski            Returns the substring starting with the character at nStartIndex
364*b1cdbd2cSJim Jagielski            (inclusive) and up to the character at nEndIndex (exclusive), if
365*b1cdbd2cSJim Jagielski            nStartIndex is less than or equal to nEndIndex.
366*b1cdbd2cSJim Jagielski
367*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
368*b1cdbd2cSJim Jagielski            if the indices are invalid
369*b1cdbd2cSJim Jagielski    */
370*b1cdbd2cSJim Jagielski    string getTextRange ([in] long nStartIndex, [in] long nEndIndex)
371*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
372*b1cdbd2cSJim Jagielski
373*b1cdbd2cSJim Jagielski    /** Get a text portion around the given position.
374*b1cdbd2cSJim Jagielski
375*b1cdbd2cSJim Jagielski        <p>Returns the substring of the specified text type that contains
376*b1cdbd2cSJim Jagielski        the character at the given index, if any.  For example, given the
377*b1cdbd2cSJim Jagielski        text type <const scope="AccessibleTextType">WORD</type>, the word
378*b1cdbd2cSJim Jagielski        which contains the character at position nIndex is returned, or an
379*b1cdbd2cSJim Jagielski        empty string if no word is found at the that position.</p>
380*b1cdbd2cSJim Jagielski
381*b1cdbd2cSJim Jagielski        @param nIndex
382*b1cdbd2cSJim Jagielski            Index of the character whose containing text portion is to be
383*b1cdbd2cSJim Jagielski            returned.
384*b1cdbd2cSJim Jagielski            The valid range is 0..length.
385*b1cdbd2cSJim Jagielski
386*b1cdbd2cSJim Jagielski        @param nTextType
387*b1cdbd2cSJim Jagielski            The type of the text portion to return.  See
388*b1cdbd2cSJim Jagielski            <type>AccessibleTextType</type> for the complete list.
389*b1cdbd2cSJim Jagielski
390*b1cdbd2cSJim Jagielski        @return
391*b1cdbd2cSJim Jagielski            Returns the requested text portion.  This portion may be empty
392*b1cdbd2cSJim Jagielski            or invalid when no appropriate text portion is found or text
393*b1cdbd2cSJim Jagielski            type is invalid.
394*b1cdbd2cSJim Jagielski
395*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
396*b1cdbd2cSJim Jagielski            if the index is invalid
397*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::InvalidArgumentException
398*b1cdbd2cSJim Jagielski            if the given text type is not valid.
399*b1cdbd2cSJim Jagielski    */
400*b1cdbd2cSJim Jagielski    TextSegment getTextAtIndex([in] long nIndex, [in] short nTextType)
401*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException,
402*b1cdbd2cSJim Jagielski            ::com::sun::star::lang::IllegalArgumentException);
403*b1cdbd2cSJim Jagielski
404*b1cdbd2cSJim Jagielski    /** Get a text portion before the given position.
405*b1cdbd2cSJim Jagielski
406*b1cdbd2cSJim Jagielski        <p>Returns the substring of the specified text type that is
407*b1cdbd2cSJim Jagielski        located before the given character and does not include
408*b1cdbd2cSJim Jagielski        it. The result of this method should be same as a result for
409*b1cdbd2cSJim Jagielski        <member>XAccessibleText::getTextAtIndex</member> with a
410*b1cdbd2cSJim Jagielski        suitably decreased index value.</p>
411*b1cdbd2cSJim Jagielski
412*b1cdbd2cSJim Jagielski        <p>For example, if text type is <const
413*b1cdbd2cSJim Jagielski        scope="AccessibleTextType">WORD</type>, then the complete word
414*b1cdbd2cSJim Jagielski        that is closest to and located before nIndex is returned.</p>
415*b1cdbd2cSJim Jagielski
416*b1cdbd2cSJim Jagielski        <p>If the index is valid, but no suitable word (or other text
417*b1cdbd2cSJim Jagielski        type) is found, an empty text segment is returned.</p>
418*b1cdbd2cSJim Jagielski
419*b1cdbd2cSJim Jagielski        @param nIndex
420*b1cdbd2cSJim Jagielski            Index of the character for which to return the text part before
421*b1cdbd2cSJim Jagielski            it.  The index character will not be part of the returned
422*b1cdbd2cSJim Jagielski            string.
423*b1cdbd2cSJim Jagielski            The valid range is 0..length.
424*b1cdbd2cSJim Jagielski
425*b1cdbd2cSJim Jagielski        @param nTextType
426*b1cdbd2cSJim Jagielski            The type of the text portion to return.  See
427*b1cdbd2cSJim Jagielski            <type>AccessibleTextType</type> for the complete list.
428*b1cdbd2cSJim Jagielski
429*b1cdbd2cSJim Jagielski        @return
430*b1cdbd2cSJim Jagielski            Returns the requested text portion.  This portion may be empty
431*b1cdbd2cSJim Jagielski            or invalid when no appropriate text portion is found or text
432*b1cdbd2cSJim Jagielski            type is invalid.
433*b1cdbd2cSJim Jagielski
434*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
435*b1cdbd2cSJim Jagielski            if the index is invalid.
436*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::InvalidArgumentException
437*b1cdbd2cSJim Jagielski            if the given text type is not valid.
438*b1cdbd2cSJim Jagielski    */
439*b1cdbd2cSJim Jagielski    TextSegment getTextBeforeIndex([in] long nIndex, [in] short nTextType)
440*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException,
441*b1cdbd2cSJim Jagielski            ::com::sun::star::lang::IllegalArgumentException);
442*b1cdbd2cSJim Jagielski
443*b1cdbd2cSJim Jagielski    /** Get a text portion behind the given position.
444*b1cdbd2cSJim Jagielski
445*b1cdbd2cSJim Jagielski        <p>Returns the substring of the specified text type that is
446*b1cdbd2cSJim Jagielski        located after the given character and does not include
447*b1cdbd2cSJim Jagielski        it. The result of this method should be same as a result for
448*b1cdbd2cSJim Jagielski        <member>XAccessibleText::getTextAtIndex</member> with a
449*b1cdbd2cSJim Jagielski        suitably increased index value.</p>
450*b1cdbd2cSJim Jagielski
451*b1cdbd2cSJim Jagielski        <p>For example, if text type is <const
452*b1cdbd2cSJim Jagielski        scope="AccessibleTextType">WORD</type>, then the complete word
453*b1cdbd2cSJim Jagielski        that is closest to and located behind nIndex is returned.</p>
454*b1cdbd2cSJim Jagielski
455*b1cdbd2cSJim Jagielski        <p>If the index is valid, but no suitable word (or other text
456*b1cdbd2cSJim Jagielski        type) is found, an empty string is returned.</p>
457*b1cdbd2cSJim Jagielski
458*b1cdbd2cSJim Jagielski        @param nIndex
459*b1cdbd2cSJim Jagielski            Index of the character for which to return the text part after
460*b1cdbd2cSJim Jagielski            it.  The index character will be part of the returned string.
461*b1cdbd2cSJim Jagielski            The valid range is 0..length.
462*b1cdbd2cSJim Jagielski
463*b1cdbd2cSJim Jagielski        @param nTextType
464*b1cdbd2cSJim Jagielski            The type of the text portion to return.  See
465*b1cdbd2cSJim Jagielski            <type>AccessibleTextType</type> for the complete list.
466*b1cdbd2cSJim Jagielski
467*b1cdbd2cSJim Jagielski        @return
468*b1cdbd2cSJim Jagielski            Returns the requested text portion.  This portion may be empty
469*b1cdbd2cSJim Jagielski            or invalid when no appropriate text portion is found or text
470*b1cdbd2cSJim Jagielski            type is invalid.
471*b1cdbd2cSJim Jagielski
472*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
473*b1cdbd2cSJim Jagielski            if the index is invalid
474*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::InvalidArgumentException
475*b1cdbd2cSJim Jagielski            if the given text type is not valid.
476*b1cdbd2cSJim Jagielski    */
477*b1cdbd2cSJim Jagielski    TextSegment getTextBehindIndex([in] long nIndex, [in] short nTextType)
478*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException,
479*b1cdbd2cSJim Jagielski            ::com::sun::star::lang::IllegalArgumentException);
480*b1cdbd2cSJim Jagielski
481*b1cdbd2cSJim Jagielski    /** Copy the specified text into the clipboard.
482*b1cdbd2cSJim Jagielski
483*b1cdbd2cSJim Jagielski        <p>Copy the specified text into the clipboard.  The text that is
484*b1cdbd2cSJim Jagielski        copied is the same text that would have been selected by the
485*b1cdbd2cSJim Jagielski        <member>XAccessibleText::getTextRange</member> method. </p>
486*b1cdbd2cSJim Jagielski
487*b1cdbd2cSJim Jagielski        <p>The other clipboard related methods
488*b1cdbd2cSJim Jagielski        <member>XAccessibleEditableText::cutText</member> and
489*b1cdbd2cSJim Jagielski        <member>XAccessibleEditableText::deleteText</member> can be found in
490*b1cdbd2cSJim Jagielski        the <type>XAccessibleEditableText</type> because of their
491*b1cdbd2cSJim Jagielski        destructive nature.</p>
492*b1cdbd2cSJim Jagielski
493*b1cdbd2cSJim Jagielski        @param nStartIndex
494*b1cdbd2cSJim Jagielski            Start index of the text to copied into the clipboard.
495*b1cdbd2cSJim Jagielski            The valid range is 0..length.
496*b1cdbd2cSJim Jagielski
497*b1cdbd2cSJim Jagielski        @param nEndIndex
498*b1cdbd2cSJim Jagielski            End index of the text to copied into the clipboard.
499*b1cdbd2cSJim Jagielski            The valid range is 0..length.
500*b1cdbd2cSJim Jagielski
501*b1cdbd2cSJim Jagielski        @return
502*b1cdbd2cSJim Jagielski            Returns <true/> if the specified text has been copied
503*b1cdbd2cSJim Jagielski            successfully into the clipboard.
504*b1cdbd2cSJim Jagielski
505*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IndexOutOfBoundsException
506*b1cdbd2cSJim Jagielski            if the indices are invalid
507*b1cdbd2cSJim Jagielski    */
508*b1cdbd2cSJim Jagielski    boolean copyText ([in] long nStartIndex, [in] long nEndIndex)
509*b1cdbd2cSJim Jagielski        raises (::com::sun::star::lang::IndexOutOfBoundsException);
510*b1cdbd2cSJim Jagielski
511*b1cdbd2cSJim Jagielski};
512*b1cdbd2cSJim Jagielski
513*b1cdbd2cSJim Jagielski}; }; }; };
514*b1cdbd2cSJim Jagielski
515*b1cdbd2cSJim Jagielski#endif
516