xref: /AOO41X/main/chart2/source/controller/accessibility/AccessibleChartView.cxx (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 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_chart2.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "AccessibleChartView.hxx"
32*cdf0e10cSrcweir #include "chartview/ExplicitValueProvider.hxx"
33*cdf0e10cSrcweir #include "servicenames.hxx"
34*cdf0e10cSrcweir #include "macros.hxx"
35*cdf0e10cSrcweir #include "ObjectHierarchy.hxx"
36*cdf0e10cSrcweir #include "ObjectIdentifier.hxx"
37*cdf0e10cSrcweir #include "ResId.hxx"
38*cdf0e10cSrcweir #include "Strings.hrc"
39*cdf0e10cSrcweir #include "AccessibleViewForwarder.hxx"
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleStateType.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp>
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir #include <tools/string.hxx>
46*cdf0e10cSrcweir #include <vcl/window.hxx>
47*cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
48*cdf0e10cSrcweir // for SolarMutex
49*cdf0e10cSrcweir #include <vcl/svapp.hxx>
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir // header for typedef MutexGuard
52*cdf0e10cSrcweir #include <osl/mutex.hxx>
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir using namespace ::com::sun::star;
55*cdf0e10cSrcweir using namespace ::com::sun::star::accessibility;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir using ::com::sun::star::uno::Sequence;
58*cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
59*cdf0e10cSrcweir using ::com::sun::star::uno::WeakReference;
60*cdf0e10cSrcweir using ::com::sun::star::uno::Any;
61*cdf0e10cSrcweir using ::rtl::OUString;
62*cdf0e10cSrcweir using osl::MutexGuard;
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir //.............................................................................
65*cdf0e10cSrcweir namespace chart
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir //.............................................................................
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir AccessibleChartView::AccessibleChartView(
70*cdf0e10cSrcweir     const Reference< uno::XComponentContext >& xContext, SdrView* pView ) :
71*cdf0e10cSrcweir         impl::AccessibleChartView_Base(
72*cdf0e10cSrcweir             AccessibleElementInfo(), // empty for now
73*cdf0e10cSrcweir             true, // has children
74*cdf0e10cSrcweir             true  // always transparent
75*cdf0e10cSrcweir             ),
76*cdf0e10cSrcweir         m_xContext( xContext ),
77*cdf0e10cSrcweir         m_pSdrView( pView ),
78*cdf0e10cSrcweir         m_pViewForwarder( NULL )
79*cdf0e10cSrcweir {
80*cdf0e10cSrcweir     AddState( AccessibleStateType::OPAQUE );
81*cdf0e10cSrcweir }
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir AccessibleChartView::~AccessibleChartView()
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     delete m_pViewForwarder;
86*cdf0e10cSrcweir }
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir awt::Rectangle AccessibleChartView::GetWindowPosSize() const
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir     Reference< awt::XWindow > xWindow( GetInfo().m_xWindow );
92*cdf0e10cSrcweir     if( ! xWindow.is())
93*cdf0e10cSrcweir         return awt::Rectangle();
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir     // this should do, but it doesn't => HACK
96*cdf0e10cSrcweir //     return xWindow->getPosSize();
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir     awt::Rectangle aBBox( xWindow->getPosSize() );
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir     Window* pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow ));
101*cdf0e10cSrcweir     if( pWindow )
102*cdf0e10cSrcweir     {
103*cdf0e10cSrcweir         // /-- solar
104*cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
105*cdf0e10cSrcweir         Point aVCLPoint( pWindow->OutputToAbsoluteScreenPixel( Point( 0, 0 ) ));
106*cdf0e10cSrcweir         aBBox.X = aVCLPoint.getX();
107*cdf0e10cSrcweir         aBBox.Y = aVCLPoint.getY();
108*cdf0e10cSrcweir         // \-- solar
109*cdf0e10cSrcweir     }
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     return aBBox;
112*cdf0e10cSrcweir }
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir awt::Point AccessibleChartView::GetUpperLeftOnScreen() const
115*cdf0e10cSrcweir {
116*cdf0e10cSrcweir     awt::Point aParentPosition;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     awt::Rectangle aBBox( GetWindowPosSize() );
119*cdf0e10cSrcweir     aParentPosition.X = aBBox.X;
120*cdf0e10cSrcweir     aParentPosition.Y = aBBox.Y;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     return aParentPosition;
123*cdf0e10cSrcweir }
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir // ________ XAccessibleContext ________
126*cdf0e10cSrcweir OUString SAL_CALL AccessibleChartView::getAccessibleName()
127*cdf0e10cSrcweir     throw (uno::RuntimeException)
128*cdf0e10cSrcweir {
129*cdf0e10cSrcweir     return OUString( String( SchResId( STR_OBJECT_DIAGRAM )));
130*cdf0e10cSrcweir }
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir OUString SAL_CALL AccessibleChartView::getAccessibleDescription()
133*cdf0e10cSrcweir     throw (uno::RuntimeException)
134*cdf0e10cSrcweir {
135*cdf0e10cSrcweir     return getAccessibleName();
136*cdf0e10cSrcweir }
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir Reference< XAccessible > SAL_CALL AccessibleChartView::getAccessibleParent()
139*cdf0e10cSrcweir     throw (uno::RuntimeException)
140*cdf0e10cSrcweir {
141*cdf0e10cSrcweir     return Reference< XAccessible >( m_xParent );
142*cdf0e10cSrcweir }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleChartView::getAccessibleIndexInParent()
145*cdf0e10cSrcweir     throw (uno::RuntimeException)
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir     // the document is always the only child of the window
148*cdf0e10cSrcweir     return 0;
149*cdf0e10cSrcweir }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir sal_Int16 SAL_CALL AccessibleChartView::getAccessibleRole()
152*cdf0e10cSrcweir     throw (uno::RuntimeException)
153*cdf0e10cSrcweir {
154*cdf0e10cSrcweir     return AccessibleRole::DOCUMENT;
155*cdf0e10cSrcweir }
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir // ________ XAccessibleComponent ________
158*cdf0e10cSrcweir awt::Rectangle SAL_CALL AccessibleChartView::getBounds()
159*cdf0e10cSrcweir     throw (uno::RuntimeException)
160*cdf0e10cSrcweir {
161*cdf0e10cSrcweir     awt::Rectangle aResult( GetWindowPosSize());
162*cdf0e10cSrcweir     Reference< XAccessible > xParent( m_xParent );
163*cdf0e10cSrcweir     if( xParent.is())
164*cdf0e10cSrcweir     {
165*cdf0e10cSrcweir         Reference< XAccessibleComponent > xContext( xParent->getAccessibleContext(), uno::UNO_QUERY );
166*cdf0e10cSrcweir         if( xContext.is())
167*cdf0e10cSrcweir         {
168*cdf0e10cSrcweir             awt::Point aParentPosition = xContext->getLocationOnScreen();
169*cdf0e10cSrcweir             aResult.X -= aParentPosition.X;
170*cdf0e10cSrcweir             aResult.Y -= aParentPosition.Y;
171*cdf0e10cSrcweir         }
172*cdf0e10cSrcweir     }
173*cdf0e10cSrcweir     return aResult;
174*cdf0e10cSrcweir }
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir awt::Point SAL_CALL AccessibleChartView::getLocationOnScreen()
177*cdf0e10cSrcweir     throw (uno::RuntimeException)
178*cdf0e10cSrcweir {
179*cdf0e10cSrcweir     awt::Rectangle aBounds( getBounds());
180*cdf0e10cSrcweir     awt::Point aResult;
181*cdf0e10cSrcweir     Reference< XAccessible > xParent( m_xParent );
182*cdf0e10cSrcweir     if( xParent.is())
183*cdf0e10cSrcweir     {
184*cdf0e10cSrcweir         Reference< XAccessibleComponent > xAccComp(
185*cdf0e10cSrcweir             xParent->getAccessibleContext(), uno::UNO_QUERY );
186*cdf0e10cSrcweir         aResult = xAccComp->getLocationOnScreen();
187*cdf0e10cSrcweir         aResult.X += aBounds.X;
188*cdf0e10cSrcweir         aResult.Y += aBounds.Y;
189*cdf0e10cSrcweir     }
190*cdf0e10cSrcweir     return aResult;
191*cdf0e10cSrcweir }
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir //-----------------------------------------------------------------
194*cdf0e10cSrcweir // lang::XInitialization
195*cdf0e10cSrcweir //-----------------------------------------------------------------
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments )
198*cdf0e10cSrcweir                 throw (uno::Exception, uno::RuntimeException)
199*cdf0e10cSrcweir {
200*cdf0e10cSrcweir     //0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
201*cdf0e10cSrcweir     //1: frame::XModel representing the chart model - offers access to object data
202*cdf0e10cSrcweir     //2: lang::XInterface representing the normal chart view - offers access to some extra object data
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir     //all arguments are only valid until next initialization
205*cdf0e10cSrcweir     bool bChanged = false;
206*cdf0e10cSrcweir     bool bOldInvalid = false;
207*cdf0e10cSrcweir     bool bNewInvalid = false;
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir     Reference< view::XSelectionSupplier > xSelectionSupplier;
210*cdf0e10cSrcweir     Reference< frame::XModel > xChartModel;
211*cdf0e10cSrcweir     Reference< uno::XInterface > xChartView;
212*cdf0e10cSrcweir     Reference< XAccessible > xParent;
213*cdf0e10cSrcweir     Reference< awt::XWindow > xWindow;
214*cdf0e10cSrcweir     {
215*cdf0e10cSrcweir         MutexGuard aGuard( GetMutex());
216*cdf0e10cSrcweir         xSelectionSupplier.set( m_xSelectionSupplier );
217*cdf0e10cSrcweir         xChartModel.set( m_xChartModel );
218*cdf0e10cSrcweir         xChartView.set( m_xChartView );
219*cdf0e10cSrcweir         xParent.set( m_xParent );
220*cdf0e10cSrcweir         xWindow.set( m_xWindow );
221*cdf0e10cSrcweir     }
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
224*cdf0e10cSrcweir     {
225*cdf0e10cSrcweir         bOldInvalid = true;
226*cdf0e10cSrcweir     }
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir     if( rArguments.getLength() > 1 )
229*cdf0e10cSrcweir     {
230*cdf0e10cSrcweir         Reference< frame::XModel > xNewChartModel;
231*cdf0e10cSrcweir         rArguments[1] >>= xNewChartModel;
232*cdf0e10cSrcweir         if( xNewChartModel != xChartModel )
233*cdf0e10cSrcweir         {
234*cdf0e10cSrcweir             xChartModel = xNewChartModel;
235*cdf0e10cSrcweir             bChanged = true;
236*cdf0e10cSrcweir         }
237*cdf0e10cSrcweir     }
238*cdf0e10cSrcweir     else if( xChartModel.is() )
239*cdf0e10cSrcweir     {
240*cdf0e10cSrcweir         bChanged = true;
241*cdf0e10cSrcweir         xChartModel = 0;
242*cdf0e10cSrcweir     }
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir     if( rArguments.getLength() > 2 )
245*cdf0e10cSrcweir     {
246*cdf0e10cSrcweir         Reference< uno::XInterface > xNewChartView;
247*cdf0e10cSrcweir         rArguments[2] >>= xNewChartView;
248*cdf0e10cSrcweir         if( xNewChartView != xChartView )
249*cdf0e10cSrcweir         {
250*cdf0e10cSrcweir             xChartView = xNewChartView;
251*cdf0e10cSrcweir             bChanged = true;
252*cdf0e10cSrcweir         }
253*cdf0e10cSrcweir     }
254*cdf0e10cSrcweir     else if( xChartView.is() )
255*cdf0e10cSrcweir     {
256*cdf0e10cSrcweir         bChanged = true;
257*cdf0e10cSrcweir         xChartView = 0;
258*cdf0e10cSrcweir     }
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir     if( rArguments.getLength() > 3 )
261*cdf0e10cSrcweir     {
262*cdf0e10cSrcweir         Reference< XAccessible > xNewParent;
263*cdf0e10cSrcweir         rArguments[3] >>= xNewParent;
264*cdf0e10cSrcweir         if( xNewParent != xParent )
265*cdf0e10cSrcweir         {
266*cdf0e10cSrcweir             xParent = xNewParent;
267*cdf0e10cSrcweir             bChanged = true;
268*cdf0e10cSrcweir         }
269*cdf0e10cSrcweir     }
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir     if( rArguments.getLength() > 4 )
272*cdf0e10cSrcweir     {
273*cdf0e10cSrcweir         Reference< awt::XWindow > xNewWindow;
274*cdf0e10cSrcweir         rArguments[4] >>= xNewWindow;
275*cdf0e10cSrcweir         if( xNewWindow != xWindow )
276*cdf0e10cSrcweir         {
277*cdf0e10cSrcweir             xWindow.set( xNewWindow );
278*cdf0e10cSrcweir             bChanged = true;
279*cdf0e10cSrcweir         }
280*cdf0e10cSrcweir     }
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir     if( rArguments.getLength() > 0 && xChartModel.is() && xChartView.is() )
283*cdf0e10cSrcweir     {
284*cdf0e10cSrcweir         Reference< view::XSelectionSupplier > xNewSelectionSupplier;
285*cdf0e10cSrcweir         rArguments[0] >>= xNewSelectionSupplier;
286*cdf0e10cSrcweir         if(xSelectionSupplier!=xNewSelectionSupplier)
287*cdf0e10cSrcweir         {
288*cdf0e10cSrcweir             bChanged = true;
289*cdf0e10cSrcweir             if(xSelectionSupplier.is())
290*cdf0e10cSrcweir                 xSelectionSupplier->removeSelectionChangeListener(this);
291*cdf0e10cSrcweir             if(xNewSelectionSupplier.is())
292*cdf0e10cSrcweir                 xNewSelectionSupplier->addSelectionChangeListener(this);
293*cdf0e10cSrcweir             xSelectionSupplier = xNewSelectionSupplier;
294*cdf0e10cSrcweir         }
295*cdf0e10cSrcweir     }
296*cdf0e10cSrcweir     else if( xSelectionSupplier.is() )
297*cdf0e10cSrcweir     {
298*cdf0e10cSrcweir         bChanged = true;
299*cdf0e10cSrcweir         xSelectionSupplier->removeSelectionChangeListener(this);
300*cdf0e10cSrcweir         xSelectionSupplier = 0;
301*cdf0e10cSrcweir     }
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir     if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
304*cdf0e10cSrcweir     {
305*cdf0e10cSrcweir         if(xSelectionSupplier.is())
306*cdf0e10cSrcweir             xSelectionSupplier->removeSelectionChangeListener(this);
307*cdf0e10cSrcweir         xSelectionSupplier = 0;
308*cdf0e10cSrcweir         xChartModel.clear();
309*cdf0e10cSrcweir         xChartView.clear();
310*cdf0e10cSrcweir         xParent.clear();
311*cdf0e10cSrcweir         xWindow.clear();
312*cdf0e10cSrcweir 
313*cdf0e10cSrcweir         bNewInvalid = true;
314*cdf0e10cSrcweir     }
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir     {
317*cdf0e10cSrcweir         MutexGuard aGuard( GetMutex());
318*cdf0e10cSrcweir         m_xSelectionSupplier = WeakReference< view::XSelectionSupplier >(xSelectionSupplier);
319*cdf0e10cSrcweir         m_xChartModel = WeakReference< frame::XModel >(xChartModel);
320*cdf0e10cSrcweir         m_xChartView = WeakReference< uno::XInterface >(xChartView);
321*cdf0e10cSrcweir         m_xParent = WeakReference< XAccessible >(xParent);
322*cdf0e10cSrcweir         m_xWindow = WeakReference< awt::XWindow >(xWindow);
323*cdf0e10cSrcweir     }
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir     if( bOldInvalid && bNewInvalid )
326*cdf0e10cSrcweir         bChanged = false;
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir     if( bChanged )
329*cdf0e10cSrcweir     {
330*cdf0e10cSrcweir         {
331*cdf0e10cSrcweir             //before notification we prepare for creation of new context
332*cdf0e10cSrcweir             //the old context will be deleted after notification than
333*cdf0e10cSrcweir             MutexGuard aGuard( GetMutex());
334*cdf0e10cSrcweir             Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
335*cdf0e10cSrcweir             if( xChartDoc.is())
336*cdf0e10cSrcweir                 m_spObjectHierarchy.reset( new ObjectHierarchy( xChartDoc, getExplicitValueProvider() ));
337*cdf0e10cSrcweir             else
338*cdf0e10cSrcweir                 m_spObjectHierarchy.reset();
339*cdf0e10cSrcweir         }
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir         {
342*cdf0e10cSrcweir             AccessibleElementInfo aAccInfo;
343*cdf0e10cSrcweir             aAccInfo.m_aOID = ObjectIdentifier( C2U( "ROOT" ) );
344*cdf0e10cSrcweir             aAccInfo.m_xChartDocument = uno::WeakReference< chart2::XChartDocument >(
345*cdf0e10cSrcweir                 uno::Reference< chart2::XChartDocument >( m_xChartModel.get(), uno::UNO_QUERY ));
346*cdf0e10cSrcweir             aAccInfo.m_xSelectionSupplier = m_xSelectionSupplier;
347*cdf0e10cSrcweir             aAccInfo.m_xView = m_xChartView;
348*cdf0e10cSrcweir             aAccInfo.m_xWindow = m_xWindow;
349*cdf0e10cSrcweir             aAccInfo.m_pParent = 0;
350*cdf0e10cSrcweir             aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy;
351*cdf0e10cSrcweir             aAccInfo.m_pSdrView = m_pSdrView;
352*cdf0e10cSrcweir             Window* pWindow = VCLUnoHelper::GetWindow( m_xWindow );
353*cdf0e10cSrcweir             if ( m_pViewForwarder )
354*cdf0e10cSrcweir             {
355*cdf0e10cSrcweir                 delete m_pViewForwarder;
356*cdf0e10cSrcweir             }
357*cdf0e10cSrcweir             m_pViewForwarder = new AccessibleViewForwarder( this, pWindow );
358*cdf0e10cSrcweir             aAccInfo.m_pViewForwarder = m_pViewForwarder;
359*cdf0e10cSrcweir             // broadcasts an INVALIDATE_ALL_CHILDREN event globally
360*cdf0e10cSrcweir             SetInfo( aAccInfo );
361*cdf0e10cSrcweir         }
362*cdf0e10cSrcweir     }
363*cdf0e10cSrcweir }
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir ExplicitValueProvider* AccessibleChartView::getExplicitValueProvider()
366*cdf0e10cSrcweir {
367*cdf0e10cSrcweir     return ExplicitValueProvider::getExplicitValueProvider(m_xChartView);
368*cdf0e10cSrcweir }
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir //-------------------------------------------------------------------------
371*cdf0e10cSrcweir // view::XSelectionChangeListener
372*cdf0e10cSrcweir //-------------------------------------------------------------------------
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir void SAL_CALL AccessibleChartView::selectionChanged( const lang::EventObject& /*rEvent*/ )
375*cdf0e10cSrcweir                 throw (uno::RuntimeException)
376*cdf0e10cSrcweir {
377*cdf0e10cSrcweir     Reference< view::XSelectionSupplier > xSelectionSupplier;
378*cdf0e10cSrcweir     {
379*cdf0e10cSrcweir         MutexGuard aGuard( GetMutex());
380*cdf0e10cSrcweir         xSelectionSupplier = Reference< view::XSelectionSupplier >(m_xSelectionSupplier);
381*cdf0e10cSrcweir     }
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir     if( xSelectionSupplier.is() )
384*cdf0e10cSrcweir     {
385*cdf0e10cSrcweir         ObjectIdentifier aSelectedOID( xSelectionSupplier->getSelection() );
386*cdf0e10cSrcweir         if ( m_aCurrentSelectionOID.isValid() )
387*cdf0e10cSrcweir         {
388*cdf0e10cSrcweir             NotifyEvent( LOST_SELECTION, m_aCurrentSelectionOID );
389*cdf0e10cSrcweir         }
390*cdf0e10cSrcweir         if( aSelectedOID.isValid() )
391*cdf0e10cSrcweir         {
392*cdf0e10cSrcweir             NotifyEvent( GOT_SELECTION, aSelectedOID );
393*cdf0e10cSrcweir         }
394*cdf0e10cSrcweir         m_aCurrentSelectionOID = aSelectedOID;
395*cdf0e10cSrcweir     }
396*cdf0e10cSrcweir }
397*cdf0e10cSrcweir 
398*cdf0e10cSrcweir //-------------------------------------------------------------------------
399*cdf0e10cSrcweir // lang::XComponent::dispose()
400*cdf0e10cSrcweir //-------------------------------------------------------------------------
401*cdf0e10cSrcweir void SAL_CALL AccessibleChartView::disposing()
402*cdf0e10cSrcweir {
403*cdf0e10cSrcweir     AccessibleBase::disposing();
404*cdf0e10cSrcweir }
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir //-------------------------------------------------------------------------
407*cdf0e10cSrcweir // XEventListener
408*cdf0e10cSrcweir //-------------------------------------------------------------------------
409*cdf0e10cSrcweir void SAL_CALL AccessibleChartView::disposing( const lang::EventObject& /*Source*/ )
410*cdf0e10cSrcweir     throw (uno::RuntimeException)
411*cdf0e10cSrcweir {
412*cdf0e10cSrcweir }
413*cdf0e10cSrcweir 
414*cdf0e10cSrcweir //.............................................................................
415*cdf0e10cSrcweir } //namespace chart
416*cdf0e10cSrcweir //.............................................................................
417