1 /*******************************************************************************
2 * Copyright (c) 2000, 2013 IBM Corporation and others.
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/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.accessibility;
18 * Class ACC contains all the constants used in defining an
21 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
26 public static final int STATE_NORMAL = 0x00000000;
27 public static final int STATE_SELECTED = 0x00000002;
28 public static final int STATE_SELECTABLE = 0x00200000;
29 public static final int STATE_MULTISELECTABLE = 0x01000000;
30 public static final int STATE_FOCUSED = 0x00000004;
31 public static final int STATE_FOCUSABLE = 0x00100000;
32 public static final int STATE_PRESSED = 0x00000008;
33 public static final int STATE_CHECKED = 0x00000010;
34 public static final int STATE_EXPANDED = 0x00000200;
35 public static final int STATE_COLLAPSED = 0x00000400;
36 public static final int STATE_HOTTRACKED = 0x00000080;
37 public static final int STATE_BUSY = 0x00000800;
38 public static final int STATE_READONLY = 0x00000040;
39 public static final int STATE_INVISIBLE = 0x00008000;
40 public static final int STATE_OFFSCREEN = 0x00010000;
41 public static final int STATE_SIZEABLE = 0x00020000;
42 public static final int STATE_LINKED = 0x00400000;
44 public static final int STATE_DISABLED = 0x00000001;
46 public static final int STATE_ACTIVE = 0x04000000;
48 public static final int STATE_SINGLELINE = 0x08000000;
50 public static final int STATE_MULTILINE = 0x10000000;
52 public static final int STATE_REQUIRED = 0x02000000;
54 public static final int STATE_INVALID_ENTRY = 0x20000000;
56 public static final int STATE_SUPPORTS_AUTOCOMPLETION = 0x40000000;
58 public static final int ROLE_CLIENT_AREA = 0xa;
59 public static final int ROLE_WINDOW = 0x9;
60 public static final int ROLE_MENUBAR = 0x2;
61 public static final int ROLE_MENU = 0xb;
62 public static final int ROLE_MENUITEM = 0xc;
63 public static final int ROLE_SEPARATOR = 0x15;
64 public static final int ROLE_TOOLTIP = 0xd;
65 public static final int ROLE_SCROLLBAR = 0x3;
66 public static final int ROLE_DIALOG = 0x12;
67 public static final int ROLE_LABEL = 0x29;
68 public static final int ROLE_PUSHBUTTON = 0x2b;
69 public static final int ROLE_CHECKBUTTON = 0x2c;
70 public static final int ROLE_RADIOBUTTON = 0x2d;
72 public static final int ROLE_SPLITBUTTON = 0x3e;
73 public static final int ROLE_COMBOBOX = 0x2e;
74 public static final int ROLE_TEXT = 0x2a;
75 public static final int ROLE_TOOLBAR = 0x16;
76 public static final int ROLE_LIST = 0x21;
77 public static final int ROLE_LISTITEM = 0x22;
78 public static final int ROLE_TABLE = 0x18;
79 public static final int ROLE_TABLECELL = 0x1d;
80 public static final int ROLE_TABLECOLUMNHEADER = 0x19;
81 /** @deprecated use ROLE_TABLECOLUMNHEADER */
83 public static final int ROLE_TABLECOLUMN = ROLE_TABLECOLUMNHEADER;
84 public static final int ROLE_TABLEROWHEADER = 0x1a;
85 public static final int ROLE_TREE = 0x23;
86 public static final int ROLE_TREEITEM = 0x24;
87 public static final int ROLE_TABFOLDER = 0x3c;
88 public static final int ROLE_TABITEM = 0x25;
89 public static final int ROLE_PROGRESSBAR = 0x30;
90 public static final int ROLE_SLIDER = 0x33;
91 public static final int ROLE_LINK = 0x1e;
93 public static final int ROLE_ALERT = 0x08;
95 public static final int ROLE_ANIMATION = 0x36;
97 public static final int ROLE_CANVAS = 0x401;
99 public static final int ROLE_COLUMN = 0x1b;
101 public static final int ROLE_DOCUMENT = 0x0f;
103 public static final int ROLE_GRAPHIC = 0x28;
105 public static final int ROLE_GROUP = 0x14;
107 public static final int ROLE_ROW = 0x1c;
109 public static final int ROLE_SPINBUTTON = 0x34;
111 public static final int ROLE_STATUSBAR = 0x17;
113 public static final int ROLE_CHECKMENUITEM = 0x403;
115 public static final int ROLE_RADIOMENUITEM = 0x431;
117 public static final int ROLE_CLOCK = 0x3d;
119 public static final int ROLE_CALENDAR = 0x2f;
121 public static final int ROLE_DATETIME = 0x405;
123 public static final int ROLE_FOOTER = 0x40E;
125 public static final int ROLE_FORM = 0x410;
127 public static final int ROLE_HEADER = 0x413;
129 public static final int ROLE_HEADING = 0x414;
131 public static final int ROLE_PAGE = 0x41D;
133 public static final int ROLE_PARAGRAPH = 0x41E;
135 public static final int ROLE_SECTION = 0x424;
137 public static final int CHILDID_SELF = -1;
138 public static final int CHILDID_NONE = -2;
139 public static final int CHILDID_MULTIPLE = -3;
142 * An AT is requesting the accessible child object at the specified index.
144 * @see AccessibleControlListener#getChild
148 public static final int CHILDID_CHILD_AT_INDEX = -4;
151 * An AT is requesting the index of this accessible in its parent.
153 * @see AccessibleControlListener#getChild
157 public static final int CHILDID_CHILD_INDEX = -5;
160 * A detail constant indicating visible accessible objects.
164 public static final int VISIBLE = 0x01;
167 * A type constant specifying that insertion occurred.
171 public static final int INSERT = 0;
174 * A type constant specifying that deletion occurred.
178 public static final int DELETE = 1;
180 public static final int TEXT_INSERT = INSERT;
181 public static final int TEXT_DELETE = DELETE;
184 * A constant specifying that an operation succeeded.
188 public static final String OK = "OK"; //$NON-NLS-1$
191 * Typically, a single character is returned. In some cases more than one
192 * character is returned, for example, when a document contains field data
193 * such as a field containing a date, time, or footnote reference. In this
194 * case the caret can move over several characters in one movement of the
195 * caret. Note that after the caret moves, the caret offset changes by the
196 * number of characters in the field, e.g. by 8 characters in the following
201 public static final int TEXT_BOUNDARY_CHAR = 0;
204 * The range provided matches the range observed when the application
205 * processes the Ctrl + left arrow and Ctrl + right arrow key sequences.
206 * Typically this is from the start of one word to the start of the next,
207 * but various applications are inconsistent in the handling of the end of a
212 public static final int TEXT_BOUNDARY_WORD = 1;
215 * Range is from start of one sentence to the start of another sentence.
219 public static final int TEXT_BOUNDARY_SENTENCE = 2;
222 * Range is from start of one paragraph to the start of another paragraph.
226 public static final int TEXT_BOUNDARY_PARAGRAPH = 3;
229 * Range is from start of one line to the start of another line. This often
230 * means that an end-of-line character will appear at the end of the range.
231 * However in the case of some applications an end-of-line character
232 * indicates the end of a paragraph and the lines composing the paragraph,
233 * other than the last line, do not contain an end of line character.
237 public static final int TEXT_BOUNDARY_LINE = 4;
240 * Using this value will cause all text to be returned.
244 public static final int TEXT_BOUNDARY_ALL = 5;
247 * Scroll the top left corner of the object or substring such that the top
248 * left corner (and as much as possible of the rest of the object or
249 * substring) is within the top level window. In cases where the entire
250 * object or substring fits within the top level window, the placement of
251 * the object or substring is dependent on the application. For example, the
252 * object or substring may be scrolled to the closest edge, the furthest
253 * edge, or midway between those two edges. In cases where there is a
254 * hierarchy of nested scrollable controls, more than one control may have
259 public static final int SCROLL_TYPE_TOP_LEFT = 0;
262 * Scroll the bottom right corner of the object or substring such that the
263 * bottom right corner (and as much as possible of the rest of the object or
264 * substring) is within the top level window. In cases where the entire
265 * object or substring fits within the top level window, the placement of
266 * the object or substring is dependent on the application. For example, the
267 * object or substring may be scrolled to the closest edge, the furthest
268 * edge, or midway between those two edges. In cases where there is a
269 * hierarchy of nested scrollable controls, more than one control may have
274 public static final int SCROLL_TYPE_BOTTOM_RIGHT = 1;
277 * Scroll the top edge of the object or substring such that the top edge
278 * (and as much as possible of the rest of the object or substring) is
279 * within the top level window. In cases where the entire object or substring
280 * fits within the top level window, the placement of the object or
281 * substring is dependent on the application. For example, the object or
282 * substring may be scrolled to the closest edge, the furthest edge, or
283 * midway between those two edges. In cases where there is a hierarchy of
284 * nested scrollable controls, more than one control may have to be
289 public static final int SCROLL_TYPE_TOP_EDGE = 2;
292 * Scroll the bottom edge of the object or substring such that the bottom
293 * edge (and as much as possible of the rest of the object or substring) is
294 * within the top level window. In cases where the entire object or
295 * substring fits within the top level window, the placement of the object
296 * or substring is dependent on the application. For example, the object or
297 * substring may be scrolled to the closest edge, the furthest edge, or
298 * midway between those two edges. In cases where there is a hierarchy of
299 * nested scrollable controls, more than one control may have to be
304 public static final int SCROLL_TYPE_BOTTOM_EDGE = 3;
307 * Scroll the left edge of the object or substring such that the left edge
308 * (and as much as possible of the rest of the object or substring) is
309 * within the top level window. In cases where the entire object or substring
310 * fits within the top level window, the placement of the object or
311 * substring is dependent on the application. For example, the object or
312 * substring may be scrolled to the closest edge, the furthest edge, or
313 * midway between those two edges. In cases where there is a hierarchy of
314 * nested scrollable controls, more than one control may have to be
319 public static final int SCROLL_TYPE_LEFT_EDGE = 4;
322 * Scroll the right edge of the object or substring such that the right edge
323 * (and as much as possible of the rest of the object or substring) is
324 * within the top level window. In cases where the entire object or
325 * substring fits within the top level window, the placement of the object
326 * or substring is dependent on the application. For example, the object or
327 * substring may be scrolled to the closest edge, the furthest edge, or
328 * midway between those two edges. In cases where there is a hierarchy of
329 * nested scrollable controls, more than one control may have to be
334 public static final int SCROLL_TYPE_RIGHT_EDGE = 5;
337 * Scroll the object or substring such that as much as possible of the
338 * object or substring is within the top level window. The placement of the
339 * object is dependent on the application. For example, the object or
340 * substring may be scrolled to to closest edge, the furthest edge, or
341 * midway between those two edges.
345 public static final int SCROLL_TYPE_ANYWHERE = 6;
348 * Scroll the top left corner of the object or substring to the specified point.
352 public static final int SCROLL_TYPE_POINT = 7;
355 * Send when the selection within a container has changed.
359 public static final int EVENT_SELECTION_CHANGED = 0x8009;
362 * Send when an object's text selection has changed.
366 public static final int EVENT_TEXT_SELECTION_CHANGED = 0x8014;
369 * Send when an object's state has changed, for example enabled/disabled, pressed/released, or checked/unchecked.
371 * The eventData object is an array of 2 ints specifying the following:</p><ul>
372 * <li>state - the STATE_* constant identifying the state that changed</li>
373 * <li>newValue - either 1 or 0, indicating whether the state has changed to true or false</li>
378 public static final int EVENT_STATE_CHANGED = 0x800A;
381 * Send when an object has moved.
383 * Note: only send one notification for the topmost object that has changed.
388 public static final int EVENT_LOCATION_CHANGED = 0x800B;
391 * Send when an object's name has changed.
395 public static final int EVENT_NAME_CHANGED = 0x800C;
398 * Send when an object's description has changed.
402 public static final int EVENT_DESCRIPTION_CHANGED = 0x800D;
405 * Send when an object's value has changed.
407 * The eventData object is an array of 2 Numbers specifying the following:</p>
409 * <li>oldValue - the object's old value</li>
410 * <li>newValue - the object's new value</li>
415 public static final int EVENT_VALUE_CHANGED = 0x800E;
418 * Send when the loading of a document has completed.
422 public static final int EVENT_DOCUMENT_LOAD_COMPLETE = 0x105;
425 * Send when the loading of a document was interrupted.
429 public static final int EVENT_DOCUMENT_LOAD_STOPPED = 0x106;
432 * Send when the document contents are being reloaded.
436 public static final int EVENT_DOCUMENT_RELOAD = 0x107;
439 * Send when a slide changed in a presentation document
440 * or a page boundary was crossed in a word processing document.
444 public static final int EVENT_PAGE_CHANGED = 0x111;
447 * Send when the caret moved from one section to the next.
451 public static final int EVENT_SECTION_CHANGED = 0x112;
454 * Send when the count or attributes of an accessible object's actions have changed.
458 public static final int EVENT_ACTION_CHANGED = 0x100;
461 * Send when the starting index of this link within the containing string has changed.
465 public static final int EVENT_HYPERLINK_START_INDEX_CHANGED = 0x10d;
468 * Send when the ending index of this link within the containing string has changed.
472 public static final int EVENT_HYPERLINK_END_INDEX_CHANGED = 0x108;
475 * Send when the number of anchors associated with this hyperlink object has changed.
479 public static final int EVENT_HYPERLINK_ANCHOR_COUNT_CHANGED = 0x109;
482 * Send when the hyperlink selected state changed from selected to unselected
483 * or from unselected to selected.
487 public static final int EVENT_HYPERLINK_SELECTED_LINK_CHANGED = 0x10a;
490 * Send when the hyperlink has been activated.
494 public static final int EVENT_HYPERLINK_ACTIVATED = 0x10b;
497 * Send when one of the links associated with the hypertext object has been selected.
499 * The eventData object is an Integer that represents the index of the selected link
500 * in the hypertext object.
505 public static final int EVENT_HYPERTEXT_LINK_SELECTED = 0x10c;
508 * Send when the number of hyperlinks associated with a hypertext object has changed.
512 public static final int EVENT_HYPERTEXT_LINK_COUNT_CHANGED = 0x10f;
515 * Send when an object's attributes have changed.
517 * @see #EVENT_TEXT_ATTRIBUTE_CHANGED
521 public static final int EVENT_ATTRIBUTE_CHANGED = 0x200;
524 * Send when a table caption has changed.
528 public static final int EVENT_TABLE_CAPTION_CHANGED = 0x203;
531 * Send when a table's column description has changed.
535 public static final int EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED = 0x204;
538 * Send when a table's column header has changed.
542 public static final int EVENT_TABLE_COLUMN_HEADER_CHANGED = 0x205;
545 * Send when a table's data has changed.
547 * The eventData object is an array of 5 ints specifying the following:</p>
549 * <li>type - {@link ACC#INSERT} or {@link ACC#DELETE} - the type of change</li>
550 * <li>rowStart - the index of the first row that changed</li>
551 * <li>rowCount - the number of contiguous rows that changed, or 0 if no rows changed</li>
552 * <li>columnStart - the index of the first column that changed</li>
553 * <li>columnCount - the number of contiguous columns that changed, or 0 if no columns changed</li>
558 public static final int EVENT_TABLE_CHANGED = 0x206;
561 * Send when a table's row description has changed.
565 public static final int EVENT_TABLE_ROW_DESCRIPTION_CHANGED = 0x207;
568 * Send when a table's row header has changed.
572 public static final int EVENT_TABLE_ROW_HEADER_CHANGED = 0x208;
575 * Send when a table's summary has changed.
579 public static final int EVENT_TABLE_SUMMARY_CHANGED = 0x209;
582 * Send when a text object's attributes have changed.
584 * @see #EVENT_ATTRIBUTE_CHANGED
588 public static final int EVENT_TEXT_ATTRIBUTE_CHANGED = 0x20a;
591 * Send when the caret has moved to a new position.
595 public static final int EVENT_TEXT_CARET_MOVED = 0x11b;
598 * Send when the caret has moved from one column to the next.
602 public static final int EVENT_TEXT_COLUMN_CHANGED = 0x11d;
605 * Send when text was inserted or deleted.
607 * The eventData object is an array of 4 objects specifying the following:</p>
609 * <li>type - {@link ACC#INSERT} or {@link ACC#DELETE} - the type of change</li>
610 * <li>start - the index of the first character that changed</li>
611 * <li>end - the index of the last character that changed</li>
612 * <li>text - the text string that was inserted or deleted</li>
617 public static final int EVENT_TEXT_CHANGED = 0x20c;
620 * Some attribute of this object is affected by a target object.
624 public static final int RELATION_CONTROLLED_BY = 0;
627 * This object is interactive and controls some attribute of a target object.
631 public static final int RELATION_CONTROLLER_FOR = 1;
634 * This object is described by the target object.
638 public static final int RELATION_DESCRIBED_BY = 2;
641 * This object is describes the target object.
645 public static final int RELATION_DESCRIPTION_FOR = 3;
648 * This object is embedded by a target object.
652 public static final int RELATION_EMBEDDED_BY = 4;
655 * This object embeds a target object. This relation can be used on a
656 * control's accessible to show where the content areas are.
660 public static final int RELATION_EMBEDS = 5;
663 * Content flows to this object from a target object.
664 * This relation and RELATION_FLOWS_TO are useful to tie text and non-text
665 * objects together in order to allow assistive technology to follow the
666 * intended reading order.
670 public static final int RELATION_FLOWS_FROM = 6;
673 * Content flows from this object to a target object.
677 public static final int RELATION_FLOWS_TO = 7;
680 * This object is label for a target object.
684 public static final int RELATION_LABEL_FOR = 8;
687 * This object is labelled by a target object.
691 public static final int RELATION_LABELLED_BY = 9;
694 * This object is a member of a group of one or more objects. When
695 * there is more than one object in the group each member may have one and the
696 * same target, e.g. a grouping object. It is also possible that each member has
697 * multiple additional targets, e.g. one for every other member in the group.
701 public static final int RELATION_MEMBER_OF = 10;
704 * This object is a child of a target object.
708 public static final int RELATION_NODE_CHILD_OF = 11;
711 * This object is a parent window of the target object.
715 public static final int RELATION_PARENT_WINDOW_OF = 12;
718 * This object is a transient component related to the target object.
719 * When this object is activated the target object doesn't lose focus.
723 public static final int RELATION_POPUP_FOR = 13;
726 * This object is a sub window of a target object.
730 public static final int RELATION_SUBWINDOW_OF = 14;