1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "unoviewcontainer.hxx"
24 #include "slidebitmap.hxx"
25 #include "shapemaps.hxx"
29 namespace com::sun::star
{
32 class XDrawPagesSupplier
;
35 class XComponentContext
;
37 namespace animations
{
49 /* Definition of Slide interface */
51 namespace slideshow::internal
55 typedef ::std::vector
< ::cppcanvas::PolyPolygonSharedPtr
> PolyPolygonVector
;
62 /** Prepares to show slide.
64 Call this method to reduce the timeout show(), and
65 getInitialSlideBitmap() need to complete. If
66 prefetch() is not called explicitly, the named
67 methods will call it implicitly.
69 virtual void prefetch() = 0;
71 /** Shows the slide on all registered views
73 After this call, the slide will render itself to the
74 views, and start its animations.
76 @param bSlideBackgroundPainted
77 When true, the initial slide content on the background
78 layer is already rendered (e.g. from a previous slide
79 transition). When false, Slide renders initial content of
82 virtual void show( bool bSlideBackgroundPainted
) = 0;
84 /** Force-ends the slide
86 After this call, the slide has stopped all animations,
87 and ceased rendering/visualization on all views.
89 virtual void hide() = 0;
95 /** Query the size of this slide in user coordinates
97 This value is retrieved from the XDrawPage properties.
99 virtual basegfx::B2ISize
getSlideSize() const = 0;
101 /// Gets the underlying API page
102 virtual css::uno::Reference
< css::drawing::XDrawPage
> getXDrawPage() const = 0;
104 /// Gets the animation node.
105 virtual css::uno::Reference
< css::animations::XAnimationNode
> getXAnimationNode() const = 0;
107 ///Gets the slide Polygons
108 virtual PolyPolygonVector
getPolygons() = 0;
110 ///Draw the slide Polygons
111 virtual void drawPolygons() const = 0;
113 ///Check if paint overlay is already active
114 virtual bool isPaintOverlayActive() const = 0;
116 virtual void enablePaintOverlay() = 0;
118 virtual void update_settings( bool bUserPaintEnabled
, RGBColor
const& aUserPaintColor
, double dUserPaintStrokeWidth
) = 0;
123 /** Request bitmap for current slide appearance.
125 The bitmap returned by this method depends on the
126 current state of the slide and the contained
127 animations. A newly generated slide will return the
128 initial slide content here (e.g. with all 'appear'
129 effect shapes invisible), a slide whose effects are
130 currently running will return a bitmap corresponding
131 to the current position on the animation timeline, and
132 a slide whose effects have all been run will generate
133 a bitmap with the final slide appearance (e.g. with
134 all 'hide' effect shapes invisible).
137 View to retrieve bitmap for (note that the bitmap will
138 have device-pixel equivalence to the content that
139 would have been rendered onto the given view). Note
140 that the view must have been added to this slide
141 before via viewAdded().
143 virtual SlideBitmapSharedPtr
144 getCurrentSlideBitmap( const UnoViewSharedPtr
& rView
) const = 0;
150 typedef ::std::shared_ptr
< Slide
> SlideSharedPtr
;
154 class MediaFileManager
;
155 class EventMultiplexer
;
156 class ActivitiesQueue
;
157 class UserEventQueue
;
160 /** Construct from XDrawPage
162 The Slide object generally works in XDrawPage model
163 coordinates, that is, the page will have the width and
164 height as specified in the XDrawPage's property
165 set. The top, left corner of the page will be rendered
166 at (0,0) in the given canvas' view coordinate system.
168 Does not render anything initially
171 Page to display on this slide
174 Root of the SMIL animation tree. Used to animate the slide.
177 EventQueue. Used to post events.
179 @param rActivitiesQueue
180 ActivitiesQueue. Used to run animations.
182 @param rEventMultiplexer
185 @param rUserEventQueue
188 SlideSharedPtr
createSlide( const css::uno::Reference
< css::drawing::XDrawPage
>& xDrawPage
,
189 const css::uno::Reference
< css::drawing::XDrawPagesSupplier
>& xDrawPages
,
190 const css::uno::Reference
< css::animations::XAnimationNode
>& xRootNode
,
191 EventQueue
& rEventQueue
,
192 EventMultiplexer
& rEventMultiplexer
,
193 ScreenUpdater
& rScreenUpdater
,
194 ActivitiesQueue
& rActivitiesQueue
,
195 UserEventQueue
& rUserEventQueue
,
196 CursorManager
& rCursorManager
,
197 MediaFileManager
& rMediaFileManager
,
198 const UnoViewContainer
& rViewContainer
,
199 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
200 const ShapeEventListenerMap
& rShapeListenerMap
,
201 const ShapeCursorMap
& rShapeCursorMap
,
202 PolyPolygonVector
&& rPolyPolygonVector
,
203 RGBColor
const& aUserPaintColor
,
204 double dUserPaintStrokeWidth
,
205 bool bUserPaintEnabled
,
206 bool bIntrinsicAnimationsAllowed
,
207 bool bDisableAnimationZOrder
);
210 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_SLIDE_HXX
212 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */