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