1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SlideRenderer.hxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SD_PRESENTER_SLIDE_PREVIEW_HXX
33 #define SD_PRESENTER_SLIDE_PREVIEW_HXX
35 #include "PreviewRenderer.hxx"
36 #include <com/sun/star/drawing/XDrawPage.hpp>
37 #include <com/sun/star/drawing/XSlideRenderer.hpp>
38 #include <com/sun/star/lang/XInitialization.hpp>
39 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
40 #include <cppuhelper/basemutex.hxx>
41 #include <cppuhelper/compbase2.hxx>
42 #include <boost/noncopyable.hpp>
44 namespace css
= ::com::sun::star
;
46 namespace sd
{ namespace presenter
{
49 typedef ::cppu::WeakComponentImplHelper2
<
50 css::drawing::XSlideRenderer
,
51 css::lang::XInitialization
52 > SlideRendererInterfaceBase
;
56 /** Render single slides into bitmaps.
59 : private ::boost::noncopyable
,
60 protected ::cppu::BaseMutex
,
61 public SlideRendererInterfaceBase
64 explicit SlideRenderer (const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
);
65 virtual ~SlideRenderer (void);
66 virtual void SAL_CALL
disposing (void);
71 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
)
72 throw (css::uno::Exception
, css::uno::RuntimeException
);
77 virtual css::uno::Reference
<css::awt::XBitmap
> SAL_CALL
createPreview (
78 const ::css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
79 const css::awt::Size
& rMaximumPreviewPixelSize
,
80 sal_Int16 nSuperSampleFactor
)
81 throw (css::uno::RuntimeException
);
83 virtual css::uno::Reference
<css::rendering::XBitmap
> SAL_CALL
createPreviewForCanvas (
84 const ::css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
85 const css::awt::Size
& rMaximumPreviewPixelSize
,
86 sal_Int16 nSuperSampleFactor
,
87 const ::css::uno::Reference
<css::rendering::XCanvas
>& rxCanvas
)
88 throw (css::uno::RuntimeException
);
90 virtual css::awt::Size SAL_CALL
calculatePreviewSize (
91 double nSlideAspectRatio
,
92 const css::awt::Size
& rMaximumPreviewPixelSize
)
93 throw (css::uno::RuntimeException
);
96 PreviewRenderer maPreviewRenderer
;
98 BitmapEx
CreatePreview (
99 const ::css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
100 const css::awt::Size
& rMaximumPreviewPixelSize
,
101 sal_Int16 nSuperSampleFactor
)
102 throw (css::uno::RuntimeException
);
104 /** This method throws a DisposedException when the object has already been
107 void ThrowIfDisposed (void) throw (css::lang::DisposedException
);
110 } } // end of namespace ::sd::presenter