LibreOffice Module comphelper (master) 1
|
helper class for implementing an AccessibleContext More...
#include <accessiblecontexthelper.hxx>
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... | |
![]() | |
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 |
Friends | |
class | OContextEntryGuard |
Additional Inherited Members | |
![]() | |
mutable::osl::Mutex | m_aMutex |
helper class for implementing an AccessibleContext
Definition at line 45 of file accessiblecontexthelper.hxx.
|
overrideprotectedvirtual |
Definition at line 41 of file accessiblecontexthelper.cxx.
References ensureDisposed().
|
protected |
Definition at line 34 of file accessiblecontexthelper.cxx.
|
overridevirtual |
Definition at line 64 of file accessiblecontexthelper.cxx.
References comphelper::AccessibleEventNotifier::addEventListener(), comphelper::SolarMutex::get(), isAlive(), m_nClientId, and comphelper::AccessibleEventNotifier::registerClient().
|
overrideprotectedvirtual |
Definition at line 50 of file accessiblecontexthelper.cxx.
References comphelper::SolarMutex::get(), m_nClientId, and comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing().
|
protected |
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().
|
protected |
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().
|
overridepure virtual |
|
overridepure virtual |
|
protected |
retrieves the creator previously set with <method>lateInit</method>
Definition at line 162 of file accessiblecontexthelper.cxx.
References m_aCreator.
|
overridepure virtual |
|
overridevirtual |
Definition at line 168 of file accessiblecontexthelper.cxx.
|
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 174 of file accessiblecontexthelper.cxx.
References Exception, implGetParentContext(), and m_aCreator.
|
overridepure virtual |
|
overridepure virtual |
Referenced by getLocale(), and implGetParentContext().
|
overridepure virtual |
|
overridepure virtual |
|
overridepure virtual |
References isAlive().
|
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 220 of file accessiblecontexthelper.cxx.
References getAccessibleParent(), and Locale.
|
inlineprotected |
Definition at line 149 of file accessiblecontexthelper.hxx.
References m_aMutex.
|
protected |
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().
|
protected |
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().
|
protected |
late construction
_rxAccessible | the 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.
|
protected |
notifies all AccessibleEventListeners of a certain event
@precond not to be called with our mutex locked
_nEventId | the id of the event. See AccessibleEventType |
_rOldValue | the old value to be notified |
_rNewValue | the new value to be notified |
Definition at line 112 of file accessiblecontexthelper.cxx.
References comphelper::AccessibleEventNotifier::addEvent(), aEvent, and m_nClientId.
|
overridevirtual |
Definition at line 87 of file accessiblecontexthelper.cxx.
References comphelper::SolarMutex::get(), isAlive(), m_nClientId, comphelper::AccessibleEventNotifier::removeEventListener(), and comphelper::AccessibleEventNotifier::revokeClient().
|
friend |
Definition at line 49 of file accessiblecontexthelper.hxx.
|
private |
Definition at line 51 of file accessiblecontexthelper.hxx.
Referenced by getAccessibleCreator(), getAccessibleIndexInParent(), and lateInit().
|
private |
Definition at line 52 of file accessiblecontexthelper.hxx.
Referenced by addAccessibleEventListener(), disposing(), NotifyAccessibleEvent(), and removeAccessibleEventListener().