1/* 2 * Copyright (c) 2024 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 */ 15import inputmethodengine from '@ohos.inputMethodEngine'; 16import display from '@ohos.display'; 17import windowManager from '@ohos.window'; 18import commoneventmanager from '@ohos.commonEventManager'; 19import prompt from '@ohos.prompt'; 20import inputMethodEngine from '@ohos.inputMethodEngine'; 21import { util } from '@kit.ArkTS'; 22 23let inputMethodAbility = inputmethodengine.getInputMethodAbility(); 24const TAG = 'keyboardController'; 25const SOFT_KEYBOARD = 0; 26const STATUS_BAR = 1; 27const FLG_FIXED = 0; 28const FLG_FLOATING = 1; 29 30let panelInfo = { 31 type: SOFT_KEYBOARD, 32 flag: FLG_FLOATING 33}; 34 35export class KeyboardController { 36 mContext; 37 storage: LocalStorage; 38 WINDOW_TYPE_INPUT_METHOD_FLOAT = 2105; 39 windowName = 'inputApp'; 40 41 private softKeyboardPanel: inputMethodEngine.Panel = null; 42 private windowHeight: number = 0; 43 private windowWidth: number = 0; 44 private nonBarPosition: number = 0; 45 private keyboardController: inputMethodEngine.KeyboardController; 46 private InputClient: inputMethodEngine.InputClient; 47 private display_info = display.getDefaultDisplaySync(); 48 private immersive: number = 0; 49 50 constructor(context) { 51 this.storage = new LocalStorage(); 52 this.storage.setOrCreate('storageSimplePorp', 121); 53 this.mContext = context; 54 this.windowWidth = this.display_info.width; 55 this.windowHeight = this.display_info.height * 0.45; 56 } 57 58 public onCreate(): void { 59 let that = this; 60 let subscriber; 61 62 inputMethodAbility.createPanel(this.mContext, panelInfo, (err, panel) => { 63 if (err !== undefined) { 64 console.info(TAG + '====>Failed to create panel, err: ' + JSON.stringify(err)); 65 return; 66 } 67 this.softKeyboardPanel = panel; 68 this.softKeyboardPanel.setUiContent('testability/pages/Second', async (err, data) => { 69 console.info(TAG + '====>Succeed in creating panel.' + JSON.stringify(panel)); 70 }); 71 try{ 72 let commonEventSubscribeInfo = { 73 events: ['InputMethodWindManageTest'] 74 }; 75 76 commoneventmanager.createSubscriber(commonEventSubscribeInfo).then(function (data) { 77 subscriber = data; 78 commoneventmanager.subscribe(subscriber, subscriberCallback) 79 console.info(TAG + '====>scene subscribe finish===='); 80 }) 81 }catch(err){ 82 console.info(TAG + '====>createSubscriber err:' + JSON.stringify(err.message)); 83 } 84 }); 85 86 inputMethodAbility.on('inputStop', async() => { 87 console.info(TAG + '====>on_inputStop callback') 88 inputMethodAbility.off('inputStart'); 89 inputMethodAbility.off('inputStop',()=>{}); 90 inputMethodAbility.destroyPanel(this.softKeyboardPanel); 91 await that.mContext.destroy(); 92 await commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); 93 }); 94 95 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 96 this.keyboardController = keyboardController; 97 this.InputClient = InputClient 98 console.info(TAG + '====>inputMethodAbility inputStart into'); 99 }) 100 101 let subscriberCallback = (err, data) => { 102 console.debug(TAG + '====>receive event err: ' + JSON.stringify(err)); 103 console.debug(TAG + '====>receive event data ' + JSON.stringify(data)); 104 switch (data.code) { 105 case 10: 106 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 event:' + data.event); 107 that.Sub_Misc_inputMethod_Panel_createPanelCallback_0010(); 108 break; 109 case 20: 110 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 event:' + data.event); 111 that.Sub_Misc_inputMethod_Panel_createPanelPromise_0020(); 112 break; 113 case 30: 114 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 event:' + data.event); 115 that.Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030(); 116 break; 117 case 40: 118 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 event:' + data.event); 119 that.Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040(); 120 break; 121 case 50: 122 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 event:' + data.event); 123 that.Sub_Misc_inputMethod_Panel_setUiContentCallback_0050(); 124 break; 125 case 60: 126 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 event:' + data.event); 127 that.Sub_Misc_inputMethod_Panel_setUiContentPromise_0060(); 128 break; 129 case 70: 130 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 event:' + data.event); 131 that.Sub_Misc_inputMethod_Panel_setUiContentCallback_0070(); 132 break; 133 case 80: 134 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 event:' + data.event); 135 that.Sub_Misc_inputMethod_Panel_setUiContentPromise_0080(); 136 break; 137 case 90: 138 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 event:' + data.event); 139 that.Sub_Misc_inputMethod_Panel_resizeCallback_0090(); 140 break; 141 case 100: 142 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_resizePromise_0100 event:' + data.event); 143 that.Sub_Misc_inputMethod_Panel_resizePromise_0100(); 144 break; 145 case 110: 146 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 event:' + data.event); 147 that.Sub_Misc_inputMethod_Panel_moveToCallback_0110(); 148 break; 149 case 120: 150 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 event:' + data.event); 151 that.Sub_Misc_inputMethod_Panel_moveToPromise_0120(); 152 break; 153 case 130: 154 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_showCallback_0130 event:' + data.event); 155 that.Sub_Misc_inputMethod_Panel_showCallback_0130(); 156 break; 157 case 140: 158 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_showPromise_0140 event:' + data.event); 159 that.Sub_Misc_inputMethod_Panel_showPromise_0140(); 160 break; 161 case 150: 162 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_hideCallback_0150 event:' + data.event); 163 that.Sub_Misc_inputMethod_Panel_hideCallback_0150(); 164 break; 165 case 160: 166 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_hidePromise_0160 event:' + data.event); 167 that.Sub_Misc_inputMethod_Panel_hidePromise_0160(); 168 break; 169 case 170: 170 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onShow_0170 event:' + data.event); 171 that.Sub_Misc_inputMethod_Panel_onShow_0170(); 172 break; 173 case 180: 174 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onHide_0180 event:' + data.event); 175 that.Sub_Misc_inputMethod_Panel_onHide_0180(); 176 break; 177 case 190: 178 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_offShow_0190 event:' + data.event); 179 that.Sub_Misc_inputMethod_Panel_offShow_0190(); 180 break; 181 case 200: 182 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_offHide_0200 event:' + data.event); 183 that.Sub_Misc_inputMethod_Panel_offHide_0200(); 184 break; 185 case 210: 186 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0210 event:' + data.event); 187 that.Sub_Misc_inputMethod_Panel_changeFlag_0210(); 188 break; 189 case 211: 190 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 event:' + data.event); 191 that.Sub_Misc_inputMethod_Panel_changeFlag_0211(); 192 break; 193 case 212: 194 console.debug(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 event:' + data.event); 195 that.Sub_InputMethod_IMF_SecurityKeyboard_0600(); 196 break; 197 case 213: 198 console.debug(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 event:' + data.event); 199 that.Sub_InputMethod_IMF_SecurityKeyboard_0700(); 200 break; 201 case 214: 202 console.debug(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 event:' + data.event); 203 that.Sub_InputMethod_IMF_SecurityKeyboard_0800(); 204 break; 205 case 215: 206 console.debug(TAG + '====>Sub_InputMethod_IMF_getSecurityMode_0100 event:' + data.event); 207 that.Sub_InputMethod_IMF_getSecurityMode_0100(); 208 break; 209 case 216: 210 console.debug(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 event:' + data.event); 211 that.SUB_InputMethod_IME_SplitScreen_0100(); 212 break; 213 case 217: 214 console.debug(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0100 event:' + data.event); 215 that.Sub_InputMethod_IME_ScreenRotation_0100(); 216 break; 217 case 218: 218 console.debug(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0200 event:' + data.event); 219 that.Sub_InputMethod_IME_ScreenRotation_0200(); 220 break; 221 case 230: 222 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0900 event:' + data.event); 223 that.Sub_InputMethod_IME_Custom_0900(); 224 break; 225 case 231: 226 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0200 event:' + data.event); 227 that.Sub_InputMethod_IME_Custom_0200(); 228 break; 229 case 232: 230 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0800 event:' + data.event); 231 that.Sub_InputMethod_IME_Custom_0800(); 232 break; 233 case 233: 234 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0400 event:' + data.event); 235 that.Sub_InputMethod_IME_Custom_0400(); 236 break; 237 case 234: 238 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0300 event:' + data.event); 239 that.Sub_InputMethod_IME_Custom_0300(); 240 break; 241 case 235: 242 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_1100 event:' + data.event); 243 that.Sub_InputMethod_IME_Custom_1100(); 244 break; 245 case 240: 246 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 event:' + data.event); 247 that.Sub_Misc_inputMethod_Panel_onSizeChange_0100(); 248 break; 249 case 241: 250 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 event:' + data.event); 251 that.Sub_Misc_inputMethod_Panel_onSizeChange_0200(); 252 break; 253 case 250: 254 console.debug(TAG + '====>Sub_InputMethod_IME_Dragging_1100 event:' + data.event); 255 that.Sub_InputMethod_IME_Dragging_1100(); 256 break; 257 case 251: 258 console.debug(TAG + '====>Sub_InputMethod_IME_Dragging_0800 event:' + data.event); 259 that.Sub_InputMethod_IME_Dragging_0800(); 260 break; 261 case 253: 262 console.debug(TAG + '====>Sub_InputMethod_IME_Dragging_0900 event:' + data.event); 263 that.Sub_InputMethod_IME_Dragging_0900(); 264 break; 265 case 260: 266 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0100 event:' + data.event); 267 that.Sub_InputMethod_IME_Attach_0100(); 268 break; 269 case 261: 270 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0200 event:' + data.event); 271 that.Sub_InputMethod_IME_Attach_0200(); 272 break; 273 case 262: 274 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0300 event:' + data.event); 275 that.Sub_InputMethod_IME_Attach_0300(); 276 break; 277 case 263: 278 console.debug(TAG + '====>Sub_InputMethod_IME_Attach_0400 event:' + data.event); 279 that.Sub_InputMethod_IME_Attach_0400(); 280 break; 281 case 270: 282 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0100 event:' + data.event); 283 that.Sub_InputMethod_IME_ShowTextInput_0100(); 284 break; 285 case 271: 286 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0200 event:' + data.event); 287 that.Sub_InputMethod_IME_ShowTextInput_0200(); 288 break; 289 case 272: 290 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0300 event:' + data.event); 291 that.Sub_InputMethod_IME_ShowTextInput_0300(); 292 break; 293 case 273: 294 console.debug(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0400 event:' + data.event); 295 that.Sub_InputMethod_IME_ShowTextInput_0400(); 296 break; 297 case 280: 298 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 event:' + data.event); 299 that.Sub_InputMethod_IME_FullScreenAbnormal_0100(); 300 break; 301 case 281: 302 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 event:' + data.event); 303 that.Sub_InputMethod_IME_FullScreenAbnormal_0200(); 304 break; 305 case 282: 306 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 event:' + data.event); 307 that.Sub_InputMethod_IME_FullScreenAbnormal_0500(); 308 break; 309 case 283: 310 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 event:' + data.event); 311 that.Sub_InputMethod_IME_FullScreenAbnormal_0400(); 312 break; 313 case 284: 314 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 event:' + data.event); 315 that.Sub_InputMethod_IME_FullScreenAbnormal_0300(); 316 break; 317 case 285: 318 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 event:' + data.event); 319 that.Sub_InputMethod_IME_FullScreenAbnormal_1200(); 320 break; 321 case 286: 322 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 event:' + data.event); 323 that.Sub_InputMethod_IME_FullScreenAbnormal_0700(); 324 break; 325 case 287: 326 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 event:' + data.event); 327 that.Sub_InputMethod_IME_FullScreenAbnormal_0600(); 328 break; 329 case 288: 330 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 event:' + data.event); 331 that.Sub_InputMethod_IME_FullScreenAbnormal_0800(); 332 break; 333 case 289: 334 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 event:' + data.event); 335 that.Sub_InputMethod_IME_FullScreenAbnormal_0900(); 336 break; 337 case 290: 338 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 event:' + data.event); 339 that.Sub_InputMethod_IME_FullScreenAbnormal_1000(); 340 break; 341 case 291: 342 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 event:' + data.event); 343 that.Sub_InputMethod_IME_FullScreenUR_0200(); 344 break; 345 case 292: 346 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 event:' + data.event); 347 that.Sub_InputMethod_IME_FullScreenUR_0300(); 348 break; 349 case 293: 350 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 event:' + data.event); 351 that.Sub_InputMethod_IME_FullScreenUR_0400(); 352 break; 353 case 294: 354 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0700 event:' + data.event); 355 that.Sub_InputMethod_IME_FullScreenUR_0700(); 356 break; 357 case 295: 358 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 event:' + data.event); 359 that.Sub_InputMethod_IME_FullScreenAbnormal_1100(); 360 break; 361 case 296: 362 console.debug(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 event:' + data.event); 363 that.Sub_InputMethod_IME_FullScreenUR_0100(); 364 break; 365 case 297: 366 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_0900 event:' + data.event); 367 that.Sub_InputMethod_IME_Immersive_0900(); 368 break; 369 case 298: 370 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_1000 event:' + data.event); 371 that.Sub_InputMethod_IME_Immersive_1000(); 372 break; 373 case 299: 374 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_1100 event:' + data.event); 375 that.Sub_InputMethod_IME_Immersive_1100(); 376 break; 377 case 300: 378 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_1200 event:' + data.event); 379 that.Sub_InputMethod_IME_Immersive_1200(); 380 break; 381 case 301: 382 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_0500 event:' + data.event); 383 that.Sub_InputMethod_IME_Immersive_0500(); 384 break; 385 case 310: 386 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelCallback_0011 event:' + data.event); 387 that.Sub_Misc_inputMethod_Panel_createPanelCallback_0011(); 388 break; 389 case 320: 390 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelPromise_0021 event:' + data.event); 391 that.Sub_Misc_inputMethod_Panel_createPanelPromise_0021(); 392 break; 393 case 330: 394 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031 event:' + data.event); 395 that.Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031(); 396 break; 397 case 340: 398 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041 event:' + data.event); 399 that.Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041(); 400 break; 401 case 350: 402 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0051 event:' + data.event); 403 that.Sub_Misc_inputMethod_Panel_setUiContentCallback_0051(); 404 break; 405 case 360: 406 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0061 event:' + data.event); 407 that.Sub_Misc_inputMethod_Panel_setUiContentPromise_0061(); 408 break; 409 case 370: 410 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0071 event:' + data.event); 411 that.Sub_Misc_inputMethod_Panel_setUiContentCallback_0071(); 412 break; 413 case 380: 414 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0081 event:' + data.event); 415 that.Sub_Misc_inputMethod_Panel_setUiContentPromise_0081(); 416 break; 417 case 390: 418 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_resizeCallback_0091 event:' + data.event); 419 that.Sub_Misc_inputMethod_Panel_resizeCallback_0091(); 420 break; 421 case 400: 422 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_resizePromise_0101 event:' + data.event); 423 that.Sub_Misc_inputMethod_Panel_resizePromise_0101(); 424 break; 425 case 410: 426 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_moveToCallback_0111 event:' + data.event); 427 that.Sub_Misc_inputMethod_Panel_moveToCallback_0111(); 428 break; 429 case 420: 430 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_moveToPromise_0121 event:' + data.event); 431 that.Sub_Misc_inputMethod_Panel_moveToPromise_0121(); 432 break; 433 case 430: 434 console.debug(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0212 event:' + data.event); 435 that.Sub_Misc_inputMethod_Panel_changeFlag_0212(); 436 break; 437 case 440: 438 console.debug(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0101 event:' + data.event); 439 that.Sub_InputMethod_IME_ScreenRotation_0101(); 440 break; 441 case 450: 442 console.debug(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0101 event:' + data.event); 443 that.SUB_InputMethod_IsTextPreviewSupport_0101(); 444 break; 445 case 460: 446 console.debug(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0201 event:' + data.event); 447 that.SUB_InputMethod_IsTextPreviewSupport_0201(); 448 break; 449 case 470: 450 console.debug(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0301 event:' + data.event); 451 that.SUB_InputMethod_IsTextPreviewSupport_0301(); 452 break; 453 case 480: 454 console.debug(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0401 event:' + data.event); 455 that.SUB_InputMethod_IsTextPreviewSupport_0401(); 456 break; 457 case 490: 458 console.debug(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 event:' + data.event); 459 that.SUB_InputMethod_IME_SplitScreen_0101(); 460 break; 461 case 500: 462 console.debug(TAG + '====>start_on_sendMessage event:' + data.event); 463 that.start_on_sendMessage(500); 464 break; 465 case 501: 466 console.debug(TAG + '====>start_on_sendMessage event:' + data.event); 467 that.start_on_sendMessage(501); 468 break; 469 case 502: 470 console.debug(TAG + '====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100 event:' + data.event); 471 that.Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100(); 472 break; 473 case 503: 474 console.debug(TAG + '====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200 event:' + data.event); 475 that.Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200(); 476 break; 477 case 504: 478 console.debug(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0100 event:' + data.event); 479 that.Sub_InputMethod_IME_setImmersiveEffect_0100(); 480 break; 481 case 505: 482 console.debug(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0200 event:' + data.event); 483 that.Sub_InputMethod_IME_setImmersiveEffect_0200(); 484 break; 485 case 506: 486 console.debug(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0300 event:' + data.event); 487 that.Sub_InputMethod_IME_setImmersiveEffect_0300(); 488 break; 489 case 507: 490 console.debug(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0400 event:' + data.event); 491 that.Sub_InputMethod_IME_setImmersiveEffect_0400(); 492 break; 493 case 508: 494 console.debug(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0500 event:' + data.event); 495 that.Sub_InputMethod_IME_setImmersiveEffect_0500(); 496 break; 497 case 509: 498 console.debug(TAG + '====>Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100 event:' + data.event); 499 that.Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100(); 500 break; 501 case 510: 502 console.debug(TAG + '====>Sub_InputMethod_IME_setKeepScreenOn_0100 event:' + data.event); 503 that.Sub_InputMethod_IME_setKeepScreenOn_0100(); 504 break; 505 case 511: 506 console.debug(TAG + '====>Sub_InputMethod_IME_setKeepScreenOn_0200 event:' + data.event); 507 that.Sub_InputMethod_IME_setKeepScreenOn_0200(); 508 break; 509 case 520: 510 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0901 event:' + data.event); 511 that.Sub_InputMethod_IME_Custom_0901(); 512 break; 513 case 530: 514 console.debug(TAG + '====>Sub_InputMethod_IME_Custom_0902 event:' + data.event); 515 that.Sub_InputMethod_IME_Custom_0902(); 516 break; 517 case 540: 518 console.debug(TAG + '====>Sub_InputMethod_IME_Immersive_0600 event:' + data.event); 519 that.Sub_InputMethod_IME_Immersive_0600(); 520 break; 521 } 522 } 523 524 let unSubscriberCallback = (err) => { 525 console.info(TAG + '====>unSubscriberCallback start'); 526 if (err) { 527 console.error(TAG + '====>unSubscriberCallback failed: ' + JSON.stringify(err)); 528 } else { 529 console.info(TAG + '====>unSubscriberCallback finsh'); 530 } 531 } 532 } 533 534 public newArrayBuffer(str:string): ArrayBuffer { 535 let arrayBuffer = new ArrayBuffer(str.length); 536 const view = new Uint8Array(arrayBuffer); 537 for(let i = 0; i < str.length; i++){ 538 view[i] = str.charCodeAt(i); 539 } 540 return arrayBuffer; 541 } 542 543 public GetArrayBufferString(buffer: ArrayBuffer): string { 544 const decoder = util.TextDecoder.create('utf-8'); 545 const str = decoder.decodeWithStream(new Uint8Array(buffer)); 546 return str; 547 } 548 549 private start_on_sendMessage = (index: number): void =>{ 550 let that = this; 551 console.info(`${TAG} ====>start_on_sendMessage index: ${index}`); 552 let commonEventPublishData = { 553 data: 'FAILED' 554 }; 555 try { 556 let msgHandler: inputMethodEngine.MessageHandler = { 557 onTerminated(): void { 558 console.info(`${TAG} ====>start_on_sendMessage onTerminated`); 559 }, 560 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 561 console.info(`${TAG} ====> onMessage msgId: ${msgId}`); 562 that.SUB_inputMethod_IMF_setPreview(msgId); 563 } 564 }; 565 if (index === 500) { 566 this.InputClient.recvMessage(msgHandler); 567 } else { 568 this.InputClient.recvMessage(); 569 }; 570 commonEventPublishData = { 571 data: 'SUCCESS' 572 }; 573 commoneventmanager.publish('start_on_sendMessage', commonEventPublishData, this.publishCallback); 574 } catch (err) { 575 console.info(TAG + '====>receive start_on_sendMessage err:' + JSON.stringify(err)); 576 commoneventmanager.publish('start_on_sendMessage', commonEventPublishData, this.publishCallback); 577 } 578 }; 579 580 private initWindow(): void { 581 display.getDefaultDisplay().then(dis => { 582 let dWidth = dis.width; 583 let dHeight = dis.height; 584 let keyHeightRate = 0.47; 585 let keyHeight = dHeight * keyHeightRate; 586 this.windowWidth = dWidth; 587 this.windowHeight = keyHeight; 588 this.nonBarPosition = dHeight - keyHeight 589 590 let config = { 591 name: this.windowName, 592 windowType: windowManager.WindowType.TYPE_INPUT_METHOD, 593 ctx: this.mContext 594 }; 595 windowManager.createWindow(config).then((win) => { 596 win.resize(dWidth, keyHeight).then(() => { 597 win.moveWindowTo(0, this.nonBarPosition).then(() => { 598 win.setUIContent('testability/pages/Second').then(() => { 599 }); 600 }); 601 }); 602 }); 603 }); 604 } 605 606 private publishCallback(err): void { 607 if (err) { 608 console.error(TAG + '====>publish failed: ' + JSON.stringify(err)); 609 } else { 610 console.log(TAG + '====>publish'); 611 } 612 } 613 614 private Sub_Misc_inputMethod_Panel_createPanelCallback_0010(): void { 615 let commonEventPublishData; 616 let panelInfo1 = { 617 type: STATUS_BAR, 618 flag: FLG_FLOATING 619 }; 620 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 success'); 621 try { 622 inputMethodAbility.createPanel(this.mContext, panelInfo1, async (err, panel) => { 623 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 createPanel'); 624 if (err) { 625 commonEventPublishData = { 626 data: 'FAILED' 627 }; 628 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 createPanel error: ' + JSON.stringify(err)); 629 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0010', commonEventPublishData, this.publishCallback); 630 } else { 631 commonEventPublishData = { 632 data: 'SUCCESS' 633 }; 634 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 Succeed in creating panel.' + JSON.stringify(panel)); 635 }; 636 await inputMethodAbility.destroyPanel(panel); 637 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0010', commonEventPublishData, this.publishCallback); 638 }); 639 } catch (error) { 640 commonEventPublishData = { 641 data: 'FAILED' 642 }; 643 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 catch error: ' + JSON.stringify(error)); 644 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0010', commonEventPublishData, this.publishCallback); 645 } 646 } 647 648 private Sub_Misc_inputMethod_Panel_createPanelPromise_0020(): void { 649 let commonEventPublishData; 650 let panelInfo1 = { 651 type: STATUS_BAR, 652 flag: FLG_FLOATING 653 }; 654 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 success'); 655 try { 656 inputMethodAbility.createPanel(this.mContext, panelInfo1).then(async (panel) => { 657 commonEventPublishData = { 658 data: 'SUCCESS' 659 }; 660 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 Succeed in creating panel.' + JSON.stringify(panel)); 661 await inputMethodAbility.destroyPanel(panel); 662 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0020', commonEventPublishData, this.publishCallback); 663 }).catch(async (err) => { 664 commonEventPublishData = { 665 data: 'FAILED' 666 }; 667 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 createPanel error: ' + JSON.stringify(err)); 668 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0020', commonEventPublishData, this.publishCallback); 669 }); 670 } catch (error) { 671 commonEventPublishData = { 672 data: 'FAILED' 673 }; 674 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 catch error: ' + JSON.stringify(error)); 675 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0020', commonEventPublishData, this.publishCallback); 676 } 677 } 678 679 private async Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030(): Promise<void> { 680 let commonEventPublishData; 681 let panelInfo1 = { 682 type: STATUS_BAR, 683 flag: FLG_FIXED 684 }; 685 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 success'); 686 try { 687 let panel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 688 inputMethodAbility.destroyPanel(panel, async (err, panel) => { 689 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 destroyPanel'); 690 if (err) { 691 commonEventPublishData = { 692 data: 'FAILED' 693 }; 694 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 destroyPanel error: ' + JSON.stringify(err)); 695 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030', commonEventPublishData, this.publishCallback); 696 } else { 697 commonEventPublishData = { 698 data: 'SUCCESS' 699 }; 700 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 Succeed in destroying panel.' + JSON.stringify(panel)); 701 }; 702 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030', commonEventPublishData, this.publishCallback); 703 }); 704 } catch (error) { 705 commonEventPublishData = { 706 data: 'FAILED' 707 }; 708 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 catch error: ' + JSON.stringify(error)); 709 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030', commonEventPublishData, this.publishCallback); 710 } 711 } 712 713 private async Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040(): Promise<void> { 714 let commonEventPublishData; 715 let panelInfo1 = { 716 type: STATUS_BAR, 717 flag: FLG_FIXED 718 }; 719 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 success'); 720 try { 721 let panel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 722 inputMethodAbility.destroyPanel(panel).then(async () => { 723 commonEventPublishData = { 724 data: 'SUCCESS' 725 }; 726 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 Succeed in destroyPanel panel.' + JSON.stringify(panel)); 727 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040', commonEventPublishData, this.publishCallback); 728 }).catch(async (err) => { 729 commonEventPublishData = { 730 data: 'FAILED' 731 }; 732 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 destroyPanel error: ' + JSON.stringify(err)); 733 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040', commonEventPublishData, this.publishCallback); 734 }); 735 } catch (error) { 736 commonEventPublishData = { 737 data: 'FAILED' 738 }; 739 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 catch error: ' + JSON.stringify(error)); 740 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040', commonEventPublishData, this.publishCallback); 741 } 742 } 743 744 private Sub_Misc_inputMethod_Panel_setUiContentCallback_0050(): void { 745 let commonEventPublishData; 746 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 success'); 747 try { 748 if (this.softKeyboardPanel !== null) { 749 this.softKeyboardPanel.setUiContent('testability/pages/Second', async (err, data) => { 750 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 setUiContent'); 751 if (err) { 752 commonEventPublishData = { 753 data: 'FAILED' 754 }; 755 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 setUiContent error: ' + JSON.stringify(err)); 756 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 757 } else { 758 commonEventPublishData = { 759 data: 'SUCCESS' 760 }; 761 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 Succeed setUiContent: ' + JSON.stringify(data)); 762 }; 763 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 764 }); 765 } else { 766 commonEventPublishData = { 767 data: 'FAILED' 768 }; 769 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 this.softKeyboardPanel is null'); 770 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 771 }; 772 } catch (error) { 773 commonEventPublishData = { 774 data: 'FAILED' 775 }; 776 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 catch error: ' + JSON.stringify(error)); 777 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0050', commonEventPublishData, this.publishCallback); 778 } 779 } 780 781 private Sub_Misc_inputMethod_Panel_setUiContentPromise_0060(): void { 782 let commonEventPublishData; 783 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 success'); 784 try { 785 if (this.softKeyboardPanel !== null) { 786 this.softKeyboardPanel.setUiContent('testability/pages/Second').then(async (data) => { 787 commonEventPublishData = { 788 data: 'SUCCESS' 789 }; 790 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 Succeed in setUiContent.' + JSON.stringify(data)); 791 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 792 }).catch(async (err) => { 793 commonEventPublishData = { 794 data: 'FAILED' 795 }; 796 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 setUiContent error: ' + JSON.stringify(err)); 797 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 798 }); 799 } else { 800 commonEventPublishData = { 801 data: 'FAILED' 802 }; 803 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 this.softKeyboardPanel is null'); 804 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 805 }; 806 } catch (error) { 807 commonEventPublishData = { 808 data: 'FAILED' 809 }; 810 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 catch error: ' + JSON.stringify(error)); 811 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0060', commonEventPublishData, this.publishCallback); 812 } 813 } 814 815 private Sub_Misc_inputMethod_Panel_setUiContentCallback_0070(): void { 816 let commonEventPublishData; 817 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 success'); 818 try { 819 if (this.softKeyboardPanel !== null) { 820 this.softKeyboardPanel.setUiContent('testability/pages/Second', this.storage, async (err, data) => { 821 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 setUiContent'); 822 if (err) { 823 commonEventPublishData = { 824 data: 'FAILED' 825 }; 826 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 setUiContent error: ' + JSON.stringify(err)); 827 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 828 } else { 829 commonEventPublishData = { 830 data: 'SUCCESS' 831 }; 832 console.info(TAG + 'Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 Succeed setUiContent: ' + JSON.stringify(data)); 833 } 834 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 835 }) 836 } else { 837 commonEventPublishData = { 838 data: 'FAILED' 839 }; 840 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 this.softKeyboardPanel is null'); 841 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 842 }; 843 } catch (error) { 844 commonEventPublishData = { 845 data: 'FAILED' 846 }; 847 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0070 catch error: ' + JSON.stringify(error)); 848 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0070', commonEventPublishData, this.publishCallback); 849 } 850 } 851 852 private Sub_Misc_inputMethod_Panel_setUiContentPromise_0080(): void { 853 let commonEventPublishData; 854 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 success'); 855 try { 856 if (this.softKeyboardPanel !== null) { 857 this.softKeyboardPanel.setUiContent('testability/pages/Second', this.storage).then(async (data) => { 858 commonEventPublishData = { 859 data: 'SUCCESS' 860 }; 861 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 Succeed in setUiContent: ' + JSON.stringify(data)); 862 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 863 }).catch(async (err) => { 864 commonEventPublishData = { 865 data: 'FAILED' 866 }; 867 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 setUiContent error: ' + JSON.stringify(err)); 868 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 869 }); 870 } else { 871 commonEventPublishData = { 872 data: 'FAILED' 873 }; 874 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 this.softKeyboardPanel is null'); 875 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 876 }; 877 } catch (error) { 878 commonEventPublishData = { 879 data: 'FAILED' 880 }; 881 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 catch error: ' + JSON.stringify(error)); 882 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0080', commonEventPublishData, this.publishCallback); 883 } 884 } 885 886 private Sub_Misc_inputMethod_Panel_resizeCallback_0090(): void { 887 let commonEventPublishData; 888 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 success'); 889 try { 890 if (this.softKeyboardPanel !== null) { 891 this.softKeyboardPanel.resize(this.windowWidth, this.windowHeight, async (err, data) => { 892 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 resize'); 893 if (err) { 894 commonEventPublishData = { 895 data: 'FAILED' 896 }; 897 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 resize error: ' + JSON.stringify(err)); 898 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 899 } else { 900 commonEventPublishData = { 901 data: 'SUCCESS' 902 }; 903 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 Succeeded in changing the panel size: ' + JSON.stringify(data)); 904 } 905 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 906 }) 907 } else { 908 commonEventPublishData = { 909 data: 'FAILED' 910 }; 911 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 this.softKeyboardPanel is null'); 912 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 913 }; 914 } catch (error) { 915 commonEventPublishData = { 916 data: 'FAILED' 917 }; 918 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 catch error: ' + JSON.stringify(error)); 919 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0090', commonEventPublishData, this.publishCallback); 920 } 921 } 922 923 private Sub_Misc_inputMethod_Panel_resizePromise_0100(): void { 924 let commonEventPublishData; 925 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 success'); 926 try { 927 if (this.softKeyboardPanel !== null) { 928 this.softKeyboardPanel.resize(this.windowWidth, this.windowHeight).then(async (data) => { 929 commonEventPublishData = { 930 data: 'SUCCESS' 931 }; 932 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_resizePromise_0100 Succeed in changing the panel size: ' + JSON.stringify(data)); 933 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 934 }).catch(async (err) => { 935 commonEventPublishData = { 936 data: 'FAILED' 937 }; 938 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 resize error: ' + JSON.stringify(err)); 939 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 940 }); 941 } else { 942 commonEventPublishData = { 943 data: 'FAILED' 944 }; 945 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 this.softKeyboardPanel is null'); 946 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 947 }; 948 } catch (error) { 949 commonEventPublishData = { 950 data: 'FAILED' 951 }; 952 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 catch error: ' + JSON.stringify(error)); 953 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0100', commonEventPublishData, this.publishCallback); 954 } 955 } 956 957 private Sub_Misc_inputMethod_Panel_moveToCallback_0110(): void { 958 let commonEventPublishData; 959 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 success'); 960 try { 961 if (this.softKeyboardPanel !== null) { 962 this.softKeyboardPanel.moveTo(100, 100, async (err, data) => { 963 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 moveTo'); 964 if (err) { 965 commonEventPublishData = { 966 data: 'FAILED' 967 }; 968 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 moveTo error: ' + JSON.stringify(err)); 969 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 970 } else { 971 commonEventPublishData = { 972 data: 'SUCCESS' 973 }; 974 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 Succeed in moving the panel: ' + JSON.stringify(data)); 975 }; 976 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 977 }); 978 } else { 979 commonEventPublishData = { 980 data: 'FAILED' 981 }; 982 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 this.softKeyboardPanel is null'); 983 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 984 }; 985 } catch (error) { 986 commonEventPublishData = { 987 data: 'FAILED' 988 }; 989 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 catch error: ' + JSON.stringify(error)); 990 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0110', commonEventPublishData, this.publishCallback); 991 } 992 } 993 994 private Sub_Misc_inputMethod_Panel_moveToPromise_0120(): void { 995 let commonEventPublishData; 996 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 success'); 997 try { 998 if (this.softKeyboardPanel !== null) { 999 this.softKeyboardPanel.moveTo(100, 100).then(async (data) => { 1000 commonEventPublishData = { 1001 data: 'SUCCESS' 1002 }; 1003 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 Succeed in moving the panel: ' + JSON.stringify(data)); 1004 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 1005 }).catch(async (err) => { 1006 commonEventPublishData = { 1007 data: 'FAILED' 1008 }; 1009 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 moveTo error: ' + JSON.stringify(err)); 1010 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 1011 }); 1012 } else { 1013 commonEventPublishData = { 1014 data: 'FAILED' 1015 }; 1016 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 this.softKeyboardPanel is null'); 1017 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 1018 }; 1019 } catch (error) { 1020 commonEventPublishData = { 1021 data: 'FAILED' 1022 }; 1023 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 catch error: ' + JSON.stringify(error)); 1024 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0120', commonEventPublishData, this.publishCallback); 1025 } 1026 } 1027 1028 private Sub_Misc_inputMethod_Panel_showCallback_0130(): void { 1029 let commonEventPublishData; 1030 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 success'); 1031 try { 1032 if (this.softKeyboardPanel !== null) { 1033 this.softKeyboardPanel.show(async (err, data) => { 1034 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 show'); 1035 if (err) { 1036 commonEventPublishData = { 1037 data: 'FAILED' 1038 }; 1039 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 show error: ' + JSON.stringify(err)); 1040 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 1041 } else { 1042 commonEventPublishData = { 1043 data: 'SUCCESS' 1044 }; 1045 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_showCallback_0130 Succeed in showing the panel: ' + JSON.stringify(data)); 1046 }; 1047 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 1048 }); 1049 } else { 1050 commonEventPublishData = { 1051 data: 'FAILED' 1052 }; 1053 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 this.softKeyboardPanel is null'); 1054 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 1055 }; 1056 } catch (error) { 1057 commonEventPublishData = { 1058 data: 'FAILED' 1059 }; 1060 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 catch error: ' + JSON.stringify(error)); 1061 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showCallback_0130', commonEventPublishData, this.publishCallback); 1062 } 1063 } 1064 1065 private Sub_Misc_inputMethod_Panel_showPromise_0140(): void { 1066 let commonEventPublishData; 1067 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 success'); 1068 try { 1069 if (this.softKeyboardPanel !== null) { 1070 this.softKeyboardPanel.show().then(async (data) => { 1071 commonEventPublishData = { 1072 data: 'SUCCESS' 1073 }; 1074 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_showPromise_0140 Succeed in showing the panel: ' + JSON.stringify(data)); 1075 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 1076 }).catch(async (err) => { 1077 commonEventPublishData = { 1078 data: 'FAILED' 1079 }; 1080 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 show error: ' + JSON.stringify(err)); 1081 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 1082 }); 1083 } else { 1084 commonEventPublishData = { 1085 data: 'FAILED' 1086 }; 1087 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 this.softKeyboardPanel is null'); 1088 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 1089 }; 1090 } catch (error) { 1091 commonEventPublishData = { 1092 data: 'FAILED' 1093 }; 1094 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 catch error: ' + JSON.stringify(error)); 1095 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_showPromise_0140', commonEventPublishData, this.publishCallback); 1096 } 1097 } 1098 1099 private Sub_Misc_inputMethod_Panel_hideCallback_0150(): void { 1100 let commonEventPublishData; 1101 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 success'); 1102 try { 1103 if (this.softKeyboardPanel !== null) { 1104 this.softKeyboardPanel.hide(async (err, data) => { 1105 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 hide'); 1106 if (err) { 1107 commonEventPublishData = { 1108 data: 'FAILED' 1109 }; 1110 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 hide error: ' + JSON.stringify(err)); 1111 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 1112 } else { 1113 commonEventPublishData = { 1114 data: 'SUCCESS' 1115 }; 1116 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_hideCallback_0150 Succeed in hiding the panel: ' + JSON.stringify(data)); 1117 }; 1118 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 1119 }); 1120 } else { 1121 commonEventPublishData = { 1122 data: 'FAILED' 1123 }; 1124 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 this.softKeyboardPanel is null'); 1125 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 1126 }; 1127 } catch (error) { 1128 commonEventPublishData = { 1129 data: 'FAILED' 1130 }; 1131 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 catch error: ' + JSON.stringify(error)); 1132 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hideCallback_0150', commonEventPublishData, this.publishCallback); 1133 } 1134 } 1135 1136 private Sub_Misc_inputMethod_Panel_hidePromise_0160(): void { 1137 let commonEventPublishData; 1138 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 success'); 1139 try { 1140 if (this.softKeyboardPanel !== null) { 1141 this.softKeyboardPanel.hide().then(async (data) => { 1142 commonEventPublishData = { 1143 data: 'SUCCESS' 1144 }; 1145 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_hidePromise_0160 Succeed in hiding the panel: ' + JSON.stringify(data)); 1146 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 1147 }).catch(async (err) => { 1148 commonEventPublishData = { 1149 data: 'FAILED' 1150 }; 1151 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 hide error: ' + JSON.stringify(err)); 1152 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 1153 }); 1154 } else { 1155 commonEventPublishData = { 1156 data: 'FAILED' 1157 }; 1158 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 this.softKeyboardPanel is null'); 1159 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 1160 }; 1161 } catch (error) { 1162 commonEventPublishData = { 1163 data: 'FAILED' 1164 }; 1165 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 catch error: ' + JSON.stringify(error)); 1166 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_hidePromise_0160', commonEventPublishData, this.publishCallback); 1167 } 1168 } 1169 1170 private async Sub_Misc_inputMethod_Panel_onShow_0170(): Promise<void> { 1171 let commonEventPublishData; 1172 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 success'); 1173 try { 1174 if (this.softKeyboardPanel !== null) { 1175 this.softKeyboardPanel.on('show', async () => { 1176 commonEventPublishData = { 1177 data: 'SUCCESS' 1178 }; 1179 this.softKeyboardPanel.off('show', ()=>{}); 1180 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 onShow error: '); 1181 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onShow_0170 Succeed onShow: '); 1182 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onShow_0170', commonEventPublishData, this.publishCallback); 1183 }); 1184 await this.softKeyboardPanel.show(); 1185 } else { 1186 commonEventPublishData = { 1187 data: 'FAILED' 1188 }; 1189 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 this.softKeyboardPanel is null'); 1190 commoneventmanager.publish('ub_Misc_inputMethod_Panel_onShow_0170', commonEventPublishData, this.publishCallback); 1191 }; 1192 } catch (error) { 1193 commonEventPublishData = { 1194 data: 'FAILED' 1195 }; 1196 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onShow_0170 catch error: ' + JSON.stringify(error)); 1197 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onShow_0170', commonEventPublishData, this.publishCallback); 1198 } 1199 } 1200 1201 private async Sub_Misc_inputMethod_Panel_onHide_0180(): Promise<void> { 1202 let commonEventPublishData; 1203 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 success'); 1204 try { 1205 if (this.softKeyboardPanel !== null) { 1206 this.softKeyboardPanel.on('hide', async () => { 1207 commonEventPublishData = { 1208 data: 'SUCCESS' 1209 }; 1210 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 onHide'); 1211 this.softKeyboardPanel.off('hide', ()=>{}); 1212 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onHide_0180 Succeed onHide:'); 1213 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onHide_0180', commonEventPublishData, this.publishCallback); 1214 }); 1215 await this.softKeyboardPanel.hide(); 1216 } else { 1217 commonEventPublishData = { 1218 data: 'FAILED' 1219 }; 1220 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 this.softKeyboardPanel is null'); 1221 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onHide_0180', commonEventPublishData, this.publishCallback); 1222 }; 1223 } catch (error) { 1224 commonEventPublishData = { 1225 data: 'FAILED' 1226 }; 1227 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onHide_0180 catch error: ' + JSON.stringify(error)); 1228 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onHide_0180', commonEventPublishData, this.publishCallback); 1229 } 1230 } 1231 1232 private Sub_Misc_inputMethod_Panel_offShow_0190(): void { 1233 let commonEventPublishData = { 1234 data: 'FAILED' 1235 }; 1236 let count = 0; 1237 let timeCount = 0; 1238 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 success'); 1239 try { 1240 if (this.softKeyboardPanel !== null) { 1241 this.softKeyboardPanel.on('show', async () => { 1242 this.softKeyboardPanel.off('show'); 1243 count += 1; 1244 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 off Show count: ' + count); 1245 }); 1246 let t1 = setInterval(async () => { 1247 await this.softKeyboardPanel.show(); 1248 await this.softKeyboardPanel.hide(); 1249 timeCount += 1; 1250 console.info(TAG + '====>this.softKeyboardPanel.show setInterval timeCount: ' + timeCount); 1251 if (timeCount === 2) { 1252 clearInterval(t1); 1253 } 1254 }, 100); 1255 1256 let t2 = setTimeout(() => { 1257 console.info(TAG + '====>setTimeout count: ' + count); 1258 if (count === 1) { 1259 commonEventPublishData = { 1260 data: 'SUCCESS' 1261 }; 1262 } 1263 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offShow_0190', commonEventPublishData, this.publishCallback); 1264 clearTimeout(t2); 1265 }, 500); 1266 1267 } else { 1268 commonEventPublishData = { 1269 data: 'FAILED' 1270 }; 1271 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 this.softKeyboardPanel is null'); 1272 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offShow_0190', commonEventPublishData, this.publishCallback); 1273 }; 1274 } catch (error) { 1275 commonEventPublishData = { 1276 data: 'FAILED' 1277 }; 1278 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offShow_0190 catch error: ' + JSON.stringify(error)); 1279 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offShow_0190', commonEventPublishData, this.publishCallback); 1280 } 1281 } 1282 1283 private Sub_Misc_inputMethod_Panel_offHide_0200(): void { 1284 let commonEventPublishData = { 1285 data: 'FAILED' 1286 }; 1287 let count = 0; 1288 let timeCount = 0; 1289 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 success'); 1290 try { 1291 if (this.softKeyboardPanel !== null) { 1292 this.softKeyboardPanel.on('hide', async () => { 1293 this.softKeyboardPanel.off('hide'); 1294 count += 1; 1295 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 off hide count: ' + count); 1296 }); 1297 1298 let t1 = setInterval(async () => { 1299 ; 1300 await this.softKeyboardPanel.show(); 1301 await this.softKeyboardPanel.hide(); 1302 timeCount += 1; 1303 console.info(TAG + '====>this.softKeyboardPanel.hide setInterval timeCount: ' + timeCount); 1304 if (timeCount === 2) { 1305 clearInterval(t1); 1306 } 1307 }, 300); 1308 1309 let t2 = setTimeout(() => { 1310 console.info(TAG + '====>setTimeout count: ' + count); 1311 if (count === 1) { 1312 commonEventPublishData = { 1313 data: 'SUCCESS' 1314 }; 1315 } 1316 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offHide_0200', commonEventPublishData, this.publishCallback); 1317 clearTimeout(t2); 1318 }, 1000); 1319 1320 } else { 1321 commonEventPublishData = { 1322 data: 'FAILED' 1323 }; 1324 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 this.softKeyboardPanel is null'); 1325 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offHide_0200', commonEventPublishData, this.publishCallback); 1326 }; 1327 } catch (error) { 1328 commonEventPublishData = { 1329 data: 'FAILED' 1330 }; 1331 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_offHide_0200 catch error: ' + JSON.stringify(error)); 1332 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_offHide_0200', commonEventPublishData, this.publishCallback); 1333 } 1334 } 1335 1336 private Sub_Misc_inputMethod_Panel_changeFlag_0210(): void { 1337 let commonEventPublishData = { 1338 data: 'FAILED' 1339 }; 1340 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 success'); 1341 try { 1342 if (this.softKeyboardPanel !== null) { 1343 try { 1344 this.softKeyboardPanel.changeFlag(1); 1345 commonEventPublishData = { 1346 data: 'SUCCESS' 1347 }; 1348 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0210', commonEventPublishData, this.publishCallback); 1349 } catch (err) { 1350 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0210 throw_error: ' + err); 1351 } 1352 1353 } else { 1354 commonEventPublishData = { 1355 data: 'FAILED' 1356 }; 1357 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 this.softKeyboardPanel is null'); 1358 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0210', commonEventPublishData, this.publishCallback); 1359 }; 1360 } catch (error) { 1361 commonEventPublishData = { 1362 data: 'FAILED' 1363 }; 1364 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 catch error: ' + JSON.stringify(error)); 1365 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0210', commonEventPublishData, this.publishCallback); 1366 } 1367 } 1368 1369 private Sub_Misc_inputMethod_Panel_changeFlag_0211(): void { 1370 let commonEventPublishData = { 1371 data: 'FAILED' 1372 }; 1373 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0211 success'); 1374 try { 1375 if (this.softKeyboardPanel !== null) { 1376 try { 1377 let fla_fixed = inputmethodengine.PanelFlag.FLG_FIXED; 1378 let fla_floating = inputmethodengine.PanelFlag.FLG_FLOATING; 1379 this.softKeyboardPanel.changeFlag(fla_fixed); 1380 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 switch to fla_fixed'); 1381 this.softKeyboardPanel.changeFlag(fla_floating); 1382 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 switch to fla_floating'); 1383 commonEventPublishData = { 1384 data: 'SUCCESS' 1385 }; 1386 } catch (err) { 1387 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_changeFlag_0211 throw_error: ' + err); 1388 }; 1389 } else { 1390 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0211 this.softKeyboardPanel is null'); 1391 }; 1392 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0211', commonEventPublishData, this.publishCallback); 1393 } catch (error) { 1394 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0211 catch error: ' + JSON.stringify(error)); 1395 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0211', commonEventPublishData, this.publishCallback); 1396 } 1397 } 1398 1399 private Sub_InputMethod_IMF_SecurityKeyboard_0600(): void { 1400 let commonEventPublishData = { 1401 data: 'FAILED' 1402 }; 1403 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 success'); 1404 try { 1405 if (this.softKeyboardPanel !== null) { 1406 try { 1407 let isPrivacyMode: boolean = true; 1408 this.softKeyboardPanel.setPrivacyMode(isPrivacyMode); 1409 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 success switch to PrivacyMode'); 1410 commonEventPublishData = { 1411 data: 'SUCCESS' 1412 }; 1413 } catch (err) { 1414 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 Failed to set privacy mode' + err); 1415 commonEventPublishData = { 1416 data: 'FAILED' 1417 }; 1418 }; 1419 } else { 1420 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 this.softKeyboardPanel is null'); 1421 } 1422 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0600', commonEventPublishData, this.publishCallback); 1423 } catch (error) { 1424 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0600 catch error: ' + JSON.stringify(error)); 1425 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0600', commonEventPublishData, this.publishCallback); 1426 } 1427 } 1428 1429 private Sub_InputMethod_IMF_SecurityKeyboard_0700(): void { 1430 let commonEventPublishData = { 1431 data: 'FAILED' 1432 }; 1433 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 success'); 1434 try { 1435 if (this.softKeyboardPanel !== null) { 1436 try { 1437 let isPrivacyMode: boolean = false; 1438 this.softKeyboardPanel.setPrivacyMode(isPrivacyMode); 1439 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 success switch to PrivacyMode'); 1440 commonEventPublishData = { 1441 data: 'SUCCESS' 1442 }; 1443 } catch (err) { 1444 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 Failed to set privacy mode' + err); 1445 commonEventPublishData = { 1446 data: 'FAILED' 1447 }; 1448 }; 1449 } else { 1450 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 this.softKeyboardPanel is null'); 1451 }; 1452 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0700', commonEventPublishData, this.publishCallback); 1453 } catch (error) { 1454 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0700 catch error: ' + JSON.stringify(error)); 1455 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0700', commonEventPublishData, this.publishCallback); 1456 } 1457 } 1458 1459 private Sub_InputMethod_IMF_SecurityKeyboard_0800(): void { 1460 let commonEventPublishData = { 1461 data: 'FAILED' 1462 }; 1463 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 success'); 1464 try { 1465 if (this.softKeyboardPanel !== null) { 1466 try { 1467 let isPrivacyMode: boolean = undefined; 1468 this.softKeyboardPanel.setPrivacyMode(isPrivacyMode); 1469 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 success switch to PrivacyMode'); 1470 } catch (err) { 1471 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 Failed to set privacy mode catch: ' + err); 1472 if (err.code === 401) { 1473 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 Failed to set privacy mode002: ' + err); 1474 commonEventPublishData = { 1475 data: 'SUCCESS' 1476 }; 1477 } 1478 }; 1479 } else { 1480 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 this.softKeyboardPanel is null'); 1481 }; 1482 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0800', commonEventPublishData, this.publishCallback); 1483 } catch (error) { 1484 console.info(TAG + '====>Sub_InputMethod_IMF_SecurityKeyboard_0800 catch error: ' + JSON.stringify(error)); 1485 commoneventmanager.publish('Sub_InputMethod_IMF_SecurityKeyboard_0800', commonEventPublishData, this.publishCallback); 1486 } 1487 } 1488 1489 private Sub_InputMethod_IMF_getSecurityMode_0100(): void { 1490 let commonEventPublishData = { 1491 data: 'FAILED' 1492 }; 1493 console.info(TAG + '====>receive Sub_InputMethod_IMF_getSecurityMode_0100 success'); 1494 try { 1495 let mode1: inputmethodengine.SecurityMode = inputMethodAbility.getSecurityMode(); 1496 if (mode1 === inputmethodengine.SecurityMode.BASIC || mode1 === inputmethodengine.SecurityMode.FULL) { 1497 console.info(TAG + '====>getSecurityMode, securityMode is : ${mode1}'); 1498 commonEventPublishData = { 1499 data: 'SUCCESS' 1500 }; 1501 commoneventmanager.publish('Sub_InputMethod_IMF_getSecurityMode_0100', commonEventPublishData, this.publishCallback); 1502 } else { 1503 commonEventPublishData = { 1504 data: 'FAILED' 1505 }; 1506 console.info(TAG + '====>Failed to getSecurityMode: ${JSON.stringify(err)}'); 1507 }; 1508 } catch (error) { 1509 commonEventPublishData = { 1510 data: 'FAILED' 1511 }; 1512 console.info(TAG + '====>receive Sub_InputMethod_IMF_getSecurityMode_0100 catch error: ' + JSON.stringify(error)); 1513 commoneventmanager.publish('Sub_InputMethod_IMF_getSecurityMode_0100', commonEventPublishData, this.publishCallback); 1514 } 1515 } 1516 1517 private async SUB_InputMethod_IME_SplitScreen_0100(): Promise<void> { 1518 let commonEventPublishData = { 1519 data: 'FAILED' 1520 }; 1521 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 start'); 1522 try { 1523 if (this.softKeyboardPanel !== null) { 1524 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 this.softKeyboardPanel:' + this.softKeyboardPanel); 1525 let t = setTimeout(async () => { 1526 clearTimeout(t); 1527 try { 1528 let WindowInfo = await this.InputClient.getCallingWindowInfo(); 1529 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo WindowInfo:' + JSON.stringify(WindowInfo)); 1530 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo rect: ' + JSON.stringify(WindowInfo.rect)); 1531 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo status: ' + JSON.stringify(WindowInfo.status)); 1532 if (typeof (WindowInfo) === 'object' && typeof (WindowInfo.rect) === 'object' && typeof (WindowInfo.status) === 'number') { 1533 commonEventPublishData = { 1534 data: 'SUCCESS' 1535 }; 1536 }; 1537 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo WindowInfo: success'); 1538 } catch (err) { 1539 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInf0 err: ' + JSON.stringify(err.message)); 1540 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInf0 err: ' + JSON.stringify(err.code)); 1541 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfO err: ' + err); 1542 }; 1543 commoneventmanager.publish('SUB_InputMethod_IME_SplitScreen_0100', commonEventPublishData, this.publishCallback); 1544 1545 }, 500); 1546 1547 } else { 1548 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 getCallingWindowInfo softKeyboardPanel is null '); 1549 }; 1550 1551 } catch (error) { 1552 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 catch error: ' + JSON.stringify(error.message)); 1553 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0100 catch error: ' + JSON.stringify(error.code)); 1554 commoneventmanager.publish('SUB_InputMethod_IME_SplitScreen_0100', commonEventPublishData, this.publishCallback); 1555 } 1556 } 1557 1558 private async Sub_InputMethod_IME_ScreenRotation_0100(): Promise<void> { 1559 console.info(TAG + '====>receive Sub_InputMethod_IME_ScreenRotation_0100 data'); 1560 let commonEventPublishData = { 1561 data: 'FAILED' 1562 }; 1563 try { 1564 let keyboardRect: inputMethodEngine.PanelRect = { 1565 landscapeRect: { left: 100, top: 100, width: this.display_info.width, height: this.display_info.height * 0.4}, 1566 portraitRect: { left: 100, top: 100, width: this.display_info.height * 0.4, height: this.display_info.width} 1567 }; 1568 this.softKeyboardPanel.adjustPanelRect(inputMethodEngine.PanelFlag.FLG_FIXED, keyboardRect); 1569 commonEventPublishData = { 1570 data: 'SUCCESS' 1571 }; 1572 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0100 startAbility success' ); 1573 } catch (err) { 1574 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0100 err: ' + JSON.stringify(err)); 1575 }; 1576 commoneventmanager.publish('Sub_InputMethod_IME_ScreenRotation_0100', commonEventPublishData, this.publishCallback); 1577 } 1578 1579 private async Sub_InputMethod_IME_ScreenRotation_0200(): Promise<void> { 1580 console.info(TAG + '====>receive Sub_InputMethod_IME_ScreenRotation_0200 data'); 1581 let commonEventPublishData = { 1582 data: 'FAILED' 1583 }; 1584 try{ 1585 let keyboardRect: inputMethodEngine.PanelRect = { 1586 landscapeRect: { left: 100, top: 100, width: this.display_info.width, height: this.display_info.height * 0.4}, 1587 portraitRect: { left: 100, top: 100, width: this.display_info.height * 0.4, height: this.display_info.width} 1588 }; 1589 this.softKeyboardPanel.adjustPanelRect(inputMethodEngine.PanelFlag.FLG_FLOATING, keyboardRect); 1590 commonEventPublishData = { 1591 data: 'SUCCESS' 1592 }; 1593 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0200 startAbility success' ); 1594 } catch (err) { 1595 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0200 err: ' + JSON.stringify(err)); 1596 }; 1597 commoneventmanager.publish('Sub_InputMethod_IME_ScreenRotation_0200', commonEventPublishData, this.publishCallback); 1598 } 1599 1600 private async Sub_Misc_inputMethod_Panel_onSizeChange_0100(): Promise<void> { 1601 let commonEventPublishData; 1602 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 success'); 1603 try { 1604 if (this.softKeyboardPanel !== null) { 1605 this.softKeyboardPanel.on('sizeChange', async (size, keyboardArea: inputMethodEngine.KeyboardArea) => { 1606 if (typeof (keyboardArea.top) === 'number' && typeof (keyboardArea.bottom) === 'number' && typeof (keyboardArea.left) === 'number' && typeof (keyboardArea.right) === 'number') { 1607 commonEventPublishData = { 1608 data: 'SUCCESS' 1609 }; 1610 }; 1611 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 onSizeChange'); 1612 this.softKeyboardPanel.off('sizeChange', ()=>{}); 1613 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 offSizeChange'); 1614 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0100', commonEventPublishData, this.publishCallback); 1615 }); 1616 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.width1: ' + this.display_info.width); 1617 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.height1: ' + this.display_info.height); 1618 await this.softKeyboardPanel.resize(200, 100); 1619 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.width2: ' + this.display_info.width); 1620 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0100 display_info.height2: ' + this.display_info.height); 1621 } else { 1622 commonEventPublishData = { 1623 data: 'FAILED' 1624 }; 1625 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 this.softKeyboardPanel is null'); 1626 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0100', commonEventPublishData, this.publishCallback); 1627 }; 1628 } catch (error) { 1629 commonEventPublishData = { 1630 data: 'FAILED' 1631 }; 1632 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0100 catch error: ' + JSON.stringify(error)); 1633 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0100', commonEventPublishData, this.publishCallback); 1634 } 1635 } 1636 1637 private async Sub_Misc_inputMethod_Panel_onSizeChange_0200(): Promise<void> { 1638 let commonEventPublishData = { 1639 data: 'FAILED' 1640 }; 1641 let count = 0; 1642 let timeCount = 0; 1643 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 success'); 1644 try { 1645 if (this.softKeyboardPanel !== null) { 1646 this.softKeyboardPanel.on('sizeChange', async (size) => { 1647 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 onSizeChange'); 1648 this.softKeyboardPanel.off('sizeChange'); 1649 count += 1; 1650 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 off SizeChange count: ' + count); 1651 }); 1652 let flage:boolean = true; 1653 let t1 = setInterval(async () => { 1654 if (flage === true) { 1655 flage = false; 1656 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.width: ' + this.display_info.width); 1657 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.height: ' + this.display_info.height); 1658 await this.softKeyboardPanel.resize(200, 120); 1659 } else { 1660 flage = true; 1661 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.width: ' + this.display_info.width); 1662 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_onSizeChange_0200 display_info.height: ' + this.display_info.height); 1663 await this.softKeyboardPanel.resize(200, 130); 1664 }; 1665 timeCount += 1; 1666 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 timeCount: ' + timeCount); 1667 if (timeCount === 2) { 1668 clearInterval(t1); 1669 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 clearInterval success'); 1670 }; 1671 }, 100); 1672 1673 let t2 = setTimeout(() => { 1674 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 count: ' + count); 1675 if (count === 1) { 1676 commonEventPublishData = { 1677 data: 'SUCCESS' 1678 }; 1679 }; 1680 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0200', commonEventPublishData, this.publishCallback); 1681 clearTimeout(t2); 1682 }, 500); 1683 1684 } else { 1685 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 this.softKeyboardPanel is null'); 1686 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0200', commonEventPublishData, this.publishCallback); 1687 }; 1688 } catch (error) { 1689 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_onSizeChange_0200 catch error: ' + JSON.stringify(error)); 1690 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_onSizeChange_0200', commonEventPublishData, this.publishCallback); 1691 } 1692 } 1693 1694 private Sub_InputMethod_IME_Dragging_1100(): void { 1695 let commonEventPublishData = { 1696 data: 'FAILED' 1697 }; 1698 let fla_fixed = inputmethodengine.PanelFlag.FLG_FIXED; 1699 let fla_floating = inputmethodengine.PanelFlag.FLG_FLOATING; 1700 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 success'); 1701 try { 1702 if (this.softKeyboardPanel !== null) { 1703 try { 1704 this.softKeyboardPanel.changeFlag(fla_fixed); 1705 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 switch to fla_fixed'); 1706 this.softKeyboardPanel.startMoving(); 1707 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 startMoving success'); 1708 } catch (err) { 1709 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 startMoving err' + JSON.stringify(err)); 1710 if (err.code === 12800017) { 1711 commonEventPublishData = { 1712 data: 'SUCCESS' 1713 }; 1714 }; 1715 if (err.code === 801) { 1716 commonEventPublishData = { 1717 data: 'SUCCESS' 1718 }; 1719 }; 1720 } finally { 1721 this.softKeyboardPanel.changeFlag(fla_floating); 1722 }; 1723 } else { 1724 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 this.softKeyboardPanel is null'); 1725 }; 1726 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_1100', commonEventPublishData, this.publishCallback); 1727 } catch (error) { 1728 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_1100 catch error: ' + JSON.stringify(error)); 1729 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_1100', commonEventPublishData, this.publishCallback); 1730 } 1731 } 1732 1733 private async Sub_InputMethod_IME_Dragging_0800(): Promise<void> { 1734 let commonEventPublishData = { 1735 data: 'FAILED' 1736 }; 1737 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 success'); 1738 try { 1739 if (this.softKeyboardPanel !== null) { 1740 try { 1741 let num = await this.softKeyboardPanel.getDisplayId(); 1742 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 typeof num: ' + typeof(num)); 1743 if (typeof(num) === 'number') { 1744 commonEventPublishData = { 1745 data: 'SUCCESS' 1746 }; 1747 }; 1748 } catch (err) { 1749 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 getDisplayId err' + JSON.stringify(err)); 1750 }; 1751 } else { 1752 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 this.softKeyboardPanel is null'); 1753 }; 1754 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0800', commonEventPublishData, this.publishCallback); 1755 } catch (error) { 1756 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0800 catch error: ' + JSON.stringify(error)); 1757 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0800', commonEventPublishData, this.publishCallback); 1758 } 1759 } 1760 1761 private async Sub_InputMethod_IME_Dragging_0900(): Promise<void> { 1762 let commonEventPublishData = { 1763 data: 'FAILED' 1764 }; 1765 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 success'); 1766 try { 1767 let panelInfo: inputMethodEngine.PanelInfo = { 1768 type: inputMethodEngine.PanelType.STATUS_BAR, 1769 flag: inputMethodEngine.PanelFlag.FLG_FLOATING 1770 }; 1771 inputMethodAbility.createPanel(this.mContext, panelInfo).then(async(inputPanel: inputMethodEngine.Panel) => { 1772 if (inputPanel) { 1773 let wid = Math.floor(this.display_info.width * 0.4); 1774 let hei = Math.floor(this.display_info.height * 0.5); 1775 console.info(TAG + `====>Sub_InputMethod_IME_Dragging_0900 wid: ${wid},hei: ${hei}`); 1776 await inputPanel.resize(wid, hei); 1777 let wid_ = Math.floor(this.display_info.width * 0.3); 1778 let hei_ = Math.floor(this.display_info.height * 0.4); 1779 console.info(TAG + `====>Sub_InputMethod_IME_Dragging_0900 wid_: ${wid_},hei_: ${hei_}`); 1780 await inputPanel.moveTo(wid_, hei_); 1781 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 creat panel success!'); 1782 let displayId = await inputPanel.getDisplayId(); 1783 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 getDisplayId success!'); 1784 commonEventPublishData = { 1785 data: typeof displayId 1786 }; 1787 }; 1788 await inputMethodAbility.destroyPanel(inputPanel); 1789 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0900', commonEventPublishData, this.publishCallback); 1790 }).catch((err) => { 1791 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 creat panel throw err: ' + JSON.stringify(err)); 1792 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0900', commonEventPublishData, this.publishCallback); 1793 }); 1794 } catch (error) { 1795 console.info(TAG + '====>Sub_InputMethod_IME_Dragging_0900 catch error: ' + JSON.stringify(error)); 1796 commoneventmanager.publish('Sub_InputMethod_IME_Dragging_0900', commonEventPublishData, this.publishCallback); 1797 } 1798 } 1799 1800 private Sub_InputMethod_IME_Custom_0900(): void { 1801 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 data'); 1802 let commonEventPublishData = { 1803 data: 'FAILED' 1804 }; 1805 try { 1806 let that = this; 1807 let msgHandler: inputMethodEngine.MessageHandler = { 1808 onTerminated(): void { 1809 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 onTerminated'); 1810 }, 1811 onMessage(msgId: string): void { 1812 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 onMessage msgId: ' + msgId ); 1813 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 sedMessages msgIdSize: ' + msgId.length ); 1814 if (msgId === 'Sub_InputMethod_IME_Custom_0900') { 1815 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 start sendMessage'); 1816 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0900', that.newArrayBuffer('SUCCESS')) 1817 }else{ 1818 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0900', that.newArrayBuffer('FAILED')) 1819 } 1820 that.InputClient.recvMessage() 1821 } 1822 } 1823 this.InputClient.recvMessage(msgHandler); 1824 commonEventPublishData = { 1825 data: 'SUCCESS' 1826 }; 1827 } catch (error) { 1828 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0900 recvMessage catch err!'); 1829 } 1830 let t = setTimeout(() => { 1831 clearTimeout(t); 1832 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0900', commonEventPublishData, this.publishCallback); 1833 }, 100) 1834 } 1835 1836 private Sub_InputMethod_IME_Custom_0200(): void { 1837 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 data'); 1838 let commonEventPublishData = { 1839 data: 'FAILED' 1840 }; 1841 try { 1842 let that = this; 1843 let msgHandler: inputMethodEngine.MessageHandler = { 1844 onTerminated(): void { 1845 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 onTerminated'); 1846 }, 1847 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1848 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 onMessage msgId: ' + msgId + ', msgParam: ' + 1849 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1850 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 sedMessages msgIdSize: ' + msgId.length + ', msgParamSize: ' + 1851 that.GetArrayBufferString(msgParam)?.length + ', ArrayBufferSize' + msgParam?.byteLength); 1852 if (msgId.length === 256 && msgParam?.byteLength === 131072) { 1853 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 start sendMessage'); 1854 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0200', that.newArrayBuffer('SUCCESS')) 1855 } else { 1856 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0200', that.newArrayBuffer('FAILED')) 1857 } 1858 that.InputClient.recvMessage() 1859 } 1860 } 1861 this.InputClient.recvMessage(msgHandler); 1862 commonEventPublishData = { 1863 data: 'SUCCESS' 1864 }; 1865 } catch (error) { 1866 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0200 recvMessage catch err!'); 1867 } 1868 let t = setTimeout(() => { 1869 clearTimeout(t); 1870 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0200', commonEventPublishData, this.publishCallback); 1871 }, 100) 1872 } 1873 1874 private Sub_InputMethod_IME_Custom_0800(): void { 1875 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 data'); 1876 let commonEventPublishData = { 1877 data: 'FAILED' 1878 }; 1879 try { 1880 let that = this; 1881 let msgHandler: inputMethodEngine.MessageHandler = { 1882 onTerminated(): void { 1883 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 onTerminated'); 1884 }, 1885 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1886 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 onMessage msgId: ' + msgId + ', msgParam: ' + 1887 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1888 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 sedMessages msgIdSize: ' + msgId.length + ', msgParamSize: ' + 1889 that.GetArrayBufferString(msgParam)?.length + ', ArrayBufferSize' + msgParam?.byteLength); 1890 if (msgId.length === 0 && msgParam?.byteLength === 131072) { 1891 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0800 start sendMessage'); 1892 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0800', that.newArrayBuffer('SUCCESS')) 1893 }else{ 1894 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_0800', that.newArrayBuffer('FAILED')) 1895 } 1896 that.InputClient.recvMessage() 1897 } 1898 } 1899 this.InputClient.recvMessage(msgHandler); 1900 commonEventPublishData = { 1901 data: 'SUCCESS' 1902 }; 1903 } catch (error) { 1904 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0800 recvMessage catch err!'); 1905 } 1906 let t = setTimeout(() => { 1907 clearTimeout(t); 1908 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0800', commonEventPublishData, this.publishCallback); 1909 }, 100) 1910 } 1911 1912 private Sub_InputMethod_IME_Custom_0400(): void { 1913 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0400 data'); 1914 let commonEventPublishData = { 1915 data: 'FAILED' 1916 }; 1917 try { 1918 let that = this; 1919 let msgHandler: inputMethodEngine.MessageHandler = { 1920 onTerminated(): void { 1921 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0400 onTerminated'); 1922 }, 1923 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1924 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0400 onMessage msgId: ' + msgId + ', msgParam: ' + 1925 that.GetArrayBufferString(msgParam) ); 1926 that.InputClient.recvMessage() 1927 } 1928 } 1929 this.InputClient.recvMessage(msgHandler); 1930 commonEventPublishData = { 1931 data: 'SUCCESS' 1932 }; 1933 } catch (error) { 1934 console.info(TAG +'====>Sub_InputMethod_IME_Custom_0400 recvMessage catch err!'); 1935 } 1936 let t = setTimeout(() => { 1937 clearTimeout(t); 1938 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0400', commonEventPublishData, this.publishCallback); 1939 }, 100) 1940 } 1941 1942 private Sub_InputMethod_IME_Custom_0300(): void { 1943 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0300 data'); 1944 let commonEventPublishData = { 1945 data: 'FAILED' 1946 }; 1947 try { 1948 let that = this; 1949 let msgHandler: inputMethodEngine.MessageHandler = { 1950 onTerminated(): void { 1951 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0300 onTerminated'); 1952 }, 1953 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1954 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0300 onMessage msgId: ' + msgId + ', msgParam: ' + 1955 that.GetArrayBufferString(msgParam) ); 1956 that.InputClient.recvMessage() 1957 } 1958 } 1959 this.InputClient.recvMessage(msgHandler); 1960 commonEventPublishData = { 1961 data: 'SUCCESS' 1962 }; 1963 } catch (error) { 1964 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0300 recvMessage catch err!'); 1965 } 1966 let t = setTimeout(() => { 1967 clearTimeout(t); 1968 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0300', commonEventPublishData, this.publishCallback); 1969 }, 100) 1970 } 1971 1972 private Sub_InputMethod_IME_Custom_1100(): void { 1973 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 data'); 1974 let commonEventPublishData = { 1975 data: 'FAILED' 1976 }; 1977 try { 1978 let that = this; 1979 let msgHandler: inputMethodEngine.MessageHandler = { 1980 onTerminated(): void { 1981 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 onTerminated'); 1982 }, 1983 onMessage(msgId: string, msgParam?: ArrayBuffer): void { 1984 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 onMessage msgId: ' + msgId + ', msgParam: ' + 1985 that.GetArrayBufferString(msgParam) + ', msgParamObj' + msgParam); 1986 if(msgId.length === 256 && msgParam?.byteLength === undefined) { 1987 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 start sendMessage'); 1988 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_1100') 1989 }else{ 1990 that.InputClient.sendMessage('Sub_InputMethod_IME_Custom_1100', that.newArrayBuffer('FAILED')) 1991 } 1992 that.InputClient.recvMessage() 1993 } 1994 } 1995 this.InputClient.recvMessage(msgHandler); 1996 commonEventPublishData = { 1997 data: 'SUCCESS' 1998 }; 1999 } catch (error) { 2000 console.info(TAG + '====>Sub_InputMethod_IME_Custom_1100 recvMessage catch err!'); 2001 } 2002 let t = setTimeout(() => { 2003 clearTimeout(t); 2004 commoneventmanager.publish('Sub_InputMethod_IME_Custom_1100', commonEventPublishData, this.publishCallback); 2005 }, 100) 2006 } 2007 2008 private async Sub_InputMethod_IME_Attach_0100(): Promise<void> { 2009 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0100 data'); 2010 let commonEventPublishData = { 2011 data: 'FAILED' 2012 }; 2013 try { 2014 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 2015 inputMethodAbility.off('inputStart'); 2016 this.keyboardController = keyboardController; 2017 this.InputClient = InputClient; 2018 2019 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0100 inputMethonAbility inputStart into'); 2020 commonEventPublishData = { 2021 data: 'SUCCESS' 2022 }; 2023 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0100', commonEventPublishData, this.publishCallback); 2024 }) 2025 commonEventPublishData = { 2026 data: 'on_SUCCESS' 2027 }; 2028 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0100', commonEventPublishData, this.publishCallback); 2029 } catch (err) { 2030 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0100 err: ' + JSON.stringify(err)); 2031 } 2032 } 2033 2034 private async Sub_InputMethod_IME_Attach_0200(): Promise<void> { 2035 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0200 data'); 2036 let commonEventPublishData = { 2037 data: 'FAILED' 2038 }; 2039 try { 2040 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 2041 inputMethodAbility.off('inputStart'); 2042 this.keyboardController = keyboardController; 2043 this.InputClient = InputClient; 2044 2045 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0200 inputMethonAbility inputStart into'); 2046 commonEventPublishData = { 2047 data: 'SUCCESS' 2048 }; 2049 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0200', commonEventPublishData, this.publishCallback); 2050 }) 2051 commonEventPublishData = { 2052 data: 'on_SUCCESS' 2053 }; 2054 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0200', commonEventPublishData, this.publishCallback); 2055 } catch (err) { 2056 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0200 err: ' + JSON.stringify(err)); 2057 } 2058 } 2059 2060 private async Sub_InputMethod_IME_Attach_0300(): Promise<void> { 2061 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0300 data'); 2062 let commonEventPublishData = { 2063 data: 'FAILED' 2064 }; 2065 try { 2066 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 2067 inputMethodAbility.off('inputStart'); 2068 this.keyboardController = keyboardController; 2069 this.InputClient = InputClient; 2070 2071 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0300 inputMethonAbility inputStart into'); 2072 commonEventPublishData = { 2073 data: 'SUCCESS' 2074 }; 2075 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0300', commonEventPublishData, this.publishCallback); 2076 }) 2077 commonEventPublishData = { 2078 data: 'on_SUCCESS' 2079 }; 2080 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0300', commonEventPublishData, this.publishCallback); 2081 } catch (err) { 2082 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0300 err: ' + JSON.stringify(err)); 2083 } 2084 } 2085 2086 private async Sub_InputMethod_IME_Attach_0400(): Promise<void> { 2087 console.info(TAG + '====>receive Sub_InputMethod_IME_Attach_0400 data'); 2088 let commonEventPublishData = { 2089 data: 'FAILED' 2090 }; 2091 try { 2092 inputMethodAbility.on('inputStart', async (keyboardController, InputClient) => { 2093 inputMethodAbility.off('inputStart'); 2094 this.keyboardController = keyboardController; 2095 this.InputClient = InputClient; 2096 2097 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0400 inputMethonAbility inputStart into'); 2098 commonEventPublishData = { 2099 data: 'SUCCESS' 2100 }; 2101 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0400', commonEventPublishData, this.publishCallback); 2102 }) 2103 commonEventPublishData = { 2104 data: 'on_SUCCESS' 2105 }; 2106 commoneventmanager.publish('Sub_InputMethod_IME_Attach_0400', commonEventPublishData, this.publishCallback); 2107 } catch (err) { 2108 console.info(TAG + '====>Sub_InputMethod_IME_Attach_0400 err: ' + JSON.stringify(err)); 2109 } 2110 } 2111 2112 private async Sub_InputMethod_IME_ShowTextInput_0100(): Promise<void> { 2113 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0100 data'); 2114 let commonEventPublishData = { 2115 data: 'FAILED' 2116 }; 2117 try { 2118 if (this.softKeyboardPanel !== null) { 2119 this.softKeyboardPanel.on('show', async () => { 2120 commonEventPublishData = { 2121 data: 'SUCCESS' 2122 }; 2123 this.softKeyboardPanel.off('show'); 2124 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0100 onShow error: '); 2125 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0100 Succeed onShow: '); 2126 commoneventmanager.publish( 2127 'Sub_InputMethod_IME_ShowTextInput_0100', commonEventPublishData, this.publishCallback); 2128 }); 2129 } 2130 commonEventPublishData = { 2131 data: 'on_SUCCESS' 2132 }; 2133 commoneventmanager.publish('Sub_InputMethod_IME_ShowTextInput_0100', commonEventPublishData, this.publishCallback); 2134 } catch (error) { 2135 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0100 catch error: ' + JSON.stringify(error)); 2136 } 2137 } 2138 2139 private async Sub_InputMethod_IME_ShowTextInput_0200(): Promise<void> { 2140 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0200 data'); 2141 let commonEventPublishData = { 2142 data: 'FAILED' 2143 }; 2144 try { 2145 if (this.softKeyboardPanel !== null) { 2146 this.softKeyboardPanel.on('show', async () => { 2147 commonEventPublishData = { 2148 data: 'SUCCESS' 2149 }; 2150 this.softKeyboardPanel.off('show'); 2151 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0200 onShow error: '); 2152 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0200 Succeed onShow: '); 2153 commoneventmanager.publish( 2154 'Sub_InputMethod_IME_ShowTextInput_0200', commonEventPublishData, this.publishCallback); 2155 }); 2156 } 2157 commonEventPublishData = { 2158 data: 'on_SUCCESS' 2159 }; 2160 commoneventmanager.publish('Sub_InputMethod_IME_ShowTextInput_0200', commonEventPublishData, this.publishCallback); 2161 } catch (error) { 2162 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0200 catch error: ' + JSON.stringify(error)); 2163 } 2164 } 2165 2166 private async Sub_InputMethod_IME_ShowTextInput_0300(): Promise<void> { 2167 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0300 data'); 2168 let commonEventPublishData = { 2169 data: 'FAILED' 2170 }; 2171 try { 2172 if (this.softKeyboardPanel !== null) { 2173 this.softKeyboardPanel.on('show', async () => { 2174 commonEventPublishData = { 2175 data: 'SUCCESS' 2176 }; 2177 this.softKeyboardPanel.off('show'); 2178 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0300 onShow error: '); 2179 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0300 Succeed onShow: '); 2180 commoneventmanager.publish( 2181 'Sub_InputMethod_IME_ShowTextInput_0300', commonEventPublishData, this.publishCallback); 2182 }); 2183 } 2184 commonEventPublishData = { 2185 data: 'on_SUCCESS' 2186 }; 2187 commoneventmanager.publish('Sub_InputMethod_IME_ShowTextInput_0300', commonEventPublishData, this.publishCallback); 2188 } catch (error) { 2189 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0300 catch error: ' + JSON.stringify(error)); 2190 } 2191 } 2192 2193 private async Sub_InputMethod_IME_ShowTextInput_0400(): Promise<void> { 2194 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0400 data'); 2195 let commonEventPublishData = { 2196 data: 'FAILED' 2197 }; 2198 try { 2199 if (this.softKeyboardPanel !== null) { 2200 this.softKeyboardPanel.on('show', async () => { 2201 commonEventPublishData = { 2202 data: 'SUCCESS' 2203 }; 2204 this.softKeyboardPanel.off('show'); 2205 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0400 onShow error: '); 2206 console.info(TAG + '====>Sub_InputMethod_IME_ShowTextInput_0400 Succeed onShow: '); 2207 commoneventmanager.publish( 2208 'Sub_InputMethod_IME_ShowTextInput_0400', commonEventPublishData, this.publishCallback); 2209 }); 2210 } 2211 commonEventPublishData = { 2212 data: 'on_SUCCESS' 2213 }; 2214 commoneventmanager.publish('Sub_InputMethod_IME_ShowTextInput_0400', commonEventPublishData, this.publishCallback); 2215 } catch (error) { 2216 console.info(TAG + '====>receive Sub_InputMethod_IME_ShowTextInput_0400 catch error: ' + JSON.stringify(error)); 2217 } 2218 } 2219 2220 private async Sub_InputMethod_IME_FullScreenAbnormal_0100(): Promise<void> { 2221 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0100 data'); 2222 let commonEventPublishData = { 2223 data: 'FAILED' 2224 }; 2225 try { 2226 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2227 portraitRect: { left: 0, top: 0, width: this.display_info.width, height: this.display_info.height*0.5}, 2228 landscapeAvoidY: 500, 2229 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2230 portraitAvoidY: 1960, 2231 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2232 }; 2233 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2234 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 success '); 2235 } catch (err) { 2236 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 cathch err: ' + JSON.stringify(err)); 2237 if (err.code === 401) { 2238 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0100 Failed to adjustPanelRect err is ' + err); 2239 commonEventPublishData = { 2240 data: 'SUCCESS' 2241 }; 2242 } 2243 }; 2244 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0100', commonEventPublishData, this.publishCallback); 2245 } 2246 2247 private async Sub_InputMethod_IME_FullScreenAbnormal_0200(): Promise<void> { 2248 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0200 data'); 2249 let commonEventPublishData = { 2250 data: 'FAILED' 2251 }; 2252 try { 2253 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2254 landscapeRect: { left: 0, top: 0, width: this.display_info.height, height: this.display_info.width * 0.5}, 2255 landscapeAvoidY: 500, 2256 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2257 portraitAvoidY: 1950, 2258 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2259 fullScreenMode:false 2260 }; 2261 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2262 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 success '); 2263 } catch (err) { 2264 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 cathch err: ' + JSON.stringify(err)); 2265 if (err.code === 401) { 2266 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0200 Failed to adjustPanelRect err is ' + err); 2267 commonEventPublishData = { 2268 data: 'SUCCESS' 2269 }; 2270 } 2271 }; 2272 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0200', commonEventPublishData, this.publishCallback); 2273 } 2274 2275 private async Sub_InputMethod_IME_FullScreenAbnormal_0500(): Promise<void> { 2276 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0500 data'); 2277 let commonEventPublishData = { 2278 data: 'FAILED' 2279 }; 2280 try { 2281 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2282 landscapeRect: { left: 0, top: 3000, width: this.display_info.height + 2000, height: this.display_info.width + 2000}, 2283 portraitRect: { left: 0, top: 3000, width: this.display_info.width + 2000, height: this.display_info.height + 2000}, 2284 landscapeAvoidY: 500, 2285 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2286 portraitAvoidY: 1950, 2287 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2288 fullScreenMode:false 2289 }; 2290 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2291 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 success '); 2292 } catch (err) { 2293 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 cathch err: ' + JSON.stringify(err)); 2294 if (err.code === 401) { 2295 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0500 Failed to adjustPanelRect err is ' + err); 2296 commonEventPublishData = { 2297 data: 'SUCCESS' 2298 }; 2299 } 2300 }; 2301 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0500', commonEventPublishData, this.publishCallback); 2302 } 2303 2304 private async Sub_InputMethod_IME_FullScreenAbnormal_0400(): Promise<void> { 2305 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0400 data'); 2306 let commonEventPublishData = { 2307 data: 'FAILED' 2308 }; 2309 try { 2310 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2311 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2312 portraitRect: { left: 0, top: 1500, width: 300, height: 1000}, 2313 landscapeAvoidY: 500, 2314 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}, { left: 0, top: 247, width: this.display_info.height, height: 150}, { left: 0, top: 247, width: this.display_info.height, height: 150}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2315 portraitAvoidY: 1950, 2316 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2317 fullScreenMode:true 2318 }; 2319 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2320 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 success '); 2321 } catch (err) { 2322 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 cathch err: ' + JSON.stringify(err)); 2323 if (err.code === 401) { 2324 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0400 Failed to adjustPanelRect err is ' + err); 2325 commonEventPublishData = { 2326 data: 'SUCCESS' 2327 }; 2328 } 2329 }; 2330 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0400', commonEventPublishData, this.publishCallback); 2331 } 2332 2333 private async Sub_InputMethod_IME_FullScreenAbnormal_0300(): Promise<void> { 2334 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0300 data'); 2335 let commonEventPublishData = { 2336 data: 'FAILED' 2337 }; 2338 try { 2339 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2340 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2341 portraitRect: { left: 0, top: 800, width: 300, height: 800}, 2342 landscapeAvoidY: 500, 2343 landscapeInputRegion:[], 2344 portraitAvoidY: 1950, 2345 portraitInputRegion: [], 2346 fullScreenMode:true 2347 }; 2348 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2349 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 success '); 2350 } catch (err) { 2351 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 cathch err: ' + JSON.stringify(err)); 2352 if (err.code === 401) { 2353 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0300 Failed to adjustPanelRect err is ' + err); 2354 commonEventPublishData = { 2355 data: 'SUCCESS' 2356 }; 2357 } 2358 }; 2359 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0300', commonEventPublishData, this.publishCallback); 2360 } 2361 2362 private async Sub_InputMethod_IME_FullScreenAbnormal_1200(): Promise<void> { 2363 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_1200 data'); 2364 let commonEventPublishData = { 2365 data: 'FAILED' 2366 }; 2367 try { 2368 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2369 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2370 portraitRect: { left: 0, top: 1500, width: 300, height: 1000}, 2371 landscapeAvoidY: 500, 2372 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2373 portraitAvoidY: 1950, 2374 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2375 fullScreenMode:true 2376 }; 2377 this.softKeyboardPanel.adjustPanelRect(2, enhancedPanelRect); 2378 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 success '); 2379 } catch (err) { 2380 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 cathch err: ' + JSON.stringify(err)); 2381 if (err.code === 12800017) { 2382 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1200 Failed to adjustPanelRect err is ' + err); 2383 commonEventPublishData = { 2384 data: 'SUCCESS' 2385 }; 2386 } 2387 }; 2388 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_1200', commonEventPublishData, this.publishCallback); 2389 } 2390 2391 private async Sub_InputMethod_IME_FullScreenAbnormal_0700(): Promise<void> { 2392 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0700 data'); 2393 let commonEventPublishData = { 2394 data: 'FAILED' 2395 }; 2396 try { 2397 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2398 landscapeRect: { left: 0, top: 500, width: 400, height: this.display_info.width}, 2399 portraitRect: { left: 0, top: 1500, width: 300, height: this.display_info.height}, 2400 landscapeAvoidY: 20, 2401 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2402 portraitAvoidY: 20, 2403 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2404 fullScreenMode:false 2405 }; 2406 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2407 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 success '); 2408 } catch (err) { 2409 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 cathch err: ' + JSON.stringify(err)); 2410 if (err.code === 401) { 2411 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0700 Failed to adjustPanelRect err is ' + err); 2412 commonEventPublishData = { 2413 data: 'SUCCESS' 2414 }; 2415 } 2416 }; 2417 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0700', commonEventPublishData, this.publishCallback); 2418 } 2419 2420 private async Sub_InputMethod_IME_FullScreenAbnormal_0600(): Promise<void> { 2421 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0600 data'); 2422 let commonEventPublishData = { 2423 data: 'FAILED' 2424 }; 2425 try { 2426 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2427 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2428 portraitRect: { left: 0, top: 1500, width: 300, height: 2100}, 2429 landscapeAvoidY: 20, 2430 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2431 portraitAvoidY: 20, 2432 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}, { left: 0, top: 1695, width: this.display_info.width, height: 150}], 2433 fullScreenMode:true 2434 }; 2435 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2436 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 success '); 2437 } catch (err) { 2438 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 cathch err: ' + JSON.stringify(err)); 2439 if (err.code === 401) { 2440 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0600 Failed to adjustPanelRect err is ' + err); 2441 commonEventPublishData = { 2442 data: 'SUCCESS' 2443 }; 2444 } 2445 }; 2446 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0600', commonEventPublishData, this.publishCallback); 2447 } 2448 2449 private async Sub_InputMethod_IME_FullScreenAbnormal_0800(): Promise<void> { 2450 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0800 data'); 2451 let commonEventPublishData = { 2452 data: 'FAILED' 2453 }; 2454 try { 2455 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2456 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2457 portraitRect: { left: 0, top: 1500, width: 300, height: 300}, 2458 landscapeAvoidY: -1, 2459 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}], 2460 portraitAvoidY: -1, 2461 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}], 2462 fullScreenMode:true 2463 }; 2464 this.softKeyboardPanel.adjustPanelRect(1, enhancedPanelRect); 2465 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 success '); 2466 } catch (err) { 2467 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 cathch err: ' + JSON.stringify(err)); 2468 if (err.code === 401) { 2469 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0800 Failed to adjustPanelRect err is ' + err); 2470 commonEventPublishData = { 2471 data: 'SUCCESS' 2472 }; 2473 } 2474 }; 2475 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0800', commonEventPublishData, this.publishCallback); 2476 } 2477 2478 private async Sub_InputMethod_IME_FullScreenAbnormal_0900(): Promise<void> { 2479 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_0900 data'); 2480 let commonEventPublishData = { 2481 data: 'FAILED' 2482 }; 2483 try { 2484 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2485 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2486 portraitRect: { left: 0, top: 1500, width: 300, height: 300}, 2487 landscapeAvoidY: -1, 2488 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}], 2489 portraitAvoidY: -1, 2490 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}], 2491 fullScreenMode:false 2492 }; 2493 this.softKeyboardPanel.adjustPanelRect(1, enhancedPanelRect); 2494 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 success '); 2495 } catch (err) { 2496 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 cathch err: ' + JSON.stringify(err)); 2497 if (err.code === 401) { 2498 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_0900 Failed to adjustPanelRect err is ' + err); 2499 commonEventPublishData = { 2500 data: 'SUCCESS' 2501 }; 2502 } 2503 }; 2504 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_0900', commonEventPublishData, this.publishCallback); 2505 } 2506 2507 private async Sub_InputMethod_IME_FullScreenAbnormal_1000(): Promise<void> { 2508 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_1000 data'); 2509 let commonEventPublishData = { 2510 data: 'FAILED' 2511 }; 2512 try { 2513 let enhancedPanelRect: inputMethodEngine.EnhancedPanelRect = { 2514 landscapeRect: { left: 0, top: 500, width: 400, height: 300}, 2515 portraitRect: { left: 0, top: 1500, width: 300, height: 1000}, 2516 landscapeAvoidY: 500, 2517 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}, { left: 0, top: 247, width: this.display_info.height, height: 150}], 2518 portraitAvoidY: 1200, 2519 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760},{ left: 0, top: 1695, width: this.display_info.width, height: 150}], 2520 fullScreenMode:false 2521 }; 2522 this.softKeyboardPanel.adjustPanelRect(0, enhancedPanelRect); 2523 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 success '); 2524 } catch (err) { 2525 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 cathch err: ' + JSON.stringify(err)); 2526 if (err.code === 401) { 2527 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1000 Failed to adjustPanelRect err is ' + err); 2528 commonEventPublishData = { 2529 data: 'SUCCESS' 2530 }; 2531 } 2532 }; 2533 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_1000', commonEventPublishData, this.publishCallback); 2534 } 2535 2536 private async Sub_InputMethod_IME_FullScreenUR_0200(): Promise<void> { 2537 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0200 data'); 2538 let commonEventPublishData = { 2539 data: 'FAILED' 2540 }; 2541 try { 2542 this.softKeyboardPanel.changeFlag(2) 2543 this.softKeyboardPanel.updateRegion([{ left: 320, top: 650, width: this.display_info.width, height: 500}]); 2544 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 success '); 2545 } catch (err) { 2546 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 cathch err: ' + JSON.stringify(err)); 2547 if (err.code === 12800017) { 2548 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0200 Failed to adjustPanelRect err is ' + err); 2549 commonEventPublishData = { 2550 data: 'SUCCESS' 2551 }; 2552 this.softKeyboardPanel.changeFlag(0); 2553 } 2554 }; 2555 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenUR_0200', commonEventPublishData, this.publishCallback); 2556 } 2557 2558 private async Sub_InputMethod_IME_FullScreenUR_0300(): Promise<void> { 2559 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0300 data'); 2560 let commonEventPublishData = { 2561 data: 'FAILED' 2562 }; 2563 try { 2564 this.softKeyboardPanel.updateRegion([]); 2565 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 success '); 2566 } catch (err) { 2567 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 cathch err: ' + JSON.stringify(err)); 2568 if (err.code === 401) { 2569 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0300 Failed to adjustPanelRect err is ' + err); 2570 commonEventPublishData = { 2571 data: 'SUCCESS' 2572 }; 2573 } 2574 }; 2575 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenUR_0300', commonEventPublishData, this.publishCallback); 2576 } 2577 2578 private async Sub_InputMethod_IME_FullScreenUR_0400(): Promise<void> { 2579 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0400 data'); 2580 let commonEventPublishData = { 2581 data: 'FAILED' 2582 }; 2583 try{ 2584 this.softKeyboardPanel.updateRegion([{ left: 320, top: 650, width: this.display_info.width, height: 500}, { left: 320, top: 650, width: this.display_info.width, height: 500}, { left: 320, top: 650, width: this.display_info.width, height: 500}, { left: 320, top: 650, width: this.display_info.width, height: 500}, { left: 320, top: 650, width: this.display_info.width, height: 500}]); 2585 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 success '); 2586 } catch (err) { 2587 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 cathch err: ' + JSON.stringify(err)); 2588 if (err.code === 401) { 2589 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0400 Failed to adjustPanelRect err is ' + err); 2590 commonEventPublishData = { 2591 data: 'SUCCESS' 2592 }; 2593 } 2594 }; 2595 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenUR_0400', commonEventPublishData, this.publishCallback); 2596 } 2597 2598 private async Sub_InputMethod_IME_FullScreenUR_0700(): Promise<void> { 2599 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0700 data'); 2600 let commonEventPublishData = { 2601 data: 'FAILED' 2602 }; 2603 try { 2604 this.softKeyboardPanel.updateRegion([{ left: -1, top: -1, width: this.display_info.width + 3000, height: this.display_info.height + 3000}]); 2605 commonEventPublishData = { 2606 data: 'SUCCESS' 2607 }; 2608 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0700 success '); 2609 } catch (err) { 2610 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0700 cathch err: ' + JSON.stringify(err)); 2611 }; 2612 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenUR_0700', commonEventPublishData, this.publishCallback); 2613 } 2614 2615 private async Sub_InputMethod_IME_FullScreenAbnormal_1100(): Promise<void> { 2616 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenAbnormal_1100 data'); 2617 let commonEventPublishData = { 2618 data: 'FAILED' 2619 }; 2620 try{ 2621 let panelInfo1:inputMethodEngine.PanelInfo = { 2622 type: inputMethodEngine.PanelType.STATUS_BAR, 2623 }; 2624 let inputPanel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 2625 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 creatPanel Succeed.'); 2626 let enhancedPanelRect:inputMethodEngine.EnhancedPanelRect = { 2627 landscapeRect: { left: 0, top: 500, width: 400, height: 500}, 2628 portraitRect: { left: 0, top: 1500, width: 300, height: 300}, 2629 landscapeAvoidY: 500, 2630 landscapeInputRegion:[{ left: 0, top: 500, width: this.display_info.height, height: 600}], 2631 portraitAvoidY: 1000, 2632 portraitInputRegion: [{ left: 0, top: 1960, width: this.display_info.width, height: 760}], 2633 fullScreenMode:true 2634 }; 2635 try { 2636 inputPanel.adjustPanelRect(0, enhancedPanelRect); 2637 } catch (err) { 2638 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 cathch err: ' + err); 2639 if (err.code === 12800017) { 2640 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 Failed to adjustPanelRect err is ' + err); 2641 commonEventPublishData = { 2642 data: 'SUCCESS' 2643 }; 2644 await inputMethodAbility.destroyPanel(inputPanel); 2645 } 2646 }; 2647 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 success '); 2648 } catch (err) { 2649 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenAbnormal_1100 cathch err: ' + JSON.stringify(err)); 2650 } 2651 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenAbnormal_1100', commonEventPublishData, this.publishCallback); 2652 } 2653 2654 private async Sub_InputMethod_IME_FullScreenUR_0100(): Promise<void> { 2655 console.info(TAG + '====>receive Sub_InputMethod_IME_FullScreenUR_0100 data'); 2656 let commonEventPublishData = { 2657 data: 'FAILED' 2658 }; 2659 try { 2660 let panelInfo1:inputMethodEngine.PanelInfo = { 2661 type: inputMethodEngine.PanelType.STATUS_BAR, 2662 }; 2663 let inputPanel = await inputMethodAbility.createPanel(this.mContext,panelInfo1); 2664 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 creatPanel Succeed.'); 2665 try{ 2666 inputPanel.updateRegion([{ left: this.display_info.width*0.3, top: this.display_info.height * 0.5, width: this.display_info.width, height: this.display_info.height * 0.5}]); 2667 } catch (err) { 2668 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 cathch err: ' + err); 2669 if (err.code === 12800017) { 2670 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 Failed to adjustPanelRect err is ' + err); 2671 commonEventPublishData = { 2672 data: 'SUCCESS' 2673 }; 2674 await inputMethodAbility.destroyPanel(inputPanel); 2675 } 2676 }; 2677 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 success '); 2678 } catch (err) { 2679 console.info(TAG + '====>Sub_InputMethod_IME_FullScreenUR_0100 cathch err: ' + JSON.stringify(err)); 2680 }; 2681 commoneventmanager.publish('Sub_InputMethod_IME_FullScreenUR_0100', commonEventPublishData, this.publishCallback); 2682 } 2683 2684 private async Sub_InputMethod_IME_Immersive_0900(): Promise<void> { 2685 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_0900 data'); 2686 let commonEventPublishData = { 2687 data: 'FAILED' 2688 }; 2689 try { 2690 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.NONE_IMMERSIVE); 2691 let mode = this.softKeyboardPanel.getImmersiveMode(); 2692 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0900 ImmersiveMode :' + JSON.stringify(mode)); 2693 if (mode == 0) { 2694 commonEventPublishData = { 2695 data: 'SUCCESS' 2696 } 2697 }; 2698 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0900 success '); 2699 } catch (err) { 2700 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0900 cathch err: ' + JSON.stringify(err)); 2701 }; 2702 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_0900', commonEventPublishData, this.publishCallback); 2703 } 2704 2705 private async Sub_InputMethod_IME_Immersive_1000(): Promise<void> { 2706 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_1000 data'); 2707 let commonEventPublishData = { 2708 data: 'FAILED' 2709 }; 2710 try { 2711 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 2712 let mode = this.softKeyboardPanel.getImmersiveMode(); 2713 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1000 ImmersiveMode :' + JSON.stringify(mode)); 2714 if (mode == 2) { 2715 commonEventPublishData = { 2716 data: 'SUCCESS' 2717 } 2718 }; 2719 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1000 success '); 2720 } catch (err) { 2721 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1000 cathch err: ' + JSON.stringify(err)); 2722 }; 2723 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_1000', commonEventPublishData, this.publishCallback); 2724 } 2725 2726 private async Sub_InputMethod_IME_Immersive_1100(): Promise<void> { 2727 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_1100 data'); 2728 let commonEventPublishData = { 2729 data: 'FAILED' 2730 }; 2731 try { 2732 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.DARK_IMMERSIVE); 2733 let mode = this.softKeyboardPanel.getImmersiveMode(); 2734 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1100 ImmersiveMode :' + JSON.stringify(mode)); 2735 if (mode == 3) { 2736 commonEventPublishData = { 2737 data: 'SUCCESS' 2738 } 2739 }; 2740 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1100 success '); 2741 } catch (err) { 2742 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1100 cathch err: ' + JSON.stringify(err)); 2743 }; 2744 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_1100', commonEventPublishData, this.publishCallback); 2745 } 2746 2747 private async Sub_InputMethod_IME_Immersive_1200(): Promise<void> { 2748 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_1200 data'); 2749 let commonEventPublishData = { 2750 data: 'FAILED' 2751 }; 2752 inputmethodengine.getKeyboardDelegate().on('editorAttributeChanged', (attr:inputMethodEngine.EditorAttribute) => { 2753 console.info(TAG + `====>on_EditorAttribute_callback = ${JSON.stringify(attr)} immersiveMode = ${attr.immersiveMode} gradientMode = ${attr.gradientMode}`); 2754 this.immersive = attr.immersiveMode; 2755 inputmethodengine.getKeyboardDelegate().off('editorAttributeChanged'); 2756 }); 2757 try { 2758 let t = setTimeout(() => { 2759 clearTimeout(t); 2760 let mode = this.immersive; 2761 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1200 ImmersiveMode :' + JSON.stringify(mode)); 2762 if (mode == 2) { 2763 commonEventPublishData = { 2764 data: 'SUCCESS' 2765 } 2766 }; 2767 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1200 success '); 2768 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_1200', commonEventPublishData, this.publishCallback); 2769 }, 500) 2770 } catch (err) { 2771 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_1200 cathch err: ' + JSON.stringify(err)); 2772 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_1200', commonEventPublishData, this.publishCallback); 2773 } 2774 } 2775 2776 private async Sub_InputMethod_IME_Immersive_0500(): Promise<void> { 2777 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_0500 data'); 2778 let commonEventPublishData = { 2779 data: 'FAILED' 2780 }; 2781 try { 2782 try { 2783 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.IMMERSIVE); 2784 } catch (err) { 2785 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 setImmersiveMode err: ' + JSON.stringify(err)); 2786 if (err.code === 401) { 2787 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 setImmersiveMode err: ' + err); 2788 commonEventPublishData = { 2789 data: 'SUCCESS' 2790 }; 2791 } 2792 }; 2793 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 success '); 2794 } catch (err) { 2795 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0500 cathch err: ' + JSON.stringify(err)); 2796 }; 2797 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_0500', commonEventPublishData, this.publishCallback); 2798 } 2799 2800 private Sub_Misc_inputMethod_Panel_createPanelCallback_0011(): void { 2801 let commonEventPublishData; 2802 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0011 success'); 2803 try { 2804 inputMethodAbility.createPanel(this.mContext, undefined, async (err, panel) => { 2805 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0011 createPanel'); 2806 if (err) { 2807 commonEventPublishData = { 2808 data: 'SUCCESS' 2809 }; 2810 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0011 createPanel error: ' + JSON.stringify(err)); 2811 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0011', commonEventPublishData, this.publishCallback); 2812 } else { 2813 commonEventPublishData = { 2814 data: 'FAILED' 2815 }; 2816 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelCallback_0011 Succeed in creating panel.' + JSON.stringify(panel)); 2817 } 2818 await inputMethodAbility.destroyPanel(panel); 2819 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0011', commonEventPublishData, this.publishCallback); 2820 }); 2821 } catch (error) { 2822 if (error.code === 401) { 2823 commonEventPublishData = { 2824 data: 'SUCCESS' 2825 }; 2826 }; 2827 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0011 catch error: ' + JSON.stringify(error)); 2828 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelCallback_0011', commonEventPublishData, this.publishCallback); 2829 } 2830 } 2831 2832 private Sub_Misc_inputMethod_Panel_createPanelPromise_0021(): void { 2833 let commonEventPublishData; 2834 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0021 success'); 2835 try { 2836 inputMethodAbility.createPanel(this.mContext, undefined).then(async (panel) => { 2837 commonEventPublishData = { 2838 data: 'FAILED' 2839 }; 2840 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_createPanelPromise_0021 Succeed in creating panel.' + JSON.stringify(panel)); 2841 await inputMethodAbility.destroyPanel(panel); 2842 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0021', commonEventPublishData, this.publishCallback); 2843 }).catch(async (err) => { 2844 commonEventPublishData = { 2845 data: 'SUCCESS' 2846 }; 2847 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0021 createPanel error: ' + JSON.stringify(err)); 2848 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0021', commonEventPublishData, this.publishCallback); 2849 }); 2850 } catch (error) { 2851 if (error.code === 401) { 2852 commonEventPublishData = { 2853 data: 'SUCCESS' 2854 }; 2855 }; 2856 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0021 catch error: ' + JSON.stringify(error)); 2857 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_createPanelPromise_0021', commonEventPublishData, this.publishCallback); 2858 } 2859 } 2860 2861 private async Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031(): Promise<void> { 2862 let commonEventPublishData; 2863 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031 success'); 2864 try { 2865 inputMethodAbility.destroyPanel(undefined, async (err, panel) => { 2866 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031 destroyPanel'); 2867 if (err) { 2868 commonEventPublishData = { 2869 data: 'SUCCESS' 2870 }; 2871 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031 destroyPanel error: ' + JSON.stringify(err)); 2872 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031', commonEventPublishData, this.publishCallback); 2873 } else { 2874 commonEventPublishData = { 2875 data: 'FAILED' 2876 }; 2877 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031 Succeed in destroying panel.' + JSON.stringify(panel)); 2878 }; 2879 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031', commonEventPublishData, this.publishCallback); 2880 }); 2881 } catch (error) { 2882 if (error.code === 401) { 2883 commonEventPublishData = { 2884 data: 'SUCCESS' 2885 }; 2886 }; 2887 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031 catch error: ' + JSON.stringify(error)); 2888 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelCallback_0031', commonEventPublishData, this.publishCallback); 2889 } 2890 } 2891 2892 private async Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041(): Promise<void> { 2893 let commonEventPublishData; 2894 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041 success'); 2895 try { 2896 let panel = await inputMethodAbility.createPanel(this.mContext, undefined); 2897 inputMethodAbility.destroyPanel(panel).then(async () => { 2898 commonEventPublishData = { 2899 data: 'FAILED' 2900 }; 2901 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041 Succeed in destroyPanel panel.' + JSON.stringify(panel)); 2902 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041', commonEventPublishData, this.publishCallback); 2903 }).catch(async (err) => { 2904 commonEventPublishData = { 2905 data: 'SUCCESS' 2906 }; 2907 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041 destroyPanel error: ' + JSON.stringify(err)); 2908 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041', commonEventPublishData, this.publishCallback); 2909 }); 2910 } catch (error) { 2911 if (error.code === 401) { 2912 commonEventPublishData = { 2913 data: 'SUCCESS' 2914 }; 2915 }; 2916 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041 catch error: ' + JSON.stringify(error)); 2917 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_destroyPanelPromise_0041', commonEventPublishData, this.publishCallback); 2918 } 2919 } 2920 2921 private Sub_Misc_inputMethod_Panel_setUiContentCallback_0051(): void { 2922 let commonEventPublishData; 2923 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0051 success'); 2924 try { 2925 this.softKeyboardPanel.setUiContent(undefined, async (err, data) => { 2926 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0051 setUiContent'); 2927 if (err) { 2928 commonEventPublishData = { 2929 data: 'SUCCESS' 2930 }; 2931 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0051 setUiContent error: ' + JSON.stringify(err)); 2932 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0051', commonEventPublishData, this.publishCallback); 2933 } else { 2934 commonEventPublishData = { 2935 data: 'FAILED' 2936 }; 2937 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0051 Succeed setUiContent: ' + JSON.stringify(data)); 2938 }; 2939 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0051', commonEventPublishData, this.publishCallback); 2940 }); 2941 } catch (error) { 2942 if (error.code === 401) { 2943 commonEventPublishData = { 2944 data: 'SUCCESS' 2945 }; 2946 }; 2947 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0051 catch error: ' + JSON.stringify(error)); 2948 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0051', commonEventPublishData, this.publishCallback); 2949 } 2950 } 2951 2952 private Sub_Misc_inputMethod_Panel_setUiContentPromise_0061(): void { 2953 let commonEventPublishData; 2954 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0061 success'); 2955 try { 2956 this.softKeyboardPanel.setUiContent(undefined).then(async (data) => { 2957 commonEventPublishData = { 2958 data: 'FAILED' 2959 }; 2960 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0061 Succeed in setUiContent.' + JSON.stringify(data)); 2961 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0061', commonEventPublishData, this.publishCallback); 2962 }).catch(async (err) => { 2963 commonEventPublishData = { 2964 data: 'SUCCESS' 2965 }; 2966 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0061 setUiContent error: ' + JSON.stringify(err)); 2967 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0061', commonEventPublishData, this.publishCallback); 2968 }); 2969 } catch (error) { 2970 if (error.code === 401) { 2971 commonEventPublishData = { 2972 data: 'SUCCESS' 2973 }; 2974 } 2975 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0061 catch error: ' + JSON.stringify(error)); 2976 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0061', commonEventPublishData, this.publishCallback); 2977 } 2978 } 2979 2980 private Sub_Misc_inputMethod_Panel_setUiContentCallback_0071(): void { 2981 let commonEventPublishData; 2982 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0071 success'); 2983 try { 2984 this.softKeyboardPanel.setUiContent(undefined, this.storage, async (err, data) => { 2985 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0071 setUiContent'); 2986 if (err) { 2987 commonEventPublishData = { 2988 data: 'SUCCESS' 2989 }; 2990 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0071 setUiContent error: ' + JSON.stringify(err)); 2991 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0071', commonEventPublishData, this.publishCallback); 2992 } else { 2993 commonEventPublishData = { 2994 data: 'FAILED' 2995 }; 2996 console.info(TAG + 'Sub_Misc_inputMethod_Panel_setUiContentCallback_0071 Succeed setUiContent: ' + JSON.stringify(data)); 2997 }; 2998 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0071', commonEventPublishData, this.publishCallback); 2999 }); 3000 } catch (error) { 3001 if (error.code === 401) { 3002 commonEventPublishData = { 3003 data: 'SUCCESS' 3004 }; 3005 }; 3006 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0071 catch error: ' + JSON.stringify(error)); 3007 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentCallback_0071', commonEventPublishData, this.publishCallback); 3008 } 3009 } 3010 3011 private Sub_Misc_inputMethod_Panel_setUiContentPromise_0081(): void { 3012 let commonEventPublishData; 3013 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0081 success'); 3014 try { 3015 this.softKeyboardPanel.setUiContent(undefined, this.storage).then(async (data) => { 3016 commonEventPublishData = { 3017 data: 'FAILED' 3018 }; 3019 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0081 Succeed in setUiContent: ' + JSON.stringify(data)); 3020 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0081', commonEventPublishData, this.publishCallback); 3021 }).catch(async (err) => { 3022 commonEventPublishData = { 3023 data: 'SUCCESS' 3024 }; 3025 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0081 setUiContent error: ' + JSON.stringify(err)); 3026 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0081', commonEventPublishData, this.publishCallback); 3027 }); 3028 } catch (error) { 3029 if (error.code === 401) { 3030 commonEventPublishData = { 3031 data: 'SUCCESS' 3032 }; 3033 }; 3034 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0081 catch error: ' + JSON.stringify(error)); 3035 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_setUiContentPromise_0081', commonEventPublishData, this.publishCallback); 3036 } 3037 } 3038 3039 private Sub_Misc_inputMethod_Panel_resizeCallback_0091(): void { 3040 let commonEventPublishData; 3041 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0091 success'); 3042 try { 3043 this.softKeyboardPanel.resize(undefined, undefined, async (err, data) => { 3044 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0091 resize'); 3045 if (err) { 3046 commonEventPublishData = { 3047 data: 'SUCCESS' 3048 }; 3049 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0091 resize error: ' + JSON.stringify(err)); 3050 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0091', commonEventPublishData, this.publishCallback); 3051 } else { 3052 commonEventPublishData = { 3053 data: 'FAILED' 3054 }; 3055 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_resizeCallback_0091 Succeeded in changing the panel size: ' + JSON.stringify(data)); 3056 } 3057 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0091', commonEventPublishData, this.publishCallback); 3058 }); 3059 } catch (error) { 3060 if (error.code === 401) { 3061 commonEventPublishData = { 3062 data: 'SUCCESS' 3063 }; 3064 } 3065 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0091 catch error: ' + JSON.stringify(error)); 3066 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizeCallback_0091', commonEventPublishData, this.publishCallback); 3067 } 3068 } 3069 3070 private Sub_Misc_inputMethod_Panel_resizePromise_0101(): void { 3071 let commonEventPublishData; 3072 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0101 success'); 3073 try { 3074 this.softKeyboardPanel.resize(undefined, undefined).then(async (data) => { 3075 commonEventPublishData = { 3076 data: 'FAILED' 3077 }; 3078 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_resizePromise_0101 Succeed in changing the panel size: ' + JSON.stringify(data)); 3079 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0101', commonEventPublishData, this.publishCallback); 3080 }).catch(async (err) => { 3081 commonEventPublishData = { 3082 data: 'SUCCESS' 3083 }; 3084 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0101 resize error: ' + JSON.stringify(err)); 3085 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0101', commonEventPublishData, this.publishCallback); 3086 }); 3087 } catch (error) { 3088 if (error.code === 401) { 3089 commonEventPublishData = { 3090 data: 'SUCCESS' 3091 }; 3092 }; 3093 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_resizePromise_0101 catch error: ' + JSON.stringify(error)); 3094 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_resizePromise_0101', commonEventPublishData, this.publishCallback); 3095 } 3096 } 3097 3098 private Sub_Misc_inputMethod_Panel_moveToCallback_0111(): void { 3099 let commonEventPublishData; 3100 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0111 success'); 3101 try { 3102 this.softKeyboardPanel.moveTo(undefined, undefined, async (err, data) => { 3103 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0111 moveTo'); 3104 if (err) { 3105 commonEventPublishData = { 3106 data: 'SUCCESS' 3107 }; 3108 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0111 moveTo error: ' + JSON.stringify(err)); 3109 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0111', commonEventPublishData, this.publishCallback); 3110 } else { 3111 commonEventPublishData = { 3112 data: 'FAILED' 3113 }; 3114 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_moveToCallback_0111 Succeed in moving the panel: ' + JSON.stringify(data)); 3115 } 3116 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0111', commonEventPublishData, this.publishCallback); 3117 }); 3118 } catch (error) { 3119 if (error.code === 401) { 3120 commonEventPublishData = { 3121 data: 'SUCCESS' 3122 }; 3123 } 3124 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0111 catch error: ' + JSON.stringify(error)); 3125 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToCallback_0111', commonEventPublishData, this.publishCallback); 3126 } 3127 } 3128 3129 private Sub_Misc_inputMethod_Panel_moveToPromise_0121(): void { 3130 let commonEventPublishData; 3131 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0121 success'); 3132 try { 3133 this.softKeyboardPanel.moveTo(undefined, undefined).then(async (data) => { 3134 commonEventPublishData = { 3135 data: 'FAILED' 3136 }; 3137 console.info(TAG + '====>Sub_Misc_inputMethod_Panel_moveToPromise_0121 Succeed in moving the panel: ' + JSON.stringify(data)); 3138 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0121', commonEventPublishData, this.publishCallback); 3139 }).catch(async (err) => { 3140 commonEventPublishData = { 3141 data: 'SUCCESS' 3142 }; 3143 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0121 moveTo error: ' + JSON.stringify(err)); 3144 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0121', commonEventPublishData, this.publishCallback); 3145 }); 3146 } catch (error) { 3147 if (error.code === 401) { 3148 commonEventPublishData = { 3149 data: 'SUCCESS' 3150 }; 3151 }; 3152 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0121 catch error: ' + JSON.stringify(error)); 3153 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_moveToPromise_0121', commonEventPublishData, this.publishCallback); 3154 } 3155 } 3156 3157 private Sub_Misc_inputMethod_Panel_changeFlag_0212(): void { 3158 let commonEventPublishData = { 3159 data: 'FAILED' 3160 }; 3161 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0212 start'); 3162 try { 3163 this.softKeyboardPanel.changeFlag(undefined); 3164 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0212 success'); 3165 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0212', commonEventPublishData, this.publishCallback); 3166 } catch (error) { 3167 if (error.code === 401) { 3168 commonEventPublishData = { 3169 data: 'SUCCESS' 3170 }; 3171 }; 3172 console.info(TAG + '====>receive Sub_Misc_inputMethod_Panel_changeFlag_0212 catch error: ' + JSON.stringify(error)); 3173 commoneventmanager.publish('Sub_Misc_inputMethod_Panel_changeFlag_0212', commonEventPublishData, this.publishCallback); 3174 } 3175 } 3176 3177 private async Sub_InputMethod_IME_ScreenRotation_0101(): Promise<void> { 3178 console.info(TAG + '====>receive Sub_InputMethod_IME_ScreenRotation_0101 data'); 3179 let commonEventPublishData = { 3180 data: 'FAILED' 3181 }; 3182 try { 3183 let keyboardRect: inputMethodEngine.PanelRect = { 3184 landscapeRect: { left: 100, top: 100, width: this.display_info.width * 10, height: this.display_info.height * 10}, 3185 portraitRect: { left: 100, top: 100, width: this.display_info.height * 10, height: this.display_info.width * 10} 3186 }; 3187 this.softKeyboardPanel.adjustPanelRect(undefined, keyboardRect); 3188 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0101 startAbility success' ); 3189 } catch (err) { 3190 if (err.code === 401) { 3191 commonEventPublishData = { 3192 data: 'SUCCESS' 3193 }; 3194 }; 3195 console.info(TAG + '====>Sub_InputMethod_IME_ScreenRotation_0101 err: ' + JSON.stringify(err)); 3196 }; 3197 commoneventmanager.publish('Sub_InputMethod_IME_ScreenRotation_0101', commonEventPublishData, this.publishCallback); 3198 } 3199 3200 private async SUB_InputMethod_IsTextPreviewSupport_0101(): Promise<void> { 3201 console.info(TAG + '====>receive SUB_InputMethod_IsTextPreviewSupport_0101 data'); 3202 let commonEventPublishData = { 3203 data: 'FAILED' 3204 }; 3205 try { 3206 let range: inputMethodEngine.Range = { start: 0, end: 1 }; 3207 await this.InputClient.setPreviewText('adc|03', range); 3208 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0101 setPreviewText success:'); 3209 commonEventPublishData = { 3210 data: 'FAILED' 3211 3212 }; 3213 } catch (err) { 3214 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0101 setPreviewText catch err: ' + 3215 JSON.stringify(err)); 3216 if (err.code === 12800011) { 3217 commonEventPublishData = { 3218 data: 'SUCCESS' 3219 }; 3220 } 3221 }; 3222 commoneventmanager.publish('SUB_InputMethod_IsTextPreviewSupport_0101', commonEventPublishData, 3223 this.publishCallback); 3224 } 3225 3226 private async SUB_InputMethod_IsTextPreviewSupport_0201(): Promise<void> { 3227 console.info(TAG + '====>receive SUB_InputMethod_IsTextPreviewSupport_0201 data'); 3228 let commonEventPublishData = { 3229 data: 'FAILED' 3230 }; 3231 try { 3232 let range: inputMethodEngine.Range = { start: 0, end: 1 }; 3233 await this.InputClient.setPreviewTextSync('adc|03', range); 3234 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0201 setPreviewText success:'); 3235 commonEventPublishData = { 3236 data: 'FAILED' 3237 3238 }; 3239 } catch (err) { 3240 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0201 setPreviewText catch err: ' + 3241 JSON.stringify(err)); 3242 if (err.code === 12800011) { 3243 commonEventPublishData = { 3244 data: 'SUCCESS' 3245 }; 3246 } 3247 }; 3248 commoneventmanager.publish('SUB_InputMethod_IsTextPreviewSupport_0201', commonEventPublishData, 3249 this.publishCallback); 3250 } 3251 3252 private async SUB_InputMethod_IsTextPreviewSupport_0301(): Promise<void> { 3253 console.info(TAG + '====>receive SUB_InputMethod_IsTextPreviewSupport_0301 data'); 3254 let commonEventPublishData = { 3255 data: 'FAILED' 3256 }; 3257 try { 3258 await this.InputClient.finishTextPreview(); 3259 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0301 setPreviewText success:'); 3260 commonEventPublishData = { 3261 data: 'FAILED' 3262 3263 }; 3264 } catch (err) { 3265 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0301 setPreviewText catch err: ' + 3266 JSON.stringify(err)); 3267 if (err.code === 12800011) { 3268 commonEventPublishData = { 3269 data: 'SUCCESS' 3270 }; 3271 } 3272 }; 3273 commoneventmanager.publish('SUB_InputMethod_IsTextPreviewSupport_0301', commonEventPublishData, 3274 this.publishCallback); 3275 } 3276 3277 private async SUB_InputMethod_IsTextPreviewSupport_0401(): Promise<void> { 3278 console.info(TAG + '====>receive SUB_InputMethod_IsTextPreviewSupport_0401 data'); 3279 let commonEventPublishData = { 3280 data: 'FAILED' 3281 }; 3282 try { 3283 await this.InputClient.finishTextPreviewSync(); 3284 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0401 setPreviewText success:'); 3285 commonEventPublishData = { 3286 data: 'FAILED' 3287 3288 }; 3289 } catch (err) { 3290 console.info(TAG + '====>SUB_InputMethod_IsTextPreviewSupport_0401 setPreviewText catch err: ' + 3291 JSON.stringify(err)); 3292 if (err.code === 12800011) { 3293 commonEventPublishData = { 3294 data: 'SUCCESS' 3295 }; 3296 } 3297 }; 3298 commoneventmanager.publish('SUB_InputMethod_IsTextPreviewSupport_0401', commonEventPublishData, 3299 this.publishCallback); 3300 } 3301 3302 private async SUB_InputMethod_IME_SplitScreen_0101(): Promise<void> { 3303 let commonEventPublishData = { 3304 data: 'FAILED' 3305 }; 3306 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 start'); 3307 try { 3308 if (this.softKeyboardPanel !== null) { 3309 await inputMethodAbility.destroyPanel(this.softKeyboardPanel); 3310 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 this.softKeyboardPanel:' + this.softKeyboardPanel); 3311 try { 3312 let WindowInfo = await this.InputClient.getCallingWindowInfo(); 3313 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 getCallingWindowInfo WindowInfo: success'); 3314 } catch (err) { 3315 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 getCallingWindowInfO err: ' + JSON.stringify(err.code) + err); 3316 if (err.code === 12800012) { 3317 commonEventPublishData = { 3318 data: 'SUCCESS' 3319 }; 3320 } 3321 }; 3322 commoneventmanager.publish('SUB_InputMethod_IME_SplitScreen_0101', commonEventPublishData, this.publishCallback); 3323 } else { 3324 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 getCallingWindowInfo softKeyboardPanel is null '); 3325 }; 3326 } catch (error) { 3327 console.info(TAG + '====>SUB_InputMethod_IME_SplitScreen_0101 catch error: ' + JSON.stringify(error.code) + JSON.stringify(error.message)); 3328 commoneventmanager.publish('SUB_InputMethod_IME_SplitScreen_0101', commonEventPublishData, this.publishCallback); 3329 } 3330 } 3331 3332 private async SUB_inputMethod_IMF_setPreview(testCaseName: string): Promise<void> { 3333 let commonEventPublishData = { 3334 data: 'FAILED' 3335 }; 3336 try { 3337 this.InputClient.setPreviewTextSync(`${testCaseName}`, {start:0, end: 1}); 3338 this.InputClient.finishTextPreviewSync(); 3339 } catch (err) { 3340 console.info(TAG + `====>receive ${testCaseName} err: ${err.code}`); 3341 if (err.code === 12800011) { 3342 commonEventPublishData = { 3343 data: 'SUCCESS' 3344 }; 3345 } 3346 commoneventmanager.publish(`${testCaseName}`, commonEventPublishData, this.publishCallback); 3347 } 3348 } 3349 3350 private async Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100(): Promise<void> { 3351 console.info(TAG + '====>receive Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100 data'); 3352 let commonEventPublishData = { 3353 data: 'FAILED' 3354 }; 3355 inputmethodengine.getKeyboardDelegate().on('editorAttributeChanged', (attr:inputMethodEngine.EditorAttribute) => { 3356 console.info(TAG + `====>on_EditorAttribute_callback = ${JSON.stringify(attr)}`); 3357 if (typeof (attr.windowId) === 'number' && typeof (attr.displayId) === 'number') { 3358 commonEventPublishData = { 3359 data: 'SUCCESS' 3360 }; 3361 }; 3362 inputmethodengine.getKeyboardDelegate().off('editorAttributeChanged'); 3363 commoneventmanager.publish('Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100', commonEventPublishData, this.publishCallback); 3364 }); 3365 try { 3366 let callingDisplayDidChangeCallback = (num: number): void => { 3367 console.info(TAG + `====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100 display id: ${num}`); 3368 }; 3369 inputMethodEngine.getInputMethodAbility().on('callingDisplayDidChange', callingDisplayDidChangeCallback); 3370 inputMethodEngine.getInputMethodAbility().off('callingDisplayDidChange', callingDisplayDidChangeCallback); 3371 } catch (err) { 3372 if (err.code === 801) { 3373 commonEventPublishData = { 3374 data: 'SUCCESS' 3375 }; 3376 }; 3377 console.info(TAG + '====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100 cathch err: ' + JSON.stringify(err)); 3378 commoneventmanager.publish('Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0100', commonEventPublishData, this.publishCallback); 3379 } 3380 } 3381 3382 private async Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200(): Promise<void> { 3383 console.info(TAG + '====>receive Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200 data'); 3384 let commonEventPublishData = { 3385 data: 'FAILED' 3386 }; 3387 try { 3388 let callingDisplayDidChangeCallback1 = (num: number): void => { 3389 console.info(TAG + `====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200 display id: ${num}`); 3390 }; 3391 inputMethodEngine.getInputMethodAbility().on('callingDisplayDidChange', callingDisplayDidChangeCallback1); 3392 inputMethodEngine.getInputMethodAbility().off('callingDisplayDidChange'); 3393 commonEventPublishData = { 3394 data: 'SUCCESS' 3395 }; 3396 console.info(TAG + '====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200 success '); 3397 commoneventmanager.publish('Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200', commonEventPublishData, this.publishCallback); 3398 } catch (err) { 3399 if (err.code === 801) { 3400 commonEventPublishData = { 3401 data: 'SUCCESS' 3402 }; 3403 }; 3404 console.info(TAG + '====>Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200 cathch err: ' + JSON.stringify(err)); 3405 commoneventmanager.publish('Sub_InputMethod_IMF_onoffcallingDisplayDidChange_0200', commonEventPublishData, this.publishCallback); 3406 } 3407 } 3408 3409 private async Sub_InputMethod_IME_setImmersiveEffect_0100(): Promise<void> { 3410 console.info(TAG + '====>receive Sub_InputMethod_IME_setImmersiveEffect_0100 data'); 3411 let commonEventPublishData = { 3412 data: 'FAILED' 3413 }; 3414 try { 3415 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 3416 let effect: inputMethodEngine.ImmersiveEffect = { 3417 gradientHeight: 0, 3418 gradientMode: inputMethodEngine.GradientMode.NONE, 3419 fluidLightMode: inputMethodEngine.FluidLightMode.NONE 3420 }; 3421 this.softKeyboardPanel.setImmersiveEffect(effect); 3422 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0100 ImmersiveMode :' + JSON.stringify(effect)); 3423 commonEventPublishData = { 3424 data: 'SUCCESS' 3425 }; 3426 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0100 success '); 3427 } catch (err) { 3428 if (err.code === 801) { 3429 commonEventPublishData = { 3430 data: 'SUCCESS' 3431 }; 3432 }; 3433 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0100 cathch err: ' + JSON.stringify(err)); 3434 }; 3435 commoneventmanager.publish('Sub_InputMethod_IME_setImmersiveEffect_0100', commonEventPublishData, this.publishCallback); 3436 } 3437 3438 private async Sub_InputMethod_IME_setImmersiveEffect_0200(): Promise<void> { 3439 console.info(TAG + '====>receive Sub_InputMethod_IME_setImmersiveEffect_0200 data'); 3440 let commonEventPublishData = { 3441 data: 'FAILED' 3442 }; 3443 try { 3444 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 3445 let effect: inputMethodEngine.ImmersiveEffect = { 3446 gradientHeight: 1, 3447 gradientMode: inputMethodEngine.GradientMode.NONE, 3448 fluidLightMode: inputMethodEngine.FluidLightMode.NONE 3449 }; 3450 this.softKeyboardPanel.setImmersiveEffect(effect); 3451 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0200 effect :' + JSON.stringify(effect)); 3452 } catch (err) { 3453 if (err.code === 801) { 3454 commonEventPublishData = { 3455 data: 'SUCCESS' 3456 }; 3457 }; 3458 if (err.code === 12800020) { 3459 commonEventPublishData = { 3460 data: 'SUCCESS' 3461 }; 3462 }; 3463 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0200 cathch err: ' + JSON.stringify(err)); 3464 }; 3465 commoneventmanager.publish('Sub_InputMethod_IME_setImmersiveEffect_0200', commonEventPublishData, this.publishCallback); 3466 } 3467 3468 private async Sub_InputMethod_IME_setImmersiveEffect_0300(): Promise<void> { 3469 console.info(TAG + '====>receive Sub_InputMethod_IME_setImmersiveEffect_0300 data'); 3470 let commonEventPublishData = { 3471 data: 'FAILED' 3472 }; 3473 try { 3474 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.NONE_IMMERSIVE); 3475 let effect: inputMethodEngine.ImmersiveEffect = { 3476 gradientHeight: 0, 3477 gradientMode: inputMethodEngine.GradientMode.LINEAR_GRADIENT, 3478 fluidLightMode: inputMethodEngine.FluidLightMode.NONE 3479 }; 3480 this.softKeyboardPanel.setImmersiveEffect(effect); 3481 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0300 effect :' + JSON.stringify(effect)); 3482 } catch (err) { 3483 if (err.code === 801) { 3484 commonEventPublishData = { 3485 data: 'SUCCESS' 3486 }; 3487 }; 3488 if (err.code === 12800020) { 3489 commonEventPublishData = { 3490 data: 'SUCCESS' 3491 }; 3492 }; 3493 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0300 cathch err: ' + JSON.stringify(err)); 3494 }; 3495 commoneventmanager.publish('Sub_InputMethod_IME_setImmersiveEffect_0300', commonEventPublishData, this.publishCallback); 3496 } 3497 3498 private async Sub_InputMethod_IME_setImmersiveEffect_0400(): Promise<void> { 3499 console.info(TAG + '====>receive Sub_InputMethod_IME_setImmersiveEffect_0400 data'); 3500 let commonEventPublishData = { 3501 data: 'FAILED' 3502 }; 3503 try { 3504 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 3505 let effect: inputMethodEngine.ImmersiveEffect = { 3506 gradientHeight: 0, 3507 gradientMode: inputMethodEngine.GradientMode.LINEAR_GRADIENT, 3508 fluidLightMode: inputMethodEngine.FluidLightMode.BACKGROUND_FLUID_LIGHT 3509 }; 3510 this.softKeyboardPanel.setImmersiveEffect(effect); 3511 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0400 effect :' + JSON.stringify(effect)); 3512 } catch (err) { 3513 if (err.code === 801) { 3514 commonEventPublishData = { 3515 data: 'SUCCESS' 3516 }; 3517 }; 3518 if (err.code === 202) { 3519 commonEventPublishData = { 3520 data: 'SUCCESS' 3521 }; 3522 }; 3523 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0400 cathch err: ' + JSON.stringify(err)); 3524 }; 3525 commoneventmanager.publish('Sub_InputMethod_IME_setImmersiveEffect_0400', commonEventPublishData, this.publishCallback); 3526 } 3527 3528 private async Sub_InputMethod_IME_setImmersiveEffect_0500(): Promise<void> { 3529 console.info(TAG + '====>receive Sub_InputMethod_IME_setImmersiveEffect_0500 data'); 3530 let commonEventPublishData = { 3531 data: 'FAILED' 3532 }; 3533 try { 3534 this.softKeyboardPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 3535 let effect: inputMethodEngine.ImmersiveEffect = { 3536 gradientHeight: 1, 3537 gradientMode: inputMethodEngine.GradientMode.LINEAR_GRADIENT, 3538 fluidLightMode: inputMethodEngine.FluidLightMode.NONE 3539 }; 3540 this.softKeyboardPanel.setImmersiveEffect(effect); 3541 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0500 effect :' + JSON.stringify(effect)); 3542 commonEventPublishData = { 3543 data: 'SUCCESS' 3544 }; 3545 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0500 success '); 3546 } catch (err) { 3547 if (err.code === 801) { 3548 commonEventPublishData = { 3549 data: 'SUCCESS' 3550 }; 3551 }; 3552 console.info(TAG + '====>Sub_InputMethod_IME_setImmersiveEffect_0500 cathch err: ' + JSON.stringify(err)); 3553 }; 3554 commoneventmanager.publish('Sub_InputMethod_IME_setImmersiveEffect_0500', commonEventPublishData, this.publishCallback); 3555 } 3556 3557 private async Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100(): Promise<void> { 3558 console.info(TAG + '====>receive Sub_InputMethod_IME_setImmersiveEffect_0500 data'); 3559 let commonEventPublishData = { 3560 data: 'FAILED' 3561 }; 3562 try { 3563 let attachOptions: inputMethodEngine.AttachOptions = this.InputClient.getAttachOptions(); 3564 console.info(TAG + '====>Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100 attachOptions is' + JSON.stringify(attachOptions)); 3565 if (attachOptions.isSimpleKeyboardEnabled === false) { 3566 commonEventPublishData = { 3567 data: 'SUCCESS' 3568 }; 3569 }; 3570 console.info(TAG + '====>Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100 success '); 3571 } catch (err) { 3572 console.info(TAG + '====>Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100 cathch err: ' + JSON.stringify(err)); 3573 }; 3574 commoneventmanager.publish('Sub_InputMethod_IME_isSimpleKeyboardEnabled_0100', commonEventPublishData, this.publishCallback); 3575 } 3576 3577 private async Sub_InputMethod_IME_setKeepScreenOn_0100(): Promise<void> { 3578 console.info(TAG + '====>receive Sub_InputMethod_IME_setKeepScreenOn_0100 data'); 3579 let commonEventPublishData = { 3580 data: 'FAILED' 3581 }; 3582 let panelInfo1:inputMethodEngine.PanelInfo = { 3583 type: inputMethodEngine.PanelType.STATUS_BAR, 3584 }; 3585 let inputPanel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 3586 try { 3587 let isKeepScreenOn = true; 3588 await inputPanel.setKeepScreenOn(isKeepScreenOn); 3589 commonEventPublishData = { 3590 data: 'SUCCESS' 3591 }; 3592 console.info(TAG + '====>Sub_InputMethod_IME_setKeepScreenOn_0100 success '); 3593 } catch (err) { 3594 console.info(TAG + '====>Sub_InputMethod_IME_setKeepScreenOn_0100 cathch err: ' + JSON.stringify(err)); 3595 } finally { 3596 await inputMethodAbility.destroyPanel(inputPanel); 3597 }; 3598 commoneventmanager.publish('Sub_InputMethod_IME_setKeepScreenOn_0100', commonEventPublishData, this.publishCallback); 3599 } 3600 3601 private async Sub_InputMethod_IME_setKeepScreenOn_0200(): Promise<void> { 3602 console.info(TAG + '====>receive Sub_InputMethod_IME_setKeepScreenOn_0200 data'); 3603 let commonEventPublishData = { 3604 data: 'FAILED' 3605 }; 3606 let panelInfo1:inputMethodEngine.PanelInfo = { 3607 type: inputMethodEngine.PanelType.STATUS_BAR, 3608 }; 3609 let inputPanel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 3610 try { 3611 let isKeepScreenOn = false; 3612 await inputPanel.setKeepScreenOn(isKeepScreenOn); 3613 commonEventPublishData = { 3614 data: 'SUCCESS' 3615 }; 3616 console.info(TAG + '====>Sub_InputMethod_IME_setKeepScreenOn_0200 success '); 3617 } catch (err) { 3618 console.info(TAG + '====>Sub_InputMethod_IME_setKeepScreenOn_0200 cathch err: ' + JSON.stringify(err)); 3619 } finally { 3620 await inputMethodAbility.destroyPanel(inputPanel); 3621 }; 3622 commoneventmanager.publish('Sub_InputMethod_IME_setKeepScreenOn_0200', commonEventPublishData, this.publishCallback); 3623 } 3624 3625 private async Sub_InputMethod_IME_Custom_0901(): Promise<void> { 3626 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0901 data'); 3627 let commonEventPublishData = { 3628 data: 'FAILED' 3629 }; 3630 try { 3631 let msgId: string = 'testMsgId'; 3632 let msgParam: ArrayBuffer = new ArrayBuffer(128); 3633 await this.InputClient.sendMessage(msgId, msgParam); 3634 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0901 recvMessage success'); 3635 } catch (error) { 3636 if (error.code === 12800016) { 3637 commonEventPublishData = { 3638 data: 'SUCCESS' 3639 }; 3640 } 3641 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0901 recvMessage catch err!: ' + error.code); 3642 } 3643 let t = setTimeout(() => { 3644 clearTimeout(t); 3645 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0901', commonEventPublishData, this.publishCallback); 3646 }, 100); 3647 } 3648 3649 private async Sub_InputMethod_IME_Custom_0902(): Promise<void> { 3650 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0902 data'); 3651 let commonEventPublishData = { 3652 data: 'FAILED' 3653 }; 3654 try { 3655 let msgId: string = 'testMsgId'; 3656 let msgParam: ArrayBuffer = new ArrayBuffer(128); 3657 await this.InputClient.sendMessage(msgId, msgParam); 3658 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0902 recvMessage success'); 3659 } catch (error) { 3660 if (error.code === 12800015) { 3661 commonEventPublishData = { 3662 data: 'SUCCESS' 3663 }; 3664 } 3665 console.info(TAG + '====>Sub_InputMethod_IME_Custom_0902 recvMessage catch err!: ' + error.code); 3666 } 3667 let t = setTimeout(() => { 3668 clearTimeout(t); 3669 commoneventmanager.publish('Sub_InputMethod_IME_Custom_0902', commonEventPublishData, this.publishCallback); 3670 }, 100); 3671 } 3672 3673 private async Sub_InputMethod_IME_Immersive_0600(): Promise<void> { 3674 console.info(TAG + '====>receive Sub_InputMethod_IME_Immersive_0600 data'); 3675 let commonEventPublishData = { 3676 data: 'FAILED' 3677 }; 3678 try { 3679 let panelInfo1: inputMethodEngine.PanelInfo = { 3680 type: inputMethodEngine.PanelType.STATUS_BAR, 3681 }; 3682 let inputPanel = await inputMethodAbility.createPanel(this.mContext, panelInfo1); 3683 3684 try { 3685 inputPanel.setImmersiveMode(inputMethodEngine.ImmersiveMode.LIGHT_IMMERSIVE); 3686 let effect: inputMethodEngine.ImmersiveEffect = { 3687 gradientHeight:1, 3688 gradientMode:inputMethodEngine.GradientMode.LINEAR_GRADIENT, 3689 fluidLightMode:inputMethodEngine.FluidLightMode.NONE 3690 }; 3691 inputPanel.setImmersiveEffect(effect); 3692 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0600 setImmersiveMode success '); 3693 } catch (err) { 3694 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0600 setImmersiveMode err: ' + err.code + JSON.stringify(err)); 3695 await inputMethodAbility.destroyPanel(inputPanel); 3696 if (err.code === 801) { 3697 commonEventPublishData = { 3698 data: 'SUCCESS' 3699 }; 3700 } 3701 if (err.code === 12800021) { 3702 commonEventPublishData = { 3703 data: 'SUCCESS' 3704 }; 3705 } 3706 }; 3707 } catch (err) { 3708 console.info(TAG + '====>Sub_InputMethod_IME_Immersive_0600 cathch err: ' + JSON.stringify(err)); 3709 }; 3710 commoneventmanager.publish('Sub_InputMethod_IME_Immersive_0600', commonEventPublishData, this.publishCallback); 3711 } 3712 3713}