1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_drawing_XSlideRenderer_idl__
29#define __com_sun_star_drawing_XSlideRenderer_idl__
30
31#ifndef __com_sun_star_awt_XBitmap_idl__
32#include <com/sun/star/awt/XBitmap.idl>
33#endif
34#ifndef __com_sun_star_drawing_XDrawPage_idl__
35#include <com/sun/star/drawing/XDrawPage.idl>
36#endif
37#ifndef __com_sun_star_rendering_XBitmap_idl__
38#include <com/sun/star/rendering/XBitmap.idl>
39#endif
40#ifndef __com_sun_star_rendering_XSpriteCanvas_idl__
41#include <com/sun/star/rendering/XSpriteCanvas.idl>
42#endif
43
44
45module com { module sun { module star { module drawing {
46
47/** Create preview bitmaps for single slides.
48*/
49interface XSlideRenderer
50{
51    /** Create a preview for the given slide that has the same aspect ratio
52        as the page and is as large as possible but not larger than the
53        specified size.
54
55        The reason for not using the given size directly as preview size and
56        thus possibly changing the aspect ratio is that
57        a) a different aspect ratio is not used often, and
58        b) leaving the adaption of the actual preview size (according to the
59        aspect ratio of the slide) to the slide renderer is more convenient
60        to the caller than having to this himself.
61
62        @param xSlide
63            The slide for which a preview will be created.
64        @param aMaximumPreviewPixelSize
65            The maximum size of the preview measured in pixels.  When the
66            aspect ratios of this size and of the given slide differ, then
67            resulting preview will either have the width or the height of
68            this size.
69        @param nSuperSampleFactor
70            When larger than the default 1 then internally a larger preview
71            is created which, before it is returned, is scaled down to the
72            requested size.  The intermediate size is nSuperSampleFactor
73            times the original size.  Values larger than 1 result in higher
74            memory consumption and longer runtime.
75            This value is an attempt to provide some antialiasing and so to
76            provide more readable slide previews.  May become obsolete in
77            the future when true antialiasing suppport will be integrated.
78    */
79    com::sun::star::awt::XBitmap createPreview (
80        [in] XDrawPage xSlide,
81        [in] com::sun::star::awt::Size aMaximumPreviewPixelSize,
82        [in] short nSuperSampleFactor);
83
84    /** Exactly the same functionality as <member>createPreview()</member>,
85        only a different return type:
86        <type>com::sun::star::rendering::XBitmap</type> instead
87        of <type>com::sun::star::awt::XBitmap</type>.
88        @see createPreview
89        @param xCanvas
90            This canvas is used create a canvas specific bitmap.
91    */
92    com::sun::star::rendering::XBitmap createPreviewForCanvas (
93        [in] XDrawPage xSlide,
94        [in] com::sun::star::awt::Size aMaximumPreviewPixelSize,
95        [in] short nSuperSampleFactor,
96        [in] com::sun::star::rendering::XCanvas xCanvas);
97
98    /** Return a size that has the given aspect ratio and shares either the
99        width or the height with the given maximum size.
100        @param nSlideAspectRatio
101            The aspect ratio must not be 0.
102        @param aMaximumPreviewPixelSize
103            The maximum size of the returned preview size.
104    */
105    com::sun::star::awt::Size calculatePreviewSize (
106        [in] double nSlideAspectRatio,
107        [in] com::sun::star::awt::Size aMaximumPreviewPixelSize);
108};
109
110}; }; }; }; // ::com::sun::star::drawing
111
112#endif
113