LibreOffice Module slideshow (master) 1
Classes | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
slideshow::internal::ExternalShapeBase Class Referenceabstract

Base class for shapes rendered by external engines. More...

#include <externalshapebase.hxx>

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

Classes

class  ExternalShapeBaseListener
 

Public Member Functions

 ExternalShapeBase (const css::uno::Reference< css::drawing::XShape > &xShape, double nPrio, const SlideShowContext &rContext)
 Create a shape for the given XShape for an external shape. More...
 
virtual ~ExternalShapeBase () override
 
virtual css::uno::Reference< css::drawing::XShape > getXShape () const override
 Get the associated XShape of this shape. More...
 
virtual void play () override
 Notify the Shape that it should start with playback. More...
 
virtual void stop () override
 Notify the Shape that it should stop playback. More...
 
virtual void pause () override
 Notify the Shape that it should pause playback. More...
 
virtual bool isPlaying () const override
 Query whether the media is currently playing. More...
 
virtual void setMediaTime (double) override
 Set media time in seconds. More...
 
void setLooping (bool bLooping) override
 
virtual bool update () const override
 Update the shape. More...
 
virtual bool render () const override
 Render the shape. More...
 
virtual bool isContentChanged () const override
 Query whether shape content changed. More...
 
virtual ::basegfx::B2DRectangle getBounds () const override
 Get the current shape position and size. More...
 
virtual ::basegfx::B2DRectangle getDomBounds () const override
 Get the DOM position and size of the shape. More...
 
virtual ::basegfx::B2DRectangle getUpdateArea () const override
 Get the current shape update area. More...
 
virtual bool isVisible () const override
 Query whether the shape is visible at all. More...
 
virtual double getPriority () const override
 Get the shape priority. More...
 
virtual bool isBackgroundDetached () const override
 Query whether the Shape is currently detached from the background. More...
 
virtual void play ()=0
 Notify the Shape that it should start with playback. More...
 
virtual void stop ()=0
 Notify the Shape that it should stop playback. More...
 
virtual void pause ()=0
 Notify the Shape that it should pause playback. More...
 
virtual bool isPlaying () const =0
 Query whether the media is currently playing. More...
 
virtual void setMediaTime (double fTime)=0
 Set media time in seconds. More...
 
virtual void setLooping (bool)
 
- Public Member Functions inherited from slideshow::internal::Shape
 Shape ()
 
virtual ~Shape ()
 
 Shape (const Shape &)=delete
 
Shapeoperator= (const Shape &)=delete
 
virtual css::uno::Reference< css::drawing::XShape > getXShape () const =0
 Get the associated XShape of this shape. More...
 
virtual void addViewLayer (const ViewLayerSharedPtr &rNewLayer, bool bRedrawLayer)=0
 Add a new view layer. More...
 
virtual bool removeViewLayer (const ViewLayerSharedPtr &rNewLayer)=0
 Withdraw the shape from a view layer. More...
 
virtual void clearAllViewLayers ()=0
 Withdraw all view layers at once. More...
 
virtual bool update () const =0
 Update the shape. More...
 
virtual bool render () const =0
 Render the shape. More...
 
virtual bool isContentChanged () const =0
 Query whether shape content changed. More...
 
virtual ::basegfx::B2DRectangle getBounds () const =0
 Get the current shape position and size. More...
 
virtual ::basegfx::B2DRectangle getDomBounds () const =0
 Get the DOM position and size of the shape. More...
 
virtual ::basegfx::B2DRectangle getUpdateArea () const =0
 Get the current shape update area. More...
 
virtual bool isVisible () const =0
 Query whether the shape is visible at all. More...
 
virtual double getPriority () const =0
 Get the shape priority. More...
 
virtual bool isBackgroundDetached () const =0
 Query whether the Shape is currently detached from the background. More...
 
virtual bool isForeground () const
 Check whether the shape belongs to the foreground. More...
 
virtual void setIsForeground (const bool bIsForeground)
 Set the flag that holds whether the shape is in the foreground or not. More...
 

Protected Attributes

const css::uno::Reference< css::uno::XComponentContext > mxComponentContext
 

Private Member Functions

virtual bool implRender (const ::basegfx::B2DRange &rCurrBounds) const =0
 override in derived class to render preview More...
 
virtual void implViewChanged (const UnoViewSharedPtr &rView)=0
 override in derived class to resize More...
 
virtual void implViewsChanged ()=0
 override in derived class to resize More...
 
virtual bool implStartIntrinsicAnimation ()=0
 override in derived class to start external viewer More...
 
virtual bool implEndIntrinsicAnimation ()=0
 override in derived class to stop external viewer More...
 
virtual void implPauseIntrinsicAnimation ()=0
 override in derived class to pause external viewer More...
 
virtual bool implIsIntrinsicAnimationPlaying () const =0
 override in derived class to return status of animation More...
 
virtual void implSetIntrinsicAnimationTime (double)=0
 override in derived class to set media time More...
 
virtual void implSetLooping (bool)
 

Private Attributes

css::uno::Reference< css::drawing::XShape > mxShape
 The associated XShape. More...
 
std::shared_ptr< ExternalShapeBaseListenermpListener
 
SubsettableShapeManagerSharedPtr mpShapeManager
 
EventMultiplexermrEventMultiplexer
 
const double mnPriority
 
::basegfx::B2DRectangle maBounds
 

Friends

class ExternalShapeBaseListener
 

Detailed Description

Base class for shapes rendered by external engines.

Used as the common base for e.g. MediaShape or AppletShape, all of which are rendered by external components (and all employ distinct windows).

Please note that this base class indeed assumes the shape does not interfere with the internal shapes in any way (including mutual overdraw). It therefore reports yes for the isBackgroundDetached() question.

Definition at line 41 of file externalshapebase.hxx.

Constructor & Destructor Documentation

◆ ExternalShapeBase()

slideshow::internal::ExternalShapeBase::ExternalShapeBase ( const css::uno::Reference< css::drawing::XShape > &  xShape,
double  nPrio,
const SlideShowContext rContext 
)

Create a shape for the given XShape for an external shape.

Parameters
xShapeThe XShape to represent.
nPrioExternally-determined shape priority (used e.g. for paint ordering). This number must be unique!

Definition at line 79 of file externalshapebase.cxx.

References slideshow::internal::EventMultiplexer::addViewHandler(), ENSURE_OR_THROW, make_shared(), mpListener, mpShapeManager, mrEventMultiplexer, mxComponentContext, and mxShape.

◆ ~ExternalShapeBase()

slideshow::internal::ExternalShapeBase::~ExternalShapeBase ( )
overridevirtual

Member Function Documentation

◆ getBounds()

basegfx::B2DRectangle slideshow::internal::ExternalShapeBase::getBounds ( ) const
overridevirtual

Get the current shape position and size.

This method yields the currently effective shape bounds (which might change over time, for animated shapes). Please note that possibly shape rotations from its original document state must not be taken into account here: if you need the screen bounding box, use getUpdateArea() instead. Note further that shape rotations, which are already contained in the shape as displayed in the original document are included herein (we currently take the shape as-is from the document, assuming a rotation angle of 0).

Implements slideshow::internal::Shape.

Definition at line 173 of file externalshapebase.cxx.

References maBounds.

◆ getDomBounds()

basegfx::B2DRectangle slideshow::internal::ExternalShapeBase::getDomBounds ( ) const
overridevirtual

Get the DOM position and size of the shape.

This method yields the underlying DOM shape bounds, i.e. the original shape bounds from the document model. This value is always unaffected by any animation activity. Note that shape rotations, which are already contained in the shape as displayed in the original document are already included herein (we currently take the shape as-is from the document, assuming a rotation angle of 0).

Implements slideshow::internal::Shape.

Definition at line 179 of file externalshapebase.cxx.

References maBounds.

◆ getPriority()

double slideshow::internal::ExternalShapeBase::getPriority ( ) const
overridevirtual

Get the shape priority.

The shape priority defines the relative order of the shapes on the slide.

Returns
the priority. Will be in the [0,+infty) range.

Implements slideshow::internal::Shape.

Definition at line 197 of file externalshapebase.cxx.

References mnPriority.

◆ getUpdateArea()

basegfx::B2DRectangle slideshow::internal::ExternalShapeBase::getUpdateArea ( ) const
overridevirtual

Get the current shape update area.

This method yields the currently effective update area for the shape, i.e. the area that needs to be updated, should the shape be painted. Normally, this will be the (possibly rotated and sheared) area returned by getBounds().

Implements slideshow::internal::Shape.

Definition at line 185 of file externalshapebase.cxx.

References maBounds.

◆ getXShape()

uno::Reference< drawing::XShape > slideshow::internal::ExternalShapeBase::getXShape ( ) const
overridevirtual

Get the associated XShape of this shape.

Returns
the associated XShape. If this method returns an empty reference, this object might be one of the special-purpose shapes of a slide, which have no direct corresponding XShape (the background comes to mind here).

Implements slideshow::internal::Shape.

Definition at line 111 of file externalshapebase.cxx.

References mxShape.

◆ implEndIntrinsicAnimation()

virtual bool slideshow::internal::ExternalShapeBase::implEndIntrinsicAnimation ( )
privatepure virtual

override in derived class to stop external viewer

Referenced by slideshow::internal::ExternalShapeBase::ExternalShapeBaseListener::disableAnimations(), and stop().

◆ implIsIntrinsicAnimationPlaying()

virtual bool slideshow::internal::ExternalShapeBase::implIsIntrinsicAnimationPlaying ( ) const
privatepure virtual

override in derived class to return status of animation

Referenced by isPlaying().

◆ implPauseIntrinsicAnimation()

virtual void slideshow::internal::ExternalShapeBase::implPauseIntrinsicAnimation ( )
privatepure virtual

override in derived class to pause external viewer

Referenced by pause().

◆ implRender()

virtual bool slideshow::internal::ExternalShapeBase::implRender ( const ::basegfx::B2DRange rCurrBounds) const
privatepure virtual

override in derived class to render preview

Referenced by render().

◆ implSetIntrinsicAnimationTime()

virtual void slideshow::internal::ExternalShapeBase::implSetIntrinsicAnimationTime ( double  )
privatepure virtual

override in derived class to set media time

Referenced by setMediaTime().

◆ implSetLooping()

virtual void slideshow::internal::ExternalShapeBase::implSetLooping ( bool  )
inlineprivatevirtual

Definition at line 112 of file externalshapebase.hxx.

Referenced by setLooping().

◆ implStartIntrinsicAnimation()

virtual bool slideshow::internal::ExternalShapeBase::implStartIntrinsicAnimation ( )
privatepure virtual

override in derived class to start external viewer

Referenced by slideshow::internal::ExternalShapeBase::ExternalShapeBaseListener::enableAnimations(), and play().

◆ implViewChanged()

virtual void slideshow::internal::ExternalShapeBase::implViewChanged ( const UnoViewSharedPtr rView)
privatepure virtual

◆ implViewsChanged()

virtual void slideshow::internal::ExternalShapeBase::implViewsChanged ( )
privatepure virtual

◆ isBackgroundDetached()

bool slideshow::internal::ExternalShapeBase::isBackgroundDetached ( ) const
overridevirtual

Query whether the Shape is currently detached from the background.

This method checks whether the Shape is currently detached from the slide background, i.e. whether shape updates affect the underlying slide background or not. A shape that returns true here must not alter slide content in any way when called render() or update() (this is normally achieved by making this shape a sprite).

Implements slideshow::internal::Shape.

Definition at line 203 of file externalshapebase.cxx.

◆ isContentChanged()

bool slideshow::internal::ExternalShapeBase::isContentChanged ( ) const
overridevirtual

Query whether shape content changed.

This method returns true, if shape content changed since the last rendering (i.e. the shape needs an update to reflect that changed content on the views).

Implements slideshow::internal::Shape.

Definition at line 167 of file externalshapebase.cxx.

◆ isPlaying()

bool slideshow::internal::ExternalShapeBase::isPlaying ( ) const
overridevirtual

Query whether the media is currently playing.

Implements slideshow::internal::IExternalMediaShapeBase.

Definition at line 135 of file externalshapebase.cxx.

References implIsIntrinsicAnimationPlaying().

◆ isVisible()

bool slideshow::internal::ExternalShapeBase::isVisible ( ) const
overridevirtual

Query whether the shape is visible at all.

Returns
true, if this shape is visible, false otherwise.

Implements slideshow::internal::Shape.

Definition at line 191 of file externalshapebase.cxx.

◆ pause()

void slideshow::internal::ExternalShapeBase::pause ( )
overridevirtual

Notify the Shape that it should pause playback.

This method stops playback on all registered views. The media stays visible (for videos)

Implements slideshow::internal::IExternalMediaShapeBase.

Definition at line 129 of file externalshapebase.cxx.

References implPauseIntrinsicAnimation().

◆ play()

void slideshow::internal::ExternalShapeBase::play ( )
overridevirtual

Notify the Shape that it should start with playback.

This method enters playback mode on all registered views. It makes the media initially visible (for videos).

Implements slideshow::internal::IExternalMediaShapeBase.

Definition at line 117 of file externalshapebase.cxx.

References implStartIntrinsicAnimation().

◆ render()

bool slideshow::internal::ExternalShapeBase::render ( ) const
overridevirtual

Render the shape.

This method renders the shape on all registered view layers, regardless of whether shape content has changed or not.

Returns
whether the rendering finished successfully.

Implements slideshow::internal::Shape.

Definition at line 154 of file externalshapebase.cxx.

References basegfx::Tuple2D< typename TYPE >::equalZero(), basegfx::B2DRange::getRange(), implRender(), and maBounds.

Referenced by update().

◆ setLooping()

void slideshow::internal::ExternalShapeBase::setLooping ( bool  bLooping)
overridevirtual

Reimplemented from slideshow::internal::IExternalMediaShapeBase.

Definition at line 146 of file externalshapebase.cxx.

References implSetLooping().

◆ setMediaTime()

void slideshow::internal::ExternalShapeBase::setMediaTime ( double  fTime)
overridevirtual

Set media time in seconds.

Parameters
fTimeTime in seconds of the media time line, that should now be presented

Implements slideshow::internal::IExternalMediaShapeBase.

Definition at line 141 of file externalshapebase.cxx.

References implSetIntrinsicAnimationTime().

◆ stop()

void slideshow::internal::ExternalShapeBase::stop ( )
overridevirtual

Notify the Shape that it should stop playback.

This method leaves playback mode on all registered views. The media is then rewound to the start, and removed from screen (for videos)

Implements slideshow::internal::IExternalMediaShapeBase.

Definition at line 123 of file externalshapebase.cxx.

References implEndIntrinsicAnimation().

◆ update()

bool slideshow::internal::ExternalShapeBase::update ( ) const
overridevirtual

Update the shape.

This method updates the Shape on all registered view layers, but only if shape content has actually changed.

Returns
whether the update finished successfully.

Implements slideshow::internal::Shape.

Definition at line 148 of file externalshapebase.cxx.

References render().

Friends And Related Function Documentation

◆ ExternalShapeBaseListener

friend class ExternalShapeBaseListener
friend

Definition at line 92 of file externalshapebase.hxx.

Member Data Documentation

◆ maBounds

::basegfx::B2DRectangle slideshow::internal::ExternalShapeBase::maBounds
private

Definition at line 125 of file externalshapebase.hxx.

Referenced by getBounds(), getDomBounds(), getUpdateArea(), and render().

◆ mnPriority

const double slideshow::internal::ExternalShapeBase::mnPriority
private

Definition at line 124 of file externalshapebase.hxx.

Referenced by getPriority().

◆ mpListener

std::shared_ptr<ExternalShapeBaseListener> slideshow::internal::ExternalShapeBase::mpListener
private

Definition at line 118 of file externalshapebase.hxx.

Referenced by ExternalShapeBase(), and ~ExternalShapeBase().

◆ mpShapeManager

SubsettableShapeManagerSharedPtr slideshow::internal::ExternalShapeBase::mpShapeManager
private

Definition at line 120 of file externalshapebase.hxx.

Referenced by ExternalShapeBase(), and ~ExternalShapeBase().

◆ mrEventMultiplexer

EventMultiplexer& slideshow::internal::ExternalShapeBase::mrEventMultiplexer
private

Definition at line 121 of file externalshapebase.hxx.

Referenced by ExternalShapeBase(), and ~ExternalShapeBase().

◆ mxComponentContext

const css::uno::Reference<css::uno::XComponentContext> slideshow::internal::ExternalShapeBase::mxComponentContext
protected

Definition at line 89 of file externalshapebase.hxx.

◆ mxShape

css::uno::Reference< css::drawing::XShape > slideshow::internal::ExternalShapeBase::mxShape
private

The associated XShape.

Definition at line 116 of file externalshapebase.hxx.

Referenced by ExternalShapeBase(), and getXShape().


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