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_ACTIVITY_HXX
21 : #define INCLUDED_SLIDESHOW_ACTIVITY_HXX
22 :
23 : #include <sal/types.h>
24 :
25 : #include <boost/shared_ptr.hpp>
26 :
27 : #include "disposable.hxx"
28 :
29 :
30 : /* Definition of Activity interface */
31 :
32 : namespace slideshow
33 : {
34 : namespace internal
35 : {
36 :
37 0 : class Activity : public Disposable
38 : {
39 : public:
40 : /** Perform the activity associated with this interface's
41 : implementation.
42 :
43 : @return true, if activity continues, or false, if activity has
44 : ended.
45 : */
46 : virtual bool perform() = 0;
47 :
48 : /** Calculates whether the activity lags time.
49 :
50 : If this method returns a time lag greater than 0.0,
51 : the ActivitiesQueue will adjust the global slideshow
52 : time, by subtracting the given amount of lag.
53 :
54 : @return time lag or 0.0. Value must be greater or
55 : equal than zero.
56 : */
57 : virtual double calcTimeLag() const = 0;
58 :
59 : /** Query whether this activity is still continuing
60 :
61 : @return true, if this activity still
62 : continues. Returns false, if activity has ended. It is
63 : required that operator() returns false, when
64 : isActive() returns false. Furthermore, it is required
65 : that the inactive state is persistent; an activity
66 : that has become inactive (i.e. isActive() once
67 : returned false) must stay in that state eternally.
68 : */
69 : virtual bool isActive() const = 0;
70 :
71 : /** Notifies the Activity that it has now left the
72 : ActivitiesQueue
73 :
74 : Use this method to react on the queue removal
75 : event. For animated shapes, this is e.g. used to
76 : switch back to the non-sprite presentation mode of the
77 : shape.
78 : */
79 : virtual void dequeued() = 0;
80 :
81 : /** Forces this activity deactivate and get to its end state
82 : (if possible), but does _not_ dispose.
83 : */
84 : virtual void end() = 0;
85 : };
86 :
87 : typedef ::boost::shared_ptr< Activity > ActivitySharedPtr;
88 :
89 : }
90 : }
91 :
92 : #endif /* INCLUDED_SLIDESHOW_ACTIVITY_HXX */
93 :
94 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|