4#ifndef QACCESSIBLE_BASE_H
5#define QACCESSIBLE_BASE_H
7#include <QtGui/qtguiglobal.h>
8#if QT_CONFIG(accessibility)
12#pragma qt_sync_stop_processing
15#include <QtCore/qobjectdefs.h>
21class QAccessibleInterface;
22class QAccessibleEvent;
25class Q_GUI_EXPORT QAccessible
33 ForegroundChanged = 0x0003,
36 PopupMenuStart = 0x0006,
37 PopupMenuEnd = 0x0007,
38 ContextHelpStart = 0x000C,
39 ContextHelpEnd = 0x000D,
40 DragDropStart = 0x000E,
44 ScrollingStart = 0x0012,
45 ScrollingEnd = 0x0013,
50 ActionChanged = 0x0101,
51 ActiveDescendantChanged = 0x0102,
52 AttributeChanged = 0x0103,
53 DocumentContentChanged = 0x0104,
54 DocumentLoadComplete = 0x0105,
55 DocumentLoadStopped = 0x0106,
56 DocumentReload = 0x0107,
57 HyperlinkEndIndexChanged = 0x0108,
58 HyperlinkNumberOfAnchorsChanged = 0x0109,
59 HyperlinkSelectedLinkChanged = 0x010A,
60 HypertextLinkActivated = 0x010B,
61 HypertextLinkSelected = 0x010C,
62 HyperlinkStartIndexChanged = 0x010D,
63 HypertextChanged = 0x010E,
64 HypertextNLinksChanged = 0x010F,
65 ObjectAttributeChanged = 0x0110,
67 SectionChanged = 0x0112,
68 TableCaptionChanged = 0x0113,
69 TableColumnDescriptionChanged = 0x0114,
70 TableColumnHeaderChanged = 0x0115,
71 TableModelChanged = 0x0116,
72 TableRowDescriptionChanged = 0x0117,
73 TableRowHeaderChanged = 0x0118,
74 TableSummaryChanged = 0x0119,
75 TextAttributeChanged = 0x011A,
76 TextCaretMoved = 0x011B,
78 TextColumnChanged = 0x011D,
79 TextInserted = 0x011E,
82 TextSelectionChanged = 0x0121,
83 VisibleDataChanged = 0x0122,
85 ObjectCreated = 0x8000,
86 ObjectDestroyed = 0x8001,
89 ObjectReorder = 0x8004,
92 SelectionAdd = 0x8007,
93 SelectionRemove = 0x8008,
94 SelectionWithin = 0x8009,
95 StateChanged = 0x800A,
96 LocationChanged = 0x800B,
98 DescriptionChanged = 0x800D,
99 ValueChanged = 0x800E,
100 ParentChanged = 0x800F,
101 HelpChanged = 0x80A0,
102 DefaultActionChanged = 0x80B0,
103 AcceleratorChanged = 0x80C0,
104 Announcement = 0x80D0,
105 IdentifierChanged = 0x80E0,
106 RoleChanged = 0x80E1,
109 InvalidEvent = AcceleratorChanged + 1,
117 quint64 disabled : 1;
118 quint64 selected : 1;
119 quint64 focusable : 1;
122 quint64 checkable : 1;
124 quint64 checkStateMixed : 1;
125 quint64 readOnly : 1;
126 quint64 hotTracked : 1;
127 quint64 defaultButton : 1;
128 quint64 expanded : 1;
129 quint64 collapsed : 1;
131 quint64 expandable : 1;
132 quint64 marqueed : 1;
133 quint64 animated : 1;
134 quint64 invisible : 1;
135 quint64 offscreen : 1;
136 quint64 sizeable : 1;
138 quint64 selfVoicing : 1;
139 quint64 selectable : 1;
141 quint64 traversed : 1;
142 quint64 multiSelectable : 1;
143 quint64 extSelectable : 1;
144 quint64 passwordEdit : 1;
145 quint64 hasPopup : 1;
152 quint64 editable : 1;
153 quint64 multiLine : 1;
154 quint64 selectableText : 1;
155 quint64 supportsAutoCompletion : 1;
157 quint64 searchEdit : 1;
181 std::memset(
this, 0,
sizeof(State));
183 friend inline bool operator==(
const QAccessible::State &first,
const QAccessible::State &second)
185 return std::memcmp(&first, &second,
sizeof(QAccessible::State)) == 0;
195 TitleBar = 0x00000001,
196 MenuBar = 0x00000002,
197 ScrollBar = 0x00000003,
202 AlertMessage = 0x00000008,
205 PopupMenu = 0x0000000B,
206 MenuItem = 0x0000000C,
207 ToolTip = 0x0000000D,
208 Application = 0x0000000E,
209 Document = 0x0000000F,
214 Grouping = 0x00000014,
215 Separator = 0x00000015,
216 ToolBar = 0x00000016,
217 StatusBar = 0x00000017,
219 ColumnHeader = 0x00000019,
220 RowHeader = 0x0000001A,
225 HelpBalloon = 0x0000001F,
226 Assistant = 0x00000020,
228 ListItem = 0x00000022,
230 TreeItem = 0x00000024,
231 PageTab = 0x00000025,
232 PropertyPage = 0x00000026,
233 Indicator = 0x00000027,
234 Graphic = 0x00000028,
235 StaticText = 0x00000029,
236 EditableText = 0x0000002A,
241 CheckBox = 0x0000002C,
242 RadioButton = 0x0000002D,
243 ComboBox = 0x0000002E,
245 ProgressBar = 0x00000030,
247 HotkeyField = 0x00000032,
249 SpinBox = 0x00000034,
251 Animation = 0x00000036,
252 Equation = 0x00000037,
253 ButtonDropDown = 0x00000038,
254 ButtonMenu = 0x00000039,
255 ButtonDropGrid = 0x0000003A,
256 Whitespace = 0x0000003B,
257 PageTabList = 0x0000003C,
259 Splitter = 0x0000003E,
263 LayeredPane = 0x00000080,
264 Terminal = 0x00000081,
265 Desktop = 0x00000082,
266 Paragraph = 0x00000083,
267 WebDocument = 0x00000084,
268 Section = 0x00000085,
269 Notification = 0x00000086,
275 ColorChooser = 0x404,
317 ComplementaryContent = 0x42C,
327 UserRole = 0x0000ffff
339 UserText = 0x0000ffff
344 Labelled = 0x00000002,
345 Controller = 0x00000004,
346 Controlled = 0x00000008,
347 DescriptionFor = 0x00000010,
348 Described = 0x00000020,
349 FlowsFrom = 0x00000040,
350 FlowsTo = 0x00000080,
351 AllRelations = 0xffffffff
353 Q_DECLARE_FLAGS(Relation, RelationFlag)
358 EditableTextInterface,
369 enum TextBoundaryType {
378 enum class Attribute {
385 enum class AnnouncementPoliteness {
389 Q_ENUM(AnnouncementPoliteness)
391 typedef QAccessibleInterface*(*InterfaceFactory)(
const QString &key, QObject*);
392 typedef void(*UpdateHandler)(QAccessibleEvent *event);
393 typedef void(*RootObjectHandler)(QObject*);
397 static void installFactory(InterfaceFactory);
398 static void removeFactory(InterfaceFactory);
399 static UpdateHandler installUpdateHandler(UpdateHandler);
400 static RootObjectHandler installRootObjectHandler(RootObjectHandler);
402 class Q_GUI_EXPORT ActivationObserver
405 virtual ~ActivationObserver();
406 virtual void accessibilityActiveChanged(
bool active) = 0;
408 static void installActivationObserver(ActivationObserver *);
409 static void removeActivationObserver(ActivationObserver *);
411 static QAccessibleInterface *queryAccessibleInterface(QObject *);
412 static Id uniqueId(QAccessibleInterface *iface);
413 static QAccessibleInterface *accessibleInterface(Id uniqueId);
414 static Id registerAccessibleInterface(QAccessibleInterface *iface);
415 static void deleteAccessibleInterface(Id uniqueId);
417 static void updateAccessibility(QAccessibleEvent *event);
419 static bool isActive();
420 static void setActive(
bool active);
421 static void setRootObject(QObject *object);
423 static void cleanup();
425 static std::pair<
int,
int > qAccessibleTextBoundaryHelper(
const QTextCursor &cursor, TextBoundaryType boundaryType);
428 static UpdateHandler updateHandler;
429 static RootObjectHandler rootObjectHandler;
433 friend class QAccessibleCache;
436Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::Relation)