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