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 #ifndef META_SRC_EASING_CURVE_H 16 #define META_SRC_EASING_CURVE_H 17 18 #include <meta/base/namespace.h> 19 #include <meta/interface/animation/builtin_animations.h> 20 #include <meta/interface/builtin_objects.h> 21 #include <meta/interface/curves/intf_easing_curve.h> 22 23 #include "base_object.h" 24 META_BEGIN_NAMESPACE()25META_BEGIN_NAMESPACE() 26 27 namespace Curves { 28 namespace Easing { 29 30 // Declares a class which implements IEasingCurve interface 31 #define META_DECLARE_EASING_CURVE(name) \ 32 class name##EasingCurve final : public IntroduceInterfaces<BaseObject, IEasingCurve> { \ 33 META_OBJECT(name##EasingCurve, META_NS::ClassId::name##EasingCurve, IntroduceInterfaces) \ 34 float Transform(float t) const override; \ 35 }; 36 37 META_DECLARE_EASING_CURVE(Linear) 38 META_DECLARE_EASING_CURVE(InQuad) 39 META_DECLARE_EASING_CURVE(OutQuad) 40 META_DECLARE_EASING_CURVE(InOutQuad) 41 META_DECLARE_EASING_CURVE(InCubic) 42 META_DECLARE_EASING_CURVE(OutCubic) 43 META_DECLARE_EASING_CURVE(InOutCubic) 44 META_DECLARE_EASING_CURVE(InSine) 45 META_DECLARE_EASING_CURVE(OutSine) 46 META_DECLARE_EASING_CURVE(InOutSine) 47 META_DECLARE_EASING_CURVE(InQuart) 48 META_DECLARE_EASING_CURVE(OutQuart) 49 META_DECLARE_EASING_CURVE(InOutQuart) 50 META_DECLARE_EASING_CURVE(InQuint) 51 META_DECLARE_EASING_CURVE(OutQuint) 52 META_DECLARE_EASING_CURVE(InOutQuint) 53 META_DECLARE_EASING_CURVE(InExpo) 54 META_DECLARE_EASING_CURVE(OutExpo) 55 META_DECLARE_EASING_CURVE(InOutExpo) 56 META_DECLARE_EASING_CURVE(InCirc) 57 META_DECLARE_EASING_CURVE(OutCirc) 58 META_DECLARE_EASING_CURVE(InOutCirc) 59 META_DECLARE_EASING_CURVE(InBack) 60 META_DECLARE_EASING_CURVE(OutBack) 61 META_DECLARE_EASING_CURVE(InOutBack) 62 META_DECLARE_EASING_CURVE(InElastic) 63 META_DECLARE_EASING_CURVE(OutElastic) 64 META_DECLARE_EASING_CURVE(InOutElastic) 65 META_DECLARE_EASING_CURVE(InBounce) 66 META_DECLARE_EASING_CURVE(OutBounce) 67 META_DECLARE_EASING_CURVE(InOutBounce) 68 META_DECLARE_EASING_CURVE(StepStart) 69 META_DECLARE_EASING_CURVE(StepEnd) 70 71 #undef META_DECLARE_EASING_CURVE 72 73 } // namespace Easing 74 } // namespace Curves 75 76 META_END_NAMESPACE() 77 78 #endif 79