1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_drawing_XSlideRenderer_idl__
25cdf0e10cSrcweir#define __com_sun_star_drawing_XSlideRenderer_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_awt_XBitmap_idl__
28cdf0e10cSrcweir#include <com/sun/star/awt/XBitmap.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir#ifndef __com_sun_star_drawing_XDrawPage_idl__
31cdf0e10cSrcweir#include <com/sun/star/drawing/XDrawPage.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XBitmap_idl__
34cdf0e10cSrcweir#include <com/sun/star/rendering/XBitmap.idl>
35cdf0e10cSrcweir#endif
36cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XSpriteCanvas_idl__
37cdf0e10cSrcweir#include <com/sun/star/rendering/XSpriteCanvas.idl>
38cdf0e10cSrcweir#endif
39cdf0e10cSrcweir
40cdf0e10cSrcweir
41cdf0e10cSrcweirmodule com { module sun { module star { module drawing {
42cdf0e10cSrcweir
43cdf0e10cSrcweir/** Create preview bitmaps for single slides.
44cdf0e10cSrcweir*/
45cdf0e10cSrcweirinterface XSlideRenderer
46cdf0e10cSrcweir{
47cdf0e10cSrcweir    /** Create a preview for the given slide that has the same aspect ratio
48cdf0e10cSrcweir        as the page and is as large as possible but not larger than the
49cdf0e10cSrcweir        specified size.
50cdf0e10cSrcweir
51cdf0e10cSrcweir        The reason for not using the given size directly as preview size and
52cdf0e10cSrcweir        thus possibly changing the aspect ratio is that
53cdf0e10cSrcweir        a) a different aspect ratio is not used often, and
54cdf0e10cSrcweir        b) leaving the adaption of the actual preview size (according to the
55cdf0e10cSrcweir        aspect ratio of the slide) to the slide renderer is more convenient
56cdf0e10cSrcweir        to the caller than having to this himself.
57cdf0e10cSrcweir
58cdf0e10cSrcweir        @param xSlide
59cdf0e10cSrcweir            The slide for which a preview will be created.
60cdf0e10cSrcweir        @param aMaximumPreviewPixelSize
61cdf0e10cSrcweir            The maximum size of the preview measured in pixels.  When the
62cdf0e10cSrcweir            aspect ratios of this size and of the given slide differ, then
63cdf0e10cSrcweir            resulting preview will either have the width or the height of
64cdf0e10cSrcweir            this size.
65cdf0e10cSrcweir        @param nSuperSampleFactor
66cdf0e10cSrcweir            When larger than the default 1 then internally a larger preview
67cdf0e10cSrcweir            is created which, before it is returned, is scaled down to the
68cdf0e10cSrcweir            requested size.  The intermediate size is nSuperSampleFactor
69cdf0e10cSrcweir            times the original size.  Values larger than 1 result in higher
70cdf0e10cSrcweir            memory consumption and longer runtime.
71cdf0e10cSrcweir            This value is an attempt to provide some antialiasing and so to
72cdf0e10cSrcweir            provide more readable slide previews.  May become obsolete in
73cdf0e10cSrcweir            the future when true antialiasing suppport will be integrated.
74cdf0e10cSrcweir    */
75cdf0e10cSrcweir    com::sun::star::awt::XBitmap createPreview (
76cdf0e10cSrcweir        [in] XDrawPage xSlide,
77cdf0e10cSrcweir        [in] com::sun::star::awt::Size aMaximumPreviewPixelSize,
78cdf0e10cSrcweir        [in] short nSuperSampleFactor);
79cdf0e10cSrcweir
80cdf0e10cSrcweir    /** Exactly the same functionality as <member>createPreview()</member>,
81cdf0e10cSrcweir        only a different return type:
82cdf0e10cSrcweir        <type>com::sun::star::rendering::XBitmap</type> instead
83cdf0e10cSrcweir        of <type>com::sun::star::awt::XBitmap</type>.
84cdf0e10cSrcweir        @see createPreview
85cdf0e10cSrcweir        @param xCanvas
86cdf0e10cSrcweir            This canvas is used create a canvas specific bitmap.
87cdf0e10cSrcweir    */
88cdf0e10cSrcweir    com::sun::star::rendering::XBitmap createPreviewForCanvas (
89cdf0e10cSrcweir        [in] XDrawPage xSlide,
90cdf0e10cSrcweir        [in] com::sun::star::awt::Size aMaximumPreviewPixelSize,
91cdf0e10cSrcweir        [in] short nSuperSampleFactor,
92cdf0e10cSrcweir        [in] com::sun::star::rendering::XCanvas xCanvas);
93cdf0e10cSrcweir
94cdf0e10cSrcweir    /** Return a size that has the given aspect ratio and shares either the
95cdf0e10cSrcweir        width or the height with the given maximum size.
96cdf0e10cSrcweir        @param nSlideAspectRatio
97cdf0e10cSrcweir            The aspect ratio must not be 0.
98cdf0e10cSrcweir        @param aMaximumPreviewPixelSize
99cdf0e10cSrcweir            The maximum size of the returned preview size.
100cdf0e10cSrcweir    */
101cdf0e10cSrcweir    com::sun::star::awt::Size calculatePreviewSize (
102cdf0e10cSrcweir        [in] double nSlideAspectRatio,
103cdf0e10cSrcweir        [in] com::sun::star::awt::Size aMaximumPreviewPixelSize);
104cdf0e10cSrcweir};
105cdf0e10cSrcweir
106cdf0e10cSrcweir}; }; }; }; // ::com::sun::star::drawing
107cdf0e10cSrcweir
108cdf0e10cSrcweir#endif
109