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 .
22 #include <PreviewRenderer.hxx>
23 #include <com/sun/star/drawing/XSlideRenderer.hpp>
24 #include <com/sun/star/lang/XInitialization.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <comphelper/compbase.hxx>
29 namespace com::sun::star::drawing
{ class XDrawPage
; }
31 namespace sd::presenter
{
33 typedef comphelper::WeakComponentImplHelper
<
34 css::drawing::XSlideRenderer
,
35 css::lang::XInitialization
,
36 css::lang::XServiceInfo
37 > SlideRendererInterfaceBase
;
39 /** Render single slides into bitmaps.
41 class SlideRenderer final
42 : public SlideRendererInterfaceBase
46 virtual ~SlideRenderer() override
;
47 SlideRenderer(const SlideRenderer
&) = delete;
48 SlideRenderer
& operator=(const SlideRenderer
&) = delete;
52 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
) override
;
54 OUString SAL_CALL
getImplementationName() override
;
56 sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
;
58 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
62 virtual css::uno::Reference
<css::awt::XBitmap
> SAL_CALL
createPreview (
63 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
64 const css::awt::Size
& rMaximumPreviewPixelSize
,
65 sal_Int16 nSuperSampleFactor
) override
;
67 virtual css::uno::Reference
<css::rendering::XBitmap
> SAL_CALL
createPreviewForCanvas (
68 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
69 const css::awt::Size
& rMaximumPreviewPixelSize
,
70 sal_Int16 nSuperSampleFactor
,
71 const css::uno::Reference
<css::rendering::XCanvas
>& rxCanvas
) override
;
73 virtual css::awt::Size SAL_CALL
calculatePreviewSize (
74 double nSlideAspectRatio
,
75 const css::awt::Size
& rMaximumPreviewPixelSize
) override
;
78 PreviewRenderer maPreviewRenderer
;
80 /// @throws css::uno::RuntimeException
81 BitmapEx
CreatePreview (
82 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
83 const css::awt::Size
& rMaximumPreviewPixelSize
,
84 sal_Int16 nSuperSampleFactor
);
86 /** @throws css::lang::DisposedException when the object has already been
89 void ThrowIfDisposed();
92 } // end of namespace ::sd::presenter
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */