1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit IMEKit 19 */ 20import type { Callback, AsyncCallback } from './@ohos.base'; 21import type { ElementName } from './bundleManager/ElementName'; 22import InputMethodSubtype from './@ohos.InputMethodSubtype'; 23import type { PanelInfo } from './@ohos.inputMethod.Panel'; 24 25/** 26 * Input method 27 * 28 * @namespace inputMethod 29 * @syscap SystemCapability.MiscServices.InputMethodFramework 30 * @since 6 31 */ 32declare namespace inputMethod { 33 /** 34 * Keyboard max number 35 * 36 * @constant 37 * @syscap SystemCapability.MiscServices.InputMethodFramework 38 * @since 8 39 */ 40 const MAX_TYPE_NUM: number; 41 42 /** 43 * Input method setting 44 * 45 * @returns { InputMethodSetting } the object of InputMethodSetting 46 * @syscap SystemCapability.MiscServices.InputMethodFramework 47 * @since 8 48 * @deprecated since 9 49 * @useinstead inputMethod#getSetting 50 */ 51 function getInputMethodSetting(): InputMethodSetting; 52 53 /** 54 * Input method controller 55 * 56 * @returns { InputMethodController } the object of InputMethodController. 57 * @syscap SystemCapability.MiscServices.InputMethodFramework 58 * @since 6 59 * @deprecated since 9 60 * @useinstead inputMethod#getController 61 */ 62 function getInputMethodController(): InputMethodController; 63 64 /** 65 * Input method setting 66 * 67 * @returns { InputMethodSetting } the object of InputMethodSetting. 68 * @throws { BusinessError } 12800007 - settings extension error. 69 * @syscap SystemCapability.MiscServices.InputMethodFramework 70 * @since 9 71 */ 72 function getSetting(): InputMethodSetting; 73 74 /** 75 * Input method controller 76 * 77 * @returns { InputMethodController } the object of InputMethodController. 78 * @throws { BusinessError } 12800006 - input method controller error. 79 * @syscap SystemCapability.MiscServices.InputMethodFramework 80 * @since 9 81 */ 82 function getController(): InputMethodController; 83 84 /** 85 * Get default input method 86 * 87 * @returns { InputMethodProperty } property of the default input method. 88 * @throws { BusinessError } 12800008 - input method manager service error. 89 * @syscap SystemCapability.MiscServices.InputMethodFramework 90 * @since 11 91 */ 92 function getDefaultInputMethod(): InputMethodProperty; 93 94 /** 95 * Get system input method config ability 96 * 97 * @returns { ElementName } the information of system input method config ability. 98 * @throws { BusinessError } 12800008 - input method manager service error. 99 * @syscap SystemCapability.MiscServices.InputMethodFramework 100 * @since 11 101 */ 102 function getSystemInputMethodConfigAbility(): ElementName; 103 104 /** 105 * Switch input method 106 * 107 * @permission ohos.permission.CONNECT_IME_ABILITY 108 * @param { InputMethodProperty } target - indicates the input method which will replace the current one. 109 * @param { AsyncCallback<boolean> } callback - the callback of switchInputMethod. 110 * @throws { BusinessError } 201 - permissions check fails. 111 * @throws { BusinessError } 401 - parameter error. Possible causes: 112 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 113 * @throws { BusinessError } 12800005 - configuration persisting error. 114 * @throws { BusinessError } 12800008 - input method manager service error. 115 * @syscap SystemCapability.MiscServices.InputMethodFramework 116 * @since 9 117 */ 118 /** 119 * Switch input method. The caller must be the current inputmethod. 120 * 121 * @param { InputMethodProperty } target - indicates the target input method. 122 * @param { AsyncCallback<boolean> } callback - the callback of switchInputMethod. 123 * @throws { BusinessError } 401 - parameter error. Possible causes: 124 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 125 * @throws { BusinessError } 12800005 - configuration persisting error. 126 * @throws { BusinessError } 12800008 - input method manager service error. 127 * @syscap SystemCapability.MiscServices.InputMethodFramework 128 * @since 11 129 */ 130 function switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolean>): void; 131 132 /** 133 * Switch input method 134 * 135 * @permission ohos.permission.CONNECT_IME_ABILITY 136 * @param { InputMethodProperty } target - Indicates the input method which will replace the current one. 137 * @returns { Promise<boolean> } the promise returned by the function. 138 * @throws { BusinessError } 201 - permissions check fails. 139 * @throws { BusinessError } 401 - parameter error. Possible causes: 140 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 141 * @throws { BusinessError } 12800005 - configuration persisting error. 142 * @throws { BusinessError } 12800008 - input method manager service error. 143 * @syscap SystemCapability.MiscServices.InputMethodFramework 144 * @since 9 145 */ 146 /** 147 * Switch input method. The caller must be the current inputmethod. 148 * 149 * @param { InputMethodProperty } target - indicates the target input method. 150 * @returns { Promise<boolean> } the promise returned by the function. 151 * @throws { BusinessError } 401 - parameter error. Possible causes: 152 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 153 * @throws { BusinessError } 12800005 - configuration persisting error. 154 * @throws { BusinessError } 12800008 - input method manager service error. 155 * @syscap SystemCapability.MiscServices.InputMethodFramework 156 * @since 11 157 */ 158 function switchInputMethod(target: InputMethodProperty): Promise<boolean>; 159 160 /** 161 * Get current input method 162 * 163 * @returns { InputMethodProperty } the property of current inputmethod. 164 * @syscap SystemCapability.MiscServices.InputMethodFramework 165 * @since 9 166 */ 167 function getCurrentInputMethod(): InputMethodProperty; 168 169 /** 170 * Switch current input method subtype 171 * 172 * @permission ohos.permission.CONNECT_IME_ABILITY 173 * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one. 174 * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype. 175 * @throws { BusinessError } 201 - permissions check fails. 176 * @throws { BusinessError } 401 - parameter error. Possible causes: 177 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 178 * @throws { BusinessError } 12800005 - configuration persisting error. 179 * @throws { BusinessError } 12800008 - input method manager service error. 180 * @syscap SystemCapability.MiscServices.InputMethodFramework 181 * @since 9 182 */ 183 /** 184 * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored. 185 * 186 * @permission ohos.permission.CONNECT_IME_ABILITY 187 * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one. 188 * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype. 189 * @throws { BusinessError } 201 - permissions check fails. 190 * @throws { BusinessError } 401 - parameter error. Possible causes: 191 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 192 * @throws { BusinessError } 12800005 - configuration persisting error. 193 * @throws { BusinessError } 12800008 - input method manager service error. 194 * @syscap SystemCapability.MiscServices.InputMethodFramework 195 * @since 10 196 */ 197 /** 198 * Switch current input method subtype. The caller must be the current inputmethod. 199 * 200 * @param { InputMethodSubtype } target - indicates the target input method subtype. 201 * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodSubtype. 202 * @throws { BusinessError } 401 - parameter error. Possible causes: 203 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 204 * @throws { BusinessError } 12800005 - configuration persisting error. 205 * @throws { BusinessError } 12800008 - input method manager service error. 206 * @syscap SystemCapability.MiscServices.InputMethodFramework 207 * @since 11 208 */ 209 function switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback<boolean>): void; 210 211 /** 212 * Switch current input method subtype 213 * 214 * @permission ohos.permission.CONNECT_IME_ABILITY 215 * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one. 216 * @returns { Promise<boolean> } the promise returned by the function. 217 * @throws { BusinessError } 201 - permissions check fails. 218 * @throws { BusinessError } 401 - parameter error. Possible causes: 219 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 220 * @throws { BusinessError } 12800005 - configuration persisting error. 221 * @throws { BusinessError } 12800008 - input method manager service error. 222 * @syscap SystemCapability.MiscServices.InputMethodFramework 223 * @since 9 224 */ 225 /** 226 * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored. 227 * 228 * @permission ohos.permission.CONNECT_IME_ABILITY 229 * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one. 230 * @returns { Promise<boolean> } the promise returned by the function. 231 * @throws { BusinessError } 201 - permissions check fails. 232 * @throws { BusinessError } 401 - parameter error. Possible causes: 233 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 234 * @throws { BusinessError } 12800005 - configuration persisting error. 235 * @throws { BusinessError } 12800008 - input method manager service error. 236 * @syscap SystemCapability.MiscServices.InputMethodFramework 237 * @since 10 238 */ 239 /** 240 * Switch current input method subtype. The caller must be the current inputmethod. 241 * 242 * @param { InputMethodSubtype } target - indicates the target input method subtype. 243 * @returns { Promise<boolean> } the promise returned by the function. 244 * @throws { BusinessError } 401 - parameter error. Possible causes: 245 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 246 * @throws { BusinessError } 12800005 - configuration persisting error. 247 * @throws { BusinessError } 12800008 - input method manager service error. 248 * @syscap SystemCapability.MiscServices.InputMethodFramework 249 * @since 11 250 */ 251 function switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean>; 252 253 /** 254 * Get the current input method subtype 255 * 256 * @returns { InputMethodSubtype } the subtype of the current input method. 257 * @syscap SystemCapability.MiscServices.InputMethodFramework 258 * @since 9 259 */ 260 function getCurrentInputMethodSubtype(): InputMethodSubtype; 261 262 /** 263 * Switch input method and subtype. If the caller is an input method, it must be the current inputmethod. 264 * 265 * @permission ohos.permission.CONNECT_IME_ABILITY 266 * @param { InputMethodProperty } inputMethodProperty - Indicates the target input method. 267 * @param { InputMethodSubtype } inputMethodSubtype - Indicates the target input method subtype. 268 * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodAndSubtype. 269 * @throws { BusinessError } 201 - permissions check fails. 270 * @throws { BusinessError } 401 - parameter error. Possible causes: 271 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 272 * @throws { BusinessError } 12800005 - configuration persisting error. 273 * @throws { BusinessError } 12800008 - input method manager service error. 274 * @syscap SystemCapability.MiscServices.InputMethodFramework 275 * @since 9 276 */ 277 /** 278 * Switch input method and subtype. The caller must be the current inputmethod. 279 * 280 * @param { InputMethodProperty } inputMethodProperty - indicates the target input method. 281 * @param { InputMethodSubtype } inputMethodSubtype - indicates the target input method subtype. 282 * @param { AsyncCallback<boolean> } callback - the callback of switchCurrentInputMethodAndSubtype. 283 * @throws { BusinessError } 401 - parameter error. Possible causes: 284 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 285 * @throws { BusinessError } 12800005 - configuration persisting error. 286 * @throws { BusinessError } 12800008 - input method manager service error. 287 * @syscap SystemCapability.MiscServices.InputMethodFramework 288 * @since 11 289 */ 290 function switchCurrentInputMethodAndSubtype( 291 inputMethodProperty: InputMethodProperty, 292 inputMethodSubtype: InputMethodSubtype, 293 callback: AsyncCallback<boolean> 294 ): void; 295 296 /** 297 * Switch input method and subtype. If the caller is an input method, it must be the current inputmethod. 298 * 299 * @permission ohos.permission.CONNECT_IME_ABILITY 300 * @param { InputMethodProperty } inputMethodProperty - Indicates the target input method. 301 * @param { InputMethodSubtype } inputMethodSubtype - Indicates the target input method subtype. 302 * @returns { Promise<boolean> } the promise returned by the function. 303 * @throws { BusinessError } 201 - permissions check fails. 304 * @throws { BusinessError } 401 - parameter error. Possible causes: 305 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 306 * @throws { BusinessError } 12800005 - configuration persisting error. 307 * @throws { BusinessError } 12800008 - input method manager service error. 308 * @syscap SystemCapability.MiscServices.InputMethodFramework 309 * @since 9 310 */ 311 /** 312 * Switch input method and subtype. The caller must be the current inputmethod. 313 * 314 * @param { InputMethodProperty } inputMethodProperty - indicates the target input method. 315 * @param { InputMethodSubtype } inputMethodSubtype - indicates the target input method subtype. 316 * @returns { Promise<boolean> } the promise returned by the function. 317 * @throws { BusinessError } 401 - parameter error. Possible causes: 318 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 319 * @throws { BusinessError } 12800005 - configuration persisting error. 320 * @throws { BusinessError } 12800008 - input method manager service error. 321 * @syscap SystemCapability.MiscServices.InputMethodFramework 322 * @since 11 323 */ 324 function switchCurrentInputMethodAndSubtype( 325 inputMethodProperty: InputMethodProperty, 326 inputMethodSubtype: InputMethodSubtype 327 ): Promise<boolean>; 328 329 /** 330 * Switch input method and subtype 331 * 332 * @permission ohos.permission.CONNECT_IME_ABILITY 333 * @param { string } bundleName - indicates the bundleName of target input method. 334 * @param { string } [subtypeId] - indicates the id of the input method subtype. 335 * If the param is not set, switch to the target input method with a default subtype. 336 * @returns { Promise<void> } the promise returned by the function. 337 * @throws { BusinessError } 201 - permissions check fails. 338 * @throws { BusinessError } 202 - not system application. 339 * @throws { BusinessError } 401 - parameter error. Possible causes: 340 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 341 * @throws { BusinessError } 12800005 - configuration persisting error. 342 * @throws { BusinessError } 12800008 - input method manager service error. 343 * @syscap SystemCapability.MiscServices.InputMethodFramework 344 * @systemapi 345 * @since 11 346 */ 347 function switchInputMethod(bundleName: string, subtypeId?: string): Promise<void>; 348 349 /** 350 * @interface InputMethodSetting 351 * @syscap SystemCapability.MiscServices.InputMethodFramework 352 * @since 8 353 */ 354 interface InputMethodSetting { 355 /** 356 * Subscribe input method or subtype change. 357 * 358 * @param { 'imeChange' } type - Indicates the event type. 359 * @param { function } callback - the callback of 'imeChange' 360 * @syscap SystemCapability.MiscServices.InputMethodFramework 361 * @since 9 362 */ 363 on( 364 type: 'imeChange', 365 callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void 366 ): void; 367 368 /** 369 * Unsubscribe input method or subtype change. 370 * 371 * @param { 'imeChange' } type - Indicates the event type. 372 * @param { function } [callback] - the callback of 'imeChange', 373 * when subscriber unsubscribes all callback functions of event 'imeChange', this parameter can be left blank. 374 * @syscap SystemCapability.MiscServices.InputMethodFramework 375 * @since 9 376 */ 377 off( 378 type: 'imeChange', 379 callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void 380 ): void; 381 382 /** 383 * Subscribes to input window show events. 384 * 385 * @param { 'imeShow' } type - Indicates the event type. 386 * @param { function } callback - the callback of 'imeShow'. 387 * @throws { BusinessError } 202 - not system application. 388 * @syscap SystemCapability.MiscServices.InputMethodFramework 389 * @systemapi 390 * @since 10 391 */ 392 on(type: 'imeShow', callback: (info: Array<InputWindowInfo>) => void): void; 393 394 /** 395 * Unsubscribe input window show event. 396 * 397 * @param { 'imeShow' } type - Indicates the event type. 398 * @param { function } [callback] - the callback of 'imeShow', 399 * when subscriber unsubscribes all callback functions of event 'imeShow', this parameter can be left blank. 400 * @syscap SystemCapability.MiscServices.InputMethodFramework 401 * @systemapi 402 * @since 10 403 */ 404 off(type: 'imeShow', callback?: (info: Array<InputWindowInfo>) => void): void; 405 406 /** 407 * Subscribes to input window hidden events. 408 * 409 * @param { 'imeHide' } type - Indicates the event type. 410 * @param { function } callback - the callback of 'imeHide'. 411 * @throws { BusinessError } 202 - not system application. 412 * @syscap SystemCapability.MiscServices.InputMethodFramework 413 * @systemapi 414 * @since 10 415 */ 416 on(type: 'imeHide', callback: (info: Array<InputWindowInfo>) => void): void; 417 418 /** 419 * Unsubscribe input window hide event. 420 * 421 * @param { 'imeHide' } type - Indicates the event type. 422 * @param { function } [callback] - the callback of 'imeHide', 423 * when subscriber unsubscribes all callback functions of event 'imeHide', this parameter can be left blank. 424 * @syscap SystemCapability.MiscServices.InputMethodFramework 425 * @systemapi 426 * @since 10 427 */ 428 off(type: 'imeHide', callback?: (info: Array<InputWindowInfo>) => void): void; 429 430 /** 431 * Query whether a panel with specified information is shown. 432 * 433 * @param { PanelInfo } panelInfo - the information of panel which is queried. 434 * @returns { boolean } 435 * If true, the panel being queried is shown. 436 * If false, the panel being queried is hidden. 437 * @throws { BusinessError } 202 - not system application. 438 * @throws { BusinessError } 401 - parameter error. Possible causes: 439 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 440 * @throws { BusinessError } 12800008 - input method manager service error. 441 * @syscap SystemCapability.MiscServices.InputMethodFramework 442 * @systemapi 443 * @since 11 444 */ 445 isPanelShown(panelInfo: PanelInfo): boolean; 446 447 /** 448 * List subtype of the specified input method. 449 * 450 * @param { InputMethodProperty } inputMethodProperty - the property of the specified inputmethod. 451 * @param { AsyncCallback<Array<InputMethodSubtype>> } callback - the callback of listInputMethodSubtype. 452 * @throws { BusinessError } 401 - parameter error. Possible causes: 453 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 454 * @throws { BusinessError } 12800001 - package manager error. 455 * @throws { BusinessError } 12800008 - input method manager service error. 456 * @syscap SystemCapability.MiscServices.InputMethodFramework 457 * @since 9 458 */ 459 listInputMethodSubtype( 460 inputMethodProperty: InputMethodProperty, 461 callback: AsyncCallback<Array<InputMethodSubtype>> 462 ): void; 463 464 /** 465 * List subtype of the specified input method. 466 * 467 * @param { InputMethodProperty } inputMethodProperty - Indicates the specified input method. 468 * @returns { Promise<Array<InputMethodSubtype>> } the promise returned by the function. 469 * @throws { BusinessError } 401 - parameter error. Possible causes: 470 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 471 * @throws { BusinessError } 12800001 - package manager error. 472 * @throws { BusinessError } 12800008 - input method manager service error. 473 * @syscap SystemCapability.MiscServices.InputMethodFramework 474 * @since 9 475 */ 476 listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Array<InputMethodSubtype>>; 477 478 /** 479 * List subtype of current input method 480 * 481 * @param { AsyncCallback<Array<InputMethodSubtype>> } callback - the callback of listCurrentInputMethodSubtype. 482 * @throws { BusinessError } 12800001 - package manager error. 483 * @throws { BusinessError } 12800008 - input method manager service error. 484 * @syscap SystemCapability.MiscServices.InputMethodFramework 485 * @since 9 486 */ 487 listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSubtype>>): void; 488 489 /** 490 * List subtype of current input method 491 * 492 * @returns { Promise<Array<InputMethodSubtype>> } the promise returned by the function. 493 * @throws { BusinessError } 12800001 - package manager error. 494 * @throws { BusinessError } 12800008 - input method manager service error. 495 * @syscap SystemCapability.MiscServices.InputMethodFramework 496 * @since 9 497 */ 498 listCurrentInputMethodSubtype(): Promise<Array<InputMethodSubtype>>; 499 500 /** 501 * List input methods 502 * 503 * @param { boolean } enable - 504 * If true, collect enabled input methods. 505 * If false, collect disabled input methods. 506 * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of getInputMethods. 507 * @throws { BusinessError } 401 - parameter error. Possible causes: 508 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 509 * @throws { BusinessError } 12800001 - package manager error. 510 * @throws { BusinessError } 12800008 - input method manager service error. 511 * @syscap SystemCapability.MiscServices.InputMethodFramework 512 * @since 9 513 */ 514 getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethodProperty>>): void; 515 516 /** 517 * List input methods 518 * 519 * @param { boolean } enable - 520 * If true, collect enabled input methods. 521 * If false, collect disabled input methods. 522 * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function. 523 * @throws { BusinessError } 401 - parameter error. Possible causes: 524 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 525 * @throws { BusinessError } 12800001 - package manager error. 526 * @throws { BusinessError } 12800008 - input method manager service error. 527 * @syscap SystemCapability.MiscServices.InputMethodFramework 528 * @since 9 529 */ 530 getInputMethods(enable: boolean): Promise<Array<InputMethodProperty>>; 531 532 /** 533 * List enabled or disabled input methods sync 534 * 535 * @param { boolean } enable - 536 * If true, collect enabled input methods. 537 * If false, collect disabled input methods. 538 * @returns { Array<InputMethodProperty> } the list of inputmethod. 539 * @throws { BusinessError } 401 - parameter error. Possible causes: 540 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 541 * @throws { BusinessError } 12800001 - bundle manager error. 542 * @throws { BusinessError } 12800008 - input method manager service error. 543 * @syscap SystemCapability.MiscServices.InputMethodFramework 544 * @since 11 545 */ 546 getInputMethodsSync(enable: boolean): Array<InputMethodProperty>; 547 548 /** 549 * List all input methods 550 * 551 * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of getInputMethods. 552 * @throws { BusinessError } 12800001 - bundle manager error. 553 * @throws { BusinessError } 12800008 - input method manager service error. 554 * @syscap SystemCapability.MiscServices.InputMethodFramework 555 * @since 11 556 */ 557 getAllInputMethods(callback: AsyncCallback<Array<InputMethodProperty>>): void; 558 559 /** 560 * List all input methods 561 * 562 * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function. 563 * @throws { BusinessError } 12800001 - bundle manager error. 564 * @throws { BusinessError } 12800008 - input method manager service error. 565 * @syscap SystemCapability.MiscServices.InputMethodFramework 566 * @since 11 567 */ 568 getAllInputMethods(): Promise<Array<InputMethodProperty>>; 569 570 /** 571 * List all input methods sync 572 * 573 * @returns { Array<InputMethodProperty> } the list of all inputmethod. 574 * @throws { BusinessError } 12800001 - bundle manager error. 575 * @throws { BusinessError } 12800008 - input method manager service error. 576 * @syscap SystemCapability.MiscServices.InputMethodFramework 577 * @since 11 578 */ 579 getAllInputMethodsSync(): Array<InputMethodProperty>; 580 581 /** 582 * @param { AsyncCallback<Array<InputMethodProperty>> } callback - the callback of listInputMethod. 583 * @syscap SystemCapability.MiscServices.InputMethodFramework 584 * @since 8 585 * @deprecated since 9 586 * @useinstead inputMethod.InputMethodSetting#getInputMethods 587 */ 588 listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>): void; 589 590 /** 591 * @returns { Promise<Array<InputMethodProperty>> } the promise returned by the function. 592 * @syscap SystemCapability.MiscServices.InputMethodFramework 593 * @since 8 594 * @deprecated since 9 595 * @useinstead inputMethod.InputMethodSetting#getInputMethods 596 */ 597 listInputMethod(): Promise<Array<InputMethodProperty>>; 598 599 /** 600 * Show input method setting extension dialog 601 * 602 * @param { AsyncCallback<boolean> } callback - the callback of showOptionalInputMethods. 603 * @throws { BusinessError } 12800008 - input method manager service error. 604 * @syscap SystemCapability.MiscServices.InputMethodFramework 605 * @since 9 606 */ 607 showOptionalInputMethods(callback: AsyncCallback<boolean>): void; 608 609 /** 610 * Show input method setting extension dialog 611 * 612 * @returns { Promise<boolean> } the promise returned by the function. 613 * @throws { BusinessError } 12800008 - input method manager service error. 614 * @syscap SystemCapability.MiscServices.InputMethodFramework 615 * @since 9 616 */ 617 showOptionalInputMethods(): Promise<boolean>; 618 619 /** 620 * @param { AsyncCallback<void> } callback - the callback of displayOptionalInputMethod. 621 * @syscap SystemCapability.MiscServices.InputMethodFramework 622 * @since 8 623 * @deprecated since 9 624 * @useinstead inputMethod.InputMethodSetting#showOptionalInputMethods 625 */ 626 displayOptionalInputMethod(callback: AsyncCallback<void>): void; 627 628 /** 629 * @returns { Promise<void> } the promise returned by the function. 630 * @syscap SystemCapability.MiscServices.InputMethodFramework 631 * @since 8 632 * @deprecated since 9 633 * @useinstead inputMethod.InputMethodSetting#showOptionalInputMethods 634 */ 635 displayOptionalInputMethod(): Promise<void>; 636 } 637 638 /** 639 * @interface InputMethodController 640 * @syscap SystemCapability.MiscServices.InputMethodFramework 641 * @since 6 642 */ 643 interface InputMethodController { 644 /** 645 * Attach application to the input method service. 646 * 647 * @param { boolean } showKeyboard - show the keyboard or not when attach the input method. 648 * @param { TextConfig } textConfig - indicates the config of the textInput. 649 * @param { AsyncCallback<void> } callback - the callback of attach. 650 * @throws { BusinessError } 401 - parameter error. Possible causes: 651 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 652 * @throws { BusinessError } 12800003 - input method client error. 653 * @throws { BusinessError } 12800008 - input method manager service error. 654 * @syscap SystemCapability.MiscServices.InputMethodFramework 655 * @since 10 656 */ 657 attach(showKeyboard: boolean, textConfig: TextConfig, callback: AsyncCallback<void>): void; 658 659 /** 660 * Attach application to the input method service. 661 * 662 * @param { boolean } showKeyboard - show the keyboard or not when attach the input method. 663 * @param { TextConfig } textConfig - indicates the config of the textInput. 664 * @returns { Promise<void> } the promise returned by the function. 665 * @throws { BusinessError } 401 - parameter error. Possible causes: 666 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 667 * @throws { BusinessError } 12800003 - input method client error. 668 * @throws { BusinessError } 12800008 - input method manager service error. 669 * @syscap SystemCapability.MiscServices.InputMethodFramework 670 * @since 10 671 */ 672 attach(showKeyboard: boolean, textConfig: TextConfig): Promise<void>; 673 674 /** 675 * Show the text input and start typing. 676 * 677 * @param { AsyncCallback<void> } callback - the callback of showTextInput. 678 * @throws { BusinessError } 12800003 - input method client error. 679 * @throws { BusinessError } 12800008 - input method manager service error. 680 * @throws { BusinessError } 12800009 - input method client is detached. 681 * @syscap SystemCapability.MiscServices.InputMethodFramework 682 * @since 10 683 */ 684 showTextInput(callback: AsyncCallback<void>): void; 685 686 /** 687 * Show the text input and start typing. 688 * 689 * @returns { Promise<void> } the promise returned by the function. 690 * @throws { BusinessError } 12800003 - input method client error. 691 * @throws { BusinessError } 12800008 - input method manager service error. 692 * @throws { BusinessError } 12800009 - input method client is detached. 693 * @syscap SystemCapability.MiscServices.InputMethodFramework 694 * @since 10 695 */ 696 showTextInput(): Promise<void>; 697 698 /** 699 * Hide the text input and stop typing. 700 * 701 * @param { AsyncCallback<void> } callback - the callback of hideTextInput. 702 * @throws { BusinessError } 12800003 - input method client error. 703 * @throws { BusinessError } 12800008 - input method manager service error. 704 * @throws { BusinessError } 12800009 - input method client is detached. 705 * @syscap SystemCapability.MiscServices.InputMethodFramework 706 * @since 10 707 */ 708 hideTextInput(callback: AsyncCallback<void>): void; 709 710 /** 711 * Hide the text input and stop typing. 712 * 713 * @returns { Promise<void> } the promise returned by the function. 714 * @throws { BusinessError } 12800003 - input method client error. 715 * @throws { BusinessError } 12800008 - input method manager service error. 716 * @throws { BusinessError } 12800009 - input method client is detached. 717 * @syscap SystemCapability.MiscServices.InputMethodFramework 718 * @since 10 719 */ 720 hideTextInput(): Promise<void>; 721 722 /** 723 * Detach the applications from the input method manager service. 724 * 725 * @param { AsyncCallback<void> } callback - the callback of detach. 726 * @throws { BusinessError } 12800003 - input method client error. 727 * @throws { BusinessError } 12800008 - input method manager service error. 728 * @syscap SystemCapability.MiscServices.InputMethodFramework 729 * @since 10 730 */ 731 detach(callback: AsyncCallback<void>): void; 732 733 /** 734 * Detach the applications from the input method manager service. 735 * 736 * @returns { Promise<void> } the promise returned by the function. 737 * @throws { BusinessError } 12800003 - input method client error. 738 * @throws { BusinessError } 12800008 - input method manager service error. 739 * @syscap SystemCapability.MiscServices.InputMethodFramework 740 * @since 10 741 */ 742 detach(): Promise<void>; 743 744 /** 745 * Inform the system of the window ID of the application currently bound to the input method. 746 * After the correct setting, the window where the client is located can avoid the input method window. 747 * 748 * @param { number } windowId - the window ID of the application currently bound to the input method. 749 * @param { AsyncCallback<void> } callback - the callback of setCallingWindow. 750 * @throws { BusinessError } 401 - parameter error. Possible causes: 751 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 752 * @throws { BusinessError } 12800003 - input method client error. 753 * @throws { BusinessError } 12800008 - input method manager service error. 754 * @throws { BusinessError } 12800009 - input method client is detached. 755 * @syscap SystemCapability.MiscServices.InputMethodFramework 756 * @since 10 757 */ 758 setCallingWindow(windowId: number, callback: AsyncCallback<void>): void; 759 760 /** 761 * Inform the system of the window ID of the application currently bound to the input method. 762 * After the correct setting, the window where the client is located can avoid the input method window. 763 * 764 * @param { number } windowId - the window ID of the application currently bound to the input method. 765 * @returns { Promise<void> } the promise returned by the function. 766 * @throws { BusinessError } 401 - parameter error. Possible causes: 767 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 768 * @throws { BusinessError } 12800003 - input method client error. 769 * @throws { BusinessError } 12800008 - input method manager service error. 770 * @throws { BusinessError } 12800009 - input method client is detached. 771 * @syscap SystemCapability.MiscServices.InputMethodFramework 772 * @since 10 773 */ 774 setCallingWindow(windowId: number): Promise<void>; 775 776 /** 777 * Update Cursor and notify the input method that the current application cursor has changed. 778 * 779 * @param { CursorInfo } cursorInfo - the CursorInfo object. 780 * @param { AsyncCallback<void> } callback - the callback of updateCursor. 781 * @throws { BusinessError } 401 - parameter error. Possible causes: 782 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 783 * @throws { BusinessError } 12800003 - input method client error. 784 * @throws { BusinessError } 12800008 - input method manager service error. 785 * @throws { BusinessError } 12800009 - input method client is detached. 786 * @syscap SystemCapability.MiscServices.InputMethodFramework 787 * @since 10 788 */ 789 updateCursor(cursorInfo: CursorInfo, callback: AsyncCallback<void>): void; 790 791 /** 792 * Update Cursor and notify the input method that the current application cursor has changed. 793 * 794 * @param { CursorInfo } cursorInfo - the CursorInfo object. 795 * @returns { Promise<void> } the promise returned by the function. 796 * @throws { BusinessError } 401 - parameter error. Possible causes: 797 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 798 * @throws { BusinessError } 12800003 - input method client error. 799 * @throws { BusinessError } 12800008 - input method manager service error. 800 * @throws { BusinessError } 12800009 - input method client is detached. 801 * @syscap SystemCapability.MiscServices.InputMethodFramework 802 * @since 10 803 */ 804 updateCursor(cursorInfo: CursorInfo): Promise<void>; 805 806 /** 807 * Notify the input method the selected text and the selection range of the current application text has changed. 808 * 809 * @param { string } text - the whole input text. 810 * @param { number } start - start position of selected text. 811 * @param { number } end - end position of selected text. 812 * @param { AsyncCallback<void> } callback - the callback of changeSelection. 813 * @throws { BusinessError } 401 - parameter error. Possible causes: 814 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 815 * @throws { BusinessError } 12800003 - input method client error. 816 * @throws { BusinessError } 12800008 - input method manager service error. 817 * @throws { BusinessError } 12800009 - input method client is detached. 818 * @syscap SystemCapability.MiscServices.InputMethodFramework 819 * @since 10 820 */ 821 changeSelection(text: string, start: number, end: number, callback: AsyncCallback<void>): void; 822 823 /** 824 * Notify the input method the selected text and the selection range of the current application text has changed. 825 * 826 * @param { string } text - the selected text. 827 * @param { number } start - start position of selected text. 828 * @param { number } end - end position of selected text. 829 * @returns { Promise<void> } the promise returned by the function. 830 * @throws { BusinessError } 401 - parameter error. Possible causes: 831 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 832 * @throws { BusinessError } 12800003 - input method client error. 833 * @throws { BusinessError } 12800008 - input method manager service error. 834 * @throws { BusinessError } 12800009 - input method client is detached. 835 * @syscap SystemCapability.MiscServices.InputMethodFramework 836 * @since 10 837 */ 838 changeSelection(text: string, start: number, end: number): Promise<void>; 839 840 /** 841 * Update InputAttribute information of input text. 842 * 843 * @param { InputAttribute } attribute - the InputAttribute object. 844 * @param { AsyncCallback<void> } callback - the callback of updateAttribute. 845 * @throws { BusinessError } 401 - parameter error. Possible causes: 846 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 847 * @throws { BusinessError } 12800003 - input method client error. 848 * @throws { BusinessError } 12800008 - input method manager service error. 849 * @throws { BusinessError } 12800009 - input method client is detached. 850 * @syscap SystemCapability.MiscServices.InputMethodFramework 851 * @since 10 852 */ 853 updateAttribute(attribute: InputAttribute, callback: AsyncCallback<void>): void; 854 855 /** 856 * Update InputAttribute information of input text. 857 * 858 * @param { InputAttribute } attribute - the InputAttribute object. 859 * @returns { Promise<void> } the promise returned by the function. 860 * @throws { BusinessError } 401 - parameter error. Possible causes: 861 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. 862 * @throws { BusinessError } 12800003 - input method client error. 863 * @throws { BusinessError } 12800008 - input method manager service error. 864 * @throws { BusinessError } 12800009 - input method client is detached. 865 * @syscap SystemCapability.MiscServices.InputMethodFramework 866 * @since 10 867 */ 868 updateAttribute(attribute: InputAttribute): Promise<void>; 869 /** 870 * Stop input session 871 * 872 * @param { AsyncCallback<boolean> } callback - the callback of stopInputSession. 873 * @throws { BusinessError } 12800003 - input method client error. 874 * @throws { BusinessError } 12800008 - input method manager service error. 875 * @syscap SystemCapability.MiscServices.InputMethodFramework 876 * @since 9 877 */ 878 stopInputSession(callback: AsyncCallback<boolean>): void; 879 880 /** 881 * Stop input session 882 * 883 * @returns { Promise<boolean> } the promise returned by the function. 884 * @throws { BusinessError } 12800003 - input method client error. 885 * @throws { BusinessError } 12800008 - input method manager service error. 886 * @syscap SystemCapability.MiscServices.InputMethodFramework 887 * @since 9 888 */ 889 stopInputSession(): Promise<boolean>; 890 891 /** 892 * Stop input 893 * 894 * @param { AsyncCallback<boolean> } callback - the callback of stopInput. 895 * @syscap SystemCapability.MiscServices.InputMethodFramework 896 * @since 6 897 * @deprecated since 9 898 * @useinstead inputMethod.InputMethodController#stopInputSession 899 */ 900 stopInput(callback: AsyncCallback<boolean>): void; 901 902 /** 903 * Stop input 904 * 905 * @returns { Promise<boolean> } the promise returned by the function. 906 * @syscap SystemCapability.MiscServices.InputMethodFramework 907 * @since 6 908 * @deprecated since 9 909 * @useinstead inputMethod.InputMethodController#stopInputSession 910 */ 911 stopInput(): Promise<boolean>; 912 913 /** 914 * Show soft keyboard. 915 * This API can be called only by system applications. 916 * 917 * @permission ohos.permission.CONNECT_IME_ABILITY 918 * @param { AsyncCallback<void> } callback - the callback of showSoftKeyboard. 919 * @throws { BusinessError } 201 - permissions check fails. 920 * @throws { BusinessError } 12800003 - input method client error. 921 * @throws { BusinessError } 12800008 - input method manager service error. 922 * @syscap SystemCapability.MiscServices.InputMethodFramework 923 * @since 9 924 */ 925 showSoftKeyboard(callback: AsyncCallback<void>): void; 926 927 /** 928 * Show soft keyboard. 929 * This API can be called only by system applications. 930 * 931 * @permission ohos.permission.CONNECT_IME_ABILITY 932 * @returns { Promise<void> } the promise returned by the function. 933 * @throws { BusinessError } 201 - permissions check fails. 934 * @throws { BusinessError } 12800003 - input method client error. 935 * @throws { BusinessError } 12800008 - input method manager service error. 936 * @syscap SystemCapability.MiscServices.InputMethodFramework 937 * @since 9 938 */ 939 showSoftKeyboard(): Promise<void>; 940 941 /** 942 * Hide soft keyboard. 943 * This API can be called only by system applications. 944 * 945 * @permission ohos.permission.CONNECT_IME_ABILITY 946 * @param { AsyncCallback<void> } callback - the callback of hideSoftKeyboard. 947 * @throws { BusinessError } 201 - permissions check fails. 948 * @throws { BusinessError } 12800003 - input method client error. 949 * @throws { BusinessError } 12800008 - input method manager service error. 950 * @syscap SystemCapability.MiscServices.InputMethodFramework 951 * @since 9 952 */ 953 hideSoftKeyboard(callback: AsyncCallback<void>): void; 954 955 /** 956 * Hide soft keyboard. 957 * This API can be called only by system applications. 958 * 959 * @permission ohos.permission.CONNECT_IME_ABILITY 960 * @returns { Promise<void> } the promise returned by the function. 961 * @throws { BusinessError } 201 - permissions check fails. 962 * @throws { BusinessError } 12800003 - input method client error. 963 * @throws { BusinessError } 12800008 - input method manager service error. 964 * @syscap SystemCapability.MiscServices.InputMethodFramework 965 * @since 9 966 */ 967 hideSoftKeyboard(): Promise<void>; 968 969 /** 970 * Register a callback and when IME sends select event with range of selection, 971 * the callback will be invoked. 972 * 973 * @param { 'selectByRange' } type - event type, fixed as 'selectByRange'. 974 * @param { Callback<Range> } callback - processes selectByRange command. The range of selection is provided for 975 * this callback, and subscribers are expected to select corresponding text in callback according to 976 * the range. 977 * @throws { BusinessError } 401 - parameter error. Possible causes: 978 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 979 * @syscap SystemCapability.MiscServices.InputMethodFramework 980 * @since 10 981 */ 982 on(type: 'selectByRange', callback: Callback<Range>): void; 983 984 /** 985 * Unregister the callback of selectedByRange. 986 * 987 * @param { 'selectByRange' } type - event type, fixed as 'selectByRange'. 988 * @param { Callback<Range> } [callback] - the callback of 'selectByRange', 989 * when subscriber unsubscribes all callback functions of event 'selectByRange', this parameter can be left blank. 990 * @syscap SystemCapability.MiscServices.InputMethodFramework 991 * @since 10 992 */ 993 off(type: 'selectByRange', callback?: Callback<Range>): void; 994 995 /** 996 * Register a callback and when IME sends select event witch movement of cursor, 997 * the callback will be invoked. 998 * 999 * @param { 'selectByMovement' } type - event type, fixed as 'selectByMovement'. 1000 * @param { Callback<Movement> } callback - processes selectByMovement command. The movement of cursor is provided 1001 * for this callback, and subscribers are expected to select corresponding text in callback according to 1002 * the movement. 1003 * @throws { BusinessError } 401 - parameter error. Possible causes: 1004 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1005 * @syscap SystemCapability.MiscServices.InputMethodFramework 1006 * @since 10 1007 */ 1008 on(type: 'selectByMovement', callback: Callback<Movement>): void; 1009 1010 /** 1011 * Unregister the callback of selectedByMovement. 1012 * 1013 * @param { 'selectByMovement' } type - event type, fixed as 'selectByMovement'. 1014 * @param { Callback<Movement> } [callback] - the callback of 'selectByMovement', 1015 * when subscriber unsubscribes all callback functions of event 'selectByMovement', this parameter can be left blank. 1016 * @syscap SystemCapability.MiscServices.InputMethodFramework 1017 * @since 10 1018 */ 1019 off(type: 'selectByMovement', callback?: Callback<Movement>): void; 1020 1021 /** 1022 * Register a callback and when IME sends insert text event, the callback will be invoked. 1023 * 1024 * @param { 'insertText' } type - event type, fixed as 'insertText'. 1025 * @param { function } callback - processes insertText command. The text of insert is provided for this callback. 1026 * Subscribers are expected to process the inserted text and update changes in editor by changeSelection and updateCursor as needed. 1027 * @throws { BusinessError } 401 - parameter error. Possible causes: 1028 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1029 * @throws { BusinessError } 12800009 - input method client is detached. 1030 * @syscap SystemCapability.MiscServices.InputMethodFramework 1031 * @since 10 1032 */ 1033 on(type: 'insertText', callback: (text: string) => void): void; 1034 1035 /** 1036 * Unregister the callback of insertText. 1037 * 1038 * @param { 'insertText' } type - event type, fixed as 'insertText'. 1039 * @param { function } [callback] - the callback of 'insertText', 1040 * when subscriber unsubscribes all callback functions of event 'insertText', this parameter can be left blank. 1041 * @syscap SystemCapability.MiscServices.InputMethodFramework 1042 * @since 10 1043 */ 1044 off(type: 'insertText', callback?: (text: string) => void): void; 1045 1046 /** 1047 * Register a callback and when IME sends delete left event with length, 1048 * the callback will be invoked. 1049 * 1050 * @param { 'deleteLeft' } type - event type, fixed as 'deleteLeft'. 1051 * @param { function } callback - processes deleteLeft command. The length of 1052 * delete is provided for this callback. Subscribers are expected to delete specified length of text 1053 * to the left of the cursor and update changes in editor by changeSelection and updateCursor as needed. 1054 * @throws { BusinessError } 401 - parameter error. Possible causes: 1055 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1056 * @throws { BusinessError } 12800009 - input method client is detached. 1057 * @syscap SystemCapability.MiscServices.InputMethodFramework 1058 * @since 10 1059 */ 1060 on(type: 'deleteLeft', callback: (length: number) => void): void; 1061 1062 /** 1063 * Unregister the callback of deleteLeft. 1064 * 1065 * @param { 'deleteLeft' } type - event type, fixed as 'deleteLeft'. 1066 * @param { function } [callback] - the callback of 'deleteLeft', 1067 * when subscriber unsubscribes all callback functions of event 'deleteLeft', this parameter can be left blank. 1068 * @syscap SystemCapability.MiscServices.InputMethodFramework 1069 * @since 10 1070 */ 1071 off(type: 'deleteLeft', callback?: (length: number) => void): void; 1072 1073 /** 1074 * Register a callback and when IME sends delete right event with length, 1075 * the callback will be invoked. 1076 * 1077 * @param { 'deleteRight' } type - event type, fixed as 'deleteRight'. 1078 * @param { function } callback - processes deleteRight command. The length of 1079 * delete is provided for this callback. Subscribers are expected to delete specified length of text 1080 * to the right of the cursor and update changes in editor by changeSelection and updateCursor as needed. 1081 * @throws { BusinessError } 401 - parameter error. Possible causes: 1082 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1083 * @throws { BusinessError } 12800009 - input method client is detached. 1084 * @syscap SystemCapability.MiscServices.InputMethodFramework 1085 * @since 10 1086 */ 1087 on(type: 'deleteRight', callback: (length: number) => void): void; 1088 1089 /** 1090 * Unregister the callback of deleteRight. 1091 * 1092 * @param { 'deleteRight' } type - event type, fixed as 'deleteRight'. 1093 * @param { function } [callback] - the callback of 'deleteRight', 1094 * when subscriber unsubscribes all callback functions of event 'deleteRight', this parameter can be left blank. 1095 * @syscap SystemCapability.MiscServices.InputMethodFramework 1096 * @since 10 1097 */ 1098 off(type: 'deleteRight', callback?: (length: number) => void): void; 1099 1100 /** 1101 * Register a callback and when IME sends keyboard status, the callback will be invoked. 1102 * 1103 * @param { 'sendKeyboardStatus' } type - event type, fixed as 'sendKeyboardStatus'. 1104 * @param { function } callback - processes sendKeyboardStatus command. 1105 * The keyboardStatus is provided for this callback. 1106 * @throws { BusinessError } 401 - parameter error. Possible causes: 1107 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1108 * @throws { BusinessError } 12800009 - input method client is detached. 1109 * @syscap SystemCapability.MiscServices.InputMethodFramework 1110 * @since 10 1111 */ 1112 on(type: 'sendKeyboardStatus', callback: (keyboardStatus: KeyboardStatus) => void): void; 1113 1114 /** 1115 * Unregister the callback of sendKeyboardStatus. 1116 * 1117 * @param { 'sendKeyboardStatus' } type - event type, fixed as 'sendKeyboardStatus'. 1118 * @param { function } [callback] - the callback of 'sendKeyboardStatus', 1119 * when subscriber unsubscribes all callback functions of event 'sendKeyboardStatus', this parameter can be left blank. 1120 * @syscap SystemCapability.MiscServices.InputMethodFramework 1121 * @since 10 1122 */ 1123 off(type: 'sendKeyboardStatus', callback?: (keyboardStatus: KeyboardStatus) => void): void; 1124 1125 /** 1126 * Register a callback and when IME sends functionKey, the callback will be invoked. 1127 * 1128 * @param { 'sendFunctionKey' } type - event type, fixed as 'sendFunctionKey'. 1129 * @param { function } callback - processes sendFunctionKey command. 1130 * The functionKey is provided for this callback.Subscribers are expected to complete the 1131 * corresponding task based on the value of functionKey. 1132 * @throws { BusinessError } 401 - parameter error. Possible causes: 1133 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1134 * @throws { BusinessError } 12800009 - input method client is detached. 1135 * @syscap SystemCapability.MiscServices.InputMethodFramework 1136 * @since 10 1137 */ 1138 on(type: 'sendFunctionKey', callback: (functionKey: FunctionKey) => void): void; 1139 1140 /** 1141 * Unregister the callback of sendFunctionKey. 1142 * 1143 * @param { 'sendFunctionKey' } type - event type, fixed as 'sendFunctionKey'. 1144 * @param { function } [callback] - the callback of 'sendFunctionKey', 1145 * when subscriber unsubscribes all callback functions of event 'sendFunctionKey', this parameter can be left blank. 1146 * @syscap SystemCapability.MiscServices.InputMethodFramework 1147 * @since 10 1148 */ 1149 off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void; 1150 1151 /** 1152 * Register a callback and when IME sends move cursor, the callback will be invoked. 1153 * 1154 * @param { 'moveCursor' } type - event type, fixed as 'moveCursor'. 1155 * @param { function } callback - processes moveCursor command. The direction of 1156 * cursor is provided for this callback. Subscribers are expected to move the cursor and update changes 1157 * in editor by changeSelection and updateCursor. 1158 * @throws { BusinessError } 401 - parameter error. Possible causes: 1159 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1160 * @throws { BusinessError } 12800009 - input method client is detached. 1161 * @syscap SystemCapability.MiscServices.InputMethodFramework 1162 * @since 10 1163 */ 1164 on(type: 'moveCursor', callback: (direction: Direction) => void): void; 1165 1166 /** 1167 * Unregister the callback of moveCursor. 1168 * 1169 * @param { 'moveCursor' } type - event type, fixed as 'moveCursor'. 1170 * @param { function } [callback] - the callback of 'moveCursor', 1171 * when subscriber unsubscribes all callback functions of event 'moveCursor', this parameter can be left blank. 1172 * @syscap SystemCapability.MiscServices.InputMethodFramework 1173 * @since 10 1174 */ 1175 off(type: 'moveCursor', callback?: (direction: Direction) => void): void; 1176 1177 /** 1178 * Register a callback and when IME sends extend action code, the callback will be invoked. 1179 * 1180 * @param { 'handleExtendAction' } type - event type, fixed as 'handleExtendAction'. 1181 * @param { function } callback - processes handleExtendAction command. The action code 1182 * is provided for this callback. 1183 * @throws { BusinessError } 401 - parameter error. Possible causes: 1184 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1185 * @throws { BusinessError } 12800009 - input method client is detached. 1186 * @syscap SystemCapability.MiscServices.InputMethodFramework 1187 * @since 10 1188 */ 1189 on(type: 'handleExtendAction', callback: (action: ExtendAction) => void): void; 1190 1191 /** 1192 * Unregister the callback of handleExtendAction. 1193 * 1194 * @param { 'handleExtendAction' } type - event type, fixed as 'handleExtendAction'. 1195 * @param { function } [callback] - the callback of 'handleExtendAction', 1196 * when subscriber unsubscribes all callback functions of event 'handleExtendAction', this parameter can be left blank. 1197 * @syscap SystemCapability.MiscServices.InputMethodFramework 1198 * @since 10 1199 */ 1200 off(type: 'handleExtendAction', callback?: (action: ExtendAction) => void): void; 1201 1202 /** 1203 * Register a callback and when input method ability gets left text of cursor, the callback will be invoked. 1204 * 1205 * @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'. 1206 * @param { function } callback - processes getLeftTextOfCursor command. The callback 1207 * must be a synchronization method and will block the input method application. 1208 * @throws { BusinessError } 401 - parameter error. Possible causes: 1209 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1210 * @throws { BusinessError } 12800009 - input method client is detached. 1211 * @syscap SystemCapability.MiscServices.InputMethodFramework 1212 * @since 10 1213 */ 1214 on(type: 'getLeftTextOfCursor', callback: (length: number) => string): void; 1215 1216 /** 1217 * Unregister the callback of getLeftTextOfCursor event. 1218 * 1219 * @param { 'getLeftTextOfCursor' } type - event type, fixed as 'getLeftTextOfCursor'. 1220 * @param { function } [callback] - the callback of 'getLeftTextOfCursor', 1221 * when subscriber unsubscribes all callback functions of event 'getLeftTextOfCursor', this parameter can be left blank. 1222 * @syscap SystemCapability.MiscServices.InputMethodFramework 1223 * @since 10 1224 */ 1225 off(type: 'getLeftTextOfCursor', callback?: (length: number) => string): void; 1226 1227 /** 1228 * Register a callback and when input method ability gets right text of cursor, the callback will be invoked. 1229 * 1230 * @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'. 1231 * @param { function } callback - processes getRightTextOfCursor command. The callback 1232 * must be a synchronization method and will block the input method application. 1233 * @throws { BusinessError } 401 - parameter error. Possible causes: 1234 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1235 * @throws { BusinessError } 12800009 - input method client is detached. 1236 * @syscap SystemCapability.MiscServices.InputMethodFramework 1237 * @since 10 1238 */ 1239 on(type: 'getRightTextOfCursor', callback: (length: number) => string): void; 1240 1241 /** 1242 * Unregister the callback of getRightTextOfCursor event. 1243 * 1244 * @param { 'getRightTextOfCursor' } type - event type, fixed as 'getRightTextOfCursor'. 1245 * @param { function } [callback] - the callback of 'getRightTextOfCursor', 1246 * when subscriber unsubscribes all callback functions of event 'getRightTextOfCursor', this parameter can be left blank. 1247 * @syscap SystemCapability.MiscServices.InputMethodFramework 1248 * @since 10 1249 */ 1250 off(type: 'getRightTextOfCursor', callback?: (length: number) => string): void; 1251 1252 /** 1253 * Register a callback and when input method ability gets the text index at cursor, the callback will be invoked. 1254 * 1255 * @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'. 1256 * @param { function } callback - processes getTextIndexAtCursor command. The callback 1257 * must be a synchronization method, and should return the text index at the cursor. 1258 * @throws { BusinessError } 401 - parameter error. Possible causes: 1259 * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. 1260 * @throws { BusinessError } 12800009 - input method client is detached. 1261 * @syscap SystemCapability.MiscServices.InputMethodFramework 1262 * @since 10 1263 */ 1264 on(type: 'getTextIndexAtCursor', callback: () => number): void; 1265 1266 /** 1267 * Unregister the callback of getTextIndexAtCursor. 1268 * 1269 * @param { 'getTextIndexAtCursor' } type - event type, fixed as 'getTextIndexAtCursor'. 1270 * @param { function } [callback] - the callback of 'getTextIndexAtCursor', 1271 * when subscriber unsubscribes all callback functions of event 'getTextIndexAtCursor', this parameter can be left blank. 1272 * @syscap SystemCapability.MiscServices.InputMethodFramework 1273 * @since 10 1274 */ 1275 off(type: 'getTextIndexAtCursor', callback?: () => number): void; 1276 } 1277 1278 /** 1279 * input method property 1280 * 1281 * @interface InputMethodProperty 1282 * @syscap SystemCapability.MiscServices.InputMethodFramework 1283 * @since 8 1284 */ 1285 interface InputMethodProperty { 1286 /** 1287 * The name of input method 1288 * 1289 * @type { string } 1290 * @syscap SystemCapability.MiscServices.InputMethodFramework 1291 * @since 8 1292 * @deprecated since 9 1293 * @useinstead inputMethod.InputMethodProperty#name 1294 */ 1295 readonly packageName: string; 1296 1297 /** 1298 * The id of input method 1299 * 1300 * @type { string } 1301 * @syscap SystemCapability.MiscServices.InputMethodFramework 1302 * @since 8 1303 * @deprecated since 9 1304 * @useinstead inputMethod.InputMethodProperty#id 1305 */ 1306 readonly methodId: string; 1307 1308 /** 1309 * The name of input method 1310 * 1311 * @type { string } 1312 * @syscap SystemCapability.MiscServices.InputMethodFramework 1313 * @since 9 1314 */ 1315 readonly name: string; 1316 1317 /** 1318 * The id of input method 1319 * 1320 * @type { string } 1321 * @syscap SystemCapability.MiscServices.InputMethodFramework 1322 * @since 9 1323 */ 1324 readonly id: string; 1325 1326 /** 1327 * The label of input method 1328 * 1329 * @type { ?string } 1330 * @syscap SystemCapability.MiscServices.InputMethodFramework 1331 * @since 9 1332 */ 1333 readonly label?: string; 1334 1335 /** 1336 * The label id of input method 1337 * 1338 * @type { ?number } 1339 * @syscap SystemCapability.MiscServices.InputMethodFramework 1340 * @since 10 1341 */ 1342 readonly labelId?: number; 1343 1344 /** 1345 * The icon of input method 1346 * 1347 * @type { ?string } 1348 * @syscap SystemCapability.MiscServices.InputMethodFramework 1349 * @since 9 1350 */ 1351 readonly icon?: string; 1352 1353 /** 1354 * The icon id of input method 1355 * 1356 * @type { ?number } 1357 * @syscap SystemCapability.MiscServices.InputMethodFramework 1358 * @since 9 1359 */ 1360 readonly iconId?: number; 1361 1362 /** 1363 * The extra info of input method 1364 * 1365 * @type { object } 1366 * @syscap SystemCapability.MiscServices.InputMethodFramework 1367 * @since 9 1368 */ 1369 /** 1370 * The extra info of input method 1371 * 1372 * @type { ?object } 1373 * @syscap SystemCapability.MiscServices.InputMethodFramework 1374 * @since 10 1375 */ 1376 extra?: object; 1377 } 1378 1379 /** 1380 * Enumerates the moving direction of cursor 1381 * 1382 * @enum { number } 1383 * @syscap SystemCapability.MiscServices.InputMethodFramework 1384 * @since 10 1385 */ 1386 export enum Direction { 1387 /** 1388 * Cursor moves up 1389 * 1390 * @syscap SystemCapability.MiscServices.InputMethodFramework 1391 * @since 10 1392 */ 1393 CURSOR_UP = 1, 1394 1395 /** 1396 * Cursor moves down 1397 * 1398 * @syscap SystemCapability.MiscServices.InputMethodFramework 1399 * @since 10 1400 */ 1401 CURSOR_DOWN, 1402 1403 /** 1404 * Cursor moves left 1405 * 1406 * @syscap SystemCapability.MiscServices.InputMethodFramework 1407 * @since 10 1408 */ 1409 CURSOR_LEFT, 1410 1411 /** 1412 * Cursor moves right 1413 * 1414 * @syscap SystemCapability.MiscServices.InputMethodFramework 1415 * @since 10 1416 */ 1417 CURSOR_RIGHT 1418 } 1419 1420 /** 1421 * Range of selected text. 1422 * 1423 * @typedef Range 1424 * @syscap SystemCapability.MiscServices.InputMethodFramework 1425 * @since 10 1426 */ 1427 export interface Range { 1428 /** 1429 * Indicates the index of the first character of the selected text. 1430 * 1431 * @type { number } 1432 * @syscap SystemCapability.MiscServices.InputMethodFramework 1433 * @since 10 1434 */ 1435 start: number; 1436 1437 /** 1438 * Indicates the index of the last character of the selected text. 1439 * 1440 * @type { number } 1441 * @syscap SystemCapability.MiscServices.InputMethodFramework 1442 * @since 10 1443 */ 1444 end: number; 1445 } 1446 1447 /** 1448 * Movement of cursor. 1449 * 1450 * @typedef Movement 1451 * @syscap SystemCapability.MiscServices.InputMethodFramework 1452 * @since 10 1453 */ 1454 export interface Movement { 1455 /** 1456 * Indicates the direction of cursor movement 1457 * 1458 * @type { Direction } 1459 * @syscap SystemCapability.MiscServices.InputMethodFramework 1460 * @since 10 1461 */ 1462 direction: Direction; 1463 } 1464 1465 /** 1466 * Enumerates the text input type. 1467 * 1468 * @enum { number } 1469 * @syscap SystemCapability.MiscServices.InputMethodFramework 1470 * @since 10 1471 */ 1472 export enum TextInputType { 1473 /** 1474 * The text input type is NONE. 1475 * 1476 * @syscap SystemCapability.MiscServices.InputMethodFramework 1477 * @since 10 1478 */ 1479 NONE = -1, 1480 1481 /** 1482 * The text input type is TEXT. 1483 * 1484 * @syscap SystemCapability.MiscServices.InputMethodFramework 1485 * @since 10 1486 */ 1487 TEXT = 0, 1488 1489 /** 1490 * The text input type is MULTILINE. 1491 * 1492 * @syscap SystemCapability.MiscServices.InputMethodFramework 1493 * @since 10 1494 */ 1495 MULTILINE, 1496 1497 /** 1498 * The text input type is NUMBER. 1499 * 1500 * @syscap SystemCapability.MiscServices.InputMethodFramework 1501 * @since 10 1502 */ 1503 NUMBER, 1504 1505 /** 1506 * The text input type is PHONE. 1507 * 1508 * @syscap SystemCapability.MiscServices.InputMethodFramework 1509 * @since 10 1510 */ 1511 PHONE, 1512 1513 /** 1514 * The text input type is DATETIME. 1515 * 1516 * @syscap SystemCapability.MiscServices.InputMethodFramework 1517 * @since 10 1518 */ 1519 DATETIME, 1520 1521 /** 1522 * The text input type is EMAIL_ADDRESS. 1523 * 1524 * @syscap SystemCapability.MiscServices.InputMethodFramework 1525 * @since 10 1526 */ 1527 EMAIL_ADDRESS, 1528 1529 /** 1530 * The text input type is URL. 1531 * 1532 * @syscap SystemCapability.MiscServices.InputMethodFramework 1533 * @since 10 1534 */ 1535 URL, 1536 1537 /** 1538 * The text input type is VISIBLE_PASSWORD. 1539 * 1540 * @syscap SystemCapability.MiscServices.InputMethodFramework 1541 * @since 10 1542 */ 1543 VISIBLE_PASSWORD, 1544 1545 /** 1546 * The text input type is NUMBER_PASSWORD. 1547 * 1548 * @syscap SystemCapability.MiscServices.InputMethodFramework 1549 * @since 11 1550 */ 1551 NUMBER_PASSWORD 1552 } 1553 1554 /** 1555 * Enumerates the enter key type. 1556 * 1557 * @enum { number } 1558 * @syscap SystemCapability.MiscServices.InputMethodFramework 1559 * @since 10 1560 */ 1561 export enum EnterKeyType { 1562 /** 1563 * The enter key type is UNSPECIFIED. 1564 * 1565 * @syscap SystemCapability.MiscServices.InputMethodFramework 1566 * @since 10 1567 */ 1568 UNSPECIFIED = 0, 1569 1570 /** 1571 * The enter key type is NONE. 1572 * 1573 * @syscap SystemCapability.MiscServices.InputMethodFramework 1574 * @since 10 1575 */ 1576 NONE, 1577 1578 /** 1579 * The enter key type is GO. 1580 * 1581 * @syscap SystemCapability.MiscServices.InputMethodFramework 1582 * @since 10 1583 */ 1584 GO, 1585 1586 /** 1587 * The enter key type is SEARCH. 1588 * 1589 * @syscap SystemCapability.MiscServices.InputMethodFramework 1590 * @since 10 1591 */ 1592 SEARCH, 1593 1594 /** 1595 * The enter key type is SEND. 1596 * 1597 * @syscap SystemCapability.MiscServices.InputMethodFramework 1598 * @since 10 1599 */ 1600 SEND, 1601 1602 /** 1603 * The enter key type is NEXT. 1604 * 1605 * @syscap SystemCapability.MiscServices.InputMethodFramework 1606 * @since 10 1607 */ 1608 NEXT, 1609 1610 /** 1611 * The enter key type is DONE. 1612 * 1613 * @syscap SystemCapability.MiscServices.InputMethodFramework 1614 * @since 10 1615 */ 1616 DONE, 1617 1618 /** 1619 * The enter key type is PREVIOUS. 1620 * 1621 * @syscap SystemCapability.MiscServices.InputMethodFramework 1622 * @since 10 1623 */ 1624 PREVIOUS, 1625 1626 /** 1627 * The enter key type is NEWLINE. 1628 * 1629 * @syscap SystemCapability.MiscServices.InputMethodFramework 1630 * @since 12 1631 */ 1632 NEWLINE 1633 } 1634 1635 /** 1636 * Enumerates the keyboard status. 1637 * 1638 * @enum { number } 1639 * @syscap SystemCapability.MiscServices.InputMethodFramework 1640 * @since 10 1641 */ 1642 export enum KeyboardStatus { 1643 /** 1644 * The keyboard status is none. 1645 * 1646 * @syscap SystemCapability.MiscServices.InputMethodFramework 1647 * @since 10 1648 */ 1649 NONE = 0, 1650 1651 /** 1652 * The keyboard status is hide. 1653 * 1654 * @syscap SystemCapability.MiscServices.InputMethodFramework 1655 * @since 10 1656 */ 1657 HIDE = 1, 1658 1659 /** 1660 * The keyboard status is show. 1661 * 1662 * @syscap SystemCapability.MiscServices.InputMethodFramework 1663 * @since 10 1664 */ 1665 SHOW = 2 1666 } 1667 1668 /** 1669 * Attribute of Input. 1670 * 1671 * @typedef InputAttribute 1672 * @syscap SystemCapability.MiscServices.InputMethodFramework 1673 * @since 10 1674 */ 1675 export interface InputAttribute { 1676 /** 1677 * Indicates the text input type of the input method. 1678 * 1679 * @type { TextInputType } 1680 * @syscap SystemCapability.MiscServices.InputMethodFramework 1681 * @since 10 1682 */ 1683 textInputType: TextInputType; 1684 1685 /** 1686 * Indicates the enter key type of the input method. 1687 * 1688 * @type { EnterKeyType } 1689 * @syscap SystemCapability.MiscServices.InputMethodFramework 1690 * @since 10 1691 */ 1692 enterKeyType: EnterKeyType; 1693 } 1694 1695 /** 1696 * FunctionKey of Input. 1697 * 1698 * @typedef FunctionKey 1699 * @syscap SystemCapability.MiscServices.InputMethodFramework 1700 * @since 10 1701 */ 1702 export interface FunctionKey { 1703 /** 1704 * Indicates the enter key type of the input method. 1705 * 1706 * @type { EnterKeyType } 1707 * @syscap SystemCapability.MiscServices.InputMethodFramework 1708 * @since 10 1709 */ 1710 enterKeyType: EnterKeyType; 1711 } 1712 1713 /** 1714 * Information of Cursor. 1715 * 1716 * @typedef CursorInfo 1717 * @syscap SystemCapability.MiscServices.InputMethodFramework 1718 * @since 10 1719 */ 1720 export interface CursorInfo { 1721 /** 1722 * Indicates the left point of the cursor info and must be absolute coordinate of the physical screen. 1723 * 1724 * @type { number } 1725 * @syscap SystemCapability.MiscServices.InputMethodFramework 1726 * @since 10 1727 */ 1728 left: number; 1729 1730 /** 1731 * Indicates the top point of the cursor info and must be absolute coordinate of the physical screen. 1732 * 1733 * @type { number } 1734 * @syscap SystemCapability.MiscServices.InputMethodFramework 1735 * @since 10 1736 */ 1737 top: number; 1738 1739 /** 1740 * Indicates the width point of the cursor info. 1741 * 1742 * @type { number } 1743 * @syscap SystemCapability.MiscServices.InputMethodFramework 1744 * @since 10 1745 */ 1746 width: number; 1747 1748 /** 1749 * Indicates the height point of the cursor info. 1750 * 1751 * @type { number } 1752 * @syscap SystemCapability.MiscServices.InputMethodFramework 1753 * @since 10 1754 */ 1755 height: number; 1756 } 1757 1758 /** 1759 * Config of editor. 1760 * 1761 * @typedef TextConfig 1762 * @syscap SystemCapability.MiscServices.InputMethodFramework 1763 * @since 10 1764 */ 1765 export interface TextConfig { 1766 /** 1767 * Attribute of Input. 1768 * 1769 * @type { InputAttribute } 1770 * @syscap SystemCapability.MiscServices.InputMethodFramework 1771 * @since 10 1772 */ 1773 inputAttribute: InputAttribute; 1774 1775 /** 1776 * Cursor information. 1777 * 1778 * @type { ?CursorInfo } 1779 * @syscap SystemCapability.MiscServices.InputMethodFramework 1780 * @since 10 1781 */ 1782 cursorInfo?: CursorInfo; 1783 1784 /** 1785 * Selection information. 1786 * 1787 * @type { ?Range } 1788 * @syscap SystemCapability.MiscServices.InputMethodFramework 1789 * @since 10 1790 */ 1791 selection?: Range; 1792 1793 /** 1794 * The window ID of the application currently bound to the input method. 1795 * 1796 * @type { ?number } 1797 * @syscap SystemCapability.MiscServices.InputMethodFramework 1798 * @since 10 1799 */ 1800 windowId?: number; 1801 } 1802 1803 /** 1804 * Enumerates the extend action. 1805 * 1806 * @enum { number } 1807 * @syscap SystemCapability.MiscServices.InputMethodFramework 1808 * @since 10 1809 */ 1810 export enum ExtendAction { 1811 /** 1812 * Select all text. 1813 * 1814 * @syscap SystemCapability.MiscServices.InputMethodFramework 1815 * @since 10 1816 */ 1817 SELECT_ALL = 0, 1818 1819 /** 1820 * Cut selecting text. 1821 * 1822 * @syscap SystemCapability.MiscServices.InputMethodFramework 1823 * @since 10 1824 */ 1825 CUT = 3, 1826 1827 /** 1828 * Copy selecting text. 1829 * 1830 * @syscap SystemCapability.MiscServices.InputMethodFramework 1831 * @since 10 1832 */ 1833 COPY = 4, 1834 1835 /** 1836 * Paste from paste board. 1837 * 1838 * @syscap SystemCapability.MiscServices.InputMethodFramework 1839 * @since 10 1840 */ 1841 PASTE = 5 1842 } 1843 1844 /** 1845 * Information of input window. 1846 * 1847 * @typedef InputWindowInfo 1848 * @syscap SystemCapability.MiscServices.InputMethodFramework 1849 * @since 10 1850 */ 1851 export interface InputWindowInfo { 1852 /** 1853 * Indicates name of the input window. 1854 * 1855 * @type { string } 1856 * @syscap SystemCapability.MiscServices.InputMethodFramework 1857 * @since 10 1858 */ 1859 name: string; 1860 1861 /** 1862 * Indicates the abscissa of the upper-left vertex of input window. 1863 * 1864 * @type { number } 1865 * @syscap SystemCapability.MiscServices.InputMethodFramework 1866 * @since 10 1867 */ 1868 left: number; 1869 1870 /** 1871 * Indicates the ordinate of the upper-left vertex of input window. 1872 * 1873 * @type { number } 1874 * @syscap SystemCapability.MiscServices.InputMethodFramework 1875 * @since 10 1876 */ 1877 top: number; 1878 1879 /** 1880 * Indicates the width of the input window. 1881 * 1882 * @type { number } 1883 * @syscap SystemCapability.MiscServices.InputMethodFramework 1884 * @since 10 1885 */ 1886 width: number; 1887 1888 /** 1889 * Indicates the height of the input window. 1890 * 1891 * @type { number } 1892 * @syscap SystemCapability.MiscServices.InputMethodFramework 1893 * @since 10 1894 */ 1895 height: number; 1896 } 1897} 1898 1899export default inputMethod;