21#include <com/sun/star/beans/XPropertySet.hpp>
25#include <osl/diagnose.h>
55 class BackgroundShape :
public Shape
64 BackgroundShape(
const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage,
65 const css::uno::Reference< css::drawing::XDrawPage >& xMasterPage,
66 const SlideShowContext& rContext );
68 virtual css::uno::Reference<
69 css::drawing::XShape > getXShape()
const override;
75 bool bRedrawLayer )
override;
77 virtual void clearAllViewLayers()
override;
83 virtual ::basegfx::B2DRectangle getBounds()
const override;
84 virtual ::basegfx::B2DRectangle getDomBounds()
const override;
85 virtual ::basegfx::B2DRectangle getUpdateArea()
const override;
86 virtual bool isVisible()
const override;
87 virtual double getPriority()
const override;
88 virtual bool isForeground()
const override {
return false; }
89 virtual bool isBackgroundDetached()
const override;
95 virtual bool update()
const override;
96 virtual bool render()
const override;
97 virtual bool isContentChanged()
const override;
107 typedef ::std::vector< ViewBackgroundShapeSharedPtr > ViewBackgroundShapeVector;
113 BackgroundShape::BackgroundShape(
const uno::Reference< drawing::XDrawPage >& xDrawPage,
114 const uno::Reference< drawing::XDrawPage >& xMasterPage,
115 const SlideShowContext& rContext ) :
120 uno::Reference< beans::XPropertySet > xPropSet( xDrawPage,
121 uno::UNO_QUERY_THROW );
126 rContext.mxComponentContext);
130 xMtf =
getMetaFile( uno::Reference<lang::XComponent>(xMasterPage, uno::UNO_QUERY),
132 rContext.mxComponentContext );
137 throw ShapeLoadFailedException();
143 sal_Int32 nDocWidth=0;
144 sal_Int32 nDocHeight=0;
145 xPropSet->getPropertyValue(
"Width") >>= nDocWidth;
146 xPropSet->getPropertyValue(
"Height") >>= nDocHeight;
152 uno::Reference< drawing::XShape > BackgroundShape::getXShape()
const
155 return uno::Reference< drawing::XShape >();
165 { return pBgShape->getViewLayer() == rNewLayer; } ) )
172 std::make_shared<ViewBackgroundShape>(
182 const ViewBackgroundShapeVector::iterator aEnd(
maViewShapes.end() );
187 { return pBgShape->getViewLayer() == rLayer; } ) < 2,
188 "BackgroundShape::removeViewLayer(): Duplicate ViewLayer entries!" );
190 ViewBackgroundShapeVector::iterator aIter;
195 { return pBgShape->getViewLayer() == rLayer; } )) == aEnd )
207 void BackgroundShape::clearAllViewLayers()
231 bool BackgroundShape::isVisible()
const
236 double BackgroundShape::getPriority()
const
241 bool BackgroundShape::update()
const
246 bool BackgroundShape::render()
const
248 SAL_INFO(
"slideshow",
"::presentation::internal::BackgroundShape::render()" );
249 SAL_INFO(
"slideshow",
"::presentation::internal::BackgroundShape: 0x" << std::hex <<
this );
252 const ::basegfx::B2DRectangle& rCurrBounds( BackgroundShape::getBounds() );
254 if( rCurrBounds.getRange().equalZero() )
265 { return pBgShape->render( this->mpMtf ); } ))
276 bool BackgroundShape::isContentChanged()
const
281 bool BackgroundShape::isBackgroundDetached()
const
292 return std::make_shared<BackgroundShape>(
GDIMetaFileSharedPtr mpMtf
The metafile actually representing the Shape.
::basegfx::B2DRectangle maBounds
ViewBackgroundShapeVector maViewShapes
::std::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr
#define SAL_INFO(area, stream)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
@ MTF_LOAD_BACKGROUND_ONLY
retrieve a meta file for the page background only
std::shared_ptr< ViewLayer > ViewLayerSharedPtr
ShapeSharedPtr createBackgroundShape(const uno::Reference< drawing::XDrawPage > &xDrawPage, const uno::Reference< drawing::XDrawPage > &xMasterPage, const SlideShowContext &rContext)
::std::shared_ptr< ViewBackgroundShape > ViewBackgroundShapeSharedPtr
GDIMetaFileSharedPtr getMetaFile(const uno::Reference< lang::XComponent > &xSource, const uno::Reference< drawing::XDrawPage > &xContainingPage, int mtfLoadFlags, const uno::Reference< uno::XComponentContext > &rxContext)
::std::shared_ptr< Shape > ShapeSharedPtr
Common arguments for slideshow objects.