// moz: [important] HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accRole(VARIANT varID, VARIANT *pvarRole) { showDebug(__FUNCTION__, accessible); if (!accessible->isValid()) return E_FAIL; QAccessible::Role role; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child) return E_FAIL; role = child->role(); } else { role = accessible->role(); } if (role != QAccessible::NoRole) { if (role == QAccessible::LayeredPane) role = QAccessible::Pane; (*pvarRole).vt = VT_I4; (*pvarRole).lVal = role; } else { (*pvarRole).vt = VT_EMPTY; } return S_OK; }
// moz: [important] HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accRole(VARIANT varID, VARIANT *pvarRole) { accessibleDebugClientCalls(accessible); if (!accessible->isValid()) return E_FAIL; QAccessible::Role role; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child) return E_FAIL; role = child->role(); } else { role = accessible->role(); } if (role != QAccessible::NoRole) { if (role >= QAccessible::LayeredPane) { // This block should hopefully only be entered if the AT client // does not support IAccessible2, since it should prefer IA2::role() then. if (role == QAccessible::LayeredPane) role = QAccessible::Pane; else role = QAccessible::Client; } (*pvarRole).vt = VT_I4; (*pvarRole).lVal = role; } else { (*pvarRole).vt = VT_EMPTY; } return S_OK; }
// moz: [important] HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accName(VARIANT varID, BSTR* pszName) { accessibleDebugClientCalls(accessible); if (!accessible->isValid()) return E_FAIL; QString name; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child) return E_FAIL; name = child->text(QAccessible::Name); if (name.isEmpty()) { if (QAccessibleInterface *labelInterface = relatedInterface(child.data(), QAccessible::Label)) { name = labelInterface->text(QAccessible::Name); delete labelInterface; } } } else { name = accessible->text(QAccessible::Name); if (name.isEmpty()) { if (QAccessibleInterface *labelInterface = relatedInterface(accessible, QAccessible::Label)) { name = labelInterface->text(QAccessible::Name); delete labelInterface; } } } if (name.size()) { *pszName = QStringToBSTR(name); return S_OK; } *pszName = 0; return S_FALSE; }
// moz: [important] HRESULT STDMETHODCALLTYPE QWindowsAccessible::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varID) { showDebug(__FUNCTION__, accessible); if (!accessible->isValid()) return E_FAIL; QRect rect; if (varID.lVal) { QAIPointer child = QAIPointer(accessible->child(varID.lVal - 1)); if (child->isValid()) rect = child->rect(); } else { rect = accessible->rect(); } *pxLeft = rect.x(); *pyTop = rect.y(); *pcxWidth = rect.width(); *pcyHeight = rect.height(); return S_OK; }
// moz: [important] HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accName(VARIANT varID, BSTR* pszName) { showDebug(__FUNCTION__, accessible); if (!accessible->isValid()) return E_FAIL; QString name; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child) return E_FAIL; name = child->text(QAccessible::Name); } else { name = accessible->text(QAccessible::Name); } if (name.size()) { *pszName = QStringToBSTR(name); return S_OK; } *pszName = 0; return S_FALSE; }
HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accHelp(VARIANT varID, BSTR *pszHelp) { showDebug(__FUNCTION__, accessible); if (!accessible->isValid()) return E_FAIL; QString help; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child) return E_FAIL; help = child->text(QAccessible::Help); } else { help = accessible->text(QAccessible::Help); } if (help.size()) { *pszHelp = QStringToBSTR(help); return S_OK; } *pszHelp = 0; return S_FALSE; }
HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accDescription(VARIANT varID, BSTR* pszDescription) { showDebug(__FUNCTION__, accessible); if (!accessible->isValid()) return E_FAIL; QString descr; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child) return E_FAIL; descr = child->text(QAccessible::Description); } else { descr = accessible->text(QAccessible::Description); } if (descr.size()) { *pszDescription = QStringToBSTR(descr); return S_OK; } *pszDescription = 0; return S_FALSE; }
// moz: [important] HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accState(VARIANT varID, VARIANT *pvarState) { showDebug(__FUNCTION__, accessible); if (!accessible->isValid()) return E_FAIL; QAccessible::State state; if (varID.lVal) { QAIPointer child = childPointer(varID); if (!child.data()) return E_FAIL; state = child->state(); } else { state = accessible->state(); } LONG st = 0; if (state.animated) st |= STATE_SYSTEM_ANIMATED; if (state.busy) st |= STATE_SYSTEM_BUSY; if (state.checked) st |= STATE_SYSTEM_CHECKED; if (state.collapsed) st |= STATE_SYSTEM_COLLAPSED; if (state.defaultButton) st |= STATE_SYSTEM_DEFAULT; if (state.expanded) st |= STATE_SYSTEM_EXPANDED; if (state.extSelectable) st |= STATE_SYSTEM_EXTSELECTABLE; if (state.focusable) st |= STATE_SYSTEM_FOCUSABLE; if (state.focused) st |= STATE_SYSTEM_FOCUSED; if (state.hasPopup) st |= STATE_SYSTEM_HASPOPUP; if (state.hotTracked) st |= STATE_SYSTEM_HOTTRACKED; if (state.invisible) st |= STATE_SYSTEM_INVISIBLE; if (state.linked) st |= STATE_SYSTEM_LINKED; if (state.marqueed) st |= STATE_SYSTEM_MARQUEED; if (state.mixed) st |= STATE_SYSTEM_MIXED; if (state.movable) st |= STATE_SYSTEM_MOVEABLE; if (state.multiSelectable) st |= STATE_SYSTEM_MULTISELECTABLE; if (state.offscreen) st |= STATE_SYSTEM_OFFSCREEN; if (state.pressed) st |= STATE_SYSTEM_PRESSED; if (state.passwordEdit) st |= STATE_SYSTEM_PROTECTED; if (state.readOnly) st |= STATE_SYSTEM_READONLY; if (state.selectable) st |= STATE_SYSTEM_SELECTABLE; if (state.selected) st |= STATE_SYSTEM_SELECTED; if (state.selfVoicing) st |= STATE_SYSTEM_SELFVOICING; if (state.sizeable) st |= STATE_SYSTEM_SIZEABLE; if (state.traversed) st |= STATE_SYSTEM_TRAVERSED; (*pvarState).vt = VT_I4; (*pvarState).lVal = st; return S_OK; }