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:
[legend]
Collaboration diagram for comphelper::OAccessibleContextHelper:
[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_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 css::uno::Reference< css::accessibility::XAccessibleStateSet > 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, class >
 WeakAggComponentImplHelper2 (::osl::Mutex &rMutex)
 
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_OVERRIDE
 
virtual void SAL_CALL release () 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

std::unique_ptr< OContextHelper_Implm_pImpl
 

Friends

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 46 of file accessiblecontexthelper.hxx.

Constructor & Destructor Documentation

comphelper::OAccessibleContextHelper::~OAccessibleContextHelper ( )
overrideprotectedvirtual

Definition at line 72 of file accessiblecontexthelper.cxx.

References ensureDisposed().

comphelper::OAccessibleContextHelper::OAccessibleContextHelper ( )
protected

Definition at line 65 of file accessiblecontexthelper.cxx.

Member Function Documentation

void SAL_CALL comphelper::OAccessibleContextHelper::addAccessibleEventListener ( const css::uno::Reference< css::accessibility::XAccessibleEventListener > &  xListener)
overridevirtual
void SAL_CALL comphelper::OAccessibleContextHelper::disposing ( )
overrideprotectedvirtual
void comphelper::OAccessibleContextHelper::ensureAlive ( ) const
protected

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

Definition at line 169 of file accessiblecontexthelper.cxx.

References isAlive().

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

void comphelper::OAccessibleContextHelper::ensureDisposed ( )
protected

ensures that the object is disposed.

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

Definition at line 176 of file accessiblecontexthelper.cxx.

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

Referenced by ~OAccessibleContextHelper().

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

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

Definition at line 193 of file accessiblecontexthelper.cxx.

References m_pImpl.

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

Definition at line 199 of file accessiblecontexthelper.cxx.

sal_Int32 SAL_CALL comphelper::OAccessibleContextHelper::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 205 of file accessiblecontexthelper.cxx.

References Exception, implGetParentContext(), and m_pImpl.

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

Referenced by getLocale(), and implGetParentContext().

virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL comphelper::OAccessibleContextHelper::getAccessibleRelationSet ( )
overridepure virtual
virtual sal_Int16 SAL_CALL comphelper::OAccessibleContextHelper::getAccessibleRole ( )
overridepure virtual
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL comphelper::OAccessibleContextHelper::getAccessibleStateSet ( )
overridepure virtual
Locale SAL_CALL comphelper::OAccessibleContextHelper::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 251 of file accessiblecontexthelper.cxx.

References getAccessibleParent(), and Locale.

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

Definition at line 149 of file accessiblecontexthelper.hxx.

References m_aMutex.

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

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

Definition at line 266 of file accessiblecontexthelper.cxx.

References getAccessibleParent().

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

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

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

Definition at line 163 of file accessiblecontexthelper.cxx.

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

void comphelper::OAccessibleContextHelper::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 187 of file accessiblecontexthelper.cxx.

References m_pImpl.

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

notifies all AccessibleEventListeners of a certain event

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

References comphelper::AccessibleEventNotifier::addEvent(), and m_pImpl.

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

Friends And Related Function Documentation

friend class OContextEntryGuard
friend

Definition at line 50 of file accessiblecontexthelper.hxx.

Member Data Documentation

std::unique_ptr<OContextHelper_Impl> comphelper::OAccessibleContextHelper::m_pImpl
private

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