LibreOffice Module comphelper (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
comphelper::OCommonAccessibleComponent Class Referenceabstract

base class encapsulating common functionality for the helper classes implementing the XAccessibleComponent respectively XAccessibleExtendendComponent More...

#include <accessiblecomponenthelper.hxx>

Inheritance diagram for comphelper::OCommonAccessibleComponent:
[legend]
Collaboration diagram for comphelper::OCommonAccessibleComponent:
[legend]

Public Member Functions

virtual void SAL_CALL addAccessibleEventListener (const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
 
virtual void SAL_CALL removeAccessibleEventListener (const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
 
virtual sal_Int64 SAL_CALL getAccessibleChildCount () override=0
 
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild (sal_Int64 i) override=0
 
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent () override=0
 
virtual sal_Int16 SAL_CALL getAccessibleRole () override=0
 
virtual OUString SAL_CALL getAccessibleDescription () override=0
 
virtual OUString SAL_CALL getAccessibleName () override=0
 
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet () override=0
 
virtual sal_Int64 SAL_CALL getAccessibleStateSet () override=0
 
virtual OUString SAL_CALL getAccessibleId () override
 
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent () override
 default implementation for retrieving the index of this object within the parent More...
 
virtual css::lang::Locale SAL_CALL getLocale () override
 default implementation for retrieving the locale More...
 

Protected Member Functions

virtual ~OCommonAccessibleComponent () override
 
 OCommonAccessibleComponent ()
 
void lateInit (const css::uno::Reference< css::accessibility::XAccessible > &_rxAccessible)
 late construction More...
 
css::uno::Reference< css::accessibility::XAccessible > getAccessibleCreator () const
 retrieves the creator previously set with <method>lateInit</method> More...
 
virtual void SAL_CALL disposing () override
 
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 More...
 
bool isAlive () const
 checks whether the object is alive (returns <TRUE> then) or disposed More...
 
void ensureAlive () const
 checks for being alive. If the object is already disposed (i.e. not alive), an exception is thrown. More...
 
void ensureDisposed ()
 ensures that the object is disposed. More...
 
css::uno::Reference< css::accessibility::XAccessibleContext > implGetParentContext ()
 shortcut for retrieving the context of the parent (returned by getAccessibleParent) More...
 
::osl::Mutex & GetMutex ()
 
virtual css::awt::Rectangle implGetBounds ()=0
 implements the calculation of the bounding rectangle - still waiting to be overwritten More...
 
bool containsPoint (const css::awt::Point &aPoint)
 non-virtual versions of the methods which can be implemented using <method>implGetBounds</method> note: getLocationOnScreen relies on a valid parent (XAccessibleContext::getParent()->getAccessibleContext()), which itself implements XAccessibleComponent More...
 
css::awt::Point getLocation ()
 
css::awt::Point getLocationOnScreen ()
 
css::awt::Size getSize ()
 
css::awt::Rectangle getBounds ()
 

Private Attributes

css::uno::WeakReference< css::accessibility::XAccessible > m_aCreator
 
AccessibleEventNotifier::TClientId m_nClientId
 

Friends

class OContextEntryGuard
 

Additional Inherited Members

- Protected Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

base class encapsulating common functionality for the helper classes implementing the XAccessibleComponent respectively XAccessibleExtendendComponent

Definition at line 48 of file accessiblecomponenthelper.hxx.

Constructor & Destructor Documentation

◆ ~OCommonAccessibleComponent()

comphelper::OCommonAccessibleComponent::~OCommonAccessibleComponent ( )
overrideprotectedvirtual

Definition at line 44 of file accessiblecomponenthelper.cxx.

References ensureDisposed().

◆ OCommonAccessibleComponent()

comphelper::OCommonAccessibleComponent::OCommonAccessibleComponent ( )
protected

Definition at line 37 of file accessiblecomponenthelper.cxx.

Member Function Documentation

◆ addAccessibleEventListener()

void SAL_CALL comphelper::OCommonAccessibleComponent::addAccessibleEventListener ( const css::uno::Reference< css::accessibility::XAccessibleEventListener > &  xListener)
overridevirtual

◆ containsPoint()

bool comphelper::OCommonAccessibleComponent::containsPoint ( const css::awt::Point &  aPoint)
protected

non-virtual versions of the methods which can be implemented using <method>implGetBounds</method> note: getLocationOnScreen relies on a valid parent (XAccessibleContext::getParent()->getAccessibleContext()), which itself implements XAccessibleComponent

Exceptions
css::uno::RuntimeException

Definition at line 244 of file accessiblecomponenthelper.cxx.

References implGetBounds().

Referenced by comphelper::OAccessibleComponentHelper::containsPoint(), and comphelper::OAccessibleExtendedComponentHelper::containsPoint().

◆ disposing()

void SAL_CALL comphelper::OCommonAccessibleComponent::disposing ( )
overrideprotectedvirtual

◆ ensureAlive()

void comphelper::OCommonAccessibleComponent::ensureAlive ( ) const
protected

checks for being alive. If the object is already disposed (i.e. not alive), an exception is thrown.

Definition at line 137 of file accessiblecomponenthelper.cxx.

References isAlive().

Referenced by comphelper::OContextEntryGuard::OContextEntryGuard().

◆ ensureDisposed()

void comphelper::OCommonAccessibleComponent::ensureDisposed ( )
protected

ensures that the object is disposed.

@precond to be called from within the destructor of your derived class only!

Definition at line 144 of file accessiblecomponenthelper.cxx.

References dispose(), and m_refCount.

Referenced by ~OCommonAccessibleComponent().

◆ getAccessibleChild()

virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleChild ( sal_Int64  i)
overridepure virtual

◆ getAccessibleChildCount()

virtual sal_Int64 SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleChildCount ( )
overridepure virtual

◆ getAccessibleCreator()

Reference< XAccessible > comphelper::OCommonAccessibleComponent::getAccessibleCreator ( ) const
protected

retrieves the creator previously set with <method>lateInit</method>

Definition at line 161 of file accessiblecomponenthelper.cxx.

References m_aCreator.

◆ getAccessibleDescription()

virtual OUString SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleDescription ( )
overridepure virtual

◆ getAccessibleId()

OUString SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleId ( )
overridevirtual

Definition at line 167 of file accessiblecomponenthelper.cxx.

◆ getAccessibleIndexInParent()

sal_Int64 SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleIndexInParent ( )
overridevirtual

default implementation for retrieving the index of this object within the parent

This basic implementation here returns the index i of the child for which <parent>.getAccessibleChild( i ) equals our creator.

Definition at line 173 of file accessiblecomponenthelper.cxx.

References Exception, implGetParentContext(), and m_aCreator.

◆ getAccessibleName()

virtual OUString SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleName ( )
overridepure virtual

◆ getAccessibleParent()

virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleParent ( )
overridepure virtual

Referenced by getLocale(), and implGetParentContext().

◆ getAccessibleRelationSet()

virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleRelationSet ( )
overridepure virtual

◆ getAccessibleRole()

virtual sal_Int16 SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleRole ( )
overridepure virtual

◆ getAccessibleStateSet()

virtual sal_Int64 SAL_CALL comphelper::OCommonAccessibleComponent::getAccessibleStateSet ( )
overridepure virtual

References isAlive().

◆ getBounds()

awt::Rectangle comphelper::OCommonAccessibleComponent::getBounds ( )
protected

◆ getLocale()

Locale SAL_CALL comphelper::OCommonAccessibleComponent::getLocale ( )
overridevirtual

default implementation for retrieving the locale

This basic implementation returns the locale of the parent context, as retrieved via getAccessibleParent()->getAccessibleContext.

Definition at line 219 of file accessiblecomponenthelper.cxx.

References getAccessibleParent(), and Locale.

◆ getLocation()

awt::Point comphelper::OCommonAccessibleComponent::getLocation ( )
protected

◆ getLocationOnScreen()

awt::Point comphelper::OCommonAccessibleComponent::getLocationOnScreen ( )
protected

◆ GetMutex()

::osl::Mutex & comphelper::OCommonAccessibleComponent::GetMutex ( )
inlineprotected

Definition at line 153 of file accessiblecomponenthelper.hxx.

References m_aMutex.

◆ getSize()

awt::Size comphelper::OCommonAccessibleComponent::getSize ( )
protected
Exceptions
css::uno::RuntimeException

Definition at line 283 of file accessiblecomponenthelper.cxx.

References implGetBounds().

Referenced by comphelper::OAccessibleComponentHelper::getSize(), and comphelper::OAccessibleExtendedComponentHelper::getSize().

◆ implGetBounds()

virtual css::awt::Rectangle comphelper::OCommonAccessibleComponent::implGetBounds ( )
protectedpure virtual

implements the calculation of the bounding rectangle - still waiting to be overwritten

Exceptions
css::uno::RuntimeException

Referenced by containsPoint(), getBounds(), getLocation(), and getSize().

◆ implGetParentContext()

Reference< XAccessibleContext > comphelper::OCommonAccessibleComponent::implGetParentContext ( )
protected

shortcut for retrieving the context of the parent (returned by getAccessibleParent)

Definition at line 234 of file accessiblecomponenthelper.cxx.

References getAccessibleParent().

Referenced by getAccessibleIndexInParent(), and getLocationOnScreen().

◆ isAlive()

bool comphelper::OCommonAccessibleComponent::isAlive ( ) const
protected

checks whether the object is alive (returns <TRUE> then) or disposed

Definition at line 131 of file accessiblecomponenthelper.cxx.

Referenced by addAccessibleEventListener(), ensureAlive(), and removeAccessibleEventListener().

◆ lateInit()

void comphelper::OCommonAccessibleComponent::lateInit ( const css::uno::Reference< css::accessibility::XAccessible > &  _rxAccessible)
protected

late construction

Parameters
_rxAccessiblethe Accessible object which created this context.

If your derived implementation implements the XAccessible (and does not follow the proposed separation of XAccessible from XAccessibleContext), you may pass this here.

The object is hold weak, so its life time is not affected.

The object is needed for performance reasons: for <method>getAccessibleIndexInParent</method>, all children (which are XAccessible's theirself) of our parent have to be asked. If we know our XAccessible, we can compare it with all the children, instead of asking all children for their context and comparing this context with ourself.

Definition at line 155 of file accessiblecomponenthelper.cxx.

References m_aCreator.

◆ NotifyAccessibleEvent()

void comphelper::OCommonAccessibleComponent::NotifyAccessibleEvent ( const sal_Int16  _nEventId,
const css::uno::Any &  _rOldValue,
const css::uno::Any &  _rNewValue,
sal_Int32  nIndexHint = -1 
)
protected

notifies all AccessibleEventListeners of a certain event

@precond not to be called with our mutex locked

Parameters
_nEventIdthe id of the event. See AccessibleEventType
_rOldValuethe old value to be notified
_rNewValuethe new value to be notified

Definition at line 115 of file accessiblecomponenthelper.cxx.

References comphelper::AccessibleEventNotifier::addEvent(), aEvent, and m_nClientId.

◆ removeAccessibleEventListener()

void SAL_CALL comphelper::OCommonAccessibleComponent::removeAccessibleEventListener ( const css::uno::Reference< css::accessibility::XAccessibleEventListener > &  xListener)
overridevirtual

Friends And Related Function Documentation

◆ OContextEntryGuard

friend class OContextEntryGuard
friend

Definition at line 52 of file accessiblecomponenthelper.hxx.

Member Data Documentation

◆ m_aCreator

css::uno::WeakReference< css::accessibility::XAccessible > comphelper::OCommonAccessibleComponent::m_aCreator
private

◆ m_nClientId

AccessibleEventNotifier::TClientId comphelper::OCommonAccessibleComponent::m_nClientId
private

The documentation for this class was generated from the following files: