xref: /AOO41X/main/offapi/com/sun/star/drawing/XSlidePreviewCache.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
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
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
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.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew 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
42cdf0e10cSrcweir
43cdf0e10cSrcweirmodule com { module sun { module star { module drawing {
44cdf0e10cSrcweir
45cdf0e10cSrcweir/** Listener for asynchronous preview creations.  Called when a slide
46cdf0e10cSrcweir    preview has been created that was previously requested via a call to
47cdf0e10cSrcweir    <method>XSlidePreviewCache::getSlidePreview()</method>.  The
48cdf0e10cSrcweir    implementor may then call <method>getSlidePreview()</method> a second
49cdf0e10cSrcweir    time to get the up-to-date version of the preview.
50cdf0e10cSrcweir*/
51cdf0e10cSrcweirpublished interface XSlidePreviewCacheListener
52cdf0e10cSrcweir{
53cdf0e10cSrcweir    /** Called by a <interface>XSlidePreviewCache</interface> object when a
54cdf0e10cSrcweir        preview has been created for the slide with the given index.
55cdf0e10cSrcweir        @param nSlideIndex
56cdf0e10cSrcweir            The index of the slide for which a new preview has been created.
57cdf0e10cSrcweir    */
58cdf0e10cSrcweir    void notifyPreviewCreation ([in] long nSlideIndex);
59cdf0e10cSrcweir};
60cdf0e10cSrcweir
61cdf0e10cSrcweir
62cdf0e10cSrcweir
63cdf0e10cSrcweir
64cdf0e10cSrcweir/** A cache of preview bitmaps for the slides of one Impress or Draw
65cdf0e10cSrcweir    document in one size.  There may be more than one cache for one
66cdf0e10cSrcweir    document.  These are internally connected and for missing previews one
67cdf0e10cSrcweir    cache may take it from another cache and scale it to the desired size.
68cdf0e10cSrcweir    When a preview is not present then it is created asynchronously.  On
69cdf0e10cSrcweir    creation all registered listeners are notified.
70cdf0e10cSrcweir
71cdf0e10cSrcweir    Slides are referenced via their index in an XIndexAccess container in
72cdf0e10cSrcweir    order to allow multiple references to a single slide (custom
73cdf0e10cSrcweir    presentations).
74cdf0e10cSrcweir*/
75cdf0e10cSrcweirpublished interface XSlidePreviewCache
76cdf0e10cSrcweir{
77cdf0e10cSrcweir    /** Set the set of slides for which the cache will provide the
78cdf0e10cSrcweir        previews.  All slides in the given XIndexAccess are required to come
79cdf0e10cSrcweir        from the given model.
80cdf0e10cSrcweir        @param xSlides
81cdf0e10cSrcweir            The set of slides for which the called cache will provide the
82cdf0e10cSrcweir            previews.  This container defines the indices that are used to
83cdf0e10cSrcweir            look up slides.
84cdf0e10cSrcweir        @param xDocument
85cdf0e10cSrcweir            The model that contains the slides reference by the xSlides argument.
86cdf0e10cSrcweir    */
87cdf0e10cSrcweir    void setDocumentSlides (
88cdf0e10cSrcweir        [in] ::com::sun::star::container::XIndexAccess xSlides,
89cdf0e10cSrcweir        [in] ::com::sun::star::uno::XInterface xDocument);
90cdf0e10cSrcweir
91cdf0e10cSrcweir    /** Define which slides are currently visible on the screen and which
92cdf0e10cSrcweir        are not.  This information is used for give preview creation for
93cdf0e10cSrcweir        visible slides a higher priority than for those slides that are not
94cdf0e10cSrcweir        visible.
95cdf0e10cSrcweir    */
96cdf0e10cSrcweir    void setVisibleRange ([in] long nFirstVisibleSlideIndex, [in] long nLastVisibleSlideIndex);
97cdf0e10cSrcweir
98cdf0e10cSrcweir    /** Define the size of the previews that are managed by the called
99cdf0e10cSrcweir        cache.
100cdf0e10cSrcweir    */
101cdf0e10cSrcweir    void setPreviewSize ([in] ::com::sun::star::geometry::IntegerSize2D aSize);
102cdf0e10cSrcweir
103cdf0e10cSrcweir    /** Return a preview for the given slide index.
104cdf0e10cSrcweir        The returned bitmap may be the requested preview, a preview of the
105cdf0e10cSrcweir        preview, i.e. a scaled up or down version, or an empty reference
106cdf0e10cSrcweir        when the preview is not yet present.
107cdf0e10cSrcweir
108cdf0e10cSrcweir        This call may lead to the asynchronous creation of the requested
109cdf0e10cSrcweir        preview.  In that case all registered listeners are notified when
110cdf0e10cSrcweir        the preview has been created.
111cdf0e10cSrcweir    */
112cdf0e10cSrcweir    ::com::sun::star::rendering::XBitmap getSlidePreview (
113cdf0e10cSrcweir        [in] long nSlideIndex,
114cdf0e10cSrcweir        [in] ::com::sun::star::rendering::XCanvas xCanvas)
115cdf0e10cSrcweir          raises(::com::sun::star::lang::IllegalArgumentException);
116cdf0e10cSrcweir
117cdf0e10cSrcweir    /** Register a listener that is called when a preview has been created
118cdf0e10cSrcweir        asynchronously.
119cdf0e10cSrcweir    */
120cdf0e10cSrcweir    void addPreviewCreationNotifyListener ([in] XSlidePreviewCacheListener xListener);
121cdf0e10cSrcweir
122cdf0e10cSrcweir    /** Remove a previously registered listener for preview creations.
123cdf0e10cSrcweir    */
124cdf0e10cSrcweir    void removePreviewCreationNotifyListener ([in] XSlidePreviewCacheListener xListener);
125cdf0e10cSrcweir
126cdf0e10cSrcweir    /** Stop the asynchronous creation of previews temporarily.
127cdf0e10cSrcweir        Call <method>resume()</method> to restart it.
128cdf0e10cSrcweir    */
129cdf0e10cSrcweir    void pause ();
130cdf0e10cSrcweir
131cdf0e10cSrcweir    /** Resume the asynchronous creation of slide previews.
132cdf0e10cSrcweir    */
133cdf0e10cSrcweir    void resume ();
134cdf0e10cSrcweir};
135cdf0e10cSrcweir
136cdf0e10cSrcweir}; }; }; }; // ::com::sun::star::drawing
137cdf0e10cSrcweir
138cdf0e10cSrcweir#endif
139