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

helper class for implementing an AccessibleContext More...

#include <accessiblecontexthelper.hxx>

Inheritance diagram for comphelper::OAccessibleContextHelper:
Collaboration diagram for comphelper::OAccessibleContextHelper:

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_Int32 SAL_CALL getAccessibleChildCount () override=0
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild (sal_Int32 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_Int32 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...
- Public Member Functions inherited from cppu::WeakAggComponentImplHelper2< class Ifc1, class Ifc2 >
 WeakAggComponentImplHelper2 (::osl::Mutex &rMutex) SAL_NOEXCEPT
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryAggregation (css::uno::Type const &rType) SAL_OVERRIDE
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE

Protected Member Functions

virtual ~OAccessibleContextHelper () override
 OAccessibleContextHelper ()
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)
 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 ()

Private Attributes

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


class OContextEntryGuard

Additional Inherited Members

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

Detailed Description

helper class for implementing an AccessibleContext

Definition at line 45 of file accessiblecontexthelper.hxx.

Constructor & Destructor Documentation

◆ ~OAccessibleContextHelper()

comphelper::OAccessibleContextHelper::~OAccessibleContextHelper ( )

Definition at line 41 of file accessiblecontexthelper.cxx.

References ensureDisposed().

◆ OAccessibleContextHelper()

comphelper::OAccessibleContextHelper::OAccessibleContextHelper ( )

Definition at line 34 of file accessiblecontexthelper.cxx.

Member Function Documentation

◆ addAccessibleEventListener()

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

◆ disposing()

void SAL_CALL comphelper::OAccessibleContextHelper::disposing ( )

◆ ensureAlive()

void comphelper::OAccessibleContextHelper::ensureAlive ( ) const

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

Definition at line 138 of file accessiblecontexthelper.cxx.

References isAlive().

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

◆ ensureDisposed()

void comphelper::OAccessibleContextHelper::ensureDisposed ( )

ensures that the object is disposed.

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

Definition at line 145 of file accessiblecontexthelper.cxx.

References cppu::WeakAggComponentImplHelper2< class Ifc1, class Ifc2 >::acquire(), dispose(), and m_refCount.

Referenced by ~OAccessibleContextHelper().

◆ getAccessibleChild()

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

◆ getAccessibleChildCount()

virtual sal_Int32 SAL_CALL comphelper::OAccessibleContextHelper::getAccessibleChildCount ( )
overridepure virtual

◆ getAccessibleCreator()

Reference< XAccessible > comphelper::OAccessibleContextHelper::getAccessibleCreator ( ) const

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

Definition at line 162 of file accessiblecontexthelper.cxx.

References m_aCreator.

◆ getAccessibleDescription()

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

◆ getAccessibleId()

OUString SAL_CALL comphelper::OAccessibleContextHelper::getAccessibleId ( )

Definition at line 168 of file accessiblecontexthelper.cxx.

◆ getAccessibleIndexInParent()

sal_Int32 SAL_CALL comphelper::OAccessibleContextHelper::getAccessibleIndexInParent ( )

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 174 of file accessiblecontexthelper.cxx.

References Exception, implGetParentContext(), and m_aCreator.

◆ getAccessibleName()

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

◆ getAccessibleParent()

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

Referenced by getLocale(), and implGetParentContext().

◆ getAccessibleRelationSet()

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

◆ getAccessibleRole()

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

◆ getAccessibleStateSet()

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

References isAlive().

◆ getLocale()

Locale SAL_CALL comphelper::OAccessibleContextHelper::getLocale ( )

default implementation for retrieving the locale

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

Definition at line 220 of file accessiblecontexthelper.cxx.

References getAccessibleParent(), and Locale.

◆ GetMutex()

::osl::Mutex & comphelper::OAccessibleContextHelper::GetMutex ( )

Definition at line 149 of file accessiblecontexthelper.hxx.

References m_aMutex.

◆ implGetParentContext()

Reference< XAccessibleContext > comphelper::OAccessibleContextHelper::implGetParentContext ( )

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

Definition at line 235 of file accessiblecontexthelper.cxx.

References getAccessibleParent().

Referenced by getAccessibleIndexInParent(), and comphelper::OCommonAccessibleComponent::getLocationOnScreen().

◆ isAlive()

bool comphelper::OAccessibleContextHelper::isAlive ( ) const

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

Definition at line 132 of file accessiblecontexthelper.cxx.

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

◆ lateInit()

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

late construction

_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 156 of file accessiblecontexthelper.cxx.

References m_aCreator.

◆ NotifyAccessibleEvent()

void comphelper::OAccessibleContextHelper::NotifyAccessibleEvent ( const sal_Int16  _nEventId,
const css::uno::Any &  _rOldValue,
const css::uno::Any &  _rNewValue 

notifies all AccessibleEventListeners of a certain event

@precond not to be called with our mutex locked

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

Definition at line 112 of file accessiblecontexthelper.cxx.

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

◆ removeAccessibleEventListener()

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

Friends And Related Function Documentation

◆ OContextEntryGuard

friend class OContextEntryGuard

Definition at line 49 of file accessiblecontexthelper.hxx.

Member Data Documentation

◆ m_aCreator

css::uno::WeakReference< css::accessibility::XAccessible > comphelper::OAccessibleContextHelper::m_aCreator

◆ m_nClientId

AccessibleEventNotifier::TClientId comphelper::OAccessibleContextHelper::m_nClientId

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