LibreOffice Module chart2 (master) 1
|
Base class for all Chart Accessibility objects. More...
#include <AccessibleBase.hxx>
Public Types | |
enum class | EventType { GOT_SELECTION , LOST_SELECTION } |
Public Member Functions | |
AccessibleBase (AccessibleElementInfo aAccInfo, bool bMayHaveChildren, bool bAlwaysTransparent) | |
virtual | ~AccessibleBase () override |
Protected Member Functions | |
bool | CheckDisposeState (bool bThrowException=true) const |
bool | NotifyEvent (EventType eType, const AccessibleUniqueId &rId) |
Events coming from the core have to be processed in this methods. More... | |
void | AddState (sal_Int64 aState) |
Adds a state to the set. More... | |
void | RemoveState (sal_Int64 aState) |
Removes a state from the set if the set contains the state, otherwise nothing is done. More... | |
bool | UpdateChildren () |
has to be overridden by derived classes that support child elements. More... | |
virtual bool | ImplUpdateChildren () |
Is called by UpdateChildren. More... | |
void | AddChild (AccessibleBase *pChild) |
adds a child to the end of the internal vector of children. More... | |
void | RemoveChildByOId (const ObjectIdentifier &rOId) |
removes a child from the internal vector. More... | |
virtual css::awt::Point | GetUpperLeftOnScreen () const |
Retrieve the pixel coordinates of logical coordinates (0,0) of the current logic coordinate system. More... | |
void | BroadcastAccEvent (sal_Int16 nId, const css::uno::Any &rNew, const css::uno::Any &rOld) const |
This method creates an AccessibleEventObject and sends it to all listeners that are currently listening to this object. More... | |
void | KillAllChildren () |
Removes all children from the internal lists and broadcasts child remove events. More... | |
virtual css::uno::Reference< css::accessibility::XAccessible > | ImplGetAccessibleChildById (sal_Int64 i) const |
Is called from getAccessibleChild(). More... | |
virtual sal_Int64 | ImplGetAccessibleChildCount () const |
Is called from getAccessibleChildCount(). More... | |
const AccessibleElementInfo & | GetInfo () const |
void | SetInfo (const AccessibleElementInfo &rNewInfo) |
const AccessibleUniqueId & | GetId () const |
virtual void SAL_CALL | disposing () override |
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL | getAccessibleContext () override |
virtual sal_Int64 SAL_CALL | getAccessibleChildCount () override |
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL | getAccessibleChild (sal_Int64 i) override |
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL | getAccessibleParent () override |
virtual sal_Int64 SAL_CALL | getAccessibleIndexInParent () override |
virtual sal_Int16 SAL_CALL | getAccessibleRole () override |
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL | getAccessibleRelationSet () override |
virtual sal_Int64 SAL_CALL | getAccessibleStateSet () override |
virtual css::lang::Locale SAL_CALL | getLocale () override |
virtual sal_Bool SAL_CALL | containsPoint (const css::awt::Point &aPoint) override |
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL | getAccessibleAtPoint (const css::awt::Point &aPoint) override |
virtual css::awt::Rectangle SAL_CALL | getBounds () override |
virtual css::awt::Point SAL_CALL | getLocation () override |
virtual css::awt::Point SAL_CALL | getLocationOnScreen () override |
virtual css::awt::Size SAL_CALL | getSize () override |
virtual void SAL_CALL | grabFocus () override |
virtual sal_Int32 SAL_CALL | getForeground () override |
virtual sal_Int32 SAL_CALL | getBackground () override |
virtual OUString SAL_CALL | getImplementationName () override |
virtual sal_Bool SAL_CALL | supportsService (const OUString &ServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &Source) override |
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 |
Private Types | |
enum | eColorType { ACC_BASE_FOREGROUND , ACC_BASE_BACKGROUND } |
typedef std::vector< css::uno::Reference< css::accessibility::XAccessible > > | ChildListVectorType |
type of the vector containing the accessible children More... | |
typedef std::map< ObjectIdentifier, css::uno::Reference< css::accessibility::XAccessible > > | ChildOIDMap |
type of the hash containing a vector index for every AccessibleUniqueId of the object in the child list More... | |
Private Member Functions | |
Color | getColor (eColorType eColType) |
Private Attributes | |
bool | m_bIsDisposed |
const bool | m_bMayHaveChildren |
bool | m_bChildrenInitialized |
ChildListVectorType | m_aChildList |
ChildOIDMap | m_aChildOIDMap |
::comphelper::AccessibleEventNotifier::TClientId | m_nEventNotifierId |
sal_Int64 | m_nStateSet |
for getAccessibleStateSet() More... | |
AccessibleElementInfo | m_aAccInfo |
const bool | m_bAlwaysTransparent |
volatile bool | m_bStateSetInitialized |
denotes if the state-set is initialized. More... | |
Additional Inherited Members | |
Protected Attributes inherited from cppu::BaseMutex | |
mutable::osl::Mutex | m_aMutex |
Base class for all Chart Accessibility objects.
Definition at line 91 of file AccessibleBase.hxx.
|
private |
type of the vector containing the accessible children
Definition at line 288 of file AccessibleBase.hxx.
|
private |
type of the hash containing a vector index for every AccessibleUniqueId of the object in the child list
Definition at line 292 of file AccessibleBase.hxx.
|
private |
Enumerator | |
---|---|
ACC_BASE_FOREGROUND | |
ACC_BASE_BACKGROUND |
Definition at line 278 of file AccessibleBase.hxx.
|
strong |
Enumerator | |
---|---|
GOT_SELECTION | |
LOST_SELECTION |
Definition at line 96 of file AccessibleBase.hxx.
chart::AccessibleBase::AccessibleBase | ( | AccessibleElementInfo | aAccInfo, |
bool | bMayHaveChildren, | ||
bool | bAlwaysTransparent | ||
) |
bMayHaveChildren | is false per default |
Definition at line 67 of file AccessibleBase.cxx.
References m_aMutex, and m_nStateSet.
|
overridevirtual |
Definition at line 89 of file AccessibleBase.cxx.
References m_bIsDisposed.
|
overrideprotectedvirtual |
Definition at line 816 of file AccessibleBase.cxx.
References comphelper::AccessibleEventNotifier::addEventListener(), cppu::BaseMutex::m_aMutex, m_nEventNotifierId, and comphelper::AccessibleEventNotifier::registerClient().
|
protected |
adds a child to the end of the internal vector of children.
As a result, the child-count increases by one, but all existing children keep their indices.
Important: as the implementation is needed, this should remain the only method for adding children (i.e. there mustn't be an AddChild( Reference< XAccessible > ) or the like).
Definition at line 249 of file AccessibleBase.cxx.
References Any, BroadcastAccEvent(), GetId(), m_aChildList, m_aChildOIDMap, cppu::BaseMutex::m_aMutex, and m_bChildrenInitialized.
|
protected |
Adds a state to the set.
css::uno::RuntimeException |
Definition at line 167 of file AccessibleBase.cxx.
References CheckDisposeState(), and m_nStateSet.
Referenced by getAccessibleStateSet(), and NotifyEvent().
|
protected |
This method creates an AccessibleEventObject and sends it to all listeners that are currently listening to this object.
Definition at line 338 of file AccessibleBase.cxx.
References comphelper::AccessibleEventNotifier::addEvent(), aEvent, cppu::BaseMutex::m_aMutex, m_nEventNotifierId, and nId.
Referenced by AddChild(), KillAllChildren(), NotifyEvent(), RemoveChildByOId(), and SetInfo().
|
protected |
bThrowException | if true, a DisposedException is thrown if the object is already disposed |
css::lang::DisposedException |
Definition at line 94 of file AccessibleBase.cxx.
References m_bIsDisposed.
Referenced by AddState(), getAccessibleAtPoint(), getAccessibleChild(), getAccessibleIndexInParent(), getAccessibleParent(), getLocale(), getLocation(), getLocationOnScreen(), getSize(), grabFocus(), and RemoveState().
|
overrideprotectedvirtual |
Definition at line 562 of file AccessibleBase.cxx.
References getBounds().
Referenced by chart::AccessibleChartElement::containsPoint().
|
overrideprotectedvirtual |
Definition at line 399 of file AccessibleBase.cxx.
References KillAllChildren(), m_aAccInfo, m_aChildList, cppu::BaseMutex::m_aMutex, m_bIsDisposed, m_bMayHaveChildren, m_nEventNotifierId, m_nStateSet, chart::AccessibleElementInfo::m_pParent, and comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Definition at line 576 of file AccessibleBase.cxx.
References CheckDisposeState(), getBounds(), m_aChildList, and cppu::BaseMutex::m_aMutex.
Referenced by chart::AccessibleChartElement::getAccessibleAtPoint().
|
overrideprotectedvirtual |
Definition at line 462 of file AccessibleBase.cxx.
References CheckDisposeState(), i, ImplGetAccessibleChildById(), cppu::BaseMutex::m_aMutex, m_bChildrenInitialized, m_bMayHaveChildren, and UpdateChildren().
|
overrideprotectedvirtual |
Definition at line 438 of file AccessibleBase.cxx.
References ImplGetAccessibleChildCount(), cppu::BaseMutex::m_aMutex, m_bChildrenInitialized, m_bIsDisposed, m_bMayHaveChildren, and UpdateChildren().
|
overrideprotectedvirtual |
Definition at line 432 of file AccessibleBase.cxx.
|
overrideprotectedvirtual |
Definition at line 514 of file AccessibleBase.cxx.
References CheckDisposeState(), GetId(), m_aAccInfo, and chart::AccessibleElementInfo::m_spObjectHierarchy.
|
overrideprotectedvirtual |
Definition at line 504 of file AccessibleBase.cxx.
References CheckDisposeState(), m_aAccInfo, and chart::AccessibleElementInfo::m_pParent.
Referenced by getBounds().
|
overrideprotectedvirtual |
Definition at line 528 of file AccessibleBase.cxx.
|
overrideprotectedvirtual |
Definition at line 523 of file AccessibleBase.cxx.
|
overrideprotectedvirtual |
Definition at line 534 of file AccessibleBase.cxx.
References AddState(), GetId(), GetInfo(), chart::ObjectIdentifier::isValid(), m_bStateSetInitialized, and m_nStateSet.
|
overrideprotectedvirtual |
Definition at line 694 of file AccessibleBase.cxx.
References ACC_BASE_BACKGROUND, and getColor().
Referenced by chart::AccessibleChartElement::getBackground().
|
overrideprotectedvirtual |
Definition at line 614 of file AccessibleBase.cxx.
References getAccessibleParent(), chart::ObjectIdentifier::getObjectCID(), tools::Rectangle::getOpenHeight(), tools::Rectangle::getOpenWidth(), GetUpperLeftOnScreen(), VCLUnoHelper::GetWindow(), tools::Rectangle::Left(), m_aAccInfo, chart::AccessibleElementInfo::m_aOID, chart::AccessibleElementInfo::m_xView, chart::AccessibleElementInfo::m_xWindow, and tools::Rectangle::Top().
Referenced by containsPoint(), getAccessibleAtPoint(), chart::AccessibleChartElement::getBounds(), getLocation(), and getSize().
|
private |
Definition at line 699 of file AccessibleBase.cxx.
References ACC_BASE_FOREGROUND, aPropName, COL_TRANSPARENT(), chart::ObjectIdentifier::createClassifiedIdentifierForParticle(), DBG_UNHANDLED_EXCEPTION, eType, chart::ObjectIdentifier::getFullParentParticle(), chart::ObjectIdentifier::getObjectCID(), chart::ObjectIdentifier::getObjectPropertySet(), chart::ObjectIdentifier::getObjectType(), m_aAccInfo, chart::AccessibleElementInfo::m_aOID, m_bAlwaysTransparent, chart::AccessibleElementInfo::m_xChartDocument, chart::OBJECTTYPE_DATA_POINT, chart::OBJECTTYPE_DATA_SERIES, and chart::OBJECTTYPE_LEGEND_ENTRY.
Referenced by getBackground(), and getForeground().
|
overrideprotectedvirtual |
Definition at line 689 of file AccessibleBase.cxx.
References ACC_BASE_FOREGROUND, and getColor().
Referenced by chart::AccessibleChartElement::getForeground().
|
inlineprotected |
Definition at line 219 of file AccessibleBase.hxx.
References m_aAccInfo, and chart::AccessibleElementInfo::m_aOID.
Referenced by AddChild(), getAccessibleIndexInParent(), getAccessibleStateSet(), grabFocus(), ImplUpdateChildren(), and NotifyEvent().
|
overrideprotectedvirtual |
Definition at line 792 of file AccessibleBase.cxx.
|
inlineprotected |
Definition at line 217 of file AccessibleBase.hxx.
References m_aAccInfo.
Referenced by getAccessibleStateSet(), and grabFocus().
|
overrideprotectedvirtual |
Definition at line 554 of file AccessibleBase.cxx.
References CheckDisposeState(), AllSettings::GetLanguageTag(), LanguageTag::getLocale(), and Application::GetSettings().
|
overrideprotectedvirtual |
Definition at line 648 of file AccessibleBase.cxx.
References CheckDisposeState(), and getBounds().
Referenced by chart::AccessibleChartElement::getLocation(), and getLocationOnScreen().
|
overrideprotectedvirtual |
Definition at line 655 of file AccessibleBase.cxx.
References CheckDisposeState(), getLocation(), m_aAccInfo, and chart::AccessibleElementInfo::m_pParent.
Referenced by chart::AccessibleChartElement::getLocationOnScreen().
|
overrideprotectedvirtual |
Definition at line 671 of file AccessibleBase.cxx.
References CheckDisposeState(), and getBounds().
Referenced by chart::AccessibleChartElement::getSize().
|
overrideprotectedvirtual |
Definition at line 802 of file AccessibleBase.cxx.
|
protectedvirtual |
Retrieve the pixel coordinates of logical coordinates (0,0) of the current logic coordinate system.
This can be used for getLocationOnScreen, if the coordinates of an object are not relative to its direct parent, but a parent higher up in hierarchy.
Definition at line 318 of file AccessibleBase.cxx.
References GetUpperLeftOnScreen(), m_aAccInfo, cppu::BaseMutex::m_aMutex, and chart::AccessibleElementInfo::m_pParent.
Referenced by getBounds(), and GetUpperLeftOnScreen().
|
overrideprotectedvirtual |
Definition at line 678 of file AccessibleBase.cxx.
References CheckDisposeState(), GetId(), and GetInfo().
Referenced by chart::AccessibleChartElement::grabFocus(), and chart::AccessibleChartShape::grabFocus().
|
protectedvirtual |
Is called from getAccessibleChild().
Before this method is called, an update of children is done if necessary.
css::lang::IndexOutOfBoundsException | |
css::uno::RuntimeException |
Definition at line 481 of file AccessibleBase.cxx.
References aBuf, i, m_aChildList, cppu::BaseMutex::m_aMutex, m_bMayHaveChildren, and o3tl::make_unsigned().
Referenced by getAccessibleChild(), and chart::AccessibleChartElement::ImplGetAccessibleChildById().
|
protectedvirtual |
Is called from getAccessibleChildCount().
Before this method is called, an update of children is done if necessary.
css::uno::RuntimeException |
Definition at line 457 of file AccessibleBase.cxx.
References m_aChildList.
Referenced by getAccessibleChildCount(), and chart::AccessibleChartElement::ImplGetAccessibleChildCount().
|
protectedvirtual |
Is called by UpdateChildren.
This method is only called if an update is really necessary.
Definition at line 199 of file AccessibleBase.cxx.
References GetId(), m_aAccInfo, m_aChildOIDMap, and chart::AccessibleElementInfo::m_spObjectHierarchy.
Referenced by chart::AccessibleChartElement::ImplUpdateChildren(), and UpdateChildren().
|
protected |
Removes all children from the internal lists and broadcasts child remove events.
This method cares about mutex locking, and thus should be called without the mutex locked.
Definition at line 361 of file AccessibleBase.cxx.
References Any, BroadcastAccEvent(), m_aChildList, m_aChildOIDMap, cppu::BaseMutex::m_aMutex, and m_bChildrenInitialized.
Referenced by disposing(), and SetInfo().
|
protected |
Events coming from the core have to be processed in this methods.
The default implementation returns false, which indicates that the object is not interested in the event. To react on events you have to implement this method in derived classes.
The default implementation iterates over all children and forwards the event until the first child returns true.
nObjId | contains the object id of chart objects. If the object is no chart object, the event is not broadcast. |
Definition at line 105 of file AccessibleBase.cxx.
References AddState(), BroadcastAccEvent(), GetId(), GOT_SELECTION, LOST_SELECTION, m_aChildList, cppu::BaseMutex::m_aMutex, m_bMayHaveChildren, RemoveState(), and SAL_INFO.
|
overrideprotectedvirtual |
Definition at line 829 of file AccessibleBase.cxx.
References cppu::BaseMutex::m_aMutex, m_nEventNotifierId, comphelper::AccessibleEventNotifier::removeEventListener(), and comphelper::AccessibleEventNotifier::revokeClient().
|
protected |
removes a child from the internal vector.
in this method we imply that the Reference< XAccessible > elements in the vector are AccessibleBase objects !
All children with index greater than the index of the removed element get an index one less than before.
Definition at line 276 of file AccessibleBase.cxx.
References Any, BroadcastAccEvent(), m_aChildList, m_aChildOIDMap, cppu::BaseMutex::m_aMutex, and m_bChildrenInitialized.
Referenced by chart::AccessibleChartView::disposing().
|
protected |
Removes a state from the set if the set contains the state, otherwise nothing is done.
css::uno::RuntimeException |
Definition at line 173 of file AccessibleBase.cxx.
References CheckDisposeState(), and m_nStateSet.
Referenced by NotifyEvent().
|
protected |
Definition at line 388 of file AccessibleBase.cxx.
References BroadcastAccEvent(), KillAllChildren(), m_aAccInfo, and m_bMayHaveChildren.
|
overrideprotectedvirtual |
Definition at line 797 of file AccessibleBase.cxx.
References ServiceName, and cppu::supportsService().
|
protected |
has to be overridden by derived classes that support child elements.
With this method a rescan is initiated that should result in a correct list of children.
This method is called when access to any methods concerning children is invoked for the first time.
Definition at line 179 of file AccessibleBase.cxx.
References ImplUpdateChildren(), cppu::BaseMutex::m_aMutex, m_bChildrenInitialized, m_bIsDisposed, and m_bMayHaveChildren.
Referenced by getAccessibleChild(), and getAccessibleChildCount().
|
private |
Definition at line 307 of file AccessibleBase.hxx.
Referenced by disposing(), getAccessibleIndexInParent(), getAccessibleParent(), getBounds(), getColor(), GetId(), GetInfo(), getLocationOnScreen(), GetUpperLeftOnScreen(), ImplUpdateChildren(), and SetInfo().
|
private |
Definition at line 297 of file AccessibleBase.hxx.
Referenced by AddChild(), disposing(), getAccessibleAtPoint(), ImplGetAccessibleChildById(), ImplGetAccessibleChildCount(), KillAllChildren(), NotifyEvent(), and RemoveChildByOId().
|
private |
Definition at line 299 of file AccessibleBase.hxx.
Referenced by AddChild(), ImplUpdateChildren(), KillAllChildren(), and RemoveChildByOId().
|
private |
Definition at line 308 of file AccessibleBase.hxx.
Referenced by getColor().
|
private |
Definition at line 296 of file AccessibleBase.hxx.
Referenced by AddChild(), getAccessibleChild(), getAccessibleChildCount(), KillAllChildren(), RemoveChildByOId(), and UpdateChildren().
|
private |
Definition at line 294 of file AccessibleBase.hxx.
Referenced by CheckDisposeState(), disposing(), getAccessibleChildCount(), UpdateChildren(), and ~AccessibleBase().
|
private |
Definition at line 295 of file AccessibleBase.hxx.
Referenced by disposing(), getAccessibleChild(), getAccessibleChildCount(), ImplGetAccessibleChildById(), NotifyEvent(), SetInfo(), and UpdateChildren().
|
private |
denotes if the state-set is initialized.
On initialization the selected state is checked.
This variable is monitored by the solar mutex!
Note: declared volatile to enable double-check-locking
Definition at line 316 of file AccessibleBase.hxx.
Referenced by getAccessibleStateSet().
|
private |
Definition at line 301 of file AccessibleBase.hxx.
Referenced by addAccessibleEventListener(), BroadcastAccEvent(), disposing(), and removeAccessibleEventListener().
|
private |
Definition at line 305 of file AccessibleBase.hxx.
Referenced by AccessibleBase(), AddState(), disposing(), getAccessibleStateSet(), and RemoveState().