From 4157bd6b5b3eba096ecd94002a00713c8a44254b Mon Sep 17 00:00:00 2001 From: qianyong325 Date: Thu, 27 Mar 2025 20:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=B3=95=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8=E5=A4=A7=E5=B0=8F=E5=86=99?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianyong325 --- .../include/inputmethod_text_config_capi.h | 31 +++++++++++++++++++ inputmethod/include/inputmethod_types_capi.h | 24 ++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/inputmethod/include/inputmethod_text_config_capi.h b/inputmethod/include/inputmethod_text_config_capi.h index ad639af2d..bb47678dd 100644 --- a/inputmethod/include/inputmethod_text_config_capi.h +++ b/inputmethod/include/inputmethod_text_config_capi.h @@ -131,6 +131,22 @@ InputMethod_ErrorCode OH_TextConfig_SetSelection(InputMethod_TextConfig *config, */ InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, int32_t windowId); +/** + * @brief Set capitalize mode into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param capitalizeMode The capitalize mode type of text Editor, + * which is defined in {@link InputMethod_capitalizeMode}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * {@link IME_ERR_PARAMCHECK} - parameter check failed. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 18 + */ +InputMethod_ErrorCode OH_TextConfig_SetCapitalizeMode(InputMethod_TextConfig *config, + InputMethod_CapitalizeMode capitalizeMode); + /** * @brief Get input type from TextConfig * @@ -222,6 +238,21 @@ InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig *config, * @since 12 */ InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, int32_t *windowId); + +/** + * @brief get capitalize mode into TextConfig. + * + * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance which will be set. + * @param capitalizeMode The capitalize mode type of text Editor, + * which is defined in {@link InputMethod_capitalizeMode}. + * @return Returns a specific error code. + * {@link IME_ERR_OK} - success. + * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. + * Specific error codes can be referenced {@link InputMethod_ErrorCode}. + * @since 18 + */ +InputMethod_ErrorCode OH_TextConfig_GetCapitalizeMode(InputMethod_TextConfig *config, + InputMethod_CapitalizeMode *capitalizeMode); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/inputmethod/include/inputmethod_types_capi.h b/inputmethod/include/inputmethod_types_capi.h index b3848f15f..32b57bdc3 100644 --- a/inputmethod/include/inputmethod_types_capi.h +++ b/inputmethod/include/inputmethod_types_capi.h @@ -325,6 +325,30 @@ typedef enum InputMethod_RequestKeyboardReason { */ IME_REQUEST_REASON_OTHER = 20 } InputMethod_RequestKeyboardReason; + +/** + * @brief The value type of capitalize mode. + * + * @since 18 + */ +typedef enum InputMethod_CapitalizeMode { + /** + * Value type is case-insensitive. + */ + NONE = 0, + /** + * Value type is capitalize the first letter of the sentence. + */ + SENTENCES = 1, + /** + * Value type is capitalize each word. + */ + WORDS = 2, + /** + * Value type is capitalize each letter. + */ + CHARACTERS = 3 +} InputMethod_CapitalizeMode; #ifdef __cplusplus } #endif /* __cplusplus */ -- Gitee