1a8c238547a1cb87918917e7a26c232ef824088e
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition / transition-lifecycle-controller.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/internal/transition/transition-lifecycle-controller.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/adaptor-framework/adaptor.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/transition/transition-set-impl.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace Internal
32 {
33 void TransitionLifecycleController::AddTransitions(Dali::Toolkit::TransitionSet transitions)
34 {
35   mTransitionList.push_back(transitions);
36   transitions.FinishedSignal().Connect(this, &TransitionLifecycleController::RemoveTransitions);
37 }
38
39 void TransitionLifecycleController::RemoveTransitions(Dali::Toolkit::TransitionSet &transitions)
40 {
41   mTransitionList.erase(std::remove(mTransitionList.begin(), mTransitionList.end(), transitions));
42 }
43
44 } // namespace Internal
45
46 } // namespace Toolkit
47
48 } // namespace Dali