LibreOffice Module editeng (master) 1
|
@descr This base class provides an implementation of the AccessibleContext service. More...
#include <AccessibleContextBase.hxx>
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... | |
@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.
The origin of the accessible name or description.
Enumerator | |
---|---|
ManuallySet | |
FromShape | |
AutomaticallyCreated | |
NotSet |
Definition at line 59 of file AccessibleContextBase.hxx.
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.
|
overridevirtual |
Definition at line 70 of file AccessibleContextBase.cxx.
|
overridevirtual |
Definition at line 326 of file AccessibleContextBase.cxx.
References comphelper::AccessibleEventNotifier::addEventListener(), mnClientId, comphelper::AccessibleEventNotifier::registerClient(), and x.
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.
aEventId | Id of the event type. |
rNewValue | New value of the modified attribute. Pass empty structure if not applicable. |
rOldValue | Old 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().
|
protectedvirtual |
Create the accessible object's name.
This method may be called more than once for a single object.
css::uno::RuntimeException |
Definition at line 456 of file AccessibleContextBase.cxx.
Referenced by getAccessibleName().
|
overrideprotectedvirtual |
Definition at line 395 of file AccessibleContextBase.cxx.
References cppu::BaseMutex::m_aMutex, mnClientId, mxParent, mxRelationSet, comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(), and SetState().
|
protected |
Definition at line 485 of file AccessibleContextBase.cxx.
References comphelper::AccessibleEventNotifier::addEvent(), aEvent, and mnClientId.
Referenced by CommitChange().
|
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().
|
overridevirtual |
Return the number of currently visible children.
No children.
Definition at line 167 of file AccessibleContextBase.cxx.
|
overridevirtual |
Return the XAccessibleContext.
Definition at line 156 of file AccessibleContextBase.cxx.
|
overridevirtual |
Return this object's description.
Definition at line 238 of file AccessibleContextBase.cxx.
References msDescription, and ThrowIfDisposed().
|
overridevirtual |
Return this objects index among the parents children.
Definition at line 195 of file AccessibleContextBase.cxx.
References i, mxParent, and ThrowIfDisposed().
|
overridevirtual |
Return the object's current name.
Definition at line 247 of file AccessibleContextBase.cxx.
References AutomaticallyCreated, CreateAccessibleName(), meNameOrigin, msName, NotSet, and ThrowIfDisposed().
|
overridevirtual |
Return a reference to the parent.
Definition at line 187 of file AccessibleContextBase.cxx.
References mxParent, and ThrowIfDisposed().
|
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().
|
overridevirtual |
Return this object's role.
Definition at line 230 of file AccessibleContextBase.cxx.
References maRole, and ThrowIfDisposed().
|
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.
|
overridevirtual |
Returns an implementation id.
Definition at line 388 of file AccessibleContextBase.cxx.
|
overridevirtual |
Returns an identifier for the implementation of this object.
Definition at line 366 of file AccessibleContextBase.cxx.
|
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().
bool accessibility::AccessibleContextBase::GetState | ( | sal_Int64 | aState | ) |
Return the state of the specified state.
aState | The state for which to return its value. |
Definition at line 123 of file AccessibleContextBase.cxx.
References cppu::BaseMutex::m_aMutex, and mnStateSet.
|
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.
bool accessibility::AccessibleContextBase::IsDisposed | ( | ) | const |
Check whether or not the object has been disposed (or is in the state of being disposed).
Definition at line 502 of file AccessibleContextBase.cxx.
|
overridevirtual |
Definition at line 346 of file AccessibleContextBase.cxx.
References mnClientId, comphelper::AccessibleEventNotifier::removeEventListener(), comphelper::AccessibleEventNotifier::revokeClient(), and ThrowIfDisposed().
|
virtual |
Reset the specified state (turn it off) and send events to all listeners to inform them of the change.
aState | The state to turn off. |
Definition at line 101 of file AccessibleContextBase.cxx.
References CommitChange(), cppu::BaseMutex::m_aMutex, and mnStateSet.
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.
rsDescription | The new description. |
eDescriptionOrigin | The 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. |
css::uno::RuntimeException |
Definition at line 412 of file AccessibleContextBase.cxx.
References CommitChange(), meDescriptionOrigin, and msDescription.
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.
rsName | The new name. |
eNameOrigin | The 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. |
css::uno::RuntimeException |
Definition at line 434 of file AccessibleContextBase.cxx.
References CommitChange(), meNameOrigin, and msName.
|
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.
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.
rRelationSet | The new relation set that replaces the old one. |
css::uno::RuntimeException |
Definition at line 130 of file AccessibleContextBase.cxx.
References CommitChange(), i, and mxRelationSet.
|
virtual |
Set the specified state (turn it on) and send events to all listeners to inform them of the change.
aState | The state to turn on. |
Definition at line 74 of file AccessibleContextBase.cxx.
References CommitChange(), cppu::BaseMutex::m_aMutex, and mnStateSet.
Referenced by disposing().
|
overridevirtual |
Return whether the specified service is supported by this class.
Definition at line 371 of file AccessibleContextBase.cxx.
References sServiceName, and cppu::supportsService().
|
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.
css::lang::DisposedException |
Definition at line 492 of file AccessibleContextBase.cxx.
Referenced by getAccessibleChild(), getAccessibleDescription(), getAccessibleIndexInParent(), getAccessibleName(), getAccessibleParent(), getAccessibleRelationSet(), getAccessibleRole(), getLocale(), and removeAccessibleEventListener().
|
private |
This is the role of this object.
Definition at line 332 of file AccessibleContextBase.hxx.
Referenced by getAccessibleRole(), and SetAccessibleRole().
|
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().
|
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().
|
private |
client id in the AccessibleEventNotifier queue
Definition at line 328 of file AccessibleContextBase.hxx.
Referenced by addAccessibleEventListener(), CommitChange(), disposing(), FireEvent(), and removeAccessibleEventListener().
|
protected |
The state set.
Definition at line 262 of file AccessibleContextBase.hxx.
Referenced by AccessibleContextBase(), getAccessibleStateSet(), GetState(), ResetState(), and SetState().
|
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().
|
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().
|
private |
Reference to the parent object.
Definition at line 301 of file AccessibleContextBase.hxx.
Referenced by disposing(), getAccessibleIndexInParent(), getAccessibleParent(), and getLocale().
|
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().