xref: /aoo4110/main/slideshow/source/inc/slide.hxx (revision b1cdbd2c)
1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski #ifndef INCLUDED_SLIDESHOW_SLIDE_HXX
25*b1cdbd2cSJim Jagielski #define INCLUDED_SLIDESHOW_SLIDE_HXX
26*b1cdbd2cSJim Jagielski 
27*b1cdbd2cSJim Jagielski #include "shapemanager.hxx"
28*b1cdbd2cSJim Jagielski #include "subsettableshapemanager.hxx"
29*b1cdbd2cSJim Jagielski #include "unoviewcontainer.hxx"
30*b1cdbd2cSJim Jagielski #include "slidebitmap.hxx"
31*b1cdbd2cSJim Jagielski #include "shapemaps.hxx"
32*b1cdbd2cSJim Jagielski 
33*b1cdbd2cSJim Jagielski #include <boost/shared_ptr.hpp>
34*b1cdbd2cSJim Jagielski 
35*b1cdbd2cSJim Jagielski namespace com {  namespace sun { namespace star {
36*b1cdbd2cSJim Jagielski     namespace drawing {
37*b1cdbd2cSJim Jagielski         class XDrawPage;
38*b1cdbd2cSJim Jagielski         class XDrawPagesSupplier;
39*b1cdbd2cSJim Jagielski     }
40*b1cdbd2cSJim Jagielski     namespace uno {
41*b1cdbd2cSJim Jagielski         class XComponentContext;
42*b1cdbd2cSJim Jagielski     }
43*b1cdbd2cSJim Jagielski     namespace animations {
44*b1cdbd2cSJim Jagielski         class XAnimationNode;
45*b1cdbd2cSJim Jagielski } } } }
46*b1cdbd2cSJim Jagielski 
47*b1cdbd2cSJim Jagielski namespace basegfx
48*b1cdbd2cSJim Jagielski {
49*b1cdbd2cSJim Jagielski     class B2IVector;
50*b1cdbd2cSJim Jagielski }
51*b1cdbd2cSJim Jagielski 
52*b1cdbd2cSJim Jagielski /* Definition of Slide interface */
53*b1cdbd2cSJim Jagielski 
54*b1cdbd2cSJim Jagielski namespace slideshow
55*b1cdbd2cSJim Jagielski {
56*b1cdbd2cSJim Jagielski     namespace internal
57*b1cdbd2cSJim Jagielski     {
58*b1cdbd2cSJim Jagielski         class RGBColor;
59*b1cdbd2cSJim Jagielski         class ScreenUpdater;
60*b1cdbd2cSJim Jagielski         typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector;
61*b1cdbd2cSJim Jagielski         class Slide
62*b1cdbd2cSJim Jagielski         {
63*b1cdbd2cSJim Jagielski         public:
64*b1cdbd2cSJim Jagielski             // Showing
65*b1cdbd2cSJim Jagielski             // -------------------------------------------------------------------
66*b1cdbd2cSJim Jagielski 
67*b1cdbd2cSJim Jagielski             /** Prepares to show slide.
68*b1cdbd2cSJim Jagielski 
69*b1cdbd2cSJim Jagielski             	Call this method to reduce the timeout show(), and
70*b1cdbd2cSJim Jagielski             	getInitialSlideBitmap() need to complete. If
71*b1cdbd2cSJim Jagielski             	prefetch() is not called explicitely, the named
72*b1cdbd2cSJim Jagielski             	methods will call it implicitely.
73*b1cdbd2cSJim Jagielski              */
74*b1cdbd2cSJim Jagielski             virtual bool prefetch() = 0;
75*b1cdbd2cSJim Jagielski 
76*b1cdbd2cSJim Jagielski             /** Shows the slide on all registered views
77*b1cdbd2cSJim Jagielski 
78*b1cdbd2cSJim Jagielski                 After this call, the slide will render itself to the
79*b1cdbd2cSJim Jagielski                 views, and start its animations.
80*b1cdbd2cSJim Jagielski 
81*b1cdbd2cSJim Jagielski                 @param bSlideBackgoundPainted
82*b1cdbd2cSJim Jagielski                 When true, the initial slide content on the background
83*b1cdbd2cSJim Jagielski                 layer is already rendered (e.g. from a previous slide
84*b1cdbd2cSJim Jagielski                 transition). When false, Slide renders initial content of
85*b1cdbd2cSJim Jagielski                 slide.
86*b1cdbd2cSJim Jagielski              */
87*b1cdbd2cSJim Jagielski             virtual bool show( bool bSlideBackgoundPainted ) = 0;
88*b1cdbd2cSJim Jagielski 
89*b1cdbd2cSJim Jagielski             /** Force-ends the slide
90*b1cdbd2cSJim Jagielski 
91*b1cdbd2cSJim Jagielski                 After this call, the slide has stopped all animations,
92*b1cdbd2cSJim Jagielski                 and ceased rendering/visualization on all views.
93*b1cdbd2cSJim Jagielski              */
94*b1cdbd2cSJim Jagielski             virtual void hide() = 0;
95*b1cdbd2cSJim Jagielski 
96*b1cdbd2cSJim Jagielski 
97*b1cdbd2cSJim Jagielski             // Queries
98*b1cdbd2cSJim Jagielski             // -------------------------------------------------------------------
99*b1cdbd2cSJim Jagielski 
100*b1cdbd2cSJim Jagielski             /** Query the size of this slide in user coordinates
101*b1cdbd2cSJim Jagielski 
102*b1cdbd2cSJim Jagielski                 This value is retrieved from the XDrawPage properties.
103*b1cdbd2cSJim Jagielski              */
104*b1cdbd2cSJim Jagielski             virtual basegfx::B2IVector getSlideSize() const = 0;
105*b1cdbd2cSJim Jagielski 
106*b1cdbd2cSJim Jagielski             /// Gets the underlying API page
107*b1cdbd2cSJim Jagielski             virtual ::com::sun::star::uno::Reference<
108*b1cdbd2cSJim Jagielski                 ::com::sun::star::drawing::XDrawPage > getXDrawPage() const = 0;
109*b1cdbd2cSJim Jagielski 
110*b1cdbd2cSJim Jagielski             /// Gets the animation node.
111*b1cdbd2cSJim Jagielski             virtual ::com::sun::star::uno::Reference<
112*b1cdbd2cSJim Jagielski                 ::com::sun::star::animations::XAnimationNode > getXAnimationNode() const = 0;
113*b1cdbd2cSJim Jagielski 
114*b1cdbd2cSJim Jagielski             ///Gets the slide Polygons
115*b1cdbd2cSJim Jagielski             virtual PolyPolygonVector getPolygons() = 0;
116*b1cdbd2cSJim Jagielski 
117*b1cdbd2cSJim Jagielski             ///Draw the slide Polygons
118*b1cdbd2cSJim Jagielski             virtual void drawPolygons() const = 0;
119*b1cdbd2cSJim Jagielski 
120*b1cdbd2cSJim Jagielski             ///Check if paint overlay is already active
121*b1cdbd2cSJim Jagielski             virtual bool isPaintOverlayActive() const = 0;
122*b1cdbd2cSJim Jagielski 
123*b1cdbd2cSJim Jagielski 			virtual void enablePaintOverlay() = 0;
124*b1cdbd2cSJim Jagielski 			virtual void disablePaintOverlay() = 0;
125*b1cdbd2cSJim Jagielski 
126*b1cdbd2cSJim Jagielski 			virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0;
127*b1cdbd2cSJim Jagielski 
128*b1cdbd2cSJim Jagielski             // Slide bitmaps
129*b1cdbd2cSJim Jagielski             // -------------------------------------------------------------------
130*b1cdbd2cSJim Jagielski 
131*b1cdbd2cSJim Jagielski             /** Request bitmap for current slide appearance.
132*b1cdbd2cSJim Jagielski 
133*b1cdbd2cSJim Jagielski             	The bitmap returned by this method depends on the
134*b1cdbd2cSJim Jagielski             	current state of the slide and the contained
135*b1cdbd2cSJim Jagielski             	animations. A newly generated slide will return the
136*b1cdbd2cSJim Jagielski             	initial slide content here (e.g. with all 'appear'
137*b1cdbd2cSJim Jagielski             	effect shapes invisible), a slide whose effects are
138*b1cdbd2cSJim Jagielski             	currently running will return a bitmap corresponding
139*b1cdbd2cSJim Jagielski             	to the current position on the animation timeline, and
140*b1cdbd2cSJim Jagielski             	a slide whose effects have all been run will generate
141*b1cdbd2cSJim Jagielski             	a bitmap with the final slide appearance (e.g. with
142*b1cdbd2cSJim Jagielski             	all 'hide' effect shapes invisible).
143*b1cdbd2cSJim Jagielski 
144*b1cdbd2cSJim Jagielski             	@param rView
145*b1cdbd2cSJim Jagielski                 View to retrieve bitmap for (note that the bitmap will
146*b1cdbd2cSJim Jagielski                 have device-pixel equivalence to the content that
147*b1cdbd2cSJim Jagielski                 would have been rendered onto the given view). Note
148*b1cdbd2cSJim Jagielski                 that the view must have been added to this slide
149*b1cdbd2cSJim Jagielski                 before via viewAdded().
150*b1cdbd2cSJim Jagielski              */
151*b1cdbd2cSJim Jagielski             virtual SlideBitmapSharedPtr
152*b1cdbd2cSJim Jagielski                 getCurrentSlideBitmap( const UnoViewSharedPtr& rView ) const = 0;
153*b1cdbd2cSJim Jagielski         };
154*b1cdbd2cSJim Jagielski 
155*b1cdbd2cSJim Jagielski         typedef ::boost::shared_ptr< Slide > SlideSharedPtr;
156*b1cdbd2cSJim Jagielski 
157*b1cdbd2cSJim Jagielski         class EventQueue;
158*b1cdbd2cSJim Jagielski         class CursorManager;
159*b1cdbd2cSJim Jagielski         class EventMultiplexer;
160*b1cdbd2cSJim Jagielski         class ActivitiesQueue;
161*b1cdbd2cSJim Jagielski         class UserEventQueue;
162*b1cdbd2cSJim Jagielski         class RGBColor;
163*b1cdbd2cSJim Jagielski 
164*b1cdbd2cSJim Jagielski         /** Construct from XDrawPage
165*b1cdbd2cSJim Jagielski 
166*b1cdbd2cSJim Jagielski             The Slide object generally works in XDrawPage model
167*b1cdbd2cSJim Jagielski             coordinates, that is, the page will have the width and
168*b1cdbd2cSJim Jagielski             height as specified in the XDrawPage's property
169*b1cdbd2cSJim Jagielski             set. The top, left corner of the page will be rendered
170*b1cdbd2cSJim Jagielski             at (0,0) in the given canvas' view coordinate system.
171*b1cdbd2cSJim Jagielski 
172*b1cdbd2cSJim Jagielski             Does not render anything initially
173*b1cdbd2cSJim Jagielski 
174*b1cdbd2cSJim Jagielski             @param xDrawPage
175*b1cdbd2cSJim Jagielski             Page to display on this slide
176*b1cdbd2cSJim Jagielski 
177*b1cdbd2cSJim Jagielski             @param xRootNode
178*b1cdbd2cSJim Jagielski             Root of the SMIL animation tree. Used to animate the slide.
179*b1cdbd2cSJim Jagielski 
180*b1cdbd2cSJim Jagielski             @param rEventQueue
181*b1cdbd2cSJim Jagielski             EventQueue. Used to post events.
182*b1cdbd2cSJim Jagielski 
183*b1cdbd2cSJim Jagielski             @param rActivitiesQueue
184*b1cdbd2cSJim Jagielski             ActivitiesQueue. Used to run animations.
185*b1cdbd2cSJim Jagielski 
186*b1cdbd2cSJim Jagielski             @param rEventMultiplexer
187*b1cdbd2cSJim Jagielski             Event source
188*b1cdbd2cSJim Jagielski 
189*b1cdbd2cSJim Jagielski             @param rUserEventQueue
190*b1cdbd2cSJim Jagielski             UserEeventQueue
191*b1cdbd2cSJim Jagielski         */
192*b1cdbd2cSJim Jagielski         SlideSharedPtr createSlide( const ::com::sun::star::uno::Reference<
193*b1cdbd2cSJim Jagielski                                        ::com::sun::star::drawing::XDrawPage >& 		    xDrawPage,
194*b1cdbd2cSJim Jagielski                                    const ::com::sun::star::uno::Reference<
195*b1cdbd2cSJim Jagielski                                        ::com::sun::star::drawing::XDrawPagesSupplier >& xDrawPages,
196*b1cdbd2cSJim Jagielski                                     const ::com::sun::star::uno::Reference<
197*b1cdbd2cSJim Jagielski                                        ::com::sun::star::animations::XAnimationNode >&  xRootNode,
198*b1cdbd2cSJim Jagielski                                     EventQueue&									        rEventQueue,
199*b1cdbd2cSJim Jagielski                                     EventMultiplexer&								    rEventMultiplexer,
200*b1cdbd2cSJim Jagielski                                     ScreenUpdater&                                      rScreenUpdater,
201*b1cdbd2cSJim Jagielski                                     ActivitiesQueue&								    rActivitiesQueue,
202*b1cdbd2cSJim Jagielski                                     UserEventQueue&									    rUserEventQueue,
203*b1cdbd2cSJim Jagielski                                     CursorManager&                                      rCursorManager,
204*b1cdbd2cSJim Jagielski                                     const UnoViewContainer&                             rViewContainer,
205*b1cdbd2cSJim Jagielski                                     const ::com::sun::star::uno::Reference<
206*b1cdbd2cSJim Jagielski                                        ::com::sun::star::uno::XComponentContext >&      xContext,
207*b1cdbd2cSJim Jagielski                                     const ShapeEventListenerMap&                        rShapeListenerMap,
208*b1cdbd2cSJim Jagielski                                     const ShapeCursorMap&                               rShapeCursorMap,
209*b1cdbd2cSJim Jagielski                                     const PolyPolygonVector&                            rPolyPolygonVector,
210*b1cdbd2cSJim Jagielski                                     RGBColor const&                                     aUserPaintColor,
211*b1cdbd2cSJim Jagielski                                     double                                              dUserPaintStrokeWidth,
212*b1cdbd2cSJim Jagielski                                     bool                                                bUserPaintEnabled,
213*b1cdbd2cSJim Jagielski                                     bool                                                bIntrinsicAnimationsAllowed,
214*b1cdbd2cSJim Jagielski                                     bool                                                bDisableAnimationZOrder );
215*b1cdbd2cSJim Jagielski     }
216*b1cdbd2cSJim Jagielski }
217*b1cdbd2cSJim Jagielski 
218*b1cdbd2cSJim Jagielski #endif /* INCLUDED_SLIDESHOW_SLIDE_HXX */
219