tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / slideshow / source / engine / activities / discreteactivitybase.hxx
blob1332ad3c5539461ab2d167bbd9aadab9a76a87f1
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_ENGINE_ACTIVITIES_DISCRETEACTIVITYBASE_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_DISCRETEACTIVITYBASE_HXX
23 #include "activitybase.hxx"
24 #include <wakeupevent.hxx>
26 #include <vector>
29 namespace slideshow::internal
31 /** Specialization of ActivityBase for discrete time activities.
33 A discrete time activity is one where time proceeds in
34 discrete steps, i.e. at given time instants.
36 class DiscreteActivityBase : public ActivityBase
38 public:
39 explicit DiscreteActivityBase( const ActivityParameters& rParms );
41 /** Hook for derived classes.
43 This method is called for each discrete time
44 instant, with nFrame denoting the frame number
45 (starting with 0)
47 @param nFrame
48 Current frame number.
50 @param nRepeatCount
51 Number of full repeats already performed
53 virtual void perform( sal_uInt32 nFrame, sal_uInt32 nRepeatCount ) const = 0;
54 virtual void dispose() override;
55 virtual bool perform() override;
57 protected:
58 virtual void startAnimation() override;
60 sal_uInt32 calcFrameIndex( sal_uInt32 nCurrCalls,
61 ::std::size_t nVectorSize ) const;
63 sal_uInt32 calcRepeatCount( sal_uInt32 nCurrCalls,
64 ::std::size_t nVectorSize ) const;
66 ::std::size_t getNumberOfKeyTimes() const { return maDiscreteTimes.size(); }
68 private:
69 WakeupEventSharedPtr mpWakeupEvent;
70 const ::std::vector< double > maDiscreteTimes;
71 const double mnSimpleDuration;
72 sal_uInt32 mnCurrPerformCalls;
77 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_DISCRETEACTIVITYBASE_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */