21#include <com/sun/star/drawing/XShape.hpp>
23#include <osl/diagnose.h>
47 class MediaShape :
public ExternalShapeBase
59 MediaShape(
const css::uno::Reference< css::drawing::XShape >& xShape,
61 const SlideShowContext& rContext );
69 bool bRedrawLayer )
override;
71 virtual void clearAllViewLayers()
override;
77 virtual bool implRender( const ::basegfx::B2DRange& rCurrBounds )
const override;
79 virtual void implViewsChanged()
override;
80 virtual bool implStartIntrinsicAnimation()
override;
81 virtual bool implEndIntrinsicAnimation()
override;
82 virtual void implPauseIntrinsicAnimation()
override;
83 virtual bool implIsIntrinsicAnimationPlaying()
const override;
84 virtual void implSetIntrinsicAnimationTime(
double)
override;
85 void implSetLooping(
bool bLooping)
override;
88 typedef ::std::vector< ViewMediaShapeSharedPtr > ViewMediaShapeVector;
95 MediaShape::MediaShape(
const uno::Reference< drawing::XShape >& xShape,
97 const SlideShowContext& rContext ) :
98 ExternalShapeBase( xShape, nPrio, rContext ),
107 const ::basegfx::B2DRectangle& rBounds = getBounds();
110 if( pViewMediaShape->getViewLayer()->isOnView( rView ) )
111 pViewMediaShape->resize( rBounds );
115 void MediaShape::implViewsChanged()
117 const ::basegfx::B2DRectangle& rBounds = getBounds();
120 pViewMediaShape->resize( rBounds );
128 std::make_shared<ViewMediaShape>( rNewLayer,
130 mxComponentContext ));
149 { return rLayer == pShape->getViewLayer(); } ) < 2,
150 "MediaShape::removeViewLayer(): Duplicate ViewLayer entries!" );
152 ViewMediaShapeVector::iterator aIter;
158 { return rLayer == pShape->getViewLayer(); } ) ) == aEnd )
171 void MediaShape::clearAllViewLayers()
177 bool MediaShape::implRender( const ::basegfx::B2DRange& rCurrBounds )
const
184 { return pShape->render( rCurrBounds ); } ))
196 bool MediaShape::implStartIntrinsicAnimation()
199 pViewMediaShape->startMedia();
207 bool MediaShape::implEndIntrinsicAnimation()
210 pViewMediaShape->endMedia();
218 void MediaShape::implPauseIntrinsicAnimation()
221 pViewMediaShape->pauseMedia();
227 bool MediaShape::implIsIntrinsicAnimationPlaying()
const
233 void MediaShape::implSetIntrinsicAnimationTime(
double fTime)
236 pViewMediaShape->setMediaTime( fTime );
239 void MediaShape::implSetLooping(
bool bLooping)
243 pViewMediaShape->setLooping(bLooping);
252 return std::make_shared<MediaShape>(xShape, nPrio, rContext);
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
ShapeSharedPtr createMediaShape(const uno::Reference< drawing::XShape > &xShape, double nPrio, const SlideShowContext &rContext)
std::shared_ptr< ViewLayer > ViewLayerSharedPtr
::std::shared_ptr< ViewMediaShape > ViewMediaShapeSharedPtr
::std::shared_ptr< Shape > ShapeSharedPtr
std::shared_ptr< UnoView > UnoViewSharedPtr
Common arguments for slideshow objects.