LibreOffice Module svx (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
accessibility::ChildrenManager Class Referencefinal

The AccessibleChildrenManager class acts as a cache of the accessible objects of the currently visible shapes of a draw page and as a factory to create the corresponding accessible object for a given shape. More...

#include <ChildrenManager.hxx>

Collaboration diagram for accessibility::ChildrenManager:
[legend]

Public Member Functions

 ChildrenManager (const css::uno::Reference< css::accessibility::XAccessible > &rxParent, const css::uno::Reference< css::drawing::XShapes > &rxShapeList, const AccessibleShapeTreeInfo &rShapeTreeInfo, AccessibleContextBase &rContext)
 Create a children manager, which manages the children of the given parent. More...
 
 ~ChildrenManager ()
 If there still are managed children these are marked as DEFUNC and released. More...
 
sal_Int64 GetChildCount () const noexcept
 Return the number of currently visible accessible children. More...
 
css::uno::Reference< css::accessibility::XAccessible > GetChild (sal_Int64 nIndex)
 Return the requested accessible child or throw and IndexOutOfBoundsException if the given index is invalid. More...
 
const css::uno::Reference< css::drawing::XShape > & GetChildShape (sal_Int64 nIndex)
 
void Update (bool bCreateNewObjectsOnDemand=true)
 Update the child manager. More...
 
void SetShapeList (const css::uno::Reference< css::drawing::XShapes > &xShapeList)
 Replace the list of UNO shapes by the specified list. More...
 
void AddAccessibleShape (rtl::Reference< AccessibleShape > const &shape)
 Add an accessible shape. More...
 
void ClearAccessibleShapeList ()
 Clear the list of accessible shapes which have been added by previous calls to <member>AddAccessibleShape</member>. More...
 
void SetInfo (AccessibleShapeTreeInfo const &rShapeTreeInfo)
 Take a new event shape tree info. More...
 
void UpdateSelection ()
 Update the SELECTED and FOCUSED states of all visible children according to the given selection. More...
 
bool HasFocus () const
 Return whether one of the shapes managed by this object has currently the focus. More...
 
void RemoveFocus ()
 When there is a shape that currently has the focus, i.e. More...
 
void ViewForwarderChanged ()
 

Private Member Functions

 ChildrenManager (const ChildrenManager &)=delete
 
ChildrenManageroperator= (const ChildrenManager &)=delete
 

Private Attributes

rtl::Reference< ChildrenManagerImplmpImpl
 

Detailed Description

The AccessibleChildrenManager class acts as a cache of the accessible objects of the currently visible shapes of a draw page and as a factory to create the corresponding accessible object for a given shape.

There are two sources of shapes. The first is a list of UNO shapes. It is passes to the constructor and can be re-set with a call to <member>SetShapeList</member>. Accessibility objects which represent these shapes are constructed usually on demand. The second source is a set of single AccessibleShape objects added by calls to <member>AddAccessibleShape</member>. These are not modified by this class. They are only copied into the list of visible shapes depending on their visibility. The later list can be cleared by calling <member>ClearAccessibleShapeList</member>. The actual set of children accessible through the <member>GetChildrenCount</member> and <member>GetChild</member> methods are the accessible objects that lie completely or partially inside the visible area obtained from the view forwarder in the shape tree info.

A children manager registers itself at the broadcaster passed to its constructor and transforms/forwards the received events to the listeners of the also given context base. The transformation process includes interpreting a document::XEventListener, the change from XShape references to the associated XAccessible reference, and the creation of an XAccessibleEventObject. The event object is then passed to the <method>fireEvent</method> method of the context and from there forwarded to all listeners.

Note that some of the data given to the constructor is passed to the accessible shape objects created by that child manager which in turn pass these data to their child managers. The data is thus propagated down a tree of child managers/accessible shape objects from a top level class that is usually a document/model. This is the way to give all accessible objects access to data normally known only to the top level owner of the shapes.

Definition at line 89 of file ChildrenManager.hxx.

Constructor & Destructor Documentation

◆ ChildrenManager() [1/2]

accessibility::ChildrenManager::ChildrenManager ( const css::uno::Reference< css::accessibility::XAccessible > &  rxParent,
const css::uno::Reference< css::drawing::XShapes > &  rxShapeList,
const AccessibleShapeTreeInfo rShapeTreeInfo,
AccessibleContextBase rContext 
)

Create a children manager, which manages the children of the given parent.

The parent is used for creating accessible objects. The list of shapes for which to create those objects is not derived from the parent and has to be provided separately by calling one of the update methods.

Parameters
rxParentThe parent of the accessible objects which will be created on demand at some point of time in the future.
rxShapeListList of UNO shapes to manage.
rShapeTreeInfoBundle of information passed down the shape tree.
rContextAn accessible context object that is called for firing events for new and deleted children, i.e. that holds a list of listeners to be informed.

◆ ~ChildrenManager()

accessibility::ChildrenManager::~ChildrenManager ( )

If there still are managed children these are marked as DEFUNC and released.

Definition at line 44 of file ChildrenManager.cxx.

References SAL_INFO.

◆ ChildrenManager() [2/2]

accessibility::ChildrenManager::ChildrenManager ( const ChildrenManager )
privatedelete

Member Function Documentation

◆ AddAccessibleShape()

void accessibility::ChildrenManager::AddAccessibleShape ( rtl::Reference< AccessibleShape > const &  shape)

Add an accessible shape.

The difference to the UNO shapes in the list passed to the constructor the specified object does not have to be created by the shape factory. This gives the caller full control over object creation.

Parameters
shapemust be non-null

Definition at line 77 of file ChildrenManager.cxx.

◆ ClearAccessibleShapeList()

void accessibility::ChildrenManager::ClearAccessibleShapeList ( )

Clear the list of accessible shapes which have been added by previous calls to <member>AddAccessibleShape</member>.

Definition at line 82 of file ChildrenManager.cxx.

◆ GetChild()

css::uno::Reference< XAccessible > accessibility::ChildrenManager::GetChild ( sal_Int64  nIndex)

Return the requested accessible child or throw and IndexOutOfBoundsException if the given index is invalid.

Parameters
nIndexIndex of the requested child. Call getChildCount for obtaining the number of children.
Returns
In case of a valid index this method returns a reference to the requested accessible child. This reference is empty if it has not been possible to create the accessible object of the corresponding shape.
Exceptions
Throwsan IndexOutOfBoundsException if the index is not valid.

Definition at line 57 of file ChildrenManager.cxx.

References nIndex.

◆ GetChildCount()

sal_Int64 accessibility::ChildrenManager::GetChildCount ( ) const
noexcept

Return the number of currently visible accessible children.

Returns
If there are no children a 0 is returned.

Definition at line 52 of file ChildrenManager.cxx.

◆ GetChildShape()

const css::uno::Reference< css::drawing::XShape > & accessibility::ChildrenManager::GetChildShape ( sal_Int64  nIndex)
Exceptions
css::lang::IndexOutOfBoundsException
css::uno::RuntimeException

Definition at line 62 of file ChildrenManager.cxx.

References nIndex.

◆ HasFocus()

bool accessibility::ChildrenManager::HasFocus ( ) const

Return whether one of the shapes managed by this object has currently the focus.

Returns
Returns <true> when there is a shape that has the focus and <false> when there is no such shape.

Definition at line 97 of file ChildrenManager.cxx.

◆ operator=()

ChildrenManager & accessibility::ChildrenManager::operator= ( const ChildrenManager )
privatedelete

◆ RemoveFocus()

void accessibility::ChildrenManager::RemoveFocus ( )

When there is a shape that currently has the focus, i.e.

<member>HasFocus()</member> returns <true> then remove the focus from that shape. Otherwise nothing changes.

Definition at line 102 of file ChildrenManager.cxx.

◆ SetInfo()

void accessibility::ChildrenManager::SetInfo ( AccessibleShapeTreeInfo const &  rShapeTreeInfo)

Take a new event shape tree info.

Call this method to inform the children manager of a change of the info bundle.

Parameters
rShapeTreeInfoThe new info that replaces the current one.

Definition at line 87 of file ChildrenManager.cxx.

◆ SetShapeList()

void accessibility::ChildrenManager::SetShapeList ( const css::uno::Reference< css::drawing::XShapes > &  xShapeList)

Replace the list of UNO shapes by the specified list.

Parameters
xShapeListThe new list of shapes.

Definition at line 72 of file ChildrenManager.cxx.

◆ Update()

void accessibility::ChildrenManager::Update ( bool  bCreateNewObjectsOnDemand = true)

Update the child manager.

Take care of a modified set of children and modified visible area. This method can optimize the update process with respect separate updates of a modified children list and visible area.

Parameters
bCreateNewObjectsOnDemandIf </true> then accessible objects associated with the visible shapes are created only when asked for. No event is sent on creation. If </false> then the accessible objects are created before this method returns and events are sent to inform the listeners of the new object.

Definition at line 67 of file ChildrenManager.cxx.

◆ UpdateSelection()

void accessibility::ChildrenManager::UpdateSelection ( )

Update the SELECTED and FOCUSED states of all visible children according to the given selection.

This includes setting and resetting the states.

Definition at line 92 of file ChildrenManager.cxx.

◆ ViewForwarderChanged()

void accessibility::ChildrenManager::ViewForwarderChanged ( )

Definition at line 108 of file ChildrenManager.cxx.

Member Data Documentation

◆ mpImpl

rtl::Reference<ChildrenManagerImpl> accessibility::ChildrenManager::mpImpl
private

Definition at line 205 of file ChildrenManager.hxx.


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