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