Bump version to 6.4-15
[LibreOffice.git] / slideshow / source / inc / slide.hxx
blobc269b9f4164df315f7cc66863b804d06b6d6e717
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_SLIDE_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_SLIDE_HXX
23 #include "shapemanager.hxx"
24 #include "subsettableshapemanager.hxx"
25 #include "unoviewcontainer.hxx"
26 #include "slidebitmap.hxx"
27 #include "shapemaps.hxx"
29 #include <memory>
31 namespace com { namespace sun { namespace star {
32 namespace drawing {
33 class XDrawPage;
34 class XDrawPagesSupplier;
36 namespace uno {
37 class XComponentContext;
39 namespace animations {
40 class XAnimationNode;
41 } } } }
43 namespace basegfx
45 class B2IVector;
48 /* Definition of Slide interface */
50 namespace slideshow
52 namespace internal
54 class RGBColor;
55 class ScreenUpdater;
56 typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector;
57 class Slide
59 public:
60 // Showing
63 /** Prepares to show slide.
65 Call this method to reduce the timeout show(), and
66 getInitialSlideBitmap() need to complete. If
67 prefetch() is not called explicitly, the named
68 methods will call it implicitly.
70 virtual void prefetch() = 0;
72 /** Shows the slide on all registered views
74 After this call, the slide will render itself to the
75 views, and start its animations.
77 @param bSlideBackgoundPainted
78 When true, the initial slide content on the background
79 layer is already rendered (e.g. from a previous slide
80 transition). When false, Slide renders initial content of
81 slide.
83 virtual void show( bool bSlideBackgoundPainted ) = 0;
85 /** Force-ends the slide
87 After this call, the slide has stopped all animations,
88 and ceased rendering/visualization on all views.
90 virtual void hide() = 0;
93 // Queries
96 /** Query the size of this slide in user coordinates
98 This value is retrieved from the XDrawPage properties.
100 virtual basegfx::B2ISize getSlideSize() const = 0;
102 /// Gets the underlying API page
103 virtual css::uno::Reference< css::drawing::XDrawPage > getXDrawPage() const = 0;
105 /// Gets the animation node.
106 virtual css::uno::Reference< css::animations::XAnimationNode > getXAnimationNode() const = 0;
108 ///Gets the slide Polygons
109 virtual PolyPolygonVector getPolygons() = 0;
111 ///Draw the slide Polygons
112 virtual void drawPolygons() const = 0;
114 ///Check if paint overlay is already active
115 virtual bool isPaintOverlayActive() const = 0;
117 virtual void enablePaintOverlay() = 0;
119 virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0;
121 // Slide bitmaps
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;
147 protected:
148 ~Slide() {}
151 typedef ::std::shared_ptr< Slide > SlideSharedPtr;
153 class EventQueue;
154 class CursorManager;
155 class MediaFileManager;
156 class EventMultiplexer;
157 class ActivitiesQueue;
158 class UserEventQueue;
159 class RGBColor;
161 /** Construct from XDrawPage
163 The Slide object generally works in XDrawPage model
164 coordinates, that is, the page will have the width and
165 height as specified in the XDrawPage's property
166 set. The top, left corner of the page will be rendered
167 at (0,0) in the given canvas' view coordinate system.
169 Does not render anything initially
171 @param xDrawPage
172 Page to display on this slide
174 @param xRootNode
175 Root of the SMIL animation tree. Used to animate the slide.
177 @param rEventQueue
178 EventQueue. Used to post events.
180 @param rActivitiesQueue
181 ActivitiesQueue. Used to run animations.
183 @param rEventMultiplexer
184 Event source
186 @param rUserEventQueue
187 UserEeventQueue
189 SlideSharedPtr createSlide( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage,
190 const css::uno::Reference< css::drawing::XDrawPagesSupplier >& xDrawPages,
191 const css::uno::Reference< css::animations::XAnimationNode >& xRootNode,
192 EventQueue& rEventQueue,
193 EventMultiplexer& rEventMultiplexer,
194 ScreenUpdater& rScreenUpdater,
195 ActivitiesQueue& rActivitiesQueue,
196 UserEventQueue& rUserEventQueue,
197 CursorManager& rCursorManager,
198 MediaFileManager& rMediaFileManager,
199 const UnoViewContainer& rViewContainer,
200 const css::uno::Reference< css::uno::XComponentContext >& xContext,
201 const ShapeEventListenerMap& rShapeListenerMap,
202 const ShapeCursorMap& rShapeCursorMap,
203 const PolyPolygonVector& rPolyPolygonVector,
204 RGBColor const& aUserPaintColor,
205 double dUserPaintStrokeWidth,
206 bool bUserPaintEnabled,
207 bool bIntrinsicAnimationsAllowed,
208 bool bDisableAnimationZOrder );
212 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_SLIDE_HXX
214 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */