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 .
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/implbase1.hxx>
36 #include <cppuhelper/interfacecontainer.hxx>
37 #include <unotools/accessiblestatesethelper.hxx>
41 #include <boost/shared_ptr.hpp>
46 /** Base class for all Chart Accessibility objects except the root node (see AccessibleChartView)
48 This class contains a reference to the ChartModel, thus, components can easily access all core functionality.
53 <li>define the getAccessibleName() method of XAccessibleContext</li>
54 <li>set the ChartModel using SetChartModel() for the first node before
55 creating any children</li>
56 <li>override UpdateChildren()</li>
62 typedef ::cppu::ImplInheritanceHelper1
<
64 ::com::sun::star::accessibility::XAccessibleExtendedComponent
65 > AccessibleChartElement_Base
;
68 class AccessibleChartElement
:
69 public impl::AccessibleChartElement_Base
72 AccessibleChartElement( const AccessibleElementInfo
& rAccInfo
,
73 bool bMayHaveChildren
,
74 bool bAlwaysTransparent
= false );
75 virtual ~AccessibleChartElement();
77 // ________ AccessibleBase ________
78 virtual bool ImplUpdateChildren() SAL_OVERRIDE
;
79 virtual ::com::sun::star::uno::Reference
<
80 ::com::sun::star::accessibility::XAccessible
>
81 ImplGetAccessibleChildById( sal_Int32 i
) const
82 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
83 ::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
84 virtual sal_Int32
ImplGetAccessibleChildCount() const
85 throw (::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
87 // ________ XAccessibleContext ________
88 virtual OUString SAL_CALL
getAccessibleName()
89 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 virtual OUString SAL_CALL
getAccessibleDescription()
91 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 // ________ XAccessibleExtendedComponent ________
94 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XFont
> SAL_CALL
getFont()
95 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 virtual OUString SAL_CALL
getTitledBorderText()
97 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 virtual OUString SAL_CALL
getToolTipText()
99 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 // the following interface is implemented in AccessibleBase, however it is
102 // also a (non-virtual) base class of XAccessibleExtendedComponent Thus
103 // these methods have to be overridden and forward to AccessibleBase
105 // ________ XAccessibleComponent ________
106 virtual sal_Bool SAL_CALL
containsPoint( const ::com::sun::star::awt::Point
& aPoint
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getAccessibleAtPoint( const ::com::sun::star::awt::Point
& aPoint
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 virtual ::com::sun::star::awt::Rectangle SAL_CALL
getBounds() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual ::com::sun::star::awt::Point SAL_CALL
getLocation() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
110 virtual ::com::sun::star::awt::Point SAL_CALL
getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 virtual ::com::sun::star::awt::Size SAL_CALL
getSize() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual void SAL_CALL
grabFocus() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 virtual sal_Int32 SAL_CALL
getForeground() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 virtual sal_Int32 SAL_CALL
getBackground() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 // ________ XServiceInfo ________
117 virtual OUString SAL_CALL
getImplementationName()
118 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
122 ::com::sun::star::uno::Reference
<
123 ::com::sun::star::accessibility::XAccessibleContext
>
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */