From eeb3d696df9d55970f1090fcd6d6e60058780bfc Mon Sep 17 00:00:00 2001 From: huangzhuozhen Date: Tue, 13 May 2025 14:24:30 +0800 Subject: [PATCH] add getAttachOptions requestKeyboardReason 5.1.0 Signed-off-by: huangzhuozhen --- api/@ohos.inputMethodEngine.d.ts | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/api/@ohos.inputMethodEngine.d.ts b/api/@ohos.inputMethodEngine.d.ts index 49feb7925d..cc1c8cc487 100644 --- a/api/@ohos.inputMethodEngine.d.ts +++ b/api/@ohos.inputMethodEngine.d.ts @@ -1428,6 +1428,34 @@ declare namespace inputMethodEngine { * @since 15 */ recvMessage(msgHandler?: MessageHandler): void; + /** + * Get input attachOptions. + * + * @returns { AttachOptions } return attach options. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + getAttachOptions(): AttachOptions; + /** + * Subscribe 'attachOptionsDidChange' event. + * + * @param { 'attachOptionsDidChange' } type - the type of subscribe event. + * @param { Callback } callback - the callback of on('attachOptionsDidChange'). + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + on(type: 'attachOptionsDidChange', callback: Callback): void; + /** + * Unsubscribe 'attachOptionsDidChange' event. + * + * @param { 'attachOptionsDidChange' } type - the type of unsubscribe event. + * @param { Callback } [callback] - optional, the callback of off('attachOptionsDidChange'). + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + off(type: 'attachOptionsDidChange', callback?: Callback): void; } /** @@ -1607,6 +1635,40 @@ declare namespace inputMethodEngine { DARK_IMMERSIVE } + /** + * RequestKeyboardReason of input click. + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + export enum RequestKeyboardReason { + /** + * The request keyboard reason is NONE. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + NONE = 0, + /** + * The request keyboard reason is MOUSE. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + MOUSE = 1, + /** + * The request keyboard reason is TOUCH. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + TOUCH = 2, + /** + * The request keyboard reason is OTHER. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + OTHER = 20 + } + /** * A panel is a container used to hold soft keyboard, candidate list, or status bar. * @@ -2547,6 +2609,23 @@ declare namespace inputMethodEngine { */ right: number; } + /** + * Attach options. + * + * @interface AttachOptions + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + export interface AttachOptions { + /** + * The reason for request keyboard. + * + * @type { ?RequestKeyboardReason } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 19 + */ + requestKeyboardReason?: RequestKeyboardReason; + } } export default inputMethodEngine; -- Gitee