bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / presenter / SlideRenderer.hxx
blob9625f4618fb86016d5f1c64785e24b056f6d2b56
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 {
34 namespace {
35 typedef ::cppu::WeakComponentImplHelper2 <
36 css::drawing::XSlideRenderer,
37 css::lang::XInitialization
38 > SlideRendererInterfaceBase;
42 /** Render single slides into bitmaps.
44 class SlideRenderer
45 : private ::boost::noncopyable,
46 protected ::cppu::BaseMutex,
47 public SlideRendererInterfaceBase
49 public:
50 explicit SlideRenderer (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
51 virtual ~SlideRenderer (void);
52 virtual void SAL_CALL disposing (void);
55 // XInitialization
57 virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments)
58 throw (css::uno::Exception, css::uno::RuntimeException);
61 // XSlideRenderer
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);
81 private:
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
91 disposed.
93 void ThrowIfDisposed (void) throw (css::lang::DisposedException);
96 } } // end of namespace ::sd::presenter
98 #endif
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */