122736c2fSopenharmony_ci/*
222736c2fSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
322736c2fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
422736c2fSopenharmony_ci * you may not use this file except in compliance with the License.
522736c2fSopenharmony_ci * You may obtain a copy of the License at
622736c2fSopenharmony_ci *
722736c2fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
822736c2fSopenharmony_ci *
922736c2fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1022736c2fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1122736c2fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1222736c2fSopenharmony_ci * See the License for the specific language governing permissions and
1322736c2fSopenharmony_ci * limitations under the License.
1422736c2fSopenharmony_ci */
1522736c2fSopenharmony_ci
1622736c2fSopenharmony_ci#ifndef INPUT_METHOD_FFI_H
1722736c2fSopenharmony_ci#define INPUT_METHOD_FFI_H
1822736c2fSopenharmony_ci
1922736c2fSopenharmony_ci#include "input_method_ffi_structs.h"
2022736c2fSopenharmony_ci
2122736c2fSopenharmony_ciextern "C" {
2222736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodGetDefaultInputMethod(CInputMethodProperty &props);
2322736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodGetCurrentInputMethod(CInputMethodProperty &props);
2422736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodSwitchInputMethod(bool &result, CInputMethodProperty props);
2522736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodSwitchCurrentInputMethodSubtype(bool &result, CInputMethodSubtype target);
2622736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodGetCurrentInputMethodSubtype(CInputMethodSubtype &props);
2722736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodSwitchCurrentInputMethodAndSubtype(bool &result, CInputMethodProperty target,
2822736c2fSopenharmony_ci        CInputMethodSubtype subtype);
2922736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodGetSystemInputMethodConfigAbility(CElementName &elem);
3022736c2fSopenharmony_ci    FFI_EXPORT RetInputMethodSubtype FfiInputMethodSettingListInputMethodSubtype(CInputMethodProperty props);
3122736c2fSopenharmony_ci    FFI_EXPORT RetInputMethodSubtype FfiInputMethodSettingListCurrentInputMethodSubtype();
3222736c2fSopenharmony_ci    FFI_EXPORT RetInputMethodProperty FfiInputMethodSettingGetInputMethods(bool enable);
3322736c2fSopenharmony_ci    FFI_EXPORT RetInputMethodProperty FfiInputMethodSettingGetAllInputMethods();
3422736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodSettingOn(uint32_t type, void (*func)(CInputMethodProperty, CInputMethodSubtype));
3522736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodSettingOff(uint32_t type);
3622736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodSettingShowOptionalInputMethods(bool& result);
3722736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerOn(int8_t type, int64_t id);
3822736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerOff(int8_t type);
3922736c2fSopenharmony_ci
4022736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerAttach(bool showKeyboard, CTextConfig txtCfg);
4122736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerDetach();
4222736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerShowTextInput();
4322736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerHideTextInput();
4422736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerSetCallingWindow(uint32_t windowId);
4522736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerUpdateCursor(CCursorInfo cursor);
4622736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerChangeSelection(char *text, int32_t start, int32_t end);
4722736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerUpdateAttribute(CInputAttribute inputAttribute);
4822736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerShowSoftKeyboard();
4922736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerHideSoftKeyboard();
5022736c2fSopenharmony_ci    FFI_EXPORT int32_t FfiInputMethodControllerStopInputSession();
5122736c2fSopenharmony_ci}
5222736c2fSopenharmony_ci
5322736c2fSopenharmony_ci#endif // INPUT_METHOD_FFI_H