1d1766043SAndrew Rist/************************************************************** 2d1766043SAndrew Rist * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_drawing_XSlidePreviewCache_idl__ 25cdf0e10cSrcweir#define __com_sun_star_drawing_XSlidePreviewCache_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_container_XIndexAccess_idl__ 28cdf0e10cSrcweir#include <com/sun/star/container/XIndexAccess.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir#ifndef __com_sun_star_geometry_IntegerSize2D_idl__ 31cdf0e10cSrcweir#include <com/sun/star/geometry/IntegerSize2D.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 34cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 35cdf0e10cSrcweir#endif 36cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XBitmap_idl__ 37cdf0e10cSrcweir#include <com/sun/star/rendering/XBitmap.idl> 38cdf0e10cSrcweir#endif 39cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XCanvas_idl__ 40cdf0e10cSrcweir#include <com/sun/star/rendering/XCanvas.idl> 41cdf0e10cSrcweir#endif 42*b63233d8Sdamjan#ifndef __com_sun_star_drawing_XSlidePreviewCacheListener_idl__ 43*b63233d8Sdamjan#include <com/sun/star/drawing/XSlidePreviewCacheListener.idl> 44*b63233d8Sdamjan#endif 45cdf0e10cSrcweir 46cdf0e10cSrcweirmodule com { module sun { module star { module drawing { 47cdf0e10cSrcweir 48cdf0e10cSrcweir/** A cache of preview bitmaps for the slides of one Impress or Draw 49cdf0e10cSrcweir document in one size. There may be more than one cache for one 50cdf0e10cSrcweir document. These are internally connected and for missing previews one 51cdf0e10cSrcweir cache may take it from another cache and scale it to the desired size. 52cdf0e10cSrcweir When a preview is not present then it is created asynchronously. On 53cdf0e10cSrcweir creation all registered listeners are notified. 54cdf0e10cSrcweir 55cdf0e10cSrcweir Slides are referenced via their index in an XIndexAccess container in 56cdf0e10cSrcweir order to allow multiple references to a single slide (custom 57cdf0e10cSrcweir presentations). 58cdf0e10cSrcweir*/ 59cdf0e10cSrcweirpublished interface XSlidePreviewCache 60cdf0e10cSrcweir{ 61cdf0e10cSrcweir /** Set the set of slides for which the cache will provide the 62cdf0e10cSrcweir previews. All slides in the given XIndexAccess are required to come 63cdf0e10cSrcweir from the given model. 64cdf0e10cSrcweir @param xSlides 65cdf0e10cSrcweir The set of slides for which the called cache will provide the 66cdf0e10cSrcweir previews. This container defines the indices that are used to 67cdf0e10cSrcweir look up slides. 68cdf0e10cSrcweir @param xDocument 69cdf0e10cSrcweir The model that contains the slides reference by the xSlides argument. 70cdf0e10cSrcweir */ 71cdf0e10cSrcweir void setDocumentSlides ( 72cdf0e10cSrcweir [in] ::com::sun::star::container::XIndexAccess xSlides, 73cdf0e10cSrcweir [in] ::com::sun::star::uno::XInterface xDocument); 74cdf0e10cSrcweir 75cdf0e10cSrcweir /** Define which slides are currently visible on the screen and which 76cdf0e10cSrcweir are not. This information is used for give preview creation for 77cdf0e10cSrcweir visible slides a higher priority than for those slides that are not 78cdf0e10cSrcweir visible. 79cdf0e10cSrcweir */ 80cdf0e10cSrcweir void setVisibleRange ([in] long nFirstVisibleSlideIndex, [in] long nLastVisibleSlideIndex); 81cdf0e10cSrcweir 82cdf0e10cSrcweir /** Define the size of the previews that are managed by the called 83cdf0e10cSrcweir cache. 84cdf0e10cSrcweir */ 85cdf0e10cSrcweir void setPreviewSize ([in] ::com::sun::star::geometry::IntegerSize2D aSize); 86cdf0e10cSrcweir 87cdf0e10cSrcweir /** Return a preview for the given slide index. 88cdf0e10cSrcweir The returned bitmap may be the requested preview, a preview of the 89cdf0e10cSrcweir preview, i.e. a scaled up or down version, or an empty reference 90cdf0e10cSrcweir when the preview is not yet present. 91cdf0e10cSrcweir 92cdf0e10cSrcweir This call may lead to the asynchronous creation of the requested 93cdf0e10cSrcweir preview. In that case all registered listeners are notified when 94cdf0e10cSrcweir the preview has been created. 95cdf0e10cSrcweir */ 96cdf0e10cSrcweir ::com::sun::star::rendering::XBitmap getSlidePreview ( 97cdf0e10cSrcweir [in] long nSlideIndex, 98cdf0e10cSrcweir [in] ::com::sun::star::rendering::XCanvas xCanvas) 99cdf0e10cSrcweir raises(::com::sun::star::lang::IllegalArgumentException); 100cdf0e10cSrcweir 101cdf0e10cSrcweir /** Register a listener that is called when a preview has been created 102cdf0e10cSrcweir asynchronously. 103cdf0e10cSrcweir */ 104cdf0e10cSrcweir void addPreviewCreationNotifyListener ([in] XSlidePreviewCacheListener xListener); 105cdf0e10cSrcweir 106cdf0e10cSrcweir /** Remove a previously registered listener for preview creations. 107cdf0e10cSrcweir */ 108cdf0e10cSrcweir void removePreviewCreationNotifyListener ([in] XSlidePreviewCacheListener xListener); 109cdf0e10cSrcweir 110cdf0e10cSrcweir /** Stop the asynchronous creation of previews temporarily. 111cdf0e10cSrcweir Call <method>resume()</method> to restart it. 112cdf0e10cSrcweir */ 113cdf0e10cSrcweir void pause (); 114cdf0e10cSrcweir 115cdf0e10cSrcweir /** Resume the asynchronous creation of slide previews. 116cdf0e10cSrcweir */ 117cdf0e10cSrcweir void resume (); 118cdf0e10cSrcweir}; 119cdf0e10cSrcweir 120cdf0e10cSrcweir}; }; }; }; // ::com::sun::star::drawing 121cdf0e10cSrcweir 122cdf0e10cSrcweir#endif 123