xref: /AOO41X/main/chart2/source/controller/accessibility/AccessibleChartElement.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _CHART2_ACCESSIBLECHARTELEMENT_HXX_
28*cdf0e10cSrcweir #define _CHART2_ACCESSIBLECHARTELEMENT_HXX_
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include "AccessibleBase.hxx"
31*cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp>
32*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleContext.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
36*cdf0e10cSrcweir #include <com/sun/star/document/XEventListener.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/lang/DisposedException.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
41*cdf0e10cSrcweir #include <com/sun/star/view/XSelectionSupplier.hpp>
42*cdf0e10cSrcweir #include <comphelper/accessibleeventnotifier.hxx>
43*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
44*cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
45*cdf0e10cSrcweir #include <unotools/accessiblestatesethelper.hxx>
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir #include <vector>
48*cdf0e10cSrcweir #include <map>
49*cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir class SfxItemSet;
52*cdf0e10cSrcweir class SdrObject;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir namespace chart
55*cdf0e10cSrcweir {
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir /** Base class for all Chart Accessibility objects except the root node (see AccessibleChartView)
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir     This class contains a reference to the ChartModel, thus, components can easily access all core functionality.
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir     Usage Instructions:
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir     <ul>
64*cdf0e10cSrcweir      <li>define the getAccessibleName() method of XAccessibleContext</li>
65*cdf0e10cSrcweir      <li>set the ChartModel using SetChartModel() for the first node before
66*cdf0e10cSrcweir          creating any children</li>
67*cdf0e10cSrcweir      <li>overload UpdateChildren()</li>
68*cdf0e10cSrcweir     </ul>
69*cdf0e10cSrcweir  */
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir namespace impl
72*cdf0e10cSrcweir {
73*cdf0e10cSrcweir typedef ::cppu::ImplInheritanceHelper1<
74*cdf0e10cSrcweir         AccessibleBase,
75*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleExtendedComponent
76*cdf0e10cSrcweir         > AccessibleChartElement_Base;
77*cdf0e10cSrcweir }
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir class AccessibleChartElement :
80*cdf0e10cSrcweir     public impl::AccessibleChartElement_Base
81*cdf0e10cSrcweir {
82*cdf0e10cSrcweir public:
83*cdf0e10cSrcweir     AccessibleChartElement( const AccessibleElementInfo & rAccInfo,
84*cdf0e10cSrcweir                             bool bMayHaveChildren,
85*cdf0e10cSrcweir                             bool bAlwaysTransparent = false );
86*cdf0e10cSrcweir     virtual ~AccessibleChartElement();
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir     // ________ AccessibleBase ________
89*cdf0e10cSrcweir     virtual bool ImplUpdateChildren();
90*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
91*cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessible >
92*cdf0e10cSrcweir         ImplGetAccessibleChildById( sal_Int32 i ) const
93*cdf0e10cSrcweir         throw (::com::sun::star::lang::IndexOutOfBoundsException,
94*cdf0e10cSrcweir                ::com::sun::star::uno::RuntimeException);
95*cdf0e10cSrcweir     virtual sal_Int32 ImplGetAccessibleChildCount() const
96*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir     // ________ XAccessibleContext ________
99*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleName()
100*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
101*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleDescription()
102*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir     // ________ XAccessibleExtendedComponent ________
105*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont()
106*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
107*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getTitledBorderText()
108*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
109*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getToolTipText()
110*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir     // the following interface is implemented in AccessibleBase, however it is
113*cdf0e10cSrcweir     // also a (non-virtual) base class of XAccessibleExtendedComponent Thus
114*cdf0e10cSrcweir     // these methods have to be overloaded and forward to AccessibleBase
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir     // ________ XAccessibleComponent ________
117*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
118*cdf0e10cSrcweir     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);
119*cdf0e10cSrcweir     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw (::com::sun::star::uno::RuntimeException);
120*cdf0e10cSrcweir     virtual ::com::sun::star::awt::Point SAL_CALL getLocation() throw (::com::sun::star::uno::RuntimeException);
121*cdf0e10cSrcweir     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException);
122*cdf0e10cSrcweir     virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw (::com::sun::star::uno::RuntimeException);
123*cdf0e10cSrcweir     virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException);
124*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getForeground() throw (::com::sun::star::uno::RuntimeException);
125*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getBackground() throw (::com::sun::star::uno::RuntimeException);
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     // ________ XServiceInfo ________
128*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName()
129*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir private:
132*cdf0e10cSrcweir     bool                m_bHasText;
133*cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
134*cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleContext >
135*cdf0e10cSrcweir                         m_xTextHelper;
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir     void InitTextEdit();
138*cdf0e10cSrcweir };
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir }  // namespace chart
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir #endif
143