Bump version to 24.04.3.4
[LibreOffice.git] / slideshow / source / inc / activity.hxx
blob5de30c79d9eb818e0832dff79cc83a41540bb199
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_ACTIVITY_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_ACTIVITY_HXX
23 #include <memory>
25 #include "disposable.hxx"
28 /* Definition of Activity interface */
30 namespace slideshow::internal
33 class Activity : public Disposable, public virtual SharedPtrAble
35 public:
36 /** Perform the activity associated with this interface's
37 implementation.
39 @return true, if activity continues, or false, if activity has
40 ended.
42 virtual bool perform() = 0;
44 /** Calculates whether the activity lags time.
46 If this method returns a time lag greater than 0.0,
47 the ActivitiesQueue will adjust the global slideshow
48 time, by subtracting the given amount of lag.
50 @return time lag or 0.0. Value must be greater or
51 equal than zero.
53 virtual double calcTimeLag() const = 0;
55 /** Query whether this activity is still continuing
57 @return true, if this activity still
58 continues. Returns false, if activity has ended. It is
59 required that operator() returns false, when
60 isActive() returns false. Furthermore, it is required
61 that the inactive state is persistent; an activity
62 that has become inactive (i.e. isActive() once
63 returned false) must stay in that state eternally.
65 virtual bool isActive() const = 0;
67 /** Notifies the Activity that it has now left the
68 ActivitiesQueue
70 Use this method to react on the queue removal
71 event. For animated shapes, this is e.g. used to
72 switch back to the non-sprite presentation mode of the
73 shape.
75 virtual void dequeued() = 0;
77 /** Forces this activity deactivate and get to its end state
78 (if possible), but does _not_ dispose.
80 virtual void end() = 0;
83 typedef ::std::shared_ptr< Activity > ActivitySharedPtr;
87 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_ACTIVITY_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */