7#include <QtGui/qwindow.h>
8#include <QtGui/qguiapplication.h>
13#include <QtCore/qloggingcategory.h>
14#include <QtCore/qtversion.h>
16#if QT_CONFIG(accessibility)
17#include "socket_interface.h"
19#include <QtCore/private/qstringiterator_p.h>
20#include <QtGui/private/qaccessiblebridgeutils_p.h>
34#if ATSPI_COORD_TYPE_COUNT < 3
35#define ATSPI_COORD_TYPE_PARENT 2
49 , sendObject_active_descendant_changed(0)
50 , sendObject_attributes_changed(0)
51 , sendObject_bounds_changed(0)
52 , sendObject_children_changed(0)
55 , sendObject_column_deleted(0)
56 , sendObject_column_inserted(0)
57 , sendObject_column_reordered(0)
58 , sendObject_link_selected(0)
59 , sendObject_model_changed(0)
60 , sendObject_property_change(0)
61 , sendObject_property_change_accessible_description(0)
62 , sendObject_property_change_accessible_name(0)
63 , sendObject_property_change_accessible_parent(0)
64 , sendObject_property_change_accessible_role(0)
65 , sendObject_property_change_accessible_table_caption(0)
66 , sendObject_property_change_accessible_table_column_description(0)
67 , sendObject_property_change_accessible_table_column_header(0)
68 , sendObject_property_change_accessible_table_row_description(0)
69 , sendObject_property_change_accessible_table_row_header(0)
70 , sendObject_property_change_accessible_table_summary(0)
71 , sendObject_property_change_accessible_value(0)
72 , sendObject_row_deleted(0)
73 , sendObject_row_inserted(0)
74 , sendObject_row_reordered(0)
75 , sendObject_selection_changed(0)
76 , sendObject_state_changed(0)
77 , sendObject_text_attributes_changed(0)
78 , sendObject_text_bounds_changed(0)
79 , sendObject_text_caret_moved(0)
80 , sendObject_text_changed(0)
83 , sendObject_text_selection_changed(0)
84 , sendObject_value_changed(0)
85 , sendObject_visible_data_changed(0)
87 , sendWindow_activate(0)
89 , sendWindow_create(0)
90 , sendWindow_deactivate(0)
94 , sendWindow_maximize(0)
95 , sendWindow_minimize(0)
98 , sendWindow_reparent(0)
99 , sendWindow_resize(0)
100 , sendWindow_restore(0)
101 , sendWindow_restyle(0)
102 , sendWindow_shade(0)
103 , sendWindow_unshade(0)
108 updateEventListeners();
109 bool success = m_dbus->connection().connect(
"org.a11y.atspi.Registry"_L1,
"/org/a11y/atspi/registry"_L1,
110 "org.a11y.atspi.Registry"_L1,
"EventListenerRegistered"_L1,
this,
112 success = success && m_dbus->connection().connect(
"org.a11y.atspi.Registry"_L1,
"/org/a11y/atspi/registry"_L1,
113 "org.a11y.atspi.Registry"_L1,
"EventListenerDeregistered"_L1,
this,
127 " <interface name=\"org.a11y.atspi.Accessible\">\n"
128 " <property access=\"read\" type=\"s\" name=\"Name\"/>\n"
129 " <property access=\"read\" type=\"s\" name=\"Description\"/>\n"
130 " <property access=\"read\" type=\"(so)\" name=\"Parent\">\n"
131 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
133 " <property access=\"read\" type=\"i\" name=\"ChildCount\"/>\n"
134 " <method name=\"GetChildAtIndex\">\n"
135 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
136 " <arg direction=\"out\" type=\"(so)\"/>\n"
137 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
139 " <method name=\"GetChildren\">\n"
140 " <arg direction=\"out\" type=\"a(so)\"/>\n"
141 " <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
143 " <method name=\"GetIndexInParent\">\n"
144 " <arg direction=\"out\" type=\"i\"/>\n"
146 " <method name=\"GetRelationSet\">\n"
147 " <arg direction=\"out\" type=\"a(ua(so))\"/>\n"
148 " <annotation value=\"QSpiRelationArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
150 " <method name=\"GetRole\">\n"
151 " <arg direction=\"out\" type=\"u\"/>\n"
153 " <method name=\"GetRoleName\">\n"
154 " <arg direction=\"out\" type=\"s\"/>\n"
156 " <method name=\"GetLocalizedRoleName\">\n"
157 " <arg direction=\"out\" type=\"s\"/>\n"
159 " <method name=\"GetState\">\n"
160 " <arg direction=\"out\" type=\"au\"/>\n"
161 " <annotation value=\"QSpiUIntList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
163 " <method name=\"GetAttributes\">\n"
164 " <arg direction=\"out\" type=\"a{ss}\"/>\n"
165 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
167 " <method name=\"GetApplication\">\n"
168 " <arg direction=\"out\" type=\"(so)\"/>\n"
169 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
171 " <method name=\"GetAccessibleId\">\n"
172 " <arg direction=\"out\" type=\"s\"/>\n"
178 " <interface name=\"org.a11y.atspi.Action\">\n"
179 " <property access=\"read\" type=\"i\" name=\"NActions\"/>\n"
180 " <method name=\"GetDescription\">\n"
181 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
182 " <arg direction=\"out\" type=\"s\"/>\n"
184 " <method name=\"GetName\">\n"
185 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
186 " <arg direction=\"out\" type=\"s\"/>\n"
188 " <method name=\"GetKeyBinding\">\n"
189 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
190 " <arg direction=\"out\" type=\"s\"/>\n"
192 " <method name=\"GetActions\">\n"
193 " <arg direction=\"out\" type=\"a(sss)\" name=\"index\"/>\n"
194 " <annotation value=\"QSpiActionArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
196 " <method name=\"DoAction\">\n"
197 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
198 " <arg direction=\"out\" type=\"b\"/>\n"
204 " <interface name=\"org.a11y.atspi.Application\">\n"
205 " <property access=\"read\" type=\"s\" name=\"ToolkitName\"/>\n"
206 " <property access=\"read\" type=\"s\" name=\"Version\"/>\n"
207 " <property access=\"readwrite\" type=\"i\" name=\"Id\"/>\n"
208 " <method name=\"GetLocale\">\n"
209 " <arg direction=\"in\" type=\"u\" name=\"lctype\"/>\n"
210 " <arg direction=\"out\" type=\"s\"/>\n"
212 " <method name=\"GetApplicationBusAddress\">\n"
213 " <arg direction=\"out\" type=\"s\" name=\"address\"/>\n"
219 " <interface name=\"org.a11y.atspi.Component\">\n"
220 " <method name=\"Contains\">\n"
221 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
222 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
223 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"
224 " <arg direction=\"out\" type=\"b\"/>\n"
226 " <method name=\"GetAccessibleAtPoint\">\n"
227 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
228 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
229 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"
230 " <arg direction=\"out\" type=\"(so)\"/>\n"
231 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
233 " <method name=\"GetExtents\">\n"
234 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"
235 " <arg direction=\"out\" type=\"(iiii)\"/>\n"
236 " <annotation value=\"QSpiRect\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
238 " <method name=\"GetPosition\">\n"
239 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"
240 " <arg direction=\"out\" type=\"i\" name=\"x\"/>\n"
241 " <arg direction=\"out\" type=\"i\" name=\"y\"/>\n"
243 " <method name=\"GetSize\">\n"
244 " <arg direction=\"out\" type=\"i\" name=\"width\"/>\n"
245 " <arg direction=\"out\" type=\"i\" name=\"height\"/>\n"
247 " <method name=\"GetLayer\">\n"
248 " <arg direction=\"out\" type=\"u\"/>\n"
250 " <method name=\"GetMDIZOrder\">\n"
251 " <arg direction=\"out\" type=\"n\"/>\n"
253 " <method name=\"GrabFocus\">\n"
254 " <arg direction=\"out\" type=\"b\"/>\n"
256 " <method name=\"GetAlpha\">\n"
257 " <arg direction=\"out\" type=\"d\"/>\n"
259 " <method name=\"SetExtents\">\n"
260 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
261 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
262 " <arg direction=\"in\" type=\"i\" name=\"width\"/>\n"
263 " <arg direction=\"in\" type=\"i\" name=\"height\"/>\n"
264 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"
265 " <arg direction=\"out\" type=\"b\"/>\n"
267 " <method name=\"SetPosition\">\n"
268 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
269 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
270 " <arg direction=\"in\" type=\"u\" name=\"coord_type\"/>\n"
271 " <arg direction=\"out\" type=\"b\"/>\n"
273 " <method name=\"SetSize\">\n"
274 " <arg direction=\"in\" type=\"i\" name=\"width\"/>\n"
275 " <arg direction=\"in\" type=\"i\" name=\"height\"/>\n"
276 " <arg direction=\"out\" type=\"b\"/>\n"
282 " <interface name=\"org.a11y.atspi.EditableText\">\n"
283 " <method name=\"SetTextContents\">\n"
284 " <arg direction=\"in\" type=\"s\" name=\"newContents\"/>\n"
285 " <arg direction=\"out\" type=\"b\"/>\n"
287 " <method name=\"InsertText\">\n"
288 " <arg direction=\"in\" type=\"i\" name=\"position\"/>\n"
289 " <arg direction=\"in\" type=\"s\" name=\"text\"/>\n"
290 " <arg direction=\"in\" type=\"i\" name=\"length\"/>\n"
291 " <arg direction=\"out\" type=\"b\"/>\n"
293 " <method name=\"CopyText\">\n"
294 " <arg direction=\"in\" type=\"i\" name=\"startPos\"/>\n"
295 " <arg direction=\"in\" type=\"i\" name=\"endPos\"/>\n"
297 " <method name=\"CutText\">\n"
298 " <arg direction=\"in\" type=\"i\" name=\"startPos\"/>\n"
299 " <arg direction=\"in\" type=\"i\" name=\"endPos\"/>\n"
300 " <arg direction=\"out\" type=\"b\"/>\n"
302 " <method name=\"DeleteText\">\n"
303 " <arg direction=\"in\" type=\"i\" name=\"startPos\"/>\n"
304 " <arg direction=\"in\" type=\"i\" name=\"endPos\"/>\n"
305 " <arg direction=\"out\" type=\"b\"/>\n"
307 " <method name=\"PasteText\">\n"
308 " <arg direction=\"in\" type=\"i\" name=\"position\"/>\n"
309 " <arg direction=\"out\" type=\"b\"/>\n"
315 " <interface name=\"org.a11y.atspi.Selection\">\n"
316 " <property name=\"NSelectedChildren\" type=\"i\" access=\"read\"/>\n"
317 " <method name=\"GetSelectedChild\">\n"
318 " <arg direction=\"in\" name=\"selectedChildIndex\" type=\"i\"/>\n"
319 " <arg direction=\"out\" type=\"(so)\"/>\n"
320 " <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"QSpiObjectReference\"/>\n"
322 " <method name=\"SelectChild\">\n"
323 " <arg direction=\"in\" name=\"childIndex\" type=\"i\"/>\n"
324 " <arg direction=\"out\" type=\"b\"/>\n"
326 " <method name=\"DeselectSelectedChild\">\n"
327 " <arg direction=\"in\" name=\"selectedChildIndex\" type=\"i\"/>\n"
328 " <arg direction=\"out\" type=\"b\"/>\n"
330 " <method name=\"IsChildSelected\">\n"
331 " <arg direction=\"in\" name=\"childIndex\" type=\"i\"/>\n"
332 " <arg direction=\"out\" type=\"b\"/>\n"
334 " <method name=\"SelectAll\">\n"
335 " <arg direction=\"out\" type=\"b\"/>\n"
337 " <method name=\"ClearSelection\">\n"
338 " <arg direction=\"out\" type=\"b\"/>\n"
340 " <method name=\"DeselectChild\">\n"
341 " <arg direction=\"in\" name=\"childIndex\" type=\"i\"/>\n"
342 " <arg direction=\"out\" type=\"b\"/>\n"
348 " <interface name=\"org.a11y.atspi.Table\">\n"
349 " <property access=\"read\" type=\"i\" name=\"NRows\"/>\n"
350 " <property access=\"read\" type=\"i\" name=\"NColumns\"/>\n"
351 " <property access=\"read\" type=\"(so)\" name=\"Caption\">\n"
352 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
354 " <property access=\"read\" type=\"(so)\" name=\"Summary\">\n"
355 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
357 " <property access=\"read\" type=\"i\" name=\"NSelectedRows\"/>\n"
358 " <property access=\"read\" type=\"i\" name=\"NSelectedColumns\"/>\n"
359 " <method name=\"GetAccessibleAt\">\n"
360 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
361 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
362 " <arg direction=\"out\" type=\"(so)\"/>\n"
363 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
365 " <method name=\"GetIndexAt\">\n"
366 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
367 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
368 " <arg direction=\"out\" type=\"i\"/>\n"
370 " <method name=\"GetRowAtIndex\">\n"
371 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
372 " <arg direction=\"out\" type=\"i\"/>\n"
374 " <method name=\"GetColumnAtIndex\">\n"
375 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
376 " <arg direction=\"out\" type=\"i\"/>\n"
378 " <method name=\"GetRowDescription\">\n"
379 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
380 " <arg direction=\"out\" type=\"s\"/>\n"
382 " <method name=\"GetColumnDescription\">\n"
383 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
384 " <arg direction=\"out\" type=\"s\"/>\n"
386 " <method name=\"GetRowExtentAt\">\n"
387 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
388 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
389 " <arg direction=\"out\" type=\"i\"/>\n"
391 " <method name=\"GetColumnExtentAt\">\n"
392 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
393 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
394 " <arg direction=\"out\" type=\"i\"/>\n"
396 " <method name=\"GetRowHeader\">\n"
397 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
398 " <arg direction=\"out\" type=\"(so)\"/>\n"
399 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
401 " <method name=\"GetColumnHeader\">\n"
402 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
403 " <arg direction=\"out\" type=\"(so)\"/>\n"
404 " <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
406 " <method name=\"GetSelectedRows\">\n"
407 " <arg direction=\"out\" type=\"ai\"/>\n"
408 " <annotation value=\"QSpiIntList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
410 " <method name=\"GetSelectedColumns\">\n"
411 " <arg direction=\"out\" type=\"ai\"/>\n"
412 " <annotation value=\"QSpiIntList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
414 " <method name=\"IsRowSelected\">\n"
415 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
416 " <arg direction=\"out\" type=\"b\"/>\n"
418 " <method name=\"IsColumnSelected\">\n"
419 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
420 " <arg direction=\"out\" type=\"b\"/>\n"
422 " <method name=\"IsSelected\">\n"
423 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
424 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
425 " <arg direction=\"out\" type=\"b\"/>\n"
427 " <method name=\"AddRowSelection\">\n"
428 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
429 " <arg direction=\"out\" type=\"b\"/>\n"
431 " <method name=\"AddColumnSelection\">\n"
432 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
433 " <arg direction=\"out\" type=\"b\"/>\n"
435 " <method name=\"RemoveRowSelection\">\n"
436 " <arg direction=\"in\" type=\"i\" name=\"row\"/>\n"
437 " <arg direction=\"out\" type=\"b\"/>\n"
439 " <method name=\"RemoveColumnSelection\">\n"
440 " <arg direction=\"in\" type=\"i\" name=\"column\"/>\n"
441 " <arg direction=\"out\" type=\"b\"/>\n"
443 " <method name=\"GetRowColumnExtentsAtIndex\">\n"
444 " <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
445 " <arg direction=\"out\" type=\"b\"/>\n"
446 " <arg direction=\"out\" type=\"i\" name=\"row\"/>\n"
447 " <arg direction=\"out\" type=\"i\" name=\"col\"/>\n"
448 " <arg direction=\"out\" type=\"i\" name=\"row_extents\"/>\n"
449 " <arg direction=\"out\" type=\"i\" name=\"col_extents\"/>\n"
450 " <arg direction=\"out\" type=\"b\" name=\"is_selected\"/>\n"
456 " <interface name=\"org.a11y.atspi.TableCell\">\n"
457 " <property access=\"read\" name=\"ColumnSpan\" type=\"i\" />\n"
458 " <property access=\"read\" name=\"Position\" type=\"(ii)\">\n"
459 " <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"QPoint\"/>\n"
461 " <property access=\"read\" name=\"RowSpan\" type=\"i\" />\n"
462 " <property access=\"read\" name=\"Table\" type=\"(so)\" >\n"
463 " <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"QSpiObjectReference\"/>\n"
465 " <method name=\"GetRowColumnSpan\">\n"
466 " <arg direction=\"out\" type=\"b\" />\n"
467 " <arg direction=\"out\" name=\"row\" type=\"i\" />\n"
468 " <arg direction=\"out\" name=\"col\" type=\"i\" />\n"
469 " <arg direction=\"out\" name=\"row_extents\" type=\"i\" />\n"
470 " <arg direction=\"out\" name=\"col_extents\" type=\"i\" />\n"
472 " <method name=\"GetColumnHeaderCells\">\n"
473 " <arg direction=\"out\" type=\"a(so)\"/>\n"
474 " <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
476 " <method name=\"GetRowHeaderCells\">\n"
477 " <arg direction=\"out\" type=\"a(so)\"/>\n"
478 " <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
484 " <interface name=\"org.a11y.atspi.Text\">\n"
485 " <property access=\"read\" type=\"i\" name=\"CharacterCount\"/>\n"
486 " <property access=\"read\" type=\"i\" name=\"CaretOffset\"/>\n"
487 " <method name=\"GetStringAtOffset\">\n"
488 " <arg direction=\"in\" name=\"offset\" type=\"i\"/>\n"
489 " <arg direction=\"in\" name=\"granularity\" type=\"u\"/>\n"
490 " <arg direction=\"out\" type=\"s\"/>\n"
491 " <arg direction=\"out\" name=\"startOffset\" type=\"i\"/>\n"
492 " <arg direction=\"out\" name=\"endOffset\" type=\"i\"/>\n"
494 " <method name=\"GetText\">\n"
495 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"
496 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"
497 " <arg direction=\"out\" type=\"s\"/>\n"
499 " <method name=\"SetCaretOffset\">\n"
500 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
501 " <arg direction=\"out\" type=\"b\"/>\n"
503 " <method name=\"GetTextBeforeOffset\">\n"
504 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
505 " <arg direction=\"in\" type=\"u\" name=\"type\"/>\n"
506 " <arg direction=\"out\" type=\"s\"/>\n"
507 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
508 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
510 " <method name=\"GetTextAtOffset\">\n"
511 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
512 " <arg direction=\"in\" type=\"u\" name=\"type\"/>\n"
513 " <arg direction=\"out\" type=\"s\"/>\n"
514 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
515 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
517 " <method name=\"GetTextAfterOffset\">\n"
518 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
519 " <arg direction=\"in\" type=\"u\" name=\"type\"/>\n"
520 " <arg direction=\"out\" type=\"s\"/>\n"
521 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
522 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
524 " <method name=\"GetCharacterAtOffset\">\n"
525 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
526 " <arg direction=\"out\" type=\"i\"/>\n"
528 " <method name=\"GetAttributeValue\">\n"
529 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
530 " <arg direction=\"in\" type=\"s\" name=\"attributeName\"/>\n"
531 " <arg direction=\"out\" type=\"s\"/>\n"
533 " <method name=\"GetAttributes\">\n"
534 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
535 " <arg direction=\"out\" type=\"a{ss}\"/>\n"
536 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
537 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
538 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
540 " <method name=\"GetDefaultAttributes\">\n"
541 " <arg direction=\"out\" type=\"a{ss}\"/>\n"
542 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
544 " <method name=\"GetCharacterExtents\">\n"
545 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
546 " <arg direction=\"out\" type=\"i\" name=\"x\"/>\n"
547 " <arg direction=\"out\" type=\"i\" name=\"y\"/>\n"
548 " <arg direction=\"out\" type=\"i\" name=\"width\"/>\n"
549 " <arg direction=\"out\" type=\"i\" name=\"height\"/>\n"
550 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"
552 " <method name=\"GetOffsetAtPoint\">\n"
553 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
554 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
555 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"
556 " <arg direction=\"out\" type=\"i\"/>\n"
558 " <method name=\"GetNSelections\">\n"
559 " <arg direction=\"out\" type=\"i\"/>\n"
561 " <method name=\"GetSelection\">\n"
562 " <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"
563 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
564 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
566 " <method name=\"AddSelection\">\n"
567 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"
568 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"
569 " <arg direction=\"out\" type=\"b\"/>\n"
571 " <method name=\"RemoveSelection\">\n"
572 " <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"
573 " <arg direction=\"out\" type=\"b\"/>\n"
575 " <method name=\"SetSelection\">\n"
576 " <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"
577 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"
578 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"
579 " <arg direction=\"out\" type=\"b\"/>\n"
581 " <method name=\"GetRangeExtents\">\n"
582 " <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"
583 " <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"
584 " <arg direction=\"out\" type=\"i\" name=\"x\"/>\n"
585 " <arg direction=\"out\" type=\"i\" name=\"y\"/>\n"
586 " <arg direction=\"out\" type=\"i\" name=\"width\"/>\n"
587 " <arg direction=\"out\" type=\"i\" name=\"height\"/>\n"
588 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"
590 " <method name=\"GetBoundedRanges\">\n"
591 " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
592 " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
593 " <arg direction=\"in\" type=\"i\" name=\"width\"/>\n"
594 " <arg direction=\"in\" type=\"i\" name=\"height\"/>\n"
595 " <arg direction=\"in\" type=\"u\" name=\"coordType\"/>\n"
596 " <arg direction=\"in\" type=\"u\" name=\"xClipType\"/>\n"
597 " <arg direction=\"in\" type=\"u\" name=\"yClipType\"/>\n"
598 " <arg direction=\"out\" type=\"a(iisv)\"/>\n"
599 " <annotation value=\"QSpiRangeList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
601 " <method name=\"GetAttributeRun\">\n"
602 " <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
603 " <arg direction=\"in\" type=\"b\" name=\"includeDefaults\"/>\n"
604 " <arg direction=\"out\" type=\"a{ss}\"/>\n"
605 " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
606 " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
607 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
609 " <method name=\"GetDefaultAttributeSet\">\n"
610 " <arg direction=\"out\" type=\"a{ss}\"/>\n"
611 " <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
613 " <method name=\"ScrollSubstringTo\">\n"
614 " <arg direction=\"in\" name=\"startOffset\" type=\"i\"/>\n"
615 " <arg direction=\"in\" name=\"endOffset\" type=\"i\"/>\n"
616 " <arg direction=\"in\" name=\"type\" type=\"u\"/>\n"
617 " <arg direction=\"out\" type=\"b\"/>\n"
623 " <interface name=\"org.a11y.atspi.Value\">\n"
624 " <property access=\"read\" type=\"d\" name=\"MinimumValue\"/>\n"
625 " <property access=\"read\" type=\"d\" name=\"MaximumValue\"/>\n"
626 " <property access=\"read\" type=\"d\" name=\"MinimumIncrement\"/>\n"
627 " <property access=\"readwrite\" type=\"d\" name=\"CurrentValue\"/>\n"
628 " <method name=\"SetCurrentValue\">\n"
629 " <arg direction=\"in\" type=\"d\" name=\"value\"/>\n"
634 QAccessibleInterface *
interface = interfaceFromPath(path);
636 qCWarning(lcAccessibilityAtspi) <<
"Could not find accessible on path:" <<
path;
643 xml.append(accessibleIntrospection);
646 xml.append(componentIntrospection);
648 xml.append(textIntrospection);
650 xml.append(editableTextIntrospection);
652 xml.append(actionIntrospection);
654 xml.append(selectionIntrospection);
656 xml.append(tableIntrospection);
657 if (interfaces.contains(ATSPI_DBUS_INTERFACE_TABLE_CELL
""_L1))
658 xml.append(tableCellIntrospection);
660 xml.append(valueIntrospection);
662 xml.append(applicationIntrospection);
667void AtSpiAdaptor::setBitFlag(
const QString &flag)
674 if (flag.
size() <= 8) {
679 }
else if (
right.startsWith(
"ActiveDescendantChanged"_L1)) {
680 sendObject_active_descendant_changed = 1;
681 }
else if (
right.startsWith(
"AttributesChanged"_L1)) {
682 sendObject_attributes_changed = 1;
683 }
else if (
right.startsWith(
"BoundsChanged"_L1)) {
684 sendObject_bounds_changed = 1;
685 }
else if (
right.startsWith(
"ChildrenChanged"_L1)) {
686 sendObject_children_changed = 1;
687 }
else if (
right.startsWith(
"ColumnDeleted"_L1)) {
688 sendObject_column_deleted = 1;
689 }
else if (
right.startsWith(
"ColumnInserted"_L1)) {
690 sendObject_column_inserted = 1;
691 }
else if (
right.startsWith(
"ColumnReordered"_L1)) {
692 sendObject_column_reordered = 1;
693 }
else if (
right.startsWith(
"LinkSelected"_L1)) {
694 sendObject_link_selected = 1;
695 }
else if (
right.startsWith(
"ModelChanged"_L1)) {
696 sendObject_model_changed = 1;
697 }
else if (
right.startsWith(
"PropertyChange"_L1)) {
698 if (
right ==
"PropertyChange:AccessibleDescription"_L1) {
699 sendObject_property_change_accessible_description = 1;
700 }
else if (
right ==
"PropertyChange:AccessibleName"_L1) {
701 sendObject_property_change_accessible_name = 1;
702 }
else if (
right ==
"PropertyChange:AccessibleParent"_L1) {
703 sendObject_property_change_accessible_parent = 1;
704 }
else if (
right ==
"PropertyChange:AccessibleRole"_L1) {
705 sendObject_property_change_accessible_role = 1;
706 }
else if (
right ==
"PropertyChange:TableCaption"_L1) {
707 sendObject_property_change_accessible_table_caption = 1;
708 }
else if (
right ==
"PropertyChange:TableColumnDescription"_L1) {
709 sendObject_property_change_accessible_table_column_description = 1;
710 }
else if (
right ==
"PropertyChange:TableColumnHeader"_L1) {
711 sendObject_property_change_accessible_table_column_header = 1;
712 }
else if (
right ==
"PropertyChange:TableRowDescription"_L1) {
713 sendObject_property_change_accessible_table_row_description = 1;
714 }
else if (
right ==
"PropertyChange:TableRowHeader"_L1) {
715 sendObject_property_change_accessible_table_row_header = 1;
716 }
else if (
right ==
"PropertyChange:TableSummary"_L1) {
717 sendObject_property_change_accessible_table_summary = 1;
718 }
else if (
right ==
"PropertyChange:AccessibleValue"_L1) {
719 sendObject_property_change_accessible_value = 1;
721 sendObject_property_change = 1;
723 }
else if (
right.startsWith(
"RowDeleted"_L1)) {
724 sendObject_row_deleted = 1;
725 }
else if (
right.startsWith(
"RowInserted"_L1)) {
726 sendObject_row_inserted = 1;
727 }
else if (
right.startsWith(
"RowReordered"_L1)) {
728 sendObject_row_reordered = 1;
729 }
else if (
right.startsWith(
"SelectionChanged"_L1)) {
730 sendObject_selection_changed = 1;
731 }
else if (
right.startsWith(
"StateChanged"_L1)) {
732 sendObject_state_changed = 1;
733 }
else if (
right.startsWith(
"TextAttributesChanged"_L1)) {
734 sendObject_text_attributes_changed = 1;
735 }
else if (
right.startsWith(
"TextBoundsChanged"_L1)) {
736 sendObject_text_bounds_changed = 1;
737 }
else if (
right.startsWith(
"TextCaretMoved"_L1)) {
738 sendObject_text_caret_moved = 1;
739 }
else if (
right.startsWith(
"TextChanged"_L1)) {
740 sendObject_text_changed = 1;
741 }
else if (
right.startsWith(
"TextSelectionChanged"_L1)) {
742 sendObject_text_selection_changed = 1;
743 }
else if (
right.startsWith(
"ValueChanged"_L1)) {
744 sendObject_value_changed = 1;
745 }
else if (
right.startsWith(
"VisibleDataChanged"_L1)
746 ||
right.startsWith(
"VisibledataChanged"_L1)) {
747 sendObject_visible_data_changed = 1;
749 qCWarning(lcAccessibilityAtspi) <<
"Subscription string not handled:" << flag;
755 if (flag.
size() <= 8) {
760 }
else if (
right.startsWith(
"Activate"_L1)) {
761 sendWindow_activate = 1;
762 }
else if (
right.startsWith(
"Close"_L1)) {
764 }
else if (
right.startsWith(
"Create"_L1)) {
765 sendWindow_create = 1;
766 }
else if (
right.startsWith(
"Deactivate"_L1)) {
767 sendWindow_deactivate = 1;
768 }
else if (
right.startsWith(
"Lower"_L1)) {
769 sendWindow_lower = 1;
770 }
else if (
right.startsWith(
"Maximize"_L1)) {
771 sendWindow_maximize = 1;
772 }
else if (
right.startsWith(
"Minimize"_L1)) {
773 sendWindow_minimize = 1;
774 }
else if (
right.startsWith(
"Move"_L1)) {
776 }
else if (
right.startsWith(
"Raise"_L1)) {
777 sendWindow_raise = 1;
778 }
else if (
right.startsWith(
"Reparent"_L1)) {
779 sendWindow_reparent = 1;
780 }
else if (
right.startsWith(
"Resize"_L1)) {
781 sendWindow_resize = 1;
782 }
else if (
right.startsWith(
"Restore"_L1)) {
783 sendWindow_restore = 1;
784 }
else if (
right.startsWith(
"Restyle"_L1)) {
785 sendWindow_restyle = 1;
786 }
else if (
right.startsWith(
"Shade"_L1)) {
787 sendWindow_shade = 1;
788 }
else if (
right.startsWith(
"Unshade"_L1)) {
789 sendWindow_unshade = 1;
790 }
else if (
right.startsWith(
"DesktopCreate"_L1)) {
792 }
else if (
right.startsWith(
"DesktopDestroy"_L1)) {
795 qCWarning(lcAccessibilityAtspi) <<
"Subscription string not handled:" << flag;
814 qCWarning(lcAccessibilityAtspi) <<
"Subscription string not handled:" << flag;
821void AtSpiAdaptor::updateEventListeners()
824 "/org/a11y/atspi/registry"_L1,
825 "org.a11y.atspi.Registry"_L1,
"GetRegisteredEvents"_L1);
827 if (listenersReply.
isValid()) {
830 setBitFlag(ev.eventName);
833 qCDebug(lcAccessibilityAtspi) <<
"Could not query active accessibility event listeners.";
840 updateEventListeners();
846 updateEventListeners();
855 if (!(sendWindow || sendWindow_activate))
858 QAccessibleInterface *
iface = QAccessible::queryAccessibleInterface(
window);
860 if (iface ==
nullptr)
866 if (
iface->isValid())
874 QString status = active ?
"Activate"_L1 :
"Deactivate"_L1;
878 QVariantList stateArgs = packDBusSignalArguments(
"active"_L1, active ? 1 : 0, 0, variantForPath(
path));
904QAccessibleInterface *AtSpiAdaptor::interfaceFromPath(
const QString& dbusPath)
const
907 return QAccessible::queryAccessibleInterface(
qApp);
910 if (parts.size() != 6) {
915 QString objectString = parts.at(5);
916 QAccessible::Id
id = objectString.
toUInt();
920 qCWarning(lcAccessibilityAtspi) <<
"No accessible object found for id: " <<
id;
922 return QAccessible::accessibleInterface(
id);
938 switch (
event->type()) {
939 case QAccessible::ObjectCreated:
940 if (sendObject || sendObject_children_changed)
941 notifyAboutCreation(
event->accessibleInterface());
943 case QAccessible::ObjectShow: {
944 if (sendObject || sendObject_state_changed) {
945 notifyStateChange(
event->accessibleInterface(),
"showing"_L1, 1);
949 case QAccessible::ObjectHide: {
950 if (sendObject || sendObject_state_changed) {
951 notifyStateChange(
event->accessibleInterface(),
"showing"_L1, 0);
955 case QAccessible::ObjectDestroyed: {
956 if (sendObject || sendObject_state_changed)
957 notifyAboutDestruction(
event->accessibleInterface());
960 case QAccessible::ObjectReorder: {
961 if (sendObject || sendObject_children_changed)
962 childrenChanged(
event->accessibleInterface());
965 case QAccessible::NameChanged: {
966 if (sendObject || sendObject_property_change || sendObject_property_change_accessible_name) {
967 QAccessibleInterface *
iface =
event->accessibleInterface();
970 "NameChanged event from invalid accessible.");
976 "accessible-name"_L1, 0, 0,
979 "PropertyChange"_L1,
args);
983 case QAccessible::DescriptionChanged: {
984 if (sendObject || sendObject_property_change || sendObject_property_change_accessible_description) {
985 QAccessibleInterface *
iface =
event->accessibleInterface();
988 "DescriptionChanged event from invalid accessible.");
994 "accessible-description"_L1, 0, 0,
997 "PropertyChange"_L1,
args);
1001 case QAccessible::Focus: {
1002 if (sendFocus || sendObject || sendObject_state_changed)
1003 sendFocusChanged(
event->accessibleInterface());
1006 case QAccessible::TextInserted:
1007 case QAccessible::TextRemoved:
1008 case QAccessible::TextUpdated: {
1009 if (sendObject || sendObject_text_changed) {
1010 QAccessibleInterface *
iface =
event->accessibleInterface();
1011 if (!iface || !
iface->textInterface()) {
1012 qCWarning(lcAccessibilityAtspi) <<
"Received text event for invalid interface.";
1017 int changePosition = 0;
1018 int cursorPosition = 0;
1022 if (
event->type() == QAccessible::TextInserted) {
1023 QAccessibleTextInsertEvent *textEvent =
static_cast<QAccessibleTextInsertEvent*
>(
event);
1024 textInserted = textEvent->textInserted();
1025 changePosition = textEvent->changePosition();
1026 cursorPosition = textEvent->cursorPosition();
1027 }
else if (
event->type() == QAccessible::TextRemoved) {
1028 QAccessibleTextRemoveEvent *textEvent =
static_cast<QAccessibleTextRemoveEvent*
>(
event);
1029 textRemoved = textEvent->textRemoved();
1030 changePosition = textEvent->changePosition();
1031 cursorPosition = textEvent->cursorPosition();
1032 }
else if (
event->type() == QAccessible::TextUpdated) {
1033 QAccessibleTextUpdateEvent *textEvent =
static_cast<QAccessibleTextUpdateEvent*
>(
event);
1034 textInserted = textEvent->textInserted();
1035 textRemoved = textEvent->textRemoved();
1036 changePosition = textEvent->changePosition();
1037 cursorPosition = textEvent->cursorPosition();
1046 "TextChanged"_L1,
args);
1049 if (!textInserted.
isEmpty()) {
1053 "TextChanged"_L1,
args);
1066 case QAccessible::TextCaretMoved: {
1067 if (sendObject || sendObject_text_caret_moved) {
1068 QAccessibleInterface *
iface =
event->accessibleInterface();
1069 if (!iface || !
iface->textInterface()) {
1070 qCWarning(lcAccessibilityAtspi) <<
"Sending TextCaretMoved from object that does not implement text interface: " <<
iface;
1076 int pos =
iface->textInterface()->cursorPosition();
1080 "TextCaretMoved"_L1,
args);
1084 case QAccessible::TextSelectionChanged: {
1085 if (sendObject || sendObject_text_selection_changed) {
1086 QAccessibleInterface *
iface =
event->accessibleInterface();
1090 "TextSelectionChanged"_L1,
args);
1094 case QAccessible::ValueChanged: {
1095 if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) {
1096 QAccessibleInterface *
iface =
event->accessibleInterface();
1098 qCWarning(lcAccessibilityAtspi) <<
"ValueChanged event from invalid accessible.";
1101 if (
iface->valueInterface()) {
1103 QVariantList args = packDBusSignalArguments(
"accessible-value"_L1, 0, 0, variantForPath(
path));
1105 "PropertyChange"_L1,
args);
1106 }
else if (
iface->role() == QAccessible::ComboBox) {
1111 "accessible-name"_L1, 0, 0,
1114 "PropertyChange"_L1, args1);
1117 "SelectionChanged"_L1, args2);
1119 qCWarning(lcAccessibilityAtspi) <<
"ValueChanged event and no ValueInterface or ComboBox: " <<
iface;
1124 case QAccessible::SelectionAdd:
1125 case QAccessible::SelectionRemove:
1126 case QAccessible::Selection: {
1127 QAccessibleInterface *
iface =
event->accessibleInterface();
1129 qCWarning(lcAccessibilityAtspi) <<
"Selection event from invalid accessible.";
1134 int selected =
iface->state().selected ? 1 : 0;
1135 QVariantList stateArgs = packDBusSignalArguments(
"selected"_L1, selected, 0, variantForPath(
path));
1141 qCDebug(lcAccessibilityAtspi) <<
"No valid parent in selection event.";
1151 case QAccessible::SelectionWithin: {
1152 QAccessibleInterface *
iface =
event->accessibleInterface();
1154 qCWarning(lcAccessibilityAtspi) <<
"SelectionWithin event from invalid accessible.";
1163 case QAccessible::StateChanged: {
1164 if (sendObject || sendObject_state_changed || sendWindow || sendWindow_activate) {
1166 if (stateChange.checked) {
1167 QAccessibleInterface *
iface =
event->accessibleInterface();
1169 qCWarning(lcAccessibilityAtspi) <<
"StateChanged event from invalid accessible.";
1172 int checked =
iface->state().checked;
1173 notifyStateChange(iface,
"checked"_L1, checked);
1174 }
else if (stateChange.active) {
1175 QAccessibleInterface *
iface =
event->accessibleInterface();
1176 if (!iface || !(
iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate)))
1186 notifyStateChange(iface,
"active"_L1,
isActive);
1187 }
else if (stateChange.disabled) {
1188 QAccessibleInterface *
iface =
event->accessibleInterface();
1192 notifyStateChange(iface,
"enabled"_L1,
enabled);
1193 notifyStateChange(iface,
"sensitive"_L1,
enabled);
1194 }
else if (stateChange.focused) {
1195 QAccessibleInterface *
iface =
event->accessibleInterface();
1197 bool focused =
state.focused;
1198 notifyStateChange(iface,
"focused"_L1, focused);
1203 case QAccessible::TableModelChanged: {
1204 QAccessibleInterface *
interface =
event->accessibleInterface();
1206 qCWarning(lcAccessibilityAtspi) <<
"TableModelChanged event from invalid accessible.";
1211 QAccessibleTableModelChangeEvent *tableModelEvent =
static_cast<QAccessibleTableModelChangeEvent*
>(
event);
1212 switch (tableModelEvent->modelChangeType()) {
1213 case QAccessibleTableModelChangeEvent::ColumnsInserted: {
1214 if (sendObject || sendObject_column_inserted) {
1215 const int firstColumn = tableModelEvent->firstColumn();
1216 const int insertedColumnCount = tableModelEvent->lastColumn() - firstColumn + 1;
1222 case QAccessibleTableModelChangeEvent::ColumnsRemoved: {
1223 if (sendObject || sendObject_column_deleted) {
1224 const int firstColumn = tableModelEvent->firstColumn();
1225 const int removedColumnCount = tableModelEvent->lastColumn() - firstColumn + 1;
1231 case QAccessibleTableModelChangeEvent::RowsInserted: {
1232 if (sendObject || sendObject_row_inserted) {
1233 const int firstRow = tableModelEvent->firstRow();
1234 const int insertedRowCount = tableModelEvent->lastRow() - firstRow + 1;
1240 case QAccessibleTableModelChangeEvent::RowsRemoved: {
1241 if (sendObject || sendObject_row_deleted) {
1242 const int firstRow = tableModelEvent->firstRow();
1243 const int removedRowCount = tableModelEvent->lastRow() - firstRow + 1;
1249 case QAccessibleTableModelChangeEvent::ModelChangeType::ModelReset: {
1250 if (sendObject || sendObject_model_changed) {
1256 case QAccessibleTableModelChangeEvent::DataChanged: {
1257 if (sendObject || sendObject_visible_data_changed) {
1268 case QAccessible::ParentChanged:
1269 case QAccessible::DialogStart:
1270 case QAccessible::DialogEnd:
1271 case QAccessible::PopupMenuStart:
1272 case QAccessible::PopupMenuEnd:
1273 case QAccessible::SoundPlayed:
1274 case QAccessible::Alert:
1275 case QAccessible::ForegroundChanged:
1276 case QAccessible::MenuStart:
1277 case QAccessible::MenuEnd:
1278 case QAccessible::ContextHelpStart:
1279 case QAccessible::ContextHelpEnd:
1280 case QAccessible::DragDropStart:
1281 case QAccessible::DragDropEnd:
1282 case QAccessible::ScrollingStart:
1283 case QAccessible::ScrollingEnd:
1284 case QAccessible::MenuCommand:
1285 case QAccessible::ActionChanged:
1286 case QAccessible::ActiveDescendantChanged:
1287 case QAccessible::AttributeChanged:
1288 case QAccessible::DocumentContentChanged:
1289 case QAccessible::DocumentLoadComplete:
1290 case QAccessible::DocumentLoadStopped:
1291 case QAccessible::DocumentReload:
1292 case QAccessible::HyperlinkEndIndexChanged:
1293 case QAccessible::HyperlinkNumberOfAnchorsChanged:
1294 case QAccessible::HyperlinkSelectedLinkChanged:
1295 case QAccessible::HypertextLinkActivated:
1296 case QAccessible::HypertextLinkSelected:
1297 case QAccessible::HyperlinkStartIndexChanged:
1298 case QAccessible::HypertextChanged:
1299 case QAccessible::HypertextNLinksChanged:
1300 case QAccessible::ObjectAttributeChanged:
1301 case QAccessible::PageChanged:
1302 case QAccessible::SectionChanged:
1303 case QAccessible::TableCaptionChanged:
1304 case QAccessible::TableColumnDescriptionChanged:
1305 case QAccessible::TableColumnHeaderChanged:
1306 case QAccessible::TableRowDescriptionChanged:
1307 case QAccessible::TableRowHeaderChanged:
1308 case QAccessible::TableSummaryChanged:
1309 case QAccessible::TextAttributeChanged:
1310 case QAccessible::TextColumnChanged:
1311 case QAccessible::VisibleDataChanged:
1312 case QAccessible::LocationChanged:
1313 case QAccessible::HelpChanged:
1314 case QAccessible::DefaultActionChanged:
1315 case QAccessible::AcceleratorChanged:
1316 case QAccessible::InvalidEvent:
1321void AtSpiAdaptor::sendFocusChanged(QAccessibleInterface *
interface)
const
1325 if (!lastFocusPath.
isEmpty()) {
1326 QVariantList stateArgs = packDBusSignalArguments(
"focused"_L1, 0, 0, variantForPath(lastFocusPath));
1328 "StateChanged"_L1, stateArgs);
1334 QVariantList stateArgs = packDBusSignalArguments(
"focused"_L1, 1, 0, variantForPath(
path));
1336 "StateChanged"_L1, stateArgs);
1340 lastFocusPath =
path;
1344void AtSpiAdaptor::childrenChanged(QAccessibleInterface *
interface)
const
1347 int childCount =
interface->childCount();
1350 QVariantList args = packDBusSignalArguments(
"add"_L1, childCount, 0, childPath);
1355void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *
interface)
const
1360 qCDebug(lcAccessibilityAtspi) <<
"AtSpiAdaptor::notifyAboutCreation: Could not find parent for " <<
interface->object();
1364 int childCount =
parent->childCount();
1370void AtSpiAdaptor::notifyAboutDestruction(QAccessibleInterface *
interface)
const
1377 qCDebug(lcAccessibilityAtspi) <<
"AtSpiAdaptor::notifyAboutDestruction: Could not find parent for " <<
interface->object();
1384 int childIndex = -1;
1403 QAccessibleInterface * accessible = interfaceFromPath(
message.path());
1405 qCWarning(lcAccessibilityAtspi) <<
"Could not find accessible on path:" <<
message.path();
1408 if (!accessible->isValid()) {
1409 qCWarning(lcAccessibilityAtspi) <<
"Accessible invalid:" << accessible <<
message.path();
1413 QString interface = message.interface();
1418 if (function ==
"Introspect"_L1) {
1424 if (
interface ==
"org.freedesktop.DBus.Properties"_L1) {
1425 interface = message.arguments().
at(0).
toString();
1449 if (
interface == ATSPI_DBUS_INTERFACE_TABLE_CELL
""_L1)
1452 qCDebug(lcAccessibilityAtspi) <<
"AtSpiAdaptor::handleMessage with unknown interface: " <<
message.path() <<
interface <<
function;
1464 if (function ==
"SetId"_L1) {
1468 m_applicationId =
value.toInt();
1471 if (function ==
"GetId"_L1) {
1476 if (function ==
"GetToolkitName"_L1) {
1481 if (function ==
"GetVersion"_L1) {
1486 if (function ==
"GetLocale"_L1) {
1491 qCDebug(lcAccessibilityAtspi) <<
"AtSpiAdaptor::applicationInterface " <<
message.path() <<
interface <<
function;
1500 OrgA11yAtspiSocketInterface *registry;
1507 reply.waitForFinished();
1508 if (
reply.isValid ()) {
1512 qCWarning(lcAccessibilityAtspi) <<
"Error in contacting registry:"
1520QString accessibleIdForAccessible(QAccessibleInterface *accessible)
1523 while (accessible) {
1526 if (
auto obj = accessible->object()) {
1528 if (!
name.isEmpty())
1533 accessible = accessible->parent();
1542 if (function ==
"GetRole"_L1) {
1544 }
else if (function ==
"GetName"_L1) {
1546 }
else if (function ==
"GetRoleName"_L1) {
1548 }
else if (function ==
"GetLocalizedRoleName"_L1) {
1550 }
else if (function ==
"GetChildCount"_L1) {
1552 }
else if (function ==
"GetIndexInParent"_L1) {
1553 int childIndex = -1;
1557 if (childIndex < 0) {
1558 qCDebug(lcAccessibilityAtspi) <<
"GetIndexInParent get invalid index: " << childIndex <<
interface;
1562 }
else if (function ==
"GetParent"_L1) {
1566 path = ATSPI_DBUS_PATH_NULL
""_L1;
1567 }
else if (
parent->role() == QAccessible::Application) {
1575 }
else if (function ==
"GetChildAtIndex"_L1) {
1585 }
else if (function ==
"GetInterfaces"_L1) {
1587 }
else if (function ==
"GetDescription"_L1) {
1589 }
else if (function ==
"GetState"_L1) {
1597 QAccessible::Role role =
interface->role();
1598 if (role == QAccessible::TreeItem ||
1599 role == QAccessible::ListItem) {
1608 }
else if (function ==
"GetAttributes"_L1) {
1610 }
else if (function ==
"GetRelationSet"_L1) {
1612 }
else if (function ==
"GetApplication"_L1) {
1615 }
else if (function ==
"GetChildren"_L1) {
1617 const int numChildren =
interface->childCount();
1619 for (
int i = 0;
i < numChildren; ++
i) {
1625 }
else if (function ==
"GetAccessibleId"_L1) {
1629 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::accessibleInterface does not implement" <<
function <<
message.path();
1635AtspiRole AtSpiAdaptor::getRole(QAccessibleInterface *
interface)
const
1637 if ((
interface->role() == QAccessible::EditableText) &&
interface->state().passwordEdit)
1638 return ATSPI_ROLE_PASSWORD_TEXT;
1645 qCDebug(lcAccessibilityAtspiCreation) <<
"AtSpiAdaptor::accessibleInterfaces create: " <<
interface->object();
1650 (
interface->role() == QAccessible::ListItem) ||
1651 (
interface->role() == QAccessible::Cell) ||
1652 (
interface->role() == QAccessible::TreeItem) ||
1653 (
interface->role() == QAccessible::Row) ||
1658 qCDebug(lcAccessibilityAtspiCreation) <<
" IS NOT a component";
1660 if (
interface->role() == QAccessible::Application)
1682 ifaces << u
"" ATSPI_DBUS_INTERFACE_TABLE_CELL
""_s;
1693 for (
const RelationPair &pair : relationInterfaces) {
1718 if (inheritsQAction(
object)) {
1719 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::pathForObject: Creating path with QAction as object.";
1722 QAccessibleInterface *
iface = QAccessible::queryAccessibleInterface(
object);
1723 return pathForInterface(iface);
1726QString AtSpiAdaptor::pathForInterface(QAccessibleInterface *
interface)
const
1729 return u
"" ATSPI_DBUS_PATH_NULL
""_s;
1730 if (
interface->role() == QAccessible::Application)
1733 QAccessible::Id
id = QAccessible::uniqueId(
interface);
1738bool AtSpiAdaptor::inheritsQAction(
QObject *
object)
1743 if (cn ==
"QAction"_L1)
1745 mo =
mo->superClass();
1751static QAccessibleInterface * getWindow(QAccessibleInterface *
interface)
1753 if (
interface->role() == QAccessible::Dialog ||
interface->role() == QAccessible::Window)
1758 &&
parent->role() != QAccessible::Window)
1766 if (function ==
"Contains"_L1) {
1768 int x =
message.arguments().at(0).toInt();
1769 int y =
message.arguments().at(1).toInt();
1775 }
else if (function ==
"GetAccessibleAtPoint"_L1) {
1782 QAccessibleInterface * childInterface(
interface->childAt(screenPos.
x(), screenPos.
y()));
1783 QAccessibleInterface *
iface =
nullptr;
1784 while (childInterface) {
1785 iface = childInterface;
1786 childInterface =
iface->childAt(screenPos.
x(), screenPos.
y());
1796 }
else if (function ==
"GetAlpha"_L1) {
1798 }
else if (function ==
"GetExtents"_L1) {
1803 }
else if (function ==
"GetLayer"_L1) {
1805 }
else if (function ==
"GetMDIZOrder"_L1) {
1807 }
else if (function ==
"GetPosition"_L1) {
1815 }
else if (function ==
"GetSize"_L1) {
1820 }
else if (function ==
"GrabFocus"_L1) {
1821 QAccessibleActionInterface *actionIface =
interface->actionInterface();
1822 if (actionIface && actionIface->actionNames().contains(QAccessibleActionInterface::setFocusAction())) {
1823 actionIface->doAction(QAccessibleActionInterface::setFocusAction());
1828 }
else if (function ==
"SetExtents"_L1) {
1834 qCDebug(lcAccessibilityAtspi) <<
"SetExtents is not implemented.";
1836 }
else if (function ==
"SetPosition"_L1) {
1840 qCDebug(lcAccessibilityAtspi) <<
"SetPosition is not implemented.";
1842 }
else if (function ==
"SetSize"_L1) {
1845 qCDebug(lcAccessibilityAtspi) <<
"SetSize is not implemented.";
1848 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::componentInterface does not implement" <<
function <<
message.path();
1862 if (function ==
"GetNActions"_L1) {
1865 }
else if (function ==
"DoAction"_L1) {
1868 if (index < 0 || index >= actionNames.size())
1873 }
else if (function ==
"GetActions"_L1) {
1875 }
else if (function ==
"GetName"_L1) {
1878 if (index < 0 || index >= actionNames.size())
1881 }
else if (function ==
"GetDescription"_L1) {
1884 if (index < 0 || index >= actionNames.size())
1887 if (QAccessibleActionInterface *actionIface =
interface->actionInterface())
1888 description = actionIface->localizedActionDescription(actionNames.at(
index));
1890 description = qAccessibleLocalizedActionDescription(actionNames.at(
index));
1892 }
else if (function ==
"GetKeyBinding"_L1) {
1895 if (index < 0 || index >= actionNames.size())
1898 if (QAccessibleActionInterface *actionIface =
interface->actionInterface())
1899 keyBindings = actionIface->keyBindingsForAction(actionNames.at(
index));
1900 if (keyBindings.isEmpty()) {
1903 keyBindings.append(acc);
1905 if (keyBindings.size() > 0)
1910 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::actionInterface does not implement" <<
function <<
message.path();
1918 QAccessibleActionInterface *actionInterface =
interface->actionInterface();
1921 actions.
reserve(actionNames.size());
1922 for (
const QString &actionName : actionNames) {
1925 action.
name = actionName;
1926 if (actionInterface) {
1927 action.
description = actionInterface->localizedActionDescription(actionName);
1928 const QStringList keyBindings = actionInterface->keyBindingsForAction(actionName);
1929 if (!keyBindings.isEmpty())
1932 action.
description = qAccessibleLocalizedActionDescription(actionName);
1935 actions.
append(std::move(action));
1947 if (function ==
"GetCaretOffset"_L1) {
1949 }
else if (function ==
"GetCharacterCount"_L1) {
1953 }
else if (function ==
"AddSelection"_L1) {
1954 int startOffset =
message.arguments().at(0).toInt();
1955 int endOffset =
message.arguments().at(1).toInt();
1956 int lastSelection =
interface->textInterface()->selectionCount();
1957 interface->textInterface()->setSelection(lastSelection, startOffset, endOffset);
1959 }
else if (function ==
"GetAttributeRun"_L1) {
1961 bool includeDefaults =
message.arguments().at(1).toBool();
1964 }
else if (function ==
"GetAttributeValue"_L1) {
1968 }
else if (function ==
"GetAttributes"_L1) {
1971 }
else if (function ==
"GetBoundedRanges"_L1) {
1972 int x =
message.arguments().at(0).toInt();
1973 int y =
message.arguments().at(1).toInt();
1977 uint xClipType =
message.arguments().at(5).toUInt();
1978 uint yClipType =
message.arguments().at(6).toUInt();
1986 qCDebug(lcAccessibilityAtspi) <<
"Not implemented: QSpiAdaptor::GetBoundedRanges";
1988 }
else if (function ==
"GetCharacterAtOffset"_L1) {
1996 if (stringIt.hasNext())
1997 codePoint =
static_cast<int>(stringIt.peekNext());
1999 }
else if (function ==
"GetCharacterExtents"_L1) {
2003 }
else if (function ==
"GetDefaultAttributeSet"_L1 || function ==
"GetDefaultAttributes"_L1) {
2007 }
else if (function ==
"GetNSelections"_L1) {
2009 }
else if (function ==
"GetOffsetAtPoint"_L1) {
2019 }
else if (function ==
"GetRangeExtents"_L1) {
2020 int startOffset =
message.arguments().at(0).toInt();
2021 int endOffset =
message.arguments().at(1).toInt();
2024 }
else if (function ==
"GetSelection"_L1) {
2025 int selectionNum =
message.arguments().at(0).toInt();
2033 }
else if (function ==
"GetStringAtOffset"_L1) {
2035 uint granularity =
message.arguments().at(1).toUInt();
2036 if (!isValidAtspiTextGranularity(granularity))
2038 int startOffset, endOffset;
2039 QString text =
interface->textInterface()->textAtOffset(
offset, qAccessibleBoundaryTypeFromAtspiTextGranularity(granularity), &startOffset, &endOffset);
2041 ret <<
text << startOffset << endOffset;
2043 }
else if (function ==
"GetText"_L1) {
2044 int startOffset =
message.arguments().at(0).toInt();
2045 int endOffset =
message.arguments().at(1).toInt();
2046 if (endOffset == -1)
2047 endOffset =
interface->textInterface()->characterCount();
2049 }
else if (function ==
"GetTextAfterOffset"_L1) {
2052 int startOffset, endOffset;
2053 QString text =
interface->textInterface()->textAfterOffset(
offset, qAccessibleBoundaryTypeFromAtspiBoundaryType(
type), &startOffset, &endOffset);
2055 ret <<
text << startOffset << endOffset;
2057 }
else if (function ==
"GetTextAtOffset"_L1) {
2060 int startOffset, endOffset;
2063 ret <<
text << startOffset << endOffset;
2065 }
else if (function ==
"GetTextBeforeOffset"_L1) {
2068 int startOffset, endOffset;
2069 QString text =
interface->textInterface()->textBeforeOffset(
offset, qAccessibleBoundaryTypeFromAtspiBoundaryType(
type), &startOffset, &endOffset);
2071 ret <<
text << startOffset << endOffset;
2073 }
else if (function ==
"RemoveSelection"_L1) {
2074 int selectionNum =
message.arguments().at(0).toInt();
2075 interface->textInterface()->removeSelection(selectionNum);
2077 }
else if (function ==
"SetCaretOffset"_L1) {
2081 }
else if (function ==
"ScrollSubstringTo"_L1) {
2082 int startOffset =
message.arguments().at(0).toInt();
2083 int endOffset =
message.arguments().at(1).toInt();
2085 qCInfo(lcAccessibilityAtspi) <<
"AtSpiAdaptor::ScrollSubstringTo doesn'take take scroll type into account.";
2086 interface->textInterface()->scrollToSubstring(startOffset, endOffset);
2088 }
else if (function ==
"SetSelection"_L1) {
2089 int selectionNum =
message.arguments().at(0).toInt();
2090 int startOffset =
message.arguments().at(1).toInt();
2091 int endOffset =
message.arguments().at(2).toInt();
2092 interface->textInterface()->setSelection(selectionNum, startOffset, endOffset);
2101QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryTypeFromAtspiBoundaryType(
int atspiTextBoundaryType)
2103 switch (atspiTextBoundaryType) {
2104 case ATSPI_TEXT_BOUNDARY_CHAR:
2105 return QAccessible::CharBoundary;
2106 case ATSPI_TEXT_BOUNDARY_WORD_START:
2107 case ATSPI_TEXT_BOUNDARY_WORD_END:
2108 return QAccessible::WordBoundary;
2109 case ATSPI_TEXT_BOUNDARY_SENTENCE_START:
2110 case ATSPI_TEXT_BOUNDARY_SENTENCE_END:
2111 return QAccessible::SentenceBoundary;
2112 case ATSPI_TEXT_BOUNDARY_LINE_START:
2113 case ATSPI_TEXT_BOUNDARY_LINE_END:
2114 return QAccessible::LineBoundary;
2116 Q_ASSERT_X(0,
"",
"Requested invalid boundary type.");
2117 return QAccessible::CharBoundary;
2120bool AtSpiAdaptor::isValidAtspiTextGranularity(
uint atspiTextGranularity)
2122 if (atspiTextGranularity == ATSPI_TEXT_GRANULARITY_CHAR
2123 || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_WORD
2124 || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_SENTENCE
2125 || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_LINE
2126 || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_PARAGRAPH)
2129 qCWarning(lcAccessibilityAtspi) <<
"Unknown value" << atspiTextGranularity <<
"for AT-SPI text granularity type";
2133QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryTypeFromAtspiTextGranularity(
uint atspiTextGranularity)
2135 Q_ASSERT(isValidAtspiTextGranularity(atspiTextGranularity));
2137 switch (atspiTextGranularity) {
2138 case ATSPI_TEXT_GRANULARITY_CHAR:
2139 return QAccessible::CharBoundary;
2140 case ATSPI_TEXT_GRANULARITY_WORD:
2141 return QAccessible::WordBoundary;
2142 case ATSPI_TEXT_GRANULARITY_SENTENCE:
2143 return QAccessible::SentenceBoundary;
2144 case ATSPI_TEXT_GRANULARITY_LINE:
2145 return QAccessible::LineBoundary;
2146 case ATSPI_TEXT_GRANULARITY_PARAGRAPH:
2147 return QAccessible::ParagraphBoundary;
2149 return QAccessible::CharBoundary;
2154 struct AtSpiAttribute {
2164 return ia2Color.
mid(4, ia2Color.
size() - (4+1));
2170 return ia2Size.
left(ia2Size.
size() - 2);
2173 AtSpiAttribute atspiTextAttribute(
const QString &ia2Name,
const QString &ia2Value)
2185 if (ia2Name ==
"background-color"_L1) {
2188 }
else if (ia2Name ==
"font-family"_L1) {
2190 }
else if (ia2Name ==
"color"_L1) {
2193 }
else if (ia2Name ==
"text-align"_L1) {
2195 if (
value ==
"justify"_L1) {
2197 }
else if (
value !=
"left"_L1 &&
value !=
"right"_L1 &&
value !=
"center"_L1) {
2198 qCDebug(lcAccessibilityAtspi) <<
"Unknown text-align attribute value \""
2199 <<
value <<
"\" cannot be translated to AT-SPI.";
2202 }
else if (ia2Name ==
"font-size"_L1) {
2205 }
else if (ia2Name ==
"font-style"_L1) {
2207 if (
value !=
"normal"_L1 &&
value !=
"italic"_L1 &&
value !=
"oblique"_L1) {
2208 qCDebug(lcAccessibilityAtspi) <<
"Unknown font-style attribute value \"" <<
value
2209 <<
"\" cannot be translated to AT-SPI.";
2212 }
else if (ia2Name ==
"text-underline-type"_L1) {
2214 if (
value !=
"none"_L1 &&
value !=
"single"_L1 &&
value !=
"double"_L1) {
2215 qCDebug(lcAccessibilityAtspi) <<
"Unknown text-underline-type attribute value \""
2216 <<
value <<
"\" cannot be translated to AT-SPI.";
2219 }
else if (ia2Name ==
"font-weight"_L1) {
2221 if (
value ==
"normal"_L1)
2226 }
else if (ia2Name ==
"text-position"_L1) {
2228 if (
value !=
"baseline"_L1 &&
value !=
"super"_L1 &&
value !=
"sub"_L1) {
2229 qCDebug(lcAccessibilityAtspi) <<
"Unknown text-position attribute value \"" <<
value
2230 <<
"\" cannot be translated to AT-SPI.";
2233 }
else if (ia2Name ==
"writing-mode"_L1) {
2235 if (
value ==
"lr"_L1)
2237 else if (
value ==
"rl"_L1)
2239 else if (
value ==
"tb"_L1) {
2242 qCDebug(lcAccessibilityAtspi) <<
"writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored";
2244 qCDebug(lcAccessibilityAtspi) <<
"Unknown writing-mode attribute value \"" <<
value
2245 <<
"\" cannot be translated to AT-SPI.";
2248 }
else if (ia2Name ==
"language"_L1) {
2250 }
else if (ia2Name ==
"invalid"_L1) {
2272 for (
const QString &attr : attributes) {
2293 joined =
interface->textInterface()->attributes(
offset, &startOffset, &endOffset);
2295 for (
const QString& attr : attributes) {
2302 return map[attributeName];
2315 if (endOffset == -1)
2316 endOffset =
interface->textInterface()->characterCount();
2318 QAccessibleTextInterface *textInterface =
interface->textInterface();
2319 if (endOffset <= startOffset || !textInterface)
2322 QRect rect = textInterface->characterRect(startOffset);
2323 for (
int i=startOffset + 1;
i <= endOffset;
i++)
2324 rect =
rect | textInterface->characterRect(
i);
2335 qCWarning(lcAccessibilityAtspi) <<
"Unknown value" <<
coordType <<
"for AT-SPI coord type";
2339QRect AtSpiAdaptor::translateFromScreenCoordinates(QAccessibleInterface *
interface,
const QRect &screenRect,
uint targetCoordType)
2341 Q_ASSERT(isValidCoordType(targetCoordType));
2343 QAccessibleInterface *upper =
nullptr;
2344 if (targetCoordType == ATSPI_COORD_TYPE_WINDOW)
2346 else if (targetCoordType == ATSPI_COORD_TYPE_PARENT)
2351 rect.translate(-upper->rect().x(), -upper->rect().y());
2358 Q_ASSERT(isValidCoordType(fromCoordType));
2360 QAccessibleInterface *upper =
nullptr;
2361 if (fromCoordType == ATSPI_COORD_TYPE_WINDOW)
2363 else if (fromCoordType == ATSPI_COORD_TYPE_PARENT)
2368 screenPos += upper->rect().topLeft();
2374static QString textForRange(QAccessibleInterface *accessible,
int startOffset,
int endOffset)
2376 if (QAccessibleTextInterface *textIface = accessible->textInterface()) {
2377 if (endOffset == -1)
2378 endOffset = textIface->characterCount();
2379 return textIface->text(startOffset, endOffset);
2381 QString txt = accessible->text(QAccessible::Value);
2382 if (endOffset == -1)
2383 endOffset =
txt.size();
2384 return txt.mid(startOffset, endOffset - startOffset);
2387static void replaceTextFallback(QAccessibleInterface *accessible,
long startOffset,
long endOffset,
const QString &
txt)
2389 QString t = textForRange(accessible, 0, -1);
2390 if (endOffset == -1)
2391 endOffset =
t.size();
2392 if (endOffset - startOffset == 0)
2393 t.insert(startOffset,
txt);
2395 t.replace(startOffset, endOffset - startOffset,
txt);
2396 accessible->setText(QAccessible::Value,
t);
2401 if (function ==
"CopyText"_L1) {
2402#ifndef QT_NO_CLIPBOARD
2403 int startOffset =
message.arguments().at(0).toInt();
2404 int endOffset =
message.arguments().at(1).toInt();
2409 }
else if (function ==
"CutText"_L1) {
2410#ifndef QT_NO_CLIPBOARD
2411 int startOffset =
message.arguments().at(0).toInt();
2412 int endOffset =
message.arguments().at(1).toInt();
2414 if (QAccessibleEditableTextInterface *editableTextIface =
interface->editableTextInterface())
2415 editableTextIface->deleteText(startOffset, endOffset);
2421 }
else if (function ==
"DeleteText"_L1) {
2422 int startOffset =
message.arguments().at(0).toInt();
2423 int endOffset =
message.arguments().at(1).toInt();
2424 if (QAccessibleEditableTextInterface *editableTextIface =
interface->editableTextInterface())
2425 editableTextIface->deleteText(startOffset, endOffset);
2429 }
else if (function ==
"InsertText"_L1) {
2434 if (QAccessibleEditableTextInterface *editableTextIface =
interface->editableTextInterface())
2439 }
else if (function ==
"PasteText"_L1) {
2440#ifndef QT_NO_CLIPBOARD
2443 if (QAccessibleEditableTextInterface *editableTextIface =
interface->editableTextInterface())
2449 }
else if (function ==
"SetTextContents"_L1) {
2451 if (QAccessibleEditableTextInterface *editableTextIface =
interface->editableTextInterface())
2452 editableTextIface->replaceText(0,
interface->textInterface()->characterCount(), newContents);
2454 replaceTextFallback(
interface, 0, -1, newContents);
2459 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::editableTextInterface does not implement" <<
function <<
message.path();
2468 QAccessibleValueInterface *valueIface =
interface->valueInterface();
2472 if (function ==
"SetCurrentValue"_L1) {
2474 double value =
v.variant().toDouble();
2477 valueIface->setCurrentValue(
value);
2481 if (function ==
"GetCurrentValue"_L1)
2482 value = valueIface->currentValue();
2483 else if (function ==
"GetMaximumValue"_L1)
2484 value = valueIface->maximumValue();
2485 else if (function ==
"GetMinimumIncrement"_L1)
2486 value = valueIface->minimumStepSize();
2487 else if (function ==
"GetMinimumValue"_L1)
2488 value = valueIface->minimumValue();
2490 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::valueInterface does not implement" <<
function <<
message.path();
2493 if (!
value.canConvert<
double>()) {
2494 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::valueInterface: Could not convert to double:" <<
function;
2508 QAccessibleSelectionInterface* selectionInterface =
interface->selectionInterface();
2509 if (!selectionInterface) {
2514 if (function ==
"ClearSelection"_L1 ) {
2516 }
else if (function ==
"DeselectChild"_L1 ) {
2517 int childIndex =
message.arguments().at(0).toInt();
2521 ret = selectionInterface->unselect(
child);
2523 }
else if (function ==
"DeselectSelectedChild"_L1 ) {
2524 int selectionIndex =
message.arguments().at(0).toInt();
2526 QAccessibleInterface *selectedChild = selectionInterface->selectedItem(selectionIndex);
2528 ret = selectionInterface->unselect(selectedChild);
2530 }
else if (function ==
"GetNSelectedChildren"_L1) {
2533 }
else if (function ==
"GetSelectedChild"_L1) {
2534 int selectionIndex =
message.arguments().at(0).toInt();
2537 }
else if (function ==
"IsChildSelected"_L1 ) {
2538 int childIndex =
message.arguments().at(0).toInt();
2542 ret = selectionInterface->isSelected(
child);
2544 }
else if (function ==
"SelectAll"_L1 ) {
2546 }
else if (function ==
"SelectChild"_L1 ) {
2547 int childIndex =
message.arguments().at(0).toInt();
2551 ret = selectionInterface->select(
child);
2554 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::selectionInterface does not implement " <<
function <<
message.path();
2566 qCWarning(lcAccessibilityAtspi) <<
"Qt AtSpiAdaptor: Could not find table interface for:" <<
message.path() <<
interface;
2570 if (function ==
"GetCaption"_L1) {
2571 QAccessibleInterface * captionInterface=
interface->tableInterface()->caption();
2572 if (captionInterface) {
2579 }
else if (function ==
"GetNColumns"_L1) {
2582 }
else if (function ==
"GetNRows"_L1) {
2585 }
else if (function ==
"GetNSelectedColumns"_L1) {
2588 }
else if (function ==
"GetNSelectedRows"_L1) {
2591 }
else if (function ==
"GetSummary"_L1) {
2592 QAccessibleInterface *summary =
interface->tableInterface() ?
interface->tableInterface()->summary() :
nullptr;
2595 }
else if (function ==
"GetAccessibleAt"_L1) {
2602 qCWarning(lcAccessibilityAtspi) <<
"Invalid index for tableInterface GetAccessibleAt (" <<
row <<
"," <<
column <<
')';
2616 }
else if (function ==
"GetIndexAt"_L1) {
2625 qCDebug(lcAccessibilityAtspi) <<
"QSpiAdaptor::GetIndexAt row:" <<
row <<
" col:" <<
column <<
" logical index:" <<
index;
2628 }
else if ((function ==
"GetColumnAtIndex"_L1) || (function ==
"GetRowAtIndex"_L1)) {
2634 if (function ==
"GetColumnAtIndex"_L1) {
2635 if (cell->role() == QAccessible::ColumnHeader) {
2637 }
else if (cell->role() == QAccessible::RowHeader) {
2640 if (!cell->tableCellInterface()) {
2641 qCWarning(lcAccessibilityAtspi).nospace() <<
"AtSpiAdaptor::" <<
function <<
" No table cell interface: " << cell;
2644 ret = cell->tableCellInterface()->columnIndex();
2647 if (cell->role() == QAccessible::ColumnHeader) {
2649 }
else if (cell->role() == QAccessible::RowHeader) {
2652 if (!cell->tableCellInterface()) {
2653 qCWarning(lcAccessibilityAtspi).nospace() <<
"AtSpiAdaptor::" <<
function <<
" No table cell interface: " << cell;
2656 ret = cell->tableCellInterface()->rowIndex();
2666 }
else if (function ==
"GetColumnDescription"_L1) {
2669 }
else if (function ==
"GetRowDescription"_L1) {
2675 }
else if (function ==
"GetRowColumnExtentsAtIndex"_L1) {
2677 bool success =
false;
2681 int rowExtents = -1;
2682 int colExtents = -1;
2683 bool isSelected =
false;
2685 int cols =
interface->tableInterface()->columnCount();
2689 QAccessibleTableCellInterface *cell =
interface->tableInterface()->cellAt(
row, col)->tableCellInterface();
2691 row = cell->rowIndex();
2692 col = cell->columnIndex();
2693 rowExtents = cell->rowExtent();
2694 colExtents = cell->columnExtent();
2695 isSelected = cell->isSelected();
2700 list << success <<
row << col << rowExtents << colExtents << isSelected;
2703 }
else if (function ==
"GetColumnExtentAt"_L1) {
2708 }
else if (function ==
"GetRowExtentAt"_L1) {
2713 }
else if (function ==
"GetColumnHeader"_L1) {
2717 QAccessibleInterface * cell(
interface->tableInterface()->cellAt(0,
column));
2718 if (cell && cell->tableCellInterface()) {
2726 }
else if (function ==
"GetRowHeader"_L1) {
2729 QAccessibleInterface *cell =
interface->tableInterface()->cellAt(
row, 0);
2730 if (cell && cell->tableCellInterface()) {
2738 }
else if (function ==
"GetSelectedColumns"_L1) {
2740 }
else if (function ==
"GetSelectedRows"_L1) {
2742 }
else if (function ==
"IsColumnSelected"_L1) {
2745 }
else if (function ==
"IsRowSelected"_L1) {
2748 }
else if (function ==
"IsSelected"_L1) {
2751 QAccessibleTableCellInterface* cell =
interface->tableInterface()->cellAt(
row,
column)->tableCellInterface();
2753 }
else if (function ==
"AddColumnSelection"_L1) {
2756 }
else if (function ==
"AddRowSelection"_L1) {
2759 }
else if (function ==
"RemoveColumnSelection"_L1) {
2762 }
else if (function ==
"RemoveRowSelection"_L1) {
2766 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::tableInterface does not implement" <<
function <<
message.path();
2775 QAccessibleTableCellInterface* cellInterface =
interface->tableCellInterface();
2776 if (!cellInterface) {
2781 if (function ==
"GetColumnHeaderCells"_L1) {
2783 const auto headerCellInterfaces = cellInterface->columnHeaderCells();
2784 headerCells.
reserve(headerCellInterfaces.size());
2785 for (QAccessibleInterface *cell : headerCellInterfaces) {
2786 const QString childPath = pathForInterface(cell);
2791 }
else if (function ==
"GetColumnSpan"_L1) {
2794 }
else if (function ==
"GetPosition"_L1) {
2795 const int row = cellInterface->rowIndex();
2796 const int column = cellInterface->columnIndex();
2799 }
else if (function ==
"GetRowHeaderCells"_L1) {
2801 const auto headerCellInterfaces = cellInterface->rowHeaderCells();
2802 headerCells.
reserve(headerCellInterfaces.size());
2803 for (QAccessibleInterface *cell : headerCellInterfaces) {
2804 const QString childPath = pathForInterface(cell);
2809 }
else if (function ==
"GetRowSpan"_L1) {
2812 }
else if (function ==
"GetRowColumnSpan"_L1) {
2814 list << cellInterface->rowIndex() << cellInterface->columnIndex() << cellInterface->rowExtent() << cellInterface->columnExtent();
2816 }
else if (function ==
"GetTable"_L1) {
2818 QAccessibleInterface*
table = cellInterface->table();
2823 qCWarning(lcAccessibilityAtspi) <<
"AtSpiAdaptor::tableCellInterface does not implement" <<
function <<
message.path();
2832#include "moc_atspiadaptor_p.cpp"
QString introspect(const QString &path) const override
void notify(QAccessibleEvent *event)
void windowActivated(QObject *window, bool active)
void registerApplication()
void eventListenerDeregistered(const QString &bus, const QString &path)
bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) override
This function needs to handle all messages to the path of the virtual object, when the SubPath option...
void eventListenerRegistered(const QString &bus, const QString &path)
Connects to the accessibility dbus.
QDBusConnection connection() const
Returns the DBus connection that got established.
QChar toLower() const noexcept
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
constexpr char toLatin1() const noexcept
Returns the Latin-1 character equivalent to the QChar, or 0.
void setText(const QString &, Mode mode=Clipboard)
Copies text into the clipboard as plain text.
QString text(Mode mode=Clipboard) const
Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any te...
bool send(const QDBusMessage &message) const
Sends the message over this connection, without waiting for a reply.
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode=QDBus::Block, int timeout=-1) const
Sends the message over this connection and blocks, waiting for a reply, for at most timeout milliseco...
static QDBusMessage createSignal(const QString &path, const QString &interface, const QString &name)
Constructs a new DBus message with the given path, interface and name, representing a signal emission...
static QDBusMessage createMethodCall(const QString &destination, const QString &path, const QString &interface, const QString &method)
Constructs a new DBus message representing a method call.
Type value() const
Returns the remote function's calls return value.
bool isValid() const
Returns true if no error occurred; otherwise, returns false.
void setVariant(const QVariant &variant)
Assigns the value of the given Qt variant to this D-Bus variant.
static QClipboard * clipboard()
Returns the object for interacting with the clipboard.
bool isEmpty() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
T value(const Key &key, const T &defaultValue=T()) const
NetworkError error() const
Returns the error that was found during the processing of this request.
const QObjectList & children() const
Returns a list of child objects.
QObject * parent() const
Returns a pointer to the parent object.
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
static RoleNames namesForRole(QAccessible::Role role)
void sendEvents(bool active)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
qsizetype size() const
Returns the number of characters in this string.
uint toUInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an {unsigned int} using base base, which is 10 by default and must be...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
QString & prepend(QChar c)
void resize(qsizetype size)
Sets the size of the string to size characters.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QMap< QString, QString > map
[6]
QList< QVariant > arguments
QStringList effectiveActionNames(QAccessibleInterface *iface)
bool performEffectiveAction(QAccessibleInterface *iface, const QString &actionName)
Combined button and popup list for selecting options.
constexpr QBindableInterface iface
std::pair< T1, T2 > QPair
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char * interface
DBusConnection * connection
static QString header(const QString &name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
EGLOutputLayerEXT EGLint attribute
#define Q_LOGGING_CATEGORY(name,...)
#define qCInfo(category,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLsizei const GLubyte GLsizei GLenum coordType
GLenum GLenum GLsizei void GLsizei void * column
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void * row
GLenum GLenum GLsizei void * table
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT_X(cond, x, msg)
#define ATSPI_DBUS_INTERFACE_EVENT_WINDOW
#define ATSPI_DBUS_INTERFACE_TABLE
#define ATSPI_DBUS_PATH_ROOT
#define ATSPI_DBUS_INTERFACE_EVENT_FOCUS
#define QSPI_OBJECT_PATH_PREFIX
#define ATSPI_DBUS_INTERFACE_SELECTION
#define QSPI_OBJECT_PATH_ROOT
#define ATSPI_DBUS_INTERFACE_APPLICATION
#define ATSPI_DBUS_INTERFACE_ACCESSIBLE
AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relation)
#define ATSPI_DBUS_INTERFACE_COMPONENT
quint64 spiStatesFromQState(QAccessible::State state)
#define ATSPI_DBUS_INTERFACE_EVENT_OBJECT
void setSpiStateBit(quint64 *state, AtspiStateType spiState)
QSpiUIntList spiStateSetFromSpiStates(quint64 states)
#define ATSPI_DBUS_INTERFACE_ACTION
#define ATSPI_DBUS_INTERFACE_VALUE
#define ATSPI_DBUS_INTERFACE_EDITABLE_TEXT
#define ATSPI_DBUS_INTERFACE_TEXT
#define QSPI_REGISTRY_NAME
QList< QSpiTextRange > QSpiTextRangeList
QMap< QString, QString > QSpiAttributeSet
QPair< unsigned int, QSpiObjectReferenceArray > QSpiRelationArrayEntry
QLatin1StringView QLatin1String
#define QStringLiteral(str)
QT_BEGIN_NAMESPACE Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char * qVersion(void) Q_DECL_NOEXCEPT
unsigned long long quint64
static QT_BEGIN_NAMESPACE QString windowTitle(HWND hwnd)
QFuture< QSet< QChar > > set
[10]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
char * toString(const MyType &t)
[31]
QString localizedName() const
AtspiRole spiRole() const
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent