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_SCROLLBAR_FFI_H
17 #define OHOS_ACE_FRAMEWORK_CJ_SCROLLBAR_FFI_H
18 
19 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_common_ffi.h"
20 #include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
21 
22 extern "C" {
23 struct SearchCreateParam {
24     const char* value;
25     const char* placeholder;
26     int64_t iconID;
27     uint32_t iconType;
28     const char* iconParams;
29     int64_t controllerID;
30 };
31 CJ_EXPORT void FfiOHOSAceFrameworkSearchCreateByIconID(SearchCreateParam value);
32 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetSearchButton(const char* text);
33 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetPlaceholderColor(uint32_t color);
34 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetPlaceholderFont(
35     double fontSize, int32_t sizeUnit, const char* fontWeight, int32_t fontStyle, const char* fontFamily);
36 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetTextFont(
37     double fontSize, int32_t sizeUnit, const char* fontWeight, int32_t fontStyle, const char* fontFamily);
38 
39 struct SearchSetBorder {
40     double width;
41     int32_t widthUnit;
42     uint32_t color;
43     double radius;
44     int32_t radiusUnit;
45     int32_t style;
46 };
47 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetBorder(SearchSetBorder value);
48 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetBorderWidth(double width, int32_t widthUnit);
49 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetBorderColor(uint32_t color);
50 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetBorderStyle(int32_t style);
51 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetBorderRadius(double radius, int32_t radiusUnit);
52 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetHeight(double height, int32_t heightUnit);
53 CJ_EXPORT void FfiOHOSAceFrameworkSearchSetCopyOption(int32_t copyOption);
54 CJ_EXPORT void FfiOHOSAceFrameworkSearchOnSubmit(void (*callback)(const char* value));
55 CJ_EXPORT void FfiOHOSAceFrameworkSearchOnChange(void (*callback)(const char* value));
56 CJ_EXPORT void FfiOHOSAceFrameworkSearchOnCopy(void (*callback)(const char* value));
57 CJ_EXPORT void FfiOHOSAceFrameworkSearchOnCut(void (*callback)(const char* value));
58 CJ_EXPORT void FfiOHOSAceFrameworkSearchOnPaste(void (*callback)(const char* value));
59 
60 CJ_EXPORT int64_t FfiOHOSAceFrameworkSearchController();
61 CJ_EXPORT void FfiOHOSAceFrameworkSearchCaretPosition(int64_t selfID, int32_t carePosition);
62 }
63 
64 #endif // OHOS_ACE_FRAMEWORK_CJ_SCROLLBAR_FFI_H
65