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 26 namespace OHOS { 27 namespace Rosen { 28 class AnimationCallback; 29 30 class RSC_EXPORT RSAnimationGroup : public RSAnimation { 31 public: 32 RSAnimationGroup() = default; 33 ~RSAnimationGroup() = default; 34 35 void AddAnimation(const std::shared_ptr<RSAnimation>& animation); 36 void RemoveAnimation(const std::shared_ptr<RSAnimation>& animation); 37 38 protected: 39 void OnStart() override; 40 void OnPause() override; 41 void OnResume() override; 42 void OnFinish() override; 43 void OnReverse() override; 44 void OnSetFraction(float fraction) override; 45 PropertyId GetPropertyId() const override; 46 47 std::list<std::shared_ptr<RSAnimation>> animations_; 48 }; 49 } // namespace Rosen 50 } // namespace OHOS 51 52 #endif // RENDER_SERVICE_CLIENT_CORE_ANIMATION_RS_ANIMATION_GROUP_H 53