DALi Version 2.1.5
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition / transition-lifecycle-controller.h
1 #ifndef DALI_TOOLKIT_INTERNAL_TRANSITION_PLAYLIST_H
2 #define DALI_TOOLKIT_INTERNAL_TRANSITION_PLAYLIST_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <cstdio>
23 #include <memory>
24 #include <mutex>
25 #include <vector>
26
27 // INTERNAL INCLUDES
28 #include <dali-toolkit/public-api/transition/transition-set.h>
29
30 namespace Dali
31 {
32 namespace Toolkit
33 {
34 namespace Internal
35 {
36
37 class TransitionLifecycleController : public ConnectionTracker
38 {
39 public:
40   static TransitionLifecycleController& GetInstance();
41
42   void AddTransitions(Dali::Toolkit::TransitionSet transitions);
43
44 private:
45
46   void RemoveTransitions(Dali::Toolkit::TransitionSet &transitions);
47
48   /**
49    * Construct a new TransitionLifecycleController.
50    */
51   TransitionLifecycleController() = default;
52
53   // Undefined
54   TransitionLifecycleController(const TransitionLifecycleController&) = delete;
55
56   // Undefined
57   TransitionLifecycleController& operator=(const TransitionLifecycleController& rhs) = delete;
58
59 private:
60   std::vector<Dali::Toolkit::TransitionSet>             mTransitionList;
61   static std::unique_ptr<TransitionLifecycleController> mInstance;
62   static std::once_flag                                 mOnceFlag;
63 };
64
65 } // namespace Internal
66
67 } // namespace Toolkit
68
69 } // namespace Dali
70
71 #endif // DALI_TOOLKIT_INTERNAL_TRANSITION_PLAYLIST_H
72 ;