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 INCLUDED_SD_SOURCE_UI_PRESENTER_SLIDERENDERER_HXX
21 #define INCLUDED_SD_SOURCE_UI_PRESENTER_SLIDERENDERER_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/lang/XServiceInfo.hpp>
28 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <cppuhelper/basemutex.hxx>
32 #include <cppuhelper/compbase.hxx>
33 #include <boost/noncopyable.hpp>
35 namespace sd
{ namespace presenter
{
38 typedef ::cppu::WeakComponentImplHelper
<
39 css::drawing::XSlideRenderer
,
40 css::lang::XInitialization
,
41 css::lang::XServiceInfo
42 > SlideRendererInterfaceBase
;
45 /** Render single slides into bitmaps.
48 : private ::boost::noncopyable
,
49 protected ::cppu::BaseMutex
,
50 public SlideRendererInterfaceBase
53 explicit SlideRenderer (const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
);
54 virtual ~SlideRenderer();
55 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
59 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
)
60 throw (css::uno::Exception
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
62 OUString SAL_CALL
getImplementationName()
63 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
65 sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
)
66 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
68 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames()
69 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 virtual css::uno::Reference
<css::awt::XBitmap
> SAL_CALL
createPreview (
74 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
75 const css::awt::Size
& rMaximumPreviewPixelSize
,
76 sal_Int16 nSuperSampleFactor
)
77 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual css::uno::Reference
<css::rendering::XBitmap
> SAL_CALL
createPreviewForCanvas (
80 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
81 const css::awt::Size
& rMaximumPreviewPixelSize
,
82 sal_Int16 nSuperSampleFactor
,
83 const css::uno::Reference
<css::rendering::XCanvas
>& rxCanvas
)
84 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual css::awt::Size SAL_CALL
calculatePreviewSize (
87 double nSlideAspectRatio
,
88 const css::awt::Size
& rMaximumPreviewPixelSize
)
89 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 PreviewRenderer maPreviewRenderer
;
94 BitmapEx
CreatePreview (
95 const css::uno::Reference
<css::drawing::XDrawPage
>& rxSlide
,
96 const css::awt::Size
& rMaximumPreviewPixelSize
,
97 sal_Int16 nSuperSampleFactor
)
98 throw (css::uno::RuntimeException
, std::exception
);
100 /** This method throws a DisposedException when the object has already been
103 void ThrowIfDisposed() throw (css::lang::DisposedException
);
106 } } // end of namespace ::sd::presenter
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */