1 #ifndef __DALI_INTERNAL_ANIMATION_PLAYLIST_H__
2 #define __DALI_INTERNAL_ANIMATION_PLAYLIST_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/animation/animation.h>
23 #include <dali/public-api/common/set-wrapper.h>
24 #include <dali/internal/event/common/complete-notification-interface.h>
35 * AnimationPlaylist provides notifications to applications when animations are finished.
36 * It reference-counts playing animations, to allow "fire and forget" behaviour.
38 class AnimationPlaylist : public CompleteNotificationInterface
43 * Create an AnimationPlaylist.
44 * @return A newly allocated animation playlist.
46 static AnimationPlaylist* New();
51 virtual ~AnimationPlaylist();
54 * Called when an animation is constructed.
56 void AnimationCreated( Animation& animation );
59 * Called when an animation is destroyed.
61 void AnimationDestroyed( Animation& animation );
64 * Called when an animation is playing.
65 * @post The animation will be referenced by AnimationPlaylist, until the "Finished" signal is emitted.
67 void OnPlay( Animation& animation );
70 * Called when an animation is cleared.
71 * @post The animation will no longer be referenced by AnimationPlaylist.
73 void OnClear( Animation& animation );
78 * Create an AnimationPlaylist.
83 AnimationPlaylist(const AnimationPlaylist&);
86 AnimationPlaylist& operator=(const AnimationPlaylist& rhs);
88 private: // from CompleteNotificationInterface
91 * @copydoc CompleteNotificationInterface::NotifyCompleted()
93 virtual void NotifyCompleted();
97 std::set< Animation* > mAnimations; ///< All existing animations (not referenced)
98 std::set< Dali::Animation > mPlaylist; ///< The currently playing animations (reference counted)
102 } // namespace Internal
106 #endif // __DALI_INTERNAL_NOTIFICATION_MANAGER_H__