LibreOffice Module editeng (master) 1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
accessibility::AccessibleContextBase Class Reference

@descr This base class provides an implementation of the AccessibleContext service. More...

#include <AccessibleContextBase.hxx>

Inheritance diagram for accessibility::AccessibleContextBase:
[legend]
Collaboration diagram for accessibility::AccessibleContextBase:
[legend]

Public Types

enum  StringOrigin {
  ManuallySet ,
  FromShape ,
  AutomaticallyCreated ,
  NotSet
}
 The origin of the accessible name or description. More...
 

Public Member Functions

 AccessibleContextBase (css::uno::Reference< css::accessibility::XAccessible > xParent, const sal_Int16 aRole)
 
virtual ~AccessibleContextBase () override
 
void CommitChange (sal_Int16 aEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue, sal_Int32 nValueIndex)
 Call all accessibility event listeners to inform them about the specified event. More...
 
void SetAccessibleDescription (const OUString &rsDescription, StringOrigin eDescriptionOrigin)
 Set a new description and, provided that the new name differs from the old one, broadcast an accessibility event. More...
 
void SetAccessibleName (const OUString &rsName, StringOrigin eNameOrigin)
 Set a new description and, provided that the new name differs from the old one, broadcast an accessibility event. More...
 
virtual bool SetState (sal_Int64 aState)
 Set the specified state (turn it on) and send events to all listeners to inform them of the change. More...
 
virtual bool ResetState (sal_Int64 aState)
 Reset the specified state (turn it off) and send events to all listeners to inform them of the change. More...
 
bool GetState (sal_Int64 aState)
 Return the state of the specified state. More...
 
void SetRelationSet (const css::uno::Reference< css::accessibility::XAccessibleRelationSet > &rxRelationSet)
 Replace the current relation set with the specified one. More...
 
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext () override
 Return the XAccessibleContext. More...
 
virtual sal_Int64 SAL_CALL getAccessibleChildCount () override
 Return the number of currently visible children. More...
 
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild (sal_Int64 nIndex) override
 Return the specified child or throw exception. More...
 
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent () override
 Return a reference to the parent. More...
 
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent () override
 Return this objects index among the parents children. More...
 
virtual sal_Int16 SAL_CALL getAccessibleRole () override
 Return this object's role. More...
 
virtual OUString SAL_CALL getAccessibleDescription () override
 Return this object's description. More...
 
virtual OUString SAL_CALL getAccessibleName () override
 Return the object's current name. More...
 
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet () override
 Return NULL to indicate that an empty relation set. More...
 
virtual sal_Int64 SAL_CALL getAccessibleStateSet () override
 Return the set of current states. More...
 
virtual css::lang::Locale SAL_CALL getLocale () override
 Return the parents locale or throw exception if this object has no parent yet/anymore. More...
 
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 OUString SAL_CALL getImplementationName () override
 Returns an identifier for the implementation of this object. More...
 
virtual sal_Bool SAL_CALL supportsService (const OUString &sServiceName) override
 Return whether the specified service is supported by this class. More...
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 Returns a list of all supported services. More...
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 Returns an implementation id. More...
 
bool IsDisposed () const
 Check whether or not the object has been disposed (or is in the state of being disposed). More...
 

Protected Member Functions

virtual void SAL_CALL disposing () override
 
virtual OUString CreateAccessibleName ()
 Create the accessible object's name. More...
 
void FireEvent (const css::accessibility::AccessibleEventObject &aEvent)
 
void ThrowIfDisposed ()
 Check whether or not the object has been disposed (or is in the state of being disposed). More...
 
void SetAccessibleRole (sal_Int16 _nRole)
 sets the role as returned by XaccessibleContext::getAccessibleRole More...
 

Protected Attributes

sal_Int64 mnStateSet
 The state set. More...
 
css::uno::Reference< css::accessibility::XAccessibleRelationSet > mxRelationSet
 The relation set. More...
 
- Protected Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Private Attributes

css::uno::Reference< css::accessibility::XAccessible > mxParent
 Reference to the parent object. More...
 
OUString msDescription
 Description of this object. More...
 
StringOrigin meDescriptionOrigin
 The origin of the description is used to determine whether new descriptions given to the SetAccessibleDescription is ignored or whether that replaces the old value in msDescription. More...
 
OUString msName
 Name of this object. More...
 
StringOrigin meNameOrigin
 The origin of the name is used to determine whether new name given to the SetAccessibleName is ignored or whether that replaces the old value in msName. More...
 
sal_uInt32 mnClientId
 client id in the AccessibleEventNotifier queue More...
 
sal_Int16 maRole
 This is the role of this object. More...
 

Detailed Description

@descr This base class provides an implementation of the AccessibleContext service.

Apart from the <type>XXAccessible<type> and XAccessibleContextContext interfaces it supports the XServiceInfo interface.

Definition at line 44 of file AccessibleContextBase.hxx.

Member Enumeration Documentation

◆ StringOrigin

The origin of the accessible name or description.

Enumerator
ManuallySet 
FromShape 
AutomaticallyCreated 
NotSet 

Definition at line 59 of file AccessibleContextBase.hxx.

Constructor & Destructor Documentation

◆ AccessibleContextBase()

accessibility::AccessibleContextBase::AccessibleContextBase ( css::uno::Reference< css::accessibility::XAccessible >  xParent,
const sal_Int16  aRole 
)

Definition at line 44 of file AccessibleContextBase.cxx.

References m_aMutex, mnStateSet, mxParent, mxRelationSet, and NotSet.

◆ ~AccessibleContextBase()

accessibility::AccessibleContextBase::~AccessibleContextBase ( )
overridevirtual

Definition at line 70 of file AccessibleContextBase.cxx.

Member Function Documentation

◆ addAccessibleEventListener()

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

◆ CommitChange()

void accessibility::AccessibleContextBase::CommitChange ( sal_Int16  aEventId,
const css::uno::Any &  rNewValue,
const css::uno::Any &  rOldValue,
sal_Int32  nValueIndex 
)

Call all accessibility event listeners to inform them about the specified event.

Parameters
aEventIdId of the event type.
rNewValueNew value of the modified attribute. Pass empty structure if not applicable.
rOldValueOld value of the modified attribute. Pass empty structure if not applicable.

Definition at line 462 of file AccessibleContextBase.cxx.

References aEvent, FireEvent(), and mnClientId.

Referenced by ResetState(), SetAccessibleDescription(), SetAccessibleName(), SetRelationSet(), and SetState().

◆ CreateAccessibleName()

OUString accessibility::AccessibleContextBase::CreateAccessibleName ( )
protectedvirtual

Create the accessible object's name.

This method may be called more than once for a single object.

Returns
The returned string is a unique (among the accessible object's siblings) name.
Exceptions
css::uno::RuntimeException

Definition at line 456 of file AccessibleContextBase.cxx.

Referenced by getAccessibleName().

◆ disposing()

void SAL_CALL accessibility::AccessibleContextBase::disposing ( )
overrideprotectedvirtual

◆ FireEvent()

void accessibility::AccessibleContextBase::FireEvent ( const css::accessibility::AccessibleEventObject &  aEvent)
protected

◆ getAccessibleChild()

uno::Reference< XAccessible > SAL_CALL accessibility::AccessibleContextBase::getAccessibleChild ( sal_Int64  nIndex)
overridevirtual

Return the specified child or throw exception.

Forward the request to the shape.

Return the requested shape or throw an exception for a wrong index.

Definition at line 177 of file AccessibleContextBase.cxx.

References nIndex, and ThrowIfDisposed().

◆ getAccessibleChildCount()

sal_Int64 SAL_CALL accessibility::AccessibleContextBase::getAccessibleChildCount ( )
overridevirtual

Return the number of currently visible children.

No children.

Definition at line 167 of file AccessibleContextBase.cxx.

◆ getAccessibleContext()

uno::Reference< XAccessibleContext > SAL_CALL accessibility::AccessibleContextBase::getAccessibleContext ( )
overridevirtual

Return the XAccessibleContext.

Definition at line 156 of file AccessibleContextBase.cxx.

◆ getAccessibleDescription()

OUString SAL_CALL accessibility::AccessibleContextBase::getAccessibleDescription ( )
overridevirtual

Return this object's description.

Definition at line 238 of file AccessibleContextBase.cxx.

References msDescription, and ThrowIfDisposed().

◆ getAccessibleIndexInParent()

sal_Int64 SAL_CALL accessibility::AccessibleContextBase::getAccessibleIndexInParent ( )
overridevirtual

Return this objects index among the parents children.

Definition at line 195 of file AccessibleContextBase.cxx.

References i, mxParent, and ThrowIfDisposed().

◆ getAccessibleName()

OUString SAL_CALL accessibility::AccessibleContextBase::getAccessibleName ( )
overridevirtual

Return the object's current name.

Definition at line 247 of file AccessibleContextBase.cxx.

References AutomaticallyCreated, CreateAccessibleName(), meNameOrigin, msName, NotSet, and ThrowIfDisposed().

◆ getAccessibleParent()

uno::Reference< XAccessible > SAL_CALL accessibility::AccessibleContextBase::getAccessibleParent ( )
overridevirtual

Return a reference to the parent.

Definition at line 187 of file AccessibleContextBase.cxx.

References mxParent, and ThrowIfDisposed().

◆ getAccessibleRelationSet()

uno::Reference< XAccessibleRelationSet > SAL_CALL accessibility::AccessibleContextBase::getAccessibleRelationSet ( )
overridevirtual

Return NULL to indicate that an empty relation set.

Return a copy of the relation set.

Definition at line 266 of file AccessibleContextBase.cxx.

References mxRelationSet, and ThrowIfDisposed().

◆ getAccessibleRole()

sal_Int16 SAL_CALL accessibility::AccessibleContextBase::getAccessibleRole ( )
overridevirtual

Return this object's role.

Definition at line 230 of file AccessibleContextBase.cxx.

References maRole, and ThrowIfDisposed().

◆ getAccessibleStateSet()

sal_Int64 SAL_CALL accessibility::AccessibleContextBase::getAccessibleStateSet ( )
overridevirtual

Return the set of current states.

Return a copy of the state set.

Possible states are: ENABLED SHOWING VISIBLE

Definition at line 290 of file AccessibleContextBase.cxx.

References mnStateSet.

◆ getImplementationId()

uno::Sequence< sal_Int8 > SAL_CALL accessibility::AccessibleContextBase::getImplementationId ( )
overridevirtual

Returns an implementation id.

Definition at line 388 of file AccessibleContextBase.cxx.

◆ getImplementationName()

OUString SAL_CALL accessibility::AccessibleContextBase::getImplementationName ( )
overridevirtual

Returns an identifier for the implementation of this object.

Definition at line 366 of file AccessibleContextBase.cxx.

◆ getLocale()

lang::Locale SAL_CALL accessibility::AccessibleContextBase::getLocale ( )
overridevirtual

Return the parents locale or throw exception if this object has no parent yet/anymore.

Definition at line 306 of file AccessibleContextBase.cxx.

References mxParent, and ThrowIfDisposed().

◆ GetState()

bool accessibility::AccessibleContextBase::GetState ( sal_Int64  aState)

Return the state of the specified state.

Parameters
aStateThe state for which to return its value.
Returns
A value of <TRUE> indicates that the state is set. A <FALSE> value indicates an unset state.

Definition at line 123 of file AccessibleContextBase.cxx.

References cppu::BaseMutex::m_aMutex, and mnStateSet.

◆ getSupportedServiceNames()

uno::Sequence< OUString > SAL_CALL accessibility::AccessibleContextBase::getSupportedServiceNames ( )
overridevirtual

Returns a list of all supported services.

In this case that is just the AccessibleContext service.

Definition at line 377 of file AccessibleContextBase.cxx.

◆ IsDisposed()

bool accessibility::AccessibleContextBase::IsDisposed ( ) const

Check whether or not the object has been disposed (or is in the state of being disposed).

Returns
TRUE, if the object is disposed or in the course of being disposed. Otherwise, FALSE is returned.

Definition at line 502 of file AccessibleContextBase.cxx.

◆ removeAccessibleEventListener()

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

◆ ResetState()

bool accessibility::AccessibleContextBase::ResetState ( sal_Int64  aState)
virtual

Reset the specified state (turn it off) and send events to all listeners to inform them of the change.

Parameters
aStateThe state to turn off.
Returns
If the specified state changed its value due to this call <TRUE> is returned, otherwise <FALSE>.

Definition at line 101 of file AccessibleContextBase.cxx.

References CommitChange(), cppu::BaseMutex::m_aMutex, and mnStateSet.

◆ SetAccessibleDescription()

void accessibility::AccessibleContextBase::SetAccessibleDescription ( const OUString &  rsDescription,
StringOrigin  eDescriptionOrigin 
)

Set a new description and, provided that the new name differs from the old one, broadcast an accessibility event.

Parameters
rsDescriptionThe new description.
eDescriptionOriginThe origin of the description. This is used to determine whether the given description overrules the existing one. An origin with a lower numerical value overrides one with a higher value.
Exceptions
css::uno::RuntimeException

Definition at line 412 of file AccessibleContextBase.cxx.

References CommitChange(), meDescriptionOrigin, and msDescription.

◆ SetAccessibleName()

void accessibility::AccessibleContextBase::SetAccessibleName ( const OUString &  rsName,
StringOrigin  eNameOrigin 
)

Set a new description and, provided that the new name differs from the old one, broadcast an accessibility event.

Parameters
rsNameThe new name.
eNameOriginThe origin of the name. This is used to determine whether the given name overrules the existing one. An origin with a lower numerical value overrides one with a higher value.
Exceptions
css::uno::RuntimeException

Definition at line 434 of file AccessibleContextBase.cxx.

References CommitChange(), meNameOrigin, and msName.

◆ SetAccessibleRole()

void accessibility::AccessibleContextBase::SetAccessibleRole ( sal_Int16  _nRole)
protected

sets the role as returned by XaccessibleContext::getAccessibleRole

Caution: This is only to be used in the construction phase (means within the ctor or late ctor), never when the object is still alive and part of an Accessibility hierarchy.

Definition at line 508 of file AccessibleContextBase.cxx.

References maRole.

◆ SetRelationSet()

void accessibility::AccessibleContextBase::SetRelationSet ( const css::uno::Reference< css::accessibility::XAccessibleRelationSet > &  rxRelationSet)

Replace the current relation set with the specified one.

Send events for relations that are not in both sets.

Parameters
rRelationSetThe new relation set that replaces the old one.
Exceptions
css::uno::RuntimeException

Definition at line 130 of file AccessibleContextBase.cxx.

References CommitChange(), i, and mxRelationSet.

◆ SetState()

bool accessibility::AccessibleContextBase::SetState ( sal_Int64  aState)
virtual

Set the specified state (turn it on) and send events to all listeners to inform them of the change.

Parameters
aStateThe state to turn on.
Returns
If the specified state changed its value due to this call <TRUE> is returned, otherwise <FALSE>.

Definition at line 74 of file AccessibleContextBase.cxx.

References CommitChange(), cppu::BaseMutex::m_aMutex, and mnStateSet.

Referenced by disposing().

◆ supportsService()

sal_Bool SAL_CALL accessibility::AccessibleContextBase::supportsService ( const OUString &  sServiceName)
overridevirtual

Return whether the specified service is supported by this class.

Definition at line 371 of file AccessibleContextBase.cxx.

References sServiceName, and cppu::supportsService().

◆ ThrowIfDisposed()

void accessibility::AccessibleContextBase::ThrowIfDisposed ( )
protected

Check whether or not the object has been disposed (or is in the state of being disposed).

If that is the case then DisposedException is thrown to inform the (indirect) caller of the foul deed.

Exceptions
css::lang::DisposedException

Definition at line 492 of file AccessibleContextBase.cxx.

Referenced by getAccessibleChild(), getAccessibleDescription(), getAccessibleIndexInParent(), getAccessibleName(), getAccessibleParent(), getAccessibleRelationSet(), getAccessibleRole(), getLocale(), and removeAccessibleEventListener().

Member Data Documentation

◆ maRole

sal_Int16 accessibility::AccessibleContextBase::maRole
private

This is the role of this object.

Definition at line 332 of file AccessibleContextBase.hxx.

Referenced by getAccessibleRole(), and SetAccessibleRole().

◆ meDescriptionOrigin

StringOrigin accessibility::AccessibleContextBase::meDescriptionOrigin
private

The origin of the description is used to determine whether new descriptions given to the SetAccessibleDescription is ignored or whether that replaces the old value in msDescription.

Definition at line 313 of file AccessibleContextBase.hxx.

Referenced by SetAccessibleDescription().

◆ meNameOrigin

StringOrigin accessibility::AccessibleContextBase::meNameOrigin
private

The origin of the name is used to determine whether new name given to the SetAccessibleName is ignored or whether that replaces the old value in msName.

Definition at line 324 of file AccessibleContextBase.hxx.

Referenced by getAccessibleName(), and SetAccessibleName().

◆ mnClientId

sal_uInt32 accessibility::AccessibleContextBase::mnClientId
private

client id in the AccessibleEventNotifier queue

Definition at line 328 of file AccessibleContextBase.hxx.

Referenced by addAccessibleEventListener(), CommitChange(), disposing(), FireEvent(), and removeAccessibleEventListener().

◆ mnStateSet

sal_Int64 accessibility::AccessibleContextBase::mnStateSet
protected

The state set.

Definition at line 262 of file AccessibleContextBase.hxx.

Referenced by AccessibleContextBase(), getAccessibleStateSet(), GetState(), ResetState(), and SetState().

◆ msDescription

OUString accessibility::AccessibleContextBase::msDescription
private

Description of this object.

This is not a constant because it can be set from the outside. Furthermore, it changes according to the draw page's display mode.

Definition at line 307 of file AccessibleContextBase.hxx.

Referenced by getAccessibleDescription(), and SetAccessibleDescription().

◆ msName

OUString accessibility::AccessibleContextBase::msName
private

Name of this object.

It changes according the draw page's display mode.

Definition at line 318 of file AccessibleContextBase.hxx.

Referenced by getAccessibleName(), and SetAccessibleName().

◆ mxParent

css::uno::Reference< css::accessibility::XAccessible> accessibility::AccessibleContextBase::mxParent
private

Reference to the parent object.

Definition at line 301 of file AccessibleContextBase.hxx.

Referenced by disposing(), getAccessibleIndexInParent(), getAccessibleParent(), and getLocale().

◆ mxRelationSet

css::uno::Reference< css::accessibility::XAccessibleRelationSet> accessibility::AccessibleContextBase::mxRelationSet
protected

The relation set.

Relations can be set or removed by calling the <member>AddRelation</member> and <member>RemoveRelation</member> methods.

Definition at line 267 of file AccessibleContextBase.hxx.

Referenced by AccessibleContextBase(), disposing(), getAccessibleRelationSet(), and SetRelationSet().


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