44 #ifndef QT_NO_ACCESSIBILITY 60 #include <private/qt_mac_p.h> 61 #include <private/qwidget_p.h> 62 #include <CoreFoundation/CoreFoundation.h> 70 #ifdef QT_MAC_USE_COCOA 72 #define QAXApplicationRole NSAccessibilityApplicationRole 73 #define QAXButtonRole NSAccessibilityButtonRole 74 #define QAXCancelAction NSAccessibilityCancelAction 75 #define QAXCheckBoxRole NSAccessibilityCheckBoxRole 76 #define QAXChildrenAttribute NSAccessibilityChildrenAttribute 77 #define QAXCloseButtonAttribute NSAccessibilityCloseButtonAttribute 78 #define QAXCloseButtonAttribute NSAccessibilityCloseButtonAttribute 79 #define QAXColumnRole NSAccessibilityColumnRole 80 #define QAXConfirmAction NSAccessibilityConfirmAction 81 #define QAXContentsAttribute NSAccessibilityContentsAttribute 82 #define QAXDecrementAction NSAccessibilityDecrementAction 83 #define QAXDecrementArrowSubrole NSAccessibilityDecrementArrowSubrole 84 #define QAXDecrementPageSubrole NSAccessibilityDecrementPageSubrole 85 #define QAXDescriptionAttribute NSAccessibilityDescriptionAttribute 86 #define QAXEnabledAttribute NSAccessibilityEnabledAttribute 87 #define QAXExpandedAttribute NSAccessibilityExpandedAttribute 88 #define QAXFocusedAttribute NSAccessibilityFocusedAttribute 89 #define QAXFocusedUIElementChangedNotification NSAccessibilityFocusedUIElementChangedNotification 90 #define QAXFocusedWindowChangedNotification NSAccessibilityFocusedWindowChangedNotification 91 #define QAXGroupRole NSAccessibilityGroupRole 92 #define QAXGrowAreaAttribute NSAccessibilityGrowAreaAttribute 93 #define QAXGrowAreaRole NSAccessibilityGrowAreaRole 94 #define QAXHelpAttribute NSAccessibilityHelpAttribute 95 #define QAXHorizontalOrientationValue NSAccessibilityHorizontalOrientationValue 96 #define QAXHorizontalScrollBarAttribute NSAccessibilityHorizontalScrollBarAttribute 97 #define QAXIncrementAction NSAccessibilityIncrementAction 98 #define QAXIncrementArrowSubrole NSAccessibilityIncrementArrowSubrole 99 #define QAXIncrementPageSubrole NSAccessibilityIncrementPageSubrole 100 #define QAXIncrementorRole NSAccessibilityIncrementorRole 101 #define QAXLinkedUIElementsAttribute NSAccessibilityLinkedUIElementsAttribute 102 #define QAXListRole NSAccessibilityListRole 103 #define QAXMainAttribute NSAccessibilityMainAttribute 104 #define QAXMaxValueAttribute NSAccessibilityMaxValueAttribute 105 #define QAXMenuBarRole NSAccessibilityMenuBarRole 106 #define QAXMenuButtonRole NSAccessibilityMenuButtonRole 107 #define QAXMenuClosedNotification NSAccessibilityMenuClosedNotification 108 #define QAXMenuItemRole NSAccessibilityMenuItemRole 109 #define QAXMenuOpenedNotification NSAccessibilityMenuOpenedNotification 110 #define QAXMenuRole NSAccessibilityMenuRole 111 #define QAXMinValueAttribute NSAccessibilityMinValueAttribute 112 #define QAXMinimizeButtonAttribute NSAccessibilityMinimizeButtonAttribute 113 #define QAXMinimizedAttribute NSAccessibilityMinimizedAttribute 114 #define QAXNextContentsAttribute NSAccessibilityNextContentsAttribute 115 #define QAXOrientationAttribute NSAccessibilityOrientationAttribute 116 #define QAXParentAttribute NSAccessibilityParentAttribute 117 #define QAXPickAction NSAccessibilityPickAction 118 #define QAXPopUpButtonRole NSAccessibilityPopUpButtonRole 119 #define QAXPositionAttribute NSAccessibilityPositionAttribute 120 #define QAXPressAction NSAccessibilityPressAction 121 #define QAXPreviousContentsAttribute NSAccessibilityPreviousContentsAttribute 122 #define QAXProgressIndicatorRole NSAccessibilityProgressIndicatorRole 123 #define QAXRadioButtonRole NSAccessibilityRadioButtonRole 124 #define QAXRoleAttribute NSAccessibilityRoleAttribute 125 #define QAXRoleDescriptionAttribute NSAccessibilityRoleDescriptionAttribute 126 #define QAXRowRole NSAccessibilityRowRole 127 #define QAXRowsAttribute NSAccessibilityRowsAttribute 128 #define QAXScrollAreaRole NSAccessibilityScrollAreaRole 129 #define QAXScrollBarRole NSAccessibilityScrollBarRole 130 #define QAXSelectedAttribute NSAccessibilitySelectedAttribute 131 #define QAXSelectedChildrenAttribute NSAccessibilitySelectedChildrenAttribute 132 #define QAXSelectedRowsAttribute NSAccessibilitySelectedRowsAttribute 133 #define QAXSizeAttribute NSAccessibilitySizeAttribute 134 #define QAXSliderRole NSAccessibilitySliderRole 135 #define QAXSplitGroupRole NSAccessibilitySplitGroupRole 136 #define QAXSplitterRole NSAccessibilitySplitterRole 137 #define QAXSplittersAttribute NSAccessibilitySplittersAttribute 138 #define QAXStaticTextRole NSAccessibilityStaticTextRole 139 #define QAXSubroleAttribute NSAccessibilitySubroleAttribute 140 #define QAXSubroleAttribute NSAccessibilitySubroleAttribute 141 #define QAXTabGroupRole NSAccessibilityTabGroupRole 142 #define QAXTableRole NSAccessibilityTableRole 143 #define QAXTabsAttribute NSAccessibilityTabsAttribute 144 #define QAXTextFieldRole NSAccessibilityTextFieldRole 145 #define QAXTitleAttribute NSAccessibilityTitleAttribute 146 #define QAXTitleUIElementAttribute NSAccessibilityTitleUIElementAttribute 147 #define QAXToolbarButtonAttribute NSAccessibilityToolbarButtonAttribute 148 #define QAXToolbarRole NSAccessibilityToolbarRole 149 #define QAXTopLevelUIElementAttribute NSAccessibilityTopLevelUIElementAttribute 150 #define QAXUnknownRole NSAccessibilityUnknownRole 151 #define QAXValueAttribute NSAccessibilityValueAttribute 152 #define QAXValueChangedNotification NSAccessibilityValueChangedNotification 153 #define QAXValueIndicatorRole NSAccessibilityValueIndicatorRole 154 #define QAXVerticalOrientationValue NSAccessibilityVerticalOrientationValue 155 #define QAXVerticalScrollBarAttribute NSAccessibilityVerticalScrollBarAttribute 156 #define QAXVisibleRowsAttribute NSAccessibilityVisibleRowsAttribute 157 #define QAXWindowAttribute NSAccessibilityWindowAttribute 158 #define QAXWindowCreatedNotification NSAccessibilityWindowCreatedNotification 159 #define QAXWindowMovedNotification NSAccessibilityWindowMovedNotification 160 #define QAXWindowRole NSAccessibilityWindowRole 161 #define QAXZoomButtonAttribute NSAccessibilityZoomButtonAttribute 164 #define QAXApplicationRole kAXApplicationRole 165 #define QAXButtonRole kAXButtonRole 166 #define QAXCancelAction kAXCancelAction 167 #define QAXCheckBoxRole kAXCheckBoxRole 168 #define QAXChildrenAttribute kAXChildrenAttribute 169 #define QAXCloseButtonAttribute kAXCloseButtonAttribute 170 #define QAXColumnRole kAXColumnRole 171 #define QAXConfirmAction kAXConfirmAction 172 #define QAXContentsAttribute kAXContentsAttribute 173 #define QAXDecrementAction kAXDecrementAction 174 #define QAXDecrementArrowSubrole kAXDecrementArrowSubrole 175 #define QAXDecrementPageSubrole kAXDecrementPageSubrole 176 #define QAXDescriptionAttribute kAXDescriptionAttribute 177 #define QAXEnabledAttribute kAXEnabledAttribute 178 #define QAXExpandedAttribute kAXExpandedAttribute 179 #define QAXFocusedAttribute kAXFocusedAttribute 180 #define QAXFocusedUIElementChangedNotification kAXFocusedUIElementChangedNotification 181 #define QAXFocusedWindowChangedNotification kAXFocusedWindowChangedNotification 182 #define QAXGroupRole kAXGroupRole 183 #define QAXGrowAreaAttribute kAXGrowAreaAttribute 184 #define QAXGrowAreaRole kAXGrowAreaRole 185 #define QAXHelpAttribute kAXHelpAttribute 186 #define QAXHorizontalOrientationValue kAXHorizontalOrientationValue 187 #define QAXHorizontalScrollBarAttribute kAXHorizontalScrollBarAttribute 188 #define QAXIncrementAction kAXIncrementAction 189 #define QAXIncrementArrowSubrole kAXIncrementArrowSubrole 190 #define QAXIncrementPageSubrole kAXIncrementPageSubrole 191 #define QAXIncrementorRole kAXIncrementorRole 192 #define QAXLinkedUIElementsAttribute kAXLinkedUIElementsAttribute 193 #define QAXListRole kAXListRole 194 #define QAXMainAttribute kAXMainAttribute 195 #define QAXMaxValueAttribute kAXMaxValueAttribute 196 #define QAXMenuBarRole kAXMenuBarRole 197 #define QAXMenuButtonRole kAXMenuButtonRole 198 #define QAXMenuClosedNotification kAXMenuClosedNotification 199 #define QAXMenuItemRole kAXMenuItemRole 200 #define QAXMenuOpenedNotification kAXMenuOpenedNotification 201 #define QAXMenuRole kAXMenuRole 202 #define QAXMinValueAttribute kAXMinValueAttribute 203 #define QAXMinimizeButtonAttribute kAXMinimizeButtonAttribute 204 #define QAXMinimizedAttribute kAXMinimizedAttribute 205 #define QAXNextContentsAttribute kAXNextContentsAttribute 206 #define QAXOrientationAttribute kAXOrientationAttribute 207 #define QAXParentAttribute kAXParentAttribute 208 #define QAXPickAction kAXPickAction 209 #define QAXPopUpButtonRole kAXPopUpButtonRole 210 #define QAXPositionAttribute kAXPositionAttribute 211 #define QAXPressAction kAXPressAction 212 #define QAXPreviousContentsAttribute kAXPreviousContentsAttribute 213 #define QAXProgressIndicatorRole kAXProgressIndicatorRole 214 #define QAXRadioButtonRole kAXRadioButtonRole 215 #define QAXRoleAttribute kAXRoleAttribute 216 #define QAXRoleDescriptionAttribute kAXRoleDescriptionAttribute 217 #define QAXRowRole kAXRowRole 218 #define QAXRowsAttribute kAXRowsAttribute 219 #define QAXScrollAreaRole kAXScrollAreaRole 220 #define QAXScrollBarRole kAXScrollBarRole 221 #define QAXSelectedAttribute kAXSelectedAttribute 222 #define QAXSelectedChildrenAttribute kAXSelectedChildrenAttribute 223 #define QAXSelectedRowsAttribute kAXSelectedRowsAttribute 224 #define QAXSizeAttribute kAXSizeAttribute 225 #define QAXSliderRole kAXSliderRole 226 #define QAXSplitGroupRole kAXSplitGroupRole 227 #define QAXSplitterRole kAXSplitterRole 228 #define QAXSplittersAttribute kAXSplittersAttribute 229 #define QAXStaticTextRole kAXStaticTextRole 230 #define QAXSubroleAttribute kAXSubroleAttribute 231 #define QAXTabGroupRole kAXTabGroupRole 232 #define QAXTableRole kAXTableRole 233 #define QAXTabsAttribute kAXTabsAttribute 234 #define QAXTextFieldRole kAXTextFieldRole 235 #define QAXTitleAttribute kAXTitleAttribute 236 #define QAXTitleUIElementAttribute kAXTitleUIElementAttribute 237 #define QAXToolbarButtonAttribute kAXToolbarButtonAttribute 238 #define QAXToolbarRole kAXToolbarRole 239 #define QAXTopLevelUIElementAttribute kAXTopLevelUIElementAttribute 240 #define QAXUnknownRole kAXUnknownRole 241 #define QAXValueAttribute kAXValueAttribute 242 #define QAXValueChangedNotification kAXValueChangedNotification 243 #define QAXValueIndicatorRole kAXValueIndicatorRole 244 #define QAXVerticalOrientationValue kAXVerticalOrientationValue 245 #define QAXVerticalScrollBarAttribute kAXVerticalScrollBarAttribute 246 #define QAXVisibleRowsAttribute kAXVisibleRowsAttribute 247 #define QAXWindowAttribute kAXWindowAttribute 248 #define QAXWindowCreatedNotification kAXWindowCreatedNotification 249 #define QAXWindowMovedNotification kAXWindowMovedNotification 250 #define QAXWindowRole kAXWindowRole 251 #define QAXZoomButtonAttribute kAXZoomButtonAttribute 399 if (interface.
isValid() ==
false)
400 debug <<
"invalid interface";
402 debug << interface.
object() <<
"id" << interface.
id() <<
"role" <<
hex << interface.
role();
420 while (currentThis.
object() == 0) {
421 if (currentOther.
object() != 0)
429 currentThis = currentThis.
parent();
430 currentOther = currentOther.
parent();
433 return (currentThis.
object() == currentOther.
object() && currentThis.
id() == currentOther.
id());
470 const int status =
base.interface->navigate(relation, entry, &child_iface);
489 :elementRef(elementRef)
491 if (elementRef != 0) {
492 CFRetain(elementRef);
508 #ifndef QT_MAC_USE_COCOA 512 elementRef = AXUIElementCreateWithHIObjectAndIdentifier(
object, child);
560 #ifndef QT_MAC_USE_COCOA 571 delete qobjectElementHash.value(
object);
572 qobjectElementHash.remove(
object);
573 hiobjectInterfaceHash.remove(hiObject);
582 qobjectElementHash.clear();
583 hiobjectInterfaceHash.clear();
584 qobjectHiobjectHash.clear();
589 return accessibleHierarchyManager();
592 #ifndef QT_MAC_USE_COCOA 598 || (
object &&
object->objectName() ==
QLatin1String(
"qt_scrollarea_viewport")
606 return (
object->inherits(
"QTabWidget") && interface.
id() == 0);
614 return (qobject_cast<QTabWidget *>(object->
parent()) == 0);
623 return (qobject_cast<QTabWidget *>(object->
parent()));
686 #ifndef QT_MAC_USE_COCOA 700 #ifndef QT_MAC_USE_COCOA 701 if (interface.
isValid() ==
false)
707 if (qobject == 0 || hiobject == 0)
710 if (qobjectElementHash.contains(qobject) ==
false) {
712 HIObjectSetAccessibilityIgnored(hiobject, !
isItInteresting(interface));
722 #ifndef QT_MAC_USE_COCOA 728 #ifndef QT_MAC_USE_COCOA 729 if (qobjectElementHash.contains(qobject) ==
false) {
730 qobjectElementHash.insert(qobject, interfaceFactory);
731 qobjectHiobjectHash.insert(qobject, hiobject);
735 if (hiobjectInterfaceHash.contains(hiobject) ==
false) {
736 hiobjectInterfaceHash.insert(hiobject, interfaceFactory);
754 if (interfaceFactory == 0)
764 #ifndef QT_MAC_USE_COCOA 773 AXUIElementGetIdentifier(element, &
id);
787 if (interface.
isValid() ==
false)
794 return factory->
element(interface);
815 : m_interface(interface),
object(interface.hiObject())
828 const int child = identifier;
839 if (interface.
object() == 0)
846 const int childCount = m_interface.childCount();
847 for (
int i = 1; i <= childCount; ++i) {
848 accessibleHierarchyManager()->registerInterface(m_interface.navigate(
QAccessible::Child, i));
864 : m_interface(interface)
876 const int child = identifier;
883 return QAElement(m_interface.hiObject(), 0);
885 if (child > objects.count())
888 return QAElement(objects.at(child - 1), child);
893 #ifndef QT_MAC_USE_COCOA 894 const int childCount = m_interface.childCount();
895 for (
int i = 1; i <= childCount; ++i) {
898 objects.append(hiobject);
899 accessibleHierarchyManager()->registerInterface(m_interface.object(), hiobject,
this);
914 : m_interface(interface),
object(interface.hiObject())
919 if (tableView->model())
920 columnCount = tableView->model()->columnCount();
921 if (tableView->verticalHeader())
937 return m_interface.
childAt(identifier);
940 const int index = identifier;
944 const int rowIndex = (index - 1) / (columnCount + 1);
945 const int cellIndex = (index - 1) % (columnCount + 1);
953 if ((cellIndex) == 0)
956 return rowInterface.
childAt(cellIndex);
973 if (interface.
object() && interface.
object() == m_interface.object()) {
977 return QAElement(
object, m_interface.indexOfChild(interface));
982 while (currentInterface.
isValid() && currentInterface.
object() == 0) {
993 index += ((parentInterface.
indexOfChild(currentInterface) - 1) * (currentInterface.
childCount() + 1)) + 1;
994 currentInterface = parentInterface;
997 if (currentInterface.
object() == m_interface.object())
1016 #ifndef QT_MAC_USE_COCOA 1037 foreach (
const QAInterface &interface, interfaces)
1041 elements.
append(element);
1063 #ifndef QT_MAC_USE_COCOA 1071 range.length = CFArrayGetCount(array);
1072 if(!CFArrayContainsValue(array, range, value)) {
1073 CFArrayAppendValue(array, value);
1081 CFMutableArrayRef array = CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks);
1084 CFArrayAppendValue(array, element.
element());
1087 const OSStatus err = SetEventParameter(event, kEventParamAccessibleAttributeValue,
1088 typeCFTypeRef,
sizeof(array), &array);
1092 #endif //QT_MAC_USE_COCOA 1100 GetEventParameter(event, kEventParamAccessibleObject, typeCFTypeRef, 0,
1101 sizeof(element), 0, &element);
1109 #ifndef QT_MAC_USE_COCOA 1113 accessibleHierarchyManager()->registerChildren(rootInterface);
1115 return CallNextEventHandler(next_ref, event);
1146 #endif //QT_MAC_USE_COCOA 1168 return kAXTabGroupRole;
1173 if (
object->inherits(
"QAbstractScrollArea") && interface.
id() == 0)
1176 if (
object->inherits(
"QDockWidget"))
1182 while (testRole != -1) {
1183 if (testRole == qtRole)
1198 #ifndef QT_MAC_USE_COCOA 1204 while (testRole != -1) {
1205 if (testRole == role) {
1209 while (qtRole != -1) {
1210 if (CFStringCompare(attribute, testAttribute, 0) == kCFCompareEqualTo) {
1243 if (parent.
isValid() ==
false)
1248 switch(interface.
id()) {
1265 if (
QAbstractSlider *
const sliderObject = qobject_cast<QAbstractSlider * const>(
object))
1266 return sliderObject->orientation();
1277 for (
int i = 2; i <= 3; ++i) {
1279 for (
int i = 1; i <= scrollBarContainer.
childCount(); ++i) {
1314 accessibleHierarchyManager()->registerChildren(stackedWidget);
1316 return accessibleHierarchyManager()->lookup(tabPageInterface);
1323 accessibleHierarchyManager()->registerChildren(interface);
1325 const int numChildren = interface.
childCount();
1326 for (
int i = 1; i < numChildren + 1; ++i) {
1329 tabs.
append(accessibleHierarchyManager()->
lookup(child));
1350 #endif //QT_MAC_USE_COCOA 1381 #ifndef QT_MAC_USE_COCOA 1422 OSStatus err = CallNextEventHandler(next_ref, event);
1423 if(err != noErr && err != eventNotHandledErr)
1425 CFMutableArrayRef attrs = 0;
1426 GetEventParameter(event, kEventParamAccessibleAttributeNames, typeCFMutableArrayRef, 0,
1427 sizeof(attrs), 0, &attrs);
1430 return eventNotHandledErr;
1451 switch (interface.
role()) {
1516 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFStringRef,
sizeof(cfstr), &cfstr);
1529 accessibleHierarchyManager()->registerChildren(interface);
1533 const int childCount = children.
count();
1535 CFMutableArrayRef array = 0;
1536 array = CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks);
1537 for (
int i = 0; i < childCount; ++i) {
1542 err = SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFArrayRef,
sizeof(array), &array);
1544 qWarning(
"Qt:Internal error (%s:%d)", __FILE__, __LINE__);
1550 const int childCount = children.
count();
1554 err = CallNextEventHandler(next_ref, event);
1556 CFMutableArrayRef array = 0;
1560 err = GetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef, NULL ,
sizeof(obj), NULL, &obj);
1561 if (err == noErr && obj != 0) {
1562 array = (CFMutableArrayRef)obj;
1563 arraySize = CFArrayGetCount(array);
1568 CFArrayRemoveAllValues(array);
1569 for (
int i = 0; i < childCount; ++i) {
1573 array = CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks);
1574 for (
int i = 0; i < childCount; ++i) {
1578 err = SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFArrayRef,
sizeof(array), &array);
1580 qWarning(
"Qt:Internal error (%s:%d)", __FILE__, __LINE__);
1593 err = CallNextEventHandler(next_ref, event);
1599 const QAElement parentElement = accessibleHierarchyManager()->lookup(parentInterface);
1601 if (parentElement.
isValid() ==
false)
1602 return eventNotHandledErr;
1605 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef,
sizeof(elementRef), &elementRef);
1635 template <
typename TestType>
1639 return CallNextEventHandler(next_ref, event);
1644 if (TestType::test(interface)) {
1645 element = accessibleHierarchyManager()->lookup(current);
1653 const QAElement currentElement = accessibleHierarchyManager()->lookup(current);
1654 AXError err = AXUIElementCopyAttributeValue(currentElement.
element(), attribute, &value);
1655 AXUIElementRef newElement = (AXUIElementRef)value;
1660 if (newElement != 0)
1661 CFRelease(newElement);
1668 if (next == current)
1673 if (element.
isValid() ==
false)
1674 return eventNotHandledErr;
1678 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef,
1679 sizeof(elementRef), &elementRef);
1687 #ifndef QT_MAC_USE_COCOA 1718 point.
x = qpoint.x();
1719 point.y = qpoint.y();
1720 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeHIPoint,
sizeof(point), &point);
1728 size.
width = qSize.width();
1729 size.height = qSize.height();
1730 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeHISize,
sizeof(size), &size);
1738 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef,
sizeof(rolestr), &rolestr);
1748 }
else if (
QSplitterHandle *
const splitter = qobject_cast<QSplitterHandle * const>(
object)) {
1752 return CallNextEventHandler(next_ref, event);
1756 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFStringRef,
sizeof(orientationString), &orientationString);
1766 return eventNotHandledErr;
1769 if (parent.
isValid() ==
false)
1770 return CallNextEventHandler(next_ref, event);
1773 return CallNextEventHandler(next_ref, event);
1777 return CallNextEventHandler(next_ref, event);
1780 const int splitterHandleIndex = splitter->
indexOf(splitterHandle);
1782 const QAElement contentsElement = accessibleHierarchyManager()->lookup(splitter->
widget(widgetIndex), 0);
1793 return CallNextEventHandler(next_ref, event);
1795 accessibleHierarchyManager()->registerChildren(interface);
1798 const int visibleSplitterCount = splitter->
count() -1;
1799 for (
int i = 0; i < visibleSplitterCount; ++i)
1809 if (scrollBar.
isValid() ==
false)
1810 return CallNextEventHandler(next_ref, event);
1813 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef,
sizeof(elementRef), &elementRef);
1824 if (mac_role == kAXTabGroupRole) {
1828 if (contents.
isValid() ==
false)
1829 return CallNextEventHandler(next_ref, event);
1855 visibleRows.
append(accessibleHierarchyManager()->
lookup(interface));
1865 selectedRows.
append(accessibleHierarchyManager()->
lookup(interface));
1873 GetEventParameter(event, kEventParamAccessibleAttributeName, typeCFStringRef, 0,
1874 sizeof(var), 0, &var);
1895 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFStringRef,
1896 sizeof(role), &role);
1901 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1905 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1909 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1913 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1918 for (
int i = 1; i <= cc; ++i) {
1921 selected.
append(accessibleHierarchyManager()->
lookup(child_iface));
1929 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1936 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1943 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1950 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1956 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1963 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeBoolean,
1969 #if !defined(QT_MAC_USE_COCOA) 1970 if (HICopyAccessibilityRoleDescription) {
1971 const CFStringRef roleDescription = HICopyAccessibilityRoleDescription(
macRole(interface), 0);
1972 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFStringRef,
1973 sizeof(roleDescription), &roleDescription);
1989 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeUInt32,
sizeof(value), &value);
1998 return CallNextEventHandler(next_ref, event);
2003 }
else if (CFStringCompare(var, kAXTitleUIElementAttribute, 0) == kCFCompareEqualTo) {
2004 return CallNextEventHandler(next_ref, event);
2014 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeUInt32,
sizeof(value), &value);
2016 return CallNextEventHandler(next_ref, event);
2021 SetEventParameter(event, kEventParamAccessibleAttributeValue, typeUInt32,
sizeof(value), &value);
2023 return CallNextEventHandler(next_ref, event);
2046 return CallNextEventHandler(next_ref, event);
2054 GetEventParameter(event, kEventParamAccessibleAttributeName, typeCFStringRef, 0,
2055 sizeof(var), 0, &var);
2071 SetEventParameter(event, kEventParamAccessibleAttributeSettable, typeBoolean,
2072 sizeof(settable), &settable);
2079 if (interface.
isValid() ==
false)
2080 return eventNotHandledErr;
2083 accessibleHierarchyManager()->registerChildren(interface);
2086 GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0,
sizeof(where), 0, &where);
2089 if (childInterface.
isValid() ==
false || childInterface == interface)
2090 return eventNotHandledErr;
2092 const QAElement element = accessibleHierarchyManager()->lookup(childInterface);
2093 if (element.
isValid() ==
false)
2094 return eventNotHandledErr;
2097 CFRetain(elementRef);
2098 SetEventParameter(event, kEventParamAccessibleChild, typeCFTypeRef,
2099 sizeof(elementRef), &elementRef);
2111 switch (interface.
role()) {
2174 #endif // QT_MAC_USE_COCOA 2180 #ifndef QT_MAC_USE_COCOA 2185 CFMutableArrayRef actions = 0;
2186 GetEventParameter(event, kEventParamAccessibleActionNames, typeCFMutableArrayRef, 0,
2187 sizeof(actions), 0, &actions);
2191 for (
int i = 0; i < predefinedActions.
count(); ++i) {
2199 for (
int i = 0; i < actionCount; ++i) {
2211 #ifndef QT_MAC_USE_COCOA 2217 GetEventParameter(event, kEventParamAccessibleActionName, typeCFStringRef, 0,
2218 sizeof(act), 0, &act);
2231 for(
int i = 0; i < actCount; i++) {
2246 GetEventParameter(event, kEventParamAccessibleAttributeName, typeCFStringRef, 0,
2247 sizeof(var), 0, &var);
2250 if(GetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef, 0,
2251 sizeof(val), 0, &val) == noErr) {
2252 if(CFGetTypeID(val) == CFBooleanGetTypeID() &&
2253 CFEqual(static_cast<CFBooleanRef>(val), kCFBooleanTrue)) {
2266 if(GetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFTypeRef, 0,
2267 sizeof(val), 0, &val) == noErr) {
2268 if(CFGetTypeID(val) == CFStringGetTypeID())
2293 const UInt32 eclass = GetEventClass(event);
2294 if (eclass != kEventClassAccessibility)
2295 return eventNotHandledErr;
2299 GetEventParameter(event, kEventParamAccessibleObject, typeCFTypeRef, 0,
sizeof(element), 0, &element);
2300 QAInterface interface = accessibleHierarchyManager()->lookup(element);
2301 if (interface.
isValid() ==
false)
2302 return eventNotHandledErr;
2304 const UInt32 ekind = GetEventKind(event);
2307 case kEventAccessibleGetAllAttributeNames:
2310 case kEventAccessibleGetNamedAttribute:
2313 case kEventAccessibleIsNamedAttributeSettable:
2316 case kEventAccessibleGetChildAtPoint:
2319 case kEventAccessibleGetAllActionNames:
2322 case kEventAccessibleGetFocusedChild:
2323 status = CallNextEventHandler(next_ref, event);
2325 case kEventAccessibleSetNamedAttribute:
2328 case kEventAccessiblePerformNamedAction:
2332 status = CallNextEventHandler(next_ref, event);
2341 #ifndef QT_MAC_USE_COCOA 2351 if (rootObjectHandler) {
2352 rootObjectHandler(
object);
2361 accessibleHierarchyManager()->reset();
2362 #ifndef QT_MAC_USE_COCOA 2372 if (updateHandler) {
2373 updateHandler(
object, child, reason);
2377 #ifndef QT_MAC_USE_COCOA 2388 if (reason == ObjectShow) {
2394 if (element.isValid() == false)
2401 }
else if(reason == ValueChanged) {
2403 }
else if(reason == MenuStart) {
2405 }
else if(reason == MenuEnd) {
2407 }
else if(reason == LocationChanged) {
2409 }
else if(reason == ObjectShow || reason == ObjectHide ) {
2432 QAInterface interface = accessibleHierarchyManager()->lookup(element);
2434 HIObjectSetAccessibilityIgnored(element.object(), !
isItInteresting(interface));
2439 for (
int i = 1; i <= interface.
childCount(); ++i) {
2442 const QAElement element = accessibleHierarchyManager()->lookup(childInterface);
2450 }
else if(reason == Focus) {
2463 AXNotificationHIObjectNotify(notification,
element.object(),
element.id());
2469 #endif // QT_NO_ACCESSIBILITY static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QCFString translateAction(const QAccessible::Action action)
QAElement element(int child)
QSplitterHandle * handle(int index) const
Returns the handle to the left (or above) for the item in the splitter's layout at the given index...
HIObjectRef hiObject() const
~QItemViewInterfaceFactory()
T qobject_cast(QObject *object)
The QDebug class provides an output stream for debugging information.
#define QAXExpandedAttribute
static EventHandlerUPP objectCreateEventHandlerUPP
static void appendIfSupported(CFMutableArrayRef array, CFStringRef attribute, const QAInterface &interface)
CFStringRef const QAXRoleType
int indexOfChild(const QAInterface &child) const
const struct __CFString * CFStringRef
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
#define QAXValueChangedNotification
void doAction(int action, const QVariantList ¶ms=QVariantList()) const
static bool test(const QAInterface &interface)
static OSStatus handleTabsAttribute(EventHandlerCallRef next_ref, EventRef event, QAInterface &interface)
static void installApplicationEventhandler()
bool operator==(const QAInterface &other) const
static CFStringRef kObjectQtAccessibility
static void handleStringAttribute(EventRef event, QAccessible::Text text, const QAInterface &interface)
virtual void registerChildren()=0
static QList< QAElement > tabWidgetGetChildren(const QAInterface &interface)
static OSStatus handleTopLevelUIElementAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
static OSStatus handleSubroleAttribute(EventHandlerCallRef, EventRef event, const QAInterface &interface)
#define QT_END_NAMESPACE
This macro expands to.
#define QAXSelectedAttribute
QPointer< QWidget > widget
bool qt_mac_is_macsheet(const QWidget *w)
static bool isEmbeddedTabBar(const QAInterface &interface)
HIObjectRef object() const
#define QAXTitleAttribute
static void installAcessibilityEventHandler(HIObjectRef hiObject)
#define QAXRoleDescriptionAttribute
static EventHandlerUPP accessibilityEventHandlerUPP
#define QAXOrientationAttribute
static QAElement tabWidgetGetContents(const QAInterface &interface)
static OSStatus handleVisibleRowsAttribute(EventHandlerCallRef, EventRef event, QAInterface &tableView)
#define QAXPopUpButtonRole
QList< HIObjectRef > objects
QAInterface navigate(RelationFlag relation, int entry) const
#define QAXWindowCreatedNotification
QAInterface interface(UInt64 identifier)
Role
This enum defines the role of an accessible object.
uint qHash(const QAInterface &item)
#define QAXFocusedUIElementChangedNotification
static EventHandlerUPP applicationEventHandlerUPP
~QMultipleHIObjectFactory()
static bool isItemView(const QAInterface &interface)
static CFStringRef toCFStringRef(const QString &str)
#define QAXWindowMovedNotification
#define QAXSplittersAttribute
static QString toQString(CFStringRef cfstr)
static LibLoadStatus status
static void registerQtAccessibilityHIObjectSubclass()
#define QAXStaticTextRole
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QAInterface childAt(int x, int y) const
#define QAXVerticalScrollBarAttribute
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
#define QAXHorizontalOrientationValue
static QObject * rootObject
QAInterface interface(UInt64 identifier)
#define QAXFocusedWindowChangedNotification
static OSStatus handleContentsAttribute(EventHandlerCallRef next_ref, EventRef event, QAInterface &interface)
The QString class provides a Unicode character string.
static bool test(const QAInterface &interface)
#define QAXContentsAttribute
The QObject class is the base class of all Qt objects.
The QSplitterHandle class provides handle functionality of the splitter.
static OSStatus handleSizeAttribute(EventHandlerCallRef, EventRef event, const QAInterface &interface)
QString toPlainText() const
Returns the plain text contained in the document.
QAElement element(int id)
Q_CORE_EXPORT QTextStream & hex(QTextStream &s)
QAElement element(int id)
#define QAXDecrementAction
#define QAXSelectedChildrenAttribute
QWidget * widget(int index) const
Returns the widget at the given index in the splitter's layout.
static OSStatus accessibilityEventHandler(EventHandlerCallRef next_ref, EventRef event, void *data)
static bool isStandaloneTabBar(const QAInterface &interface)
#define QAXProgressIndicatorRole
static OSStatus handleOrientationAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
#define QAXIncrementPageSubrole
static OSStatus getAllActionNames(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
static OSStatus handleParentAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
#define QAXRadioButtonRole
#define QAXVerticalOrientationValue
static OSStatus setNamedAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
int width() const
Returns the width.
void append(const T &t)
Inserts value at the end of the list.
static OSStatus isNamedAttributeSettable(EventRef event, const QAInterface &interface)
#define QAXTopLevelUIElementAttribute
static OSStatus getChildAtPoint(EventHandlerCallRef next_ref, EventRef event, QAInterface &interface)
bool operator==(const QAElement &other) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
static QString getValue(const QAInterface &interface)
#define QAXSelectedRowsAttribute
QAInterface parent() const
#define QAXCloseButtonAttribute
#define QAXSubroleAttribute
void objectDestroyed(QObject *)
int count() const
Returns the number of widgets contained in the splitter's layout.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Event
This enum type defines accessible event types.
virtual QAElement element(int id)=0
static void removeEventhandler(EventHandlerUPP eventHandler)
static QList< QAElement > tabBarGetTabs(const QAInterface &interface)
RelationFlag
This enum type defines bit flags that can be combined to indicate the relationship between two access...
static OSStatus handleRowsAttribute(EventHandlerCallRef, EventRef event, QAInterface &tableView)
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
void setText(Text t, const QString &text) const
static QAccessibleHierarchyManager * instance()
#define QAXMenuButtonRole
#define QAXZoomButtonAttribute
QObject * cachedObject() const
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
#define QAXValueIndicatorRole
static OSStatus setAttributeValue(EventRef event, const QList< QAElement > &elements)
#define QAXChildrenAttribute
#define QAXSplitGroupRole
#define QAXHorizontalScrollBarAttribute
void setHtml(const QString &html)
Replaces the entire contents of the document with the given HTML-formatted text in the html string...
#define QAXNextContentsAttribute
#define QAXIncrementAction
static OSStatus getAllAttributeNames(EventRef event, const QAInterface &interface, EventHandlerCallRef next_ref)
static int buttonValue(QAInterface element)
#define QAXDecrementPageSubrole
#define QAXLinkedUIElementsAttribute
The QTableView class provides a default model/view implementation of a table view.
AXUIElementRef element() const
struct OpaqueEventRef * EventRef
#define QAXToolbarButtonAttribute
static OSStatus performNamedAction(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
static QWidget * parentWidget(const QWidget *w)
QAInterface interface(UInt64 identifier)
QString actionText(int action, Text text) const
static AXUIElementRef getAccessibleObjectParameter(EventRef event)
static int textForRoleAndAttribute(QAccessible::Role role, CFStringRef attribute)
#define QAXFocusedAttribute
Action
This enum describes the possible types of action that can occur.
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...
#define QAXMinimizedAttribute
static QList< QAccessible::Action > supportedPredefinedActions(const QAInterface &interface)
bool operator!=(const QAInterface &other) const
void registerChildren(const QAInterface &interface)
#define QAXPreviousContentsAttribute
The QAbstractItemView class provides the basic functionality for item view classes.
static bool supportsAttribute(CFStringRef attribute, const QAInterface &interface)
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
#define QAXDecrementArrowSubrole
static QAInterface scrollAreaGetScrollBarInterface(const QAInterface &scrollArea, Qt::Orientation orientation)
static void setRootObject(QObject *)
Sets the root accessible object of this application to object.
int userActionCount() const
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
#define QAXGrowAreaAttribute
QMultipleHIObjectFactory(const QAInterface &interface)
static QAElement scrollAreaGetContents(const QAInterface &scrollArea)
void operator=(const QAElement &other)
static QCFString subrole(const QAInterface &interface)
#define QAXIncrementArrowSubrole
OSStatus navigateAncestors(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface, CFStringRef attribute)
QObject * parent() const
Returns a pointer to the parent object.
#define QAXVisibleRowsAttribute
QList< QVariant > QVariantList
The QPoint class defines a point in the plane using integer precision.
QAElement element(const QAInterface &interface)
static CFStringRef macRole(const QAInterface &interface)
The QMainWindow class provides a main application window.
struct OpaqueHIObjectRef * HIObjectRef
if(void) toggleToolbarShown
#define QAXScrollAreaRole
The QAbstractSlider class provides an integer value within a range.
#define QAXMenuOpenedNotification
#define QAXWindowAttribute
static Qt::Orientation scrollBarOrientation(const QAInterface &scrollBar)
static bool scrollAreaHasScrollBar(const QAInterface &scrollArea, Qt::Orientation orientation)
static OSStatus handlePositionAttribute(EventHandlerCallRef, EventRef event, const QAInterface &interface)
QAInterface lookup(const AXUIElementRef &element)
~QStandardInterfaceFactory()
virtual QAInterface interface(UInt64 identifier)=0
#define QAXParentAttribute
static OSStatus handleChildrenAttribute(EventHandlerCallRef next_ref, EventRef event, QAInterface &interface)
#define QAXPositionAttribute
static const QTextHtmlElement elements[Html_NumElements]
return(isPopup||isToolTip)
static OSStatus handleSplittersAttribute(EventHandlerCallRef next_ref, EventRef event, QAInterface &interface)
static QAElement scrollAreaGetScrollBar(const QAInterface &scrollArea, Qt::Orientation orientation)
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
static OSStatus applicationEventHandler(EventHandlerCallRef next_ref, EventRef event, void *)
#define QAXValueAttribute
QList< QAElement > lookup(const QList< QAInterface > &interfaces)
QItemViewInterfaceFactory(const QAInterface &interface)
QDebug operator<<(QDebug debug, const QAInterface &interface)
QAElement element(const QAInterface &interface)
#define QAXMaxValueAttribute
The QSize class defines the size of a two-dimensional object using integer point precision.
struct OpaqueEventHandlerCallRef * EventHandlerCallRef
int qstrcmp(const QByteArray &str1, const char *str2)
QAInterface objectInterface() const
int indexOf(QWidget *w) const
Returns the index in the splitter's layout of the specified widget.
int x() const
Returns the x coordinate of this point.
QList< QAInterface > children() const
Text
This enum specifies string information that an accessible object returns.
#define QAXEnabledAttribute
AXUIElementRef elementRef
QStandardInterfaceFactory(const QAInterface &interface)
QString text(Text text) const
Q_GLOBAL_STATIC(QAccessibleHierarchyManager, accessibleHierarchyManager)
#define QAXMenuClosedNotification
#define QAXDescriptionAttribute
static OSStatus handleSplitterContentsAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface, QCFString nextOrPrev)
QAElement registerInterface(QObject *object, int child)
#define QAXIncrementorRole
bool qt_mac_is_macdrawer(const QWidget *w)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
bool operator==(QBool b1, bool b2)
static OSStatus handleScrollBarAttribute(EventHandlerCallRef next_ref, EventRef event, QAInterface &scrollArea, Qt::Orientation orientation)
static QInterfaceFactory * createFactory(const QAInterface &interface)
The QSplitter class implements a splitter widget.
#define QAXTitleUIElementAttribute
static bool qt_mac_append_cf_uniq(CFMutableArrayRef array, CFTypeRef value)
struct QAccessibleTextBinding text_bindings[][10]
bool isItInteresting(const QAInterface &interface)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
static bool isTabWidget(const QAInterface &interface)
#define QAXMinimizeButtonAttribute
static bool managesChildren(const QAInterface &interface)
#define QAXMinValueAttribute
static OSStatus handleSelectedRowsAttribute(EventHandlerCallRef, EventRef event, QAInterface &tableView)
static OSStatus getNamedAttribute(EventHandlerCallRef next_ref, EventRef event, QAInterface &interface)
static OSStatus handleWindowAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
#define QAXApplicationRole
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
static QList< QAElement > tabWidgetGetTabs(const QAInterface &interface)
void removeAt(int i)
Removes the item at index position i.