161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit IMEKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base'; 2161847f8eSopenharmony_ciimport type { KeyEvent as InputKeyEvent } from './@ohos.multimodalInput.keyEvent'; 2261847f8eSopenharmony_ciimport InputMethodSubtype from './@ohos.InputMethodSubtype'; 2361847f8eSopenharmony_ciimport BaseContext from './application/BaseContext'; 2461847f8eSopenharmony_ciimport window from './@ohos.window'; 2561847f8eSopenharmony_ci 2661847f8eSopenharmony_ci/** 2761847f8eSopenharmony_ci * Input method engine 2861847f8eSopenharmony_ci * 2961847f8eSopenharmony_ci * @namespace inputMethodEngine 3061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 3161847f8eSopenharmony_ci * @since 8 3261847f8eSopenharmony_ci */ 3361847f8eSopenharmony_cideclare namespace inputMethodEngine { 3461847f8eSopenharmony_ci /** 3561847f8eSopenharmony_ci * When "enter" key is pressed, there is no action 3661847f8eSopenharmony_ci * 3761847f8eSopenharmony_ci * @constant 3861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 3961847f8eSopenharmony_ci * @since 8 4061847f8eSopenharmony_ci */ 4161847f8eSopenharmony_ci const ENTER_KEY_TYPE_UNSPECIFIED: number; 4261847f8eSopenharmony_ci 4361847f8eSopenharmony_ci /** 4461847f8eSopenharmony_ci * When "enter" key is pressed, it means GO 4561847f8eSopenharmony_ci * 4661847f8eSopenharmony_ci * @constant 4761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 4861847f8eSopenharmony_ci * @since 8 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci const ENTER_KEY_TYPE_GO: number; 5161847f8eSopenharmony_ci 5261847f8eSopenharmony_ci /** 5361847f8eSopenharmony_ci * When "enter" key is pressed, it means SEARCH 5461847f8eSopenharmony_ci * 5561847f8eSopenharmony_ci * @constant 5661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 5761847f8eSopenharmony_ci * @since 8 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_ci const ENTER_KEY_TYPE_SEARCH: number; 6061847f8eSopenharmony_ci 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * When "enter" key is pressed, it means SEND 6361847f8eSopenharmony_ci * 6461847f8eSopenharmony_ci * @constant 6561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 6661847f8eSopenharmony_ci * @since 8 6761847f8eSopenharmony_ci */ 6861847f8eSopenharmony_ci const ENTER_KEY_TYPE_SEND: number; 6961847f8eSopenharmony_ci 7061847f8eSopenharmony_ci /** 7161847f8eSopenharmony_ci * When "enter" key is pressed, it means NEXT 7261847f8eSopenharmony_ci * 7361847f8eSopenharmony_ci * @constant 7461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 7561847f8eSopenharmony_ci * @since 8 7661847f8eSopenharmony_ci */ 7761847f8eSopenharmony_ci const ENTER_KEY_TYPE_NEXT: number; 7861847f8eSopenharmony_ci 7961847f8eSopenharmony_ci /** 8061847f8eSopenharmony_ci * When "enter" key is pressed, it means DONE 8161847f8eSopenharmony_ci * 8261847f8eSopenharmony_ci * @constant 8361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 8461847f8eSopenharmony_ci * @since 8 8561847f8eSopenharmony_ci */ 8661847f8eSopenharmony_ci const ENTER_KEY_TYPE_DONE: number; 8761847f8eSopenharmony_ci 8861847f8eSopenharmony_ci /** 8961847f8eSopenharmony_ci * When "enter" key is pressed, it means PREVIOUS 9061847f8eSopenharmony_ci * 9161847f8eSopenharmony_ci * @constant 9261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 9361847f8eSopenharmony_ci * @since 8 9461847f8eSopenharmony_ci */ 9561847f8eSopenharmony_ci const ENTER_KEY_TYPE_PREVIOUS: number; 9661847f8eSopenharmony_ci 9761847f8eSopenharmony_ci /** 9861847f8eSopenharmony_ci * When "enter" key is pressed, it means NEWLINE 9961847f8eSopenharmony_ci * 10061847f8eSopenharmony_ci * @constant 10161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 10261847f8eSopenharmony_ci * @since 12 10361847f8eSopenharmony_ci */ 10461847f8eSopenharmony_ci const ENTER_KEY_TYPE_NEWLINE: 8; 10561847f8eSopenharmony_ci 10661847f8eSopenharmony_ci /** 10761847f8eSopenharmony_ci * Editor with no special function 10861847f8eSopenharmony_ci * 10961847f8eSopenharmony_ci * @constant 11061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 11161847f8eSopenharmony_ci * @since 8 11261847f8eSopenharmony_ci */ 11361847f8eSopenharmony_ci const PATTERN_NULL: number; 11461847f8eSopenharmony_ci 11561847f8eSopenharmony_ci /** 11661847f8eSopenharmony_ci * Editor of type TEXT 11761847f8eSopenharmony_ci * 11861847f8eSopenharmony_ci * @constant 11961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 12061847f8eSopenharmony_ci * @since 8 12161847f8eSopenharmony_ci */ 12261847f8eSopenharmony_ci const PATTERN_TEXT: number; 12361847f8eSopenharmony_ci 12461847f8eSopenharmony_ci /** 12561847f8eSopenharmony_ci * Editor of type NUMBER 12661847f8eSopenharmony_ci * 12761847f8eSopenharmony_ci * @constant 12861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 12961847f8eSopenharmony_ci * @since 8 13061847f8eSopenharmony_ci */ 13161847f8eSopenharmony_ci const PATTERN_NUMBER: number; 13261847f8eSopenharmony_ci 13361847f8eSopenharmony_ci /** 13461847f8eSopenharmony_ci * Editor of type PHONE NUMBER 13561847f8eSopenharmony_ci * 13661847f8eSopenharmony_ci * @constant 13761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 13861847f8eSopenharmony_ci * @since 8 13961847f8eSopenharmony_ci */ 14061847f8eSopenharmony_ci const PATTERN_PHONE: number; 14161847f8eSopenharmony_ci 14261847f8eSopenharmony_ci /** 14361847f8eSopenharmony_ci * Editor of type DATETIME 14461847f8eSopenharmony_ci * 14561847f8eSopenharmony_ci * @constant 14661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 14761847f8eSopenharmony_ci * @since 8 14861847f8eSopenharmony_ci */ 14961847f8eSopenharmony_ci const PATTERN_DATETIME: number; 15061847f8eSopenharmony_ci 15161847f8eSopenharmony_ci /** 15261847f8eSopenharmony_ci * Editor of type EMAIL 15361847f8eSopenharmony_ci * 15461847f8eSopenharmony_ci * @constant 15561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 15661847f8eSopenharmony_ci * @since 8 15761847f8eSopenharmony_ci */ 15861847f8eSopenharmony_ci const PATTERN_EMAIL: number; 15961847f8eSopenharmony_ci 16061847f8eSopenharmony_ci /** 16161847f8eSopenharmony_ci * Editor of type URI 16261847f8eSopenharmony_ci * 16361847f8eSopenharmony_ci * @constant 16461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 16561847f8eSopenharmony_ci * @since 8 16661847f8eSopenharmony_ci */ 16761847f8eSopenharmony_ci const PATTERN_URI: number; 16861847f8eSopenharmony_ci 16961847f8eSopenharmony_ci /** 17061847f8eSopenharmony_ci * Editor of type PASSWORD 17161847f8eSopenharmony_ci * 17261847f8eSopenharmony_ci * @constant 17361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 17461847f8eSopenharmony_ci * @since 8 17561847f8eSopenharmony_ci */ 17661847f8eSopenharmony_ci const PATTERN_PASSWORD: number; 17761847f8eSopenharmony_ci 17861847f8eSopenharmony_ci /** 17961847f8eSopenharmony_ci * Editor of type SCREEN LOCK PASSWORD 18061847f8eSopenharmony_ci * 18161847f8eSopenharmony_ci * @constant 18261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 18361847f8eSopenharmony_ci * @since 11 18461847f8eSopenharmony_ci */ 18561847f8eSopenharmony_ci const PATTERN_PASSWORD_SCREEN_LOCK: number; 18661847f8eSopenharmony_ci 18761847f8eSopenharmony_ci /** 18861847f8eSopenharmony_ci * Editor of type NUMBER PASSWORD 18961847f8eSopenharmony_ci * 19061847f8eSopenharmony_ci * @constant 19161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 19261847f8eSopenharmony_ci * @since 11 19361847f8eSopenharmony_ci */ 19461847f8eSopenharmony_ci const PATTERN_PASSWORD_NUMBER: number; 19561847f8eSopenharmony_ci 19661847f8eSopenharmony_ci /** 19761847f8eSopenharmony_ci * Editor in SELECTING state 19861847f8eSopenharmony_ci * 19961847f8eSopenharmony_ci * @constant 20061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 20161847f8eSopenharmony_ci * @since 8 20261847f8eSopenharmony_ci */ 20361847f8eSopenharmony_ci const FLAG_SELECTING: number; 20461847f8eSopenharmony_ci 20561847f8eSopenharmony_ci /** 20661847f8eSopenharmony_ci * Editor in SINGLE_LINE state 20761847f8eSopenharmony_ci * 20861847f8eSopenharmony_ci * @constant 20961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 21061847f8eSopenharmony_ci * @since 8 21161847f8eSopenharmony_ci */ 21261847f8eSopenharmony_ci const FLAG_SINGLE_LINE: number; 21361847f8eSopenharmony_ci 21461847f8eSopenharmony_ci /** 21561847f8eSopenharmony_ci * The Editor displays in PART mode 21661847f8eSopenharmony_ci * 21761847f8eSopenharmony_ci * @constant 21861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 21961847f8eSopenharmony_ci * @since 8 22061847f8eSopenharmony_ci */ 22161847f8eSopenharmony_ci const DISPLAY_MODE_PART: number; 22261847f8eSopenharmony_ci 22361847f8eSopenharmony_ci /** 22461847f8eSopenharmony_ci * The Editor displays in FULL mode 22561847f8eSopenharmony_ci * 22661847f8eSopenharmony_ci * @constant 22761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 22861847f8eSopenharmony_ci * @since 8 22961847f8eSopenharmony_ci */ 23061847f8eSopenharmony_ci const DISPLAY_MODE_FULL: number; 23161847f8eSopenharmony_ci 23261847f8eSopenharmony_ci /** 23361847f8eSopenharmony_ci * Allows ASCII to be inputted 23461847f8eSopenharmony_ci * 23561847f8eSopenharmony_ci * @constant 23661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 23761847f8eSopenharmony_ci * @since 8 23861847f8eSopenharmony_ci */ 23961847f8eSopenharmony_ci const OPTION_ASCII: number; 24061847f8eSopenharmony_ci 24161847f8eSopenharmony_ci /** 24261847f8eSopenharmony_ci * Do not specify Editor's input type 24361847f8eSopenharmony_ci * 24461847f8eSopenharmony_ci * @constant 24561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 24661847f8eSopenharmony_ci * @since 8 24761847f8eSopenharmony_ci */ 24861847f8eSopenharmony_ci const OPTION_NONE: number; 24961847f8eSopenharmony_ci 25061847f8eSopenharmony_ci /** 25161847f8eSopenharmony_ci * Allows CHARACTERS to be inputted 25261847f8eSopenharmony_ci * 25361847f8eSopenharmony_ci * @constant 25461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 25561847f8eSopenharmony_ci * @since 8 25661847f8eSopenharmony_ci */ 25761847f8eSopenharmony_ci const OPTION_AUTO_CAP_CHARACTERS: number; 25861847f8eSopenharmony_ci 25961847f8eSopenharmony_ci /** 26061847f8eSopenharmony_ci * Allows SENTENCES to be inputted 26161847f8eSopenharmony_ci * 26261847f8eSopenharmony_ci * @constant 26361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 26461847f8eSopenharmony_ci * @since 8 26561847f8eSopenharmony_ci */ 26661847f8eSopenharmony_ci const OPTION_AUTO_CAP_SENTENCES: number; 26761847f8eSopenharmony_ci 26861847f8eSopenharmony_ci /** 26961847f8eSopenharmony_ci * Allows WORDS to be inputted 27061847f8eSopenharmony_ci * 27161847f8eSopenharmony_ci * @constant 27261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 27361847f8eSopenharmony_ci * @since 8 27461847f8eSopenharmony_ci */ 27561847f8eSopenharmony_ci const OPTION_AUTO_WORDS: number; 27661847f8eSopenharmony_ci 27761847f8eSopenharmony_ci /** 27861847f8eSopenharmony_ci * Allows MULTI_LINE to be inputted 27961847f8eSopenharmony_ci * 28061847f8eSopenharmony_ci * @constant 28161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 28261847f8eSopenharmony_ci * @since 8 28361847f8eSopenharmony_ci */ 28461847f8eSopenharmony_ci const OPTION_MULTI_LINE: number; 28561847f8eSopenharmony_ci 28661847f8eSopenharmony_ci /** 28761847f8eSopenharmony_ci * Half-screen mode 28861847f8eSopenharmony_ci * 28961847f8eSopenharmony_ci * @constant 29061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 29161847f8eSopenharmony_ci * @since 8 29261847f8eSopenharmony_ci */ 29361847f8eSopenharmony_ci const OPTION_NO_FULLSCREEN: number; 29461847f8eSopenharmony_ci 29561847f8eSopenharmony_ci /** 29661847f8eSopenharmony_ci * The move direction of cursor: UP 29761847f8eSopenharmony_ci * 29861847f8eSopenharmony_ci * @constant 29961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 30061847f8eSopenharmony_ci * @since 9 30161847f8eSopenharmony_ci */ 30261847f8eSopenharmony_ci const CURSOR_UP: number; 30361847f8eSopenharmony_ci 30461847f8eSopenharmony_ci /** 30561847f8eSopenharmony_ci * The move direction of cursor: DOWN 30661847f8eSopenharmony_ci * 30761847f8eSopenharmony_ci * @constant 30861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 30961847f8eSopenharmony_ci * @since 9 31061847f8eSopenharmony_ci */ 31161847f8eSopenharmony_ci const CURSOR_DOWN: number; 31261847f8eSopenharmony_ci 31361847f8eSopenharmony_ci /** 31461847f8eSopenharmony_ci * The move direction of cursor: LEFT 31561847f8eSopenharmony_ci * 31661847f8eSopenharmony_ci * @constant 31761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 31861847f8eSopenharmony_ci * @since 9 31961847f8eSopenharmony_ci */ 32061847f8eSopenharmony_ci const CURSOR_LEFT: number; 32161847f8eSopenharmony_ci 32261847f8eSopenharmony_ci /** 32361847f8eSopenharmony_ci * The move direction of cursor: RIGHT 32461847f8eSopenharmony_ci * 32561847f8eSopenharmony_ci * @constant 32661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 32761847f8eSopenharmony_ci * @since 9 32861847f8eSopenharmony_ci */ 32961847f8eSopenharmony_ci const CURSOR_RIGHT: number; 33061847f8eSopenharmony_ci 33161847f8eSopenharmony_ci /** 33261847f8eSopenharmony_ci * The window styles for input method ability. 33361847f8eSopenharmony_ci * 33461847f8eSopenharmony_ci * @constant 33561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 33661847f8eSopenharmony_ci * @since 9 33761847f8eSopenharmony_ci */ 33861847f8eSopenharmony_ci const WINDOW_TYPE_INPUT_METHOD_FLOAT: number; 33961847f8eSopenharmony_ci 34061847f8eSopenharmony_ci /** 34161847f8eSopenharmony_ci * Get InputMethodAbility object to subscribe events about IME. 34261847f8eSopenharmony_ci * 34361847f8eSopenharmony_ci * @returns { InputMethodAbility } the object of the InputMethodAbility. 34461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 34561847f8eSopenharmony_ci * @since 9 34661847f8eSopenharmony_ci */ 34761847f8eSopenharmony_ci function getInputMethodAbility(): InputMethodAbility; 34861847f8eSopenharmony_ci 34961847f8eSopenharmony_ci /** 35061847f8eSopenharmony_ci * @returns { InputMethodEngine } 35161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 35261847f8eSopenharmony_ci * @since 8 35361847f8eSopenharmony_ci * @deprecated since 9 35461847f8eSopenharmony_ci * @useinstead inputMethodEngine#getInputMethodAbility 35561847f8eSopenharmony_ci */ 35661847f8eSopenharmony_ci function getInputMethodEngine(): InputMethodEngine; 35761847f8eSopenharmony_ci 35861847f8eSopenharmony_ci /** 35961847f8eSopenharmony_ci * Get KeyboardDelegate object to subscribe key event or events about editor. 36061847f8eSopenharmony_ci * 36161847f8eSopenharmony_ci * @returns { KeyboardDelegate } the object of KeyboardDelegate. 36261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 36361847f8eSopenharmony_ci * @since 9 36461847f8eSopenharmony_ci */ 36561847f8eSopenharmony_ci function getKeyboardDelegate(): KeyboardDelegate; 36661847f8eSopenharmony_ci 36761847f8eSopenharmony_ci /** 36861847f8eSopenharmony_ci * @returns { KeyboardDelegate } 36961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 37061847f8eSopenharmony_ci * @since 8 37161847f8eSopenharmony_ci * @deprecated since 9 37261847f8eSopenharmony_ci * @useinstead inputMethodEngine#getKeyboardDelegate 37361847f8eSopenharmony_ci */ 37461847f8eSopenharmony_ci function createKeyboardDelegate(): KeyboardDelegate; 37561847f8eSopenharmony_ci 37661847f8eSopenharmony_ci /** 37761847f8eSopenharmony_ci * Indicates the possible data types of the command. 37861847f8eSopenharmony_ci * @typedef { number | string | boolean } 37961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 38061847f8eSopenharmony_ci * @since 12 38161847f8eSopenharmony_ci */ 38261847f8eSopenharmony_ci type CommandDataType = number | string | boolean; 38361847f8eSopenharmony_ci 38461847f8eSopenharmony_ci /** 38561847f8eSopenharmony_ci * @interface KeyboardController 38661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 38761847f8eSopenharmony_ci * @since 8 38861847f8eSopenharmony_ci */ 38961847f8eSopenharmony_ci interface KeyboardController { 39061847f8eSopenharmony_ci /** 39161847f8eSopenharmony_ci * Hide soft keyboard 39261847f8eSopenharmony_ci * 39361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - indicates the callback function of hide. 39461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 39561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 39661847f8eSopenharmony_ci * @since 9 39761847f8eSopenharmony_ci */ 39861847f8eSopenharmony_ci hide(callback: AsyncCallback<void>): void; 39961847f8eSopenharmony_ci 40061847f8eSopenharmony_ci /** 40161847f8eSopenharmony_ci * Hide soft keyboard 40261847f8eSopenharmony_ci * 40361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function 40461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 40561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 40661847f8eSopenharmony_ci * @since 9 40761847f8eSopenharmony_ci */ 40861847f8eSopenharmony_ci hide(): Promise<void>; 40961847f8eSopenharmony_ci 41061847f8eSopenharmony_ci /** 41161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - indicates the callback function of hideKeyboard. 41261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 41361847f8eSopenharmony_ci * @since 8 41461847f8eSopenharmony_ci * @deprecated since 9 41561847f8eSopenharmony_ci * @useinstead inputMethodEngine.KeyboardController#hide 41661847f8eSopenharmony_ci */ 41761847f8eSopenharmony_ci hideKeyboard(callback: AsyncCallback<void>): void; 41861847f8eSopenharmony_ci 41961847f8eSopenharmony_ci /** 42061847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function 42161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 42261847f8eSopenharmony_ci * @since 8 42361847f8eSopenharmony_ci * @deprecated since 9 42461847f8eSopenharmony_ci * @useinstead inputMethodEngine.KeyboardController#hide 42561847f8eSopenharmony_ci */ 42661847f8eSopenharmony_ci hideKeyboard(): Promise<void>; 42761847f8eSopenharmony_ci 42861847f8eSopenharmony_ci /** 42961847f8eSopenharmony_ci * Exit the current input type. This function can only be called by default input method configured by system. 43061847f8eSopenharmony_ci * 43161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of exitCurrentInputType. 43261847f8eSopenharmony_ci * @throws { BusinessError } 12800008 - input method manager service error. 43361847f8eSopenharmony_ci * @throws { BusinessError } 12800010 - not default input method configured by system. 43461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 43561847f8eSopenharmony_ci * @since 11 43661847f8eSopenharmony_ci */ 43761847f8eSopenharmony_ci exitCurrentInputType(callback: AsyncCallback<void>): void; 43861847f8eSopenharmony_ci 43961847f8eSopenharmony_ci /** 44061847f8eSopenharmony_ci * Exit the current input type. This function can only be called by default input method configured by system. 44161847f8eSopenharmony_ci * 44261847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 44361847f8eSopenharmony_ci * @throws { BusinessError } 12800008 - input method manager service error. 44461847f8eSopenharmony_ci * @throws { BusinessError } 12800010 - not default input method configured by system. 44561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 44661847f8eSopenharmony_ci * @since 11 44761847f8eSopenharmony_ci */ 44861847f8eSopenharmony_ci exitCurrentInputType(): Promise<void>; 44961847f8eSopenharmony_ci } 45061847f8eSopenharmony_ci 45161847f8eSopenharmony_ci /** 45261847f8eSopenharmony_ci * @interface InputMethodEngine 45361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 45461847f8eSopenharmony_ci * @since 8 45561847f8eSopenharmony_ci */ 45661847f8eSopenharmony_ci interface InputMethodEngine { 45761847f8eSopenharmony_ci /** 45861847f8eSopenharmony_ci * Subscribe 'inputStart' 45961847f8eSopenharmony_ci * 46061847f8eSopenharmony_ci * @param { 'inputStart' } type - indicates the type of subscribe event. 46161847f8eSopenharmony_ci * @param { function } callback - indicates the callback of on('inputStart'). 46261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 46361847f8eSopenharmony_ci * @since 8 46461847f8eSopenharmony_ci */ 46561847f8eSopenharmony_ci on( 46661847f8eSopenharmony_ci type: 'inputStart', 46761847f8eSopenharmony_ci callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void 46861847f8eSopenharmony_ci ): void; 46961847f8eSopenharmony_ci 47061847f8eSopenharmony_ci /** 47161847f8eSopenharmony_ci * Unsubscribe 'inputStart' 47261847f8eSopenharmony_ci * 47361847f8eSopenharmony_ci * @param { 'inputStart' } type - indicates the type of subscribe event. 47461847f8eSopenharmony_ci * @param { function } callback - optional, indicates the callback of off('inputStart'). 47561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 47661847f8eSopenharmony_ci * @since 8 47761847f8eSopenharmony_ci */ 47861847f8eSopenharmony_ci off( 47961847f8eSopenharmony_ci type: 'inputStart', 48061847f8eSopenharmony_ci callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void 48161847f8eSopenharmony_ci ): void; 48261847f8eSopenharmony_ci 48361847f8eSopenharmony_ci /** 48461847f8eSopenharmony_ci * Subscribe 'keyboardShow'|'keyboardHide' 48561847f8eSopenharmony_ci * 48661847f8eSopenharmony_ci * @param { 'keyboardShow' | 'keyboardHide' } type - indicates the type of subscribe event. 48761847f8eSopenharmony_ci * @param { function } callback - indicates the callback of on('keyboardShow'|'keyboardHide'). 48861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 48961847f8eSopenharmony_ci * @since 8 49061847f8eSopenharmony_ci */ 49161847f8eSopenharmony_ci on(type: 'keyboardShow' | 'keyboardHide', callback: () => void): void; 49261847f8eSopenharmony_ci 49361847f8eSopenharmony_ci /** 49461847f8eSopenharmony_ci * Unsubscribe 'keyboardShow'|'keyboardHide' 49561847f8eSopenharmony_ci * 49661847f8eSopenharmony_ci * @param { 'keyboardShow' | 'keyboardHide' } type - indicates the type of subscribe event. 49761847f8eSopenharmony_ci * @param { function } [callback] - optional, indicates the callback of off('keyboardShow'|'keyboardHide'). 49861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 49961847f8eSopenharmony_ci * @since 8 50061847f8eSopenharmony_ci */ 50161847f8eSopenharmony_ci off(type: 'keyboardShow' | 'keyboardHide', callback?: () => void): void; 50261847f8eSopenharmony_ci } 50361847f8eSopenharmony_ci 50461847f8eSopenharmony_ci /** 50561847f8eSopenharmony_ci * <p>Control events about IME.</p> 50661847f8eSopenharmony_ci * <p>Events provided for IME to subscribe with callback function. When those events occur, the corresponding callback 50761847f8eSopenharmony_ci * will be invoked.</p> 50861847f8eSopenharmony_ci * 50961847f8eSopenharmony_ci * @interface InputMethodAbility 51061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 51161847f8eSopenharmony_ci * @since 9 51261847f8eSopenharmony_ci */ 51361847f8eSopenharmony_ci interface InputMethodAbility { 51461847f8eSopenharmony_ci /** 51561847f8eSopenharmony_ci * Subscribe 'inputStart' event. 51661847f8eSopenharmony_ci * 51761847f8eSopenharmony_ci * @param { 'inputStart' } type - the type of subscribe event. 51861847f8eSopenharmony_ci * @param { function } callback - the callback of on('inputStart'). 51961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 52061847f8eSopenharmony_ci * @since 9 52161847f8eSopenharmony_ci */ 52261847f8eSopenharmony_ci on(type: 'inputStart', callback: (kbController: KeyboardController, inputClient: InputClient) => void): void; 52361847f8eSopenharmony_ci 52461847f8eSopenharmony_ci /** 52561847f8eSopenharmony_ci * Unsubscribe 'inputStart' event. 52661847f8eSopenharmony_ci * 52761847f8eSopenharmony_ci * @param { 'inputStart' } type - the type of unsubscribe event. 52861847f8eSopenharmony_ci * @param { function } [callback] - optional, the callback of off('inputStart'). 52961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 53061847f8eSopenharmony_ci * @since 9 53161847f8eSopenharmony_ci */ 53261847f8eSopenharmony_ci off(type: 'inputStart', callback?: (kbController: KeyboardController, inputClient: InputClient) => void): void; 53361847f8eSopenharmony_ci 53461847f8eSopenharmony_ci /** 53561847f8eSopenharmony_ci * Subscribe 'inputStop'. 53661847f8eSopenharmony_ci * 53761847f8eSopenharmony_ci * @param { 'inputStop' } type - the type of subscribe event. 53861847f8eSopenharmony_ci * @param { function } callback - the callback of on('inputStop'). 53961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 54061847f8eSopenharmony_ci * @since 9 54161847f8eSopenharmony_ci */ 54261847f8eSopenharmony_ci on(type: 'inputStop', callback: () => void): void; 54361847f8eSopenharmony_ci 54461847f8eSopenharmony_ci /** 54561847f8eSopenharmony_ci * Unsubscribe 'inputStop'. 54661847f8eSopenharmony_ci * 54761847f8eSopenharmony_ci * @param { 'inputStop' } type - the type of unsubscribe event. 54861847f8eSopenharmony_ci * @param { function } callback - the callback of off('inputStop'). 54961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 55061847f8eSopenharmony_ci * @since 9 55161847f8eSopenharmony_ci */ 55261847f8eSopenharmony_ci off(type: 'inputStop', callback: () => void): void; 55361847f8eSopenharmony_ci 55461847f8eSopenharmony_ci /** 55561847f8eSopenharmony_ci * Subscribe 'setCallingWindow'. 55661847f8eSopenharmony_ci * 55761847f8eSopenharmony_ci * @param { 'setCallingWindow' } type - the type of subscribe event. 55861847f8eSopenharmony_ci * @param { function } callback - the callback of on('setCallingWindow'). 55961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 56061847f8eSopenharmony_ci * @since 9 56161847f8eSopenharmony_ci */ 56261847f8eSopenharmony_ci on(type: 'setCallingWindow', callback: (wid: number) => void): void; 56361847f8eSopenharmony_ci 56461847f8eSopenharmony_ci /** 56561847f8eSopenharmony_ci * Unsubscribe 'setCallingWindow'. 56661847f8eSopenharmony_ci * 56761847f8eSopenharmony_ci * @param { 'setCallingWindow' } type - the type of unsubscribe event. 56861847f8eSopenharmony_ci * @param { function } callback - the callback of off('setCallingWindow'). 56961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 57061847f8eSopenharmony_ci * @since 9 57161847f8eSopenharmony_ci */ 57261847f8eSopenharmony_ci off(type: 'setCallingWindow', callback: (wid: number) => void): void; 57361847f8eSopenharmony_ci 57461847f8eSopenharmony_ci /** 57561847f8eSopenharmony_ci * Subscribe 'keyboardShow'|'keyboardHide'. 57661847f8eSopenharmony_ci * 57761847f8eSopenharmony_ci * @param { 'keyboardShow' | 'keyboardHide' } type - the type of subscribe event. 57861847f8eSopenharmony_ci * @param { function } callback - the callback of on('keyboardShow'|'keyboardHide'). 57961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 58061847f8eSopenharmony_ci * @since 9 58161847f8eSopenharmony_ci */ 58261847f8eSopenharmony_ci on(type: 'keyboardShow' | 'keyboardHide', callback: () => void): void; 58361847f8eSopenharmony_ci 58461847f8eSopenharmony_ci /** 58561847f8eSopenharmony_ci * Unsubscribe 'keyboardShow'|'keyboardHide'. 58661847f8eSopenharmony_ci * 58761847f8eSopenharmony_ci * @param { 'keyboardShow' | 'keyboardHide' } type - the type of unsubscribe event. 58861847f8eSopenharmony_ci * @param { function } [callback] - the callback of off('keyboardShow'|'keyboardHide'). 58961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 59061847f8eSopenharmony_ci * @since 9 59161847f8eSopenharmony_ci */ 59261847f8eSopenharmony_ci off(type: 'keyboardShow' | 'keyboardHide', callback?: () => void): void; 59361847f8eSopenharmony_ci 59461847f8eSopenharmony_ci /** 59561847f8eSopenharmony_ci * Subscribe 'setSubtype'. 59661847f8eSopenharmony_ci * 59761847f8eSopenharmony_ci * @param { 'setSubtype' } type - the type of subscribe event. 59861847f8eSopenharmony_ci * @param { function } callback - the callback of on('setSubtype'). 59961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 60061847f8eSopenharmony_ci * @since 9 60161847f8eSopenharmony_ci */ 60261847f8eSopenharmony_ci on(type: 'setSubtype', callback: (inputMethodSubtype: InputMethodSubtype) => void): void; 60361847f8eSopenharmony_ci 60461847f8eSopenharmony_ci /** 60561847f8eSopenharmony_ci * Unsubscribe 'setSubtype'. 60661847f8eSopenharmony_ci * 60761847f8eSopenharmony_ci * @param { 'setSubtype' } type - the type of subscribe event. 60861847f8eSopenharmony_ci * @param { function } [callback] - the callback of off('setSubtype'). 60961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 61061847f8eSopenharmony_ci * @since 9 61161847f8eSopenharmony_ci */ 61261847f8eSopenharmony_ci off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void; 61361847f8eSopenharmony_ci 61461847f8eSopenharmony_ci /** 61561847f8eSopenharmony_ci * Subscribe 'securityModeChange' event. 61661847f8eSopenharmony_ci * 61761847f8eSopenharmony_ci * @param { 'securityModeChange' } type - the type of subscribe event. 61861847f8eSopenharmony_ci * @param { Callback<SecurityMode> } callback - the callback of on('securityModeChange'). 61961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 62061847f8eSopenharmony_ci * @since 11 62161847f8eSopenharmony_ci */ 62261847f8eSopenharmony_ci on(type: 'securityModeChange', callback: Callback<SecurityMode>): void; 62361847f8eSopenharmony_ci 62461847f8eSopenharmony_ci /** 62561847f8eSopenharmony_ci * Unsubscribe 'securityModeChange' event. 62661847f8eSopenharmony_ci * 62761847f8eSopenharmony_ci * @param { 'securityModeChange' } type - the type of unsubscribe event. 62861847f8eSopenharmony_ci * @param { Callback<SecurityMode> } [callback] - optional, the callback of off('securityModeChange'). 62961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 63061847f8eSopenharmony_ci * @since 11 63161847f8eSopenharmony_ci */ 63261847f8eSopenharmony_ci off(type: 'securityModeChange', callback?: Callback<SecurityMode>): void; 63361847f8eSopenharmony_ci 63461847f8eSopenharmony_ci /** 63561847f8eSopenharmony_ci * Subscribe 'privateCommand'.This function can only be called by default input method configured by system. 63661847f8eSopenharmony_ci * 63761847f8eSopenharmony_ci * @param { 'privateCommand' } type - indicates the type of subscribe event. 63861847f8eSopenharmony_ci * @param { Callback<Record<string, CommandDataType>> } callback - indicates the callback of on('privateCommand'). 63961847f8eSopenharmony_ci * @throws { BusinessError } 12800010 - not default input method configured by system. 64061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 64161847f8eSopenharmony_ci * @since 12 64261847f8eSopenharmony_ci */ 64361847f8eSopenharmony_ci on(type: 'privateCommand', callback: Callback<Record<string, CommandDataType>>): void; 64461847f8eSopenharmony_ci 64561847f8eSopenharmony_ci /** 64661847f8eSopenharmony_ci * Unsubscribe 'privateCommand'.This function can only be called by default input method configured by system. 64761847f8eSopenharmony_ci * 64861847f8eSopenharmony_ci * @param { 'privateCommand' } type - indicates the type of subscribe event. 64961847f8eSopenharmony_ci * @param { Callback<Record<string, CommandDataType>> } [callback] - optional, 65061847f8eSopenharmony_ci * indicates the callback of off('privateCommand'). 65161847f8eSopenharmony_ci * @throws { BusinessError } 12800010 - not default input method configured by system. 65261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 65361847f8eSopenharmony_ci * @since 12 65461847f8eSopenharmony_ci */ 65561847f8eSopenharmony_ci off(type: 'privateCommand', callback?: Callback<Record<string, CommandDataType>>): void; 65661847f8eSopenharmony_ci 65761847f8eSopenharmony_ci /** 65861847f8eSopenharmony_ci * Get input method's security mode. 65961847f8eSopenharmony_ci * 66061847f8eSopenharmony_ci * @returns { SecurityMode } return security mode. 66161847f8eSopenharmony_ci * @throws { BusinessError } 12800004 - not an input method extension. 66261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 66361847f8eSopenharmony_ci * @since 11 66461847f8eSopenharmony_ci */ 66561847f8eSopenharmony_ci getSecurityMode(): SecurityMode; 66661847f8eSopenharmony_ci 66761847f8eSopenharmony_ci /** 66861847f8eSopenharmony_ci * Creates a panel. 66961847f8eSopenharmony_ci * <p>The system only allows one soft keyboard and one status bar to be created.</p> 67061847f8eSopenharmony_ci * 67161847f8eSopenharmony_ci * @param { BaseContext } ctx - indicates the context on which the window depends. 67261847f8eSopenharmony_ci * @param { PanelInfo } info - the info of panel to be created. 67361847f8eSopenharmony_ci * @param { AsyncCallback<Panel> } callback - the callback of createPanel. 67461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 67561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 67661847f8eSopenharmony_ci * @throws { BusinessError } 12800004 - not an input method extension. 67761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 67861847f8eSopenharmony_ci * @since 10 67961847f8eSopenharmony_ci */ 68061847f8eSopenharmony_ci createPanel(ctx: BaseContext, info: PanelInfo, callback: AsyncCallback<Panel>): void; 68161847f8eSopenharmony_ci 68261847f8eSopenharmony_ci /** 68361847f8eSopenharmony_ci * Creates a panel. 68461847f8eSopenharmony_ci * <p>The system only allows one soft keyboard and one status bar to be created.</p> 68561847f8eSopenharmony_ci * 68661847f8eSopenharmony_ci * @param { BaseContext } ctx - indicates the context on which the window depends. 68761847f8eSopenharmony_ci * @param { PanelInfo } info - the info of panel to be created. 68861847f8eSopenharmony_ci * @returns { Promise<Panel> } the promise returned by the function. 68961847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 69061847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 69161847f8eSopenharmony_ci * @throws { BusinessError } 12800004 - not an input method extension. 69261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 69361847f8eSopenharmony_ci * @since 10 69461847f8eSopenharmony_ci */ 69561847f8eSopenharmony_ci createPanel(ctx: BaseContext, info: PanelInfo): Promise<Panel>; 69661847f8eSopenharmony_ci 69761847f8eSopenharmony_ci /** 69861847f8eSopenharmony_ci * Destroys a panel. 69961847f8eSopenharmony_ci * 70061847f8eSopenharmony_ci * @param { Panel } panel - to be destroyed. 70161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of destroyPanel. 70261847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 70361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 70461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 70561847f8eSopenharmony_ci * @since 10 70661847f8eSopenharmony_ci */ 70761847f8eSopenharmony_ci destroyPanel(panel: Panel, callback: AsyncCallback<void>): void; 70861847f8eSopenharmony_ci 70961847f8eSopenharmony_ci /** 71061847f8eSopenharmony_ci * Destroys a panel. 71161847f8eSopenharmony_ci * 71261847f8eSopenharmony_ci * @param { Panel } panel - to be destroyed. 71361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 71461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 71561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 71661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 71761847f8eSopenharmony_ci * @since 10 71861847f8eSopenharmony_ci */ 71961847f8eSopenharmony_ci destroyPanel(panel: Panel): Promise<void>; 72061847f8eSopenharmony_ci } 72161847f8eSopenharmony_ci 72261847f8eSopenharmony_ci /** 72361847f8eSopenharmony_ci * @interface TextInputClient 72461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 72561847f8eSopenharmony_ci * @since 8 72661847f8eSopenharmony_ci * @deprecated since 9 72761847f8eSopenharmony_ci * @useinstead inputMethodEngine#InputClient 72861847f8eSopenharmony_ci */ 72961847f8eSopenharmony_ci interface TextInputClient { 73061847f8eSopenharmony_ci /** 73161847f8eSopenharmony_ci * @param { number } action - action indicates the function of "enter" key. 73261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of sendKeyFunction. 73361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 73461847f8eSopenharmony_ci * @since 8 73561847f8eSopenharmony_ci * @deprecated since 9 73661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#sendKeyFunction 73761847f8eSopenharmony_ci */ 73861847f8eSopenharmony_ci sendKeyFunction(action: number, callback: AsyncCallback<boolean>): void; 73961847f8eSopenharmony_ci 74061847f8eSopenharmony_ci /** 74161847f8eSopenharmony_ci * @param { number } action - action indicates the function of "enter" key. 74261847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 74361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 74461847f8eSopenharmony_ci * @since 8 74561847f8eSopenharmony_ci * @deprecated since 9 74661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#sendKeyFunction 74761847f8eSopenharmony_ci */ 74861847f8eSopenharmony_ci sendKeyFunction(action: number): Promise<boolean>; 74961847f8eSopenharmony_ci 75061847f8eSopenharmony_ci /** 75161847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted forward. 75261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of deleteForward. 75361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 75461847f8eSopenharmony_ci * @since 8 75561847f8eSopenharmony_ci * @deprecated since 9 75661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#deleteForward 75761847f8eSopenharmony_ci */ 75861847f8eSopenharmony_ci deleteForward(length: number, callback: AsyncCallback<boolean>): void; 75961847f8eSopenharmony_ci 76061847f8eSopenharmony_ci /** 76161847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted forward. 76261847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 76361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 76461847f8eSopenharmony_ci * @since 8 76561847f8eSopenharmony_ci * @deprecated since 9 76661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#deleteForward 76761847f8eSopenharmony_ci */ 76861847f8eSopenharmony_ci deleteForward(length: number): Promise<boolean>; 76961847f8eSopenharmony_ci 77061847f8eSopenharmony_ci /** 77161847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted backward. 77261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of deleteBackward. 77361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 77461847f8eSopenharmony_ci * @since 8 77561847f8eSopenharmony_ci * @deprecated since 9 77661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#deleteBackward 77761847f8eSopenharmony_ci */ 77861847f8eSopenharmony_ci deleteBackward(length: number, callback: AsyncCallback<boolean>): void; 77961847f8eSopenharmony_ci 78061847f8eSopenharmony_ci /** 78161847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted backward. 78261847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 78361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 78461847f8eSopenharmony_ci * @since 8 78561847f8eSopenharmony_ci * @deprecated since 9 78661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#deleteBackward 78761847f8eSopenharmony_ci */ 78861847f8eSopenharmony_ci deleteBackward(length: number): Promise<boolean>; 78961847f8eSopenharmony_ci 79061847f8eSopenharmony_ci /** 79161847f8eSopenharmony_ci * @param { string } text - text which will be inserted. 79261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of insertText. 79361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 79461847f8eSopenharmony_ci * @since 8 79561847f8eSopenharmony_ci * @deprecated since 9 79661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#insertText 79761847f8eSopenharmony_ci */ 79861847f8eSopenharmony_ci insertText(text: string, callback: AsyncCallback<boolean>): void; 79961847f8eSopenharmony_ci 80061847f8eSopenharmony_ci /** 80161847f8eSopenharmony_ci * @param { string } text - text which will be inserted. 80261847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function 80361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 80461847f8eSopenharmony_ci * @since 8 80561847f8eSopenharmony_ci * @deprecated since 9 80661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#insertText 80761847f8eSopenharmony_ci */ 80861847f8eSopenharmony_ci insertText(text: string): Promise<boolean>; 80961847f8eSopenharmony_ci 81061847f8eSopenharmony_ci /** 81161847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. 81261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback of getForward. 81361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 81461847f8eSopenharmony_ci * @since 8 81561847f8eSopenharmony_ci * @deprecated since 9 81661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#getForward 81761847f8eSopenharmony_ci */ 81861847f8eSopenharmony_ci getForward(length: number, callback: AsyncCallback<string>): void; 81961847f8eSopenharmony_ci 82061847f8eSopenharmony_ci /** 82161847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. 82261847f8eSopenharmony_ci * @returns { Promise<string> } the promise returned by the function 82361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 82461847f8eSopenharmony_ci * @since 8 82561847f8eSopenharmony_ci * @deprecated since 9 82661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#getForward 82761847f8eSopenharmony_ci */ 82861847f8eSopenharmony_ci getForward(length: number): Promise<string>; 82961847f8eSopenharmony_ci 83061847f8eSopenharmony_ci /** 83161847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. 83261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback of getBackward. 83361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 83461847f8eSopenharmony_ci * @since 8 83561847f8eSopenharmony_ci * @deprecated since 9 83661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#getBackward 83761847f8eSopenharmony_ci */ 83861847f8eSopenharmony_ci getBackward(length: number, callback: AsyncCallback<string>): void; 83961847f8eSopenharmony_ci 84061847f8eSopenharmony_ci /** 84161847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. 84261847f8eSopenharmony_ci * @returns { Promise<string> } the promise returned by the function. 84361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 84461847f8eSopenharmony_ci * @since 8 84561847f8eSopenharmony_ci * @deprecated since 9 84661847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#getBackward 84761847f8eSopenharmony_ci */ 84861847f8eSopenharmony_ci getBackward(length: number): Promise<string>; 84961847f8eSopenharmony_ci 85061847f8eSopenharmony_ci /** 85161847f8eSopenharmony_ci * @param { AsyncCallback<EditorAttribute> } callback - the callback of getEditorAttribute. 85261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 85361847f8eSopenharmony_ci * @since 8 85461847f8eSopenharmony_ci * @deprecated since 9 85561847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#getEditorAttribute 85661847f8eSopenharmony_ci */ 85761847f8eSopenharmony_ci getEditorAttribute(callback: AsyncCallback<EditorAttribute>): void; 85861847f8eSopenharmony_ci 85961847f8eSopenharmony_ci /** 86061847f8eSopenharmony_ci * @returns { Promise<EditorAttribute> } the promise returned by the function. 86161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 86261847f8eSopenharmony_ci * @since 8 86361847f8eSopenharmony_ci * @deprecated since 9 86461847f8eSopenharmony_ci * @useinstead inputMethodEngine.InputClient#getEditorAttribute 86561847f8eSopenharmony_ci */ 86661847f8eSopenharmony_ci getEditorAttribute(): Promise<EditorAttribute>; 86761847f8eSopenharmony_ci } 86861847f8eSopenharmony_ci 86961847f8eSopenharmony_ci /** 87061847f8eSopenharmony_ci * Control events about Editor. 87161847f8eSopenharmony_ci * 87261847f8eSopenharmony_ci * @interface InputClient 87361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 87461847f8eSopenharmony_ci * @since 9 87561847f8eSopenharmony_ci */ 87661847f8eSopenharmony_ci interface InputClient { 87761847f8eSopenharmony_ci /** 87861847f8eSopenharmony_ci * Send the function of the key. 87961847f8eSopenharmony_ci * 88061847f8eSopenharmony_ci * @param { number } action - action indicates the function of "enter" key. 88161847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of sendKeyFunction. 88261847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 88361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 88461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 88561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 88661847f8eSopenharmony_ci * @since 9 88761847f8eSopenharmony_ci */ 88861847f8eSopenharmony_ci sendKeyFunction(action: number, callback: AsyncCallback<boolean>): void; 88961847f8eSopenharmony_ci 89061847f8eSopenharmony_ci /** 89161847f8eSopenharmony_ci * Send the function of the key. 89261847f8eSopenharmony_ci * 89361847f8eSopenharmony_ci * @param { number } action - action indicates the function of "enter" key. 89461847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 89561847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 89661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 89761847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 89861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 89961847f8eSopenharmony_ci * @since 9 90061847f8eSopenharmony_ci */ 90161847f8eSopenharmony_ci sendKeyFunction(action: number): Promise<boolean>; 90261847f8eSopenharmony_ci 90361847f8eSopenharmony_ci /** 90461847f8eSopenharmony_ci * Delete text forward. 90561847f8eSopenharmony_ci * 90661847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted forward. It can't be less than 0. 90761847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of deleteForward. 90861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 90961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 91061847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - Input method engine error. 91161847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 91261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 91361847f8eSopenharmony_ci * @since 9 91461847f8eSopenharmony_ci */ 91561847f8eSopenharmony_ci deleteForward(length: number, callback: AsyncCallback<boolean>): void; 91661847f8eSopenharmony_ci 91761847f8eSopenharmony_ci /** 91861847f8eSopenharmony_ci * Delete text forward. 91961847f8eSopenharmony_ci * 92061847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted forward. It can't be less than 0. 92161847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 92261847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 92361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 92461847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - Input method engine error. 92561847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 92661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 92761847f8eSopenharmony_ci * @since 9 92861847f8eSopenharmony_ci */ 92961847f8eSopenharmony_ci deleteForward(length: number): Promise<boolean>; 93061847f8eSopenharmony_ci 93161847f8eSopenharmony_ci /** 93261847f8eSopenharmony_ci * Delete text forward. 93361847f8eSopenharmony_ci * 93461847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted forward. It can't be less than 0. 93561847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 93661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 93761847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - input method engine error. 93861847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 93961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 94061847f8eSopenharmony_ci * @since 10 94161847f8eSopenharmony_ci */ 94261847f8eSopenharmony_ci deleteForwardSync(length: number): void; 94361847f8eSopenharmony_ci 94461847f8eSopenharmony_ci /** 94561847f8eSopenharmony_ci * Delete text backward. 94661847f8eSopenharmony_ci * 94761847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted backward. It can't be less than 0. 94861847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of deleteBackward. 94961847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 95061847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 95161847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - Input method engine error. 95261847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 95361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 95461847f8eSopenharmony_ci * @since 9 95561847f8eSopenharmony_ci */ 95661847f8eSopenharmony_ci deleteBackward(length: number, callback: AsyncCallback<boolean>): void; 95761847f8eSopenharmony_ci 95861847f8eSopenharmony_ci /** 95961847f8eSopenharmony_ci * Delete text backward. 96061847f8eSopenharmony_ci * 96161847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted backward. It can't be less than 0. 96261847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 96361847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 96461847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 96561847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - Input method engine error. 96661847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 96761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 96861847f8eSopenharmony_ci * @since 9 96961847f8eSopenharmony_ci */ 97061847f8eSopenharmony_ci deleteBackward(length: number): Promise<boolean>; 97161847f8eSopenharmony_ci 97261847f8eSopenharmony_ci /** 97361847f8eSopenharmony_ci * Delete text backward. 97461847f8eSopenharmony_ci * 97561847f8eSopenharmony_ci * @param { number } length - length of text which will be deleted backward. It can't be less than 0. 97661847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 97761847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 97861847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - input method engine error. 97961847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 98061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 98161847f8eSopenharmony_ci * @since 10 98261847f8eSopenharmony_ci */ 98361847f8eSopenharmony_ci deleteBackwardSync(length: number): void; 98461847f8eSopenharmony_ci 98561847f8eSopenharmony_ci /** 98661847f8eSopenharmony_ci * Insert text into Editor. 98761847f8eSopenharmony_ci * 98861847f8eSopenharmony_ci * @param { string } text - text which will be inserted. 98961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of insertText. 99061847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 99161847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 99261847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - Input method engine error. 99361847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 99461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 99561847f8eSopenharmony_ci * @since 9 99661847f8eSopenharmony_ci */ 99761847f8eSopenharmony_ci insertText(text: string, callback: AsyncCallback<boolean>): void; 99861847f8eSopenharmony_ci 99961847f8eSopenharmony_ci /** 100061847f8eSopenharmony_ci * Insert text into Editor. 100161847f8eSopenharmony_ci * 100261847f8eSopenharmony_ci * @param { string } text - text which will be inserted. 100361847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the function. 100461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 100561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 100661847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - Input method engine error. 100761847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 100861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 100961847f8eSopenharmony_ci * @since 9 101061847f8eSopenharmony_ci */ 101161847f8eSopenharmony_ci insertText(text: string): Promise<boolean>; 101261847f8eSopenharmony_ci 101361847f8eSopenharmony_ci /** 101461847f8eSopenharmony_ci * Insert text into Editor. 101561847f8eSopenharmony_ci * 101661847f8eSopenharmony_ci * @param { string } text - text which will be inserted. 101761847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 101861847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 101961847f8eSopenharmony_ci * @throws { BusinessError } 12800002 - input method engine error. 102061847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 102161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 102261847f8eSopenharmony_ci * @since 10 102361847f8eSopenharmony_ci */ 102461847f8eSopenharmony_ci insertTextSync(text: string): void; 102561847f8eSopenharmony_ci 102661847f8eSopenharmony_ci /** 102761847f8eSopenharmony_ci * Get the text before cursor. 102861847f8eSopenharmony_ci * 102961847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. It can't be less than 0. 103061847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback of getForward. 103161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 103261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 103361847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 103461847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 103561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 103661847f8eSopenharmony_ci * @since 9 103761847f8eSopenharmony_ci */ 103861847f8eSopenharmony_ci getForward(length: number, callback: AsyncCallback<string>): void; 103961847f8eSopenharmony_ci 104061847f8eSopenharmony_ci /** 104161847f8eSopenharmony_ci * Get the text before cursor. 104261847f8eSopenharmony_ci * 104361847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. It can't be less than 0. 104461847f8eSopenharmony_ci * @returns { Promise<string> } the promise returned by the function. 104561847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 104661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 104761847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 104861847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 104961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 105061847f8eSopenharmony_ci * @since 9 105161847f8eSopenharmony_ci */ 105261847f8eSopenharmony_ci getForward(length: number): Promise<string>; 105361847f8eSopenharmony_ci 105461847f8eSopenharmony_ci /** 105561847f8eSopenharmony_ci * Get the text before cursor. 105661847f8eSopenharmony_ci * 105761847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. It can't be less than 0. 105861847f8eSopenharmony_ci * @returns { string } the text string before cursor. 105961847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 106061847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 106161847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 106261847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - input method controller error. 106361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 106461847f8eSopenharmony_ci * @since 10 106561847f8eSopenharmony_ci */ 106661847f8eSopenharmony_ci getForwardSync(length: number): string; 106761847f8eSopenharmony_ci 106861847f8eSopenharmony_ci /** 106961847f8eSopenharmony_ci * Get the text after cursor. 107061847f8eSopenharmony_ci * 107161847f8eSopenharmony_ci * @param { number } length - the length of text which will be got.It can't be less than 0. 107261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback of getBackward. 107361847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 107461847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 107561847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 107661847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 107761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 107861847f8eSopenharmony_ci * @since 9 107961847f8eSopenharmony_ci */ 108061847f8eSopenharmony_ci getBackward(length: number, callback: AsyncCallback<string>): void; 108161847f8eSopenharmony_ci 108261847f8eSopenharmony_ci /** 108361847f8eSopenharmony_ci * Get the text after cursor. 108461847f8eSopenharmony_ci * 108561847f8eSopenharmony_ci * @param { number } length - the length of text which will be got.It can't be less than 0. 108661847f8eSopenharmony_ci * @returns { Promise<string> } the promise returned by the function. 108761847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 108861847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 108961847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 109061847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 109161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 109261847f8eSopenharmony_ci * @since 9 109361847f8eSopenharmony_ci */ 109461847f8eSopenharmony_ci getBackward(length: number): Promise<string>; 109561847f8eSopenharmony_ci 109661847f8eSopenharmony_ci /** 109761847f8eSopenharmony_ci * Get the text after cursor. 109861847f8eSopenharmony_ci * 109961847f8eSopenharmony_ci * @param { number } length - the length of text which will be got. It can't be less than 0. 110061847f8eSopenharmony_ci * @returns { string } the text string after cursor. 110161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 110261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 110361847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 110461847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - input method controller error. 110561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 110661847f8eSopenharmony_ci * @since 10 110761847f8eSopenharmony_ci */ 110861847f8eSopenharmony_ci getBackwardSync(length: number): string; 110961847f8eSopenharmony_ci 111061847f8eSopenharmony_ci /** 111161847f8eSopenharmony_ci * Get attribute about editor. 111261847f8eSopenharmony_ci * 111361847f8eSopenharmony_ci * @param { AsyncCallback<EditorAttribute> } callback - the callback of getEditorAttribute. 111461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 111561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 111661847f8eSopenharmony_ci * @since 9 111761847f8eSopenharmony_ci */ 111861847f8eSopenharmony_ci getEditorAttribute(callback: AsyncCallback<EditorAttribute>): void; 111961847f8eSopenharmony_ci 112061847f8eSopenharmony_ci /** 112161847f8eSopenharmony_ci * Get attribute about editor. 112261847f8eSopenharmony_ci * 112361847f8eSopenharmony_ci * @returns { Promise<EditorAttribute> } the promise returned by the function. 112461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 112561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 112661847f8eSopenharmony_ci * @since 9 112761847f8eSopenharmony_ci */ 112861847f8eSopenharmony_ci getEditorAttribute(): Promise<EditorAttribute>; 112961847f8eSopenharmony_ci 113061847f8eSopenharmony_ci /** 113161847f8eSopenharmony_ci * Get attribute about editor. 113261847f8eSopenharmony_ci * 113361847f8eSopenharmony_ci * @returns { EditorAttribute } the attribute of editor. 113461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 113561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 113661847f8eSopenharmony_ci * @since 10 113761847f8eSopenharmony_ci */ 113861847f8eSopenharmony_ci getEditorAttributeSync(): EditorAttribute; 113961847f8eSopenharmony_ci 114061847f8eSopenharmony_ci /** 114161847f8eSopenharmony_ci * Move cursor from input method. 114261847f8eSopenharmony_ci * 114361847f8eSopenharmony_ci * @param { number } direction - Indicates the distance of cursor to be moved. It can't be less than 0. 114461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of moveCursor. 114561847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 114661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 114761847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 114861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 114961847f8eSopenharmony_ci * @since 9 115061847f8eSopenharmony_ci */ 115161847f8eSopenharmony_ci moveCursor(direction: number, callback: AsyncCallback<void>): void; 115261847f8eSopenharmony_ci 115361847f8eSopenharmony_ci /** 115461847f8eSopenharmony_ci * Move cursor from input method. 115561847f8eSopenharmony_ci * 115661847f8eSopenharmony_ci * @param { number } direction - Indicates the distance of cursor to be moved. It can't be less than 0. 115761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 115861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 115961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 116061847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 116161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 116261847f8eSopenharmony_ci * @since 9 116361847f8eSopenharmony_ci */ 116461847f8eSopenharmony_ci moveCursor(direction: number): Promise<void>; 116561847f8eSopenharmony_ci 116661847f8eSopenharmony_ci /** 116761847f8eSopenharmony_ci * Move cursor from input method. 116861847f8eSopenharmony_ci * 116961847f8eSopenharmony_ci * @param { number } direction - Indicates the distance of cursor to be moved. It can't be less than 0. 117061847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 117161847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 117261847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 117361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 117461847f8eSopenharmony_ci * @since 10 117561847f8eSopenharmony_ci */ 117661847f8eSopenharmony_ci moveCursorSync(direction: number): void; 117761847f8eSopenharmony_ci 117861847f8eSopenharmony_ci /** 117961847f8eSopenharmony_ci * Select text in editor by range. 118061847f8eSopenharmony_ci * 118161847f8eSopenharmony_ci * @param { Range } range - indicates the range of selected text in editor. 118261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of selectByRange. 118361847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 118461847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 118561847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 118661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 118761847f8eSopenharmony_ci * @since 10 118861847f8eSopenharmony_ci */ 118961847f8eSopenharmony_ci selectByRange(range: Range, callback: AsyncCallback<void>): void; 119061847f8eSopenharmony_ci 119161847f8eSopenharmony_ci /** 119261847f8eSopenharmony_ci * Select text in editor by range. 119361847f8eSopenharmony_ci * 119461847f8eSopenharmony_ci * @param { Range } range - indicates the range of selected text in editor. 119561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 119661847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 119761847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 119861847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 119961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 120061847f8eSopenharmony_ci * @since 10 120161847f8eSopenharmony_ci */ 120261847f8eSopenharmony_ci selectByRange(range: Range): Promise<void>; 120361847f8eSopenharmony_ci 120461847f8eSopenharmony_ci /** 120561847f8eSopenharmony_ci * Select text in editor by range. 120661847f8eSopenharmony_ci * 120761847f8eSopenharmony_ci * @param { Range } range - indicates the range of selected text in editor. 120861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 120961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 121061847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 121161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 121261847f8eSopenharmony_ci * @since 10 121361847f8eSopenharmony_ci */ 121461847f8eSopenharmony_ci selectByRangeSync(range: Range): void; 121561847f8eSopenharmony_ci 121661847f8eSopenharmony_ci /** 121761847f8eSopenharmony_ci * Select text in editor by cursor movement. 121861847f8eSopenharmony_ci * 121961847f8eSopenharmony_ci * @param { Movement } movement - indicates the movement of cursor when selecting. 122061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of selectByMovement. 122161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 122261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 122361847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 122461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 122561847f8eSopenharmony_ci * @since 10 122661847f8eSopenharmony_ci */ 122761847f8eSopenharmony_ci selectByMovement(movement: Movement, callback: AsyncCallback<void>): void; 122861847f8eSopenharmony_ci 122961847f8eSopenharmony_ci /** 123061847f8eSopenharmony_ci * Select text in editor by cursor movement. 123161847f8eSopenharmony_ci * 123261847f8eSopenharmony_ci * @param { Movement } movement - indicates the movement of cursor when selecting. 123361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 123461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 123561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 123661847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 123761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 123861847f8eSopenharmony_ci * @since 10 123961847f8eSopenharmony_ci */ 124061847f8eSopenharmony_ci selectByMovement(movement: Movement): Promise<void>; 124161847f8eSopenharmony_ci 124261847f8eSopenharmony_ci /** 124361847f8eSopenharmony_ci * Select text in editor by cursor movement. 124461847f8eSopenharmony_ci * 124561847f8eSopenharmony_ci * @param { Movement } movement - indicates the movement of cursor when selecting. 124661847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 124761847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 124861847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 124961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 125061847f8eSopenharmony_ci * @since 10 125161847f8eSopenharmony_ci */ 125261847f8eSopenharmony_ci selectByMovementSync(movement: Movement): void; 125361847f8eSopenharmony_ci 125461847f8eSopenharmony_ci /** 125561847f8eSopenharmony_ci * Get the index number of text at cursor. 125661847f8eSopenharmony_ci * 125761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of getTextIndexAtCursor, number represents the index 125861847f8eSopenharmony_ci * number of text at cursor. 125961847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 126061847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 126161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 126261847f8eSopenharmony_ci * @since 10 126361847f8eSopenharmony_ci */ 126461847f8eSopenharmony_ci getTextIndexAtCursor(callback: AsyncCallback<number>): void; 126561847f8eSopenharmony_ci 126661847f8eSopenharmony_ci /** 126761847f8eSopenharmony_ci * Get the index number of text at cursor. 126861847f8eSopenharmony_ci * 126961847f8eSopenharmony_ci * @returns { Promise<number> } the promise returned by the function, number represents the index number of text 127061847f8eSopenharmony_ci * at cursor. 127161847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 127261847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 127361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 127461847f8eSopenharmony_ci * @since 10 127561847f8eSopenharmony_ci */ 127661847f8eSopenharmony_ci getTextIndexAtCursor(): Promise<number>; 127761847f8eSopenharmony_ci 127861847f8eSopenharmony_ci /** 127961847f8eSopenharmony_ci * Get the index number of text at cursor. 128061847f8eSopenharmony_ci * 128161847f8eSopenharmony_ci * @returns { number } the index number of text at cursor. 128261847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 128361847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 128461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 128561847f8eSopenharmony_ci * @since 10 128661847f8eSopenharmony_ci */ 128761847f8eSopenharmony_ci getTextIndexAtCursorSync(): number; 128861847f8eSopenharmony_ci 128961847f8eSopenharmony_ci /** 129061847f8eSopenharmony_ci * Send extend action code. 129161847f8eSopenharmony_ci * 129261847f8eSopenharmony_ci * @param { ExtendAction } action - action code which will be send. 129361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of sendExtendAction. 129461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 129561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types 129661847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 129761847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 129861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 129961847f8eSopenharmony_ci * @since 10 130061847f8eSopenharmony_ci */ 130161847f8eSopenharmony_ci sendExtendAction(action: ExtendAction, callback: AsyncCallback<void>): void; 130261847f8eSopenharmony_ci 130361847f8eSopenharmony_ci /** 130461847f8eSopenharmony_ci * Send extend action code. 130561847f8eSopenharmony_ci * 130661847f8eSopenharmony_ci * @param { ExtendAction } action - action code which will be send. 130761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 130861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 130961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types 131061847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 131161847f8eSopenharmony_ci * @throws { BusinessError } 12800006 - Input method controller error. 131261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 131361847f8eSopenharmony_ci * @since 10 131461847f8eSopenharmony_ci */ 131561847f8eSopenharmony_ci sendExtendAction(action: ExtendAction): Promise<void>; 131661847f8eSopenharmony_ci 131761847f8eSopenharmony_ci /** 131861847f8eSopenharmony_ci * Send private command.This function can only be called by default input method configured by system. 131961847f8eSopenharmony_ci * 132061847f8eSopenharmony_ci * @param { Record<string, CommandDataType> } commandData - command data which will be send.Max size 32KB. 132161847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 132261847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 132361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 132461847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 132561847f8eSopenharmony_ci * @throws { BusinessError } 12800010 - not default input method configured by system. 132661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 132761847f8eSopenharmony_ci * @since 12 132861847f8eSopenharmony_ci */ 132961847f8eSopenharmony_ci sendPrivateCommand(commandData: Record<string, CommandDataType>): Promise<void>; 133061847f8eSopenharmony_ci 133161847f8eSopenharmony_ci /** 133261847f8eSopenharmony_ci * Get info of the calling window. 133361847f8eSopenharmony_ci * 133461847f8eSopenharmony_ci * @returns { Promise<WindowInfo> } the promise returned by the function. 133561847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 133661847f8eSopenharmony_ci * @throws { BusinessError } 12800012 - input method panel doesn't exist. 133761847f8eSopenharmony_ci * @throws { BusinessError } 12800013 - window manager service error. 133861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 133961847f8eSopenharmony_ci * @since 12 134061847f8eSopenharmony_ci */ 134161847f8eSopenharmony_ci getCallingWindowInfo(): Promise<WindowInfo>; 134261847f8eSopenharmony_ci 134361847f8eSopenharmony_ci /** 134461847f8eSopenharmony_ci * Insert the provided text as preview text. 134561847f8eSopenharmony_ci * 134661847f8eSopenharmony_ci * @param { string } text - the text to be previewed. 134761847f8eSopenharmony_ci * @param { Range } range - the range of the text to be replaced by the preview text. 134861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 134961847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 135061847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 135161847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 135261847f8eSopenharmony_ci * @throws { BusinessError } 12800011 - text preview is not supported. 135361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 135461847f8eSopenharmony_ci * @since 12 135561847f8eSopenharmony_ci */ 135661847f8eSopenharmony_ci setPreviewText(text: string, range: Range): Promise<void>; 135761847f8eSopenharmony_ci 135861847f8eSopenharmony_ci /** 135961847f8eSopenharmony_ci * Insert the provided text as preview text. 136061847f8eSopenharmony_ci * 136161847f8eSopenharmony_ci * @param { string } text - the text to be previewed. 136261847f8eSopenharmony_ci * @param { Range } range - the range of the text to be replaced by the preview text. 136361847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 136461847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 136561847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 136661847f8eSopenharmony_ci * @throws { BusinessError } 12800011 - text preview is not supported. 136761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 136861847f8eSopenharmony_ci * @since 12 136961847f8eSopenharmony_ci */ 137061847f8eSopenharmony_ci setPreviewTextSync(text: string, range: Range): void; 137161847f8eSopenharmony_ci 137261847f8eSopenharmony_ci /** 137361847f8eSopenharmony_ci * Finish the text preview. 137461847f8eSopenharmony_ci * 137561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 137661847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 137761847f8eSopenharmony_ci * @throws { BusinessError } 12800011 - text preview is not supported. 137861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 137961847f8eSopenharmony_ci * @since 12 138061847f8eSopenharmony_ci */ 138161847f8eSopenharmony_ci finishTextPreview(): Promise<void>; 138261847f8eSopenharmony_ci 138361847f8eSopenharmony_ci /** 138461847f8eSopenharmony_ci * Finish the text preview. 138561847f8eSopenharmony_ci * 138661847f8eSopenharmony_ci * @throws { BusinessError } 12800003 - input method client error. 138761847f8eSopenharmony_ci * @throws { BusinessError } 12800011 - text preview is not supported. 138861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 138961847f8eSopenharmony_ci * @since 12 139061847f8eSopenharmony_ci */ 139161847f8eSopenharmony_ci finishTextPreviewSync(): void; 139261847f8eSopenharmony_ci } 139361847f8eSopenharmony_ci 139461847f8eSopenharmony_ci /** 139561847f8eSopenharmony_ci * @interface KeyboardDelegate 139661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 139761847f8eSopenharmony_ci * @since 8 139861847f8eSopenharmony_ci */ 139961847f8eSopenharmony_ci interface KeyboardDelegate { 140061847f8eSopenharmony_ci /** 140161847f8eSopenharmony_ci * Subscribe key up or down event 140261847f8eSopenharmony_ci * 140361847f8eSopenharmony_ci * @param { 'keyDown' | 'keyUp' } type - indicates the type of subscribe event. 140461847f8eSopenharmony_ci * @param { function } callback - indicates the callback function of on('keyDown'|'keyUp'). 140561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 140661847f8eSopenharmony_ci * @since 8 140761847f8eSopenharmony_ci */ 140861847f8eSopenharmony_ci on(type: 'keyDown' | 'keyUp', callback: (event: KeyEvent) => boolean): void; 140961847f8eSopenharmony_ci 141061847f8eSopenharmony_ci /** 141161847f8eSopenharmony_ci * Unsubscribe key up or down event 141261847f8eSopenharmony_ci * 141361847f8eSopenharmony_ci * @param { 'keyDown' | 'keyUp' } type - indicates the type of unsubscribe event. 141461847f8eSopenharmony_ci * @param { function } [callback] - optional, indicates the callback function of off('keyDown'|'keyUp'). 141561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 141661847f8eSopenharmony_ci * @since 8 141761847f8eSopenharmony_ci */ 141861847f8eSopenharmony_ci off(type: 'keyDown' | 'keyUp', callback?: (event: KeyEvent) => boolean): void; 141961847f8eSopenharmony_ci 142061847f8eSopenharmony_ci /** 142161847f8eSopenharmony_ci * Subscribe key event. 142261847f8eSopenharmony_ci * 142361847f8eSopenharmony_ci * @param { 'keyEvent' } type - indicates the type of subscribe event. 142461847f8eSopenharmony_ci * @param { function } callback - indicates the callback function of on('keyEvent'). 142561847f8eSopenharmony_ci * If the key is processed by event subscriber, callback should be return true, else return false. 142661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 142761847f8eSopenharmony_ci * @since 10 142861847f8eSopenharmony_ci */ 142961847f8eSopenharmony_ci on(type: 'keyEvent', callback: (event: InputKeyEvent) => boolean): void; 143061847f8eSopenharmony_ci 143161847f8eSopenharmony_ci /** 143261847f8eSopenharmony_ci * Unsubscribe key event. 143361847f8eSopenharmony_ci * 143461847f8eSopenharmony_ci * @param { 'keyEvent' } type - indicates the type of unsubscribe event. 143561847f8eSopenharmony_ci * @param { function } [callback] - optional, indicates the callback function of off('keyEvent'). 143661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 143761847f8eSopenharmony_ci * @since 10 143861847f8eSopenharmony_ci */ 143961847f8eSopenharmony_ci off(type: 'keyEvent', callback?: (event: InputKeyEvent) => boolean): void; 144061847f8eSopenharmony_ci 144161847f8eSopenharmony_ci /** 144261847f8eSopenharmony_ci * Subscribe cursor context change 144361847f8eSopenharmony_ci * 144461847f8eSopenharmony_ci * @param { 'cursorContextChange' } type - indicates the type of subscribe event. 144561847f8eSopenharmony_ci * @param { function } callback - indicates the callback function of on('cursorContextChange'). 144661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 144761847f8eSopenharmony_ci * @since 8 144861847f8eSopenharmony_ci */ 144961847f8eSopenharmony_ci on(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void; 145061847f8eSopenharmony_ci 145161847f8eSopenharmony_ci /** 145261847f8eSopenharmony_ci * Unsubscribe cursor context change 145361847f8eSopenharmony_ci * 145461847f8eSopenharmony_ci * @param { 'cursorContextChange' } type - indicates the type of unsubscribe event. 145561847f8eSopenharmony_ci * @param { function } [callback] - optional, indicates the callback function of off('cursorContextChange'). 145661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 145761847f8eSopenharmony_ci * @since 8 145861847f8eSopenharmony_ci */ 145961847f8eSopenharmony_ci off(type: 'cursorContextChange', callback?: (x: number, y: number, height: number) => void): void; 146061847f8eSopenharmony_ci 146161847f8eSopenharmony_ci /** 146261847f8eSopenharmony_ci * Subscribe selection change 146361847f8eSopenharmony_ci * 146461847f8eSopenharmony_ci * @param { 'selectionChange' } type - indicates the type of subscribe event. 146561847f8eSopenharmony_ci * @param { function } callback - indicates the callback function 146661847f8eSopenharmony_ci * of on('selectionChange'). 146761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 146861847f8eSopenharmony_ci * @since 8 146961847f8eSopenharmony_ci */ 147061847f8eSopenharmony_ci on( 147161847f8eSopenharmony_ci type: 'selectionChange', 147261847f8eSopenharmony_ci callback: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void 147361847f8eSopenharmony_ci ): void; 147461847f8eSopenharmony_ci 147561847f8eSopenharmony_ci /** 147661847f8eSopenharmony_ci * Unsubscribe selection change 147761847f8eSopenharmony_ci * 147861847f8eSopenharmony_ci * @param { 'selectionChange' } type - indicates the type of unsubscribe event. 147961847f8eSopenharmony_ci * @param { function } [callback] - optional, 148061847f8eSopenharmony_ci * indicates the callback function of off('selectionChange'). 148161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 148261847f8eSopenharmony_ci * @since 8 148361847f8eSopenharmony_ci */ 148461847f8eSopenharmony_ci off( 148561847f8eSopenharmony_ci type: 'selectionChange', 148661847f8eSopenharmony_ci callback?: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void 148761847f8eSopenharmony_ci ): void; 148861847f8eSopenharmony_ci 148961847f8eSopenharmony_ci /** 149061847f8eSopenharmony_ci * Subscribe text change 149161847f8eSopenharmony_ci * 149261847f8eSopenharmony_ci * @param { 'textChange' } type - indicates the type of subscribe event. 149361847f8eSopenharmony_ci * @param { function } callback - indicates the callback function of on('textChange'). 149461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 149561847f8eSopenharmony_ci * @since 8 149661847f8eSopenharmony_ci */ 149761847f8eSopenharmony_ci on(type: 'textChange', callback: (text: string) => void): void; 149861847f8eSopenharmony_ci 149961847f8eSopenharmony_ci /** 150061847f8eSopenharmony_ci * Unsubscribe text change 150161847f8eSopenharmony_ci * 150261847f8eSopenharmony_ci * @param { 'textChange' } type - indicates the type of unsubscribe event. 150361847f8eSopenharmony_ci * @param { function } [callback] - optional, indicates the callback function of off('textChange'). 150461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 150561847f8eSopenharmony_ci * @since 8 150661847f8eSopenharmony_ci */ 150761847f8eSopenharmony_ci off(type: 'textChange', callback?: (text: string) => void): void; 150861847f8eSopenharmony_ci 150961847f8eSopenharmony_ci /** 151061847f8eSopenharmony_ci * Subscribe input text attribute change 151161847f8eSopenharmony_ci * 151261847f8eSopenharmony_ci * @param { 'editorAttributeChanged' } type - indicates the type of subscribe event. 151361847f8eSopenharmony_ci * @param { function } callback - indicates the callback function of on('editorAttributeChanged'). 151461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 151561847f8eSopenharmony_ci * @since 10 151661847f8eSopenharmony_ci */ 151761847f8eSopenharmony_ci on(type: 'editorAttributeChanged', callback: (attr: EditorAttribute) => void): void; 151861847f8eSopenharmony_ci 151961847f8eSopenharmony_ci /** 152061847f8eSopenharmony_ci * Unsubscribe input text attribute change 152161847f8eSopenharmony_ci * 152261847f8eSopenharmony_ci * @param { 'editorAttributeChanged' } type - indicates the type of subscribe event. 152361847f8eSopenharmony_ci * @param { function } [callback] - indicates the callback function of off('editorAttributeChanged'). 152461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 152561847f8eSopenharmony_ci * @since 10 152661847f8eSopenharmony_ci */ 152761847f8eSopenharmony_ci off(type: 'editorAttributeChanged', callback?: (attr: EditorAttribute) => void): void; 152861847f8eSopenharmony_ci } 152961847f8eSopenharmony_ci 153061847f8eSopenharmony_ci /** 153161847f8eSopenharmony_ci * A panel is a container used to hold soft keyboard, candidate list, or status bar. 153261847f8eSopenharmony_ci * 153361847f8eSopenharmony_ci * @interface Panel 153461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 153561847f8eSopenharmony_ci * @since 10 153661847f8eSopenharmony_ci */ 153761847f8eSopenharmony_ci interface Panel { 153861847f8eSopenharmony_ci /** 153961847f8eSopenharmony_ci * Sets ui content. 154061847f8eSopenharmony_ci * <p>When this method is executed successfully, the content of panel will be replaced.</p> 154161847f8eSopenharmony_ci * 154261847f8eSopenharmony_ci * @param { string } path - the path of ui content. 154361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setUiContent. 154461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 154561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 154661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 154761847f8eSopenharmony_ci * @since 10 154861847f8eSopenharmony_ci */ 154961847f8eSopenharmony_ci setUiContent(path: string, callback: AsyncCallback<void>): void; 155061847f8eSopenharmony_ci 155161847f8eSopenharmony_ci /** 155261847f8eSopenharmony_ci * Sets ui content. 155361847f8eSopenharmony_ci * <p>When this method is executed successfully, the content of panel will be replaced.</p> 155461847f8eSopenharmony_ci * 155561847f8eSopenharmony_ci * @param { string } path - the path of ui content. 155661847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 155761847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 155861847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 155961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 156061847f8eSopenharmony_ci * @since 10 156161847f8eSopenharmony_ci */ 156261847f8eSopenharmony_ci setUiContent(path: string): Promise<void>; 156361847f8eSopenharmony_ci 156461847f8eSopenharmony_ci /** 156561847f8eSopenharmony_ci * Sets ui content. 156661847f8eSopenharmony_ci * <p>When this method is executed successfully, the content of panel will be replaced.</p> 156761847f8eSopenharmony_ci * 156861847f8eSopenharmony_ci * @param { string } path - the path of ui content. 156961847f8eSopenharmony_ci * @param { LocalStorage } storage - the data object shared within the content instance loaded by the panel. 157061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setUiContent. 157161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 157261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 157361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 157461847f8eSopenharmony_ci * @since 10 157561847f8eSopenharmony_ci */ 157661847f8eSopenharmony_ci setUiContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 157761847f8eSopenharmony_ci 157861847f8eSopenharmony_ci /** 157961847f8eSopenharmony_ci * Sets ui content. 158061847f8eSopenharmony_ci * <p>When this method is executed successfully, the content of panel will be replaced.</p> 158161847f8eSopenharmony_ci * 158261847f8eSopenharmony_ci * @param { string } path - the path of ui content. 158361847f8eSopenharmony_ci * @param { LocalStorage } storage - the data object shared within the content instance loaded by the panel. 158461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 158561847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 158661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 158761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 158861847f8eSopenharmony_ci * @since 10 158961847f8eSopenharmony_ci */ 159061847f8eSopenharmony_ci setUiContent(path: string, storage: LocalStorage): Promise<void>; 159161847f8eSopenharmony_ci 159261847f8eSopenharmony_ci /** 159361847f8eSopenharmony_ci * Resizes a panel. 159461847f8eSopenharmony_ci * 159561847f8eSopenharmony_ci * @param { number } width - the new width of the panel. 159661847f8eSopenharmony_ci * @param { number } height - the new height of the panel. 159761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of resize. 159861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 159961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 160061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 160161847f8eSopenharmony_ci * @since 10 160261847f8eSopenharmony_ci */ 160361847f8eSopenharmony_ci resize(width: number, height: number, callback: AsyncCallback<void>): void; 160461847f8eSopenharmony_ci 160561847f8eSopenharmony_ci /** 160661847f8eSopenharmony_ci * Resizes a panel. 160761847f8eSopenharmony_ci * 160861847f8eSopenharmony_ci * @param { number } width - the new width of the panel. 160961847f8eSopenharmony_ci * @param { number } height - the new height of the panel. 161061847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 161161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 161261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 161361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 161461847f8eSopenharmony_ci * @since 10 161561847f8eSopenharmony_ci */ 161661847f8eSopenharmony_ci resize(width: number, height: number): Promise<void>; 161761847f8eSopenharmony_ci 161861847f8eSopenharmony_ci /** 161961847f8eSopenharmony_ci * Moves a panel. 162061847f8eSopenharmony_ci * <p>It's unusable for SOFT_KEYBOARD panel with FLG_FIXED.</p> 162161847f8eSopenharmony_ci * 162261847f8eSopenharmony_ci * @param { number } x - the x-coordinate of the new position. 162361847f8eSopenharmony_ci * @param { number } y - the y-coordinate of the new position. 162461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of moveTo. 162561847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 162661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 162761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 162861847f8eSopenharmony_ci * @since 10 162961847f8eSopenharmony_ci */ 163061847f8eSopenharmony_ci moveTo(x: number, y: number, callback: AsyncCallback<void>): void; 163161847f8eSopenharmony_ci 163261847f8eSopenharmony_ci /** 163361847f8eSopenharmony_ci * Moves a panel. 163461847f8eSopenharmony_ci * <p>It's unusable for SOFT_KEYBOARD panel with FLG_FIXED.</p> 163561847f8eSopenharmony_ci * 163661847f8eSopenharmony_ci * @param { number } x - the x-coordinate of the new position. 163761847f8eSopenharmony_ci * @param { number } y - the y-coordinate of the new position. 163861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 163961847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 164061847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 164161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 164261847f8eSopenharmony_ci * @since 10 164361847f8eSopenharmony_ci */ 164461847f8eSopenharmony_ci moveTo(x: number, y: number): Promise<void>; 164561847f8eSopenharmony_ci 164661847f8eSopenharmony_ci /** 164761847f8eSopenharmony_ci * Shows panel. 164861847f8eSopenharmony_ci * 164961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of show. 165061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 165161847f8eSopenharmony_ci * @since 10 165261847f8eSopenharmony_ci */ 165361847f8eSopenharmony_ci show(callback: AsyncCallback<void>): void; 165461847f8eSopenharmony_ci 165561847f8eSopenharmony_ci /** 165661847f8eSopenharmony_ci * Shows panel. 165761847f8eSopenharmony_ci * 165861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 165961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 166061847f8eSopenharmony_ci * @since 10 166161847f8eSopenharmony_ci */ 166261847f8eSopenharmony_ci show(): Promise<void>; 166361847f8eSopenharmony_ci 166461847f8eSopenharmony_ci /** 166561847f8eSopenharmony_ci * Hides panel. 166661847f8eSopenharmony_ci * 166761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of hide. 166861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 166961847f8eSopenharmony_ci * @since 10 167061847f8eSopenharmony_ci */ 167161847f8eSopenharmony_ci hide(callback: AsyncCallback<void>): void; 167261847f8eSopenharmony_ci 167361847f8eSopenharmony_ci /** 167461847f8eSopenharmony_ci * Hides panel. 167561847f8eSopenharmony_ci * 167661847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 167761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 167861847f8eSopenharmony_ci * @since 10 167961847f8eSopenharmony_ci */ 168061847f8eSopenharmony_ci hide(): Promise<void>; 168161847f8eSopenharmony_ci 168261847f8eSopenharmony_ci /** 168361847f8eSopenharmony_ci * Registers panel show event. 168461847f8eSopenharmony_ci * <p>The "show" events are triggered when the panel is shown.</p> 168561847f8eSopenharmony_ci * 168661847f8eSopenharmony_ci * @param { 'show' } type - events type. 168761847f8eSopenharmony_ci * @param { function } callback - the callback will be called when events are triggered. 168861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 168961847f8eSopenharmony_ci * @since 10 169061847f8eSopenharmony_ci */ 169161847f8eSopenharmony_ci on(type: 'show', callback: () => void): void; 169261847f8eSopenharmony_ci 169361847f8eSopenharmony_ci /** 169461847f8eSopenharmony_ci * Unregisters panel show event. 169561847f8eSopenharmony_ci * 169661847f8eSopenharmony_ci * @param { 'show' } type - events type. 169761847f8eSopenharmony_ci * @param { function } [callback] - the callback to Unregister. 169861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 169961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 170061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 170161847f8eSopenharmony_ci * @since 10 170261847f8eSopenharmony_ci */ 170361847f8eSopenharmony_ci off(type: 'show', callback?: () => void): void; 170461847f8eSopenharmony_ci 170561847f8eSopenharmony_ci /** 170661847f8eSopenharmony_ci * Registers panel hide event. 170761847f8eSopenharmony_ci * <p>The "hide" events are triggered when the panel is hidden.</p> 170861847f8eSopenharmony_ci * 170961847f8eSopenharmony_ci * @param { 'hide' } type - events type. 171061847f8eSopenharmony_ci * @param { function } callback - the callback will be called when events are triggered. 171161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 171261847f8eSopenharmony_ci * @since 10 171361847f8eSopenharmony_ci */ 171461847f8eSopenharmony_ci on(type: 'hide', callback: () => void): void; 171561847f8eSopenharmony_ci 171661847f8eSopenharmony_ci /** 171761847f8eSopenharmony_ci * Unregisters panel hide event. 171861847f8eSopenharmony_ci * 171961847f8eSopenharmony_ci * @param { 'hide' } type - events type. 172061847f8eSopenharmony_ci * @param { function } [callback] - the callback to Unregister. 172161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 172261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 172361847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 172461847f8eSopenharmony_ci * @since 10 172561847f8eSopenharmony_ci */ 172661847f8eSopenharmony_ci off(type: 'hide', callback?: () => void): void; 172761847f8eSopenharmony_ci 172861847f8eSopenharmony_ci /** 172961847f8eSopenharmony_ci * Changes panel flag. 173061847f8eSopenharmony_ci * <p>Before flag is changed, Developers should hide the panel.After that, developers can change the content, size, point of the panel 173161847f8eSopenharmony_ci * and show it again at appropriate opportunity.</p> 173261847f8eSopenharmony_ci * 173361847f8eSopenharmony_ci * @param { PanelFlag } flag - the callback of changeFlag. 173461847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 173561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 173661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 173761847f8eSopenharmony_ci * @since 10 173861847f8eSopenharmony_ci */ 173961847f8eSopenharmony_ci changeFlag(flag: PanelFlag): void; 174061847f8eSopenharmony_ci 174161847f8eSopenharmony_ci /** 174261847f8eSopenharmony_ci * Sets ime panel private mode or not. 174361847f8eSopenharmony_ci * 174461847f8eSopenharmony_ci * @permission ohos.permission.PRIVACY_WINDOW 174561847f8eSopenharmony_ci * @param { boolean } isPrivacyMode - if the value is true, the privacy mode will be set, 174661847f8eSopenharmony_ci * otherwise the non-privacy mode will be set. 174761847f8eSopenharmony_ci * @throws { BusinessError } 201 - permissions check fails. 174861847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 174961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 175061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 175161847f8eSopenharmony_ci * @since 11 175261847f8eSopenharmony_ci */ 175361847f8eSopenharmony_ci setPrivacyMode(isPrivacyMode: boolean): void; 175461847f8eSopenharmony_ci 175561847f8eSopenharmony_ci /** 175661847f8eSopenharmony_ci * Adjust the rect of soft keyboard panel for landscape and portrait orientations. 175761847f8eSopenharmony_ci * <p>It's only used for SOFT_KEYBOARD panel with FLG_FIXED and FLG_FLOATING.</p> 175861847f8eSopenharmony_ci * 175961847f8eSopenharmony_ci * @param { PanelFlag } flag - panel flag. 176061847f8eSopenharmony_ci * @param { PanelRect } rect - panel rect. 176161847f8eSopenharmony_ci * @throws { BusinessError } 401 - parameter error. Possible causes: 176261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 176361847f8eSopenharmony_ci * @throws { BusinessError } 12800013 - window manager service error. 176461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 176561847f8eSopenharmony_ci * @since 12 176661847f8eSopenharmony_ci */ 176761847f8eSopenharmony_ci adjustPanelRect(flag: PanelFlag, rect: PanelRect): void; 176861847f8eSopenharmony_ci 176961847f8eSopenharmony_ci /** 177061847f8eSopenharmony_ci * Subscribe 'sizeChange' event. 177161847f8eSopenharmony_ci * <p>It's only used for SOFT_KEYBOARD panel with FLG_FIXED and FLG_FLOATING.</p> 177261847f8eSopenharmony_ci * 177361847f8eSopenharmony_ci * @param { 'sizeChange' } type - the type of subscribe event. 177461847f8eSopenharmony_ci * @param { Callback<window.Size> } callback - the callback of on('sizeChange'). 177561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 177661847f8eSopenharmony_ci * @since 12 177761847f8eSopenharmony_ci */ 177861847f8eSopenharmony_ci on(type: 'sizeChange', callback: Callback<window.Size>): void; 177961847f8eSopenharmony_ci 178061847f8eSopenharmony_ci /** 178161847f8eSopenharmony_ci * Unsubscribe 'sizeChange' event. 178261847f8eSopenharmony_ci * <p>It's only used for SOFT_KEYBOARD panel with FLG_FIXED and FLG_FLOATING.</p> 178361847f8eSopenharmony_ci * 178461847f8eSopenharmony_ci * @param { 'sizeChange' } type - the type of unsubscribe event. 178561847f8eSopenharmony_ci * @param { Callback<window.Size> } [callback] - optional, the callback of off('sizeChange'). 178661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 178761847f8eSopenharmony_ci * @since 12 178861847f8eSopenharmony_ci */ 178961847f8eSopenharmony_ci off(type: 'sizeChange', callback?: Callback<window.Size>): void; 179061847f8eSopenharmony_ci } 179161847f8eSopenharmony_ci 179261847f8eSopenharmony_ci /** 179361847f8eSopenharmony_ci * @interface EditorAttribute 179461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 179561847f8eSopenharmony_ci * @since 8 179661847f8eSopenharmony_ci */ 179761847f8eSopenharmony_ci interface EditorAttribute { 179861847f8eSopenharmony_ci /** 179961847f8eSopenharmony_ci * Editor's pattern 180061847f8eSopenharmony_ci * 180161847f8eSopenharmony_ci * @type { number } 180261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 180361847f8eSopenharmony_ci * @since 8 180461847f8eSopenharmony_ci */ 180561847f8eSopenharmony_ci readonly inputPattern: number; 180661847f8eSopenharmony_ci 180761847f8eSopenharmony_ci /** 180861847f8eSopenharmony_ci * Editor's key type 180961847f8eSopenharmony_ci * 181061847f8eSopenharmony_ci * @type { number } 181161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 181261847f8eSopenharmony_ci * @since 8 181361847f8eSopenharmony_ci */ 181461847f8eSopenharmony_ci readonly enterKeyType: number; 181561847f8eSopenharmony_ci 181661847f8eSopenharmony_ci /** 181761847f8eSopenharmony_ci * Indicates whether the editor supports the text preview. 181861847f8eSopenharmony_ci * 181961847f8eSopenharmony_ci * @type { boolean } 182061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 182161847f8eSopenharmony_ci * @since 12 182261847f8eSopenharmony_ci */ 182361847f8eSopenharmony_ci isTextPreviewSupported: boolean; 182461847f8eSopenharmony_ci } 182561847f8eSopenharmony_ci 182661847f8eSopenharmony_ci /** 182761847f8eSopenharmony_ci * @interface KeyEvent 182861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 182961847f8eSopenharmony_ci * @since 8 183061847f8eSopenharmony_ci */ 183161847f8eSopenharmony_ci interface KeyEvent { 183261847f8eSopenharmony_ci /** 183361847f8eSopenharmony_ci * Key code 183461847f8eSopenharmony_ci * 183561847f8eSopenharmony_ci * @type { number } 183661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 183761847f8eSopenharmony_ci * @since 8 183861847f8eSopenharmony_ci */ 183961847f8eSopenharmony_ci readonly keyCode: number; 184061847f8eSopenharmony_ci 184161847f8eSopenharmony_ci /** 184261847f8eSopenharmony_ci * Key action 184361847f8eSopenharmony_ci * 184461847f8eSopenharmony_ci * @type { number } 184561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 184661847f8eSopenharmony_ci * @since 8 184761847f8eSopenharmony_ci */ 184861847f8eSopenharmony_ci readonly keyAction: number; 184961847f8eSopenharmony_ci } 185061847f8eSopenharmony_ci 185161847f8eSopenharmony_ci /** 185261847f8eSopenharmony_ci * Enumerates the flags of panel 185361847f8eSopenharmony_ci * 185461847f8eSopenharmony_ci * @enum { number } 185561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 185661847f8eSopenharmony_ci * @since 10 185761847f8eSopenharmony_ci */ 185861847f8eSopenharmony_ci export enum PanelFlag { 185961847f8eSopenharmony_ci /** 186061847f8eSopenharmony_ci * Fixed style. 186161847f8eSopenharmony_ci * <p>It's provided for the panel with type of SOFT_KEYBOARD. 186261847f8eSopenharmony_ci * When the flag is set, the soft keyboard is fixed at the bottom of the screen.</p> 186361847f8eSopenharmony_ci * 186461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 186561847f8eSopenharmony_ci * @since 10 186661847f8eSopenharmony_ci */ 186761847f8eSopenharmony_ci FLG_FIXED = 0, 186861847f8eSopenharmony_ci 186961847f8eSopenharmony_ci /** 187061847f8eSopenharmony_ci * Floating style. 187161847f8eSopenharmony_ci * <p>It's provided for the panel with type of SOFT_KEYBOARD. 187261847f8eSopenharmony_ci * When the flag is set, the soft keyboard is floating.</p> 187361847f8eSopenharmony_ci * 187461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 187561847f8eSopenharmony_ci * @since 10 187661847f8eSopenharmony_ci */ 187761847f8eSopenharmony_ci FLG_FLOATING 187861847f8eSopenharmony_ci } 187961847f8eSopenharmony_ci 188061847f8eSopenharmony_ci /** 188161847f8eSopenharmony_ci * <p>Panel types provided for input method applications.</p> 188261847f8eSopenharmony_ci * <p>Input method application developers should select the appropriate panel type according to the user scenario.</p> 188361847f8eSopenharmony_ci * 188461847f8eSopenharmony_ci * @enum { number } 188561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 188661847f8eSopenharmony_ci * @since 10 188761847f8eSopenharmony_ci */ 188861847f8eSopenharmony_ci export enum PanelType { 188961847f8eSopenharmony_ci /** 189061847f8eSopenharmony_ci * Panel for displaying a virtual software keyboard. 189161847f8eSopenharmony_ci * 189261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 189361847f8eSopenharmony_ci * @since 10 189461847f8eSopenharmony_ci */ 189561847f8eSopenharmony_ci SOFT_KEYBOARD = 0, 189661847f8eSopenharmony_ci 189761847f8eSopenharmony_ci /** 189861847f8eSopenharmony_ci * Panel for displaying status bar. 189961847f8eSopenharmony_ci * 190061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 190161847f8eSopenharmony_ci * @since 10 190261847f8eSopenharmony_ci */ 190361847f8eSopenharmony_ci STATUS_BAR 190461847f8eSopenharmony_ci } 190561847f8eSopenharmony_ci 190661847f8eSopenharmony_ci /** 190761847f8eSopenharmony_ci * Panel information. 190861847f8eSopenharmony_ci * 190961847f8eSopenharmony_ci * @typedef PanelInfo 191061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 191161847f8eSopenharmony_ci * @since 10 191261847f8eSopenharmony_ci */ 191361847f8eSopenharmony_ci export interface PanelInfo { 191461847f8eSopenharmony_ci /** 191561847f8eSopenharmony_ci * Panel type. 191661847f8eSopenharmony_ci * 191761847f8eSopenharmony_ci * @type { PanelType } 191861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 191961847f8eSopenharmony_ci * @since 10 192061847f8eSopenharmony_ci */ 192161847f8eSopenharmony_ci type: PanelType; 192261847f8eSopenharmony_ci 192361847f8eSopenharmony_ci /** 192461847f8eSopenharmony_ci * <p>Flag of Panel.</p> 192561847f8eSopenharmony_ci * <p>Currently only using for SOFT_KEYBOARD panel.</p> 192661847f8eSopenharmony_ci * 192761847f8eSopenharmony_ci * @type { ?PanelFlag } 192861847f8eSopenharmony_ci * @default FLG_FIXED 192961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 193061847f8eSopenharmony_ci * @since 10 193161847f8eSopenharmony_ci */ 193261847f8eSopenharmony_ci flag?: PanelFlag; 193361847f8eSopenharmony_ci } 193461847f8eSopenharmony_ci 193561847f8eSopenharmony_ci /** 193661847f8eSopenharmony_ci * Enumerates the moving direction of cursor 193761847f8eSopenharmony_ci * 193861847f8eSopenharmony_ci * @enum { number } 193961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 194061847f8eSopenharmony_ci * @since 10 194161847f8eSopenharmony_ci */ 194261847f8eSopenharmony_ci export enum Direction { 194361847f8eSopenharmony_ci /** 194461847f8eSopenharmony_ci * Cursor moves up 194561847f8eSopenharmony_ci * 194661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 194761847f8eSopenharmony_ci * @since 10 194861847f8eSopenharmony_ci */ 194961847f8eSopenharmony_ci CURSOR_UP = 1, 195061847f8eSopenharmony_ci 195161847f8eSopenharmony_ci /** 195261847f8eSopenharmony_ci * Cursor moves down 195361847f8eSopenharmony_ci * 195461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 195561847f8eSopenharmony_ci * @since 10 195661847f8eSopenharmony_ci */ 195761847f8eSopenharmony_ci CURSOR_DOWN, 195861847f8eSopenharmony_ci 195961847f8eSopenharmony_ci /** 196061847f8eSopenharmony_ci * Cursor moves left 196161847f8eSopenharmony_ci * 196261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 196361847f8eSopenharmony_ci * @since 10 196461847f8eSopenharmony_ci */ 196561847f8eSopenharmony_ci CURSOR_LEFT, 196661847f8eSopenharmony_ci 196761847f8eSopenharmony_ci /** 196861847f8eSopenharmony_ci * Cursor moves right 196961847f8eSopenharmony_ci * 197061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 197161847f8eSopenharmony_ci * @since 10 197261847f8eSopenharmony_ci */ 197361847f8eSopenharmony_ci CURSOR_RIGHT 197461847f8eSopenharmony_ci } 197561847f8eSopenharmony_ci 197661847f8eSopenharmony_ci /** 197761847f8eSopenharmony_ci * Enumerates the security mode. 197861847f8eSopenharmony_ci * 197961847f8eSopenharmony_ci * @enum { number } 198061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 198161847f8eSopenharmony_ci * @since 11 198261847f8eSopenharmony_ci */ 198361847f8eSopenharmony_ci export enum SecurityMode { 198461847f8eSopenharmony_ci /** 198561847f8eSopenharmony_ci * Basic security mode 198661847f8eSopenharmony_ci * 198761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 198861847f8eSopenharmony_ci * @since 11 198961847f8eSopenharmony_ci */ 199061847f8eSopenharmony_ci BASIC = 0, 199161847f8eSopenharmony_ci /** 199261847f8eSopenharmony_ci * Full security mode 199361847f8eSopenharmony_ci * 199461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 199561847f8eSopenharmony_ci * @since 11 199661847f8eSopenharmony_ci */ 199761847f8eSopenharmony_ci FULL 199861847f8eSopenharmony_ci } 199961847f8eSopenharmony_ci 200061847f8eSopenharmony_ci /** 200161847f8eSopenharmony_ci * Range of selected text. 200261847f8eSopenharmony_ci * 200361847f8eSopenharmony_ci * @interface Range 200461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 200561847f8eSopenharmony_ci * @since 10 200661847f8eSopenharmony_ci */ 200761847f8eSopenharmony_ci export interface Range { 200861847f8eSopenharmony_ci /** 200961847f8eSopenharmony_ci * Indicates the index of the first character of the selected text. 201061847f8eSopenharmony_ci * 201161847f8eSopenharmony_ci * @type { number } 201261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 201361847f8eSopenharmony_ci * @since 10 201461847f8eSopenharmony_ci */ 201561847f8eSopenharmony_ci start: number; 201661847f8eSopenharmony_ci 201761847f8eSopenharmony_ci /** 201861847f8eSopenharmony_ci * Indicates the index of the last character of the selected text. 201961847f8eSopenharmony_ci * 202061847f8eSopenharmony_ci * @type { number } 202161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 202261847f8eSopenharmony_ci * @since 10 202361847f8eSopenharmony_ci */ 202461847f8eSopenharmony_ci end: number; 202561847f8eSopenharmony_ci } 202661847f8eSopenharmony_ci 202761847f8eSopenharmony_ci /** 202861847f8eSopenharmony_ci * Movement of cursor. 202961847f8eSopenharmony_ci * 203061847f8eSopenharmony_ci * @interface Movement 203161847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 203261847f8eSopenharmony_ci * @since 10 203361847f8eSopenharmony_ci */ 203461847f8eSopenharmony_ci export interface Movement { 203561847f8eSopenharmony_ci /** 203661847f8eSopenharmony_ci * Indicates the direction of cursor movement 203761847f8eSopenharmony_ci * 203861847f8eSopenharmony_ci * @type { Direction } 203961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 204061847f8eSopenharmony_ci * @since 10 204161847f8eSopenharmony_ci */ 204261847f8eSopenharmony_ci direction: Direction; 204361847f8eSopenharmony_ci } 204461847f8eSopenharmony_ci 204561847f8eSopenharmony_ci /** 204661847f8eSopenharmony_ci * Enumerates the extend action. 204761847f8eSopenharmony_ci * 204861847f8eSopenharmony_ci * @enum { number } 204961847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 205061847f8eSopenharmony_ci * @since 10 205161847f8eSopenharmony_ci */ 205261847f8eSopenharmony_ci export enum ExtendAction { 205361847f8eSopenharmony_ci /** 205461847f8eSopenharmony_ci * Select all text. 205561847f8eSopenharmony_ci * 205661847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 205761847f8eSopenharmony_ci * @since 10 205861847f8eSopenharmony_ci */ 205961847f8eSopenharmony_ci SELECT_ALL = 0, 206061847f8eSopenharmony_ci 206161847f8eSopenharmony_ci /** 206261847f8eSopenharmony_ci * Cut selecting text. 206361847f8eSopenharmony_ci * 206461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 206561847f8eSopenharmony_ci * @since 10 206661847f8eSopenharmony_ci */ 206761847f8eSopenharmony_ci CUT = 3, 206861847f8eSopenharmony_ci 206961847f8eSopenharmony_ci /** 207061847f8eSopenharmony_ci * Copy selecting text. 207161847f8eSopenharmony_ci * 207261847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 207361847f8eSopenharmony_ci * @since 10 207461847f8eSopenharmony_ci */ 207561847f8eSopenharmony_ci COPY = 4, 207661847f8eSopenharmony_ci 207761847f8eSopenharmony_ci /** 207861847f8eSopenharmony_ci * Paste from paste board. 207961847f8eSopenharmony_ci * 208061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 208161847f8eSopenharmony_ci * @since 10 208261847f8eSopenharmony_ci */ 208361847f8eSopenharmony_ci PASTE = 5 208461847f8eSopenharmony_ci } 208561847f8eSopenharmony_ci 208661847f8eSopenharmony_ci /** 208761847f8eSopenharmony_ci * Window info. 208861847f8eSopenharmony_ci * 208961847f8eSopenharmony_ci * @interface WindowInfo 209061847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 209161847f8eSopenharmony_ci * @since 12 209261847f8eSopenharmony_ci */ 209361847f8eSopenharmony_ci export interface WindowInfo { 209461847f8eSopenharmony_ci /** 209561847f8eSopenharmony_ci * Rectangle. 209661847f8eSopenharmony_ci * 209761847f8eSopenharmony_ci * @type { window.Rect } 209861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 209961847f8eSopenharmony_ci * @since 12 210061847f8eSopenharmony_ci */ 210161847f8eSopenharmony_ci rect: window.Rect; 210261847f8eSopenharmony_ci 210361847f8eSopenharmony_ci /** 210461847f8eSopenharmony_ci * Window status. 210561847f8eSopenharmony_ci * 210661847f8eSopenharmony_ci * @type { window.WindowStatusType } 210761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 210861847f8eSopenharmony_ci * @since 12 210961847f8eSopenharmony_ci */ 211061847f8eSopenharmony_ci status: window.WindowStatusType; 211161847f8eSopenharmony_ci } 211261847f8eSopenharmony_ci 211361847f8eSopenharmony_ci /** 211461847f8eSopenharmony_ci * Panel Rect. 211561847f8eSopenharmony_ci * 211661847f8eSopenharmony_ci * @interface PanelRect 211761847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 211861847f8eSopenharmony_ci * @since 12 211961847f8eSopenharmony_ci */ 212061847f8eSopenharmony_ci export interface PanelRect { 212161847f8eSopenharmony_ci /** 212261847f8eSopenharmony_ci * Panel rect in landscape orientation. 212361847f8eSopenharmony_ci * 212461847f8eSopenharmony_ci * @type { window.Rect } 212561847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 212661847f8eSopenharmony_ci * @since 12 212761847f8eSopenharmony_ci */ 212861847f8eSopenharmony_ci landscapeRect: window.Rect; 212961847f8eSopenharmony_ci 213061847f8eSopenharmony_ci /** 213161847f8eSopenharmony_ci * Panel rect in portrait orientation. 213261847f8eSopenharmony_ci * 213361847f8eSopenharmony_ci * @type { window.Rect } 213461847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.InputMethodFramework 213561847f8eSopenharmony_ci * @since 12 213661847f8eSopenharmony_ci */ 213761847f8eSopenharmony_ci portraitRect: window.Rect; 213861847f8eSopenharmony_ci } 213961847f8eSopenharmony_ci} 214061847f8eSopenharmony_ci 214161847f8eSopenharmony_ciexport default inputMethodEngine; 2142