1 /*
2  * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef RENDER_SERVICE_CLIENT_CORE_ANIMATION_RS_ANIMATION_GROUP_H
17 #define RENDER_SERVICE_CLIENT_CORE_ANIMATION_RS_ANIMATION_GROUP_H
18 
19 #include <functional>
20 #include <list>
21 #include <memory>
22 
23 #include "animation/rs_animation.h"
24 #include "common/rs_common_def.h"
25 #include "modifier/rs_modifier_type.h"
26 
27 namespace OHOS {
28 namespace Rosen {
29 class AnimationCallback;
30 
31 class RSC_EXPORT RSAnimationGroup : public RSAnimation {
32 public:
33     RSAnimationGroup() = default;
34     ~RSAnimationGroup() = default;
35 
36     void AddAnimation(const std::shared_ptr<RSAnimation>& animation);
37     void RemoveAnimation(const std::shared_ptr<RSAnimation>& animation);
38 
39 protected:
40     void OnStart() override;
41     void OnPause() override;
42     void OnResume() override;
43     void OnFinish() override;
44     void OnReverse() override;
45     void OnSetFraction(float fraction) override;
46     PropertyId GetPropertyId() const override;
47 
48     std::list<std::shared_ptr<RSAnimation>> animations_;
49 };
50 } // namespace Rosen
51 } // namespace OHOS
52 
53 #endif // RENDER_SERVICE_CLIENT_CORE_ANIMATION_RS_ANIMATION_GROUP_H
54