30#include <com/sun/star/accessibility/AccessibleStateType.hpp>
31#include <com/sun/star/accessibility/AccessibleRole.hpp>
32#include <com/sun/star/view/XSelectionSupplier.hpp>
36#include <rtl/ustring.hxx>
40#include <osl/mutex.hxx>
45using ::com::sun::star::uno::Sequence;
46using ::com::sun::star::uno::Reference;
47using ::com::sun::star::uno::WeakReference;
48using ::com::sun::star::uno::Any;
62 AddState( AccessibleStateType::OPAQUE );
73 return awt::Rectangle();
75 awt::Rectangle aBBox( xWindow->getPosSize() );
81 Point aVCLPoint( pWindow->OutputToAbsoluteScreenPixel(
Point( 0, 0 ) ));
82 aBBox.X = aVCLPoint.
getX();
83 aBBox.Y = aVCLPoint.
getY();
91 awt::Point aParentPosition;
94 aParentPosition.X = aBBox.X;
95 aParentPosition.Y = aBBox.Y;
97 return aParentPosition;
103 return SchResId(STR_OBJECT_DIAGRAM);
124 return AccessibleRole::DOCUMENT;
137 awt::Point aParentPosition = xContext->getLocationOnScreen();
138 aResult.X -= aParentPosition.X;
139 aResult.Y -= aParentPosition.Y;
153 xParent->getAccessibleContext(), uno::UNO_QUERY );
154 aResult = xAccComp->getLocationOnScreen();
155 aResult.X += aBounds.X;
156 aResult.Y += aBounds.Y;
170 bool bChanged =
false;
171 bool bOldInvalid =
false;
172 bool bNewInvalid =
false;
188 if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
193 if( rArguments.getLength() > 1 )
196 rArguments[1] >>= xNewChartModel;
197 assert(!xNewChartModel ||
dynamic_cast<::chart::ChartModel*
>(xNewChartModel.get()));
198 ::chart::ChartModel* pNewChartModel =
dynamic_cast<::chart::ChartModel*
>(xNewChartModel.get());
199 if( pNewChartModel != xChartModel.get() )
201 xChartModel = pNewChartModel;
205 else if( xChartModel.is() )
208 xChartModel =
nullptr;
211 if( rArguments.getLength() > 2 )
214 rArguments[2] >>= xTmp;
216 assert(
bool(xTmp)==
bool(xNewChartView) &&
"we only support ChartView");
217 if( xNewChartView != xChartView )
219 xChartView = xNewChartView;
223 else if( xChartView.is() )
226 xChartView =
nullptr;
229 if( rArguments.getLength() > 3 )
232 rArguments[3] >>= xNewParent;
233 if( xNewParent != xParent )
235 xParent = xNewParent;
240 if( rArguments.getLength() > 4 )
243 rArguments[4] >>= xNewWindow;
244 if( xNewWindow != xWindow )
246 xWindow.set( xNewWindow );
251 if( rArguments.hasElements() && xChartModel.is() && xChartView.is() )
254 rArguments[0] >>= xNewSelectionSupplier;
255 if(xSelectionSupplier!=xNewSelectionSupplier)
258 if(xSelectionSupplier.is())
259 xSelectionSupplier->removeSelectionChangeListener(
this);
260 if(xNewSelectionSupplier.is())
261 xNewSelectionSupplier->addSelectionChangeListener(
this);
262 xSelectionSupplier = xNewSelectionSupplier;
265 else if( xSelectionSupplier.is() )
268 xSelectionSupplier->removeSelectionChangeListener(
this);
269 xSelectionSupplier =
nullptr;
272 if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
274 if(xSelectionSupplier.is())
275 xSelectionSupplier->removeSelectionChangeListener(
this);
276 xSelectionSupplier =
nullptr;
294 if( bOldInvalid && bNewInvalid )
304 if( xChartModel.is())
306 std::make_shared<ObjectHierarchy>( xChartModel,
m_xChartView.get().get() );
339 if( !xSelectionSupplier.is() )
349 NotifyEvent( EventType::GOT_SELECTION, aSelectedOID );
constexpr tools::Long getX() const
constexpr tools::Long getY() const
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
std::shared_ptr< ObjectHierarchy > m_spObjectHierarchy
virtual OUString SAL_CALL getAccessibleName() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual OUString SAL_CALL getAccessibleDescription() override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
unotools::WeakReference< ChartView > m_xChartView
std::unique_ptr<::accessibility::IAccessibleViewForwarder > m_pViewForwarder
css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier
css::uno::WeakReference< css::accessibility::XAccessible > m_xParent
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
css::awt::Rectangle GetWindowPosSize() const
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual void SAL_CALL disposing() override
virtual ~AccessibleChartView() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual css::awt::Point GetUpperLeftOnScreen() const override
unotools::WeakReference<::chart::ChartModel > m_xChartModel
AccessibleChartView()=delete
AccessibleUniqueId m_aCurrentSelectionOID
css::uno::WeakReference< css::awt::XWindow > m_xWindow
The ChartView is responsible to manage the generation of Drawing Objects for visualization on a given...
::cppu::ImplInheritanceHelper< ::chart::AccessibleBase, css::lang::XInitialization, css::view::XSelectionChangeListener > AccessibleChartView_Base
OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId)
css::uno::WeakReference< css::awt::XWindow > m_xWindow
std::shared_ptr< ObjectHierarchy > m_spObjectHierarchy
AccessibleUniqueId m_aOID
css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier
::accessibility::IAccessibleViewForwarder * m_pViewForwarder
AccessibleBase * m_pParent
unotools::WeakReference< ::chart::ChartModel > m_xChartDocument
unotools::WeakReference< ::chart::ChartView > m_xView