1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSlidePreviewCache.idl,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef __com_sun_star_drawing_XSlidePreviewCache_idl__
33 #define __com_sun_star_drawing_XSlidePreviewCache_idl__
35 #ifndef __com_sun_star_container_XIndexAccess_idl__
36 #include
<com
/sun
/star
/container
/XIndexAccess.idl
>
38 #ifndef __com_sun_star_geometry_IntegerSize2D_idl__
39 #include
<com
/sun
/star
/geometry
/IntegerSize2D.idl
>
41 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
42 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
44 #ifndef __com_sun_star_rendering_XBitmap_idl__
45 #include
<com
/sun
/star
/rendering
/XBitmap.idl
>
47 #ifndef __com_sun_star_rendering_XCanvas_idl__
48 #include
<com
/sun
/star
/rendering
/XCanvas.idl
>
52 module com
{ module sun
{ module star
{ module drawing
{
54 /** Listener for asynchronous preview creations. Called when a slide
55 preview has been created that was previously requested via a call to
56 <method>XSlidePreviewCache::getSlidePreview()</method>. The
57 implementor may then call <method>getSlidePreview()</method> a second
58 time to get the up-to-date version of the preview.
60 interface XSlidePreviewCacheListener
62 /** Called by a <interface>XSlidePreviewCache</interface> object when a
63 preview has been created for the slide with the given index.
65 The index of the slide for which a new preview has been created.
67 void notifyPreviewCreation
([in] long nSlideIndex
);
73 /** A cache of preview bitmaps for the slides of one Impress or Draw
74 document in one size. There may be more than one cache for one
75 document. These are internally connected and for missing previews one
76 cache may take it from another cache and scale it to the desired size.
77 When a preview is not present then it is created asynchronously. On
78 creation all registered listeners are notified.
80 Slides are referenced via their index in an XIndexAccess container in
81 order to allow multiple references to a single slide (custom
84 interface XSlidePreviewCache
86 /** Set the set of slides for which the cache will provide the
87 previews. All slides in the given XIndexAccess are required to come
90 The set of slides for which the called cache will provide the
91 previews. This container defines the indices that are used to
94 The model that contains the slides reference by the xSlides argument.
96 void setDocumentSlides
(
97 [in] ::com
::sun
::star
::container
::XIndexAccess xSlides
,
98 [in] ::com
::sun
::star
::uno
::XInterface xDocument
);
100 /** Define which slides are currently visible on the screen and which
101 are not. This information is used for give preview creation for
102 visible slides a higher priority than for those slides that are not
105 void setVisibleRange
([in] long nFirstVisibleSlideIndex
, [in] long nLastVisibleSlideIndex
);
107 /** Define the size of the previews that are managed by the called
110 void setPreviewSize
([in] ::com
::sun
::star
::geometry
::IntegerSize2D aSize
);
112 /** Return a preview for the given slide index.
113 The returned bitmap may be the requested preview, a preview of the
114 preview, i.e. a scaled up or down version, or an empty reference
115 when the preview is not yet present.
117 This call may lead to the asynchronous creation of the requested
118 preview. In that case all registered listeners are notified when
119 the preview has been created.
121 ::com
::sun
::star
::rendering
::XBitmap getSlidePreview
(
122 [in] long nSlideIndex
,
123 [in] ::com
::sun
::star
::rendering
::XCanvas xCanvas
)
124 raises
(::com
::sun
::star
::lang
::IllegalArgumentException
);
126 /** Register a listener that is called when a preview has been created
129 void addPreviewCreationNotifyListener
([in] XSlidePreviewCacheListener xListener
);
131 /** Remove a previously registered listener for preview creations.
133 void removePreviewCreationNotifyListener
([in] XSlidePreviewCacheListener xListener
);
135 /** Stop the asynchronous creation of previews temporarily.
136 Call <method>resume()</method> to restart it.
140 /** Resume the asynchronous creation of slide previews.
145 }; }; }; }; // ::com::sun::star::drawing