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 OHOS_ACE_FRAMEWORK_CJ_ANIMATE_PARAM_FFI_H
16 #define OHOS_ACE_FRAMEWORK_CJ_ANIMATE_PARAM_FFI_H
17 
18 #include <cinttypes>
19 #include <optional>
20 #include <string>
21 #include "core/components/common/properties/animation_option.h"
22 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_common_ffi.h"
23 
24 extern "C" {
25 struct NativeAnimateParam {
26     NativeOptionInt32 duration;
27     NativeOptionFloat32 tempo;
28     NativeOptionCString curve;
29     NativeOptionInt32 delay;
30     NativeOptionInt32 iterations;
31     NativeOptionInt32 playMode;
32     NativeOptionCallBack onFinish;
33     NativeOptionInt32 finishCallbackType;
34     NativeOptionInt32 min;
35     NativeOptionInt32 max;
36     NativeOptionInt32 expected;
37 };
38 
39 struct NativeOptionAnimateParam {
40     bool hasValue;
41     NativeAnimateParam value;
42 };
43 
44 namespace OHOS::Ace::Framework {
45 void ParseCjAnimation(NativeAnimateParam animationValue, AnimationOption& result);
46 }
47 }
48 
49 #endif // OHOS_ACE_FRAMEWORK_CJ_ANIMATE_PARAM_H