LibreOffice Module svx (master)  1
GraphCtlAccessibleContext.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include <com/sun/star/accessibility/AccessibleRole.hpp>
21 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
22 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
23 #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
24 #include <com/sun/star/lang/DisposedException.hpp>
25 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
28 #include <vcl/svapp.hxx>
29 #include <vcl/settings.hxx>
30 #include <o3tl/safeint.hxx>
31 #include <osl/mutex.hxx>
32 #include <tools/gen.hxx>
33 #include <svtools/colorcfg.hxx>
35 #include <svx/sdrpaintwindow.hxx>
36 
37 #include <svx/ShapeTypeHandler.hxx>
40 #include <svx/graphctl.hxx>
41 #include <svx/strings.hrc>
42 #include <svx/svdpage.hxx>
43 #include <svx/dialmgr.hxx>
44 #include <svx/sdrhittesthelper.hxx>
45 
46 // namespaces
47 using namespace ::cppu;
48 using namespace ::osl;
49 using namespace ::accessibility;
50 using namespace ::com::sun::star;
51 using namespace ::com::sun::star::uno;
52 using namespace ::com::sun::star::drawing;
53 using namespace ::com::sun::star::lang;
54 using namespace ::com::sun::star::accessibility;
55 
56 // internal
59  GraphCtrl& rRepr ) :
60 
62  mpControl( &rRepr ),
63  mpModel (nullptr),
64  mpPage (nullptr),
65  mpView (nullptr),
66  mnClientId( 0 ),
67  mbDisposed( false )
68 {
69  if (mpControl != nullptr)
70  {
72  if (mpModel != nullptr)
73  mpPage = mpModel->GetPage( 0 );
75 
76  if( mpModel == nullptr || mpPage == nullptr || mpView == nullptr )
77  {
78  mbDisposed = true;
79  // Set all the pointers to NULL just in case they are used as
80  // a disposed flag.
81  mpModel = nullptr;
82  mpPage = nullptr;
83  mpView = nullptr;
84  }
85  }
86 
87  {
88  ::SolarMutexGuard aSolarGuard;
89  msName = SvxResId( RID_SVXSTR_GRAPHCTRL_ACC_NAME );
90  msDescription = SvxResId( RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION );
91  }
92 
96 }
97 
98 
102 {
103  disposing();
104 }
105 
106 
110 Reference< XAccessible > SvxGraphCtrlAccessibleContext::getAccessible( const SdrObject* pObj )
111 {
112  Reference<XAccessible> xAccessibleShape;
113 
114  if( pObj )
115  {
116  // see if we already created an XAccessible for the given SdrObject
117  ShapesMapType::const_iterator iter = mxShapes.find( pObj );
118 
119  if( iter != mxShapes.end() )
120  {
121  // if we already have one, return it
122  xAccessibleShape = (*iter).second.get();
123  }
124  else
125  {
126  // create a new one and remember in our internal map
127  Reference< XShape > xShape( Reference< XShape >::query( const_cast<SdrObject*>(pObj)->getUnoShape() ) );
128 
129  css::uno::Reference<css::accessibility::XAccessible> xParent(getAccessibleParent());
130  AccessibleShapeInfo aShapeInfo (xShape,xParent);
131  // Create accessible object that corresponds to the descriptor's shape.
132  rtl::Reference<AccessibleShape> pAcc(ShapeTypeHandler::Instance().CreateAccessibleObject(
133  aShapeInfo, maTreeInfo));
134  xAccessibleShape = pAcc.get();
135  if (pAcc.is())
136  {
137  pAcc->Init ();
138  }
139  mxShapes[pObj] = pAcc;
140 
141  // Create event and inform listeners of the object creation.
142  CommitChange( AccessibleEventId::CHILD, makeAny( xAccessibleShape ), makeAny( Reference<XAccessible>() ) );
143  }
144  }
145 
146  return xAccessibleShape;
147 }
148 
149 // XAccessible
150 Reference< XAccessibleContext > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleContext()
151 {
152  return this;
153 }
154 
155 // XAccessibleComponent
156 sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::containsPoint( const awt::Point& rPoint )
157 {
158  // no guard -> done in getSize()
159  awt::Size aSize (getSize());
160  return (rPoint.X >= 0)
161  && (rPoint.X < aSize.Width)
162  && (rPoint.Y >= 0)
163  && (rPoint.Y < aSize.Height);
164 }
165 
166 
167 Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleAtPoint( const awt::Point& rPoint )
168 {
169  ::osl::MutexGuard aGuard( m_aMutex );
170 
171  Reference< XAccessible > xAccessible;
172 
173  if( !mpControl )
174  {
175  throw DisposedException();
176  }
177 
178  Point aPnt( rPoint.X, rPoint.Y );
180 
181  SdrObject* pObj = nullptr;
182 
183  if(mpView && mpView->GetSdrPageView())
184  {
185  pObj = SdrObjListPrimitiveHit(*mpPage, aPnt, 1, *mpView->GetSdrPageView(), nullptr, false);
186  }
187 
188  if( pObj )
189  xAccessible = getAccessible( pObj );
190 
191  return xAccessible;
192 }
193 
195 {
196  const SolarMutexGuard aSolarGuard;
197 
198  if (nullptr == mpControl)
199  throw DisposedException();
200 
201  const Point aOutPos;
202  const Size aOutSize( mpControl->GetOutputSizePixel() );
203  awt::Rectangle aRet;
204 
205  aRet.X = aOutPos.X();
206  aRet.Y = aOutPos.Y();
207  aRet.Width = aOutSize.Width();
208  aRet.Height = aOutSize.Height();
209 
210  return aRet;
211 }
212 
214 {
215  const SolarMutexGuard aSolarGuard;
216 
217  if (nullptr == mpControl)
218  throw DisposedException();
219 
220  const awt::Rectangle aRect( getBounds() );
221  awt::Point aRet;
222 
223  aRet.X = aRect.X;
224  aRet.Y = aRect.Y;
225 
226  return aRet;
227 }
228 
230 {
231  const SolarMutexGuard aSolarGuard;
232 
233  if (nullptr == mpControl)
234  throw DisposedException();
235 
236  awt::Point aScreenLoc(0, 0);
237 
238  auto xParent(getAccessibleParent());
239  if (xParent)
240  {
241  css::uno::Reference<css::accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext());
242  css::uno::Reference<css::accessibility::XAccessibleComponent> xParentComponent(xParentContext, css::uno::UNO_QUERY);
243  OSL_ENSURE( xParentComponent.is(), "SvtValueSetAcc::getLocationOnScreen: no parent component!" );
244  if ( xParentComponent.is() )
245  {
246  awt::Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
247  awt::Point aOwnRelativeLoc( getLocation() );
248  aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
249  aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
250  }
251  }
252 
253  return aScreenLoc;
254 }
255 
257 {
258  const SolarMutexGuard aSolarGuard;
259 
260  if (nullptr == mpControl)
261  throw DisposedException();
262 
263  const awt::Rectangle aRect( getBounds() );
264  awt::Size aRet;
265 
266  aRet.Width = aRect.Width;
267  aRet.Height = aRect.Height;
268 
269  return aRet;
270 }
271 
272 // XAccessibleContext
274 {
275  ::SolarMutexGuard aGuard;
276 
277  if( nullptr == mpPage )
278  throw DisposedException();
279 
280  return mpPage->GetObjCount();
281 }
282 
283 
286 {
287  ::SolarMutexGuard aGuard;
288 
289  if( nullptr == mpPage )
290  throw DisposedException();
291 
292  if( (nIndex < 0) || ( o3tl::make_unsigned(nIndex) >= mpPage->GetObjCount() ) )
293  throw lang::IndexOutOfBoundsException();
294 
295  return mpPage->GetObj( nIndex );
296 }
297 
298 
301  sal_Int16 nEventId,
302  const uno::Any& rNewValue,
303  const uno::Any& rOldValue)
304 {
305  AccessibleEventObject aEvent (
306  static_cast<uno::XWeak*>(this),
307  nEventId,
308  rNewValue,
309  rOldValue);
310 
311  if (mnClientId)
313 }
314 
315 Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleChild( sal_Int32 nIndex )
316 {
317  ::SolarMutexGuard aGuard;
318 
319  return getAccessible( getSdrObject( nIndex ) );
320 }
321 
322 Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleParent()
323 {
324  ::SolarMutexGuard aGuard;
325 
326  if( nullptr == mpControl )
327  throw DisposedException();
328 
330 }
331 
333 {
334  ::SolarMutexGuard aGuard;
335  // Use a simple but slow solution for now. Optimize later.
336 
337  // Iterate over all the parent's children and search for this object.
338  css::uno::Reference<css::accessibility::XAccessible> xParent(getAccessibleParent());
339  if (xParent.is())
340  {
341  Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
342  if( xParentContext.is() )
343  {
344  sal_Int32 nChildCount = xParentContext->getAccessibleChildCount();
345  for( sal_Int32 i = 0 ; i < nChildCount ; ++i )
346  {
347  Reference< XAccessible > xChild( xParentContext->getAccessibleChild( i ) );
348  if( xChild.is() )
349  {
350  Reference< XAccessibleContext > xChildContext = xChild->getAccessibleContext();
351  if( xChildContext == static_cast<XAccessibleContext*>(this) )
352  return i;
353  }
354  }
355  }
356  }
357 
358  // Return -1 to indicate that this object's parent does not know about the
359  // object.
360  return -1;
361 }
362 
363 
365 {
366  return AccessibleRole::PANEL;
367 }
368 
369 
371 {
372  ::SolarMutexGuard aGuard;
373  return msDescription;
374 }
375 
376 
378 {
379  ::SolarMutexGuard aGuard;
380  return msName;
381 }
382 
383 
387 Reference< XAccessibleRelationSet > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleRelationSet()
388 {
389  return Reference< XAccessibleRelationSet >();
390 }
391 
392 
393 Reference< XAccessibleStateSet > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleStateSet()
394 {
395  ::SolarMutexGuard aGuard;
396 
398 
399  if ( rBHelper.bDisposed || mbDisposed )
400  {
401  pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
402  }
403  else
404  {
405  pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
406  if( mpControl->HasFocus() )
407  pStateSetHelper->AddState( AccessibleStateType::FOCUSED );
408  pStateSetHelper->AddState( AccessibleStateType::OPAQUE );
409  pStateSetHelper->AddState( AccessibleStateType::SHOWING );
410  pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
411  }
412 
413  return pStateSetHelper;
414 }
415 
416 
418 {
419  ::SolarMutexGuard aGuard;
420 
421  css::uno::Reference<css::accessibility::XAccessible> xParent(getAccessibleParent());
422  if (xParent.is())
423  {
424  Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
425  if( xParentContext.is() )
426  return xParentContext->getLocale();
427  }
428 
429  // No parent. Therefore throw exception to indicate this cluelessness.
430  throw IllegalAccessibleComponentStateException();
431 }
432 
433 // XAccessibleEventListener
434 void SAL_CALL SvxGraphCtrlAccessibleContext::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener )
435 {
436  if (xListener.is())
437  {
438  ::SolarMutexGuard aGuard;
439  if (!mnClientId)
442  }
443 }
444 
445 
446 void SAL_CALL SvxGraphCtrlAccessibleContext::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener )
447 {
448  if (xListener.is())
449  {
450  ::SolarMutexGuard aGuard;
451 
452  sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, xListener );
453  if ( !nListenerCount )
454  {
455  // no listeners anymore
456  // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
457  // and at least to us not firing any events anymore, in case somebody calls
458  // NotifyAccessibleEvent, again
460  mnClientId = 0;
461  }
462  }
463 }
464 
466 {
467  ::SolarMutexGuard aGuard;
468 
469  if( nullptr == mpControl )
470  throw DisposedException();
471 
472  mpControl->GrabFocus();
473 }
474 
476 {
477  svtools::ColorConfig aColorConfig;
478  Color nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor;
479  return static_cast<sal_Int32>(nColor);
480 }
481 
483 {
485  return static_cast<sal_Int32>(nColor);
486 }
487 
488 // XServiceInfo
490 {
491  return "com.sun.star.comp.ui.SvxGraphCtrlAccessibleContext";
492 }
493 
494 sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::supportsService( const OUString& sServiceName )
495 {
496  return cppu::supportsService(this, sServiceName);
497 }
498 
500 {
501  return { "com.sun.star.accessibility.Accessible",
502  "com.sun.star.accessibility.AccessibleContext",
503  "com.sun.star.drawing.AccessibleGraphControl" };
504 }
505 
506 // XTypeProvider
508 {
509  return css::uno::Sequence<sal_Int8>();
510 }
511 
512 // XServiceName
514 {
515  return "com.sun.star.accessibility.AccessibleContext";
516 }
517 
518 // XAccessibleSelection
520 {
521  ::SolarMutexGuard aGuard;
522 
523  if( nullptr == mpView )
524  throw DisposedException();
525 
526  SdrObject* pObj = getSdrObject( nIndex );
527 
528  if( pObj )
529  mpView->MarkObj( pObj, mpView->GetSdrPageView());
530 }
531 
532 
534 {
535  ::SolarMutexGuard aGuard;
536 
537  if( nullptr == mpView )
538  throw DisposedException();
539 
540  return mpView->IsObjMarked( getSdrObject( nIndex ) );
541 }
542 
543 
545 {
546  ::SolarMutexGuard aGuard;
547 
548  if( nullptr == mpView )
549  throw DisposedException();
550 
551  mpView->UnmarkAllObj();
552 }
553 
554 
556 {
557  ::SolarMutexGuard aGuard;
558 
559  if( nullptr == mpView )
560  throw DisposedException();
561 
562  mpView->MarkAllObj();
563 }
564 
565 
567 {
568  ::SolarMutexGuard aGuard;
569 
570  if( nullptr == mpView )
571  throw DisposedException();
572 
573  const SdrMarkList& rList = mpView->GetMarkedObjectList();
574  return static_cast<sal_Int32>(rList.GetMarkCount());
575 }
576 
577 
578 Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChild( sal_Int32 nIndex )
579 {
580  ::SolarMutexGuard aGuard;
581 
582  checkChildIndexOnSelection( nIndex );
583 
584  Reference< XAccessible > xAccessible;
585 
586  const SdrMarkList& rList = mpView->GetMarkedObjectList();
587  SdrObject* pObj = rList.GetMark(static_cast<size_t>(nIndex))->GetMarkedSdrObj();
588  if( pObj )
589  xAccessible = getAccessible( pObj );
590 
591  return xAccessible;
592 }
593 
594 
596 {
597  ::SolarMutexGuard aGuard;
598 
599  checkChildIndexOnSelection( nIndex );
600 
601  if( mpView )
602  {
603  const SdrMarkList& rList = mpView->GetMarkedObjectList();
604 
605  SdrObject* pObj = getSdrObject( nIndex );
606  if( pObj )
607  {
608  SdrMarkList aRefList( rList );
609 
611  mpView->UnmarkAllObj( pPV );
612 
613  const size_t nCount = aRefList.GetMarkCount();
614  for( size_t nMark = 0; nMark < nCount; ++nMark )
615  {
616  if( aRefList.GetMark(nMark)->GetMarkedSdrObj() != pObj )
617  mpView->MarkObj( aRefList.GetMark(nMark)->GetMarkedSdrObj(), pPV );
618  }
619  }
620  }
621 }
622 
623 // internals
625 {
626  if( nIndex < 0 || nIndex >= getSelectedAccessibleChildCount() )
627  throw lang::IndexOutOfBoundsException();
628 }
629 
630 
635  SdrModel* pModel,
636  SdrView* pView)
637 {
638  ::SolarMutexGuard aGuard;
639 
640  mpModel = pModel;
641  if (mpModel != nullptr)
642  mpPage = mpModel->GetPage( 0 );
643  mpView = pView;
644 
645  if (mpModel == nullptr || mpPage == nullptr || mpView == nullptr)
646  {
647  mbDisposed = true;
648 
649  // Set all the pointers to NULL just in case they are used as
650  // a disposed flag.
651  mpModel = nullptr;
652  mpPage = nullptr;
653  mpView = nullptr;
654  }
655 
657 }
658 
659 
661 {
662  ::SolarMutexGuard aGuard;
663 
664  if( mbDisposed )
665  return;
666 
667  mbDisposed = true;
668 
669  mpControl = nullptr; // object dies with representation
670  mpView = nullptr;
671  mpPage = nullptr;
672 
673  {
674  for (const auto& rEntry : mxShapes)
675  {
676  rtl::Reference<XAccessible> pAcc(rEntry.second.get());
677  Reference< XComponent > xComp( pAcc.get(), UNO_QUERY );
678  if( xComp.is() )
679  xComp->dispose();
680  }
681 
682  mxShapes.clear();
683  }
684 
685  // Send a disposing to all listeners.
686  if ( mnClientId )
687  {
689  mnClientId = 0;
690  }
691 }
692 
694 {
695  if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint)
696  {
697  const SdrHint* pSdrHint = static_cast<const SdrHint*>( &rHint );
698  switch( pSdrHint->GetKind() )
699  {
701  {
702  ShapesMapType::iterator iter = mxShapes.find( pSdrHint->GetObject() );
703 
704  if( iter != mxShapes.end() )
705  {
706  // if we already have one, return it
707  rtl::Reference<AccessibleShape> pShape((*iter).second);
708 
709  if( pShape.is() )
710  pShape->CommitChange( AccessibleEventId::VISIBLE_DATA_CHANGED, uno::Any(), uno::Any() );
711  }
712  }
713  break;
714 
716  CommitChange( AccessibleEventId::CHILD, makeAny( getAccessible( pSdrHint->GetObject() ) ) , uno::Any());
717  break;
719  CommitChange( AccessibleEventId::CHILD, uno::Any(), makeAny( getAccessible( pSdrHint->GetObject() ) ) );
720  break;
722  dispose();
723  break;
724  default:
725  break;
726  }
727  }
728  else
729  {
730  // Has our SdDrawDocument just died?
731  if(rHint.GetId() == SfxHintId::Dying)
732  {
733  dispose();
734  }
735  }
736 }
737 
738 // IAccessibleViewforwarder
740 {
741  tools::Rectangle aVisArea;
742 
743  if( mpView && mpView->PaintWindowCount())
744  {
745  SdrPaintWindow* pPaintWindow = mpView->GetPaintWindow(0);
746  aVisArea = pPaintWindow->GetVisibleArea();
747  }
748 
749  return aVisArea;
750 }
751 
753 {
754  if( mpControl )
755  {
757  }
758  else
759  {
760  return rPoint;
761  }
762 }
763 
765 {
766  if( mpControl )
768  else
769  return rSize;
770 }
771 
772 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void Notify(SfxBroadcaster &aBC, const SfxHint &aHint) override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return empty reference to indicate that the relation set is not supported.
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
Definition: svdmrkv.cxx:2302
SdrHintKind GetKind() const
Definition: svdmodel.hxx:124
size_t GetMarkCount() const
Definition: svdmark.hxx:179
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
SvxGraphCtrlAccessibleContext(GraphCtrl &rRepresentation)
initialize this component and set default values
sal_uInt32 mnClientId
client id in the AccessibleEventNotifier queue
osl::Mutex m_aMutex
virtual a11yref get_accessible_parent()=0
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Return the XAccessibleContext.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:774
size_t GetObjCount() const
Definition: svdpage.cxx:768
virtual css::lang::Locale SAL_CALL getLocale() override
mutable::osl::Mutex m_aMutex
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:234
OUString msName
Name of this object.
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
SfxHintId GetId() const
virtual void SAL_CALL grabFocus() override
Size const & GetOutputSizePixel() const
virtual css::awt::Rectangle SAL_CALL getBounds() override
tools::Rectangle GetVisibleArea() const
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
int nCount
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Point GetPositionInDialog() const
Definition: graphctl.cxx:822
virtual tools::Rectangle GetVisibleArea() const override
Returns the area of the underlying document that is visible in the corresponding window.
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual css::awt::Size SAL_CALL getSize() override
OUString msDescription
Description of this object.
virtual OutputDevice & get_ref_device()=0
virtual ~SvxGraphCtrlAccessibleContext() override
on destruction, this component is disposed and all dispose listeners are called, except if this compo...
void CommitChange(sal_Int16 aEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue)
sends an AccessibleEventObject to all added XAccessibleEventListeners
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:228
SdrObject * SdrObjListPrimitiveHit(const SdrObjList &rList, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly)
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:67
void MarkAllObj(SdrPageView *pPV=nullptr)
Definition: svdmrkv.cxx:2321
SdrObject * getSdrObject(sal_Int32 nIndex)
returns the SdrObject at index nIndex from the model of this graph
SdPage * mpPage
virtual OUString SAL_CALL getAccessibleName() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nSelectedChildIndex) override
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
int i
void checkChildIndexOnSelection(long nIndexOfChild)
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:243
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1917
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
SdrView * GetSdrView() const
Definition: graphctl.hxx:114
unsigned char sal_Bool
virtual OUString SAL_CALL getServiceName() override
SdrModel * GetSdrModel() const
Definition: graphctl.hxx:113
virtual OUString SAL_CALL getAccessibleDescription() override
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual sal_Int32 SAL_CALL getBackground() override
long X() const
static void revokeClientNotifyDisposing(const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &rPoint) override
void SetViewForwarder(const IAccessibleViewForwarder *pViewForwarder)
The view forwarder allows the transformation between internal and pixel coordinates and can be asked ...
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
virtual void SAL_CALL clearAccessibleSelection() override
weld::DrawingArea * GetDrawingArea() const
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
static void revokeClient(const TClientId _nClient)
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
virtual css::awt::Point SAL_CALL getLocation() override
virtual void SAL_CALL disposing() final override
const Color & GetWindowColor() const
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
UnoViewSharedPtr mpView
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:310
css::uno::Reference< css::accessibility::XAccessible > getAccessible(const SdrObject *pObj)
returns the XAccessible interface for a given SdrObject.
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Definition: svdmrkv.cxx:1678
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
void dispose()
void SetDevice(OutputDevice *pWindow)
Set the window that is used to construct SvxTextEditSources which in turn is used to create accessibl...
void AddState(sal_Int16 aState)
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
void setModelAndView(SdrModel *pModel, SdrView *pView)
This method is used by the graph control to tell the accessibility object about a new model and view...
virtual Point LogicToPixel(const Point &rPoint) const override
Transform the specified point from internal coordinates in 100th of mm to an absolute screen position...
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:77
void SetSdrView(SdrView *pView)
Set the view that will be used to construct SvxTextEditSources which in turn are used to create acces...
AnyEventRef aEvent
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
long Y() const
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
::accessibility::AccessibleShapeTreeInfo maTreeInfo
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:1940
const SdrObject * GetObject() const
Definition: svdmodel.hxx:123
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)