17777dab0Sopenharmony_ci/*
27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License.
57777dab0Sopenharmony_ci * You may obtain a copy of the License at
67777dab0Sopenharmony_ci *
77777dab0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87777dab0Sopenharmony_ci *
97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and
137777dab0Sopenharmony_ci * limitations under the License.
147777dab0Sopenharmony_ci */
157777dab0Sopenharmony_ci/**
167777dab0Sopenharmony_ci * @addtogroup InputMethod
177777dab0Sopenharmony_ci * @{
187777dab0Sopenharmony_ci *
197777dab0Sopenharmony_ci * @brief InputMethod provides functions to use input methods and develop input methods.
207777dab0Sopenharmony_ci *
217777dab0Sopenharmony_ci * @since 12
227777dab0Sopenharmony_ci */
237777dab0Sopenharmony_ci
247777dab0Sopenharmony_ci/**
257777dab0Sopenharmony_ci * @file inputmethod_text_avoid_info_capi.h
267777dab0Sopenharmony_ci *
277777dab0Sopenharmony_ci * @brief Provides functions to manage text editor to avoid the keyboard.
287777dab0Sopenharmony_ci *
297777dab0Sopenharmony_ci * @library libohinputmethod.so
307777dab0Sopenharmony_ci * @kit IMEKit
317777dab0Sopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework
327777dab0Sopenharmony_ci * @since 12
337777dab0Sopenharmony_ci * @version 1.0
347777dab0Sopenharmony_ci */
357777dab0Sopenharmony_ci#ifndef OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H
367777dab0Sopenharmony_ci#define OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAPI_H
377777dab0Sopenharmony_ci#include "inputmethod_types_capi.h"
387777dab0Sopenharmony_ci#ifdef __cplusplus
397777dab0Sopenharmony_ciextern "C" {
407777dab0Sopenharmony_ci#endif /* __cplusplus */
417777dab0Sopenharmony_ci
427777dab0Sopenharmony_ci/**
437777dab0Sopenharmony_ci * @brief Define the InputMethod_TextAvoidInfo structure type.
447777dab0Sopenharmony_ci *
457777dab0Sopenharmony_ci * Information for text editor to avoid the keyboard.
467777dab0Sopenharmony_ci *
477777dab0Sopenharmony_ci * @since 12
487777dab0Sopenharmony_ci */
497777dab0Sopenharmony_citypedef struct InputMethod_TextAvoidInfo InputMethod_TextAvoidInfo;
507777dab0Sopenharmony_ci
517777dab0Sopenharmony_ci/**
527777dab0Sopenharmony_ci * @brief Create a new {@link InputMethod_TextAvoidInfo} instance.
537777dab0Sopenharmony_ci *
547777dab0Sopenharmony_ci * @param positionY The y-coordinate of the avoid area.
557777dab0Sopenharmony_ci * @param height The height of the avoid area.
567777dab0Sopenharmony_ci * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextAvoidInfo}
577777dab0Sopenharmony_ci * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory.
587777dab0Sopenharmony_ci * @since 12
597777dab0Sopenharmony_ci */
607777dab0Sopenharmony_ciInputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height);
617777dab0Sopenharmony_ci/**
627777dab0Sopenharmony_ci * @brief Destroy a {@link InputMethod_TextAvoidInfo} instance.
637777dab0Sopenharmony_ci *
647777dab0Sopenharmony_ci * @param options Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be destroyed.
657777dab0Sopenharmony_ci * @since 12
667777dab0Sopenharmony_ci */
677777dab0Sopenharmony_civoid OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info);
687777dab0Sopenharmony_ci/**
697777dab0Sopenharmony_ci * @brief Set positionY value into {@link InputMethod_TextAvoidInfo}.
707777dab0Sopenharmony_ci *
717777dab0Sopenharmony_ci * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be set value.
727777dab0Sopenharmony_ci * @param positionY Represents positionY value.
737777dab0Sopenharmony_ci * @return Returns a specific error code.
747777dab0Sopenharmony_ci *     {@link IME_ERR_OK} - success.
757777dab0Sopenharmony_ci *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer.
767777dab0Sopenharmony_ci * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
777777dab0Sopenharmony_ci * @since 12
787777dab0Sopenharmony_ci */
797777dab0Sopenharmony_ciInputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY);
807777dab0Sopenharmony_ci/**
817777dab0Sopenharmony_ci * @brief Set height value into {@link InputMethod_TextAvoidInfo}.
827777dab0Sopenharmony_ci *
837777dab0Sopenharmony_ci * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be set value.
847777dab0Sopenharmony_ci * @param height Represents height value.
857777dab0Sopenharmony_ci * @return Returns a specific error code.
867777dab0Sopenharmony_ci *     {@link IME_ERR_OK} - success.
877777dab0Sopenharmony_ci *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer.
887777dab0Sopenharmony_ci * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
897777dab0Sopenharmony_ci * @since 12
907777dab0Sopenharmony_ci */
917777dab0Sopenharmony_ciInputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height);
927777dab0Sopenharmony_ci/**
937777dab0Sopenharmony_ci * @brief Get positionY value from {@link InputMethod_TextAvoidInfo}.
947777dab0Sopenharmony_ci *
957777dab0Sopenharmony_ci * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be get value from.
967777dab0Sopenharmony_ci * @param positionY Represents positionY value.
977777dab0Sopenharmony_ci * @return Returns a specific error code.
987777dab0Sopenharmony_ci *     {@link IME_ERR_OK} - success.
997777dab0Sopenharmony_ci *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer.
1007777dab0Sopenharmony_ci * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
1017777dab0Sopenharmony_ci * @since 12
1027777dab0Sopenharmony_ci */
1037777dab0Sopenharmony_ciInputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY);
1047777dab0Sopenharmony_ci/**
1057777dab0Sopenharmony_ci * @brief Get height value into {@link InputMethod_TextAvoidInfo}.
1067777dab0Sopenharmony_ci *
1077777dab0Sopenharmony_ci * @param info Represents a pointer to an {@link InputMethod_TextAvoidInfo} instance which will be get value from.
1087777dab0Sopenharmony_ci * @param height Represents height value.
1097777dab0Sopenharmony_ci * @return Returns a specific error code.
1107777dab0Sopenharmony_ci *     {@link IME_ERR_OK} - success.
1117777dab0Sopenharmony_ci *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer.
1127777dab0Sopenharmony_ci * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
1137777dab0Sopenharmony_ci * @since 12
1147777dab0Sopenharmony_ci */
1157777dab0Sopenharmony_ciInputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height);
1167777dab0Sopenharmony_ci#ifdef __cplusplus
1177777dab0Sopenharmony_ci}
1187777dab0Sopenharmony_ci#endif /* __cplusplus */
1197777dab0Sopenharmony_ci/** @} */
1207777dab0Sopenharmony_ci#endif // OHOS_INPUTMETHOD_TEXT_AVOID_INFO_CAP_H