Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / chart2 / source / controller / accessibility / AccessibleChartElement.hxx
blob1e79f684b84cb0857f634ea42dfb828fb62f710a
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_CHART2_SOURCE_CONTROLLER_ACCESSIBILITY_ACCESSIBLECHARTELEMENT_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_ACCESSIBILITY_ACCESSIBLECHARTELEMENT_HXX
22 #include <AccessibleBase.hxx>
23 #include <com/sun/star/chart2/XChartDocument.hpp>
24 #include <com/sun/star/accessibility/XAccessible.hpp>
25 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
26 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/document/XEventListener.hpp>
29 #include <com/sun/star/lang/XEventListener.hpp>
30 #include <com/sun/star/lang/DisposedException.hpp>
31 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
32 #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
33 #include <com/sun/star/view/XSelectionSupplier.hpp>
34 #include <comphelper/accessibleeventnotifier.hxx>
35 #include <cppuhelper/implbase.hxx>
36 #include <cppuhelper/interfacecontainer.hxx>
37 #include <unotools/accessiblestatesethelper.hxx>
39 #include <vector>
40 #include <map>
42 namespace chart
45 /** Base class for all Chart Accessibility objects except the root node (see AccessibleChartView)
47 This class contains a reference to the ChartModel, thus, components can easily access all core functionality.
49 Usage Instructions:
51 <ul>
52 <li>define the getAccessibleName() method of XAccessibleContext</li>
53 <li>set the ChartModel using SetChartModel() for the first node before
54 creating any children</li>
55 <li>override UpdateChildren()</li>
56 </ul>
59 namespace impl
61 typedef ::cppu::ImplInheritanceHelper<
62 AccessibleBase,
63 css::accessibility::XAccessibleExtendedComponent
64 > AccessibleChartElement_Base;
67 class AccessibleChartElement :
68 public impl::AccessibleChartElement_Base
70 public:
71 AccessibleChartElement( const AccessibleElementInfo & rAccInfo,
72 bool bMayHaveChildren );
73 virtual ~AccessibleChartElement() override;
75 // ________ AccessibleBase ________
76 virtual bool ImplUpdateChildren() override;
77 virtual css::uno::Reference< css::accessibility::XAccessible >
78 ImplGetAccessibleChildById( sal_Int32 i ) const override;
79 virtual sal_Int32 ImplGetAccessibleChildCount() const override;
81 // ________ XAccessibleContext ________
82 virtual OUString SAL_CALL getAccessibleName() override;
83 virtual OUString SAL_CALL getAccessibleDescription() override;
85 // ________ XAccessibleExtendedComponent ________
86 virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override;
87 virtual OUString SAL_CALL getTitledBorderText() override;
88 virtual OUString SAL_CALL getToolTipText() override;
90 // the following interface is implemented in AccessibleBase, however it is
91 // also a (non-virtual) base class of XAccessibleExtendedComponent Thus
92 // these methods have to be overridden and forward to AccessibleBase
94 // ________ XAccessibleComponent ________
95 virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
96 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
97 virtual css::awt::Rectangle SAL_CALL getBounds() override;
98 virtual css::awt::Point SAL_CALL getLocation() override;
99 virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
100 virtual css::awt::Size SAL_CALL getSize() override;
101 virtual void SAL_CALL grabFocus() override;
102 virtual sal_Int32 SAL_CALL getForeground() override;
103 virtual sal_Int32 SAL_CALL getBackground() override;
105 // ________ XServiceInfo ________
106 virtual OUString SAL_CALL getImplementationName() override;
108 private:
109 bool m_bHasText;
110 css::uno::Reference< css::accessibility::XAccessibleContext >
111 m_xTextHelper;
113 void InitTextEdit();
116 } // namespace chart
118 #endif
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */