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