LibreOffice Module chart2 (master) 1
AccessibleBase.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 <AccessibleBase.hxx>
22#include <ObjectHierarchy.hxx>
23#include <ObjectIdentifier.hxx>
24#include <ChartView.hxx>
26
27#include <com/sun/star/accessibility/AccessibleEventId.hpp>
28#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
29#include <com/sun/star/accessibility/AccessibleStateType.hpp>
30#include <com/sun/star/accessibility/AccessibleRole.hpp>
31#include <com/sun/star/drawing/LineStyle.hpp>
32#include <com/sun/star/drawing/FillStyle.hpp>
33#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
34#include <com/sun/star/view/XSelectionSupplier.hpp>
35#include <sal/log.hxx>
36#include <utility>
37#include <vcl/svapp.hxx>
42#include <vcl/window.hxx>
43#include <vcl/settings.hxx>
44#include <o3tl/functional.hxx>
45#include <o3tl/safeint.hxx>
47
48#include <algorithm>
49#include <iterator>
50
52
53using namespace ::com::sun::star;
54using namespace ::com::sun::star::accessibility;
55
56using ::com::sun::star::uno::UNO_QUERY;
57using ::com::sun::star::uno::Reference;
58using ::osl::MutexGuard;
59using ::osl::ClearableMutexGuard;
60using ::com::sun::star::uno::Any;
61
62namespace chart
63{
64
68 AccessibleElementInfo aAccInfo,
69 bool bMayHaveChildren,
70 bool bAlwaysTransparent /* default: false */ ) :
72 m_bIsDisposed( false ),
73 m_bMayHaveChildren( bMayHaveChildren ),
74 m_bChildrenInitialized( false ),
75 m_nEventNotifierId(0),
76 m_nStateSet( 0 ),
77 m_aAccInfo(std::move( aAccInfo )),
78 m_bAlwaysTransparent( bAlwaysTransparent ),
79 m_bStateSetInitialized( false )
80{
81 // initialize some states
82 m_nStateSet |= AccessibleStateType::ENABLED;
83 m_nStateSet |= AccessibleStateType::SHOWING;
84 m_nStateSet |= AccessibleStateType::VISIBLE;
85 m_nStateSet |= AccessibleStateType::SELECTABLE;
86 m_nStateSet |= AccessibleStateType::FOCUSABLE;
87}
88
90{
91 OSL_ASSERT( m_bIsDisposed );
92}
93
94bool AccessibleBase::CheckDisposeState( bool bThrowException /* default: true */ ) const
95{
96 if( bThrowException &&
98 {
99 throw lang::DisposedException("component has state DEFUNC",
100 static_cast< uno::XWeak * >( const_cast< AccessibleBase * >( this )));
101 }
102 return m_bIsDisposed;
103}
104
106{
107 if( GetId() == rId )
108 {
109 // event is addressed to this object
110
111 css::uno::Any aEmpty;
112 css::uno::Any aSelected;
113 aSelected <<= AccessibleStateType::SELECTED;
114 switch( eEventType )
115 {
117 {
118 AddState( AccessibleStateType::SELECTED );
119 BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty );
120
121 AddState( AccessibleStateType::FOCUSED );
122 aSelected <<= AccessibleStateType::FOCUSED;
123 BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty );
124
125 SAL_INFO("chart2.accessibility", "Selection acquired by: " << getAccessibleName());
126 }
127 break;
128
130 {
131 RemoveState( AccessibleStateType::SELECTED );
132 BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected );
133
134 AddState( AccessibleStateType::FOCUSED );
135 aSelected <<= AccessibleStateType::FOCUSED;
136 BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected );
137 SAL_INFO("chart2.accessibility", "Selection lost by: " << getAccessibleName());
138 }
139 break;
140 }
141 return true;
142 }
143 else if( m_bMayHaveChildren )
144 {
145 bool bStop = false;
146
147 ClearableMutexGuard aGuard( m_aMutex );
148 // make local copy for notification
149 ChildListVectorType aLocalChildList( m_aChildList );
150 aGuard.clear();
151
152 for (auto const& localChild : aLocalChildList)
153 {
154 // Note: at this place we must be sure to have an AccessibleBase
155 // object in the UNO reference to XAccessible !
156 bStop = (*static_cast< AccessibleBase * >
157 ( localChild.get() )).NotifyEvent( eEventType, rId );
158 if (bStop)
159 break;
160 }
161 return bStop;
162 }
163
164 return false;
165}
166
167void AccessibleBase::AddState( sal_Int64 aState )
168{
170 m_nStateSet |= aState;
171}
172
173void AccessibleBase::RemoveState( sal_Int64 aState )
174{
176 m_nStateSet &= ~aState;
177}
178
180{
181 bool bMustUpdateChildren = false;
182 {
183 MutexGuard aGuard( m_aMutex );
184 if( ! m_bMayHaveChildren ||
186 return false;
187
188 bMustUpdateChildren = ( m_bMayHaveChildren &&
190 }
191
192 // update unguarded
193 if( bMustUpdateChildren )
195
197}
198
200{
201 bool bResult = false;
202
204 {
206 m_aAccInfo.m_spObjectHierarchy->getChildren( GetId() ));
207 std::vector< ChildOIDMap::key_type > aAccChildren;
208 aAccChildren.reserve( aModelChildren.size());
209 std::transform( m_aChildOIDMap.begin(), m_aChildOIDMap.end(),
210 std::back_inserter( aAccChildren ),
212
213 std::sort( aModelChildren.begin(), aModelChildren.end());
214
215 std::vector< ObjectIdentifier > aChildrenToRemove, aChildrenToAdd;
216 std::set_difference( aModelChildren.begin(), aModelChildren.end(),
217 aAccChildren.begin(), aAccChildren.end(),
218 std::back_inserter( aChildrenToAdd ));
219 std::set_difference( aAccChildren.begin(), aAccChildren.end(),
220 aModelChildren.begin(), aModelChildren.end(),
221 std::back_inserter( aChildrenToRemove ));
223 for (auto const& childToRemove : aChildrenToRemove)
224 {
225 RemoveChildByOId(childToRemove);
226 }
227
228 AccessibleElementInfo aAccInfo( GetInfo());
229 aAccInfo.m_pParent = this;
230
231 for (auto const& childToAdd : aChildrenToAdd)
232 {
233 aAccInfo.m_aOID = childToAdd;
234 if ( childToAdd.isAutoGeneratedObject() )
235 {
237 }
238 else if ( childToAdd.isAdditionalShape() )
239 {
240 AddChild( new AccessibleChartShape( aAccInfo ) );
241 }
242 }
243 bResult = true;
244 }
245
246 return bResult;
247}
248
250{
251 OSL_ENSURE( pChild != nullptr, "Invalid Child" );
252 if( !pChild )
253 return;
254
255 ClearableMutexGuard aGuard( m_aMutex );
256
257 Reference< XAccessible > xChild( pChild );
258 m_aChildList.push_back( xChild );
259
260 m_aChildOIDMap[ pChild->GetId() ] = xChild;
261
262 // inform listeners of new child
264 {
265 Any aEmpty, aNew;
266 aNew <<= xChild;
267
268 aGuard.clear();
269 BroadcastAccEvent( AccessibleEventId::CHILD, aNew, aEmpty );
270 }
271}
272
277{
278 ClearableMutexGuard aGuard( m_aMutex );
279
280 ChildOIDMap::iterator aIt( m_aChildOIDMap.find( rOId ));
281 if( aIt == m_aChildOIDMap.end())
282 return;
283
284 Reference< XAccessible > xChild( aIt->second );
285
286 // remove from map
287 m_aChildOIDMap.erase( aIt );
288
289 // search child in vector
290 ChildListVectorType::iterator aVecIter =
291 std::find( m_aChildList.begin(), m_aChildList.end(), xChild );
292
293 OSL_ENSURE( aVecIter != m_aChildList.end(),
294 "Inconsistent ChildMap" );
295
296 // remove child from vector
297 m_aChildList.erase( aVecIter );
298 bool bInitialized = m_bChildrenInitialized;
299
300 // call listeners unguarded
301 aGuard.clear();
302
303 // inform listeners of removed child
304 if( bInitialized )
305 {
306 Any aEmpty, aOld;
307 aOld <<= xChild;
308
309 BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld );
310 }
311
312 // dispose the child
313 Reference< lang::XComponent > xComp( xChild, UNO_QUERY );
314 if( xComp.is())
315 xComp->dispose();
316}
317
319{
320 awt::Point aResult;
322 {
323 ClearableMutexGuard aGuard( m_aMutex );
325 aGuard.clear();
326
327 if( pParent )
328 {
329 aResult = pParent->GetUpperLeftOnScreen();
330 }
331 else
332 OSL_FAIL( "Default position used is probably incorrect." );
333 }
334
335 return aResult;
336}
337
339 sal_Int16 nId,
340 const Any & rNew,
341 const Any & rOld ) const
342{
343 ClearableMutexGuard aGuard( m_aMutex );
344
345 if ( !m_nEventNotifierId )
346 return;
347 // if we don't have a client id for the notifier, then we don't have listeners, then
348 // we don't need to notify anything
349
350 // the const cast is needed, because UNO parameters are never const
351 const AccessibleEventObject aEvent(
352 const_cast< uno::XWeak * >( static_cast< const uno::XWeak * >( this )),
353 nId, rNew, rOld, -1 );
354
355 // let the notifier handle this event
357
358 aGuard.clear();
359}
360
362{
363 ClearableMutexGuard aGuard( m_aMutex );
364
365 // make local copy for notification, and remove all children
366 ChildListVectorType aLocalChildList;
367 aLocalChildList.swap( m_aChildList );
368 m_aChildOIDMap.clear();
369
370 aGuard.clear();
371
372 // call dispose for all children
373 // and notify listeners
375 Any aEmpty, aOld;
376 for (auto const& localChild : aLocalChildList)
377 {
378 aOld <<= localChild;
379 BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld );
380
381 xComp.set(localChild, UNO_QUERY);
382 if( xComp.is())
383 xComp->dispose();
384 }
386}
387
389{
390 m_aAccInfo = rNewInfo;
392 {
394 }
395 BroadcastAccEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any());
396}
397
398// ________ (XComponent::dispose) ________
400{
401 {
402 MutexGuard aGuard(m_aMutex);
403 OSL_ENSURE(!m_bIsDisposed, "dispose() called twice");
404
405 // notify disposing to all AccessibleEvent listeners asynchronous
407 {
409 *this);
411 }
412
413 // reset pointers
414 m_aAccInfo.m_pParent = nullptr;
415
416 m_nStateSet = AccessibleStateType::DEFUNC;
417
418 m_bIsDisposed = true;
419
420 }
421 // call listeners unguarded
422
424 {
426 }
427 else
428 OSL_ENSURE( m_aChildList.empty(), "Child list should be empty" );
429}
430
431// ________ XAccessible ________
433{
434 return this;
435}
436
437// ________ AccessibleBase::XAccessibleContext ________
439{
440 ClearableMutexGuard aGuard( m_aMutex );
441 if( ! m_bMayHaveChildren ||
443 return 0;
444
445 bool bMustUpdateChildren = ( m_bMayHaveChildren &&
447
448 aGuard.clear();
449
450 // update unguarded
451 if( bMustUpdateChildren )
453
455}
456
458{
459 return m_aChildList.size();
460}
461
463{
466
467 ClearableMutexGuard aGuard( m_aMutex );
468 bool bMustUpdateChildren = ( m_bMayHaveChildren &&
470
471 aGuard.clear();
472
473 if( bMustUpdateChildren )
475
476 xResult.set( ImplGetAccessibleChildById( i ));
477
478 return xResult;
479}
480
482{
484
485 MutexGuard aGuard( m_aMutex);
486 if( ! m_bMayHaveChildren ||
487 i < 0 ||
488 o3tl::make_unsigned( i ) >= m_aChildList.size() )
489 {
490 OUString aBuf = "Index " + OUString::number( i ) + " is invalid for range [ 0, " +
491 OUString::number( m_aChildList.size() - 1 ) +
492 " ]";
493 lang::IndexOutOfBoundsException aEx( aBuf,
494 const_cast< ::cppu::OWeakObject * >(
495 static_cast< const ::cppu::OWeakObject * >( this )));
496 throw aEx;
497 }
498 else
499 xResult.set( m_aChildList[ i ] );
500
501 return xResult;
502}
503
505{
509 aResult.set( m_aAccInfo.m_pParent );
510
511 return aResult;
512}
513
515{
517
519 return m_aAccInfo.m_spObjectHierarchy->getIndexInParent( GetId() );
520 return -1;
521}
522
524{
525 return AccessibleRole::SHAPE;
526}
527
529{
531 return aResult;
532}
533
535{
537 {
538 Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
539 if ( xSelSupp.is() )
540 {
541 ObjectIdentifier aOID( xSelSupp->getSelection() );
542 if ( aOID.isValid() && GetId() == aOID )
543 {
544 AddState( AccessibleStateType::SELECTED );
545 AddState( AccessibleStateType::FOCUSED );
546 }
547 }
549 }
550
551 return m_nStateSet;
552}
553
554lang::Locale SAL_CALL AccessibleBase::getLocale()
555{
557
559}
560
561// ________ AccessibleBase::XAccessibleComponent ________
562sal_Bool SAL_CALL AccessibleBase::containsPoint( const awt::Point& aPoint )
563{
564 awt::Rectangle aRect( getBounds() );
565
566 // contains() works with relative coordinates
567 aRect.X = 0;
568 aRect.Y = 0;
569
570 return ( aPoint.X >= aRect.X &&
571 aPoint.Y >= aRect.Y &&
572 aPoint.X < (aRect.X + aRect.Width) &&
573 aPoint.Y < (aRect.Y + aRect.Height) );
574}
575
577{
580 awt::Rectangle aRect( getBounds());
581
582 // children are positioned relative to this object, so translate bound rect
583 aRect.X = 0;
584 aRect.Y = 0;
585
586 // children must be inside the own bound rect
587 if( ( aRect.X <= aPoint.X && aPoint.X <= (aRect.X + aRect.Width) ) &&
588 ( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height)))
589 {
590 ClearableMutexGuard aGuard( m_aMutex );
591 ChildListVectorType aLocalChildList( m_aChildList );
592 aGuard.clear();
593
595 for (auto const& localChild : aLocalChildList)
596 {
597 aComp.set(localChild, UNO_QUERY);
598 if( aComp.is())
599 {
600 aRect = aComp->getBounds();
601 if( ( aRect.X <= aPoint.X && aPoint.X <= (aRect.X + aRect.Width) ) &&
602 ( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height)))
603 {
604 aResult = localChild;
605 break;
606 }
607 }
608 }
609 }
610
611 return aResult;
612}
613
614awt::Rectangle SAL_CALL AccessibleBase::getBounds()
615{
617 if( pChartView )
618 {
620 awt::Rectangle aLogicRect( pChartView->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() ));
621 if( pWindow )
622 {
623 tools::Rectangle aRect( aLogicRect.X, aLogicRect.Y,
624 aLogicRect.X + aLogicRect.Width,
625 aLogicRect.Y + aLogicRect.Height );
626 SolarMutexGuard aSolarGuard;
627 aRect = pWindow->LogicToPixel( aRect );
628
629 // aLogicRect is relative to the page, but we need a value relative
630 // to the parent object
631 awt::Point aParentLocOnScreen;
633 if( xParent.is() )
634 aParentLocOnScreen = xParent->getLocationOnScreen();
635
636 awt::Point aULOnScreen = GetUpperLeftOnScreen();
637 awt::Point aOffset( aParentLocOnScreen.X - aULOnScreen.X,
638 aParentLocOnScreen.Y - aULOnScreen.Y );
639
640 return awt::Rectangle( aRect.Left() - aOffset.X, aRect.Top() - aOffset.Y,
641 aRect.getOpenWidth(), aRect.getOpenHeight());
642 }
643 }
644
645 return awt::Rectangle();
646}
647
648awt::Point SAL_CALL AccessibleBase::getLocation()
649{
651 awt::Rectangle aBBox( getBounds() );
652 return awt::Point( aBBox.X, aBBox.Y );
653}
654
656{
658
659 if (AccessibleBase* pParent = m_aAccInfo.m_pParent)
660 {
661 awt::Point aLocThisRel( getLocation());
662 awt::Point aUpperLeft(pParent->getLocationOnScreen());
663
664 return awt::Point( aUpperLeft.X + aLocThisRel.X,
665 aUpperLeft.Y + aLocThisRel.Y );
666 }
667 else
668 return getLocation();
669}
670
671awt::Size SAL_CALL AccessibleBase::getSize()
672{
674 awt::Rectangle aBBox( getBounds() );
675 return awt::Size( aBBox.Width, aBBox.Height );
676}
677
679{
681
682 Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
683 if ( xSelSupp.is() )
684 {
685 xSelSupp->select( GetId().getAny() );
686 }
687}
688
690{
691 return sal_Int32(getColor( ACC_BASE_FOREGROUND ));
692}
693
695{
696 return sal_Int32(getColor( ACC_BASE_BACKGROUND ));
697}
698
700{
701 Color nResult = COL_TRANSPARENT;
703 return nResult;
704
708 OUString aObjectCID = aOID.getObjectCID();
710 {
711 // for colors get the data series/point properties
712 std::u16string_view aParentParticle( ObjectIdentifier::getFullParentParticle( aObjectCID ));
713 aObjectCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle );
714 }
715
716 xObjProp =
718 aObjectCID, m_aAccInfo.m_xChartDocument );
719 if( xObjProp.is())
720 {
721 try
722 {
723 OUString aPropName;
724 OUString aStylePropName;
725
726 switch( eType )
727 {
731 if( eColType == ACC_BASE_FOREGROUND )
732 {
733 aPropName = "BorderColor";
734 aStylePropName = "BorderTransparency";
735 }
736 else
737 {
738 aPropName = "Color";
739 aStylePropName = "Transparency";
740 }
741 break;
742 default:
743 if( eColType == ACC_BASE_FOREGROUND )
744 {
745 aPropName = "LineColor";
746 aStylePropName = "LineTransparence";
747 }
748 else
749 {
750 aPropName = "FillColor";
751 aStylePropName = "FillTransparence";
752 }
753 break;
754 }
755
756 bool bTransparent = m_bAlwaysTransparent;
757 Reference< beans::XPropertySetInfo > xInfo = xObjProp->getPropertySetInfo();
758 if( xInfo.is() &&
759 xInfo->hasPropertyByName( aStylePropName ))
760 {
761 if( eColType == ACC_BASE_FOREGROUND )
762 {
763 drawing::LineStyle aLStyle;
764 if( xObjProp->getPropertyValue( aStylePropName ) >>= aLStyle )
765 bTransparent = (aLStyle == drawing::LineStyle_NONE);
766 }
767 else
768 {
769 drawing::FillStyle aFStyle;
770 if( xObjProp->getPropertyValue( aStylePropName ) >>= aFStyle )
771 bTransparent = (aFStyle == drawing::FillStyle_NONE);
772 }
773 }
774
775 if( !bTransparent &&
776 xInfo.is() &&
777 xInfo->hasPropertyByName( aPropName ))
778 {
779 xObjProp->getPropertyValue( aPropName ) >>= nResult;
780 }
781 }
782 catch( const uno::Exception & )
783 {
784 DBG_UNHANDLED_EXCEPTION("chart2");
785 }
786 }
787
788 return nResult;
789}
790
791// ________ AccessibleBase::XServiceInfo ________
793{
794 return "AccessibleBase";
795}
796
797sal_Bool SAL_CALL AccessibleBase::supportsService( const OUString& ServiceName )
798{
799 return cppu::supportsService( this, ServiceName );
800}
801
803{
804 return {
805 "com.sun.star.accessibility.Accessible",
806 "com.sun.star.accessibility.AccessibleContext"
807 };
808}
809
810// ________ AccessibleBase::XEventListener ________
811void SAL_CALL AccessibleBase::disposing( const lang::EventObject& /*Source*/ )
812{
813}
814
815// ________ XAccessibleEventBroadcasters ________
817{
818 MutexGuard aGuard( m_aMutex );
819
820 if ( xListener.is() )
821 {
822 if ( !m_nEventNotifierId )
824
826 }
827}
828
830{
831 MutexGuard aGuard( m_aMutex );
832
833 if ( xListener.is() && m_nEventNotifierId)
834 {
836 if ( !nListenerCount )
837 {
838 // no listeners anymore
841 }
842 }
843}
844
845} // namespace chart
846
847/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
Base class for all Chart Accessibility objects.
void KillAllChildren()
Removes all children from the internal lists and broadcasts child remove events.
virtual css::uno::Reference< css::accessibility::XAccessible > ImplGetAccessibleChildById(sal_Int64 i) const
Is called from getAccessibleChild().
virtual sal_Int64 ImplGetAccessibleChildCount() const
Is called from getAccessibleChildCount().
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
AccessibleBase(AccessibleElementInfo aAccInfo, bool bMayHaveChildren, bool bAlwaysTransparent)
void SetInfo(const AccessibleElementInfo &rNewInfo)
std::vector< css::uno::Reference< css::accessibility::XAccessible > > ChildListVectorType
type of the vector containing the accessible children
const AccessibleUniqueId & GetId() const
virtual css::awt::Point GetUpperLeftOnScreen() const
Retrieve the pixel coordinates of logical coordinates (0,0) of the current logic coordinate system.
Color getColor(eColorType eColType)
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::awt::Size SAL_CALL getSize() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::awt::Point SAL_CALL getLocation() override
void AddState(sal_Int64 aState)
Adds a state to the set.
sal_Int64 m_nStateSet
for getAccessibleStateSet()
volatile bool m_bStateSetInitialized
denotes if the state-set is initialized.
ChildListVectorType m_aChildList
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
bool UpdateChildren()
has to be overridden by derived classes that support child elements.
::comphelper::AccessibleEventNotifier::TClientId m_nEventNotifierId
bool NotifyEvent(EventType eType, const AccessibleUniqueId &rId)
Events coming from the core have to be processed in this methods.
virtual void SAL_CALL grabFocus() override
AccessibleElementInfo m_aAccInfo
virtual ~AccessibleBase() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
void RemoveChildByOId(const ObjectIdentifier &rOId)
removes a child from the internal vector.
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual void SAL_CALL disposing() override
virtual css::lang::Locale SAL_CALL getLocale() override
bool CheckDisposeState(bool bThrowException=true) const
void BroadcastAccEvent(sal_Int16 nId, const css::uno::Any &rNew, const css::uno::Any &rOld) const
This method creates an AccessibleEventObject and sends it to all listeners that are currently listeni...
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
void RemoveState(sal_Int64 aState)
Removes a state from the set if the set contains the state, otherwise nothing is done.
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
void AddChild(AccessibleBase *pChild)
adds a child to the end of the internal vector of children.
const AccessibleElementInfo & GetInfo() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual bool ImplUpdateChildren()
Is called by UpdateChildren.
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
static rtl::Reference< AccessibleBase > CreateChartElement(const AccessibleElementInfo &rAccInfo)
std::vector< ObjectIdentifier > tChildContainer
static OUString createClassifiedIdentifierForParticle(std::u16string_view rParticle)
const OUString & getObjectCID() const
static ObjectType getObjectType(std::u16string_view rCID)
static css::uno::Reference< css::beans::XPropertySet > getObjectPropertySet(std::u16string_view rObjectCID, const rtl::Reference< ::chart::ChartModel > &xChartDocument)
static std::u16string_view getFullParentParticle(std::u16string_view rCID)
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static void revokeClient(const TClientId _nClient)
static void revokeClientNotifyDisposing(const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
mutable::osl::Mutex m_aMutex
constexpr tools::Long Top() const
tools::Long getOpenHeight() const
tools::Long getOpenWidth() const
constexpr tools::Long Left() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_UNHANDLED_EXCEPTION(...)
DocumentType eType
std::mutex m_aMutex
#define SAL_INFO(area, stream)
aBuf
::cppu::WeakComponentImplHelper< css::accessibility::XAccessible, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleEventBroadcaster, css::lang::XServiceInfo, css::lang::XEventListener > AccessibleBase_Base
@ OBJECTTYPE_DATA_SERIES
@ OBJECTTYPE_LEGEND_ENTRY
@ OBJECTTYPE_DATA_POINT
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
OUString aPropName
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
sal_Int16 nId
css::uno::WeakReference< css::awt::XWindow > m_xWindow
std::shared_ptr< ObjectHierarchy > m_spObjectHierarchy
unotools::WeakReference< ::chart::ChartModel > m_xChartDocument
unotools::WeakReference< ::chart::ChartView > m_xView
unsigned char sal_Bool