Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SLIDESHOW_SLIDE_HXX
21 : #define INCLUDED_SLIDESHOW_SLIDE_HXX
22 :
23 : #include "shapemanager.hxx"
24 : #include "subsettableshapemanager.hxx"
25 : #include "unoviewcontainer.hxx"
26 : #include "slidebitmap.hxx"
27 : #include "shapemaps.hxx"
28 :
29 : #include <boost/shared_ptr.hpp>
30 :
31 : namespace com { namespace sun { namespace star {
32 : namespace drawing {
33 : class XDrawPage;
34 : class XDrawPagesSupplier;
35 : }
36 : namespace uno {
37 : class XComponentContext;
38 : }
39 : namespace animations {
40 : class XAnimationNode;
41 : } } } }
42 :
43 : namespace basegfx
44 : {
45 : class B2IVector;
46 : }
47 :
48 : /* Definition of Slide interface */
49 :
50 : namespace slideshow
51 : {
52 : namespace internal
53 : {
54 : class RGBColor;
55 : class ScreenUpdater;
56 : typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector;
57 0 : class Slide
58 : {
59 : public:
60 : // Showing
61 :
62 :
63 : /** Prepares to show slide.
64 :
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 implicitely.
69 : */
70 : virtual bool prefetch() = 0;
71 :
72 : /** Shows the slide on all registered views
73 :
74 : After this call, the slide will render itself to the
75 : views, and start its animations.
76 :
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.
82 : */
83 : virtual bool show( bool bSlideBackgoundPainted ) = 0;
84 :
85 : /** Force-ends the slide
86 :
87 : After this call, the slide has stopped all animations,
88 : and ceased rendering/visualization on all views.
89 : */
90 : virtual void hide() = 0;
91 :
92 :
93 : // Queries
94 :
95 :
96 : /** Query the size of this slide in user coordinates
97 :
98 : This value is retrieved from the XDrawPage properties.
99 : */
100 : virtual basegfx::B2IVector getSlideSize() const = 0;
101 :
102 : /// Gets the underlying API page
103 : virtual ::com::sun::star::uno::Reference<
104 : ::com::sun::star::drawing::XDrawPage > getXDrawPage() const = 0;
105 :
106 : /// Gets the animation node.
107 : virtual ::com::sun::star::uno::Reference<
108 : ::com::sun::star::animations::XAnimationNode > getXAnimationNode() const = 0;
109 :
110 : ///Gets the slide Polygons
111 : virtual PolyPolygonVector getPolygons() = 0;
112 :
113 : ///Draw the slide Polygons
114 : virtual void drawPolygons() const = 0;
115 :
116 : ///Check if paint overlay is already active
117 : virtual bool isPaintOverlayActive() const = 0;
118 :
119 : virtual void enablePaintOverlay() = 0;
120 : virtual void disablePaintOverlay() = 0;
121 :
122 : virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0;
123 :
124 : // Slide bitmaps
125 :
126 :
127 : /** Request bitmap for current slide appearance.
128 :
129 : The bitmap returned by this method depends on the
130 : current state of the slide and the contained
131 : animations. A newly generated slide will return the
132 : initial slide content here (e.g. with all 'appear'
133 : effect shapes invisible), a slide whose effects are
134 : currently running will return a bitmap corresponding
135 : to the current position on the animation timeline, and
136 : a slide whose effects have all been run will generate
137 : a bitmap with the final slide appearance (e.g. with
138 : all 'hide' effect shapes invisible).
139 :
140 : @param rView
141 : View to retrieve bitmap for (note that the bitmap will
142 : have device-pixel equivalence to the content that
143 : would have been rendered onto the given view). Note
144 : that the view must have been added to this slide
145 : before via viewAdded().
146 : */
147 : virtual SlideBitmapSharedPtr
148 : getCurrentSlideBitmap( const UnoViewSharedPtr& rView ) const = 0;
149 :
150 : protected:
151 0 : ~Slide() {}
152 : };
153 :
154 : typedef ::boost::shared_ptr< Slide > SlideSharedPtr;
155 :
156 : class EventQueue;
157 : class CursorManager;
158 : class EventMultiplexer;
159 : class ActivitiesQueue;
160 : class UserEventQueue;
161 : class RGBColor;
162 :
163 : /** Construct from XDrawPage
164 :
165 : The Slide object generally works in XDrawPage model
166 : coordinates, that is, the page will have the width and
167 : height as specified in the XDrawPage's property
168 : set. The top, left corner of the page will be rendered
169 : at (0,0) in the given canvas' view coordinate system.
170 :
171 : Does not render anything initially
172 :
173 : @param xDrawPage
174 : Page to display on this slide
175 :
176 : @param xRootNode
177 : Root of the SMIL animation tree. Used to animate the slide.
178 :
179 : @param rEventQueue
180 : EventQueue. Used to post events.
181 :
182 : @param rActivitiesQueue
183 : ActivitiesQueue. Used to run animations.
184 :
185 : @param rEventMultiplexer
186 : Event source
187 :
188 : @param rUserEventQueue
189 : UserEeventQueue
190 : */
191 : SlideSharedPtr createSlide( const ::com::sun::star::uno::Reference<
192 : ::com::sun::star::drawing::XDrawPage >& xDrawPage,
193 : const ::com::sun::star::uno::Reference<
194 : ::com::sun::star::drawing::XDrawPagesSupplier >& xDrawPages,
195 : const ::com::sun::star::uno::Reference<
196 : ::com::sun::star::animations::XAnimationNode >& xRootNode,
197 : EventQueue& rEventQueue,
198 : EventMultiplexer& rEventMultiplexer,
199 : ScreenUpdater& rScreenUpdater,
200 : ActivitiesQueue& rActivitiesQueue,
201 : UserEventQueue& rUserEventQueue,
202 : CursorManager& rCursorManager,
203 : const UnoViewContainer& rViewContainer,
204 : const ::com::sun::star::uno::Reference<
205 : ::com::sun::star::uno::XComponentContext >& xContext,
206 : const ShapeEventListenerMap& rShapeListenerMap,
207 : const ShapeCursorMap& rShapeCursorMap,
208 : const PolyPolygonVector& rPolyPolygonVector,
209 : RGBColor const& aUserPaintColor,
210 : double dUserPaintStrokeWidth,
211 : bool bUserPaintEnabled,
212 : bool bIntrinsicAnimationsAllowed,
213 : bool bDisableAnimationZOrder );
214 : }
215 : }
216 :
217 : #endif /* INCLUDED_SLIDESHOW_SLIDE_HXX */
218 :
219 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|