1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/accessibility/XAccessible.hpp>
23 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
24 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
25 #include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
26 #include <com/sun/star/awt/Rectangle.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <cppuhelper/implbase3.hxx>
29 #include <comphelper/accessiblecomponenthelper.hxx>
30 #include <sal/types.h>
32 class SmElementsControl
;
34 typedef ::cppu::ImplHelper3
<css::lang::XServiceInfo
, css::accessibility::XAccessible
,
35 css::accessibility::XAccessibleAction
>
36 AccessibleSmElement_BASE
;
38 class AccessibleSmElement final
: public comphelper::OAccessibleComponentHelper
,
39 public AccessibleSmElement_BASE
41 SmElementsControl
* m_pSmElementsControl
;
42 const sal_Int32 m_nIndexInParent
; ///< index in the parent XAccessible
43 const sal_uInt16 m_nItemId
; ///< index in the SmElementsControl
47 ~AccessibleSmElement() override
;
48 void SAL_CALL
disposing() override
;
49 css::awt::Rectangle
implGetBounds() override
;
51 void testAction(sal_Int32
) const;
54 explicit AccessibleSmElement(SmElementsControl
* pSmElementsControl
, sal_uInt16 nItemId
,
55 sal_Int32 nIndexInParent
);
57 void SetFocus(bool _bFocus
);
58 sal_uInt16
itemId() const { return m_nItemId
; }
61 DECLARE_XTYPEPROVIDER()
64 css::uno::Reference
<css::accessibility::XAccessibleContext
>
65 SAL_CALL
getAccessibleContext() override
;
68 OUString SAL_CALL
getImplementationName() override
;
69 sal_Bool SAL_CALL
supportsService(const OUString
& rServiceName
) override
;
70 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
73 sal_Int32 SAL_CALL
getAccessibleChildCount() override
;
74 css::uno::Reference
<css::accessibility::XAccessible
>
75 SAL_CALL
getAccessibleChild(sal_Int32 i
) override
;
76 css::uno::Reference
<css::accessibility::XAccessible
> SAL_CALL
getAccessibleParent() override
;
77 sal_Int32 SAL_CALL
getAccessibleIndexInParent() override
;
78 sal_Int16 SAL_CALL
getAccessibleRole() override
;
79 OUString SAL_CALL
getAccessibleDescription() override
;
80 OUString SAL_CALL
getAccessibleName() override
;
81 css::uno::Reference
<css::accessibility::XAccessibleRelationSet
>
82 SAL_CALL
getAccessibleRelationSet() override
;
83 css::uno::Reference
<css::accessibility::XAccessibleStateSet
>
84 SAL_CALL
getAccessibleStateSet() override
;
86 // XAccessibleComponent
87 css::uno::Reference
<css::accessibility::XAccessible
>
88 SAL_CALL
getAccessibleAtPoint(const css::awt::Point
& aPoint
) override
;
89 void SAL_CALL
grabFocus() override
;
90 sal_Int32 SAL_CALL
getForeground() override
;
91 sal_Int32 SAL_CALL
getBackground() override
;
94 sal_Int32 SAL_CALL
getAccessibleActionCount() override
;
95 sal_Bool SAL_CALL
doAccessibleAction(sal_Int32 nIndex
) override
;
96 OUString SAL_CALL
getAccessibleActionDescription(sal_Int32 nIndex
) override
;
97 css::uno::Reference
<css::accessibility::XAccessibleKeyBinding
>
98 SAL_CALL
getAccessibleActionKeyBinding(sal_Int32 nIndex
) override
;
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */