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