LibreOffice Module comphelper (master)  1
accessiblewrapper.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 
21 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
22 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
23 
24 using namespace ::comphelper;
25 using namespace ::com::sun::star::accessibility;
26 using namespace ::com::sun::star::uno;
27 using namespace ::com::sun::star::lang;
28 
29 
30 namespace comphelper
31 {
32  OWrappedAccessibleChildrenManager::OWrappedAccessibleChildrenManager( const Reference< XComponentContext >& _rxContext )
33  :m_xContext( _rxContext )
34  ,m_bTransientChildren( true )
35  {
36  }
37 
38 
39  OWrappedAccessibleChildrenManager::~OWrappedAccessibleChildrenManager( )
40  {
41  }
42 
43 
44  void OWrappedAccessibleChildrenManager::setTransientChildren( bool _bSet )
45  {
46  m_bTransientChildren = _bSet;
47  }
48 
49 
50  void OWrappedAccessibleChildrenManager::setOwningAccessible( const Reference< XAccessible >& _rxAcc )
51  {
52  OSL_ENSURE( !m_aOwningAccessible.get().is(), "OWrappedAccessibleChildrenManager::setOwningAccessible: to be called only once!" );
53  m_aOwningAccessible = WeakReference< XAccessible >( _rxAcc );
54  }
55 
56 
57  void OWrappedAccessibleChildrenManager::removeFromCache( const Reference< XAccessible >& _rxKey )
58  {
59  AccessibleMap::iterator aRemovedPos = m_aChildrenMap.find( _rxKey );
60  if ( m_aChildrenMap.end() != aRemovedPos )
61  { // it was cached
62  // remove ourself as event listener
63  Reference< XComponent > xComp( aRemovedPos->first, UNO_QUERY );
64  if( xComp.is() )
65  xComp->removeEventListener( this );
66  // and remove the entry from the map
67  m_aChildrenMap.erase( aRemovedPos );
68  }
69  }
70 
71 
72  void OWrappedAccessibleChildrenManager::invalidateAll( )
73  {
74  // remove as event listener from the map elements
75  for( const auto& rChild : m_aChildrenMap )
76  {
77  Reference< XComponent > xComp( rChild.first, UNO_QUERY );
78  if( xComp.is() )
79  xComp->removeEventListener( this );
80  }
81  // clear the map
83  m_aChildrenMap.swap( aMap );
84  }
85 
86 
87  Reference< XAccessible > OWrappedAccessibleChildrenManager::getAccessibleWrapperFor(
88  const Reference< XAccessible >& _rxKey )
89  {
90  Reference< XAccessible > xValue;
91 
92  if( !_rxKey.is() )
93  {
94  // fprintf( stderr, "It was this path that was crashing stuff\n" );
95  return xValue;
96  }
97 
98  // do we have this child in the cache?
99  AccessibleMap::const_iterator aPos = m_aChildrenMap.find( _rxKey );
100  if ( m_aChildrenMap.end() != aPos )
101  {
102  xValue = aPos->second;
103  }
104  else
105  { // not found in the cache, and allowed to create
106  // -> new wrapper
107  xValue = new OAccessibleWrapper( m_xContext, _rxKey, m_aOwningAccessible );
108 
109  // see if we do cache children
110  if ( !m_bTransientChildren )
111  {
112  if (!m_aChildrenMap.emplace( _rxKey, xValue ).second)
113  {
114  OSL_FAIL(
115  "OWrappedAccessibleChildrenManager::"
116  "getAccessibleWrapperFor: element was already"
117  " inserted!" );
118  }
119 
120  // listen for disposals of inner children - this may happen when the inner context
121  // is the owner for the inner children (it will dispose these children, and of course
122  // not our wrapper for these children)
123  Reference< XComponent > xComp( _rxKey, UNO_QUERY );
124  if ( xComp.is() )
125  xComp->addEventListener( this );
126  }
127  }
128 
129  return xValue;
130  }
131 
132 
133  void OWrappedAccessibleChildrenManager::dispose()
134  {
135  // dispose our children
136  for( const auto& rChild : m_aChildrenMap )
137  {
138  Reference< XComponent > xComp( rChild.first, UNO_QUERY );
139  if( xComp.is() )
140  xComp->removeEventListener( this );
141 
142  Reference< XComponent > xContextComponent;
143  if( rChild.second.is() )
144  xContextComponent.set( rChild.second->getAccessibleContext(),
145  ::css::uno::UNO_QUERY );
146  if( xContextComponent.is() )
147  xContextComponent->dispose();
148  }
149 
150  // clear our children
151  AccessibleMap aMap;
152  m_aChildrenMap.swap( aMap );
153  }
154 
155 
156  void OWrappedAccessibleChildrenManager::implTranslateChildEventValue( const Any& _rInValue, Any& _rOutValue )
157  {
158  _rOutValue.clear();
159  Reference< XAccessible > xChild;
160  if ( _rInValue >>= xChild )
161  _rOutValue <<= getAccessibleWrapperFor( xChild );
162  }
163 
164 
165  void OWrappedAccessibleChildrenManager::translateAccessibleEvent( const AccessibleEventObject& _rEvent, AccessibleEventObject& _rTranslatedEvent )
166  {
167  // just in case we can't translate some of the values:
168  _rTranslatedEvent.NewValue = _rEvent.NewValue;
169  _rTranslatedEvent.OldValue = _rEvent.OldValue;
170 
171  switch ( _rEvent.EventId )
172  {
173  case AccessibleEventId::CHILD:
174  case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
175  case AccessibleEventId::CONTROLLED_BY_RELATION_CHANGED:
176  case AccessibleEventId::CONTROLLER_FOR_RELATION_CHANGED:
177  case AccessibleEventId::LABEL_FOR_RELATION_CHANGED:
178  case AccessibleEventId::LABELED_BY_RELATION_CHANGED:
179  case AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED:
180  case AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED:
181  // these are events where both the old and the new value contain child references
182  implTranslateChildEventValue( _rEvent.OldValue, _rTranslatedEvent.OldValue );
183  implTranslateChildEventValue( _rEvent.NewValue, _rTranslatedEvent.NewValue );
184  break;
185 
186  case AccessibleEventId::NAME_CHANGED:
187  case AccessibleEventId::DESCRIPTION_CHANGED:
188  case AccessibleEventId::ACTION_CHANGED:
189  case AccessibleEventId::STATE_CHANGED:
190  case AccessibleEventId::BOUNDRECT_CHANGED:
191  case AccessibleEventId::INVALIDATE_ALL_CHILDREN:
192  case AccessibleEventId::SELECTION_CHANGED:
193  case AccessibleEventId::VISIBLE_DATA_CHANGED:
194  case AccessibleEventId::VALUE_CHANGED:
195  case AccessibleEventId::MEMBER_OF_RELATION_CHANGED:
196  case AccessibleEventId::CARET_CHANGED:
197  case AccessibleEventId::TEXT_CHANGED:
198  case AccessibleEventId::HYPERTEXT_CHANGED:
199  case AccessibleEventId::TABLE_CAPTION_CHANGED:
200  case AccessibleEventId::TABLE_COLUMN_DESCRIPTION_CHANGED:
201  case AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED:
202  case AccessibleEventId::TABLE_MODEL_CHANGED:
203  case AccessibleEventId::TABLE_ROW_DESCRIPTION_CHANGED:
204  case AccessibleEventId::TABLE_ROW_HEADER_CHANGED:
205  case AccessibleEventId::TABLE_SUMMARY_CHANGED:
206  // these Ids are also missed: SUB_WINDOW_OF_RELATION_CHANGED & TEXT_ATTRIBUTE_CHANGED
207  case AccessibleEventId::TEXT_SELECTION_CHANGED:
208  // nothing to translate
209  break;
210 
211  default:
212  OSL_FAIL( "OWrappedAccessibleChildrenManager::translateAccessibleEvent: unknown (or unexpected) event id!" );
213  break;
214  }
215  }
216 
217 
218  void OWrappedAccessibleChildrenManager::handleChildNotification( const AccessibleEventObject& _rEvent )
219  {
220  if ( AccessibleEventId::INVALIDATE_ALL_CHILDREN == _rEvent.EventId )
221  { // clear our child map
222  invalidateAll( );
223  }
224  else if ( AccessibleEventId::CHILD == _rEvent.EventId )
225  {
226  // check if the removed or replaced element is cached
227  Reference< XAccessible > xRemoved;
228  if ( _rEvent.OldValue >>= xRemoved )
229  removeFromCache( xRemoved );
230  }
231  }
232 
233 
234  void SAL_CALL OWrappedAccessibleChildrenManager::disposing( const EventObject& _rSource )
235  {
236  // this should come from one of the inner XAccessible's of our children
237  Reference< XAccessible > xSource( _rSource.Source, UNO_QUERY );
238  AccessibleMap::iterator aDisposedPos = m_aChildrenMap.find( xSource );
239 #if OSL_DEBUG_LEVEL > 0
240  if ( m_aChildrenMap.end() == aDisposedPos )
241  {
242  OSL_FAIL( "OWrappedAccessibleChildrenManager::disposing: where did this come from?" );
243  // helper for diagnostics
244  Reference< XAccessible > xOwningAccessible( m_aOwningAccessible );
245  Reference< XAccessibleContext > xContext;
246  try
247  {
248  if ( xOwningAccessible.is() )
249  xContext = xOwningAccessible->getAccessibleContext();
250  if ( xContext.is() )
251  {
252  //TODO: do something
253  //OUString sName = xContext->getAccessibleName();
254  //OUString sDescription = xContext->getAccessibleDescription();
255  //sal_Int32 nPlaceYourBreakpointHere = 0;
256  }
257  }
258  catch( const Exception& /*e*/ )
259  {
260  // silent this, it's only diagnostics which failed
261  }
262  }
263 #endif
264  if ( m_aChildrenMap.end() != aDisposedPos )
265  {
266  m_aChildrenMap.erase( aDisposedPos );
267  }
268  }
269 
271  const Reference< XAccessible >& _rxInnerAccessible, const Reference< XAccessible >& _rxParentAccessible )
272  :OAccessibleWrapper_Base( )
273  ,OComponentProxyAggregation( _rxContext, Reference< XComponent >( _rxInnerAccessible, UNO_QUERY ) )
274  ,m_xParentAccessible( _rxParentAccessible )
275  ,m_xInnerAccessible( _rxInnerAccessible )
276  {
277  }
278 
279 
281  {
282  if ( !m_rBHelper.bDisposed )
283  {
284  acquire(); // to prevent duplicate dtor calls
285  dispose();
286  }
287  }
288 
289 
292 
293 
294  Any OAccessibleWrapper::queryInterface( const Type& _rType )
295  {
296  // #111089# instead of the inner XAccessible the proxy XAccessible must be returned
297  Any aReturn = OAccessibleWrapper_Base::queryInterface( _rType );
298  if ( !aReturn.hasValue() )
299  aReturn = OComponentProxyAggregation::queryInterface( _rType );
300 
301  return aReturn;
302  }
303 
304 
305  Reference< XAccessibleContext > OAccessibleWrapper::getContextNoCreate( ) const
306  {
307  return m_aContext;
308  }
309 
310 
311  OAccessibleContextWrapper* OAccessibleWrapper::createAccessibleContext( const Reference< XAccessibleContext >& _rxInnerContext )
312  {
313  return new OAccessibleContextWrapper( getComponentContext(), _rxInnerContext, this, m_xParentAccessible );
314  }
315 
316 
317  Reference< XAccessibleContext > SAL_CALL OAccessibleWrapper::getAccessibleContext( )
318  {
319  // see if the context is still alive (we cache it)
320  Reference< XAccessibleContext > xContext = m_aContext;
321  if ( !xContext.is() )
322  {
323  // create a new context
324  Reference< XAccessibleContext > xInnerContext = m_xInnerAccessible->getAccessibleContext( );
325  if ( xInnerContext.is() )
326  {
327  xContext = createAccessibleContext( xInnerContext );
328  // cache it
329  m_aContext = WeakReference< XAccessibleContext >( xContext );
330  }
331  }
332 
333  return xContext;
334  }
335 
337  const Reference< XComponentContext >& _rxContext,
338  ::cppu::OBroadcastHelper& _rBHelper,
339  const Reference< XAccessibleContext >& _rxInnerAccessibleContext,
340  const Reference< XAccessible >& _rxOwningAccessible,
341  const Reference< XAccessible >& _rxParentAccessible )
342  :OComponentProxyAggregationHelper( _rxContext, _rBHelper )
343  ,m_xInnerContext( _rxInnerAccessibleContext )
344  ,m_xOwningAccessible( _rxOwningAccessible )
345  ,m_xParentAccessible( _rxParentAccessible )
346  // initialize the mapper for our children
347  ,m_xChildMapper( new OWrappedAccessibleChildrenManager( getComponentContext() ) )
348  {
349  // determine if we're allowed to cache children
350  Reference< XAccessibleStateSet > xStates( m_xInnerContext->getAccessibleStateSet( ) );
351  OSL_ENSURE( xStates.is(), "OAccessibleContextWrapperHelper::OAccessibleContextWrapperHelper: no inner state set!" );
352  m_xChildMapper->setTransientChildren( !xStates.is() || xStates->contains( AccessibleStateType::MANAGES_DESCENDANTS) );
353 
354  m_xChildMapper->setOwningAccessible( m_xOwningAccessible );
355  }
356 
357 
358  void OAccessibleContextWrapperHelper::aggregateProxy( oslInterlockedCount& _rRefCount, ::cppu::OWeakObject& _rDelegator )
359  {
360  Reference< XComponent > xInnerComponent( m_xInnerContext, UNO_QUERY );
361  OSL_ENSURE( xInnerComponent.is(), "OComponentProxyAggregation::aggregateProxy: accessible is no XComponent!" );
362  if ( xInnerComponent.is() )
363  componentAggregateProxyFor( xInnerComponent, _rRefCount, _rDelegator );
364 
365  // add as event listener to the inner context, because we want to multiplex the AccessibleEvents
366  osl_atomic_increment( &_rRefCount );
367  {
368  Reference< XAccessibleEventBroadcaster > xBroadcaster( m_xInner, UNO_QUERY );
369  if ( xBroadcaster.is() )
370  xBroadcaster->addAccessibleEventListener( this );
371  }
372  osl_atomic_decrement( &_rRefCount );
373  }
374 
375 
377  {
378  OSL_ENSURE( m_rBHelper.bDisposed, "OAccessibleContextWrapperHelper::~OAccessibleContextWrapperHelper: you should ensure (in your dtor) that the object is disposed!" );
379  }
380 
381 
383  {
385  if ( !aReturn.hasValue() )
387  return aReturn;
388  }
389 
390 
392 
393 
394  sal_Int32 OAccessibleContextWrapperHelper::baseGetAccessibleChildCount( )
395  {
396  return m_xInnerContext->getAccessibleChildCount();
397  }
398 
399 
400  Reference< XAccessible > OAccessibleContextWrapperHelper::baseGetAccessibleChild( sal_Int32 i )
401  {
402  // get the child of the wrapped component
403  Reference< XAccessible > xInnerChild = m_xInnerContext->getAccessibleChild( i );
404  return m_xChildMapper->getAccessibleWrapperFor( xInnerChild );
405  }
406 
407 
409  {
410  return m_xInnerContext->getAccessibleRelationSet();
411  // TODO: if this relation set would contain relations to siblings, we would normally need
412  // to wrap them, too...
413  }
414 
415 
416  void SAL_CALL OAccessibleContextWrapperHelper::notifyEvent( const AccessibleEventObject& _rEvent )
417  {
418 #if OSL_DEBUG_LEVEL > 0
419  if ( AccessibleEventId::STATE_CHANGED == _rEvent.EventId )
420  {
421  bool bChildTransienceChanged = false;
422  sal_Int16 nChangeState = 0;
423  if ( _rEvent.OldValue >>= nChangeState )
424  bChildTransienceChanged = bChildTransienceChanged || AccessibleStateType::MANAGES_DESCENDANTS == nChangeState;
425  if ( _rEvent.NewValue >>= nChangeState )
426  bChildTransienceChanged = bChildTransienceChanged || AccessibleStateType::MANAGES_DESCENDANTS == nChangeState;
427  OSL_ENSURE( !bChildTransienceChanged, "OAccessibleContextWrapperHelper::notifyEvent: MANAGES_DESCENDANTS is not expected to change during runtime!" );
428  // if this asserts, then we would need to update our m_bTransientChildren flag here,
429  // as well as (potentially) our child cache
430  }
431 #endif
432  AccessibleEventObject aTranslatedEvent( _rEvent );
433 
434  {
435  ::osl::MutexGuard aGuard( m_rBHelper.rMutex );
436 
437  // translate the event
438  queryInterface( cppu::UnoType<XInterface>::get() ) >>= aTranslatedEvent.Source;
439  m_xChildMapper->translateAccessibleEvent( _rEvent, aTranslatedEvent );
440 
441  // see if any of these notifications affect our child manager
442  m_xChildMapper->handleChildNotification( _rEvent );
443 
444  if ( aTranslatedEvent.NewValue == m_xInner )
445  aTranslatedEvent.NewValue <<= aTranslatedEvent.Source;
446  if ( aTranslatedEvent.OldValue == m_xInner )
447  aTranslatedEvent.OldValue <<= aTranslatedEvent.Source;
448  }
449 
450  notifyTranslatedEvent( aTranslatedEvent );
451  }
452 
453 
455  {
456  ::osl::MutexGuard aGuard( m_rBHelper.rMutex );
457 
458  // stop multiplexing events
459  Reference< XAccessibleEventBroadcaster > xBroadcaster( m_xInner, UNO_QUERY );
460  OSL_ENSURE( xBroadcaster.is(), "OAccessibleContextWrapperHelper::disposing(): inner context is no broadcaster!" );
461  if ( xBroadcaster.is() )
462  xBroadcaster->removeAccessibleEventListener( this );
463 
464  // dispose the child cache/map
465  m_xChildMapper->dispose();
466 
467  // let the base class dispose the inner component
469  }
470 
471 
472  void SAL_CALL OAccessibleContextWrapperHelper::disposing( const EventObject& _rEvent )
473  {
474  // simply disambiguate this
476  }
477 
479 
480 
482 
483 
484  OAccessibleContextWrapper::OAccessibleContextWrapper( const Reference< XComponentContext >& _rxContext,
485  const Reference< XAccessibleContext >& _rxInnerAccessibleContext, const Reference< XAccessible >& _rxOwningAccessible,
486  const Reference< XAccessible >& _rxParentAccessible )
487  :OAccessibleContextWrapper_CBase( m_aMutex )
488  ,OAccessibleContextWrapperHelper( _rxContext, rBHelper, _rxInnerAccessibleContext, _rxOwningAccessible, _rxParentAccessible )
489  ,m_nNotifierClient( 0 )
490  {
491  aggregateProxy( m_refCount, *this );
492  }
493 
494 
496  {
497  }
498 
499 
501  {
503  }
504 
505 
506  Reference< XAccessible > SAL_CALL OAccessibleContextWrapper::getAccessibleChild( sal_Int32 i )
507  {
508  return baseGetAccessibleChild( i );
509  }
510 
511 
512  Reference< XAccessible > SAL_CALL OAccessibleContextWrapper::getAccessibleParent( )
513  {
514  return m_xParentAccessible;
515  }
516 
517 
519  {
520  return m_xInnerContext->getAccessibleIndexInParent();
521  }
522 
523 
525  {
526  return m_xInnerContext->getAccessibleRole();
527  }
528 
529 
531  {
532  return m_xInnerContext->getAccessibleDescription();
533  }
534 
535 
537  {
538  return m_xInnerContext->getAccessibleName();
539  }
540 
541 
542  Reference< XAccessibleRelationSet > SAL_CALL OAccessibleContextWrapper::getAccessibleRelationSet( )
543  {
545  }
546 
547 
548  Reference< XAccessibleStateSet > SAL_CALL OAccessibleContextWrapper::getAccessibleStateSet( )
549  {
550  return m_xInnerContext->getAccessibleStateSet();
551  }
552 
553 
555  {
556  return m_xInnerContext->getLocale();
557  }
558 
559 
560  void OAccessibleContextWrapper::notifyTranslatedEvent( const AccessibleEventObject& _rEvent )
561  {
562  if ( m_nNotifierClient )
564  }
565 
566 
567  void SAL_CALL OAccessibleContextWrapper::addAccessibleEventListener( const Reference< XAccessibleEventListener >& _rxListener )
568  {
569  ::osl::MutexGuard aGuard( m_aMutex );
570  if ( !m_nNotifierClient )
573  }
574 
575 
576  void SAL_CALL OAccessibleContextWrapper::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& _rxListener )
577  {
578  ::osl::MutexGuard aGuard( m_aMutex );
579  if ( m_nNotifierClient )
580  {
582  {
584  m_nNotifierClient = 0;
586  }
587  }
588  }
589 
590 
592  {
593  AccessibleEventNotifier::TClientId nClientId( 0 );
594 
595  // --- <mutex lock> -----------------------------------------
596  {
597  ::osl::MutexGuard aGuard( m_aMutex );
598 
599  // prepare notifying our AccessibleListeners
600  if ( m_nNotifierClient )
601  {
602  nClientId = m_nNotifierClient;
603  m_nNotifierClient = 0;
604  }
605  }
606  // --- </mutex lock> -----------------------------------------
607 
608  // let the base class do
610 
611  // notify the disposal
612  if ( nClientId )
614  }
615 } // namespace accessibility
616 
617 
618 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
::cppu::WeakComponentImplHelper< css::accessibility::XAccessibleEventBroadcaster, css::accessibility::XAccessibleContext > OAccessibleContextWrapper_CBase
::std::map< css::uno::Reference< css::accessibility::XAccessible >, css::uno::Reference< css::accessibility::XAccessible > > AccessibleMap
::osl::Mutex m_aMutex
a class which aggregates a proxy for an XAccessible, and wrapping the context returned by this XAcces...
css::uno::WeakReference< css::accessibility::XAccessibleContext > m_aContext
virtual void notifyTranslatedEvent(const css::accessibility::AccessibleEventObject &_rEvent)=0
notify an accessible event which has been translated (if necessary)
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Reference
sal_Int16 nId
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
mutable::osl::Mutex m_aMutex
#define IMPLEMENT_FORWARD_XTYPEPROVIDER2(classname, baseclass1, baseclass2)
Definition: uno3.hxx:136
virtual void SAL_CALL dispose() override
css::uno::Reference< css::accessibility::XAccessible > m_xInnerAccessible
virtual css::lang::Locale SAL_CALL getLocale() override
css::uno::Reference< css::accessibility::XAccessibleRelationSet > baseGetAccessibleRelationSet()
Helper for wrapping an XAccessibleContext by aggregating a proxy for it.
HashMap_OWString_Interface aMap
virtual void SAL_CALL disposing() override
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
virtual OUString SAL_CALL getAccessibleDescription() override
::comphelper::AccessibleEventNotifier::TClientId m_nNotifierClient
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
revokes a listener for the given client
OAccessibleWrapper(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::accessibility::XAccessible > &_rxInnerAccessible, const css::uno::Reference< css::accessibility::XAccessible > &_rxParentAccessible)
ctor
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &aEvent) override
void aggregateProxy(oslInterlockedCount &_rRefCount,::cppu::OWeakObject &_rDelegator)
to be called from within your ctor - does the aggregation of a proxy for m_xInnerContext ...
virtual OUString SAL_CALL getAccessibleName() override
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
static void revokeClientNotifyDisposing(const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
revokes a client, with additionally notifying a disposing event to all listeners registered for this ...
#define IMPLEMENT_FORWARD_XINTERFACE2(classname, refcountbase, baseclass2)
Definition: uno3.hxx:99
css::uno::Reference< css::accessibility::XAccessible > baseGetAccessibleChild(sal_Int32 i)
css::uno::Reference< css::accessibility::XAccessibleContext > getContextNoCreate() const
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
Definition: uno3.hxx:95
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
css::uno::Reference< css::lang::XComponent > m_xInner
rtl::Reference< OWrappedAccessibleChildrenManager > m_xChildMapper
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
static void revokeClient(const TClientId _nClient)
revokes a broadcaster of AccessibleEvents
css::uno::Reference< css::accessibility::XAccessible > m_xParentAccessible
the XAccessible which is to be returned in getAccessibleParent
a helper class for aggregating a proxy to an XComponent
css::uno::Reference< css::accessibility::XAccessible > m_xParentAccessible
virtual void SAL_CALL dispose() override
virtual OAccessibleContextWrapper * createAccessibleContext(const css::uno::Reference< css::accessibility::XAccessibleContext > &_rxInnerContext)
css::uno::Reference< css::accessibility::XAccessibleContext > m_xInnerContext
the context we're wrapping (properly typed, in opposite to OComponentProxyAggregationHelper::m_xInner...
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
void componentAggregateProxyFor(const css::uno::Reference< css::lang::XComponent > &_rxComponent, oslInterlockedCount &_rRefCount,::cppu::OWeakObject &_rDelegator)
to be called from within your ctor
virtual void notifyTranslatedEvent(const css::accessibility::AccessibleEventObject &_rEvent) override
notify an accessible event which has been translated (if necessary)
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
adds an event, which is to be broadcasted, to the queue
OAccessibleContextWrapperHelper(const css::uno::Reference< css::uno::XComponentContext > &_rxContext,::cppu::OBroadcastHelper &_rBHelper, const css::uno::Reference< css::accessibility::XAccessibleContext > &_rxInnerAccessibleContext, const css::uno::Reference< css::accessibility::XAccessible > &_rxOwningAccessible, const css::uno::Reference< css::accessibility::XAccessible > &_rxParentAccessible)
ctor
Reference< XComponentContext > m_xContext
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
static TClientId registerClient()
registers a client of this class, means a broadcaster of AccessibleEvents
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
registers a listener for the given client