22#include <osl/diagnose.h>
23#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
75 if ( _rxListener.is() )
76 _rxListener->disposing( EventObject( *
this ) );
80 if ( _rxListener.is() )
103 if ( !nListenerCount )
116 const Any& _rOldValue,
const Any& _rNewValue, sal_Int32 nIndexHint )
124 AccessibleEventObject
aEvent(*
this, _nEventId, _rNewValue, _rOldValue, nIndexHint);
133 return !rBHelper.bDisposed && !rBHelper.bInDispose;
140 throw DisposedException();
146 if ( !rBHelper.bDisposed )
148 OSL_ENSURE( 0 ==
m_refCount,
"OCommonAccessibleComponent::ensureDisposed: this method _has_ to be called from without your dtor only!" );
186 if ( xParentContext.is() )
189 Reference< XAccessible > xCreator(
m_aCreator);
191 OSL_ENSURE( xCreator.is(),
"OCommonAccessibleComponent::getAccessibleIndexInParent: invalid creator!" );
200 sal_Int64 nChildCount = xParentContext->getAccessibleChildCount();
201 for ( sal_Int64 nChild = 0; ( nChild < nChildCount ) && ( -1 == nRet ); ++nChild )
203 Reference< XAccessible > xChild( xParentContext->getAccessibleChild( nChild ) );
204 if ( xChild.get() == xCreator.get() )
212 OSL_FAIL(
"OCommonAccessibleComponent::getAccessibleIndexInParent: caught an exception!" );
223 Reference< XAccessibleContext > xParentContext;
225 xParentContext = xParent->getAccessibleContext();
227 if ( !xParentContext.is() )
228 throw IllegalAccessibleComponentStateException( OUString(), *
this );
230 return xParentContext->getLocale();
237 Reference< XAccessibleContext > xParentContext;
239 xParentContext = xParent->getAccessibleContext();
240 return xParentContext;
248 return ( _rPoint.X >= 0 )
249 && ( _rPoint.Y >= 0 )
250 && ( _rPoint.X < aBounds.Width )
251 && ( _rPoint.Y < aBounds.Height );
259 return awt::Point( aBounds.X, aBounds.Y );
267 awt::Point aScreenLoc( 0, 0 );
270 OSL_ENSURE( xParentComponent.is(),
"OCommonAccessibleComponent::getLocationOnScreen: no parent component!" );
271 if ( xParentComponent.is() )
273 awt::Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
275 aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
276 aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
287 return awt::Size( aBounds.Width, aBounds.Height );
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
registers a listener for the given client
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
adds an event, which is to be broadcasted, to the queue
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
revokes a listener for the given client
static TClientId registerClient()
registers a client of this class, means a broadcaster of AccessibleEvents
static void revokeClient(const TClientId _nClient)
revokes a broadcaster of AccessibleEvents
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 ...
OAccessibleComponentHelper()
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
OAccessibleExtendedComponentHelper()
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual OUString SAL_CALL getAccessibleId() override
void lateInit(const css::uno::Reference< css::accessibility::XAccessible > &_rxAccessible)
late construction
virtual css::awt::Rectangle implGetBounds()=0
implements the calculation of the bounding rectangle - still waiting to be overwritten
virtual ~OCommonAccessibleComponent() override
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
default implementation for retrieving the index of this object within the parent
css::uno::WeakReference< css::accessibility::XAccessible > m_aCreator
css::awt::Point getLocationOnScreen()
virtual void SAL_CALL disposing() override
css::uno::Reference< css::accessibility::XAccessibleContext > implGetParentContext()
shortcut for retrieving the context of the parent (returned by getAccessibleParent)
void NotifyAccessibleEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue, sal_Int32 nIndexHint=-1)
notifies all AccessibleEventListeners of a certain event
css::awt::Point getLocation()
bool containsPoint(const css::awt::Point &aPoint)
non-virtual versions of the methods which can be implemented using <method>implGetBounds</method> not...
virtual css::lang::Locale SAL_CALL getLocale() override
default implementation for retrieving the locale
AccessibleEventNotifier::TClientId m_nClientId
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override=0
void ensureAlive() const
checks for being alive. If the object is already disposed (i.e. not alive), an exception is thrown.
bool isAlive() const
checks whether the object is alive (returns <TRUE> then) or disposed
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
css::awt::Rectangle getBounds()
void ensureDisposed()
ensures that the object is disposed.
OCommonAccessibleComponent()
css::uno::Reference< css::accessibility::XAccessible > getAccessibleCreator() const
retrieves the creator previously set with <method>lateInit</method>
static SolarMutex * get()
Help components to get the SolarMutex easily.
::cppu::WeakComponentImplHelper< css::accessibility::XAccessibleContext2, css::accessibility::XAccessibleEventBroadcaster > OCommonAccessibleComponent_Base