summaryrefslogtreecommitdiff
path: root/vcl/inc/accessibility
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-12-04 15:48:51 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-12-04 20:47:30 +0100
commit739b0716504d2526fb7283100420e4bd5eacb7c2 (patch)
tree3e1281c0c74ffa5a25267e1a8b953df762c364bb /vcl/inc/accessibility
parent3d780e72b93773a25f796feb488b0fd878c490b5 (diff)
a11y: Move menu a11y classes to vcl, no more use factory
Other than most of the a11y implementations for vcl classes, VCLXAccessiblePopupMenu etc. do not make use of any VCLXWindow (i.e. UNO/toolkit wrapper of a vcl::Window) and thus do not depend on the toolkit module, which the accessibility module depends on. Therefore, there's also no need to use the accessible factory to create them (which is needed when toolkit classes are involved to avoid a dependency cycle). Move those classes from the accessibility module to vcl and add a new method Menu::CreateAccessible and move the logic from AccessibleFactory::createAccessible there. Drop the now unnecessary factory methods previously used for those classes. No change in behavior intended (yet), but this also simplifies the code involved for the tdf#164093 scenario. Change-Id: Ie3f6f1a02bf6662206d31383473cdc868e1f9164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177812 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/inc/accessibility')
-rw-r--r--vcl/inc/accessibility/accessiblemenubasecomponent.hxx124
-rw-r--r--vcl/inc/accessibility/accessiblemenucomponent.hxx78
-rw-r--r--vcl/inc/accessibility/accessiblemenuitemcomponent.hxx86
-rw-r--r--vcl/inc/accessibility/vclxaccessiblemenu.hxx68
-rw-r--r--vcl/inc/accessibility/vclxaccessiblemenubar.hxx62
-rw-r--r--vcl/inc/accessibility/vclxaccessiblemenuitem.hxx101
-rw-r--r--vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx37
-rw-r--r--vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx43
8 files changed, 599 insertions, 0 deletions
diff --git a/vcl/inc/accessibility/accessiblemenubasecomponent.hxx b/vcl/inc/accessibility/accessiblemenubasecomponent.hxx
new file mode 100644
index 000000000000..4ddcdd791e1b
--- /dev/null
+++ b/vcl/inc/accessibility/accessiblemenubasecomponent.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <comphelper/accessiblecomponenthelper.hxx>
+#include <cppuhelper/implbase.hxx>
+#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
+
+#include <vector>
+
+class Menu;
+class VclSimpleEvent;
+class VclMenuEvent;
+
+class OAccessibleMenuItemComponent;
+
+class OAccessibleMenuBaseComponent : public cppu::ImplInheritanceHelper<
+ comphelper::OAccessibleExtendedComponentHelper,
+ css::accessibility::XAccessible,
+ css::lang::XServiceInfo>
+{
+ friend class OAccessibleMenuItemComponent;
+ friend class VCLXAccessibleMenuItem;
+ friend class VCLXAccessibleMenu;
+
+protected:
+ std::vector<rtl::Reference<OAccessibleMenuItemComponent>> m_aAccessibleChildren;
+ VclPtr<Menu> m_pMenu;
+
+ bool m_bEnabled;
+ bool m_bFocused;
+ bool m_bVisible;
+ bool m_bSelected;
+ bool m_bChecked;
+
+ virtual bool IsEnabled();
+ virtual bool IsFocused();
+ virtual bool IsVisible();
+ virtual bool IsSelected();
+ virtual bool IsChecked();
+
+ void SetEnabled( bool bEnabled );
+ void SetFocused( bool bFocused );
+ void SetVisible( bool bVisible );
+ void SetSelected( bool bSelected );
+ void SetChecked( bool bChecked );
+
+ void UpdateEnabled( sal_Int32 i, bool bEnabled );
+ void UpdateFocused( sal_Int32 i, bool bFocused );
+ void UpdateVisible();
+ void UpdateSelected( sal_Int32 i, bool bSelected );
+ void UpdateChecked( sal_Int32 i, bool bChecked );
+ void UpdateAccessibleName( sal_Int32 i );
+ void UpdateItemRole(sal_Int32 i);
+ void UpdateItemText( sal_Int32 i );
+
+ sal_Int64 GetChildCount() const;
+
+ css::uno::Reference< css::accessibility::XAccessible > GetChild( sal_Int64 i );
+ css::uno::Reference< css::accessibility::XAccessible > GetChildAt( const css::awt::Point& rPoint );
+
+ void InsertChild( sal_Int32 i );
+ void RemoveChild( sal_Int32 i );
+
+ virtual bool IsHighlighted();
+ bool IsChildHighlighted();
+
+ virtual bool IsMenuHideDisabledEntries();
+
+ void SelectChild( sal_Int32 i );
+ void DeSelectAll();
+ bool IsChildSelected( sal_Int32 i );
+
+ virtual void Click();
+ virtual bool IsPopupMenuOpen();
+
+ DECL_LINK( MenuEventListener, VclMenuEvent&, void );
+
+ void ProcessMenuEvent( const VclMenuEvent& rVclMenuEvent );
+
+ virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) = 0;
+
+ // XComponent
+ virtual void SAL_CALL disposing() override;
+
+public:
+ OAccessibleMenuBaseComponent( Menu* pMenu );
+ virtual ~OAccessibleMenuBaseComponent() override;
+
+ void SetStates();
+
+ // XServiceInfo
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
+
+ // XAccessible
+ virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/accessiblemenucomponent.hxx b/vcl/inc/accessibility/accessiblemenucomponent.hxx
new file mode 100644
index 000000000000..2954b52119e5
--- /dev/null
+++ b/vcl/inc/accessibility/accessiblemenucomponent.hxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/accessiblemenubasecomponent.hxx>
+
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include <cppuhelper/implbase.hxx>
+
+
+
+class OAccessibleMenuComponent : public cppu::ImplInheritanceHelper<
+ OAccessibleMenuBaseComponent,
+ css::accessibility::XAccessibleSelection>
+{
+protected:
+ virtual bool IsEnabled() override;
+ virtual bool IsVisible() override;
+
+ virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
+
+ // OCommonAccessibleComponent
+ virtual css::awt::Rectangle implGetBounds( ) override;
+
+public:
+
+ OAccessibleMenuComponent( Menu* pMenu ): ImplInheritanceHelper(pMenu) {}
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
+ virtual OUString SAL_CALL getAccessibleDescription( ) override;
+ virtual OUString SAL_CALL getAccessibleName( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
+ virtual css::lang::Locale SAL_CALL getLocale( ) override;
+
+ // XAccessibleComponent
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
+ virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override;
+ virtual void SAL_CALL grabFocus( ) override;
+ virtual sal_Int32 SAL_CALL getForeground( ) override;
+ virtual sal_Int32 SAL_CALL getBackground( ) override;
+
+ // XAccessibleExtendedComponent
+ virtual OUString SAL_CALL getTitledBorderText( ) override;
+ virtual OUString SAL_CALL getToolTipText( ) override;
+
+ // XAccessibleSelection
+ virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
+ virtual void SAL_CALL clearAccessibleSelection( ) override;
+ virtual void SAL_CALL selectAllAccessibleChildren( ) override;
+ virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/accessiblemenuitemcomponent.hxx b/vcl/inc/accessibility/accessiblemenuitemcomponent.hxx
new file mode 100644
index 000000000000..58b819f8ad66
--- /dev/null
+++ b/vcl/inc/accessibility/accessiblemenuitemcomponent.hxx
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/accessiblemenubasecomponent.hxx>
+
+
+
+
+class OAccessibleMenuItemComponent : public OAccessibleMenuBaseComponent
+{
+ friend class OAccessibleMenuBaseComponent;
+
+protected:
+ VclPtr<Menu> m_pParent;
+ sal_uInt16 m_nItemPos;
+ OUString m_sAccessibleName;
+ OUString m_sItemText;
+
+ virtual bool IsEnabled() override;
+ virtual bool IsVisible() override;
+ void Select();
+ void DeSelect();
+ virtual void Click() override;
+
+ void SetItemPos( sal_uInt16 nItemPos );
+ void SetAccessibleName( const OUString& sAccessibleName );
+ OUString GetAccessibleName();
+ void SetItemText( const OUString& sItemText );
+ OUString GetItemText();
+
+ virtual bool IsMenuHideDisabledEntries() override;
+
+ virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
+
+ // OCommonAccessibleComponent
+ virtual css::awt::Rectangle implGetBounds( ) override;
+
+ // XComponent
+ virtual void SAL_CALL disposing() override;
+
+public:
+ OAccessibleMenuItemComponent( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu );
+ virtual ~OAccessibleMenuItemComponent() override;
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override;
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
+ virtual OUString SAL_CALL getAccessibleDescription( ) override;
+ virtual OUString SAL_CALL getAccessibleName( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
+ virtual css::lang::Locale SAL_CALL getLocale( ) override;
+
+ // XAccessibleComponent
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
+ virtual void SAL_CALL grabFocus( ) override;
+ virtual sal_Int32 SAL_CALL getForeground( ) override;
+ virtual sal_Int32 SAL_CALL getBackground( ) override;
+
+ // XAccessibleExtendedComponent
+ virtual OUString SAL_CALL getTitledBorderText( ) override;
+ virtual OUString SAL_CALL getToolTipText( ) override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/vclxaccessiblemenu.hxx b/vcl/inc/accessibility/vclxaccessiblemenu.hxx
new file mode 100644
index 000000000000..3f6903587166
--- /dev/null
+++ b/vcl/inc/accessibility/vclxaccessiblemenu.hxx
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/vclxaccessiblemenuitem.hxx>
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+
+#include <cppuhelper/implbase.hxx>
+
+
+
+
+class VCLXAccessibleMenu final :
+ public cppu::ImplInheritanceHelper<
+ VCLXAccessibleMenuItem, css::accessibility::XAccessibleSelection>
+{
+ virtual bool IsFocused() override;
+ virtual bool IsPopupMenuOpen() override;
+ sal_Int64 implGetSelectedAccessibleChildCount();
+
+public:
+ VCLXAccessibleMenu( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr ):
+ ImplInheritanceHelper(pParent, nItemPos, pMenu) {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
+
+ // XAccessibleComponent
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
+
+ // XAccessibleSelection
+ virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
+ virtual void SAL_CALL clearAccessibleSelection( ) override;
+ virtual void SAL_CALL selectAllAccessibleChildren( ) override;
+ virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override;
+
+ // XAccessibleAction
+ virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/vclxaccessiblemenubar.hxx b/vcl/inc/accessibility/vclxaccessiblemenubar.hxx
new file mode 100644
index 000000000000..31e50c8b75ff
--- /dev/null
+++ b/vcl/inc/accessibility/vclxaccessiblemenubar.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/accessiblemenucomponent.hxx>
+#include <vcl/vclptr.hxx>
+
+class VclSimpleEvent;
+class VclWindowEvent;
+namespace vcl { class Window; }
+
+
+
+
+class VCLXAccessibleMenuBar final : public OAccessibleMenuComponent
+{
+ VclPtr<vcl::Window> m_pWindow;
+
+ virtual bool IsFocused() override;
+
+ DECL_LINK( WindowEventListener, VclWindowEvent&, void );
+
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+
+ // XComponent
+ virtual void SAL_CALL disposing() override;
+
+public:
+ VCLXAccessibleMenuBar( Menu* pMenu );
+ virtual ~VCLXAccessibleMenuBar() override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override;
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
+
+ // XAccessibleExtendedComponent
+ virtual sal_Int32 SAL_CALL getBackground( ) override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/vclxaccessiblemenuitem.hxx b/vcl/inc/accessibility/vclxaccessiblemenuitem.hxx
new file mode 100644
index 000000000000..ddde3cda04b6
--- /dev/null
+++ b/vcl/inc/accessibility/vclxaccessiblemenuitem.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/accessiblemenuitemcomponent.hxx>
+
+#include <com/sun/star/accessibility/AccessibleScrollType.hpp>
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+
+#include <cppuhelper/implbase.hxx>
+#include <comphelper/accessibletexthelper.hxx>
+
+
+
+
+class VCLXAccessibleMenuItem : public cppu::ImplInheritanceHelper<
+ OAccessibleMenuItemComponent,
+ css::accessibility::XAccessibleText,
+ css::accessibility::XAccessibleAction,
+ css::accessibility::XAccessibleValue>,
+ public ::comphelper::OCommonAccessibleText
+{
+protected:
+ virtual bool IsFocused() override;
+ virtual bool IsSelected() override;
+ bool IsCheckable();
+ virtual bool IsChecked() override;
+
+ virtual bool IsHighlighted() override;
+
+ virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
+
+ // OCommonAccessibleText
+ virtual OUString implGetText() final override;
+ virtual css::lang::Locale implGetLocale() override;
+ virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override final;
+
+public:
+ VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr );
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+
+ // XAccessibleContext
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
+
+ // XAccessibleText
+ virtual sal_Int32 SAL_CALL getCaretPosition() override;
+ virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) final override;
+ virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
+ virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
+ virtual sal_Int32 SAL_CALL getCharacterCount() final override;
+ virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
+ virtual OUString SAL_CALL getSelectedText() override final;
+ virtual sal_Int32 SAL_CALL getSelectionStart() override final;
+ virtual sal_Int32 SAL_CALL getSelectionEnd() override final;
+ virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual OUString SAL_CALL getText() final override;
+ virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
+ virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override;
+
+ // XAccessibleAction
+ virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) final override;
+ virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
+ virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
+
+ // XAccessibleValue
+ virtual css::uno::Any SAL_CALL getCurrentValue( ) override;
+ virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) override;
+ virtual css::uno::Any SAL_CALL getMaximumValue( ) override;
+ virtual css::uno::Any SAL_CALL getMinimumValue( ) override;
+ virtual css::uno::Any SAL_CALL getMinimumIncrement( ) override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx b/vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx
new file mode 100644
index 000000000000..ce971ca49ac0
--- /dev/null
+++ b/vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/accessiblemenuitemcomponent.hxx>
+
+class VCLXAccessibleMenuSeparator final : public OAccessibleMenuItemComponent
+{
+public:
+ VCLXAccessibleMenuSeparator(Menu* pParent, sal_uInt16 nItemPos);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ // XAccessibleContext
+ virtual sal_Int16 SAL_CALL getAccessibleRole() override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx b/vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx
new file mode 100644
index 000000000000..6f099b722452
--- /dev/null
+++ b/vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <accessibility/accessiblemenucomponent.hxx>
+
+class VCLXAccessiblePopupMenu final : public OAccessibleMenuComponent
+{
+ virtual bool IsFocused() override;
+
+public:
+ using OAccessibleMenuComponent::OAccessibleMenuComponent;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
+ virtual sal_Int16 SAL_CALL getAccessibleRole() override;
+
+ // XAccessibleExtendedComponent
+ virtual sal_Int32 SAL_CALL getBackground() override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */