1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SD_PRESENTER_SLIDE_PREVIEW_HXX
21 #define SD_PRESENTER_SLIDE_PREVIEW_HXX
23 #include "PreviewRenderer.hxx"
24 #include <com/sun/star/drawing/XDrawPage.hpp>
25 #include <com/sun/star/drawing/XSlideRenderer.hpp>
26 #include <com/sun/star/lang/XInitialization.hpp>
27 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
28 #include <cppuhelper/basemutex.hxx>
29 #include <cppuhelper/compbase2.hxx>
30 #include <boost/noncopyable.hpp>
32 namespace sd
{ namespace presenter
{
35 typedef ::cppu::WeakComponentImplHelper2
<
36 css::drawing::XSlideRenderer
,
37 css::lang::XInitialization
38 > SlideRendererInterfaceBase
;
42 /** Render single slides into bitmaps.
45 : private ::boost::noncopyable
,
46 protected ::cppu::BaseMutex
,
47 public SlideRendererInterfaceBase
50 explicit SlideRenderer (const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
);
51 virtual ~SlideRenderer (void);
52 virtual void SAL_CALL
disposing (void);
57 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
)
58 throw (css::uno::Exception
, css::uno::RuntimeException
);
63 virtual css::uno::Reference
<css::awt::XBitmap
> SAL_CALL
createPreview (
64 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
65 const css::awt::Size
& rMaximumPreviewPixelSize
,
66 sal_Int16 nSuperSampleFactor
)
67 throw (css::uno::RuntimeException
);
69 virtual css::uno::Reference
<css::rendering::XBitmap
> SAL_CALL
createPreviewForCanvas (
70 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
71 const css::awt::Size
& rMaximumPreviewPixelSize
,
72 sal_Int16 nSuperSampleFactor
,
73 const css::uno::Reference
<css::rendering::XCanvas
>& rxCanvas
)
74 throw (css::uno::RuntimeException
);
76 virtual css::awt::Size SAL_CALL
calculatePreviewSize (
77 double nSlideAspectRatio
,
78 const css::awt::Size
& rMaximumPreviewPixelSize
)
79 throw (css::uno::RuntimeException
);
82 PreviewRenderer maPreviewRenderer
;
84 BitmapEx
CreatePreview (
85 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
86 const css::awt::Size
& rMaximumPreviewPixelSize
,
87 sal_Int16 nSuperSampleFactor
)
88 throw (css::uno::RuntimeException
);
90 /** This method throws a DisposedException when the object has already been
93 void ThrowIfDisposed (void) throw (css::lang::DisposedException
);
96 } } // end of namespace ::sd::presenter
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */