• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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_INTERFACES_INNER_API_ACE_KIT_INCLUDE_ANIMATION_ANIMATION_CONSTANTS_H
17 #define FOUNDATION_ACE_INTERFACES_INNER_API_ACE_KIT_INCLUDE_ANIMATION_ANIMATION_CONSTANTS_H
18 
19 #include <atomic>
20 #include <string>
21 #include <cstdint>
22 
23 namespace OHOS::Ace {
24 
25 // Forever animation
26 static constexpr int32_t ANIMATION_REPEAT_INFINITE { -1 };
27 
28 // normalized max duration time.
29 static constexpr float NORMALIZED_DURATION_MAX { 1.0f };
30 
31 // normalized min duration time.
32 static constexpr float NORMALIZED_DURATION_MIN { 0.0f };
33 
34 enum class FillMode {
35     NONE,
36     FORWARDS,
37     BACKWARDS,
38     BOTH,
39 };
40 
41 enum class AnimationDirection {
42     NORMAL,
43     ALTERNATE,
44     REVERSE,
45     ALTERNATE_REVERSE,
46 };
47 
48 enum class AnimationOperation {
49     NONE,
50     PLAY,
51     RUNNING,
52     FINISH,
53     PAUSE,
54     CANCEL,
55     REVERSE,
56 };
57 
58 enum class AnimationType {
59     TRANSLATE,
60     TRANSLATE_X,
61     TRANSLATE_Y,
62     TRANSLATE_Z,
63     TRANSLATE_3D,
64     SCALE,
65     SCALE_X,
66     SCALE_Y,
67     SCALE_Z,
68     SCALE_3D,
69     ROTATE_Z,
70     ROTATE_X,
71     ROTATE_Y,
72     ROTATE,
73     ROTATE_3D,
74     SKEW,
75     SKEW_X,
76     SKEW_Y,
77     MATRIX_3D,
78     MATRIX_2D,
79     PERSPECTIVE
80 };
81 
82 enum class TransitionEffect {
83     NONE,
84     UNFOLD,
85 };
86 
87 enum class TransitionType {
88     ALL,
89     APPEARING,
90     DISAPPEARING
91 };
92 
93 enum class FinishCallbackType {
94     REMOVED = 0,
95     LOGICALLY = 1
96 };
97 
98 enum class AnimationInterface : int8_t {
99     UNKNOWN = -1,
100     ANIMATION,
101     ANIMATE_TO,
102     ANIMATE_TO_IMMEDIATELY,
103     KEYFRAME_ANIMATE_TO,
104     TRANSITION,
105     SHARED_TRANSITION,
106     PAGE_TRANSITION,
107 };
108 
109 enum class AnimationPropertyType : int32_t {
110     ROTATION = 0,
111     TRANSLATION,
112     SCALE,
113     OPACITY,
114 };
115 
116 enum class CancelAnimationStatus : int32_t {
117     SUCCESS = 0,
118     NULL_ANIMATOR,
119     NO_OPEN_CLOSURE,
120     INCORRECT_PARAM_TYPE,
121     EMPTY_PENDING_SYNC_LIST,
122     TASK_EXECUTION_FAILURE,
123 };
124 } // namespace OHOS::Ace
125 
126 #endif // FOUNDATION_ACE_INTERFACES_INNER_API_ACE_KIT_INCLUDE_ANIMATION_ANIMATION_CONSTANTS_H
127