// 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::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; }