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 DECLARE_EASING_CURVE(name) \ 32 class name##EasingCurve final \ 33 : public Internal::BaseObjectFwd<name##EasingCurve, ClassId::name##EasingCurve, IEasingCurve> { \ 34 float Transform(float t) const override; \ 35 }; 36 37 DECLARE_EASING_CURVE(Linear) 38 DECLARE_EASING_CURVE(InQuad) 39 DECLARE_EASING_CURVE(OutQuad) 40 DECLARE_EASING_CURVE(InOutQuad) 41 DECLARE_EASING_CURVE(InCubic) 42 DECLARE_EASING_CURVE(OutCubic) 43 DECLARE_EASING_CURVE(InOutCubic) 44 DECLARE_EASING_CURVE(InSine) 45 DECLARE_EASING_CURVE(OutSine) 46 DECLARE_EASING_CURVE(InOutSine) 47 DECLARE_EASING_CURVE(InQuart) 48 DECLARE_EASING_CURVE(OutQuart) 49 DECLARE_EASING_CURVE(InOutQuart) 50 DECLARE_EASING_CURVE(InQuint) 51 DECLARE_EASING_CURVE(OutQuint) 52 DECLARE_EASING_CURVE(InOutQuint) 53 DECLARE_EASING_CURVE(InExpo) 54 DECLARE_EASING_CURVE(OutExpo) 55 DECLARE_EASING_CURVE(InOutExpo) 56 DECLARE_EASING_CURVE(InCirc) 57 DECLARE_EASING_CURVE(OutCirc) 58 DECLARE_EASING_CURVE(InOutCirc) 59 DECLARE_EASING_CURVE(InBack) 60 DECLARE_EASING_CURVE(OutBack) 61 DECLARE_EASING_CURVE(InOutBack) 62 DECLARE_EASING_CURVE(InElastic) 63 DECLARE_EASING_CURVE(OutElastic) 64 DECLARE_EASING_CURVE(InOutElastic) 65 DECLARE_EASING_CURVE(InBounce) 66 DECLARE_EASING_CURVE(OutBounce) 67 DECLARE_EASING_CURVE(InOutBounce) 68 DECLARE_EASING_CURVE(StepStart) 69 DECLARE_EASING_CURVE(StepEnd) 70 71 } // namespace Easing 72 } // namespace Curves 73 74 META_END_NAMESPACE() 75 76 #endif 77