1 /* 2 * Copyright (c) 2024 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 META_SRC_ANIMATION_SEQUENTIAL_ANIMATION_H 17 #define META_SRC_ANIMATION_SEQUENTIAL_ANIMATION_H 18 19 #include "animation.h" 20 #include "staggered_animation_state.h" 21 META_BEGIN_NAMESPACE()22META_BEGIN_NAMESPACE() 23 24 namespace Internal { 25 26 class SequentialAnimation final : public BaseAnimationContainerFwd<ISequentialAnimation> { 27 META_OBJECT(SequentialAnimation, META_NS::ClassId::SequentialAnimation, BaseAnimationContainerFwd) 28 public: 29 SequentialAnimation() = default; 30 ~SequentialAnimation() override = default; 31 32 bool Build(const IMetadata::Ptr& data) override; 33 34 private: 35 AnimationState::AnimationStateParams GetParams() override; 36 void Evaluate() override; 37 void ChildrenChanged(); 38 39 IContainer& GetContainer() noexcept override 40 { 41 return state_.GetContainerInterface(); 42 } 43 const IContainer& GetContainer() const noexcept override 44 { 45 return state_.GetContainerInterface(); 46 } 47 Internal::SequentialAnimationState& GetState() noexcept override 48 { 49 return state_; 50 } 51 Internal::SequentialAnimationState state_; 52 }; 53 54 } // namespace Internal 55 56 META_END_NAMESPACE() 57 58 #endif // META_SRC_ANIMATION_SEQUENTIAL_ANIMATION_H 59