Bump version to 21.06.18.1
[LibreOffice.git] / starmath / inc / AccessibleSmElementsControl.hxx
blob66cbd80bcef4f47015b2175b20bf91ad2cb8b669
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_STARMATH_INC_ACCESSIBLESMELEMENTSCONTROL_HXX
20 #define INCLUDED_STARMATH_INC_ACCESSIBLESMELEMENTSCONTROL_HXX
22 #include <comphelper/accessiblecomponenthelper.hxx>
23 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <cppuhelper/implbase3.hxx>
26 #include <vcl/vclptr.hxx>
28 #include <vector>
30 class AccessibleSmElement;
31 class SmElementsControl;
33 typedef ::cppu::ImplHelper3<css::lang::XServiceInfo, css::accessibility::XAccessible,
34 css::accessibility::XAccessibleSelection>
35 AccessibleSmElementsControl_BASE;
37 class AccessibleSmElementsControl final : public comphelper::OAccessibleComponentHelper,
38 public AccessibleSmElementsControl_BASE
40 std::vector<rtl::Reference<AccessibleSmElement>> m_aAccessibleChildren;
41 SmElementsControl* m_pControl;
43 void UpdateFocus(sal_uInt16);
44 inline void TestControl();
46 ~AccessibleSmElementsControl() override;
47 void SAL_CALL disposing() override;
48 css::awt::Rectangle implGetBounds() override;
50 public:
51 AccessibleSmElementsControl(SmElementsControl& rControl);
53 void ReleaseAllItems();
54 void AddAllItems();
55 inline void AcquireFocus();
56 inline void ReleaseFocus(sal_uInt16);
58 DECLARE_XINTERFACE()
59 DECLARE_XTYPEPROVIDER()
61 // XAccessible
62 css::uno::Reference<css::accessibility::XAccessibleContext>
63 SAL_CALL getAccessibleContext() override;
65 // XServiceInfo
66 OUString SAL_CALL getImplementationName() override;
67 sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
68 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
70 // XAccessibleComponent
71 sal_Bool SAL_CALL containsPoint(const css::awt::Point& aPoint) override;
72 css::uno::Reference<css::accessibility::XAccessible>
73 SAL_CALL getAccessibleAtPoint(const css::awt::Point& aPoint) override;
74 void SAL_CALL grabFocus() override;
75 sal_Int32 SAL_CALL getForeground() override;
76 sal_Int32 SAL_CALL getBackground() override;
78 // XAccessibleContext
79 sal_Int32 SAL_CALL getAccessibleChildCount() override;
80 css::uno::Reference<css::accessibility::XAccessible>
81 SAL_CALL getAccessibleChild(sal_Int32 i) override;
82 css::uno::Reference<css::accessibility::XAccessible> SAL_CALL getAccessibleParent() override;
83 sal_Int16 SAL_CALL getAccessibleRole() override;
84 OUString SAL_CALL getAccessibleDescription() override;
85 OUString SAL_CALL getAccessibleName() override;
86 css::uno::Reference<css::accessibility::XAccessibleRelationSet>
87 SAL_CALL getAccessibleRelationSet() override;
88 css::uno::Reference<css::accessibility::XAccessibleStateSet>
89 SAL_CALL getAccessibleStateSet() override;
91 // XAccessibleSelection
92 void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override;
93 sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override;
94 void SAL_CALL clearAccessibleSelection() override;
95 void SAL_CALL selectAllAccessibleChildren() override;
96 sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override;
97 css::uno::Reference<css::accessibility::XAccessible>
98 SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override;
99 void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override;
102 void AccessibleSmElementsControl::AcquireFocus() { UpdateFocus(SAL_MAX_UINT16); }
104 void AccessibleSmElementsControl::ReleaseFocus(sal_uInt16 nPos) { UpdateFocus(nPos); }
106 #endif // INCLUDED_STARMATH_INC_ACCESSIBLESMELEMENTSCONTROL_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */