Update ooo320-m1
[ooovba.git] / slideshow / source / inc / slide.hxx
blob3cea49174deb75057953a6dbb345b10dd2593168
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: slide.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_SLIDE_HXX
32 #define INCLUDED_SLIDESHOW_SLIDE_HXX
34 #include "shapemanager.hxx"
35 #include "subsettableshapemanager.hxx"
36 #include "unoviewcontainer.hxx"
37 #include "slidebitmap.hxx"
38 #include "shapemaps.hxx"
40 #include <boost/shared_ptr.hpp>
42 namespace com { namespace sun { namespace star {
43 namespace drawing {
44 class XDrawPage;
46 namespace uno {
47 class XComponentContext;
49 namespace animations {
50 class XAnimationNode;
51 } } } }
53 namespace basegfx
55 class B2IVector;
58 /* Definition of Slide interface */
60 namespace slideshow
62 namespace internal
64 class RGBColor;
65 class ScreenUpdater;
67 class Slide
69 public:
70 // Showing
71 // -------------------------------------------------------------------
73 /** Prepares to show slide.
75 Call this method to reduce the timeout show(), and
76 getInitialSlideBitmap() need to complete. If
77 prefetch() is not called explicitely, the named
78 methods will call it implicitely.
80 virtual bool prefetch() = 0;
82 /** Shows the slide on all registered views
84 After this call, the slide will render itself to the
85 views, and start its animations.
87 @param bSlideBackgoundPainted
88 When true, the initial slide content on the background
89 layer is already rendered (e.g. from a previous slide
90 transition). When false, Slide renders initial content of
91 slide.
93 virtual bool show( bool bSlideBackgoundPainted ) = 0;
95 /** Force-ends the slide
97 After this call, the slide has stopped all animations,
98 and ceased rendering/visualization on all views.
100 virtual void hide() = 0;
103 // Queries
104 // -------------------------------------------------------------------
106 /** Query the size of this slide in user coordinates
108 This value is retrieved from the XDrawPage properties.
110 virtual basegfx::B2IVector getSlideSize() const = 0;
112 /// Gets the underlying API page
113 virtual ::com::sun::star::uno::Reference<
114 ::com::sun::star::drawing::XDrawPage > getXDrawPage() const = 0;
116 /// Gets the animation node.
117 virtual ::com::sun::star::uno::Reference<
118 ::com::sun::star::animations::XAnimationNode > getXAnimationNode() const = 0;
121 // Slide bitmaps
122 // -------------------------------------------------------------------
124 /** Request bitmap for current slide appearance.
126 The bitmap returned by this method depends on the
127 current state of the slide and the contained
128 animations. A newly generated slide will return the
129 initial slide content here (e.g. with all 'appear'
130 effect shapes invisible), a slide whose effects are
131 currently running will return a bitmap corresponding
132 to the current position on the animation timeline, and
133 a slide whose effects have all been run will generate
134 a bitmap with the final slide appearance (e.g. with
135 all 'hide' effect shapes invisible).
137 @param rView
138 View to retrieve bitmap for (note that the bitmap will
139 have device-pixel equivalence to the content that
140 would have been rendered onto the given view). Note
141 that the view must have been added to this slide
142 before via viewAdded().
144 virtual SlideBitmapSharedPtr
145 getCurrentSlideBitmap( const UnoViewSharedPtr& rView ) const = 0;
148 typedef ::boost::shared_ptr< Slide > SlideSharedPtr;
150 class EventQueue;
151 class CursorManager;
152 class EventMultiplexer;
153 class ActivitiesQueue;
154 class UserEventQueue;
155 class RGBColor;
157 /** Construct from XDrawPage
159 The Slide object generally works in XDrawPage model
160 coordinates, that is, the page will have the width and
161 height as specified in the XDrawPage's property
162 set. The top, left corner of the page will be rendered
163 at (0,0) in the given canvas' view coordinate system.
165 Does not render anything initially
167 @param xDrawPage
168 Page to display on this slide
170 @param xRootNode
171 Root of the SMIL animation tree. Used to animate the slide.
173 @param rEventQueue
174 EventQueue. Used to post events.
176 @param rActivitiesQueue
177 ActivitiesQueue. Used to run animations.
179 @param rEventMultiplexer
180 Event source
182 @param rUserEventQueue
183 UserEeventQueue
185 SlideSharedPtr createSlide( const ::com::sun::star::uno::Reference<
186 ::com::sun::star::drawing::XDrawPage >& xDrawPage,
187 const ::com::sun::star::uno::Reference<
188 ::com::sun::star::animations::XAnimationNode >& xRootNode,
189 EventQueue& rEventQueue,
190 EventMultiplexer& rEventMultiplexer,
191 ScreenUpdater& rScreenUpdater,
192 ActivitiesQueue& rActivitiesQueue,
193 UserEventQueue& rUserEventQueue,
194 CursorManager& rCursorManager,
195 const UnoViewContainer& rViewContainer,
196 const ::com::sun::star::uno::Reference<
197 ::com::sun::star::uno::XComponentContext >& xContext,
198 const ShapeEventListenerMap& rShapeListenerMap,
199 const ShapeCursorMap& rShapeCursorMap,
200 RGBColor const& aUserPaintColor,
201 double dUserPaintStrokeWidth,
202 bool bUserPaintEnabled,
203 bool bIntrinsicAnimationsAllowed,
204 bool bDisableAnimationZOrder );
208 #endif /* INCLUDED_SLIDESHOW_SLIDE_HXX */