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 INTPU_METHOD_FFI_STRUCTS_H 17 #define INTPU_METHOD_FFI_STRUCTS_H 18 19 #include <cstdint> 20 21 #include "cj_ffi/cj_common_ffi.h" 22 23 extern "C" { 24 const int32_t ERR_NO_MEMORY = -2; 25 struct CInputMethodProperty { 26 char* name; 27 char* id; 28 char* label; 29 uint32_t labelId; 30 char* icon; 31 uint32_t iconId; 32 }; 33 34 struct CInputMethodSubtype { 35 char* name; 36 char* id; 37 char* locale; 38 char* language; 39 char* label; 40 uint32_t labelId; 41 char* icon; 42 uint32_t iconId; 43 char* mode; 44 }; 45 46 struct RetInputMethodSubtype { 47 int32_t code; 48 int64_t size; 49 CInputMethodSubtype *head; 50 }; 51 52 struct RetInputMethodProperty { 53 int32_t code; 54 int64_t size; 55 CInputMethodProperty *head; 56 }; 57 58 struct CElementName { 59 char* deviceId; 60 char* bundleName; 61 char* abilityName; 62 char* moduleName; 63 }; 64 65 struct CInputAttribute { 66 int8_t textInputType; 67 int8_t enterKeyType; 68 }; 69 70 struct CCursorInfo { 71 double left; 72 double top; 73 double width; 74 double height; 75 }; 76 77 struct Range { 78 int32_t start; 79 int32_t end; 80 }; 81 82 struct CTextConfig { 83 CInputAttribute inputAttrbute; 84 CCursorInfo cursor; 85 Range range; 86 uint32_t windowId; 87 }; 88 } 89 90 91 #endif // INTPU_METHOD_FFI_STRUCTS_H