1 /* 2 * Copyright (c) 2021 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 FOUNDATION_ACE_FRAMEWORKS_CORE_ANIMATION_ANIMATION_PUB_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_ANIMATION_ANIMATION_PUB_H 18 19 #include <string> 20 21 namespace OHOS::Ace { 22 23 // Forever animation 24 static constexpr int32_t ANIMATION_REPEAT_INFINITE { -1 }; 25 26 // normalized max duration time. 27 static constexpr float NORMALIZED_DURATION_MAX { 1.0f }; 28 29 // normalized min duration time. 30 static constexpr float NORMALIZED_DURATION_MIN { 0.0f }; 31 32 enum class FillMode { 33 NONE, 34 FORWARDS, 35 BACKWARDS, 36 BOTH, 37 }; 38 39 enum class AnimationDirection { 40 NORMAL, 41 ALTERNATE, 42 REVERSE, 43 ALTERNATE_REVERSE, 44 }; 45 46 enum class AnimationOperation { 47 NONE, 48 PLAY, 49 RUNNING, 50 FINISH, 51 PAUSE, 52 CANCEL, 53 REVERSE, 54 }; 55 56 enum class AnimationType { 57 TRANSLATE, 58 TRANSLATE_X, 59 TRANSLATE_Y, 60 TRANSLATE_Z, 61 TRANSLATE_3D, 62 SCALE, 63 SCALE_X, 64 SCALE_Y, 65 SCALE_Z, 66 SCALE_3D, 67 ROTATE_Z, 68 ROTATE_X, 69 ROTATE_Y, 70 ROTATE, 71 ROTATE_3D, 72 SKEW, 73 SKEW_X, 74 SKEW_Y, 75 MATRIX_3D, 76 MATRIX_2D, 77 PERSPECTIVE 78 }; 79 80 enum class TransitionEffect { 81 NONE, 82 UNFOLD, 83 }; 84 85 enum class TransitionType { 86 ALL, 87 APPEARING, 88 DISAPPEARING 89 }; 90 91 enum class FinishCallbackType { 92 REMOVED = 0, 93 LOGICALLY = 1 94 }; 95 96 enum class AnimationInterface : int32_t { 97 ANIMATION = 0, 98 ANIMATE_TO, 99 ANIMATE_TO_IMMEDIATELY, 100 KEYFRAME_ANIMATE_TO, 101 }; 102 103 const char* GetAnimationInterfaceName(AnimationInterface interfaceName); 104 105 using ShareId = std::string; 106 107 } // namespace OHOS::Ace 108 109 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_ANIMATION_ANIMATION_PUB_H 110