merge the formfield patch from ooo-build
[ooovba.git] / slideshow / source / engine / activities / simplecontinuousactivitybase.hxx
blob966a88efbc443faee7077f37f62ecd79637c8a15
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: simplecontinuousactivitybase.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_SIMPLECONTINUOUSACTIVITYBASE_HXX
32 #define INCLUDED_SLIDESHOW_SIMPLECONTINUOUSACTIVITYBASE_HXX
34 #include "activitybase.hxx"
35 #include <canvas/elapsedtime.hxx>
37 namespace slideshow
39 namespace internal
41 /** Simple, continuous animation.
43 This class implements a simple, continuous animation
44 without considering repeats or acceleration on the
45 perform call. Only useful as a base class, you
46 probably want to use ContinuousActivityBase.
48 class SimpleContinuousActivityBase : public ActivityBase
50 public:
51 SimpleContinuousActivityBase( const ActivityParameters& rParms );
53 virtual double calcTimeLag() const;
54 virtual bool perform();
56 protected:
57 /** Hook for derived classes
59 This method will be called from perform().
61 @param nSimpleTime
62 Simple animation time, without repeat,
63 acceleration or deceleration applied. This value
64 is always in the [0,1] range, the repeat is
65 accounted for with the nRepeatCount parameter.
67 @param nRepeatCount
68 Number of full repeats already performed
70 virtual void simplePerform( double nSimpleTime, sal_uInt32 nRepeatCount ) const = 0;
72 virtual void startAnimation();
74 private:
75 /// Time elapsed since activity started
76 ::canvas::tools::ElapsedTime maTimer;
78 /// Simple duration of activity
79 const double mnMinSimpleDuration;
81 /// Minimal number of frames to show (see ActivityParameters)
82 const sal_uInt32 mnMinNumberOfFrames;
84 /// Actual number of frames shown until now.
85 sal_uInt32 mnCurrPerformCalls;
90 #endif /* INCLUDED_SLIDESHOW_SIMPLECONTINUOUSACTIVITYBASE_HXX */