30#include <com/sun/star/accessibility/XAccessible.hpp>
31#include <com/sun/star/accessibility/AccessibleRole.hpp>
32#include <com/sun/star/accessibility/AccessibleStateType.hpp>
33#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
34#include <com/sun/star/awt/XVclWindowPeer.hpp>
71 return css::uno::Reference< css::accessibility::XAccessible >();
80 css::uno::Reference< css::accessibility::XAccessible > xAcc(
GetComponentInterface(), css::uno::UNO_QUERY );
127 while( pWorkWin && (pWorkWin ==
this) )
150 sal_uInt16 nChildren = 0;
197 sal_uInt16 nChildren =
n;
213 SAL_WARN_IF( !pChild,
"vcl",
"GetAccessibleChildWindow(): wrong index in border window");
228 SAL_WARN_IF(
mpWindowImpl->mpAccessibleInfos->nAccessibleRole != 0xFFFF,
"vcl",
"AccessibleRole already set!" );
229 mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole;
234 sal_uInt16 nRole = 0xFFFF;
263 case WindowType::EDIT: nRole =
static_cast<Edit const *
>(
this)->IsPassword() ? accessibility::AccessibleRole::PASSWORD_TEXT : accessibility::AccessibleRole::TEXT;
break;
280 nRole = accessibility::AccessibleRole::LABEL;
282 nRole = accessibility::AccessibleRole::SEPARATOR;
312 accessibility::AccessibleRole::PANEL;
break;
317 accessibility::AccessibleRole::WINDOW;
break;
335 nRole = accessibility::AccessibleRole::FRAME;
337 nRole = accessibility::AccessibleRole::SCROLL_PANE;
339 nRole = accessibility::AccessibleRole::WINDOW;
344 nRole = accessibility::AccessibleRole::PANEL;
355 if ( nRole == 0xFFFF )
367 mpWindowImpl->mpAccessibleInfos->pAccessibleName = rName;
378 return *
mpWindowImpl->mpAccessibleInfos->pAccessibleName;
384 OUString aAccessibleName;
409 if ( pLabel && pLabel !=
this )
410 aAccessibleName = pLabel->
GetText();
411 if (aAccessibleName.isEmpty())
413 if (aAccessibleName.isEmpty())
421 if (aAccessibleName.isEmpty())
424 if (aAccessibleName.isEmpty())
450 std::optional<OUString>& rCurrentDescription =
mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
451 SAL_WARN_IF( rCurrentDescription && *rCurrentDescription != rDescription,
"vcl",
"AccessibleDescription already set" );
452 rCurrentDescription = rDescription;
460 OUString aAccessibleDescription;
463 aAccessibleDescription = *
mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
476 return aAccessibleDescription;
483 mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy;
490 mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
504 return mpWindowImpl->mpAccessibleInfos->pLabelForWindow;
525 return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow;
528 if (!aMnemonicLabels.empty())
531 for (
auto const & rCandidate : aMnemonicLabels)
533 if (rCandidate->IsVisible())
536 return aMnemonicLabels[0];
547 if( !bTraverseParentPath )
554 if( pParent->
mpWindowImpl->mbSuppressAccessibilityEvents )
565 mpWindowImpl->mbSuppressAccessibilityEvents = bSuppressed;
570uno::Reference<accessibility::XAccessibleEditableText>
574 return uno::Reference<accessibility::XAccessibleEditableText>();
576 sal_Int64
nState = xContext->getAccessibleStateSet();
577 if (
nState & accessibility::AccessibleStateType::FOCUSED)
579 uno::Reference<accessibility::XAccessibleEditableText> xText(xContext, uno::UNO_QUERY);
582 if (
nState & accessibility::AccessibleStateType::MANAGES_DESCENDANTS)
583 return uno::Reference<accessibility::XAccessibleEditableText>();
586 bool bSafeToIterate =
true;
587 sal_Int64
nCount = xContext->getAccessibleChildCount();
589 bSafeToIterate =
false;
591 return uno::Reference<accessibility::XAccessibleEditableText>();
593 for (sal_Int64
i = 0;
i < xContext->getAccessibleChildCount(); ++
i)
595 uno::Reference<accessibility::XAccessible> xChild = xContext->getAccessibleChild(
i);
598 uno::Reference<accessibility::XAccessibleContext> xChildContext
599 = xChild->getAccessibleContext();
600 if (!xChildContext.is())
602 uno::Reference<accessibility::XAccessibleEditableText> xText
607 return uno::Reference<accessibility::XAccessibleEditableText>();
uno::Reference< accessibility::XAccessibleEditableText > FindFocusedEditableText(uno::Reference< accessibility::XAccessibleContext > const &xContext)
VclPtr< vcl::Window > mpMenuBarWindow
MenuBar * GetMenuBar() const
virtual vcl::Window * getAccessibleRelationLabelFor() const
vcl::Window * GetAccessibleChildWindow(sal_uInt16 n)
vcl::Window * GetParent() const
sal_uInt16 GetAccessibleRole() const
sal_uInt16 GetAccessibleChildWindowCount()
SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const
sal_uInt16 GetChildCount() const
WindowType GetType() const
SAL_DLLPRIVATE vcl::Window * getLegacyNonLayoutAccessibleRelationLabeledBy() const
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
SAL_DLLPRIVATE vcl::Window * getLegacyNonLayoutAccessibleRelationMemberOf() const
bool IsAccessibilityEventsSuppressed(bool bTraverseParentPath=true)
vcl::Window * GetAccessibleParentWindow() const
void SetAccessibleDescription(const OUString &rDescr)
vcl::Window * GetAccessibleRelationLabeledBy() const
const std::vector< VclPtr< FixedText > > & list_mnemonic_labels() const
virtual sal_uInt16 getDefaultAccessibleRole() const
void SetAccessibleName(const OUString &rName)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()
void SetAccessibleRole(sal_uInt16 nRole)
virtual css::uno::Reference< css::awt::XVclWindowPeer > GetComponentInterface(bool bCreate=true)
std::unique_ptr< WindowImpl > mpWindowImpl
virtual OUString getDefaultAccessibleName() const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
vcl::Window * GetAccessibleRelationLabelFor() const
vcl::Window * GetAccessibleRelationMemberOf() const
OUString GetAccessibleName() const
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
virtual OUString GetText() const
bool IsScrollable() const
void SetAccessibleRelationLabelFor(vcl::Window *pLabelFor)
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
bool IsMenuFloatingWindow() const
const OUString & GetQuickHelpText() const
void SetAccessibilityEventsSuppressed(bool bSuppressed)
void SetAccessibleRelationLabeledBy(vcl::Window *pLabeledBy)
vcl::Window * GetChild(sal_uInt16 nChild) const
OUString GetAccessibleDescription() const
SAL_DLLPRIVATE vcl::Window * getLegacyNonLayoutAccessibleRelationLabelFor() const
const OUString & GetHelpText() const
SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const
bool isContainerWindow(const vcl::Window &rWindow)
#define SAL_WARN_IF(condition, area, stream)
VclPtr< vcl::Window > pLabeledByWindow
sal_uInt16 nAccessibleRole
VclPtr< vcl::Window > pLabelForWindow
OUString removeMnemonicFromString(OUString const &rStr)
@ WindowFrameTitleChanged
WinBits const WB_MOVEABLE
WinBits const WB_OWNERDRAWDECORATION
WinBits const WB_SIZEABLE