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 
16 #ifndef OHOS_ACE_FRAMEWORK_CJ_GIRD_ROW_FFI_H
17 #define OHOS_ACE_FRAMEWORK_CJ_GIRD_ROW_FFI_H
18 
19 #include <cstdint>
20 
21 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
22 
23 using VectorFloat64Handle = void*;
24 using VectorInt32Handle = void*;
25 
26 extern "C" {
27 struct GridRowCreateWithFloat64Int32 {
28     double gutterValue;
29     int32_t gutterUnit;
30     int32_t columns;
31     VectorFloat64Handle breakpointVals;
32     VectorInt32Handle breakpointUnits;
33     int32_t breakpointReference;
34     int32_t direction;
35 };
36 
37 struct GridRowColumnOption {
38     int32_t xs;
39     int32_t sm;
40     int32_t md;
41     int32_t lg;
42     int32_t xl;
43     int32_t xxl;
44 };
45 
46 struct AtCGridRowSizeOption {
47     struct Unit {
48         double value;
49         int32_t unit;
50     };
51     Unit data[6];
52 };
53 
54 struct GridRowCreateWithFloat64ColumnOption {
55     double gutterValue;
56     int32_t gutterUnit;
57     GridRowColumnOption columns;
58     VectorFloat64Handle breakpointVals;
59     VectorInt32Handle breakpointUnits;
60     int32_t breakpointReference;
61     int32_t direction;
62 };
63 
64 struct GridRowCreateWithFloat64OptionColumnOption {
65     double x;
66     int32_t xUnit;
67     double y;
68     int32_t yUnit;
69     GridRowColumnOption columns;
70     VectorFloat64Handle breakpointVals;
71     VectorInt32Handle breakpointUnits;
72     int32_t breakpointReference;
73     int32_t direction;
74 };
75 
76 struct GridRowCreateWithSizeOptionColumnOption {
77     AtCGridRowSizeOption x;
78     AtCGridRowSizeOption y;
79     GridRowColumnOption columns;
80     VectorFloat64Handle breakpointVals;
81     VectorInt32Handle breakpointUnits;
82     int32_t breakpointReference;
83     int32_t direction;
84 };
85 
86 struct GridRowCreateWithFloat64OptionInt32 {
87     double x;
88     int32_t xUnit;
89     double y;
90     int32_t yUnit;
91     int32_t columns;
92     VectorFloat64Handle breakpointVals;
93     VectorInt32Handle breakpointUnits;
94     int32_t breakpointReference;
95     int32_t direction;
96 };
97 
98 struct GridRowCreateWithSizeOptionInt32 {
99     AtCGridRowSizeOption x;
100     AtCGridRowSizeOption y;
101     int32_t columns;
102     VectorFloat64Handle breakpointVals;
103     VectorInt32Handle breakpointUnits;
104     int32_t breakpointReference;
105     int32_t direction;
106 };
107 
108 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreate();
109 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreateWithFloat64Int32(GridRowCreateWithFloat64Int32 createOption);
110 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreateWithFloat64ColumnOption(
111     GridRowCreateWithFloat64ColumnOption createOption);
112 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreateWithFloat64OptionColumnOption(
113     GridRowCreateWithFloat64OptionColumnOption createOption);
114 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreateWithSizeOptionColumnOption(
115     GridRowCreateWithSizeOptionColumnOption createOption);
116 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreateWithFloat64OptionInt32(GridRowCreateWithFloat64OptionInt32 createOption);
117 CJ_EXPORT void FfiOHOSAceFrameworkGridRowCreateWithSizeOptionInt32(GridRowCreateWithSizeOptionInt32 createOption);
118 CJ_EXPORT void FfiOHOSAceFrameworkGridRowSetHeight(double height, int32_t heightUnit);
119 CJ_EXPORT void FfiOHOSAceFrameworkGridRowBreakpointEvent(void (*callback)(const char*));
120 CJ_EXPORT void FfiOHOSAceFrameworkGridRowAlignItem(int32_t alignItem);
121 }
122 
123 #endif // OHOS_ACE_FRAMEWORK_CJ_GIRD_ROW_FFI_H
124