]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/accessibility/AccessibleTextExtendedListener.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / accessibility / AccessibleTextExtendedListener.java
1 /*******************************************************************************
2  * Copyright (c) 2009, 2010 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.accessibility;
15
16 /**
17  * Classes which implement this interface provide methods
18  * that handle AccessibleTextExtended events.
19  * <p>
20  * After creating an instance of a class that implements
21  * this interface it can be added to an accessible using the
22  * <code>addAccessibleTextListener</code> method and removed using
23  * the <code>removeAccessibleTextListener</code> method.
24  * </p>
25  *
26  * @see AccessibleTextExtendedAdapter
27  * @see AccessibleTextEvent
28  *
29  * @since 3.6
30  */
31 public interface AccessibleTextExtendedListener extends AccessibleTextListener {
32         /**
33          * Adds a text selection.
34          *
35          * @param e an event object containing the following fields:<ul>
36          * <li>[in] start - the 0 based offset of the first character of the new selection</li>
37          * <li>[in] end - the 0 based offset after the last character of the new selection</li>
38          * <li>[out] result - set to {@link ACC#OK} if the text selection was added</li>
39          * </ul>
40          */
41         public void addSelection(AccessibleTextEvent e);
42
43         /**
44          * Returns the total number of characters in the text.
45          *
46          * @param e an event object containing the following fields:<ul>
47          * <li>[out] count - the total number of characters</li>
48          * </ul>
49          */
50         public void getCharacterCount(AccessibleTextEvent e);
51
52         /**
53          * Returns the number of links and link groups contained within this hypertext
54          * paragraph.
55          *
56          * @param e an event object containing the following fields:<ul>
57          * <li>[out] count - the number of links and link groups within this hypertext paragraph,
58          *              or 0 if there are none</li>
59          * </ul>
60          */
61         public void getHyperlinkCount(AccessibleTextEvent e);
62
63         /**
64          * Returns the specified hyperlink.
65          *
66          * @param e an event object containing the following fields:<ul>
67          * <li>[in] index - the 0 based index of the hyperlink to return</li>
68          * <li>[out] accessible - the specified hyperlink object, or null if the index is invalid</li>
69          * </ul>
70          */
71         public void getHyperlink(AccessibleTextEvent e);
72
73         /**
74          * Returns the index of the hyperlink that is associated with this character offset.
75          * <p>
76          * This is the case when a link spans the given character index.
77          * </p>
78          * @param e an event object containing the following fields:<ul>
79          * <li>[in] offset - the 0 based offset of the character for which to return the link index</li>
80          * <li>[out] index - the 0 based index of the hyperlink that is associated with this
81          *              character offset, or -1 if the offset is not in a link</li>
82          * </ul>
83          */
84         public void getHyperlinkIndex(AccessibleTextEvent e);
85
86         /**
87          * Returns the offset of the character under the specified point.
88          *
89          * @param e an event object containing the following fields:<ul>
90          * <li>[in] x - the X value in display coordinates for which to look up the offset of the character
91          *              that is rendered on the display at that point</li>
92          * <li>[in] y - the position's Y value for which to look up the offset of the character
93          *              that is rendered on the display at that point</li>
94          * <li>[out] offset - the 0 based offset of the character under the given point,
95          *              or -1 if the point is invalid or there is no character under the point</li>
96          * </ul>
97          */
98         public void getOffsetAtPoint(AccessibleTextEvent e);
99
100         /**
101          * Returns the text range(s) contained within the given bounding box.
102          * <p>
103          * Partially visible characters are included in the returned ranges.
104          * </p>
105          *
106          * @param e an event object containing the following fields:<ul>
107          * <li>[in] x - the X coordinate of the top left corner of the bounding box, in display relative coordinates</li>
108          * <li>[in] y - the Y coordinate of the top left corner of the bounding box, in display relative coordinates</li>
109          * <li>[in] width - the width of the bounding box</li>
110          * <li>[in] height - the height of the bounding box</li>
111          * <li>[typical out] start - the 0 based offset of the first character of the substring in the bounding box</li>
112          * <li>[typical out] end - the 0 based offset after the last character of the substring in the bounding box</li>
113          * <li>[optional out] ranges - an array of pairs specifying the start and end offsets of each range,
114          *              if the text range is clipped by the bounding box</li>
115          * </ul>
116          */
117         public void getRanges(AccessibleTextEvent e);
118
119         /**
120          * Returns the character offsets of the specified text selection.
121          *
122          * @param e an event object containing the following fields:<ul>
123          * <li>[in] index - the 0 based index of the selection</li>
124          * <li>[out] start - the 0 based offset of first selected character</li>
125          * <li>[out] end - the 0 based offset after the last selected character</li>
126          * </ul>
127          */
128         public void getSelection(AccessibleTextEvent e);
129
130         /**
131          * Returns the number of active non-contiguous selections.
132          *
133          * @param e an event object containing the following fields:<ul>
134          * <li>[out] count - the number of active non-contiguous selections</li>
135          * </ul>
136          */
137         public void getSelectionCount(AccessibleTextEvent e);
138
139         /**
140          * Returns a substring and its range for the given range, count and boundary type.
141          * <p>
142          * Returns the substring of the specified boundary type that is located count
143          * positions from the given character range. Also returns the start and end
144          * offsets of the returned substring.
145          * </p><p>
146          * For example, if the boundary type is TEXT_BOUNDARY_WORD, then the complete
147          * word that is located count words from the specified range is returned.
148          * If count is negative, then return the word that is count words before start.
149          * If count is positive, then return the word that is count words after end.
150          * If count is zero, start and end are the same, so return the word at start.
151          * </p><p>
152          * The whole text can be requested by passing start == 0 and end == getCharacterCount,
153          * TEXT_BOUNDARY_ALL, and 0 for count. Alternatively the whole text can be requested
154          * by calling AccessibleControlListener.getValue().
155          * </p><p>
156          * If start and end are valid, but no suitable word (or other boundary type) is found,
157          * the returned string is null and the returned range is degenerate (start == end).
158          * </p>
159          *
160          * @param e an event object containing the following fields:<ul>
161          * <li>[in] type - the boundary type of the substring to return. One of:<ul>
162          *              <li> {@link ACC#TEXT_BOUNDARY_CHAR}</li>
163          *              <li> {@link ACC#TEXT_BOUNDARY_WORD}</li>
164          *              <li> {@link ACC#TEXT_BOUNDARY_SENTENCE}</li>
165          *              <li> {@link ACC#TEXT_BOUNDARY_PARAGRAPH}</li>
166          *              <li> {@link ACC#TEXT_BOUNDARY_LINE}</li>
167          *              <li> {@link ACC#TEXT_BOUNDARY_ALL}</li>
168          *              </ul></li>
169          * <li>[in,out] start - the 0 based offset of first character of the substring</li>
170          * <li>[in,out] end - the 0 based offset after the last character of the substring</li>
171          * <li>[in,out] count - the number of boundary type units to move to find the substring:<ul>
172          *              <li>in - look count units before start if count &lt; 0, or after end if count &gt; 0. Look at start if count == 0</li>
173          *              <li>out - the actual number of boundary type units that were moved. This may be fewer than the input count</li>
174          *              </ul></li>
175          * <li>[out] result - the requested substring.  This may be empty or null
176          *              when no appropriate substring is found, or if the type is invalid.</li>
177          * </ul>
178          */
179         public void getText(AccessibleTextEvent e);
180
181         /**
182          * Returns the bounding box(es) of the specified text range in display coordinates.
183          * <p>
184          * Typically, the text range will represent a single character, i.e. end - start = 1,
185          * therefore providers should optimize for this case.
186          * </p><p>
187          * Note: The virtual character after the last character of the represented text,
188          * i.e. the one at offset getCharacterCount, is a special case. It represents the
189          * current input position and will therefore typically be queried by AT more
190          * often than other positions.  Because it does not represent an existing character
191          * its bounding box is defined in relation to preceding characters.  It should be
192          * roughly equivalent to the bounding box of some character when inserted at the
193          * end of the text; its height typically being the maximal height of all the
194          * characters in the text or the height of the preceding character, its width
195          * being at least one pixel so that the bounding box is not degenerate.
196          * </p>
197          *
198          * @param e an event object containing the following fields:<ul>
199          * <li>[in] start - the 0 based offset of the first character of the substring in the bounding box</li>
200          * <li>[in] end - the 0 based offset after the last character of the substring in the bounding box</li>
201          * <li>[typical out] x - the X coordinate of the top left corner of the bounding box of the specified substring</li>
202          * <li>[typical out] y - the Y coordinate of the top left corner of the bounding box of the specified substring</li>
203          * <li>[typical out] width - the width of the bounding box of the specified substring</li>
204          * <li>[typical out] height - the height of the bounding box of the specified substring</li>
205          * <li>[optional out] rectangles - a set of disjoint bounding rectangles, if the specified text range includes
206          *              partial lines</li>
207          * </ul>
208          */
209         public void getTextBounds(AccessibleTextEvent e);
210
211         /**
212          * Returns the visible text range(s).
213          * <p>
214          * Partially visible characters are included in the returned ranges.
215          * </p>
216          *
217          * @param e an event object containing the following fields:<ul>
218          * <li>[typical out] start - the 0 based offset of the first character of the visible substring</li>
219          * <li>[typical out] end - the 0 based offset after the last character of the visible substring</li>
220          * <li>[optional out] ranges - an array of pairs specifying the start and end offsets of each range,
221          *              if the visible text range is clipped</li>
222          * </ul>
223          */
224         public void getVisibleRanges(AccessibleTextEvent e);
225
226         /**
227          * Deselects a range of text.
228          *
229          * @param e an event object containing the following fields:<ul>
230          * <li>[in] index - the 0 based index of selection to remove</li>
231          * <li>[out] result - set to {@link ACC#OK} if the range of text was deselected</li>
232          * </ul>
233          */
234         public void removeSelection(AccessibleTextEvent e);
235
236         /**
237          * Scrolls a specific part of a substring according to the scroll type.
238          *
239          * @param e an event object containing the following fields:<ul>
240          * <li>[in] start - the 0 based offset of the first character of the substring</li>
241          * <li>[in] end - the 0 based offset after the last character of the substring</li>
242          * <li>[in] type - a scroll type indicating where the substring should be placed
243          *              on the screen. One of:<ul>
244          *              <li> {@link ACC#SCROLL_TYPE_TOP_LEFT}</li>
245          *              <li> {@link ACC#SCROLL_TYPE_BOTTOM_RIGHT}</li>
246          *              <li> {@link ACC#SCROLL_TYPE_TOP_EDGE}</li>
247          *              <li> {@link ACC#SCROLL_TYPE_BOTTOM_EDGE}</li>
248          *              <li> {@link ACC#SCROLL_TYPE_LEFT_EDGE}</li>
249          *              <li> {@link ACC#SCROLL_TYPE_RIGHT_EDGE}</li>
250          *              <li> {@link ACC#SCROLL_TYPE_ANYWHERE}</li>
251          *              <li> {@link ACC#SCROLL_TYPE_POINT}</li>
252          *              </ul></li>
253          * <li>[optional in] x - for SCROLL_TYPE_POINT, the X coordinate of the destination point in display coordinates</li>
254          * <li>[optional in] y - for SCROLL_TYPE_POINT, the Y coordinate of the destination point in display coordinates</li>
255          * <li>[out] result - set to {@link ACC#OK} if the text was scrolled</li>
256          * </ul>
257          */
258         public void scrollText(AccessibleTextEvent e);
259
260         /**
261          * Sets the position of the caret.
262          * <p>
263          * The caret position is that of the character logically following it,
264          * e.g. to the right of it in a left to right language.
265          * The caret is actually placed to the leading side of the character with
266          * that offset. An offset of 0 places the caret so that the next insertion
267          * goes before the first character. An offset of getCharacterCount places
268          * the caret so that the next insertion goes after the last character.
269          * </p><p>
270          * Setting the caret position may or may not alter the current selection.  A
271          * change of the selection is notified to the accessibility event listeners with
272          * an EVENT_TEXT_SELECTION_CHANGED event.
273          * </p><p>
274          * When the new caret position differs from the old one, this is notified to the
275          * accessibility event listeners with an EVENT_TEXT_CARET_MOVED event.
276          * </p>
277          *
278          * @param e an event object containing the following fields:<ul>
279          * <li>[in] offset - the new offset of the caret</li>
280          * <li>[out] result - set to {@link ACC#OK} if the caret position was set</li>
281          * </ul>
282          */
283         public void setCaretOffset(AccessibleTextEvent e);
284
285         /**
286          * Changes the bounds of an existing selection.
287          *
288          * @param e an event object containing the following fields:<ul>
289          * <li>[in] index - the 0 based index of the selection to change</li>
290          * <li>[in] start - the new 0 based offset of the first character of the selection</li>
291          * <li>[in] end - the new 0 based offset after the last character of the selection</li>
292          * <li>[out] result - set to {@link ACC#OK} if the selection was set</li>
293          * </ul>
294          */
295         public void setSelection(AccessibleTextEvent e);
296 }