LibreOffice Module slideshow (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
slideshow::internal::ShapeManagerImpl Class Reference

Listener class for shape events. More...

#include <shapemanagerimpl.hxx>

Inheritance diagram for slideshow::internal::ShapeManagerImpl:
[legend]
Collaboration diagram for slideshow::internal::ShapeManagerImpl:
[legend]

Public Member Functions

 ShapeManagerImpl (EventMultiplexer &rMultiplexer, LayerManagerSharedPtr xLayerManager, CursorManager &rCursorManager, const ShapeEventListenerMap &rGlobalListenersMap, const ShapeCursorMap &rGlobalCursorMap, const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
 Create a shape event broadcaster. More...
 
 ShapeManagerImpl (const ShapeManagerImpl &)=delete
 Forbid copy construction. More...
 
ShapeManagerImploperator= (const ShapeManagerImpl &)=delete
 Forbid copy assignment. More...
 
void activate ()
 Enables event listening. More...
 
void deactivate ()
 Disables event listening. More...
 
virtual void dispose () override
 Dispose all object references. More...
 
virtual AttributableShapeSharedPtr getSubsetShape (const AttributableShapeSharedPtr &rOrigShape, const DocTreeNode &rTreeNode)=0
 Query a subset of the given original shape. More...
 
virtual void revokeSubset (const AttributableShapeSharedPtr &rOrigShape, const AttributableShapeSharedPtr &rSubsetShape)=0
 Revoke a previously queried subset shape. More...
 
virtual void addIntrinsicAnimationHandler (const IntrinsicAnimationEventHandlerSharedPtr &rHandler)=0
 Register an event handler that will be called when user paint parameters change. More...
 
virtual void removeIntrinsicAnimationHandler (const IntrinsicAnimationEventHandlerSharedPtr &rHandler)=0
 
virtual void notifyIntrinsicAnimationsEnabled ()=0
 Notify that shape-intrinsic animations are now enabled. More...
 
virtual void notifyIntrinsicAnimationsDisabled ()=0
 Notify that shape-intrinsic animations are now disabled. More...
 
virtual void enterAnimationMode (const AnimatableShapeSharedPtr &rShape)=0
 Notify the ShapeManager that the given Shape starts an animation now. More...
 
virtual void leaveAnimationMode (const AnimatableShapeSharedPtr &rShape)=0
 Notify the ShapeManager that the given Shape is no longer animated. More...
 
virtual void notifyShapeUpdate (const ShapeSharedPtr &rShape)=0
 Notify that a shape needs an update. More...
 
virtual ShapeSharedPtr lookupShape (css::uno::Reference< css::drawing::XShape > const &xShape) const =0
 Lookup a Shape from an XShape model object. More...
 
virtual const XShapeToShapeMapgetXShapeToShapeMap () const =0
 Get a map that maps all Shapes with their XShape reference as the key. More...
 
virtual void addHyperlinkArea (const HyperlinkAreaSharedPtr &rArea)=0
 Register given shape as a hyperlink target. More...
 
- Public Member Functions inherited from slideshow::internal::Disposable
virtual ~Disposable ()
 
virtual void dispose ()=0
 Dispose all object references. More...
 
- Public Member Functions inherited from slideshow::internal::ShapeListenerEventHandler
virtual ~ShapeListenerEventHandler ()
 
virtual bool listenerAdded (const css::uno::Reference< css::drawing::XShape > &xShape)=0
 
virtual bool listenerRemoved (const css::uno::Reference< css::drawing::XShape > &xShape)=0
 
- Public Member Functions inherited from slideshow::internal::MouseEventHandler
virtual ~MouseEventHandler ()
 
virtual bool handleMousePressed (const css::awt::MouseEvent &e)=0
 Handle a mouse button pressed event. More...
 
virtual bool handleMouseReleased (const css::awt::MouseEvent &e)=0
 Handle a mouse button released event. More...
 
virtual bool handleMouseDragged (const css::awt::MouseEvent &e)=0
 Handle a mouse was moved with a pressed button event. More...
 
virtual bool handleMouseMoved (const css::awt::MouseEvent &e)=0
 Handle a mouse was moved event. More...
 
virtual bool update ()=0
 Perform the update action on all views. More...
 
virtual bool needsUpdate () const =0
 Query whether updates are pending. More...
 

Private Types

typedef std::map< ShapeSharedPtr, std::shared_ptr< ::comphelper::OInterfaceContainerHelper3< css::presentation::XShapeEventListener > >, Shape::lessThanShapeShapeToListenersMap
 
typedef std::map< ShapeSharedPtr, sal_Int16, Shape::lessThanShapeShapeToCursorMap
 
typedef std::set< HyperlinkAreaSharedPtr, HyperlinkArea::lessThanAreaAreaSet
 
typedef ThreadUnsafeListenerContainer< IntrinsicAnimationEventHandlerSharedPtr, std::vector< IntrinsicAnimationEventHandlerSharedPtr > > ImplIntrinsicAnimationEventHandlers
 

Private Member Functions

virtual bool handleMousePressed (css::awt::MouseEvent const &evt) override
 Handle a mouse button pressed event. More...
 
virtual bool handleMouseReleased (css::awt::MouseEvent const &evt) override
 Handle a mouse button released event. More...
 
virtual bool handleMouseDragged (css::awt::MouseEvent const &evt) override
 Handle a mouse was moved with a pressed button event. More...
 
virtual bool handleMouseMoved (css::awt::MouseEvent const &evt) override
 Handle a mouse was moved event. More...
 
virtual bool update () override
 Perform the update action on all views. More...
 
virtual bool needsUpdate () const override
 Query whether updates are pending. More...
 
virtual void enterAnimationMode (const AnimatableShapeSharedPtr &rShape) override
 Notify the ShapeManager that the given Shape starts an animation now. More...
 
virtual void leaveAnimationMode (const AnimatableShapeSharedPtr &rShape) override
 Notify the ShapeManager that the given Shape is no longer animated. More...
 
virtual void notifyShapeUpdate (const ShapeSharedPtr &rShape) override
 Notify that a shape needs an update. More...
 
virtual ShapeSharedPtr lookupShape (css::uno::Reference< css::drawing::XShape > const &xShape) const override
 Lookup a Shape from an XShape model object. More...
 
virtual const XShapeToShapeMapgetXShapeToShapeMap () const override
 Get a map that maps all Shapes with their XShape reference as the key. More...
 
virtual void addHyperlinkArea (const HyperlinkAreaSharedPtr &rArea) override
 Register given shape as a hyperlink target. More...
 
virtual AttributableShapeSharedPtr getSubsetShape (const AttributableShapeSharedPtr &rOrigShape, const DocTreeNode &rTreeNode) override
 Query a subset of the given original shape. More...
 
virtual void revokeSubset (const AttributableShapeSharedPtr &rOrigShape, const AttributableShapeSharedPtr &rSubsetShape) override
 Revoke a previously queried subset shape. More...
 
virtual void addIntrinsicAnimationHandler (const IntrinsicAnimationEventHandlerSharedPtr &rHandler) override
 Register an event handler that will be called when user paint parameters change. More...
 
virtual void removeIntrinsicAnimationHandler (const IntrinsicAnimationEventHandlerSharedPtr &rHandler) override
 
virtual void notifyIntrinsicAnimationsEnabled () override
 Notify that shape-intrinsic animations are now enabled. More...
 
virtual void notifyIntrinsicAnimationsDisabled () override
 Notify that shape-intrinsic animations are now disabled. More...
 
virtual bool listenerAdded (const css::uno::Reference< css::drawing::XShape > &xShape) override
 
virtual bool listenerRemoved (const css::uno::Reference< css::drawing::XShape > &xShape) override
 
void cursorChanged (const css::uno::Reference< css::drawing::XShape > &xShape, sal_Int16 nCursor)
 
OUString checkForHyperlink (::basegfx::B2DPoint const &hitPos) const
 
OUString checkForImageMap (css::awt::MouseEvent const &evt) const
 

Private Attributes

EventMultiplexermrMultiplexer
 
LayerManagerSharedPtr mpLayerManager
 
CursorManager & mrCursorManager
 
const ShapeEventListenerMapmrGlobalListenersMap
 
const ShapeCursorMapmrGlobalCursorMap
 
ShapeToListenersMap maShapeListenerMap
 
ShapeToCursorMap maShapeCursorMap
 
AreaSet maHyperlinkShapes
 
ImplIntrinsicAnimationEventHandlers maIntrinsicAnimationEventHandlers
 
bool mbEnabled
 
const css::uno::Reference< css::drawing::XDrawPage > mxDrawPage
 

Detailed Description

Listener class for shape events.

This helper class registers itself on each view, and broadcasts the XShapeEventListener events. The mouse motion events are needed for setting the shape cursor.

Definition at line 50 of file shapemanagerimpl.hxx.

Member Typedef Documentation

◆ AreaSet

Definition at line 166 of file shapemanagerimpl.hxx.

◆ ImplIntrinsicAnimationEventHandlers

Definition at line 170 of file shapemanagerimpl.hxx.

◆ ShapeToCursorMap

Definition at line 164 of file shapemanagerimpl.hxx.

◆ ShapeToListenersMap

Definition at line 162 of file shapemanagerimpl.hxx.

Constructor & Destructor Documentation

◆ ShapeManagerImpl() [1/2]

slideshow::internal::ShapeManagerImpl::ShapeManagerImpl ( EventMultiplexer rMultiplexer,
LayerManagerSharedPtr  xLayerManager,
CursorManager &  rCursorManager,
const ShapeEventListenerMap rGlobalListenersMap,
const ShapeCursorMap rGlobalCursorMap,
const css::uno::Reference< css::drawing::XDrawPage > &  xDrawPage 
)

Create a shape event broadcaster.

Parameters
rEventMultiplexerThe slideshow-global event source, where this class registers its event handlers.

◆ ShapeManagerImpl() [2/2]

slideshow::internal::ShapeManagerImpl::ShapeManagerImpl ( const ShapeManagerImpl )
delete

Forbid copy construction.

Member Function Documentation

◆ activate()

void slideshow::internal::ShapeManagerImpl::activate ( )

Enables event listening.

The initial slide content on the background layer is already rendered (e.g. from a previous slide transition).

Definition at line 60 of file shapemanagerimpl.cxx.

References mpLayerManager, and mrMultiplexer.

◆ addHyperlinkArea()

void slideshow::internal::ShapeManagerImpl::addHyperlinkArea ( const HyperlinkAreaSharedPtr rArea)
overrideprivatevirtual

Register given shape as a hyperlink target.

Parameters
rAreaHyperlink sensitive area. Will participate in hyperlink region lookup. Must be in absolute user space coordinates.

Implements slideshow::internal::ShapeManager.

Definition at line 274 of file shapemanagerimpl.cxx.

◆ addIntrinsicAnimationHandler()

void slideshow::internal::ShapeManagerImpl::addIntrinsicAnimationHandler ( const IntrinsicAnimationEventHandlerSharedPtr rHandler)
overrideprivatevirtual

Register an event handler that will be called when user paint parameters change.

Parameters
rHandlerHandler to call when a shape listener changes

Implements slideshow::internal::SubsettableShapeManager.

Definition at line 402 of file shapemanagerimpl.cxx.

◆ checkForHyperlink()

OUString slideshow::internal::ShapeManagerImpl::checkForHyperlink ( ::basegfx::B2DPoint const &  hitPos) const
private

◆ checkForImageMap()

OUString slideshow::internal::ShapeManagerImpl::checkForImageMap ( css::awt::MouseEvent const &  evt) const
private

◆ cursorChanged()

void slideshow::internal::ShapeManagerImpl::cursorChanged ( const css::uno::Reference< css::drawing::XShape > &  xShape,
sal_Int16  nCursor 
)
private

Definition at line 331 of file shapemanagerimpl.cxx.

◆ deactivate()

void slideshow::internal::ShapeManagerImpl::deactivate ( )

Disables event listening.

Definition at line 85 of file shapemanagerimpl.cxx.

References mpLayerManager, and mrMultiplexer.

◆ dispose()

void slideshow::internal::ShapeManagerImpl::dispose ( )
overridevirtual

Dispose all object references.

An implementor of this method must first call dispose() on any of its external references, and release them after that.

Implements slideshow::internal::Disposable.

Definition at line 103 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ enterAnimationMode()

void slideshow::internal::ShapeManagerImpl::enterAnimationMode ( const AnimatableShapeSharedPtr rShape)
overrideprivatevirtual

Notify the ShapeManager that the given Shape starts an animation now.

This method enters animation mode for the Shape. If the shape is already in animation mode, the call is counted, and the shape only leaves animation mode after a corresponding number of leaveAnimationMode() calls.

Implements slideshow::internal::ShapeManager.

Definition at line 242 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ getSubsetShape()

AttributableShapeSharedPtr slideshow::internal::ShapeManagerImpl::getSubsetShape ( const AttributableShapeSharedPtr rOrigShape,
const DocTreeNode rTreeNode 
)
overrideprivatevirtual

Query a subset of the given original shape.

This method queries a new (but not necessarily unique) shape, which displays only the given subset of the original one. Calling this method multiple times with the same original shape and DocTreeNode content always returns the same shape.

Requesting a subset from an original shape leads to the original shape ceasing to display the subsetted content. In other words, shape content is always displayed in exactly one shape.

Parameters
rOrigShapeThe shape the subset is to be created for
rSubsetShapeThe subset to display in the generated shape.

Implements slideshow::internal::SubsettableShapeManager.

Definition at line 279 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ getXShapeToShapeMap()

const XShapeToShapeMap & slideshow::internal::ShapeManagerImpl::getXShapeToShapeMap ( ) const
overrideprivatevirtual

Get a map that maps all Shapes with their XShape reference as the key.

Returns
an unordered map that contains all shapes in the current page with their XShape reference as the key

Implements slideshow::internal::ShapeManager.

Definition at line 268 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ handleMouseDragged()

bool slideshow::internal::ShapeManagerImpl::handleMouseDragged ( css::awt::MouseEvent const &  e)
overrideprivatevirtual

Handle a mouse was moved with a pressed button event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the pause event. When this method returns false, possibly other, less prioritized handlers are called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 178 of file shapemanagerimpl.cxx.

◆ handleMouseMoved()

bool slideshow::internal::ShapeManagerImpl::handleMouseMoved ( css::awt::MouseEvent const &  e)
overrideprivatevirtual

Handle a mouse was moved event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the pause event. When this method returns false, possibly other, less prioritized handlers are called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 184 of file shapemanagerimpl.cxx.

References mrCursorManager.

◆ handleMousePressed()

bool slideshow::internal::ShapeManagerImpl::handleMousePressed ( css::awt::MouseEvent const &  e)
overrideprivatevirtual

Handle a mouse button pressed event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the mouse event. When this method returns false, possibly other, less prioritized handlers can be called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 114 of file shapemanagerimpl.cxx.

◆ handleMouseReleased()

bool slideshow::internal::ShapeManagerImpl::handleMouseReleased ( css::awt::MouseEvent const &  e)
overrideprivatevirtual

Handle a mouse button released event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the pause event. When this method returns false, possibly other, less prioritized handlers are called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 120 of file shapemanagerimpl.cxx.

References comphelper::getProcessComponentContext(), and mrMultiplexer.

◆ leaveAnimationMode()

void slideshow::internal::ShapeManagerImpl::leaveAnimationMode ( const AnimatableShapeSharedPtr rShape)
overrideprivatevirtual

Notify the ShapeManager that the given Shape is no longer animated.

When called a corresponding number of times as enterAnimationMode() for a given shape, this methods ends animation mode for the given Shape. It is illegal to call this method more often than enterAnimationMode().

Implements slideshow::internal::ShapeManager.

Definition at line 248 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ listenerAdded()

bool slideshow::internal::ShapeManagerImpl::listenerAdded ( const css::uno::Reference< css::drawing::XShape > &  xShape)
overrideprivatevirtual

◆ listenerRemoved()

bool slideshow::internal::ShapeManagerImpl::listenerRemoved ( const css::uno::Reference< css::drawing::XShape > &  xShape)
overrideprivatevirtual

◆ lookupShape()

ShapeSharedPtr slideshow::internal::ShapeManagerImpl::lookupShape ( css::uno::Reference< css::drawing::XShape > const &  xShape) const
overrideprivatevirtual

Lookup a Shape from an XShape model object.

This method looks up the internal shape map for one representing the given XShape.

Parameters
xShapeThe XShape object, for which the representing Shape should be looked up.

Implements slideshow::internal::ShapeManager.

Definition at line 260 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ needsUpdate()

bool slideshow::internal::ShapeManagerImpl::needsUpdate ( ) const
overrideprivatevirtual

Query whether updates are pending.

Returns
true, if updates are pending. Calling update() subsequently will perform the pending update then.

Implements slideshow::internal::ViewUpdate.

Definition at line 234 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ notifyIntrinsicAnimationsDisabled()

void slideshow::internal::ShapeManagerImpl::notifyIntrinsicAnimationsDisabled ( )
overrideprivatevirtual

Notify that shape-intrinsic animations are now disabled.

Implements slideshow::internal::SubsettableShapeManager.

Definition at line 418 of file shapemanagerimpl.cxx.

◆ notifyIntrinsicAnimationsEnabled()

void slideshow::internal::ShapeManagerImpl::notifyIntrinsicAnimationsEnabled ( )
overrideprivatevirtual

Notify that shape-intrinsic animations are now enabled.

Implements slideshow::internal::SubsettableShapeManager.

Definition at line 412 of file shapemanagerimpl.cxx.

◆ notifyShapeUpdate()

void slideshow::internal::ShapeManagerImpl::notifyShapeUpdate ( const ShapeSharedPtr rShape)
overrideprivatevirtual

Notify that a shape needs an update.

This method notifies the ShapeManager that a shape update is necessary. Use this if e.g. a running animation changed the shape appearance.

Parameters
rShapeShape which needs an update

Implements slideshow::internal::ShapeManager.

Definition at line 254 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ operator=()

ShapeManagerImpl & slideshow::internal::ShapeManagerImpl::operator= ( const ShapeManagerImpl )
delete

Forbid copy assignment.

◆ removeIntrinsicAnimationHandler()

void slideshow::internal::ShapeManagerImpl::removeIntrinsicAnimationHandler ( const IntrinsicAnimationEventHandlerSharedPtr rHandler)
overrideprivatevirtual

◆ revokeSubset()

void slideshow::internal::ShapeManagerImpl::revokeSubset ( const AttributableShapeSharedPtr rOrigShape,
const AttributableShapeSharedPtr rSubsetShape 
)
overrideprivatevirtual

Revoke a previously queried subset shape.

With this method, a previously requested subset shape is revoked again. If the last client revokes a given subset, it will cease to be displayed, and the original shape will again show the subset data.

Parameters
rOrigShapeThe shape the subset was created from
rSubsetShapeThe subset created from rOrigShape

Implements slideshow::internal::SubsettableShapeManager.

Definition at line 288 of file shapemanagerimpl.cxx.

References mpLayerManager.

◆ update()

bool slideshow::internal::ShapeManagerImpl::update ( )
overrideprivatevirtual

Perform the update action on all views.

Returns
true, if the update was performed successfully, false otherwise.

Implements slideshow::internal::ViewUpdate.

Definition at line 226 of file shapemanagerimpl.cxx.

References mpLayerManager.

Member Data Documentation

◆ maHyperlinkShapes

AreaSet slideshow::internal::ShapeManagerImpl::maHyperlinkShapes
private

Definition at line 179 of file shapemanagerimpl.hxx.

◆ maIntrinsicAnimationEventHandlers

ImplIntrinsicAnimationEventHandlers slideshow::internal::ShapeManagerImpl::maIntrinsicAnimationEventHandlers
private

Definition at line 180 of file shapemanagerimpl.hxx.

◆ maShapeCursorMap

ShapeToCursorMap slideshow::internal::ShapeManagerImpl::maShapeCursorMap
private

Definition at line 178 of file shapemanagerimpl.hxx.

◆ maShapeListenerMap

ShapeToListenersMap slideshow::internal::ShapeManagerImpl::maShapeListenerMap
private

Definition at line 177 of file shapemanagerimpl.hxx.

◆ mbEnabled

bool slideshow::internal::ShapeManagerImpl::mbEnabled
private

Definition at line 181 of file shapemanagerimpl.hxx.

◆ mpLayerManager

LayerManagerSharedPtr slideshow::internal::ShapeManagerImpl::mpLayerManager
private

Definition at line 173 of file shapemanagerimpl.hxx.

◆ mrCursorManager

CursorManager& slideshow::internal::ShapeManagerImpl::mrCursorManager
private

Definition at line 174 of file shapemanagerimpl.hxx.

◆ mrGlobalCursorMap

const ShapeCursorMap& slideshow::internal::ShapeManagerImpl::mrGlobalCursorMap
private

Definition at line 176 of file shapemanagerimpl.hxx.

◆ mrGlobalListenersMap

const ShapeEventListenerMap& slideshow::internal::ShapeManagerImpl::mrGlobalListenersMap
private

Definition at line 175 of file shapemanagerimpl.hxx.

◆ mrMultiplexer

EventMultiplexer& slideshow::internal::ShapeManagerImpl::mrMultiplexer
private

Definition at line 172 of file shapemanagerimpl.hxx.

◆ mxDrawPage

const css::uno::Reference<css::drawing::XDrawPage> slideshow::internal::ShapeManagerImpl::mxDrawPage
private

Definition at line 182 of file shapemanagerimpl.hxx.


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