1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit ArkUI 19 */ 20 21import { AsyncCallback, BusinessError, Callback } from './@ohos.base'; 22import BaseContext from './application/BaseContext'; 23import image from './@ohos.multimedia.image'; 24import rpc from './@ohos.rpc'; 25import dialogRequest from './@ohos.app.ability.dialogRequest'; 26import { UIContext } from './@ohos.arkui.UIContext'; 27import ConfigurationConstant from './@ohos.app.ability.ConfigurationConstant'; 28 29/** 30 * Window manager. 31 * 32 * @namespace window 33 * @syscap SystemCapability.WindowManager.WindowManager.Core 34 */ 35/** 36 * Window manager. 37 * 38 * @namespace window 39 * @syscap SystemCapability.WindowManager.WindowManager.Core 40 * @crossplatform 41 * @since 10 42 */ 43/** 44 * Window manager. 45 * 46 * @namespace window 47 * @syscap SystemCapability.WindowManager.WindowManager.Core 48 * @crossplatform 49 * @atomicservice 50 * @since 11 51 */ 52declare namespace window { 53 /** 54 * The type of a window. 55 * 56 * @enum { number } 57 * @syscap SystemCapability.WindowManager.WindowManager.Core 58 * @since 7 59 */ 60 /** 61 * The type of a window. 62 * 63 * @enum { number } 64 * @syscap SystemCapability.WindowManager.WindowManager.Core 65 * @atomicservice 66 * @since 12 67 */ 68 enum WindowType { 69 /** 70 * App. 71 * 72 * @syscap SystemCapability.WindowManager.WindowManager.Core 73 * @FAModelOnly 74 * @since 7 75 */ 76 TYPE_APP, 77 /** 78 * System alert. 79 * 80 * @syscap SystemCapability.WindowManager.WindowManager.Core 81 * @since 7 82 * @deprecated since 11 83 */ 84 TYPE_SYSTEM_ALERT, 85 /** 86 * Input method. 87 * 88 * @syscap SystemCapability.WindowManager.WindowManager.Core 89 * @systemapi Hide this for inner system use. 90 * @StageModelOnly 91 * @since 9 92 * @deprecated since 13 93 */ 94 TYPE_INPUT_METHOD, 95 /** 96 * Status bar. 97 * 98 * @syscap SystemCapability.WindowManager.WindowManager.Core 99 * @systemapi Hide this for inner system use. 100 * @StageModelOnly 101 * @since 9 102 */ 103 TYPE_STATUS_BAR, 104 /** 105 * Panel. 106 * 107 * @syscap SystemCapability.WindowManager.WindowManager.Core 108 * @systemapi Hide this for inner system use. 109 * @StageModelOnly 110 * @since 9 111 */ 112 TYPE_PANEL, 113 /** 114 * Keyguard. 115 * 116 * @syscap SystemCapability.WindowManager.WindowManager.Core 117 * @systemapi Hide this for inner system use. 118 * @StageModelOnly 119 * @since 9 120 */ 121 TYPE_KEYGUARD, 122 /** 123 * Volume. 124 * 125 * @syscap SystemCapability.WindowManager.WindowManager.Core 126 * @systemapi Hide this for inner system use. 127 * @StageModelOnly 128 * @since 9 129 */ 130 TYPE_VOLUME_OVERLAY, 131 /** 132 * Navigation bar. 133 * 134 * @syscap SystemCapability.WindowManager.WindowManager.Core 135 * @systemapi Hide this for inner system use. 136 * @StageModelOnly 137 * @since 9 138 */ 139 TYPE_NAVIGATION_BAR, 140 /** 141 * Float. 142 * 143 * @permission ohos.permission.SYSTEM_FLOAT_WINDOW 144 * @syscap SystemCapability.WindowManager.WindowManager.Core 145 * @StageModelOnly 146 * @since 9 147 */ 148 /** 149 * Float. 150 * Require "ohos.permission.SYSTEM_FLOAT_WINDOW" permission 151 * 152 * @syscap SystemCapability.WindowManager.WindowManager.Core 153 * @StageModelOnly 154 * @atomicservice 155 * @since 12 156 */ 157 TYPE_FLOAT, 158 /** 159 * Wallpaper. 160 * 161 * @syscap SystemCapability.WindowManager.WindowManager.Core 162 * @systemapi Hide this for inner system use. 163 * @StageModelOnly 164 * @since 9 165 */ 166 TYPE_WALLPAPER, 167 /** 168 * Desktop. 169 * 170 * @syscap SystemCapability.WindowManager.WindowManager.Core 171 * @systemapi Hide this for inner system use. 172 * @StageModelOnly 173 * @since 9 174 */ 175 TYPE_DESKTOP, 176 /** 177 * Recent. 178 * 179 * @syscap SystemCapability.WindowManager.WindowManager.Core 180 * @systemapi Hide this for inner system use. 181 * @StageModelOnly 182 * @since 9 183 */ 184 TYPE_LAUNCHER_RECENT, 185 /** 186 * Dock. 187 * 188 * @syscap SystemCapability.WindowManager.WindowManager.Core 189 * @systemapi Hide this for inner system use. 190 * @StageModelOnly 191 * @since 9 192 */ 193 TYPE_LAUNCHER_DOCK, 194 /** 195 * Voice interaction. 196 * 197 * @syscap SystemCapability.WindowManager.WindowManager.Core 198 * @systemapi Hide this for inner system use. 199 * @StageModelOnly 200 * @since 9 201 */ 202 TYPE_VOICE_INTERACTION, 203 /** 204 * Pointer. 205 * 206 * @syscap SystemCapability.WindowManager.WindowManager.Core 207 * @systemapi Hide this for inner system use. 208 * @StageModelOnly 209 * @since 9 210 */ 211 TYPE_POINTER, 212 /** 213 * Float camera. 214 * 215 * @syscap SystemCapability.WindowManager.WindowManager.Core 216 * @systemapi Hide this for inner system use. 217 * @StageModelOnly 218 * @since 9 219 */ 220 TYPE_FLOAT_CAMERA, 221 /** 222 * Dialog. 223 * 224 * @syscap SystemCapability.WindowManager.WindowManager.Core 225 * @StageModelOnly 226 * @since 10 227 */ 228 /** 229 * Dialog. 230 * 231 * @syscap SystemCapability.WindowManager.WindowManager.Core 232 * @StageModelOnly 233 * @atomicservice 234 * @since 12 235 */ 236 TYPE_DIALOG, 237 /** 238 * Screenshot. 239 * 240 * @syscap SystemCapability.WindowManager.WindowManager.Core 241 * @systemapi Hide this for inner system use. 242 * @StageModelOnly 243 * @since 9 244 */ 245 TYPE_SCREENSHOT, 246 /** 247 * System Toast. 248 * 249 * @syscap SystemCapability.WindowManager.WindowManager.Core 250 * @systemapi Hide this for inner system use. 251 * @StageModelOnly 252 * @since 11 253 */ 254 TYPE_SYSTEM_TOAST, 255 /** 256 * Divider. 257 * 258 * @syscap SystemCapability.WindowManager.WindowManager.Core 259 * @systemapi Hide this for inner system use. 260 * @StageModelOnly 261 * @since 11 262 */ 263 TYPE_DIVIDER, 264 /** 265 * Global Search. 266 * 267 * @syscap SystemCapability.WindowManager.WindowManager.Core 268 * @systemapi Hide this for inner system use. 269 * @StageModelOnly 270 * @since 11 271 */ 272 TYPE_GLOBAL_SEARCH, 273 /** 274 * Handwrite. 275 * 276 * @syscap SystemCapability.Window.SessionManager 277 * @systemapi Hide this for inner system use. 278 * @StageModelOnly 279 * @since 12 280 */ 281 TYPE_HANDWRITE 282 } 283 284 /** 285 * Describes the type of avoid area 286 * 287 * @enum { number } 288 * @syscap SystemCapability.WindowManager.WindowManager.Core 289 * @since 7 290 */ 291 /** 292 * Describes the type of avoid area 293 * 294 * @enum { number } 295 * @syscap SystemCapability.WindowManager.WindowManager.Core 296 * @atomicservice 297 * @since 11 298 */ 299 /** 300 * Describes the type of avoid area 301 * 302 * @enum { number } 303 * @syscap SystemCapability.WindowManager.WindowManager.Core 304 * @crossplatform 305 * @atomicservice 306 * @since 12 307 */ 308 enum AvoidAreaType { 309 /** 310 * Default area of the system 311 * 312 * @syscap SystemCapability.WindowManager.WindowManager.Core 313 * @since 7 314 */ 315 /** 316 * Default area of the system 317 * 318 * @syscap SystemCapability.WindowManager.WindowManager.Core 319 * @atomicservice 320 * @since 11 321 */ 322 /** 323 * Default area of the system 324 * 325 * @syscap SystemCapability.WindowManager.WindowManager.Core 326 * @crossplatform 327 * @atomicservice 328 * @since 12 329 */ 330 TYPE_SYSTEM, 331 332 /** 333 * Notch 334 * 335 * @syscap SystemCapability.WindowManager.WindowManager.Core 336 * @since 7 337 */ 338 /** 339 * Notch 340 * 341 * @syscap SystemCapability.WindowManager.WindowManager.Core 342 * @atomicservice 343 * @since 11 344 */ 345 /** 346 * Notch 347 * 348 * @syscap SystemCapability.WindowManager.WindowManager.Core 349 * @crossplatform 350 * @atomicservice 351 * @since 12 352 */ 353 TYPE_CUTOUT, 354 355 /** 356 * Area for system gesture 357 * 358 * @syscap SystemCapability.WindowManager.WindowManager.Core 359 * @since 9 360 */ 361 /** 362 * Area for system gesture 363 * 364 * @syscap SystemCapability.WindowManager.WindowManager.Core 365 * @atomicservice 366 * @since 11 367 */ 368 /** 369 * Area for system gesture 370 * 371 * @syscap SystemCapability.WindowManager.WindowManager.Core 372 * @crossplatform 373 * @atomicservice 374 * @since 12 375 */ 376 TYPE_SYSTEM_GESTURE, 377 378 /** 379 * Area for keyboard 380 * 381 * @syscap SystemCapability.WindowManager.WindowManager.Core 382 * @since 9 383 */ 384 /** 385 * Area for keyboard 386 * 387 * @syscap SystemCapability.WindowManager.WindowManager.Core 388 * @atomicservice 389 * @since 11 390 */ 391 /** 392 * Area for keyboard 393 * 394 * @syscap SystemCapability.WindowManager.WindowManager.Core 395 * @crossplatform 396 * @atomicservice 397 * @since 12 398 */ 399 TYPE_KEYBOARD, 400 401 /** 402 * Area for navigation indicator 403 * 404 * @syscap SystemCapability.WindowManager.WindowManager.Core 405 * @atomicservice 406 * @since 11 407 */ 408 /** 409 * Area for navigation indicator 410 * 411 * @syscap SystemCapability.WindowManager.WindowManager.Core 412 * @crossplatform 413 * @atomicservice 414 * @since 12 415 */ 416 TYPE_NAVIGATION_INDICATOR 417 } 418 /** 419 * Describes the window mode of an application 420 * 421 * @enum { number } 422 * @syscap SystemCapability.WindowManager.WindowManager.Core 423 * @systemapi Hide this for inner system use. 424 * @since 7 425 */ 426 enum WindowMode { 427 /** 428 * Undefined mode of the window 429 * 430 * @syscap SystemCapability.WindowManager.WindowManager.Core 431 * @systemapi Hide this for inner system use. 432 * @since 7 433 */ 434 UNDEFINED = 1, 435 /** 436 * Fullscreen mode of the window 437 * 438 * @syscap SystemCapability.WindowManager.WindowManager.Core 439 * @systemapi Hide this for inner system use. 440 * @since 7 441 */ 442 FULLSCREEN, 443 /** 444 * Primary mode of the window 445 * 446 * @syscap SystemCapability.WindowManager.WindowManager.Core 447 * @systemapi Hide this for inner system use. 448 * @since 7 449 */ 450 PRIMARY, 451 /** 452 * Secondary mode of the window 453 * 454 * @syscap SystemCapability.WindowManager.WindowManager.Core 455 * @systemapi Hide this for inner system use. 456 * @since 7 457 */ 458 SECONDARY, 459 /** 460 * Floating mode of the window 461 * 462 * @syscap SystemCapability.WindowManager.WindowManager.Core 463 * @systemapi Hide this for inner system use. 464 * @since 7 465 */ 466 FLOATING 467 } 468 469 /** 470 * Describes the mode of window layout 471 * 472 * @enum { number } 473 * @syscap SystemCapability.WindowManager.WindowManager.Core 474 * @systemapi Hide this for inner system use. 475 * @since 9 476 */ 477 enum WindowLayoutMode { 478 /** 479 * CASCADE 480 * 481 * @syscap SystemCapability.WindowManager.WindowManager.Core 482 * @systemapi Hide this for inner system use. 483 * @since 9 484 */ 485 WINDOW_LAYOUT_MODE_CASCADE, 486 /** 487 * TILE 488 * 489 * @syscap SystemCapability.WindowManager.WindowManager.Core 490 * @systemapi Hide this for inner system use. 491 * @since 9 492 */ 493 WINDOW_LAYOUT_MODE_TILE 494 } 495 496 /** 497 * Describes the window status of an application 498 * 499 * @enum { number } 500 * @syscap SystemCapability.Window.SessionManager 501 * @since 11 502 */ 503 /** 504 * Describes the window status of an application 505 * 506 * @enum { number } 507 * @syscap SystemCapability.Window.SessionManager 508 * @atomicservice 509 * @since 12 510 */ 511 enum WindowStatusType { 512 /** 513 * Undefined status of the window 514 * 515 * @syscap SystemCapability.Window.SessionManager 516 * @since 11 517 */ 518 /** 519 * Undefined status of the window 520 * 521 * @syscap SystemCapability.Window.SessionManager 522 * @atomicservice 523 * @since 12 524 */ 525 UNDEFINED = 0, 526 /** 527 * Full screen status of the window 528 * 529 * @syscap SystemCapability.Window.SessionManager 530 * @since 11 531 */ 532 /** 533 * Full screen status of the window 534 * 535 * @syscap SystemCapability.Window.SessionManager 536 * @atomicservice 537 * @since 12 538 */ 539 FULL_SCREEN, 540 /** 541 * Maximize status of the window 542 * 543 * @syscap SystemCapability.Window.SessionManager 544 * @since 11 545 */ 546 /** 547 * Maximize status of the window 548 * 549 * @syscap SystemCapability.Window.SessionManager 550 * @atomicservice 551 * @since 12 552 */ 553 MAXIMIZE, 554 /** 555 * Minimize status of the window 556 * 557 * @syscap SystemCapability.Window.SessionManager 558 * @since 11 559 */ 560 /** 561 * Minimize status of the window 562 * 563 * @syscap SystemCapability.Window.SessionManager 564 * @atomicservice 565 * @since 12 566 */ 567 MINIMIZE, 568 /** 569 * Floating status of the window 570 * 571 * @syscap SystemCapability.Window.SessionManager 572 * @since 11 573 */ 574 /** 575 * Floating status of the window 576 * 577 * @syscap SystemCapability.Window.SessionManager 578 * @atomicservice 579 * @since 12 580 */ 581 FLOATING, 582 /** 583 * Split screen status of the window 584 * 585 * @syscap SystemCapability.Window.SessionManager 586 * @since 11 587 */ 588 /** 589 * Split screen status of the window 590 * 591 * @syscap SystemCapability.Window.SessionManager 592 * @atomicservice 593 * @since 12 594 */ 595 SPLIT_SCREEN 596 } 597 598 /** 599 * Properties of status bar and navigation bar, it couldn't update automatically 600 * 601 * @interface SystemBarProperties 602 * @syscap SystemCapability.WindowManager.WindowManager.Core 603 * @since 6 604 */ 605 /** 606 * Properties of status bar and navigation bar, it couldn't update automatically 607 * 608 * @interface SystemBarProperties 609 * @syscap SystemCapability.WindowManager.WindowManager.Core 610 * @atomicservice 611 * @since 12 612 */ 613 interface SystemBarProperties { 614 /** 615 * The color of the status bar. 616 * 617 * @syscap SystemCapability.WindowManager.WindowManager.Core 618 * @since 6 619 */ 620 /** 621 * The color of the status bar. 622 * 623 * @type { ?string } 624 * @syscap SystemCapability.WindowManager.WindowManager.Core 625 * @atomicservice 626 * @since 12 627 */ 628 statusBarColor?: string; 629 630 /** 631 * The light icon of the status bar. 632 * 633 * @syscap SystemCapability.WindowManager.WindowManager.Core 634 * @since 7 635 */ 636 /** 637 * The light icon of the status bar. 638 * 639 * @type { ?boolean } 640 * @syscap SystemCapability.WindowManager.WindowManager.Core 641 * @atomicservice 642 * @since 12 643 */ 644 isStatusBarLightIcon?: boolean; 645 646 /** 647 * The content color of the status bar 648 * 649 * @syscap SystemCapability.WindowManager.WindowManager.Core 650 * @since 8 651 */ 652 /** 653 * The content color of the status bar 654 * 655 * @type { ?string } 656 * @syscap SystemCapability.WindowManager.WindowManager.Core 657 * @atomicservice 658 * @since 12 659 */ 660 statusBarContentColor?: string; 661 662 /** 663 * The color of the navigation bar. 664 * 665 * @syscap SystemCapability.WindowManager.WindowManager.Core 666 * @since 6 667 */ 668 /** 669 * The color of the navigation bar. 670 * 671 * @type { ?string } 672 * @syscap SystemCapability.WindowManager.WindowManager.Core 673 * @atomicservice 674 * @since 12 675 */ 676 navigationBarColor?: string; 677 678 /** 679 * The light icon of the navigation bar. 680 * 681 * @syscap SystemCapability.WindowManager.WindowManager.Core 682 * @since 7 683 */ 684 /** 685 * The light icon of the navigation bar. 686 * 687 * @type { ?boolean } 688 * @syscap SystemCapability.WindowManager.WindowManager.Core 689 * @atomicservice 690 * @since 12 691 */ 692 isNavigationBarLightIcon?: boolean; 693 694 /** 695 * The content color of the navigation bar 696 * 697 * @syscap SystemCapability.WindowManager.WindowManager.Core 698 * @since 8 699 */ 700 /** 701 * The content color of the navigation bar 702 * 703 * @type { ?string } 704 * @syscap SystemCapability.WindowManager.WindowManager.Core 705 * @atomicservice 706 * @since 12 707 */ 708 navigationBarContentColor?: string; 709 710 /** 711 * Enable the animation of the status bar. 712 * 713 * @type { ?boolean } 714 * @syscap SystemCapability.Window.SessionManager 715 * @atomicservice 716 * @since 12 717 */ 718 enableStatusBarAnimation?: boolean; 719 720 /** 721 * Enable the animation of the navigation bar. 722 * 723 * @type { ?boolean } 724 * @syscap SystemCapability.Window.SessionManager 725 * @atomicservice 726 * @since 12 727 */ 728 enableNavigationBarAnimation?: boolean; 729 } 730 731 /** 732 * Properties of status bar, it couldn't update automatically 733 * 734 * @interface SystemBarStyle 735 * @syscap SystemCapability.WindowManager.WindowManager.Core 736 * @atomicservice 737 * @since 12 738 */ 739 interface SystemBarStyle { 740 /** 741 * The content color of the status bar 742 * 743 * @type { ?string } 744 * @syscap SystemCapability.WindowManager.WindowManager.Core 745 * @atomicservice 746 * @since 12 747 */ 748 statusBarContentColor?: string; 749 } 750 751 /** 752 * System bar tint of region 753 * 754 * @interface SystemBarRegionTint 755 * @syscap SystemCapability.WindowManager.WindowManager.Core 756 * @systemapi Hide this for inner system use. 757 * @since 8 758 */ 759 interface SystemBarRegionTint { 760 /** 761 * System bar type 762 * 763 * @type { WindowType } 764 * @syscap SystemCapability.WindowManager.WindowManager.Core 765 * @systemapi Hide this for inner system use. 766 * @since 8 767 */ 768 type: WindowType; 769 770 /** 771 * The visibility of system bar 772 * 773 * @type { ?boolean } 774 * @syscap SystemCapability.WindowManager.WindowManager.Core 775 * @systemapi Hide this for inner system use. 776 * @since 8 777 */ 778 isEnable?: boolean; 779 780 /** 781 * The region of system bar 782 * 783 * @type { ?Rect } 784 * @syscap SystemCapability.WindowManager.WindowManager.Core 785 * @systemapi Hide this for inner system use. 786 * @since 8 787 */ 788 region?: Rect; 789 790 /** 791 * The background color of the system bar. 792 * 793 * @type { ?string } 794 * @syscap SystemCapability.WindowManager.WindowManager.Core 795 * @systemapi Hide this for inner system use. 796 * @since 8 797 */ 798 backgroundColor?: string; 799 800 /** 801 * The content color of the system bar. 802 * 803 * @type { ?string } 804 * @syscap SystemCapability.WindowManager.WindowManager.Core 805 * @systemapi Hide this for inner system use. 806 * @since 8 807 */ 808 contentColor?: string; 809 } 810 811 /** 812 * System bar tint state for systemui 813 * 814 * @interface SystemBarTintState 815 * @syscap SystemCapability.WindowManager.WindowManager.Core 816 * @systemapi Hide this for inner system use. 817 * @since 8 818 */ 819 interface SystemBarTintState { 820 /** 821 * Id of display 822 * 823 * @type { number } 824 * @syscap SystemCapability.WindowManager.WindowManager.Core 825 * @systemapi Hide this for inner system use. 826 * @since 8 827 */ 828 displayId: number; 829 /** 830 * Region tint of systembar 831 * 832 * @type { Array<SystemBarRegionTint> } 833 * @syscap SystemCapability.WindowManager.WindowManager.Core 834 * @systemapi Hide this for inner system use. 835 * @since 8 836 */ 837 regionTint: Array<SystemBarRegionTint>; 838 } 839 840 /** 841 * Rectangle 842 * 843 * @interface Rect 844 * @syscap SystemCapability.WindowManager.WindowManager.Core 845 * @since 7 846 */ 847 /** 848 * Rectangle 849 * 850 * @interface Rect 851 * @syscap SystemCapability.WindowManager.WindowManager.Core 852 * @crossplatform 853 * @since 10 854 */ 855 /** 856 * Rectangle 857 * 858 * @interface Rect 859 * @syscap SystemCapability.WindowManager.WindowManager.Core 860 * @crossplatform 861 * @atomicservice 862 * @since 11 863 */ 864 interface Rect { 865 866 /** 867 * The left of the Rect. 868 * 869 * @syscap SystemCapability.WindowManager.WindowManager.Core 870 * @since 7 871 */ 872 /** 873 * The left of the Rect. 874 * 875 * @syscap SystemCapability.WindowManager.WindowManager.Core 876 * @crossplatform 877 * @since 10 878 */ 879 /** 880 * The left of the Rect. 881 * 882 * @type { number } 883 * @syscap SystemCapability.WindowManager.WindowManager.Core 884 * @crossplatform 885 * @atomicservice 886 * @since 11 887 */ 888 left: number; 889 890 /** 891 * The top of the Rect. 892 * 893 * @syscap SystemCapability.WindowManager.WindowManager.Core 894 * @since 7 895 */ 896 /** 897 * The top of the Rect. 898 * 899 * @syscap SystemCapability.WindowManager.WindowManager.Core 900 * @crossplatform 901 * @since 10 902 */ 903 /** 904 * The top of the Rect. 905 * 906 * @type { number } 907 * @syscap SystemCapability.WindowManager.WindowManager.Core 908 * @crossplatform 909 * @atomicservice 910 * @since 11 911 */ 912 top: number; 913 914 /** 915 * The width of the Rect. 916 * 917 * @syscap SystemCapability.WindowManager.WindowManager.Core 918 * @since 7 919 */ 920 /** 921 * The width of the Rect. 922 * 923 * @syscap SystemCapability.WindowManager.WindowManager.Core 924 * @crossplatform 925 * @since 10 926 */ 927 /** 928 * The width of the Rect. 929 * 930 * @type { number } 931 * @syscap SystemCapability.WindowManager.WindowManager.Core 932 * @crossplatform 933 * @atomicservice 934 * @since 11 935 */ 936 width: number; 937 938 /** 939 * The height of the Rect. 940 * 941 * @syscap SystemCapability.WindowManager.WindowManager.Core 942 * @since 7 943 */ 944 /** 945 * The height of the Rect. 946 * 947 * @syscap SystemCapability.WindowManager.WindowManager.Core 948 * @crossplatform 949 * @since 10 950 */ 951 /** 952 * The height of the Rect. 953 * 954 * @type { number } 955 * @syscap SystemCapability.WindowManager.WindowManager.Core 956 * @crossplatform 957 * @atomicservice 958 * @since 11 959 */ 960 height: number; 961 } 962 963 /** 964 * Avoid area 965 * 966 * @interface AvoidArea 967 * @syscap SystemCapability.WindowManager.WindowManager.Core 968 * @since 7 969 */ 970 /** 971 * Avoid area 972 * 973 * @interface AvoidArea 974 * @syscap SystemCapability.WindowManager.WindowManager.Core 975 * @atomicservice 976 * @since 11 977 */ 978 /** 979 * Avoid area 980 * 981 * @interface AvoidArea 982 * @syscap SystemCapability.WindowManager.WindowManager.Core 983 * @crossplatform 984 * @atomicservice 985 * @since 12 986 */ 987 interface AvoidArea { 988 /** 989 * Whether avoidArea is visible on screen 990 * 991 * @type { boolean } 992 * @syscap SystemCapability.WindowManager.WindowManager.Core 993 * @since 9 994 */ 995 /** 996 * Whether avoidArea is visible on screen 997 * 998 * @type { boolean } 999 * @syscap SystemCapability.WindowManager.WindowManager.Core 1000 * @atomicservice 1001 * @since 11 1002 */ 1003 visible: boolean; 1004 1005 /** 1006 * Rectangle on the left of the screen 1007 * 1008 * @type { Rect } 1009 * @syscap SystemCapability.WindowManager.WindowManager.Core 1010 * @since 7 1011 */ 1012 /** 1013 * Rectangle on the left of the screen 1014 * 1015 * @type { Rect } 1016 * @syscap SystemCapability.WindowManager.WindowManager.Core 1017 * @atomicservice 1018 * @since 11 1019 */ 1020 /** 1021 * Rectangle on the left of the screen 1022 * 1023 * @type { Rect } 1024 * @syscap SystemCapability.WindowManager.WindowManager.Core 1025 * @crossplatform 1026 * @atomicservice 1027 * @since 12 1028 */ 1029 leftRect: Rect; 1030 1031 /** 1032 * Rectangle on the top of the screen 1033 * 1034 * @type { Rect } 1035 * @syscap SystemCapability.WindowManager.WindowManager.Core 1036 * @since 7 1037 */ 1038 /** 1039 * Rectangle on the top of the screen 1040 * 1041 * @type { Rect } 1042 * @syscap SystemCapability.WindowManager.WindowManager.Core 1043 * @atomicservice 1044 * @since 11 1045 */ 1046 /** 1047 * Rectangle on the top of the screen 1048 * 1049 * @type { Rect } 1050 * @syscap SystemCapability.WindowManager.WindowManager.Core 1051 * @crossplatform 1052 * @atomicservice 1053 * @since 12 1054 */ 1055 topRect: Rect; 1056 1057 /** 1058 * Rectangle on the right of the screen 1059 * 1060 * @type { Rect } 1061 * @syscap SystemCapability.WindowManager.WindowManager.Core 1062 * @since 7 1063 */ 1064 /** 1065 * Rectangle on the right of the screen 1066 * 1067 * @type { Rect } 1068 * @syscap SystemCapability.WindowManager.WindowManager.Core 1069 * @atomicservice 1070 * @since 11 1071 */ 1072 /** 1073 * Rectangle on the right of the screen 1074 * 1075 * @type { Rect } 1076 * @syscap SystemCapability.WindowManager.WindowManager.Core 1077 * @crossplatform 1078 * @atomicservice 1079 * @since 12 1080 */ 1081 rightRect: Rect; 1082 1083 /** 1084 * Rectangle on the bottom of the screen 1085 * 1086 * @type { Rect } 1087 * @syscap SystemCapability.WindowManager.WindowManager.Core 1088 * @since 7 1089 */ 1090 /** 1091 * Rectangle on the bottom of the screen 1092 * 1093 * @type { Rect } 1094 * @syscap SystemCapability.WindowManager.WindowManager.Core 1095 * @atomicservice 1096 * @since 11 1097 */ 1098 /** 1099 * Rectangle on the bottom of the screen 1100 * 1101 * @type { Rect } 1102 * @syscap SystemCapability.WindowManager.WindowManager.Core 1103 * @crossplatform 1104 * @atomicservice 1105 * @since 12 1106 */ 1107 bottomRect: Rect; 1108 } 1109 1110 /** 1111 * Window size 1112 * 1113 * @interface Size 1114 * @syscap SystemCapability.WindowManager.WindowManager.Core 1115 * @since 7 1116 */ 1117 /** 1118 * Window size 1119 * 1120 * @interface Size 1121 * @syscap SystemCapability.WindowManager.WindowManager.Core 1122 * @crossplatform 1123 * @since 10 1124 */ 1125 /** 1126 * Window size 1127 * 1128 * @interface Size 1129 * @syscap SystemCapability.WindowManager.WindowManager.Core 1130 * @crossplatform 1131 * @atomicservice 1132 * @since 11 1133 */ 1134 interface Size { 1135 /** 1136 * The width of the window. 1137 * 1138 * @type { number } 1139 * @syscap SystemCapability.WindowManager.WindowManager.Core 1140 * @since 7 1141 */ 1142 /** 1143 * The width of the window. 1144 * 1145 * @type { number } 1146 * @syscap SystemCapability.WindowManager.WindowManager.Core 1147 * @crossplatform 1148 * @since 10 1149 */ 1150 /** 1151 * The width of the window. 1152 * 1153 * @type { number } 1154 * @syscap SystemCapability.WindowManager.WindowManager.Core 1155 * @crossplatform 1156 * @atomicservice 1157 * @since 11 1158 */ 1159 width: number; 1160 1161 /** 1162 * The height of the window. 1163 * 1164 * @syscap SystemCapability.WindowManager.WindowManager.Core 1165 * @since 7 1166 */ 1167 /** 1168 * The height of the window. 1169 * 1170 * @type { number } 1171 * @syscap SystemCapability.WindowManager.WindowManager.Core 1172 * @crossplatform 1173 * @since 10 1174 */ 1175 /** 1176 * The height of the window. 1177 * 1178 * @type { number } 1179 * @syscap SystemCapability.WindowManager.WindowManager.Core 1180 * @crossplatform 1181 * @atomicservice 1182 * @since 11 1183 */ 1184 height: number; 1185 } 1186 1187 /** 1188 * The info of window 1189 * 1190 * @interface WindowInfo 1191 * @syscap SystemCapability.Window.SessionManager 1192 * @systemapi 1193 * @since 12 1194 */ 1195 interface WindowInfo { 1196 /** 1197 * The position and size of the window 1198 * 1199 * @type { Rect } 1200 * @syscap SystemCapability.Window.SessionManager 1201 * @systemapi 1202 * @since 12 1203 */ 1204 rect: Rect; 1205 1206 /** 1207 * bundleName of window 1208 * 1209 * @type { string } 1210 * @syscap SystemCapability.Window.SessionManager 1211 * @systemapi 1212 * @since 12 1213 */ 1214 bundleName: string; 1215 1216 /** 1217 * abilityName of window 1218 * 1219 * @type { string } 1220 * @syscap SystemCapability.Window.SessionManager 1221 * @systemapi 1222 * @since 12 1223 */ 1224 abilityName: string; 1225 1226 /** 1227 * Indicates target window id. 1228 * 1229 * @type { number } 1230 * @syscap SystemCapability.Window.SessionManager 1231 * @systemapi 1232 * @since 12 1233 */ 1234 windowId: number; 1235 1236 /** 1237 * The window status of an application. 1238 * 1239 * @type { WindowStatusType } 1240 * @syscap SystemCapability.Window.SessionManager 1241 * @systemapi 1242 * @since 12 1243 */ 1244 windowStatusType: WindowStatusType; 1245 1246 /** 1247 * Whether the window is focused. The default value is false. 1248 * 1249 * @type { ?boolean } 1250 * @syscap SystemCapability.Window.SessionManager 1251 * @systemapi 1252 * @since 14 1253 */ 1254 isFocused?: boolean; 1255 } 1256 1257 /** 1258 * Properties of window, it couldn't update automatically 1259 * 1260 * @interface WindowProperties 1261 * @syscap SystemCapability.WindowManager.WindowManager.Core 1262 * @since 6 1263 */ 1264 /** 1265 * Properties of window, it couldn't update automatically 1266 * 1267 * @interface WindowProperties 1268 * @syscap SystemCapability.WindowManager.WindowManager.Core 1269 * @crossplatform 1270 * @since 10 1271 */ 1272 /** 1273 * Properties of window, it couldn't update automatically 1274 * 1275 * @interface WindowProperties 1276 * @syscap SystemCapability.WindowManager.WindowManager.Core 1277 * @crossplatform 1278 * @atomicservice 1279 * @since 11 1280 */ 1281 interface WindowProperties { 1282 /** 1283 * The position and size of the window 1284 * 1285 * @type { Rect } 1286 * @syscap SystemCapability.WindowManager.WindowManager.Core 1287 * @since 7 1288 */ 1289 /** 1290 * The position and size of the window 1291 * 1292 * @type { Rect } 1293 * @syscap SystemCapability.WindowManager.WindowManager.Core 1294 * @crossplatform 1295 * @since 10 1296 */ 1297 /** 1298 * The position and size of the window 1299 * 1300 * @type { Rect } 1301 * @syscap SystemCapability.WindowManager.WindowManager.Core 1302 * @crossplatform 1303 * @atomicservice 1304 * @since 11 1305 */ 1306 windowRect: Rect; 1307 1308 /** 1309 * The position relative to the window and size of drawable area 1310 * 1311 * @type { Rect } 1312 * @syscap SystemCapability.WindowManager.WindowManager.Core 1313 * @since 11 1314 */ 1315 /** 1316 * The position relative to the window and size of drawable area 1317 * 1318 * @type { Rect } 1319 * @syscap SystemCapability.WindowManager.WindowManager.Core 1320 * @atomicservice 1321 * @since 12 1322 */ 1323 drawableRect: Rect; 1324 1325 /** 1326 * Window type 1327 * 1328 * @type { WindowType } 1329 * @syscap SystemCapability.WindowManager.WindowManager.Core 1330 * @since 7 1331 */ 1332 /** 1333 * Window type 1334 * 1335 * @type { WindowType } 1336 * @syscap SystemCapability.WindowManager.WindowManager.Core 1337 * @atomicservice 1338 * @since 12 1339 */ 1340 type: WindowType; 1341 1342 /** 1343 * Whether the window is displayed in full screen mode. The default value is false. 1344 * 1345 * @type { boolean } 1346 * @syscap SystemCapability.WindowManager.WindowManager.Core 1347 * @since 6 1348 */ 1349 /** 1350 * Whether the window is displayed in full screen mode. The default value is false. 1351 * 1352 * @type { boolean } 1353 * @syscap SystemCapability.WindowManager.WindowManager.Core 1354 * @atomicservice 1355 * @since 12 1356 */ 1357 isFullScreen: boolean; 1358 1359 /** 1360 * Whether the window layout is in full screen mode(whether the window is immersive). The default value is false. 1361 * 1362 * @type { boolean } 1363 * @syscap SystemCapability.WindowManager.WindowManager.Core 1364 * @since 7 1365 */ 1366 /** 1367 * Whether the window layout is in full screen mode(whether the window is immersive). The default value is false. 1368 * 1369 * @type { boolean } 1370 * @syscap SystemCapability.WindowManager.WindowManager.Core 1371 * @atomicservice 1372 * @since 12 1373 */ 1374 isLayoutFullScreen: boolean; 1375 1376 /** 1377 * Whether the window can gain focus. The default value is true 1378 * 1379 * @type { boolean } 1380 * @syscap SystemCapability.WindowManager.WindowManager.Core 1381 * @since 7 1382 */ 1383 /** 1384 * Whether the window can gain focus. The default value is true 1385 * 1386 * @type { boolean } 1387 * @syscap SystemCapability.WindowManager.WindowManager.Core 1388 * @atomicservice 1389 * @since 12 1390 */ 1391 focusable: boolean; 1392 1393 /** 1394 * Whether the window is touchable. The default value is false 1395 * 1396 * @type { boolean } 1397 * @syscap SystemCapability.WindowManager.WindowManager.Core 1398 * @since 7 1399 */ 1400 /** 1401 * Whether the window is touchable. The default value is false 1402 * 1403 * @type { boolean } 1404 * @syscap SystemCapability.WindowManager.WindowManager.Core 1405 * @atomicservice 1406 * @since 12 1407 */ 1408 touchable: boolean; 1409 1410 /** 1411 * Brightness value of window. 1412 * 1413 * @syscap SystemCapability.WindowManager.WindowManager.Core 1414 * @since 6 1415 */ 1416 /** 1417 * Brightness value of window. 1418 * 1419 * @type { number } 1420 * @syscap SystemCapability.WindowManager.WindowManager.Core 1421 * @crossplatform 1422 * @since 10 1423 */ 1424 /** 1425 * Brightness value of window. 1426 * 1427 * @type { number } 1428 * @syscap SystemCapability.WindowManager.WindowManager.Core 1429 * @crossplatform 1430 * @atomicservice 1431 * @since 11 1432 */ 1433 brightness: number; 1434 1435 /** 1436 * The dimbehind value of window. 1437 * 1438 * @type { number } 1439 * @syscap SystemCapability.WindowManager.WindowManager.Core 1440 * @since 7 1441 * @deprecated since 9 1442 */ 1443 dimBehindValue: number; 1444 1445 /** 1446 * Whether keep screen on. 1447 * 1448 * @syscap SystemCapability.WindowManager.WindowManager.Core 1449 * @since 6 1450 */ 1451 /** 1452 * Whether keep screen on. 1453 * 1454 * @type { boolean } 1455 * @syscap SystemCapability.WindowManager.WindowManager.Core 1456 * @crossplatform 1457 * @since 10 1458 */ 1459 /** 1460 * Whether keep screen on. 1461 * 1462 * @type { boolean } 1463 * @syscap SystemCapability.WindowManager.WindowManager.Core 1464 * @crossplatform 1465 * @atomicservice 1466 * @since 11 1467 */ 1468 isKeepScreenOn: boolean; 1469 1470 /** 1471 * Whether make window in privacy mode or not. 1472 * 1473 * @type { boolean } 1474 * @syscap SystemCapability.WindowManager.WindowManager.Core 1475 * @since 7 1476 */ 1477 /** 1478 * Whether make window in privacy mode or not. 1479 * 1480 * @type { boolean } 1481 * @syscap SystemCapability.WindowManager.WindowManager.Core 1482 * @atomicservice 1483 * @since 12 1484 */ 1485 isPrivacyMode: boolean; 1486 1487 /** 1488 * Whether is round corner or not. 1489 * 1490 * @type { boolean } 1491 * @syscap SystemCapability.WindowManager.WindowManager.Core 1492 * @since 7 1493 * @deprecated since 9 1494 */ 1495 isRoundCorner: boolean; 1496 1497 /** 1498 * Whether is transparent or not. 1499 * 1500 * @type { boolean } 1501 * @syscap SystemCapability.WindowManager.WindowManager.Core 1502 * @since 7 1503 */ 1504 /** 1505 * Whether is transparent or not. 1506 * 1507 * @type { boolean } 1508 * @syscap SystemCapability.WindowManager.WindowManager.Core 1509 * @atomicservice 1510 * @since 12 1511 */ 1512 isTransparent: boolean; 1513 1514 /** 1515 * Window id. 1516 * 1517 * @type { number } 1518 * @syscap SystemCapability.WindowManager.WindowManager.Core 1519 * @since 9 1520 */ 1521 /** 1522 * Window id. 1523 * 1524 * @type { number } 1525 * @syscap SystemCapability.WindowManager.WindowManager.Core 1526 * @atomicservice 1527 * @since 12 1528 */ 1529 id: number; 1530 1531 /** 1532 * display id. 1533 * 1534 * @type { ?number } 1535 * @syscap SystemCapability.WindowManager.WindowManager.Core 1536 * @atomicservice 1537 * @since 12 1538 */ 1539 displayId?: number; 1540 } 1541 1542 /** 1543 * The decor button style of the window. 1544 * 1545 * @interface DecorButtonStyle 1546 * @syscap SystemCapability.Window.SessionManager 1547 * @atomicservice 1548 * @since 14 1549 */ 1550 interface DecorButtonStyle { 1551 /** 1552 * color mode. 1553 * 1554 * @type { ?colorMode } 1555 * @syscap SystemCapability.Window.SessionManager 1556 * @atomicservice 1557 * @since 14 1558 */ 1559 colorMode?: ConfigurationConstant.ColorMode; 1560 1561 /** 1562 * button background size when hover. 1563 * 1564 * @type { ?number } 1565 * @syscap SystemCapability.Window.SessionManager 1566 * @atomicservice 1567 * @since 14 1568 */ 1569 buttonBackgroundSize? : number; 1570 1571 /** 1572 * button spacing. 1573 * 1574 * @type { ?number } 1575 * @syscap SystemCapability.Window.SessionManager 1576 * @atomicservice 1577 * @since 14 1578 */ 1579 spacingBetweenButtons? : number; 1580 1581 /** 1582 * close button right Margin. 1583 * 1584 * @type { ?number } 1585 * @syscap SystemCapability.Window.SessionManager 1586 * @atomicservice 1587 * @since 14 1588 */ 1589 closeButtonRightMargin? : number; 1590 } 1591 1592 /** 1593 * Type of allowing the specified of color space. 1594 * 1595 * @enum { number } 1596 * @syscap SystemCapability.WindowManager.WindowManager.Core 1597 * @since 8 1598 */ 1599 /** 1600 * Type of allowing the specified of color space. 1601 * 1602 * @enum { number } 1603 * @syscap SystemCapability.WindowManager.WindowManager.Core 1604 * @crossplatform 1605 * @since 11 1606 */ 1607 /** 1608 * Type of allowing the specified of color space. 1609 * 1610 * @enum { number } 1611 * @syscap SystemCapability.WindowManager.WindowManager.Core 1612 * @crossplatform 1613 * @atomicservice 1614 * @since 12 1615 */ 1616 enum ColorSpace { 1617 /** 1618 * Default color space. 1619 * 1620 * @syscap SystemCapability.WindowManager.WindowManager.Core 1621 * @since 8 1622 */ 1623 /** 1624 * Default color space. 1625 * 1626 * @syscap SystemCapability.WindowManager.WindowManager.Core 1627 * @crossplatform 1628 * @since 11 1629 */ 1630 /** 1631 * Default color space. 1632 * 1633 * @syscap SystemCapability.WindowManager.WindowManager.Core 1634 * @crossplatform 1635 * @atomicservice 1636 * @since 12 1637 */ 1638 DEFAULT, 1639 /** 1640 * Wide gamut color space. The specific wide color gamut depends on thr screen. 1641 * 1642 * @syscap SystemCapability.WindowManager.WindowManager.Core 1643 * @since 8 1644 */ 1645 /** 1646 * Wide gamut color space. The specific wide color gamut depends on thr screen. 1647 * 1648 * @syscap SystemCapability.WindowManager.WindowManager.Core 1649 * @crossplatform 1650 * @since 11 1651 */ 1652 /** 1653 * Wide gamut color space. The specific wide color gamut depends on thr screen. 1654 * 1655 * @syscap SystemCapability.WindowManager.WindowManager.Core 1656 * @crossplatform 1657 * @atomicservice 1658 * @since 12 1659 */ 1660 WIDE_GAMUT 1661 } 1662 /** 1663 * Describes the scale Transition Options of window 1664 * 1665 * @interface ScaleOptions 1666 * @syscap SystemCapability.WindowManager.WindowManager.Core 1667 * @systemapi 1668 * @since 9 1669 */ 1670 interface ScaleOptions { 1671 /** 1672 * The scale param of x direction. Default is 1.f 1673 * 1674 * @type { ?number } 1675 * @syscap SystemCapability.WindowManager.WindowManager.Core 1676 * @systemapi 1677 * @since 9 1678 */ 1679 x?: number; 1680 1681 /** 1682 * The scale param of y direction. Default is 1.f 1683 * 1684 * @type { ?number } 1685 * @syscap SystemCapability.WindowManager.WindowManager.Core 1686 * @systemapi 1687 * @since 9 1688 */ 1689 y?: number; 1690 1691 /** 1692 * The scale param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 1693 * 1694 * @type { ?number } 1695 * @syscap SystemCapability.WindowManager.WindowManager.Core 1696 * @systemapi 1697 * @since 9 1698 */ 1699 pivotX?: number; 1700 1701 /** 1702 * The scale param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 1703 * 1704 * @type { ?number } 1705 * @syscap SystemCapability.WindowManager.WindowManager.Core 1706 * @systemapi 1707 * @since 9 1708 */ 1709 pivotY?: number; 1710 } 1711 1712 /** 1713 * Describes the rotate Transition Options of window 1714 * 1715 * @interface RotateOptions 1716 * @syscap SystemCapability.WindowManager.WindowManager.Core 1717 * @systemapi 1718 * @since 9 1719 */ 1720 interface RotateOptions { 1721 /** 1722 * The rotate degree of x direction. Default value is 0.f 1723 * 1724 * @type { ?number } 1725 * @syscap SystemCapability.WindowManager.WindowManager.Core 1726 * @systemapi 1727 * @since 9 1728 */ 1729 x?: number; 1730 1731 /** 1732 * The rotate degree of y direction. Default value is 0.f 1733 * 1734 * @type { ?number } 1735 * @syscap SystemCapability.WindowManager.WindowManager.Core 1736 * @systemapi 1737 * @since 9 1738 */ 1739 y?: number; 1740 1741 /** 1742 * The rotate degree of z direction. Default value is 0.f 1743 * 1744 * @type { ?number } 1745 * @syscap SystemCapability.WindowManager.WindowManager.Core 1746 * @systemapi 1747 * @since 9 1748 */ 1749 z?: number; 1750 1751 /** 1752 * The param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 1753 * 1754 * @type { ?number } 1755 * @syscap SystemCapability.WindowManager.WindowManager.Core 1756 * @systemapi 1757 * @since 9 1758 */ 1759 pivotX?: number; 1760 1761 /** 1762 * The param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 1763 * 1764 * @type { ?number } 1765 * @syscap SystemCapability.WindowManager.WindowManager.Core 1766 * @systemapi 1767 * @since 9 1768 */ 1769 pivotY?: number; 1770 } 1771 1772 /** 1773 * Describes the translate Transition Options of window 1774 * 1775 * @interface TranslateOptions 1776 * @syscap SystemCapability.WindowManager.WindowManager.Core 1777 * @systemapi 1778 * @since 9 1779 */ 1780 interface TranslateOptions { 1781 /** 1782 * The translate pixel param of x direction. Default is 0.f 1783 * 1784 * @type { ?number } 1785 * @syscap SystemCapability.WindowManager.WindowManager.Core 1786 * @systemapi 1787 * @since 9 1788 */ 1789 x?: number; 1790 1791 /** 1792 * The translate pixel param of y direction. Default is 0.f 1793 * 1794 * @type { ?number } 1795 * @syscap SystemCapability.WindowManager.WindowManager.Core 1796 * @systemapi 1797 * @since 9 1798 */ 1799 y?: number; 1800 1801 /** 1802 * The translate pixel param of z direction. Default is 0.f 1803 * 1804 * @type { ?number } 1805 * @syscap SystemCapability.WindowManager.WindowManager.Core 1806 * @systemapi 1807 * @since 9 1808 */ 1809 z?: number; 1810 } 1811 1812 /** 1813 * Transition Context 1814 * 1815 * @interface TransitionContext 1816 * @syscap SystemCapability.WindowManager.WindowManager.Core 1817 * @systemapi 1818 * @since 9 1819 */ 1820 interface TransitionContext { 1821 /** 1822 * The target window with animation 1823 * 1824 * @type { Window } 1825 * @syscap SystemCapability.WindowManager.WindowManager.Core 1826 * @systemapi 1827 * @since 9 1828 */ 1829 toWindow: Window; 1830 1831 /** 1832 * Set complete state of animation transition 1833 * 1834 * @param { boolean } isCompleted - Whether the transition is complete. The value true means that the transition is complete, and false means the opposite. 1835 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 1836 * 2. Incorrect parameter types. 1837 * @syscap SystemCapability.WindowManager.WindowManager.Core 1838 * @systemapi 1839 * @since 9 1840 */ 1841 /** 1842 * Set complete state of animation transition 1843 * 1844 * @param { boolean } isCompleted - Whether the transition is complete. The value true means that the transition is complete, and false means the opposite. 1845 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1846 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 1847 * 2. Incorrect parameter types. 1848 * @syscap SystemCapability.WindowManager.WindowManager.Core 1849 * @systemapi 1850 * @since 12 1851 */ 1852 completeTransition(isCompleted: boolean): void; 1853 } 1854 1855 /** 1856 * Transition Controller 1857 * 1858 * @interface TransitionController 1859 * @syscap SystemCapability.WindowManager.WindowManager.Core 1860 * @systemapi 1861 * @since 9 1862 */ 1863 interface TransitionController { 1864 /** 1865 * Animation configuration when showing window 1866 * 1867 * @param { TransitionContext } context - The transition context. 1868 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 1869 * 2. Incorrect parameter types. 1870 * @syscap SystemCapability.WindowManager.WindowManager.Core 1871 * @systemapi 1872 * @since 9 1873 */ 1874 /** 1875 * Animation configuration when showing window 1876 * 1877 * @param { TransitionContext } context - The transition context. 1878 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1879 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 1880 * 2. Incorrect parameter types. 1881 * @syscap SystemCapability.WindowManager.WindowManager.Core 1882 * @systemapi 1883 * @since 12 1884 */ 1885 animationForShown(context: TransitionContext): void; 1886 /** 1887 * Animation configuration when hiding window 1888 * 1889 * @param { TransitionContext } context - The transition context. 1890 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 1891 * 2. Incorrect parameter types. 1892 * @syscap SystemCapability.WindowManager.WindowManager.Core 1893 * @systemapi 1894 * @since 9 1895 */ 1896 /** 1897 * Animation configuration when hiding window 1898 * 1899 * @param { TransitionContext } context - The transition context. 1900 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1901 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 1902 * 2. Incorrect parameter types. 1903 * @syscap SystemCapability.WindowManager.WindowManager.Core 1904 * @systemapi 1905 * @since 12 1906 */ 1907 animationForHidden(context: TransitionContext): void; 1908 } 1909 1910 /** 1911 * Configuration parameters for window creation. 1912 * 1913 * @interface Configuration 1914 * @syscap SystemCapability.WindowManager.WindowManager.Core 1915 * @since 9 1916 */ 1917 /** 1918 * Configuration parameters for window creation. 1919 * 1920 * @interface Configuration 1921 * @syscap SystemCapability.WindowManager.WindowManager.Core 1922 * @atomicservice 1923 * @since 12 1924 */ 1925 interface Configuration { 1926 /** 1927 * Indicates window id. 1928 * 1929 * @syscap SystemCapability.WindowManager.WindowManager.Core 1930 * @since 9 1931 */ 1932 /** 1933 * Indicates window id. 1934 * 1935 * @type { string } 1936 * @syscap SystemCapability.WindowManager.WindowManager.Core 1937 * @atomicservice 1938 * @since 12 1939 */ 1940 name: string; 1941 1942 /** 1943 * Indicates window type 1944 * 1945 * @type { WindowType } 1946 * @syscap SystemCapability.WindowManager.WindowManager.Core 1947 * @since 9 1948 */ 1949 /** 1950 * Indicates window type 1951 * 1952 * @type { WindowType } 1953 * @syscap SystemCapability.WindowManager.WindowManager.Core 1954 * @atomicservice 1955 * @since 12 1956 */ 1957 windowType: WindowType; 1958 1959 /** 1960 * Indicates window context. 1961 * 1962 * @type { ?BaseContext } 1963 * @syscap SystemCapability.WindowManager.WindowManager.Core 1964 * @since 9 1965 */ 1966 /** 1967 * Indicates window context. 1968 * 1969 * @type { ?BaseContext } 1970 * @syscap SystemCapability.WindowManager.WindowManager.Core 1971 * @atomicservice 1972 * @since 12 1973 */ 1974 ctx?: BaseContext; 1975 1976 /** 1977 * Indicates display ID. 1978 * 1979 * @type { ?number } 1980 * @syscap SystemCapability.WindowManager.WindowManager.Core 1981 * @since 9 1982 */ 1983 /** 1984 * Indicates display ID. 1985 * 1986 * @type { ?number } 1987 * @syscap SystemCapability.WindowManager.WindowManager.Core 1988 * @atomicservice 1989 * @since 12 1990 */ 1991 displayId?: number; 1992 1993 /** 1994 * Indicates Parent window id 1995 * 1996 * @type { ?number } 1997 * @syscap SystemCapability.WindowManager.WindowManager.Core 1998 * @since 9 1999 */ 2000 /** 2001 * Indicates Parent window id 2002 * 2003 * @type { ?number } 2004 * @syscap SystemCapability.WindowManager.WindowManager.Core 2005 * @atomicservice 2006 * @since 12 2007 */ 2008 parentId?: number; 2009 2010 /** 2011 * Indicates whether enable window decor, only support dialog, The default value is false. 2012 * 2013 * @type { ?boolean } 2014 * @syscap SystemCapability.Window.SessionManager 2015 * @atomicservice 2016 * @since 12 2017 */ 2018 decorEnabled?: boolean; 2019 2020 /** 2021 * Indicates dialog window title when decor enabled. 2022 * 2023 * @type { ?string } 2024 * @syscap SystemCapability.Window.SessionManager 2025 * @atomicservice 2026 * @since 12 2027 */ 2028 title?: string; 2029 } 2030 2031 /** 2032 * Limits of window. 2033 * 2034 * @interface WindowLimits 2035 * @syscap SystemCapability.Window.SessionManager 2036 * @since 11 2037 */ 2038 /** 2039 * Limits of window. 2040 * 2041 * @interface WindowLimits 2042 * @syscap SystemCapability.Window.SessionManager 2043 * @atomicservice 2044 * @since 12 2045 */ 2046 interface WindowLimits { 2047 2048 /** 2049 * The maximum width of the window. 2050 * 2051 * @type { ?number } 2052 * @syscap SystemCapability.Window.SessionManager 2053 * @since 11 2054 */ 2055 /** 2056 * The maximum width of the window. 2057 * 2058 * @type { ?number } 2059 * @syscap SystemCapability.Window.SessionManager 2060 * @atomicservice 2061 * @since 12 2062 */ 2063 maxWidth?: number; 2064 2065 /** 2066 * The maximum height of the window. 2067 * 2068 * @type { ?number } 2069 * @syscap SystemCapability.Window.SessionManager 2070 * @since 11 2071 */ 2072 /** 2073 * The maximum height of the window. 2074 * 2075 * @type { ?number } 2076 * @syscap SystemCapability.Window.SessionManager 2077 * @atomicservice 2078 * @since 12 2079 */ 2080 maxHeight?: number; 2081 2082 /** 2083 * The minimum width of the window. 2084 * 2085 * @type { ?number } 2086 * @syscap SystemCapability.Window.SessionManager 2087 * @since 11 2088 */ 2089 /** 2090 * The minimum width of the window. 2091 * 2092 * @type { ?number } 2093 * @syscap SystemCapability.Window.SessionManager 2094 * @atomicservice 2095 * @since 12 2096 */ 2097 minWidth?: number; 2098 2099 /** 2100 * The minimum height of the window. 2101 * 2102 * @type { ?number } 2103 * @syscap SystemCapability.Window.SessionManager 2104 * @since 11 2105 */ 2106 /** 2107 * The minimum height of the window. 2108 * 2109 * @type { ?number } 2110 * @syscap SystemCapability.Window.SessionManager 2111 * @atomicservice 2112 * @since 12 2113 */ 2114 minHeight?: number; 2115 } 2116 2117 /** 2118 * Rectangular area of the title buttons relative to the upper right corner of the window. 2119 * 2120 * @interface TitleButtonRect 2121 * @syscap SystemCapability.Window.SessionManager 2122 * @since 11 2123 */ 2124 /** 2125 * Rectangular area of the title buttons relative to the upper right corner of the window. 2126 * 2127 * @interface TitleButtonRect 2128 * @syscap SystemCapability.Window.SessionManager 2129 * @atomicservice 2130 * @since 12 2131 */ 2132 interface TitleButtonRect { 2133 2134 /** 2135 * The right of the Rect. 2136 * 2137 * @type { number } 2138 * @syscap SystemCapability.Window.SessionManager 2139 * @since 11 2140 */ 2141 /** 2142 * The right of the Rect. 2143 * 2144 * @type { number } 2145 * @syscap SystemCapability.Window.SessionManager 2146 * @atomicservice 2147 * @since 12 2148 */ 2149 right: number; 2150 2151 /** 2152 * The top of the Rect. 2153 * 2154 * @type { number } 2155 * @syscap SystemCapability.Window.SessionManager 2156 * @since 11 2157 */ 2158 /** 2159 * The top of the Rect. 2160 * 2161 * @type { number } 2162 * @syscap SystemCapability.Window.SessionManager 2163 * @atomicservice 2164 * @since 12 2165 */ 2166 top: number; 2167 2168 /** 2169 * The width of the Rect. 2170 * 2171 * @type { number } 2172 * @syscap SystemCapability.Window.SessionManager 2173 * @since 11 2174 */ 2175 /** 2176 * The width of the Rect. 2177 * 2178 * @type { number } 2179 * @syscap SystemCapability.Window.SessionManager 2180 * @atomicservice 2181 * @since 12 2182 */ 2183 width: number; 2184 2185 /** 2186 * The height of the Rect. 2187 * 2188 * @type { number } 2189 * @syscap SystemCapability.Window.SessionManager 2190 * @since 11 2191 */ 2192 /** 2193 * The height of the Rect. 2194 * 2195 * @type { number } 2196 * @syscap SystemCapability.Window.SessionManager 2197 * @atomicservice 2198 * @since 12 2199 */ 2200 height: number; 2201 } 2202 2203 /** 2204 * Rect change options 2205 * 2206 * @interface RectChangeOptions 2207 * @syscap SystemCapability.Window.SessionManager 2208 * @atomicservice 2209 * @since 12 2210 */ 2211 interface RectChangeOptions { 2212 /** 2213 * Rect 2214 * 2215 * @type { Rect } 2216 * @syscap SystemCapability.Window.SessionManager 2217 * @atomicservice 2218 * @since 12 2219 */ 2220 rect: Rect, 2221 2222 /** 2223 * Rect change reason 2224 * 2225 * @type { RectChangeReason } 2226 * @syscap SystemCapability.Window.SessionManager 2227 * @atomicservice 2228 * @since 12 2229 */ 2230 reason: RectChangeReason 2231 } 2232 2233 /** 2234 * Avoid area options 2235 * 2236 * @interface AvoidAreaOptions 2237 * @syscap SystemCapability.WindowManager.WindowManager.Core 2238 * @atomicservice 2239 * @since 12 2240 */ 2241 interface AvoidAreaOptions { 2242 /** 2243 * Avoid area type 2244 * 2245 * @type { AvoidAreaType } 2246 * @syscap SystemCapability.WindowManager.WindowManager.Core 2247 * @atomicservice 2248 * @since 12 2249 */ 2250 type: AvoidAreaType, 2251 2252 /** 2253 * Avoid area 2254 * 2255 * @type { AvoidArea } 2256 * @syscap SystemCapability.WindowManager.WindowManager.Core 2257 * @atomicservice 2258 * @since 12 2259 */ 2260 area: AvoidArea 2261 } 2262 2263 /** 2264 * Window rect change reason. 2265 * 2266 * @enum { number } 2267 * @syscap SystemCapability.Window.SessionManager 2268 * @atomicservice 2269 * @since 12 2270 */ 2271 enum RectChangeReason { 2272 /** 2273 * Default RectChangeReason. 2274 * 2275 * @syscap SystemCapability.Window.SessionManager 2276 * @atomicservice 2277 * @since 12 2278 */ 2279 UNDEFINED = 0, 2280 2281 /** 2282 * Window maximize. 2283 * 2284 * @syscap SystemCapability.Window.SessionManager 2285 * @atomicservice 2286 * @since 12 2287 */ 2288 MAXIMIZE, 2289 2290 /** 2291 * Window recover. 2292 * 2293 * @syscap SystemCapability.Window.SessionManager 2294 * @atomicservice 2295 * @since 12 2296 */ 2297 RECOVER, 2298 2299 /** 2300 * Window move. 2301 * 2302 * @syscap SystemCapability.Window.SessionManager 2303 * @atomicservice 2304 * @since 12 2305 */ 2306 MOVE, 2307 2308 /** 2309 * Window drag. 2310 * 2311 * @syscap SystemCapability.Window.SessionManager 2312 * @atomicservice 2313 * @since 12 2314 */ 2315 DRAG, 2316 2317 /** 2318 * Window drag start. 2319 * 2320 * @syscap SystemCapability.Window.SessionManager 2321 * @atomicservice 2322 * @since 12 2323 */ 2324 DRAG_START, 2325 2326 /** 2327 * Window drag end. 2328 * 2329 * @syscap SystemCapability.Window.SessionManager 2330 * @atomicservice 2331 * @since 12 2332 */ 2333 DRAG_END, 2334 } 2335 2336 /** 2337 * Create a window with a specific configuration 2338 * 2339 * @param { Configuration } config - Parameters for window creation. 2340 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 2341 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 2342 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2343 * 2. Incorrect parameter types. 2344 * @throws { BusinessError } 1300001 - Repeated operation. 2345 * @throws { BusinessError } 1300006 - This window context is abnormal. 2346 * @throws { BusinessError } 1300008 - The display device is abnormal. 2347 * @throws { BusinessError } 1300009 - The parent window is invalid. 2348 * @syscap SystemCapability.WindowManager.WindowManager.Core 2349 * @since 9 2350 */ 2351 /** 2352 * Create a window with a specific configuration 2353 * When config.windowType == TYPE_FLOAT, the "ohos.permission.SYSTEM_FLOAT_WINDOW" permission is required 2354 * 2355 * @permission ohos.permission.SYSTEM_FLOAT_WINDOW 2356 * @param { Configuration } config - Parameters for window creation. 2357 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 2358 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 2359 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2360 * 2. Incorrect parameter types. 2361 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2362 * @throws { BusinessError } 1300001 - Repeated operation. 2363 * @throws { BusinessError } 1300002 - This window state is abnormal. 2364 * @throws { BusinessError } 1300004 - Unauthorized operation. 2365 * @throws { BusinessError } 1300006 - This window context is abnormal. 2366 * @throws { BusinessError } 1300008 - The display device is abnormal. 2367 * @throws { BusinessError } 1300009 - The parent window is invalid. 2368 * @syscap SystemCapability.WindowManager.WindowManager.Core 2369 * @atomicservice 2370 * @since 12 2371 */ 2372 function createWindow(config: Configuration, callback: AsyncCallback<Window>): void; 2373 2374 /** 2375 * Create a window with a specific configuration 2376 * 2377 * @param { Configuration } config - Parameters for window creation. 2378 * @returns { Promise<Window> } Promise used to return the window created. 2379 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 2380 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2381 * 2. Incorrect parameter types. 2382 * @throws { BusinessError } 1300001 - Repeated operation. 2383 * @throws { BusinessError } 1300006 - This window context is abnormal. 2384 * @throws { BusinessError } 1300008 - The display device is abnormal. 2385 * @throws { BusinessError } 1300009 - The parent window is invalid. 2386 * @syscap SystemCapability.WindowManager.WindowManager.Core 2387 * @since 9 2388 */ 2389 /** 2390 * Create a window with a specific configuration 2391 * When config.windowType == TYPE_FLOAT, the "ohos.permission.SYSTEM_FLOAT_WINDOW" permission is required 2392 * 2393 * @permission ohos.permission.SYSTEM_FLOAT_WINDOW 2394 * @param { Configuration } config - Parameters for window creation. 2395 * @returns { Promise<Window> } Promise used to return the window created. 2396 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 2397 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2398 * 2. Incorrect parameter types. 2399 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2400 * @throws { BusinessError } 1300001 - Repeated operation. 2401 * @throws { BusinessError } 1300002 - This window state is abnormal. 2402 * @throws { BusinessError } 1300004 - Unauthorized operation. 2403 * @throws { BusinessError } 1300006 - This window context is abnormal. 2404 * @throws { BusinessError } 1300008 - The display device is abnormal. 2405 * @throws { BusinessError } 1300009 - The parent window is invalid. 2406 * @syscap SystemCapability.WindowManager.WindowManager.Core 2407 * @atomicservice 2408 * @since 12 2409 */ 2410 function createWindow(config: Configuration): Promise<Window>; 2411 2412 /** 2413 * Create a sub window with a specific id and type, only support 7. 2414 * 2415 * @param { string } id - Indicates window id. 2416 * @param { WindowType } type - Indicates window type. 2417 * @param { AsyncCallback<Window> } callback - Callback used to return the subwindow created. 2418 * @syscap SystemCapability.WindowManager.WindowManager.Core 2419 * @FAModelOnly 2420 * @since 7 2421 * @deprecated since 9 2422 * @useinstead ohos.window#createWindow 2423 */ 2424 function create(id: string, type: WindowType, callback: AsyncCallback<Window>): void; 2425 2426 /** 2427 * Create a sub window with a specific id and type, only support 7. 2428 * 2429 * @param { string } id - Indicates window id. 2430 * @param { WindowType } type - Indicates window type. 2431 * @returns { Promise<Window> } Promise used to return the subwindow created. 2432 * @syscap SystemCapability.WindowManager.WindowManager.Core 2433 * @FAModelOnly 2434 * @since 7 2435 * @deprecated since 9 2436 * @useinstead ohos.window#createWindow 2437 */ 2438 function create(id: string, type: WindowType): Promise<Window>; 2439 2440 /** 2441 * Create a system or float window with a specific id and type. 2442 * 2443 * @param { BaseContext } ctx - Indicates the context on which the window depends 2444 * @param { string } id - Indicates window id. 2445 * @param { WindowType } type - Indicates window type. 2446 * @returns { Promise<Window> } Promise used to return the window created. 2447 * @syscap SystemCapability.WindowManager.WindowManager.Core 2448 * @since 8 2449 * @deprecated since 9 2450 * @useinstead ohos.window#createWindow 2451 */ 2452 function create(ctx: BaseContext, id: string, type: WindowType): Promise<Window>; 2453 2454 /** 2455 * Create a system or float window with a specific id and type. 2456 * 2457 * @param { BaseContext } ctx - Indicates the context on which the window depends 2458 * @param { string } id - Indicates window id. 2459 * @param { WindowType } type - Indicates window type. 2460 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 2461 * @syscap SystemCapability.WindowManager.WindowManager.Core 2462 * @since 8 2463 * @deprecated since 9 2464 * @useinstead ohos.window#createWindow 2465 */ 2466 function create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback<Window>): void; 2467 2468 /** 2469 * Find the window by id. 2470 * 2471 * @param { string } id - Indicates window id. 2472 * @param { AsyncCallback<Window> } callback - Callback used to return the window found. 2473 * @syscap SystemCapability.WindowManager.WindowManager.Core 2474 * @since 7 2475 * @deprecated since 9 2476 * @useinstead ohos.window#findWindow 2477 */ 2478 function find(id: string, callback: AsyncCallback<Window>): void; 2479 2480 /** 2481 * Find the window by id. 2482 * 2483 * @param { string } id - Indicates window id. 2484 * @returns { Promise<Window> } Window found. 2485 * @syscap SystemCapability.WindowManager.WindowManager.Core 2486 * @since 7 2487 * @deprecated since 9 2488 * @useinstead ohos.window#findWindow 2489 */ 2490 function find(id: string): Promise<Window>; 2491 2492 /** 2493 * Find the window by name. 2494 * 2495 * @param { string } name - Indicates window name. 2496 * @returns { Window } Window found. 2497 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2498 * 2. Incorrect parameter types. 2499 * @throws { BusinessError } 1300002 - This window state is abnormal. 2500 * @syscap SystemCapability.WindowManager.WindowManager.Core 2501 * @since 9 2502 */ 2503 /** 2504 * Find the window by name. 2505 * 2506 * @param { string } name - Indicates window name. 2507 * @returns { Window } Window found. 2508 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2509 * 2. Incorrect parameter types. 2510 * @throws { BusinessError } 1300002 - This window state is abnormal. 2511 * @syscap SystemCapability.WindowManager.WindowManager.Core 2512 * @crossplatform 2513 * @since 10 2514 */ 2515 /** 2516 * Find the window by name. 2517 * 2518 * @param { string } name - Indicates window name. 2519 * @returns { Window } Window found. 2520 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2521 * 2. Incorrect parameter types. 2522 * @throws { BusinessError } 1300002 - This window state is abnormal. 2523 * @syscap SystemCapability.WindowManager.WindowManager.Core 2524 * @crossplatform 2525 * @atomicservice 2526 * @since 11 2527 */ 2528 function findWindow(name: string): Window; 2529 2530 /** 2531 * Get the final show window. 2532 * 2533 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 2534 * @syscap SystemCapability.WindowManager.WindowManager.Core 2535 * @FAModelOnly 2536 * @since 6 2537 * @deprecated since 9 2538 * @useinstead ohos.window#getLastWindow 2539 */ 2540 function getTopWindow(callback: AsyncCallback<Window>): void; 2541 2542 /** 2543 * Get the final show window. 2544 * 2545 * @returns { Promise<Window> } Promise used to return the top window obtained. 2546 * @syscap SystemCapability.WindowManager.WindowManager.Core 2547 * @FAModelOnly 2548 * @since 6 2549 * @deprecated since 9 2550 * @useinstead ohos.window#getLastWindow 2551 */ 2552 function getTopWindow(): Promise<Window>; 2553 2554 /** 2555 * Get the final show window. 2556 * 2557 * @param { BaseContext } ctx - Indicates the context on which the window depends 2558 * @returns { Promise<Window> } Promise used to return the top window obtained. 2559 * @syscap SystemCapability.WindowManager.WindowManager.Core 2560 * @since 8 2561 * @deprecated since 9 2562 * @useinstead ohos.window#getLastWindow 2563 */ 2564 function getTopWindow(ctx: BaseContext): Promise<Window>; 2565 2566 /** 2567 * Get the final show window. 2568 * 2569 * @param { BaseContext } ctx - Indicates the context on which the window depends 2570 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 2571 * @syscap SystemCapability.WindowManager.WindowManager.Core 2572 * @since 8 2573 * @deprecated since 9 2574 * @useinstead ohos.window#getLastWindow 2575 */ 2576 function getTopWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 2577 2578 /** 2579 * Get the final show window. 2580 * 2581 * @param { BaseContext } ctx - Current application context. 2582 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 2583 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2584 * 2. Incorrect parameter types. 2585 * @throws { BusinessError } 1300002 - This window state is abnormal. 2586 * @throws { BusinessError } 1300006 - This window context is abnormal. 2587 * @syscap SystemCapability.WindowManager.WindowManager.Core 2588 * @since 9 2589 */ 2590 /** 2591 * Get the final show window. 2592 * 2593 * @param { BaseContext } ctx - Current application context. 2594 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 2595 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2596 * 2. Incorrect parameter types. 2597 * @throws { BusinessError } 1300002 - This window state is abnormal. 2598 * @throws { BusinessError } 1300006 - This window context is abnormal. 2599 * @syscap SystemCapability.WindowManager.WindowManager.Core 2600 * @crossplatform 2601 * @since 10 2602 */ 2603 /** 2604 * Get the final show window. 2605 * 2606 * @param { BaseContext } ctx - Current application context. 2607 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 2608 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2609 * 2. Incorrect parameter types. 2610 * @throws { BusinessError } 1300002 - This window state is abnormal. 2611 * @throws { BusinessError } 1300006 - This window context is abnormal. 2612 * @syscap SystemCapability.WindowManager.WindowManager.Core 2613 * @crossplatform 2614 * @atomicservice 2615 * @since 12 2616 */ 2617 function getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 2618 2619 /** 2620 * Get the final show window. 2621 * 2622 * @param { BaseContext } ctx - Current application context. 2623 * @returns { Promise<Window> } Promise used to return the top window obtained. 2624 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2625 * 2. Incorrect parameter types. 2626 * @throws { BusinessError } 1300002 - This window state is abnormal. 2627 * @throws { BusinessError } 1300006 - This window context is abnormal. 2628 * @syscap SystemCapability.WindowManager.WindowManager.Core 2629 * @since 9 2630 */ 2631 /** 2632 * Get the final show window. 2633 * 2634 * @param { BaseContext } ctx - Current application context. 2635 * @returns { Promise<Window> } Promise used to return the top window obtained. 2636 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2637 * 2. Incorrect parameter types. 2638 * @throws { BusinessError } 1300002 - This window state is abnormal. 2639 * @throws { BusinessError } 1300006 - This window context is abnormal. 2640 * @syscap SystemCapability.WindowManager.WindowManager.Core 2641 * @crossplatform 2642 * @since 10 2643 */ 2644 /** 2645 * Get the final show window. 2646 * 2647 * @param { BaseContext } ctx - Current application context. 2648 * @returns { Promise<Window> } Promise used to return the top window obtained. 2649 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2650 * 2. Incorrect parameter types. 2651 * @throws { BusinessError } 1300002 - This window state is abnormal. 2652 * @throws { BusinessError } 1300006 - This window context is abnormal. 2653 * @syscap SystemCapability.WindowManager.WindowManager.Core 2654 * @crossplatform 2655 * @atomicservice 2656 * @since 12 2657 */ 2658 function getLastWindow(ctx: BaseContext): Promise<Window>; 2659 2660 /** 2661 * Minimize all app windows. 2662 * 2663 * @param { number } id - ID of the display. 2664 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2665 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2666 * 2. Incorrect parameter types; 2667 * 3. Parameter verification failed. 2668 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2669 * @syscap SystemCapability.WindowManager.WindowManager.Core 2670 * @systemapi Hide this for inner system use. 2671 * @since 9 2672 */ 2673 /** 2674 * Minimize all app windows. 2675 * 2676 * @param { number } id - ID of the display. 2677 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2678 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2679 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2680 * 2. Incorrect parameter types; 2681 * 3. Parameter verification failed. 2682 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2683 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2684 * @syscap SystemCapability.WindowManager.WindowManager.Core 2685 * @systemapi Hide this for inner system use. 2686 * @since 12 2687 */ 2688 function minimizeAll(id: number, callback: AsyncCallback<void>): void; 2689 2690 /** 2691 * Minimize all app windows. 2692 * 2693 * @param { number } id - ID of the display. 2694 * @returns { Promise<void> } Promise that returns no value. 2695 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2696 * 2. Incorrect parameter types; 2697 * 3. Parameter verification failed. 2698 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2699 * @syscap SystemCapability.WindowManager.WindowManager.Core 2700 * @systemapi Hide this for inner system use. 2701 * @since 9 2702 */ 2703 /** 2704 * Minimize all app windows. 2705 * 2706 * @param { number } id - ID of the display. 2707 * @returns { Promise<void> } Promise that returns no value. 2708 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2709 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2710 * 2. Incorrect parameter types; 2711 * 3. Parameter verification failed. 2712 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2713 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2714 * @syscap SystemCapability.WindowManager.WindowManager.Core 2715 * @systemapi Hide this for inner system use. 2716 * @since 12 2717 */ 2718 function minimizeAll(id: number): Promise<void>; 2719 2720 /** 2721 * Toggle shown state for all app windows. Minimize or restore all app windows. 2722 * 2723 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2724 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2725 * @syscap SystemCapability.WindowManager.WindowManager.Core 2726 * @systemapi Hide this for inner system use. 2727 * @since 9 2728 */ 2729 /** 2730 * Toggle shown state for all app windows. Minimize or restore all app windows. 2731 * 2732 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2733 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2734 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2735 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2736 * @syscap SystemCapability.WindowManager.WindowManager.Core 2737 * @systemapi Hide this for inner system use. 2738 * @since 12 2739 */ 2740 function toggleShownStateForAllAppWindows(callback: AsyncCallback<void>): void; 2741 2742 /** 2743 * Toggle shown state for all app windows. Minimize or restore all app windows. 2744 * 2745 * @returns { Promise<void> } Promise that returns no value. 2746 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2747 * @syscap SystemCapability.WindowManager.WindowManager.Core 2748 * @systemapi Hide this for inner system use. 2749 * @since 9 2750 */ 2751 /** 2752 * Toggle shown state for all app windows. Minimize or restore all app windows. 2753 * 2754 * @returns { Promise<void> } Promise that returns no value. 2755 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2756 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2757 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2758 * @syscap SystemCapability.WindowManager.WindowManager.Core 2759 * @systemapi Hide this for inner system use. 2760 * @since 12 2761 */ 2762 function toggleShownStateForAllAppWindows(): Promise<void>; 2763 2764 /** 2765 * Set the layout mode of a window. 2766 * 2767 * @param { WindowLayoutMode } mode - The layout mode of a window. 2768 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2769 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2770 * 2. Incorrect parameter types; 2771 * 3. Parameter verification failed. 2772 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2773 * @syscap SystemCapability.WindowManager.WindowManager.Core 2774 * @systemapi Hide this for inner system use. 2775 * @since 9 2776 */ 2777 /** 2778 * Set the layout mode of a window. 2779 * 2780 * @param { WindowLayoutMode } mode - The layout mode of a window. 2781 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2782 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2783 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2784 * 2. Incorrect parameter types; 2785 * 3. Parameter verification failed. 2786 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2787 * @syscap SystemCapability.WindowManager.WindowManager.Core 2788 * @systemapi Hide this for inner system use. 2789 * @since 12 2790 */ 2791 function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback<void>): void; 2792 2793 /** 2794 * Set the layout mode of a window. 2795 * 2796 * @param { WindowLayoutMode } mode - The layout mode of a window. 2797 * @returns { Promise<void> } Promise that returns no value. 2798 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2799 * 2. Incorrect parameter types; 2800 * 3. Parameter verification failed. 2801 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2802 * @syscap SystemCapability.WindowManager.WindowManager.Core 2803 * @systemapi Hide this for inner system use. 2804 * @since 9 2805 */ 2806 /** 2807 * Set the layout mode of a window. 2808 * 2809 * @param { WindowLayoutMode } mode - The layout mode of a window. 2810 * @returns { Promise<void> } Promise that returns no value. 2811 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2812 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2813 * 2. Incorrect parameter types; 2814 * 3. Parameter verification failed. 2815 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2816 * @syscap SystemCapability.WindowManager.WindowManager.Core 2817 * @systemapi Hide this for inner system use. 2818 * @since 12 2819 */ 2820 function setWindowLayoutMode(mode: WindowLayoutMode): Promise<void>; 2821 2822 /** 2823 * Sets whether to enable gesture navigation. 2824 * 2825 * @param { boolean } enable - Gesture navigation if true, or disable if false. 2826 * @param { AsyncCallback<void> } callback - The callback of setGestureNavigationEnabled. 2827 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2828 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2829 * 2. Incorrect parameter types. 2830 * @throws { BusinessError } 1300002 - This window state is abnormal. 2831 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2832 * @syscap SystemCapability.WindowManager.WindowManager.Core 2833 * @systemapi Hide this for inner system use. 2834 * @since 10 2835 */ 2836 function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback<void>): void; 2837 2838 /** 2839 * Sets whether to enable gesture navigation. 2840 * 2841 * @param { boolean } enable - Gesture navigation if true, or disable if false. 2842 * @returns { Promise<void> } - The promise returned by the function. 2843 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2844 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2845 * 2. Incorrect parameter types. 2846 * @throws { BusinessError } 1300002 - This window state is abnormal. 2847 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2848 * @syscap SystemCapability.WindowManager.WindowManager.Core 2849 * @systemapi Hide this for inner system use. 2850 * @since 10 2851 */ 2852 function setGestureNavigationEnabled(enable: boolean): Promise<void>; 2853 2854 /** 2855 * Set watermark image. 2856 * 2857 * @param { image.PixelMap } pixelMap - Watermark image. 2858 * @param { boolean } enable - Show watermark if true. 2859 * @returns { Promise<void> } - Promise that returns no value. 2860 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2861 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2862 * 2. Incorrect parameter types. 2863 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2864 * @syscap SystemCapability.WindowManager.WindowManager.Core 2865 * @systemapi Hide this for inner system use. 2866 * @since 10 2867 */ 2868 function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise<void>; 2869 2870 /** 2871 * Set watermark image. 2872 * 2873 * @param { image.PixelMap } pixelMap - Watermark image. 2874 * @param { boolean } enable - Show watermark if true. 2875 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkImage. 2876 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2877 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2878 * 2. Incorrect parameter types. 2879 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2880 * @syscap SystemCapability.WindowManager.WindowManager.Core 2881 * @systemapi Hide this for inner system use. 2882 * @since 10 2883 */ 2884 function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCallback<void>): void; 2885 2886 /** 2887 * Shift window focus within the same application. And the window type contains only main window and subwindow. 2888 * 2889 * @param { number } sourceWindowId - Window id which the focus shift from. 2890 * @param { number } targetWindowId - Window id which the focus shift to. 2891 * @returns { Promise<void> } - Promise that returns no value. 2892 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2893 * 2. Incorrect parameter types. 2894 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2895 * @throws { BusinessError } 1300002 - This window state is abnormal. 2896 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2897 * @throws { BusinessError } 1300004 - Unauthorized operation. 2898 * @syscap SystemCapability.Window.SessionManager 2899 * @since 11 2900 */ 2901 /** 2902 * Shift window focus within the same application. And the window type contains only main window and subwindow. 2903 * 2904 * @param { number } sourceWindowId - Window id which the focus shift from. 2905 * @param { number } targetWindowId - Window id which the focus shift to. 2906 * @returns { Promise<void> } - Promise that returns no value. 2907 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2908 * 2. Incorrect parameter types. 2909 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2910 * @throws { BusinessError } 1300002 - This window state is abnormal. 2911 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2912 * @throws { BusinessError } 1300004 - Unauthorized operation. 2913 * @syscap SystemCapability.Window.SessionManager 2914 * @atomicservice 2915 * @since 12 2916 */ 2917 function shiftAppWindowFocus(sourceWindowId: number, targetWindowId: number): Promise<void>; 2918 2919 /** 2920 * Get info of visible windows. 2921 * 2922 * @returns { Promise<Array<WindowInfo>> } - Promise that returns windowInfo list. 2923 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 2924 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2925 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2926 * @syscap SystemCapability.Window.SessionManager 2927 * @systemapi Hide this for inner system use. 2928 * @since 12 2929 */ 2930 function getVisibleWindowInfo(): Promise<Array<WindowInfo>>; 2931 2932 /** 2933 * gets snapshot of window 2934 * 2935 * @param { number } windowId - Indicates target window id. 2936 * @returns { Promise<image.PixelMap> } - Promise that returns no value. 2937 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2938 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2939 * <br>2. Incorrect parameter types. 3.Parameter verification failed. 2940 * @throws { BusinessError } 1300002 - This window state is abnormal. 2941 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2942 * @throws { BusinessError } 1300004 - This operation is not accessible. 2943 * @syscap SystemCapability.WindowManager.WindowManager.Core 2944 * @systemapi Hide this for inner system use. 2945 * @since 12 2946 */ 2947 function getSnapshot(windowId: number): Promise<image.PixelMap>; 2948 2949 /** 2950 * Get windows by coordinate. 2951 * 2952 * @param { number } displayId - Indicate the id of display. 2953 * @param { number } windowNumber - Indicate the Number of query windows. 2954 * @param { number } x - Indicate the X-coordinate of the window. 2955 * @param { number } y - Indicate the Y-coordinate of the window. 2956 * @returns { Promise<Array<Window>> } Promise used to return the window. 2957 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 2958 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 2959 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2960 * @syscap SystemCapability.Window.SessionManager 2961 * @atomicservice 2962 * @since 14 2963 */ 2964 function getWindowsByCoordinate(displayId: number, windowNumber?: number, x?: number, y?: number): Promise<Array<Window>>; 2965 2966 /** 2967 * Register the callback of systemBarTintChange 2968 * 2969 * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. 2970 * @param { Callback<SystemBarTintState> } callback - Callback used to return the properties of the system bar. 2971 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2972 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 2973 * 2. Incorrect parameter types; 2974 * 3. Parameter verification failed. 2975 * @syscap SystemCapability.WindowManager.WindowManager.Core 2976 * @systemapi Hide this for inner system use. 2977 * @since 8 2978 */ 2979 function on(type: 'systemBarTintChange', callback: Callback<SystemBarTintState>): void; 2980 2981 /** 2982 * Unregister the callback of systemBarTintChange 2983 * 2984 * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. 2985 * @param { Callback<SystemBarTintState> } callback - Callback used to return the properties of the system bar. 2986 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 2987 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 2988 * 2. Parameter verification failed. 2989 * @syscap SystemCapability.WindowManager.WindowManager.Core 2990 * @systemapi Hide this for inner system use. 2991 * @since 8 2992 */ 2993 function off(type: 'systemBarTintChange', callback?: Callback<SystemBarTintState>): void; 2994 2995 /** 2996 * Register the callback for gesture navigation enabled changes. 2997 * 2998 * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. 2999 * @param { Callback<boolean> } callback Callback used to return the result whether gesture navigation enabled or not. 3000 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3001 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3002 * 2. Incorrect parameter types. 3003 * 3. Parameter verification failed. 3004 * @throws { BusinessError } 1300002 - This window state is abnormal. 3005 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3006 * @syscap SystemCapability.WindowManager.WindowManager.Core 3007 * @systemapi Hide this for inner system use. 3008 * @since 10 3009 */ 3010 function on(type: 'gestureNavigationEnabledChange', callback: Callback<boolean>): void; 3011 3012 /** 3013 * Unregister the callback for gesture navigation enabled changes. 3014 * 3015 * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. 3016 * @param { Callback<boolean> } callback Callback used to return the result whether gesture navigation enabled or not. 3017 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3018 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 3019 * 2. Parameter verification failed. 3020 * @throws { BusinessError } 1300002 - This window state is abnormal. 3021 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3022 * @syscap SystemCapability.WindowManager.WindowManager.Core 3023 * @systemapi Hide this for inner system use. 3024 * @since 10 3025 */ 3026 function off(type: 'gestureNavigationEnabledChange', callback?: Callback<boolean>): void; 3027 3028 /** 3029 * Register the callback for watermark flag change. 3030 * 3031 * @param { 'waterMarkFlagChange' } type the event of watermark flag change. 3032 * @param { Callback<boolean> } callback Callback used to return the result whether watermark flag change or not. 3033 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3034 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3035 * <br>2. Incorrect parameter types. 3.Parameter verification failed. 3036 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3037 * @syscap SystemCapability.WindowManager.WindowManager.Core 3038 * @systemapi Hide this for inner system use. 3039 * @since 10 3040 */ 3041 function on(type: 'waterMarkFlagChange', callback: Callback<boolean>): void; 3042 3043 /** 3044 * Unregister the callback for watermark flag change. 3045 * 3046 * @param { 'waterMarkFlagChange' } type the event of watermark flag change. 3047 * @param { Callback<boolean> } callback Callback used to return the result whether watermark flag change or not. 3048 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3049 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 3050 * <br>2. Parameter verification failed. 3051 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3052 * @syscap SystemCapability.WindowManager.WindowManager.Core 3053 * @systemapi Hide this for inner system use. 3054 * @since 10 3055 */ 3056 function off(type: 'waterMarkFlagChange', callback?: Callback<boolean>): void; 3057 /** 3058 * Display orientation 3059 * 3060 * @enum { number } 3061 * @syscap SystemCapability.WindowManager.WindowManager.Core 3062 * @since 9 3063 */ 3064 /** 3065 * Display orientation 3066 * 3067 * @enum { number } 3068 * @syscap SystemCapability.WindowManager.WindowManager.Core 3069 * @crossplatform 3070 * @since 10 3071 */ 3072 /** 3073 * Display orientation 3074 * 3075 * @enum { number } 3076 * @syscap SystemCapability.WindowManager.WindowManager.Core 3077 * @crossplatform 3078 * @atomicservice 3079 * @since 11 3080 */ 3081 enum Orientation { 3082 /** 3083 * Default value. The direction mode is not clearly defined. It is determined by the system. 3084 * 3085 * @syscap SystemCapability.WindowManager.WindowManager.Core 3086 * @since 9 3087 */ 3088 /** 3089 * Default value. The direction mode is not clearly defined. It is determined by the system. 3090 * 3091 * @syscap SystemCapability.WindowManager.WindowManager.Core 3092 * @crossplatform 3093 * @since 10 3094 */ 3095 /** 3096 * Default value. The direction mode is not clearly defined. It is determined by the system. 3097 * 3098 * @syscap SystemCapability.WindowManager.WindowManager.Core 3099 * @crossplatform 3100 * @atomicservice 3101 * @since 12 3102 */ 3103 UNSPECIFIED = 0, 3104 3105 /** 3106 * Display in portrait orientation. 3107 * 3108 * @syscap SystemCapability.WindowManager.WindowManager.Core 3109 * @since 9 3110 */ 3111 /** 3112 * Display in portrait orientation. 3113 * 3114 * @syscap SystemCapability.WindowManager.WindowManager.Core 3115 * @crossplatform 3116 * @since 10 3117 */ 3118 /** 3119 * Display in portrait orientation. 3120 * 3121 * @syscap SystemCapability.WindowManager.WindowManager.Core 3122 * @crossplatform 3123 * @atomicservice 3124 * @since 11 3125 */ 3126 PORTRAIT = 1, 3127 3128 /** 3129 * Display in landscape orientation. 3130 * 3131 * @syscap SystemCapability.WindowManager.WindowManager.Core 3132 * @since 9 3133 */ 3134 /** 3135 * Display in landscape orientation. 3136 * 3137 * @syscap SystemCapability.WindowManager.WindowManager.Core 3138 * @crossplatform 3139 * @since 10 3140 */ 3141 /** 3142 * Display in landscape orientation. 3143 * 3144 * @syscap SystemCapability.WindowManager.WindowManager.Core 3145 * @crossplatform 3146 * @atomicservice 3147 * @since 12 3148 */ 3149 LANDSCAPE = 2, 3150 3151 /** 3152 * Display in inverted portrait orientation. 3153 * 3154 * @syscap SystemCapability.WindowManager.WindowManager.Core 3155 * @since 9 3156 */ 3157 /** 3158 * Display in inverted portrait orientation. 3159 * 3160 * @syscap SystemCapability.WindowManager.WindowManager.Core 3161 * @crossplatform 3162 * @since 10 3163 */ 3164 /** 3165 * Display in inverted portrait orientation. 3166 * 3167 * @syscap SystemCapability.WindowManager.WindowManager.Core 3168 * @crossplatform 3169 * @atomicservice 3170 * @since 12 3171 */ 3172 PORTRAIT_INVERTED = 3, 3173 3174 /** 3175 * Display in inverted landscape orientation. 3176 * 3177 * @syscap SystemCapability.WindowManager.WindowManager.Core 3178 * @since 9 3179 */ 3180 /** 3181 * Display in inverted landscape orientation. 3182 * 3183 * @syscap SystemCapability.WindowManager.WindowManager.Core 3184 * @crossplatform 3185 * @since 10 3186 */ 3187 /** 3188 * Display in inverted landscape orientation. 3189 * 3190 * @syscap SystemCapability.WindowManager.WindowManager.Core 3191 * @crossplatform 3192 * @atomicservice 3193 * @since 12 3194 */ 3195 LANDSCAPE_INVERTED = 4, 3196 3197 /** 3198 * Follow the rotation of the sensor, ignore auto rotation lock. 3199 * 3200 * @syscap SystemCapability.WindowManager.WindowManager.Core 3201 * @since 9 3202 */ 3203 /** 3204 * Follow the rotation of the sensor, ignore auto rotation lock. 3205 * 3206 * @syscap SystemCapability.WindowManager.WindowManager.Core 3207 * @atomicservice 3208 * @since 11 3209 */ 3210 AUTO_ROTATION = 5, 3211 3212 /** 3213 * Follow the rotation of the sensor, only work in the vertical direction, ignore auto rotation lock. 3214 * 3215 * @syscap SystemCapability.WindowManager.WindowManager.Core 3216 * @since 9 3217 */ 3218 /** 3219 * Follow the rotation of the sensor, only work in the vertical direction, ignore auto rotation lock. 3220 * 3221 * @syscap SystemCapability.WindowManager.WindowManager.Core 3222 * @atomicservice 3223 * @since 12 3224 */ 3225 AUTO_ROTATION_PORTRAIT = 6, 3226 3227 /** 3228 * Follow the rotation of the sensor, only work in the horizontal direction, ignore auto rotation lock. 3229 * 3230 * @syscap SystemCapability.WindowManager.WindowManager.Core 3231 * @since 9 3232 */ 3233 /** 3234 * Follow the rotation of the sensor, only work in the horizontal direction, ignore auto rotation lock. 3235 * 3236 * @syscap SystemCapability.WindowManager.WindowManager.Core 3237 * @atomicservice 3238 * @since 12 3239 */ 3240 AUTO_ROTATION_LANDSCAPE = 7, 3241 3242 /** 3243 * Follow the rotation of the sensor, controlled by auto rotation lock. 3244 * 3245 * @syscap SystemCapability.WindowManager.WindowManager.Core 3246 * @since 9 3247 */ 3248 /** 3249 * Follow the rotation of the sensor, controlled by auto rotation lock. 3250 * 3251 * @syscap SystemCapability.WindowManager.WindowManager.Core 3252 * @atomicservice 3253 * @since 12 3254 */ 3255 AUTO_ROTATION_RESTRICTED = 8, 3256 3257 /** 3258 * Follow the rotation of the sensor, only work in the vertical direction, controlled by auto rotation lock. 3259 * 3260 * @syscap SystemCapability.WindowManager.WindowManager.Core 3261 * @since 9 3262 */ 3263 /** 3264 * Follow the rotation of the sensor, only work in the vertical direction, controlled by auto rotation lock. 3265 * 3266 * @syscap SystemCapability.WindowManager.WindowManager.Core 3267 * @atomicservice 3268 * @since 12 3269 */ 3270 AUTO_ROTATION_PORTRAIT_RESTRICTED = 9, 3271 3272 /** 3273 * Follow the rotation of the sensor, only work in the horizontal direction, controlled by auto rotation lock. 3274 * 3275 * @syscap SystemCapability.WindowManager.WindowManager.Core 3276 * @since 9 3277 */ 3278 /** 3279 * Follow the rotation of the sensor, only work in the horizontal direction, controlled by auto rotation lock. 3280 * 3281 * @syscap SystemCapability.WindowManager.WindowManager.Core 3282 * @atomicservice 3283 * @since 12 3284 */ 3285 AUTO_ROTATION_LANDSCAPE_RESTRICTED = 10, 3286 3287 /** 3288 * Locked mode, keep the same direction as previous one. 3289 * 3290 * @syscap SystemCapability.WindowManager.WindowManager.Core 3291 * @since 9 3292 */ 3293 /** 3294 * Locked mode, keep the same direction as previous one. 3295 * 3296 * @syscap SystemCapability.WindowManager.WindowManager.Core 3297 * @atomicservice 3298 * @since 12 3299 */ 3300 LOCKED = 11, 3301 3302 /** 3303 * Follow the rotation of the sensor, determined by the system, controlled by auto rotation lock. 3304 * 3305 * @syscap SystemCapability.Window.SessionManager 3306 * @atomicservice 3307 * @since 12 3308 */ 3309 AUTO_ROTATION_UNSPECIFIED = 12, 3310 3311 /** 3312 * Display in portrait orientation, and then, follow the rotation of the sensor, determined by the system, controlled by auto rotation lock. 3313 * 3314 * @syscap SystemCapability.Window.SessionManager 3315 * @atomicservice 3316 * @since 12 3317 */ 3318 USER_ROTATION_PORTRAIT = 13, 3319 3320 /** 3321 * Display in landscape orientation, and then, follow the rotation of the sensor, determined by the system, controlled by auto rotation lock. 3322 * 3323 * @syscap SystemCapability.Window.SessionManager 3324 * @atomicservice 3325 * @since 12 3326 */ 3327 USER_ROTATION_LANDSCAPE = 14, 3328 3329 /** 3330 * Display in inverted portrait orientation, and then, follow the rotation of the sensor, determined by the system, controlled by auto rotation lock. 3331 * 3332 * @syscap SystemCapability.Window.SessionManager 3333 * @atomicservice 3334 * @since 12 3335 */ 3336 USER_ROTATION_PORTRAIT_INVERTED = 15, 3337 3338 /** 3339 * Display in inverted landscape orientation, and then, follow the rotation of the sensor, determined by the system, controlled by auto rotation lock. 3340 * 3341 * @syscap SystemCapability.Window.SessionManager 3342 * @atomicservice 3343 * @since 12 3344 */ 3345 USER_ROTATION_LANDSCAPE_INVERTED = 16, 3346 3347 /** 3348 * Follow the desktop rotate mode. 3349 * 3350 * @syscap SystemCapability.Window.SessionManager 3351 * @atomicservice 3352 * @since 12 3353 */ 3354 FOLLOW_DESKTOP = 17 3355 } 3356 3357 /** 3358 * Type of blur style 3359 * 3360 * @enum { number } 3361 * @syscap SystemCapability.WindowManager.WindowManager.Core 3362 * @systemapi Hide this for inner system use. 3363 * @since 9 3364 */ 3365 enum BlurStyle { 3366 /** 3367 * Close blur. 3368 * 3369 * @syscap SystemCapability.WindowManager.WindowManager.Core 3370 * @systemapi Hide this for inner system use. 3371 * @since 9 3372 */ 3373 OFF, 3374 /** 3375 * Blur style thin. 3376 * 3377 * @syscap SystemCapability.WindowManager.WindowManager.Core 3378 * @systemapi Hide this for inner system use. 3379 * @since 9 3380 */ 3381 THIN, 3382 /** 3383 * Blur style regular. 3384 * 3385 * @syscap SystemCapability.WindowManager.WindowManager.Core 3386 * @systemapi Hide this for inner system use. 3387 * @since 9 3388 */ 3389 REGULAR, 3390 /** 3391 * Blur style thick. 3392 * 3393 * @syscap SystemCapability.WindowManager.WindowManager.Core 3394 * @systemapi Hide this for inner system use. 3395 * @since 9 3396 */ 3397 THICK 3398 } 3399 3400 /** 3401 * Enum for window callback event type 3402 * 3403 * @enum { number } 3404 * @syscap SystemCapability.WindowManager.WindowManager.Core 3405 * @since 10 3406 */ 3407 /** 3408 * Enum for window callback event type 3409 * 3410 * @enum { number } 3411 * @syscap SystemCapability.WindowManager.WindowManager.Core 3412 * @crossplatform 3413 * @atomicservice 3414 * @since 11 3415 */ 3416 enum WindowEventType { 3417 /** 3418 * The value of window event is window show 3419 * 3420 * @syscap SystemCapability.WindowManager.WindowManager.Core 3421 * @since 10 3422 */ 3423 /** 3424 * The value of window event is window show 3425 * 3426 * @syscap SystemCapability.WindowManager.WindowManager.Core 3427 * @crossplatform 3428 * @atomicservice 3429 * @since 11 3430 */ 3431 WINDOW_SHOWN = 1, 3432 /** 3433 * The value of window event is window active 3434 * 3435 * @syscap SystemCapability.WindowManager.WindowManager.Core 3436 * @since 10 3437 */ 3438 /** 3439 * The value of window event is window active 3440 * 3441 * @syscap SystemCapability.WindowManager.WindowManager.Core 3442 * @crossplatform 3443 * @atomicservice 3444 * @since 11 3445 */ 3446 WINDOW_ACTIVE = 2, 3447 /** 3448 * The value of window event is window inactive 3449 * 3450 * @syscap SystemCapability.WindowManager.WindowManager.Core 3451 * @since 10 3452 */ 3453 /** 3454 * The value of window event is window inactive 3455 * 3456 * @syscap SystemCapability.WindowManager.WindowManager.Core 3457 * @crossplatform 3458 * @atomicservice 3459 * @since 11 3460 */ 3461 WINDOW_INACTIVE = 3, 3462 /** 3463 * The value of window event is window hide 3464 * 3465 * @syscap SystemCapability.WindowManager.WindowManager.Core 3466 * @since 10 3467 */ 3468 /** 3469 * The value of window event is window hide 3470 * 3471 * @syscap SystemCapability.WindowManager.WindowManager.Core 3472 * @crossplatform 3473 * @atomicservice 3474 * @since 11 3475 */ 3476 WINDOW_HIDDEN = 4, 3477 /** 3478 * The value of window event is window destroy 3479 * 3480 * @syscap SystemCapability.Window.SessionManager 3481 * @atomicservice 3482 * @since 11 3483 */ 3484 WINDOW_DESTROYED = 7 3485 } 3486 3487 /** 3488 * Enum for window maximize presentation 3489 * 3490 * @enum { number } 3491 * @syscap SystemCapability.Window.SessionManager 3492 * @atomicservice 3493 * @since 12 3494 */ 3495 enum MaximizePresentation { 3496 /** 3497 * The value means follow immersive state which set by app 3498 * 3499 * @syscap SystemCapability.Window.SessionManager 3500 * @atomicservice 3501 * @since 12 3502 */ 3503 FOLLOW_APP_IMMERSIVE_SETTING = 0, 3504 /** 3505 * The value means exit immersive state 3506 * 3507 * @syscap SystemCapability.Window.SessionManager 3508 * @atomicservice 3509 * @since 12 3510 */ 3511 EXIT_IMMERSIVE = 1, 3512 /** 3513 * The value means enter immersive state 3514 * 3515 * @syscap SystemCapability.Window.SessionManager 3516 * @atomicservice 3517 * @since 12 3518 */ 3519 ENTER_IMMERSIVE = 2, 3520 /** 3521 * The value means enter immersive state and the title bar and dock bar cannot be shown, when the mouse hovers over hot area. 3522 * 3523 * @syscap SystemCapability.Window.SessionManager 3524 * @atomicservice 3525 * @since 14 3526 */ 3527 ENTER_IMMERSIVE_DISABLE_TITLE_AND_DOCK_HOVER = 3, 3528 } 3529 3530 /** 3531 * Specific system bar type. 3532 * 3533 * @syscap SystemCapability.Window.SessionManager 3534 * @atomicservice 3535 * @since 11 3536 */ 3537 /** 3538 * Specific system bar type. 3539 * 3540 * @typedef {'status' | 'navigation' | 'navigationIndicator'} 3541 * @syscap SystemCapability.Window.SessionManager 3542 * @crossplatform 3543 * @atomicservice 3544 * @since 12 3545 */ 3546 type SpecificSystemBar = 'status' | 'navigation' | 'navigationIndicator'; 3547 3548 /** 3549 * Window 3550 * 3551 * @interface Window 3552 * @syscap SystemCapability.WindowManager.WindowManager.Core 3553 * @since 6 3554 */ 3555 /** 3556 * Window 3557 * 3558 * @interface Window 3559 * @syscap SystemCapability.WindowManager.WindowManager.Core 3560 * @crossplatform 3561 * @atomicservice 3562 * @since 11 3563 */ 3564 interface Window { 3565 /** 3566 * Hide window. 3567 * 3568 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3569 * @throws { BusinessError } 1300002 - This window state is abnormal. 3570 * @syscap SystemCapability.WindowManager.WindowManager.Core 3571 * @systemapi Hide this for inner system use. 3572 * @since 7 3573 */ 3574 /** 3575 * Hide window. 3576 * 3577 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3578 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3579 * @throws { BusinessError } 1300002 - This window state is abnormal. 3580 * @syscap SystemCapability.WindowManager.WindowManager.Core 3581 * @systemapi Hide this for inner system use. 3582 * @since 12 3583 */ 3584 hide(callback: AsyncCallback<void>): void; 3585 3586 /** 3587 * Hide window. 3588 * 3589 * @returns { Promise<void> } Promise that returns no value. 3590 * @throws { BusinessError } 1300002 - This window state is abnormal. 3591 * @syscap SystemCapability.WindowManager.WindowManager.Core 3592 * @systemapi Hide this for inner system use. 3593 * @since 7 3594 */ 3595 /** 3596 * Hide window. 3597 * 3598 * @returns { Promise<void> } Promise that returns no value. 3599 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3600 * @throws { BusinessError } 1300002 - This window state is abnormal. 3601 * @syscap SystemCapability.WindowManager.WindowManager.Core 3602 * @systemapi Hide this for inner system use. 3603 * @since 12 3604 */ 3605 hide(): Promise<void>; 3606 3607 /** 3608 * Hide window with animation. 3609 * 3610 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3611 * @throws { BusinessError } 1300002 - This window state is abnormal. 3612 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3613 * @throws { BusinessError } 1300004 - Unauthorized operation. 3614 * @syscap SystemCapability.WindowManager.WindowManager.Core 3615 * @systemapi 3616 * @since 9 3617 */ 3618 /** 3619 * Hide window with animation. 3620 * 3621 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3622 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3623 * @throws { BusinessError } 1300002 - This window state is abnormal. 3624 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3625 * @throws { BusinessError } 1300004 - Unauthorized operation. 3626 * @syscap SystemCapability.WindowManager.WindowManager.Core 3627 * @systemapi 3628 * @since 12 3629 */ 3630 hideWithAnimation(callback: AsyncCallback<void>): void; 3631 3632 /** 3633 * Hide window with animation. 3634 * 3635 * @returns { Promise<void> } Promise that returns no value. 3636 * @throws { BusinessError } 1300002 - This window state is abnormal. 3637 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3638 * @throws { BusinessError } 1300004 - Unauthorized operation. 3639 * @syscap SystemCapability.WindowManager.WindowManager.Core 3640 * @systemapi 3641 * @since 9 3642 */ 3643 /** 3644 * Hide window with animation. 3645 * 3646 * @returns { Promise<void> } Promise that returns no value. 3647 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3648 * @throws { BusinessError } 1300002 - This window state is abnormal. 3649 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3650 * @throws { BusinessError } 1300004 - Unauthorized operation. 3651 * @syscap SystemCapability.WindowManager.WindowManager.Core 3652 * @systemapi 3653 * @since 12 3654 */ 3655 hideWithAnimation(): Promise<void>; 3656 3657 /** 3658 * Show window. 3659 * 3660 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3661 * @syscap SystemCapability.WindowManager.WindowManager.Core 3662 * @since 7 3663 * @deprecated since 9 3664 * @useinstead ohos.window.Window#showWindow 3665 */ 3666 show(callback: AsyncCallback<void>): void; 3667 3668 /** 3669 * Show window. 3670 * 3671 * @returns { Promise<void> } Promise that returns no value. 3672 * @syscap SystemCapability.WindowManager.WindowManager.Core 3673 * @since 7 3674 * @deprecated since 9 3675 * @useinstead ohos.window.Window#showWindow 3676 */ 3677 show(): Promise<void>; 3678 3679 /** 3680 * Show window. 3681 * 3682 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3683 * @throws { BusinessError } 1300002 - This window state is abnormal. 3684 * @syscap SystemCapability.WindowManager.WindowManager.Core 3685 * @since 9 3686 */ 3687 /** 3688 * Show window. 3689 * 3690 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3691 * @throws { BusinessError } 1300002 - This window state is abnormal. 3692 * @syscap SystemCapability.WindowManager.WindowManager.Core 3693 * @crossplatform 3694 * @since 10 3695 */ 3696 /** 3697 * Show window. 3698 * 3699 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3700 * @throws { BusinessError } 1300002 - This window state is abnormal. 3701 * @syscap SystemCapability.WindowManager.WindowManager.Core 3702 * @crossplatform 3703 * @atomicservice 3704 * @since 11 3705 */ 3706 showWindow(callback: AsyncCallback<void>): void; 3707 3708 /** 3709 * Show window. 3710 * 3711 * @returns { Promise<void> } Promise that returns no value. 3712 * @throws { BusinessError } 1300002 - This window state is abnormal. 3713 * @syscap SystemCapability.WindowManager.WindowManager.Core 3714 * @since 9 3715 */ 3716 /** 3717 * Show window. 3718 * 3719 * @returns { Promise<void> } Promise that returns no value. 3720 * @throws { BusinessError } 1300002 - This window state is abnormal. 3721 * @syscap SystemCapability.WindowManager.WindowManager.Core 3722 * @crossplatform 3723 * @since 10 3724 */ 3725 /** 3726 * Show window. 3727 * 3728 * @returns { Promise<void> } Promise that returns no value. 3729 * @throws { BusinessError } 1300002 - This window state is abnormal. 3730 * @syscap SystemCapability.WindowManager.WindowManager.Core 3731 * @crossplatform 3732 * @atomicservice 3733 * @since 11 3734 */ 3735 showWindow(): Promise<void>; 3736 3737 /** 3738 * Show window with animation. 3739 * 3740 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3741 * @throws { BusinessError } 1300002 - This window state is abnormal. 3742 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3743 * @throws { BusinessError } 1300004 - Unauthorized operation. 3744 * @syscap SystemCapability.WindowManager.WindowManager.Core 3745 * @systemapi 3746 * @since 9 3747 */ 3748 /** 3749 * Show window with animation. 3750 * 3751 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3752 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3753 * @throws { BusinessError } 1300002 - This window state is abnormal. 3754 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3755 * @throws { BusinessError } 1300004 - Unauthorized operation. 3756 * @syscap SystemCapability.WindowManager.WindowManager.Core 3757 * @systemapi 3758 * @since 12 3759 */ 3760 showWithAnimation(callback: AsyncCallback<void>): void; 3761 3762 /** 3763 * Show window with animation. 3764 * 3765 * @returns { Promise<void> } Promise that returns no value. 3766 * @throws { BusinessError } 1300002 - This window state is abnormal. 3767 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3768 * @throws { BusinessError } 1300004 - Unauthorized operation. 3769 * @syscap SystemCapability.WindowManager.WindowManager.Core 3770 * @systemapi 3771 * @since 9 3772 */ 3773 /** 3774 * Show window with animation. 3775 * 3776 * @returns { Promise<void> } Promise that returns no value. 3777 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3778 * @throws { BusinessError } 1300002 - This window state is abnormal. 3779 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3780 * @throws { BusinessError } 1300004 - Unauthorized operation. 3781 * @syscap SystemCapability.WindowManager.WindowManager.Core 3782 * @systemapi 3783 * @since 12 3784 */ 3785 showWithAnimation(): Promise<void>; 3786 3787 /** 3788 * Destroy the window. 3789 * 3790 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3791 * @syscap SystemCapability.WindowManager.WindowManager.Core 3792 * @since 7 3793 * @deprecated since 9 3794 * @useinstead ohos.window.Window#destroyWindow 3795 */ 3796 destroy(callback: AsyncCallback<void>): void; 3797 3798 /** 3799 * Destroy the window. 3800 * 3801 * @returns { Promise<void> } Promise that returns no value. 3802 * @syscap SystemCapability.WindowManager.WindowManager.Core 3803 * @since 7 3804 * @deprecated since 9 3805 * @useinstead ohos.window.Window#destroyWindow 3806 */ 3807 destroy(): Promise<void>; 3808 3809 /** 3810 * Destroy the window. 3811 * 3812 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3813 * @throws { BusinessError } 1300002 - This window state is abnormal. 3814 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3815 * @syscap SystemCapability.WindowManager.WindowManager.Core 3816 * @since 9 3817 */ 3818 /** 3819 * Destroy the window. 3820 * 3821 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3822 * @throws { BusinessError } 1300002 - This window state is abnormal. 3823 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3824 * @syscap SystemCapability.WindowManager.WindowManager.Core 3825 * @crossplatform 3826 * @since 10 3827 */ 3828 /** 3829 * Destroy the window. 3830 * 3831 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3832 * @throws { BusinessError } 1300002 - This window state is abnormal. 3833 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3834 * @syscap SystemCapability.WindowManager.WindowManager.Core 3835 * @crossplatform 3836 * @atomicservice 3837 * @since 11 3838 */ 3839 destroyWindow(callback: AsyncCallback<void>): void; 3840 3841 /** 3842 * Destroy the window. 3843 * 3844 * @returns { Promise<void> } Promise that returns no value. 3845 * @throws { BusinessError } 1300002 - This window state is abnormal. 3846 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3847 * @syscap SystemCapability.WindowManager.WindowManager.Core 3848 * @since 9 3849 */ 3850 /** 3851 * Destroy the window. 3852 * 3853 * @returns { Promise<void> } Promise that returns no value. 3854 * @throws { BusinessError } 1300002 - This window state is abnormal. 3855 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3856 * @syscap SystemCapability.WindowManager.WindowManager.Core 3857 * @crossplatform 3858 * @since 10 3859 */ 3860 /** 3861 * Destroy the window. 3862 * 3863 * @returns { Promise<void> } Promise that returns no value. 3864 * @throws { BusinessError } 1300002 - This window state is abnormal. 3865 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3866 * @syscap SystemCapability.WindowManager.WindowManager.Core 3867 * @crossplatform 3868 * @atomicservice 3869 * @since 11 3870 */ 3871 destroyWindow(): Promise<void>; 3872 3873 /** 3874 * Set the position of a window. 3875 * 3876 * @param { number } x - Indicate the X-coordinate of the window. 3877 * @param { number } y - Indicate the Y-coordinate of the window. 3878 * @returns { Promise<void> } Promise that returns no value. 3879 * @syscap SystemCapability.WindowManager.WindowManager.Core 3880 * @since 7 3881 * @deprecated since 9 3882 * @useinstead ohos.window.Window#moveWindowTo 3883 */ 3884 moveTo(x: number, y: number): Promise<void>; 3885 3886 /** 3887 * Set the position of a window. 3888 * 3889 * @param { number } x - Indicate the X-coordinate of the window. 3890 * @param { number } y - Indicate the Y-coordinate of the window. 3891 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3892 * @syscap SystemCapability.WindowManager.WindowManager.Core 3893 * @since 7 3894 * @deprecated since 9 3895 * @useinstead ohos.window.Window#moveWindowTo 3896 */ 3897 moveTo(x: number, y: number, callback: AsyncCallback<void>): void; 3898 3899 /** 3900 * Set the position of a window. 3901 * 3902 * @param { number } x - Indicate the X-coordinate of the window. 3903 * @param { number } y - Indicate the Y-coordinate of the window. 3904 * @returns { Promise<void> } Promise that returns no value. 3905 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3906 * 2. Incorrect parameter types. 3907 * @throws { BusinessError } 1300002 - This window state is abnormal. 3908 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3909 * @syscap SystemCapability.WindowManager.WindowManager.Core 3910 * @since 9 3911 */ 3912 /** 3913 * Set the position of a window. 3914 * 3915 * @param { number } x - Indicate the X-coordinate of the window. 3916 * @param { number } y - Indicate the Y-coordinate of the window. 3917 * @returns { Promise<void> } Promise that returns no value. 3918 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3919 * 2. Incorrect parameter types. 3920 * @throws { BusinessError } 1300002 - This window state is abnormal. 3921 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3922 * @syscap SystemCapability.WindowManager.WindowManager.Core 3923 * @crossplatform 3924 * @since 10 3925 */ 3926 /** 3927 * Set the position of a window. 3928 * 3929 * @param { number } x - Indicate the X-coordinate of the window. 3930 * @param { number } y - Indicate the Y-coordinate of the window. 3931 * @returns { Promise<void> } Promise that returns no value. 3932 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3933 * 2. Incorrect parameter types. 3934 * @throws { BusinessError } 1300002 - This window state is abnormal. 3935 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3936 * @syscap SystemCapability.WindowManager.WindowManager.Core 3937 * @crossplatform 3938 * @atomicservice 3939 * @since 11 3940 */ 3941 moveWindowTo(x: number, y: number): Promise<void>; 3942 3943 /** 3944 * Set the position of a window. 3945 * 3946 * @param { number } x - Indicate the X-coordinate of the window. 3947 * @param { number } y - Indicate the Y-coordinate of the window. 3948 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3949 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3950 * 2. Incorrect parameter types. 3951 * @throws { BusinessError } 1300002 - This window state is abnormal. 3952 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3953 * @syscap SystemCapability.WindowManager.WindowManager.Core 3954 * @since 9 3955 */ 3956 /** 3957 * Set the position of a window. 3958 * 3959 * @param { number } x - Indicate the X-coordinate of the window. 3960 * @param { number } y - Indicate the Y-coordinate of the window. 3961 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3962 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3963 * 2. Incorrect parameter types. 3964 * @throws { BusinessError } 1300002 - This window state is abnormal. 3965 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3966 * @syscap SystemCapability.WindowManager.WindowManager.Core 3967 * @crossplatform 3968 * @since 10 3969 */ 3970 /** 3971 * Set the position of a window. 3972 * 3973 * @param { number } x - Indicate the X-coordinate of the window. 3974 * @param { number } y - Indicate the Y-coordinate of the window. 3975 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3976 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3977 * 2. Incorrect parameter types. 3978 * @throws { BusinessError } 1300002 - This window state is abnormal. 3979 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3980 * @syscap SystemCapability.WindowManager.WindowManager.Core 3981 * @crossplatform 3982 * @atomicservice 3983 * @since 11 3984 */ 3985 moveWindowTo(x: number, y: number, callback: AsyncCallback<void>): void; 3986 3987 /** 3988 * Move window to the position. 3989 * 3990 * @param { number } x - Indicate the X-coordinate of the window. 3991 * @param { number } y - Indicate the Y-coordinate of the window. 3992 * @returns { Promise<void> } Promise that returns no value. 3993 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 3994 * 2. Incorrect parameter types. 3995 * 3. Parameter verification failed. 3996 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 3997 * @throws { BusinessError } 1300002 - This window state is abnormal. 3998 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3999 * @throws { BusinessError } 1300010 - The operation in the current window status is invalid. 4000 * @syscap SystemCapability.Window.SessionManager 4001 * @atomicservice 4002 * @since 12 4003 */ 4004 moveWindowToAsync(x: number, y: number): Promise<void>; 4005 4006 /** 4007 * Move window to the position relative to current screen. 4008 * 4009 * @param { number } x - Indicate the X-coordinate of the window relative to current screen. 4010 * @param { number } y - Indicate the Y-coordinate of the window relative to current screen. 4011 * @returns { Promise<void> } Promise that returns no value. 4012 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4013 * 2. Incorrect parameter types. 4014 * 3. Parameter verification failed. 4015 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4016 * @throws { BusinessError } 1300002 - This window state is abnormal. 4017 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4018 * @throws { BusinessError } 1300010 - The operation in the current window status is invalid. 4019 * @syscap SystemCapability.Window.SessionManager 4020 * @atomicservice 4021 * @since 13 4022 */ 4023 moveWindowToGlobal(x: number, y: number): Promise<void>; 4024 4025 /** 4026 * Set the size of a window . 4027 * 4028 * @param { number } width - Indicates the width of the window. 4029 * @param { number } height - Indicates the height of the window. 4030 * @returns { Promise<void> } Promise that returns no value. 4031 * @syscap SystemCapability.WindowManager.WindowManager.Core 4032 * @since 7 4033 * @deprecated since 9 4034 * @useinstead ohos.window.Window#resize 4035 */ 4036 resetSize(width: number, height: number): Promise<void>; 4037 4038 /** 4039 * Set the size of a window . 4040 * 4041 * @param { number } width - Indicates the width of the window. 4042 * @param { number } height - Indicates the height of the window. 4043 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4044 * @syscap SystemCapability.WindowManager.WindowManager.Core 4045 * @since 7 4046 * @deprecated since 9 4047 * @useinstead ohos.window.Window#resize 4048 */ 4049 resetSize(width: number, height: number, callback: AsyncCallback<void>): void; 4050 4051 /** 4052 * Set the size of a window . 4053 * 4054 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4055 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4056 * @returns { Promise<void> } Promise that returns no value. 4057 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4058 * 2. Incorrect parameter types; 4059 * 3. Parameter verification failed. 4060 * @throws { BusinessError } 1300002 - This window state is abnormal. 4061 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4062 * @syscap SystemCapability.WindowManager.WindowManager.Core 4063 * @since 9 4064 */ 4065 /** 4066 * Set the size of a window . 4067 * 4068 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4069 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4070 * @returns { Promise<void> } Promise that returns no value. 4071 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4072 * 2. Incorrect parameter types; 4073 * 3. Parameter verification failed. 4074 * @throws { BusinessError } 1300002 - This window state is abnormal. 4075 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4076 * @syscap SystemCapability.WindowManager.WindowManager.Core 4077 * @crossplatform 4078 * @since 10 4079 */ 4080 /** 4081 * Set the size of a window . 4082 * 4083 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4084 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4085 * @returns { Promise<void> } Promise that returns no value. 4086 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4087 * 2. Incorrect parameter types; 4088 * 3. Parameter verification failed. 4089 * @throws { BusinessError } 1300002 - This window state is abnormal. 4090 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4091 * @syscap SystemCapability.WindowManager.WindowManager.Core 4092 * @crossplatform 4093 * @atomicservice 4094 * @since 11 4095 */ 4096 resize(width: number, height: number): Promise<void>; 4097 4098 /** 4099 * Set the size of a window . 4100 * 4101 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4102 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4103 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4104 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4105 * 2. Incorrect parameter types; 4106 * 3. Parameter verification failed. 4107 * @throws { BusinessError } 1300002 - This window state is abnormal. 4108 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4109 * @syscap SystemCapability.WindowManager.WindowManager.Core 4110 * @since 9 4111 */ 4112 /** 4113 * Set the size of a window . 4114 * 4115 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4116 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4117 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4118 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4119 * 2. Incorrect parameter types; 4120 * 3. Parameter verification failed. 4121 * @throws { BusinessError } 1300002 - This window state is abnormal. 4122 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4123 * @syscap SystemCapability.WindowManager.WindowManager.Core 4124 * @crossplatform 4125 * @since 10 4126 */ 4127 /** 4128 * Set the size of a window . 4129 * 4130 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4131 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4132 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4133 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4134 * 2. Incorrect parameter types; 4135 * 3. Parameter verification failed. 4136 * @throws { BusinessError } 1300002 - This window state is abnormal. 4137 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4138 * @syscap SystemCapability.WindowManager.WindowManager.Core 4139 * @crossplatform 4140 * @atomicservice 4141 * @since 11 4142 */ 4143 resize(width: number, height: number, callback: AsyncCallback<void>): void; 4144 4145 /** 4146 * Set the size of a window. 4147 * 4148 * @param { number } width - Indicates the width of the window. The width should be greater than 0. 4149 * @param { number } height - Indicates the height of the window. The height should be greater than 0. 4150 * @returns { Promise<void> } Promise that returns no value. 4151 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4152 * 2. Incorrect parameter types; 4153 * 3. Parameter verification failed. 4154 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4155 * @throws { BusinessError } 1300002 - This window state is abnormal. 4156 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4157 * @throws { BusinessError } 1300010 - The operation in the current window status is invalid. 4158 * @syscap SystemCapability.Window.SessionManager 4159 * @atomicservice 4160 * @since 12 4161 */ 4162 resizeAsync(width: number, height: number): Promise<void>; 4163 4164 /** 4165 * Set the type of a window. 4166 * 4167 * @param { WindowType } type - Indicate the type of a window. 4168 * @returns { Promise<void> } Promise that returns no value. 4169 * @syscap SystemCapability.WindowManager.WindowManager.Core 4170 * @systemapi Hide this for inner system use. 4171 * @since 7 4172 * @deprecated since 9 4173 */ 4174 setWindowType(type: WindowType): Promise<void>; 4175 4176 /** 4177 * Set the type of a window. 4178 * 4179 * @param { WindowType } type - Indicate the type of a window. 4180 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4181 * @syscap SystemCapability.WindowManager.WindowManager.Core 4182 * @systemapi Hide this for inner system use. 4183 * @since 7 4184 * @deprecated since 9 4185 */ 4186 setWindowType(type: WindowType, callback: AsyncCallback<void>): void; 4187 4188 /** 4189 * Set the mode of a window. 4190 * 4191 * @param { WindowMode } mode - Indicate the mode of a window. 4192 * @returns { Promise<void> } Promise that returns no value. 4193 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4194 * 2. Incorrect parameter types; 4195 * 3. Parameter verification failed. 4196 * @throws { BusinessError } 1300002 - This window state is abnormal. 4197 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4198 * @syscap SystemCapability.WindowManager.WindowManager.Core 4199 * @systemapi Hide this for inner system use. 4200 * @since 9 4201 */ 4202 /** 4203 * Set the mode of a window. 4204 * 4205 * @param { WindowMode } mode - Indicate the mode of a window. 4206 * @returns { Promise<void> } Promise that returns no value. 4207 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 4208 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4209 * 2. Incorrect parameter types; 4210 * 3. Parameter verification failed. 4211 * @throws { BusinessError } 1300002 - This window state is abnormal. 4212 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4213 * @syscap SystemCapability.WindowManager.WindowManager.Core 4214 * @systemapi Hide this for inner system use. 4215 * @since 12 4216 */ 4217 setWindowMode(mode: WindowMode): Promise<void>; 4218 4219 /** 4220 * Set the mode of a window. 4221 * 4222 * @param { WindowMode } mode - Indicate the mode of a window. 4223 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4224 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4225 * 2. Incorrect parameter types; 4226 * 3. Parameter verification failed. 4227 * @throws { BusinessError } 1300002 - This window state is abnormal. 4228 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4229 * @syscap SystemCapability.WindowManager.WindowManager.Core 4230 * @systemapi Hide this for inner system use. 4231 * @since 9 4232 */ 4233 /** 4234 * Set the mode of a window. 4235 * 4236 * @param { WindowMode } mode - Indicate the mode of a window. 4237 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4238 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 4239 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4240 * 2. Incorrect parameter types; 4241 * 3. Parameter verification failed. 4242 * @throws { BusinessError } 1300002 - This window state is abnormal. 4243 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4244 * @syscap SystemCapability.WindowManager.WindowManager.Core 4245 * @systemapi Hide this for inner system use. 4246 * @since 12 4247 */ 4248 setWindowMode(mode: WindowMode, callback: AsyncCallback<void>): void; 4249 4250 /** 4251 * Get the properties of current window 4252 * 4253 * @param { AsyncCallback<WindowProperties> } callback - Callback used to return the window properties. 4254 * @syscap SystemCapability.WindowManager.WindowManager.Core 4255 * @since 6 4256 * @deprecated since 9 4257 * @useinstead ohos.window.Window#getWindowProperties 4258 */ 4259 getProperties(callback: AsyncCallback<WindowProperties>): void; 4260 4261 /** 4262 * Get the window rectangular area quadruple {left,top,weight,height}, left and top represent relative to screen coordinates 4263 * and are affected by parent window scaling, weight and height are the scaling width and height. 4264 * 4265 * @returns { Rect } The quadruple {left,top,weight,height} represents respectively the X-coordinate 4266 * and Y-coordinate of the window relative to current screen, the scaled window width and scaled window height. 4267 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4268 * @throws { BusinessError } 1300002 - This window state is abnormal. 4269 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4270 * @syscap SystemCapability.Window.SessionManager 4271 * @atomicservice 4272 * @since 13 4273 */ 4274 getGlobalRect(): Rect; 4275 4276 /** 4277 * Get the properties of current window 4278 * 4279 * @returns { Promise<WindowProperties> } Promise used to return the window properties. 4280 * @syscap SystemCapability.WindowManager.WindowManager.Core 4281 * @since 6 4282 * @deprecated since 9 4283 * @useinstead ohos.window.Window#getWindowProperties 4284 */ 4285 getProperties(): Promise<WindowProperties>; 4286 4287 /** 4288 * Get the properties of current window 4289 * 4290 * @returns { WindowProperties } Return the window properties. 4291 * @throws { BusinessError } 1300002 - This window state is abnormal. 4292 * @syscap SystemCapability.WindowManager.WindowManager.Core 4293 * @since 9 4294 */ 4295 /** 4296 * Get the properties of current window 4297 * 4298 * @returns { WindowProperties } Return the window properties. 4299 * @throws { BusinessError } 1300002 - This window state is abnormal. 4300 * @syscap SystemCapability.WindowManager.WindowManager.Core 4301 * @crossplatform 4302 * @since 10 4303 */ 4304 /** 4305 * Get the properties of current window 4306 * 4307 * @returns { WindowProperties } Return the window properties. 4308 * @throws { BusinessError } 1300002 - This window state is abnormal. 4309 * @syscap SystemCapability.WindowManager.WindowManager.Core 4310 * @crossplatform 4311 * @atomicservice 4312 * @since 11 4313 */ 4314 getWindowProperties(): WindowProperties; 4315 4316 /** 4317 * Get the avoid area 4318 * 4319 * @param { AvoidAreaType } type - Type of the area 4320 * @param { AsyncCallback<AvoidArea> } callback - Callback used to return the area. 4321 * @syscap SystemCapability.WindowManager.WindowManager.Core 4322 * @since 7 4323 * @deprecated since 9 4324 * @useinstead ohos.window.Window#getWindowAvoidArea 4325 */ 4326 getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): void; 4327 4328 /** 4329 * Get the avoid area 4330 * 4331 * @param { AvoidAreaType } type - Type of the area 4332 * @returns { Promise<AvoidArea> } Area where the window cannot be displayed. 4333 * @syscap SystemCapability.WindowManager.WindowManager.Core 4334 * @since 7 4335 * @deprecated since 9 4336 * @useinstead ohos.window.Window#getWindowAvoidArea 4337 */ 4338 getAvoidArea(type: AvoidAreaType): Promise<AvoidArea>; 4339 4340 /** 4341 * Get the avoid area 4342 * 4343 * @param { AvoidAreaType } type - Type of the area 4344 * @returns { AvoidArea } Area where the window cannot be displayed. 4345 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4346 * 2. Incorrect parameter types; 4347 * 3. Parameter verification failed. 4348 * @throws { BusinessError } 1300002 - This window state is abnormal. 4349 * @syscap SystemCapability.WindowManager.WindowManager.Core 4350 * @since 9 4351 */ 4352 /** 4353 * Get the avoid area 4354 * 4355 * @param { AvoidAreaType } type - Type of the area 4356 * @returns { AvoidArea } Area where the window cannot be displayed. 4357 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4358 * 2. Incorrect parameter types; 4359 * 3. Parameter verification failed. 4360 * @throws { BusinessError } 1300002 - This window state is abnormal. 4361 * @syscap SystemCapability.WindowManager.WindowManager.Core 4362 * @atomicservice 4363 * @since 11 4364 */ 4365 /** 4366 * Get the avoid area 4367 * 4368 * @param { AvoidAreaType } type - Type of the area 4369 * @returns { AvoidArea } Area where the window cannot be displayed. 4370 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4371 * 2. Incorrect parameter types; 4372 * 3. Parameter verification failed. 4373 * @throws { BusinessError } 1300002 - This window state is abnormal. 4374 * @syscap SystemCapability.WindowManager.WindowManager.Core 4375 * @crossplatform 4376 * @atomicservice 4377 * @since 12 4378 */ 4379 getWindowAvoidArea(type: AvoidAreaType): AvoidArea; 4380 4381 /** 4382 * Set the flag of the window is shown full screen 4383 * 4384 * @param { boolean } isFullScreen - The flag of the window is shown full screen 4385 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4386 * @syscap SystemCapability.WindowManager.WindowManager.Core 4387 * @since 6 4388 * @deprecated since 9 4389 * @useinstead ohos.window.Window#setWindowSystemBarEnable 4390 */ 4391 setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void; 4392 4393 /** 4394 * Set the flag of the window is shown full screen 4395 * 4396 * @param { boolean } isFullScreen - The flag of the window is shown full screen 4397 * @returns { Promise<void> } Promise that returns no value. 4398 * @syscap SystemCapability.WindowManager.WindowManager.Core 4399 * @since 6 4400 * @deprecated since 9 4401 * @useinstead ohos.window.Window#setWindowSystemBarEnable 4402 */ 4403 setFullScreen(isFullScreen: boolean): Promise<void>; 4404 4405 /** 4406 * Set the property of the window can layout in full screen 4407 * 4408 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 4409 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4410 * @syscap SystemCapability.WindowManager.WindowManager.Core 4411 * @since 7 4412 * @deprecated since 9 4413 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 4414 */ 4415 setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 4416 4417 /** 4418 * Set the property of the window can layout in full screen 4419 * 4420 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 4421 * @returns { Promise<void> } Promise that returns no value. 4422 * @syscap SystemCapability.WindowManager.WindowManager.Core 4423 * @since 7 4424 * @deprecated since 9 4425 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 4426 */ 4427 setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 4428 4429 /** 4430 * Set the property of the window can layout in full screen 4431 * 4432 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 4433 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4434 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4435 * 2. Incorrect parameter types. 4436 * @throws { BusinessError } 1300002 - This window state is abnormal. 4437 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4438 * @syscap SystemCapability.WindowManager.WindowManager.Core 4439 * @since 9 4440 */ 4441 /** 4442 * Set the property of the window can layout in full screen 4443 * 4444 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 4445 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4446 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4447 * 2. Incorrect parameter types. 4448 * @throws { BusinessError } 1300002 - This window state is abnormal. 4449 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4450 * @syscap SystemCapability.WindowManager.WindowManager.Core 4451 * @crossplatform 4452 * @atomicservice 4453 * @since 12 4454 * @deprecated since 12 4455 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 4456 */ 4457 setWindowLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 4458 4459 /** 4460 * Set the property of the window can layout in full screen 4461 * 4462 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 4463 * @returns { Promise<void> } Promise that returns no value. 4464 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4465 * 2. Incorrect parameter types. 4466 * @throws { BusinessError } 1300002 - This window state is abnormal. 4467 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4468 * @syscap SystemCapability.WindowManager.WindowManager.Core 4469 * @since 9 4470 */ 4471 /** 4472 * Set the property of the window can layout in full screen 4473 * 4474 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 4475 * @returns { Promise<void> } Promise that returns no value. 4476 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4477 * 2. Incorrect parameter types. 4478 * @throws { BusinessError } 1300002 - This window state is abnormal. 4479 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4480 * @syscap SystemCapability.WindowManager.WindowManager.Core 4481 * @crossplatform 4482 * @atomicservice 4483 * @since 12 4484 */ 4485 setWindowLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 4486 4487 /** 4488 * Set the system bar to have visible. 4489 * 4490 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4491 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4492 * @syscap SystemCapability.WindowManager.WindowManager.Core 4493 * @since 7 4494 * @deprecated since 9 4495 * @useinstead ohos.window.Window#setWindowSystemBarEnable 4496 */ 4497 setSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void; 4498 4499 /** 4500 * Set the system bar to have visible. 4501 * 4502 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4503 * @returns { Promise<void> } Promise that returns no value. 4504 * @syscap SystemCapability.WindowManager.WindowManager.Core 4505 * @since 7 4506 * @deprecated since 9 4507 * @useinstead ohos.window.Window#setWindowSystemBarEnable 4508 */ 4509 setSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void>; 4510 4511 /** 4512 * Set the system bar to have visible. 4513 * 4514 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4515 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4516 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4517 * 2. Incorrect parameter types. 4518 * @throws { BusinessError } 1300002 - This window state is abnormal. 4519 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4520 * @syscap SystemCapability.WindowManager.WindowManager.Core 4521 * @since 9 4522 */ 4523 /** 4524 * Set the system bar to have visible. 4525 * 4526 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4527 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4528 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4529 * 2. Incorrect parameter types. 4530 * @throws { BusinessError } 1300002 - This window state is abnormal. 4531 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4532 * @syscap SystemCapability.WindowManager.WindowManager.Core 4533 * @crossplatform 4534 * @since 10 4535 */ 4536 /** 4537 * Set the system bar to have visible. 4538 * 4539 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4540 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4541 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Mandatory parameters are left unspecified; 4542 * 2.Incorrect parameter types. 4543 * @throws { BusinessError } 1300002 - This window state is abnormal. 4544 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4545 * @syscap SystemCapability.WindowManager.WindowManager.Core 4546 * @crossplatform 4547 * @atomicservice 4548 * @since 12 4549 * @deprecated since 12 4550 * @useinstead ohos.window.Window#setWindowSystemBarEnable 4551 */ 4552 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void; 4553 4554 /** 4555 * Set the system bar to have visible. 4556 * 4557 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4558 * @returns { Promise<void> } Promise that returns no value. 4559 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4560 * 2. Incorrect parameter types. 4561 * @throws { BusinessError } 1300002 - This window state is abnormal. 4562 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4563 * @syscap SystemCapability.WindowManager.WindowManager.Core 4564 * @since 9 4565 */ 4566 /** 4567 * Set the system bar to have visible. 4568 * 4569 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4570 * @returns { Promise<void> } Promise that returns no value. 4571 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4572 * 2. Incorrect parameter types. 4573 * @throws { BusinessError } 1300002 - This window state is abnormal. 4574 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4575 * @syscap SystemCapability.WindowManager.WindowManager.Core 4576 * @crossplatform 4577 * @since 10 4578 */ 4579 /** 4580 * Set the system bar to have visible. 4581 * 4582 * @param { Array<'status' | 'navigation'> } names - The set of system bar 4583 * @returns { Promise<void> } Promise that returns no value. 4584 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Mandatory parameters are left unspecified; 4585 * 2.Incorrect parameter types. 4586 * @throws { BusinessError } 1300002 - This window state is abnormal. 4587 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4588 * @syscap SystemCapability.WindowManager.WindowManager.Core 4589 * @crossplatform 4590 * @atomicservice 4591 * @since 12 4592 */ 4593 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void>; 4594 4595 /** 4596 * Set specific system bar to have visible. 4597 * 4598 * @param {SpecificSystemBar} name - the set of system bar 4599 * @param {boolean} enable - Show specific system bar if true, or hide specific system bar if false. 4600 * @returns { Promise<void> } Promise that returns no value. 4601 * @throws {BusinessError} 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4602 * 2. Incorrect parameter types. 4603 * @throws {BusinessError} 1300002 - This window state is abnormal. 4604 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 4605 * @syscap SystemCapability.Window.SessionManager 4606 * @atomicservice 4607 * @since 11 4608 */ 4609 /** 4610 * Set specific system bar to have visible. 4611 * 4612 * @param {SpecificSystemBar} name - the set of system bar 4613 * @param {boolean} enable - Show specific system bar if true, or hide specific system bar if false. 4614 * @param {boolean} enableAnimation - Whether using animation during this setting, using animation if true or not using animation if false. 4615 * @returns { Promise<void> } Promise that returns no value. 4616 * @throws {BusinessError} 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4617 * 2. Incorrect parameter types. 4618 * @throws {BusinessError} 1300002 - This window state is abnormal. 4619 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 4620 * @syscap SystemCapability.Window.SessionManager 4621 * @crossplatform 4622 * @atomicservice 4623 * @since 12 4624 */ 4625 setSpecificSystemBarEnabled(name: SpecificSystemBar, enable: boolean, enableAnimation?: boolean): Promise<void>; 4626 4627 /** 4628 * Set the properties of system bar 4629 * 4630 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 4631 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4632 * @syscap SystemCapability.WindowManager.WindowManager.Core 4633 * @since 6 4634 * @deprecated since 9 4635 * @useinstead ohos.window.Window#setWindowSystemBarProperties 4636 */ 4637 setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 4638 4639 /** 4640 * Set the properties of system bar 4641 * 4642 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 4643 * @returns { Promise<void> } Promise that returns no value. 4644 * @syscap SystemCapability.WindowManager.WindowManager.Core 4645 * @since 6 4646 * @deprecated since 9 4647 * @useinstead ohos.window.Window#setWindowSystemBarProperties 4648 */ 4649 setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 4650 4651 /** 4652 * Set the properties of system bar 4653 * 4654 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 4655 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4656 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4657 * 2. Incorrect parameter types. 4658 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4659 * @throws { BusinessError } 1300002 - This window state is abnormal. 4660 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4661 * @syscap SystemCapability.WindowManager.WindowManager.Core 4662 * @since 9 4663 */ 4664 /** 4665 * Set the properties of system bar 4666 * 4667 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 4668 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4669 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4670 * 2. Incorrect parameter types. 4671 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4672 * @throws { BusinessError } 1300002 - This window state is abnormal. 4673 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4674 * @syscap SystemCapability.WindowManager.WindowManager.Core 4675 * @atomicservice 4676 * @since 12 4677 * @deprecated since 12 4678 * @useinstead ohos.window.Window#setWindowSystemBarProperties 4679 */ 4680 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 4681 4682 /** 4683 * Set the properties of system bar 4684 * 4685 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 4686 * @returns { Promise<void> } Promise that returns no value. 4687 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4688 * 2. Incorrect parameter types. 4689 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4690 * @throws { BusinessError } 1300002 - This window state is abnormal. 4691 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4692 * @syscap SystemCapability.WindowManager.WindowManager.Core 4693 * @since 9 4694 */ 4695 /** 4696 * Set the properties of system bar 4697 * 4698 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 4699 * @returns { Promise<void> } Promise that returns no value. 4700 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4701 * 2. Incorrect parameter types. 4702 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4703 * @throws { BusinessError } 1300002 - This window state is abnormal. 4704 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4705 * @syscap SystemCapability.WindowManager.WindowManager.Core 4706 * @atomicservice 4707 * @since 12 4708 */ 4709 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 4710 4711 /** 4712 * Get the properties of system bar 4713 * 4714 * @returns { SystemBarProperties } Return system bar properties. 4715 * @throws { BusinessError } 1300002 - This window state is abnormal. 4716 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4717 * @throws { BusinessError } 1300004 - Unauthorized operation. 4718 * @syscap SystemCapability.WindowManager.WindowManager.Core 4719 * @atomicservice 4720 * @since 12 4721 */ 4722 getWindowSystemBarProperties(): SystemBarProperties; 4723 4724 /** 4725 * Set whether to disable the gesture back function. 4726 * 4727 * @param { boolean } enabled - If true then enable the gesture back function, false then disable the gesture back function. 4728 * @returns { Promise<void> } Promise that returns no value. 4729 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4730 * 2. Incorrect parameter types. 4731 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4732 * @throws { BusinessError } 1300002 - This window state is abnormal. 4733 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4734 * @throws { BusinessError } 1300004 - Unauthorized operation. 4735 * @syscap SystemCapability.Window.SessionManager 4736 * @atomicservice 4737 * @since 13 4738 */ 4739 setGestureBackEnabled(enabled: boolean): Promise<void>; 4740 4741 /** 4742 * Get whether the gesture back function is currently disabled. 4743 * 4744 * @returns { boolean } enabled - If true then the gesture back function is currently enabled, false then the gesture back function is currently disabled. 4745 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 4746 * @throws { BusinessError } 1300002 - This window state is abnormal. 4747 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4748 * @throws { BusinessError } 1300004 - Unauthorized operation. 4749 * @syscap SystemCapability.Window.SessionManager 4750 * @atomicservice 4751 * @since 13 4752 */ 4753 isGestureBackEnabled(): boolean; 4754 4755 /** 4756 * Set the preferred orientation config of the window 4757 * 4758 * @param { Orientation } orientation - The orientation config of the window 4759 * @returns { Promise<void> } Promise that returns no value. 4760 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4761 * 2. Incorrect parameter types; 4762 * 3. Parameter verification failed. 4763 * @throws { BusinessError } 1300002 - This window state is abnormal. 4764 * @syscap SystemCapability.WindowManager.WindowManager.Core 4765 * @since 9 4766 */ 4767 /** 4768 * Set the preferred orientation config of the window 4769 * 4770 * @param { Orientation } orientation - The orientation config of the window 4771 * @returns { Promise<void> } Promise that returns no value. 4772 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4773 * 2. Incorrect parameter types; 4774 * 3. Parameter verification failed. 4775 * @throws { BusinessError } 1300002 - This window state is abnormal. 4776 * @syscap SystemCapability.WindowManager.WindowManager.Core 4777 * @crossplatform 4778 * @since 10 4779 */ 4780 /** 4781 * Set the preferred orientation config of the window 4782 * 4783 * @param { Orientation } orientation - The orientation config of the window 4784 * @returns { Promise<void> } Promise that returns no value. 4785 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4786 * 2. Incorrect parameter types; 4787 * 3. Parameter verification failed. 4788 * @throws { BusinessError } 1300002 - This window state is abnormal. 4789 * @syscap SystemCapability.WindowManager.WindowManager.Core 4790 * @crossplatform 4791 * @atomicservice 4792 * @since 11 4793 */ 4794 setPreferredOrientation(orientation: Orientation): Promise<void>; 4795 4796 /** 4797 * Set the preferred orientation config of the window 4798 * 4799 * @param { Orientation } orientation - The orientation config of the window 4800 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4801 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4802 * 2. Incorrect parameter types; 4803 * 3. Parameter verification failed. 4804 * @throws { BusinessError } 1300002 - This window state is abnormal. 4805 * @syscap SystemCapability.WindowManager.WindowManager.Core 4806 * @since 9 4807 */ 4808 /** 4809 * Set the preferred orientation config of the window 4810 * 4811 * @param { Orientation } orientation - The orientation config of the window 4812 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4813 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4814 * 2. Incorrect parameter types; 4815 * 3. Parameter verification failed. 4816 * @throws { BusinessError } 1300002 - This window state is abnormal. 4817 * @syscap SystemCapability.WindowManager.WindowManager.Core 4818 * @crossplatform 4819 * @since 10 4820 */ 4821 /** 4822 * Set the preferred orientation config of the window 4823 * 4824 * @param { Orientation } orientation - The orientation config of the window 4825 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4826 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4827 * 2. Incorrect parameter types; 4828 * 3. Parameter verification failed. 4829 * @throws { BusinessError } 1300002 - This window state is abnormal. 4830 * @syscap SystemCapability.WindowManager.WindowManager.Core 4831 * @crossplatform 4832 * @atomicservice 4833 * @since 11 4834 */ 4835 setPreferredOrientation(orientation: Orientation, callback: AsyncCallback<void>): void; 4836 4837 /** 4838 * Get the preferred orientation config of the window 4839 * 4840 * @returns { Orientation } orientation - The orientation config of the window 4841 * @throws { BusinessError } 1300002 - This window state is abnormal. 4842 * @syscap SystemCapability.WindowManager.WindowManager.Core 4843 * @atomicservice 4844 * @since 12 4845 */ 4846 getPreferredOrientation(): Orientation; 4847 4848 /** 4849 * Loads content 4850 * 4851 * @param { string } path - Path of the page to which the content will be loaded 4852 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 4853 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4854 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4855 * 2. Incorrect parameter types. 4856 * @throws { BusinessError } 1300002 - This window state is abnormal. 4857 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4858 * @syscap SystemCapability.WindowManager.WindowManager.Core 4859 * @StageModelOnly 4860 * @since 9 4861 */ 4862 /** 4863 * Loads content 4864 * 4865 * @param { string } path - Path of the page to which the content will be loaded 4866 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 4867 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4868 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4869 * 2. Incorrect parameter types. 4870 * @throws { BusinessError } 1300002 - This window state is abnormal. 4871 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4872 * @syscap SystemCapability.WindowManager.WindowManager.Core 4873 * @StageModelOnly 4874 * @crossplatform 4875 * @since 10 4876 */ 4877 /** 4878 * Loads content 4879 * 4880 * @param { string } path - Path of the page to which the content will be loaded 4881 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 4882 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4883 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4884 * 2. Incorrect parameter types. 4885 * @throws { BusinessError } 1300002 - This window state is abnormal. 4886 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4887 * @syscap SystemCapability.WindowManager.WindowManager.Core 4888 * @StageModelOnly 4889 * @crossplatform 4890 * @atomicservice 4891 * @since 11 4892 */ 4893 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 4894 4895 /** 4896 * Loads content 4897 * 4898 * @param { string } path - Path of the page to which the content will be loaded 4899 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 4900 * @returns { Promise<void> } Promise that returns no value. 4901 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4902 * 2. Incorrect parameter types. 4903 * @throws { BusinessError } 1300002 - This window state is abnormal. 4904 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4905 * @syscap SystemCapability.WindowManager.WindowManager.Core 4906 * @StageModelOnly 4907 * @since 9 4908 */ 4909 /** 4910 * Loads content 4911 * 4912 * @param { string } path - Path of the page to which the content will be loaded 4913 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 4914 * @returns { Promise<void> } Promise that returns no value. 4915 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4916 * 2. Incorrect parameter types. 4917 * @throws { BusinessError } 1300002 - This window state is abnormal. 4918 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4919 * @syscap SystemCapability.WindowManager.WindowManager.Core 4920 * @StageModelOnly 4921 * @crossplatform 4922 * @since 10 4923 */ 4924 /** 4925 * Loads content 4926 * 4927 * @param { string } path - Path of the page to which the content will be loaded 4928 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 4929 * @returns { Promise<void> } Promise that returns no value. 4930 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4931 * 2. Incorrect parameter types. 4932 * @throws { BusinessError } 1300002 - This window state is abnormal. 4933 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4934 * @syscap SystemCapability.WindowManager.WindowManager.Core 4935 * @StageModelOnly 4936 * @crossplatform 4937 * @atomicservice 4938 * @since 11 4939 */ 4940 loadContent(path: string, storage: LocalStorage): Promise<void>; 4941 4942 /** 4943 * Loads content 4944 * 4945 * @param { string } path - Path of the page to which the content will be loaded 4946 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4947 * @syscap SystemCapability.WindowManager.WindowManager.Core 4948 * @since 7 4949 * @deprecated since 9 4950 * @useinstead ohos.window.Window#setUIContent 4951 */ 4952 loadContent(path: string, callback: AsyncCallback<void>): void; 4953 4954 /** 4955 * Loads content 4956 * 4957 * @param { string } path - Path of the page to which the content will be loaded 4958 * @returns { Promise<void> } Promise that returns no value. 4959 * @syscap SystemCapability.WindowManager.WindowManager.Core 4960 * @since 7 4961 * @deprecated since 9 4962 * @useinstead ohos.window.Window#setUIContent 4963 */ 4964 loadContent(path: string): Promise<void>; 4965 4966 /** 4967 * Get the UIContext associate with the window content. 4968 * 4969 * @returns { UIContext } the object of UIContext. 4970 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4971 * 2. Incorrect parameter types; 4972 * 3. Parameter verification failed. 4973 * @throws { BusinessError } 1300002 - This window state is abnormal. 4974 * @syscap SystemCapability.WindowManager.WindowManager.Core 4975 * @stagemodelonly 4976 * @crossplatform 4977 * @since 10 4978 */ 4979 /** 4980 * Get the UIContext associate with the window content. 4981 * 4982 * @returns { UIContext } the object of UIContext. 4983 * @throws { BusinessError } 1300002 - This window state is abnormal. 4984 * @syscap SystemCapability.WindowManager.WindowManager.Core 4985 * @stagemodelonly 4986 * @crossplatform 4987 * @atomicservice 4988 * @since 11 4989 */ 4990 getUIContext() : UIContext; 4991 4992 /** 4993 * Loads content 4994 * 4995 * @param { string } path - Path of the page to which the content will be loaded 4996 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4997 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 4998 * 2. Incorrect parameter types. 4999 * @throws { BusinessError } 1300002 - This window state is abnormal. 5000 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5001 * @syscap SystemCapability.WindowManager.WindowManager.Core 5002 * @since 9 5003 */ 5004 /** 5005 * Loads content 5006 * 5007 * @param { string } path - Path of the page to which the content will be loaded 5008 * @param { AsyncCallback<void> } callback - Callback used to return the result. 5009 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5010 * 2. Incorrect parameter types. 5011 * @throws { BusinessError } 1300002 - This window state is abnormal. 5012 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5013 * @syscap SystemCapability.WindowManager.WindowManager.Core 5014 * @crossplatform 5015 * @since 10 5016 */ 5017 /** 5018 * Loads content 5019 * 5020 * @param { string } path - Path of the page to which the content will be loaded 5021 * @param { AsyncCallback<void> } callback - Callback used to return the result. 5022 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5023 * 2. Incorrect parameter types. 5024 * @throws { BusinessError } 1300002 - This window state is abnormal. 5025 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5026 * @syscap SystemCapability.WindowManager.WindowManager.Core 5027 * @crossplatform 5028 * @atomicservice 5029 * @since 11 5030 */ 5031 setUIContent(path: string, callback: AsyncCallback<void>): void; 5032 5033 /** 5034 * Loads content 5035 * 5036 * @param { string } path - Path of the page to which the content will be loaded 5037 * @returns { Promise<void> } Promise that returns no value. 5038 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5039 * 2. Incorrect parameter types. 5040 * @throws { BusinessError } 1300002 - This window state is abnormal. 5041 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5042 * @syscap SystemCapability.WindowManager.WindowManager.Core 5043 * @since 9 5044 */ 5045 /** 5046 * Loads content 5047 * 5048 * @param { string } path - Path of the page to which the content will be loaded 5049 * @returns { Promise<void> } Promise that returns no value. 5050 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5051 * 2. Incorrect parameter types. 5052 * @throws { BusinessError } 1300002 - This window state is abnormal. 5053 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5054 * @syscap SystemCapability.WindowManager.WindowManager.Core 5055 * @crossplatform 5056 * @since 10 5057 */ 5058 /** 5059 * Loads content 5060 * 5061 * @param { string } path - Path of the page to which the content will be loaded 5062 * @returns { Promise<void> } Promise that returns no value. 5063 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5064 * 2. Incorrect parameter types. 5065 * @throws { BusinessError } 1300002 - This window state is abnormal. 5066 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5067 * @syscap SystemCapability.WindowManager.WindowManager.Core 5068 * @crossplatform 5069 * @atomicservice 5070 * @since 11 5071 */ 5072 setUIContent(path: string): Promise<void>; 5073 5074 /** 5075 * Loads content by named router 5076 * 5077 * @param { string } name - name of the page to which the content will be loaded. 5078 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 5079 * @param { AsyncCallback<void> } callback - Callback used to return the result. 5080 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5081 * 2. Incorrect parameter types. 5082 * @throws { BusinessError } 1300002 - This window state is abnormal. 5083 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5084 * @syscap SystemCapability.WindowManager.WindowManager.Core 5085 * @stagemodelonly 5086 * @crossplatform 5087 * @atomicservice 5088 * @since 11 5089 */ 5090 loadContentByName(name: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 5091 5092 /** 5093 * Loads content by named router 5094 * 5095 * @param { string } name - name of the page to which the content will be loaded. 5096 * @param { AsyncCallback<void> } callback - Callback used to return the result. 5097 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5098 * 2. Incorrect parameter types. 5099 * @throws { BusinessError } 1300002 - This window state is abnormal. 5100 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5101 * @syscap SystemCapability.WindowManager.WindowManager.Core 5102 * @stagemodelonly 5103 * @crossplatform 5104 * @atomicservice 5105 * @since 11 5106 */ 5107 loadContentByName(name: string, callback: AsyncCallback<void>): void; 5108 5109 /** 5110 * Loads content by named router 5111 * 5112 * @param { string } name - name of the page to which the content will be loaded. 5113 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 5114 * @returns { Promise<void> } Promise that returns no value. 5115 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5116 * 2. Incorrect parameter types. 5117 * @throws { BusinessError } 1300002 - This window state is abnormal. 5118 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5119 * @syscap SystemCapability.WindowManager.WindowManager.Core 5120 * @stagemodelonly 5121 * @crossplatform 5122 * @atomicservice 5123 * @since 11 5124 */ 5125 loadContentByName(name: string, storage?: LocalStorage): Promise<void>; 5126 5127 /** 5128 * Checks whether the window is displayed 5129 * 5130 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 5131 * @syscap SystemCapability.WindowManager.WindowManager.Core 5132 * @since 7 5133 * @deprecated since 9 5134 * @useinstead ohos.window.Window#isWindowShowing 5135 */ 5136 isShowing(callback: AsyncCallback<boolean>): void; 5137 5138 /** 5139 * Checks whether the window is displayed 5140 * 5141 * @returns { Promise<boolean> } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 5142 * @syscap SystemCapability.WindowManager.WindowManager.Core 5143 * @since 7 5144 * @deprecated since 9 5145 * @useinstead ohos.window.Window#isWindowShowing 5146 */ 5147 isShowing(): Promise<boolean>; 5148 5149 /** 5150 * Checks whether the window is displayed 5151 * 5152 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 5153 * @throws { BusinessError } 1300002 - This window state is abnormal. 5154 * @syscap SystemCapability.WindowManager.WindowManager.Core 5155 * @since 9 5156 */ 5157 /** 5158 * Checks whether the window is displayed 5159 * 5160 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 5161 * @throws { BusinessError } 1300002 - This window state is abnormal. 5162 * @syscap SystemCapability.WindowManager.WindowManager.Core 5163 * @crossplatform 5164 * @since 10 5165 */ 5166 /** 5167 * Checks whether the window is displayed 5168 * 5169 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 5170 * @throws { BusinessError } 1300002 - This window state is abnormal. 5171 * @syscap SystemCapability.WindowManager.WindowManager.Core 5172 * @crossplatform 5173 * @atomicservice 5174 * @since 11 5175 */ 5176 isWindowShowing(): boolean; 5177 5178 /** 5179 * Register the callback of windowSizeChange 5180 * 5181 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 5182 * @param { Callback<Size> } callback - Callback used to return the window size. 5183 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5184 * 2. Incorrect parameter types; 5185 * 3. Parameter verification failed. 5186 * @syscap SystemCapability.WindowManager.WindowManager.Core 5187 * @since 7 5188 */ 5189 /** 5190 * Register the callback of windowSizeChange 5191 * 5192 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 5193 * @param { Callback<Size> } callback - Callback used to return the window size. 5194 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5195 * 2. Incorrect parameter types; 5196 * 3. Parameter verification failed. 5197 * @syscap SystemCapability.WindowManager.WindowManager.Core 5198 * @atomicservice 5199 * @since 11 5200 */ 5201 /** 5202 * Register the callback of windowSizeChange 5203 * 5204 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 5205 * @param { Callback<Size> } callback - Callback used to return the window size. 5206 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5207 * 2. Incorrect parameter types; 5208 * 3. Parameter verification failed. 5209 * @syscap SystemCapability.WindowManager.WindowManager.Core 5210 * @crossplatform 5211 * @atomicservice 5212 * @since 12 5213 */ 5214 on(type: 'windowSizeChange', callback: Callback<Size>): void; 5215 5216 /** 5217 * Unregister the callback of windowSizeChange 5218 * 5219 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 5220 * @param { Callback<Size> } callback - Callback used to return the window size. 5221 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5222 * 2. Parameter verification failed. 5223 * @syscap SystemCapability.WindowManager.WindowManager.Core 5224 * @since 7 5225 */ 5226 /** 5227 * Unregister the callback of windowSizeChange 5228 * 5229 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 5230 * @param { Callback<Size> } callback - Callback used to return the window size. 5231 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5232 * 2. Parameter verification failed. 5233 * @syscap SystemCapability.WindowManager.WindowManager.Core 5234 * @atomicservice 5235 * @since 11 5236 */ 5237 /** 5238 * Unregister the callback of windowSizeChange 5239 * 5240 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 5241 * @param { Callback<Size> } callback - Callback used to return the window size. 5242 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5243 * 2. Parameter verification failed. 5244 * @syscap SystemCapability.WindowManager.WindowManager.Core 5245 * @crossplatform 5246 * @atomicservice 5247 * @since 12 5248 */ 5249 off(type: 'windowSizeChange', callback?: Callback<Size>): void; 5250 5251 /** 5252 * Register the callback of systemAvoidAreaChange 5253 * 5254 * @param { 'systemAvoidAreaChange' } type - The value is fixed at 'systemAvoidAreaChange', indicating the event of changes to the avoid area. 5255 * @param { Callback<AvoidArea> } callback - Callback used to return the area. 5256 * @syscap SystemCapability.WindowManager.WindowManager.Core 5257 * @since 7 5258 * @deprecated since 9 5259 * @useinstead ohos.window.Window#on_avoidAreaChange 5260 */ 5261 on(type: 'systemAvoidAreaChange', callback: Callback<AvoidArea>): void; 5262 5263 /** 5264 * Unregister the callback of systemAvoidAreaChange 5265 * 5266 * @param { 'systemAvoidAreaChange' } type - The value is fixed at 'systemAvoidAreaChange', indicating the event of changes to the avoid area. 5267 * @param { Callback<AvoidArea> } callback - Callback used to return the area. 5268 * @syscap SystemCapability.WindowManager.WindowManager.Core 5269 * @since 7 5270 * @deprecated since 9 5271 * @useinstead ohos.window.Window#off_avoidAreaChange 5272 */ 5273 off(type: 'systemAvoidAreaChange', callback?: Callback<AvoidArea>): void; 5274 5275 /** 5276 * Register the callback of avoidAreaChange 5277 * 5278 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 5279 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 5280 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5281 * 2. Incorrect parameter types; 5282 * 3. Parameter verification failed. 5283 * @syscap SystemCapability.WindowManager.WindowManager.Core 5284 * @since 9 5285 */ 5286 /** 5287 * Register the callback of avoidAreaChange 5288 * 5289 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 5290 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 5291 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5292 * 2. Incorrect parameter types; 5293 * 3. Parameter verification failed. 5294 * @syscap SystemCapability.WindowManager.WindowManager.Core 5295 * @atomicservice 5296 * @since 11 5297 */ 5298 /** 5299 * Register the callback of avoidAreaChange 5300 * 5301 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 5302 * @param { Callback<AvoidAreaOptions> } callback - Callback used to return the area. 5303 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5304 * 2. Incorrect parameter types; 5305 * 3. Parameter verification failed. 5306 * @syscap SystemCapability.WindowManager.WindowManager.Core 5307 * @atomicservice 5308 * @since 12 5309 */ 5310 on(type: 'avoidAreaChange', callback: Callback<AvoidAreaOptions>): void; 5311 5312 /** 5313 * Unregister the callback of avoidAreaChange 5314 * 5315 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 5316 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 5317 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 5318 * 2. Parameter verification failed. 5319 * @syscap SystemCapability.WindowManager.WindowManager.Core 5320 * @since 9 5321 */ 5322 /** 5323 * Unregister the callback of avoidAreaChange 5324 * 5325 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 5326 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 5327 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 5328 * 2. Parameter verification failed. 5329 * @syscap SystemCapability.WindowManager.WindowManager.Core 5330 * @atomicservice 5331 * @since 11 5332 */ 5333 /** 5334 * Unregister the callback of avoidAreaChange 5335 * 5336 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 5337 * @param { Callback<AvoidAreaOptions> } callback - Callback used to return the area. 5338 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 5339 * 2. Parameter verification failed. 5340 * @syscap SystemCapability.WindowManager.WindowManager.Core 5341 * @atomicservice 5342 * @since 12 5343 */ 5344 off(type: 'avoidAreaChange', callback?: Callback<AvoidAreaOptions>): void; 5345 5346 /** 5347 * Register the callback of keyboardHeightChange 5348 * 5349 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 5350 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 5351 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5352 * 2. Incorrect parameter types; 5353 * 3. Parameter verification failed. 5354 * @syscap SystemCapability.WindowManager.WindowManager.Core 5355 * @since 7 5356 */ 5357 /** 5358 * Register the callback of keyboardHeightChange 5359 * 5360 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 5361 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 5362 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5363 * 2. Incorrect parameter types; 5364 * 3. Parameter verification failed. 5365 * @syscap SystemCapability.WindowManager.WindowManager.Core 5366 * @atomicservice 5367 * @since 12 5368 */ 5369 on(type: 'keyboardHeightChange', callback: Callback<number>): void; 5370 5371 /** 5372 * Unregister the callback of keyboardHeightChange 5373 * 5374 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 5375 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 5376 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5377 * 2. Parameter verification failed. 5378 * @syscap SystemCapability.WindowManager.WindowManager.Core 5379 * @since 7 5380 */ 5381 /** 5382 * Unregister the callback of keyboardHeightChange 5383 * 5384 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 5385 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 5386 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5387 * 2. Parameter verification failed. 5388 * @syscap SystemCapability.WindowManager.WindowManager.Core 5389 * @atomicservice 5390 * @since 12 5391 */ 5392 off(type: 'keyboardHeightChange', callback?: Callback<number>): void; 5393 5394 /** 5395 * Touch outside callback on. 5396 * 5397 * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. 5398 * @param { Callback<void> } callback - Callback used to return the click event outside this window. 5399 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5400 * 2. Incorrect parameter types; 5401 * 3. Parameter verification failed. 5402 * @syscap SystemCapability.WindowManager.WindowManager.Core 5403 * @atomicservice 5404 * @since 11 5405 */ 5406 on(type: 'touchOutside', callback: Callback<void>): void; 5407 5408 /** 5409 * Touch outside callback off. 5410 * 5411 * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. 5412 * @param { Callback<void> } callback - Callback used to return the click event outside this window. 5413 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5414 * 2. Parameter verification failed. 5415 * @syscap SystemCapability.WindowManager.WindowManager.Core 5416 * @atomicservice 5417 * @since 11 5418 */ 5419 off(type: 'touchOutside', callback?: Callback<void>): void; 5420 5421 /** 5422 * Window displayId change callback on. 5423 * 5424 * @param { 'displayIdChange' } type - The value is fixed at 'displayIdChange', indicating the Display this window is current showing has changed. 5425 * @param { Callback<number> } callback - Callback used to notify the Display this window is current showing has changed. 5426 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5427 * 2. Incorrect parameter types; 5428 * 3. Parameter verification failed. 5429 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5430 * @throws { BusinessError } 1300002 - This window state is abnormal. 5431 * @syscap SystemCapability.Window.SessionManager 5432 * @atomicservice 5433 * @since 14 5434 */ 5435 on(type: 'displayIdChange', callback: Callback<number>): void; 5436 5437 /** 5438 * Window displayId change callback off. 5439 * 5440 * @param { 'displayIdChange' } type - The value is fixed at 'displayIdChange', indicating the Display this window is current showing has changed. 5441 * @param { Callback<number> } callback - Callback used to notify the Display this window is current showing has changed. 5442 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5443 * 2. Parameter verification failed. 5444 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5445 * @throws { BusinessError } 1300002 - This window state is abnormal. 5446 * @syscap SystemCapability.Window.SessionManager 5447 * @atomicservice 5448 * @since 14 5449 */ 5450 off(type: 'displayIdChange', callback?: Callback<number>): void; 5451 5452 /** 5453 * Window visibility change callback on. 5454 * 5455 * @param { 'windowVisibilityChange' } type - The value is fixed at 'windowVisibilityChange', indicating the window visibility change. 5456 * @param { Callback<boolean> } callback - Callback used to notify the window visibility change. 5457 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5458 * 2. Incorrect parameter types; 5459 * 3. Parameter verification failed. 5460 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5461 * @throws { BusinessError } 1300002 - This window state is abnormal. 5462 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5463 * @syscap SystemCapability.Window.SessionManager 5464 * @since 11 5465 */ 5466 /** 5467 * Window visibility change callback on. 5468 * 5469 * @param { 'windowVisibilityChange' } type - The value is fixed at 'windowVisibilityChange', indicating the window visibility change. 5470 * @param { Callback<boolean> } callback - Callback used to notify the window visibility change. 5471 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5472 * 2. Incorrect parameter types; 5473 * 3. Parameter verification failed. 5474 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5475 * @throws { BusinessError } 1300002 - This window state is abnormal. 5476 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5477 * @syscap SystemCapability.Window.SessionManager 5478 * @atomicservice 5479 * @since 12 5480 */ 5481 on(type: 'windowVisibilityChange', callback: Callback<boolean>): void; 5482 5483 /** 5484 * Window visibility change callback off. 5485 * 5486 * @param { 'windowVisibilityChange' } type - The value is fixed at 'windowVisibilityChange', indicating the window visibility change. 5487 * @param { Callback<boolean> } callback - Callback used to notify the window visibility change. 5488 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5489 * 2. Parameter verification failed. 5490 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5491 * @throws { BusinessError } 1300002 - This window state is abnormal. 5492 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5493 * @syscap SystemCapability.Window.SessionManager 5494 * @since 11 5495 */ 5496 /** 5497 * Window visibility change callback off. 5498 * 5499 * @param { 'windowVisibilityChange' } type - The value is fixed at 'windowVisibilityChange', indicating the window visibility change. 5500 * @param { Callback<boolean> } callback - Callback used to notify the window visibility change. 5501 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5502 * 2. Parameter verification failed. 5503 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5504 * @throws { BusinessError } 1300002 - This window state is abnormal. 5505 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5506 * @syscap SystemCapability.Window.SessionManager 5507 * @atomicservice 5508 * @since 12 5509 */ 5510 off(type: 'windowVisibilityChange', callback?: Callback<boolean>): void; 5511 5512 /** 5513 * Register the callback function that has no interaction for a long time. 5514 * 5515 * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', indicating the window has no interaction for a long time. 5516 * @param { number } timeout - The timeout(in seconds) of no interaction detection. 5517 * @param { Callback<void> } callback - Callback used to notify the window has no interaction for a long time. 5518 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5519 * 2. Incorrect parameter types; 5520 * 3. Parameter verification failed. 5521 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5522 * @throws { BusinessError } 1300002 - This window state is abnormal. 5523 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5524 * @syscap SystemCapability.Window.SessionManager 5525 * @atomicservice 5526 * @since 12 5527 */ 5528 on(type: 'noInteractionDetected', timeout: number, callback: Callback<void>): void; 5529 5530 /** 5531 * Unregister the callback function that has no interaction for a long time. 5532 * 5533 * @param { 'noInteractionDetected' } type - The value is fixed at 'noInteractionDetected', indicating the window has no interaction for a long time. 5534 * @param { Callback<void> } callback - Callback used to notify the window has no interaction for a long time. 5535 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5536 * 2. Parameter verification failed. 5537 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5538 * @throws { BusinessError } 1300002 - This window state is abnormal. 5539 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5540 * @syscap SystemCapability.Window.SessionManager 5541 * @atomicservice 5542 * @since 12 5543 */ 5544 off(type: 'noInteractionDetected', callback?: Callback<void>): void; 5545 5546 /** 5547 * Register the callback of screenshot, only the focused window called back 5548 * 5549 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 5550 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 5551 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5552 * 2. Incorrect parameter types; 5553 * 3. Parameter verification failed. 5554 * @syscap SystemCapability.WindowManager.WindowManager.Core 5555 * @since 9 5556 */ 5557 /** 5558 * Register the callback of screenshot, only the focused window called back 5559 * 5560 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 5561 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 5562 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5563 * 2. Incorrect parameter types; 5564 * 3. Parameter verification failed. 5565 * @syscap SystemCapability.WindowManager.WindowManager.Core 5566 * @atomicservice 5567 * @since 12 5568 */ 5569 on(type: 'screenshot', callback: Callback<void>): void; 5570 5571 /** 5572 * Unregister the callback of screenshot 5573 * 5574 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 5575 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 5576 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5577 * 2. Parameter verification failed. 5578 * @syscap SystemCapability.WindowManager.WindowManager.Core 5579 * @since 9 5580 */ 5581 /** 5582 * Unregister the callback of screenshot 5583 * 5584 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 5585 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 5586 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5587 * 2. Parameter verification failed. 5588 * @syscap SystemCapability.WindowManager.WindowManager.Core 5589 * @atomicservice 5590 * @since 12 5591 */ 5592 off(type: 'screenshot', callback?: Callback<void>): void; 5593 5594 /** 5595 * Register the callback of dialogTargetTouch 5596 * 5597 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', indicating the click event of the target window in the modal window mode. 5598 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 5599 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5600 * 2. Incorrect parameter types; 5601 * 3. Parameter verification failed. 5602 * @syscap SystemCapability.WindowManager.WindowManager.Core 5603 * @since 10 5604 */ 5605 /** 5606 * Register the callback of dialogTargetTouch 5607 * 5608 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', indicating the click event of the target window in the modal window mode. 5609 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 5610 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5611 * 2. Incorrect parameter types; 5612 * 3. Parameter verification failed. 5613 * @syscap SystemCapability.WindowManager.WindowManager.Core 5614 * @atomicservice 5615 * @since 12 5616 */ 5617 on(type: 'dialogTargetTouch', callback: Callback<void>): void; 5618 5619 /** 5620 * Unregister the callback of dialogTargetTouch 5621 * 5622 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', 5623 * indicating the click event of the target window in the modal window mode. 5624 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 5625 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5626 * 2. Parameter verification failed. 5627 * @syscap SystemCapability.WindowManager.WindowManager.Core 5628 * @since 10 5629 */ 5630 /** 5631 * Unregister the callback of dialogTargetTouch 5632 * 5633 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', 5634 * indicating the click event of the target window in the modal window mode. 5635 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 5636 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5637 * 2. Parameter verification failed. 5638 * @syscap SystemCapability.WindowManager.WindowManager.Core 5639 * @atomicservice 5640 * @since 12 5641 */ 5642 off(type: 'dialogTargetTouch', callback?: Callback<void>): void; 5643 5644 /** 5645 * Register the callback of windowEvent 5646 * 5647 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 5648 * @param { Callback<WindowEventType> } callback - the callback of window event 5649 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5650 * 2. Incorrect parameter types; 5651 * 3. Parameter verification failed. 5652 * @syscap SystemCapability.WindowManager.WindowManager.Core 5653 * @since 10 5654 */ 5655 /** 5656 * Register the callback of windowEvent 5657 * 5658 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 5659 * @param { Callback<WindowEventType> } callback - the callback of window event 5660 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5661 * 2. Incorrect parameter types; 5662 * 3. Parameter verification failed. 5663 * @syscap SystemCapability.WindowManager.WindowManager.Core 5664 * @crossplatform 5665 * @atomicservice 5666 * @since 11 5667 */ 5668 on(type: 'windowEvent', callback: Callback<WindowEventType>): void; 5669 5670 /** 5671 * Unregister the callback of windowEvent 5672 * 5673 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 5674 * @param { Callback<WindowEventType> } callback - the callback of window event 5675 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5676 * 2. Parameter verification failed. 5677 * @syscap SystemCapability.WindowManager.WindowManager.Core 5678 * @since 10 5679 */ 5680 /** 5681 * Unregister the callback of windowEvent 5682 * 5683 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 5684 * @param { Callback<WindowEventType> } callback - the callback of window event 5685 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5686 * 2. Parameter verification failed. 5687 * @syscap SystemCapability.WindowManager.WindowManager.Core 5688 * @crossplatform 5689 * @atomicservice 5690 * @since 11 5691 */ 5692 off(type: 'windowEvent', callback?: Callback<WindowEventType>): void; 5693 5694 /** 5695 * Register the callback of windowStatusChange 5696 * 5697 * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. 5698 * @param { Callback<WindowStatusType> } callback - Callback used to return the window status. 5699 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5700 * 2. Incorrect parameter types; 5701 * 3. Parameter verification failed. 5702 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5703 * @syscap SystemCapability.Window.SessionManager 5704 * @since 11 5705 */ 5706 /** 5707 * Register the callback of windowStatusChange 5708 * 5709 * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. 5710 * @param { Callback<WindowStatusType> } callback - Callback used to return the window status. 5711 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5712 * 2. Incorrect parameter types; 5713 * 3. Parameter verification failed. 5714 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5715 * @syscap SystemCapability.Window.SessionManager 5716 * @atomicservice 5717 * @since 12 5718 */ 5719 on(type: 'windowStatusChange', callback: Callback<WindowStatusType>): void; 5720 5721 /** 5722 * Unregister the callback of windowStatusChange 5723 * 5724 * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. 5725 * @param { Callback<WindowStatusType> } callback - Callback used to return the window status. 5726 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5727 * 2. Parameter verification failed. 5728 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5729 * @syscap SystemCapability.Window.SessionManager 5730 * @since 11 5731 */ 5732 /** 5733 * Unregister the callback of windowStatusChange 5734 * 5735 * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. 5736 * @param { Callback<WindowStatusType> } callback - Callback used to return the window status. 5737 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5738 * 2. Parameter verification failed. 5739 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5740 * @syscap SystemCapability.Window.SessionManager 5741 * @atomicservice 5742 * @since 12 5743 */ 5744 off(type: 'windowStatusChange', callback?: Callback<WindowStatusType>): void; 5745 5746 /** 5747 * Register the callback of subWindowClose 5748 * 5749 * @param { 'subWindowClose' } type - The value is fixed at 'subWindowClose', indicating the subwindow close event. 5750 * @param { Callback<void> } callback - Callback used to return whether to terminate the subwindow close process. 5751 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5752 * 2. Parameter verification failed. 5753 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5754 * @throws { BusinessError } 1300002 - This window state is abnormal. 5755 * @throws { BusinessError } 1300004 - Unauthorized operation. 5756 * @syscap SystemCapability.Window.SessionManager 5757 * @atomicservice 5758 * @since 12 5759 */ 5760 on(type: 'subWindowClose', callback: Callback<void>): void; 5761 5762 /** 5763 * Unregister the callback of subWindowClose 5764 * 5765 * @param { 'subWindowClose' } type - The value is fixed at 'subWindowClose', indicating the subwindow close event. 5766 * @param { Callback<void> } callback - Callback used to return whether to terminate the subwindow close process. 5767 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 5768 * 2. Parameter verification failed. 5769 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5770 * @throws { BusinessError } 1300002 - This window state is abnormal. 5771 * @throws { BusinessError } 1300004 - Unauthorized operation. 5772 * @syscap SystemCapability.Window.SessionManager 5773 * @atomicservice 5774 * @since 12 5775 */ 5776 off(type: 'subWindowClose', callback?: Callback<void>): void; 5777 5778 /** 5779 * Bind dialog to the target window. 5780 * 5781 * @param { rpc.RemoteObject } token - token of the target window. 5782 * @param { Callback<void> } deathCallback - the callback of dialogDeath. 5783 * @returns { Promise<void> } Promise that returns no value. 5784 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5785 * @throws { BusinessError } 1300002 - This window state is abnormal. 5786 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5787 * @syscap SystemCapability.WindowManager.WindowManager.Core 5788 * @systemapi Hide this for inner system use. 5789 * @since 9 5790 */ 5791 /** 5792 * Bind dialog to the target window. 5793 * 5794 * @param { rpc.RemoteObject } token - token of the target window. 5795 * @param { Callback<void> } deathCallback - the callback of dialogDeath. 5796 * @returns { Promise<void> } Promise that returns no value. 5797 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 5798 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5799 * @throws { BusinessError } 1300002 - This window state is abnormal. 5800 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5801 * @syscap SystemCapability.WindowManager.WindowManager.Core 5802 * @systemapi Hide this for inner system use. 5803 * @since 12 5804 */ 5805 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>): Promise<void>; 5806 5807 /** 5808 * Bind dialog to the target window. 5809 * 5810 * @param { rpc.RemoteObject } token token of the target window. 5811 * @param { Callback<void> } deathCallback the callback of dialogDeath. 5812 * @param { AsyncCallback<void> } callback Callback used to return the result. 5813 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5814 * @throws { BusinessError } 1300002 - This window state is abnormal. 5815 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5816 * @syscap SystemCapability.WindowManager.WindowManager.Core 5817 * @systemapi Hide this for inner system use. 5818 * @since 9 5819 */ 5820 /** 5821 * Bind dialog to the target window. 5822 * 5823 * @param { rpc.RemoteObject } token token of the target window. 5824 * @param { Callback<void> } deathCallback the callback of dialogDeath. 5825 * @param { AsyncCallback<void> } callback Callback used to return the result. 5826 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 5827 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5828 * @throws { BusinessError } 1300002 - This window state is abnormal. 5829 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5830 * @syscap SystemCapability.WindowManager.WindowManager.Core 5831 * @systemapi Hide this for inner system use. 5832 * @since 12 5833 */ 5834 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>, callback: AsyncCallback<void>): void; 5835 5836 /** 5837 * Bind dialog to the target window. 5838 * 5839 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 5840 * @param { Callback<void> } deathCallback the callback of dialogDeath. 5841 * @returns { Promise<void> } Promise that returns no value. 5842 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5843 * @throws { BusinessError } 1300002 - This window state is abnormal. 5844 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5845 * @syscap SystemCapability.WindowManager.WindowManager.Core 5846 * @systemapi Hide this for inner system use. 5847 * @since 9 5848 */ 5849 /** 5850 * Bind dialog to the target window. 5851 * 5852 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 5853 * @param { Callback<void> } deathCallback the callback of dialogDeath. 5854 * @returns { Promise<void> } Promise that returns no value. 5855 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 5856 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5857 * @throws { BusinessError } 1300002 - This window state is abnormal. 5858 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5859 * @syscap SystemCapability.WindowManager.WindowManager.Core 5860 * @systemapi Hide this for inner system use. 5861 * @since 12 5862 */ 5863 bindDialogTarget(requestInfo: dialogRequest.RequestInfo, deathCallback: Callback<void>): Promise<void>; 5864 5865 /** 5866 * Bind dialog to the target window. 5867 * 5868 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 5869 * @param { Callback<void> } deathCallback the callback of dialogDeath. 5870 * @param { AsyncCallback<void> } callback Callback used to return the result. 5871 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5872 * @throws { BusinessError } 1300002 - This window state is abnormal. 5873 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5874 * @syscap SystemCapability.WindowManager.WindowManager.Core 5875 * @systemapi Hide this for inner system use. 5876 * @since 9 5877 */ 5878 /** 5879 * Bind dialog to the target window. 5880 * 5881 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 5882 * @param { Callback<void> } deathCallback the callback of dialogDeath. 5883 * @param { AsyncCallback<void> } callback Callback used to return the result. 5884 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 5885 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 5886 * @throws { BusinessError } 1300002 - This window state is abnormal. 5887 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5888 * @syscap SystemCapability.WindowManager.WindowManager.Core 5889 * @systemapi Hide this for inner system use. 5890 * @since 12 5891 */ 5892 bindDialogTarget( 5893 requestInfo: dialogRequest.RequestInfo, 5894 deathCallback: Callback<void>, 5895 callback: AsyncCallback<void> 5896 ): void; 5897 5898 /** 5899 * Set whether the dialog window responds to back gesture. 5900 * 5901 * @param { boolean } enabled - Responds to back gesture if true, or ignore back gesture if false. 5902 * @returns { Promise<void> } Promise that returns no value. 5903 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 5904 * 2. Incorrect parameter types. 5905 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 5906 * @throws { BusinessError } 1300002 - This window state is abnormal. 5907 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5908 * @throws { BusinessError } 1300004 - Unauthorized operation. 5909 * @syscap SystemCapability.Window.SessionManager 5910 * @atomicservice 5911 * @since 12 5912 */ 5913 setDialogBackGestureEnabled(enabled: boolean): Promise<void>; 5914 5915 /** 5916 * Whether the window supports thr wide gamut setting. 5917 * 5918 * @returns { Promise<boolean> } Promise used to return the result. The value true means that the wide-gamut color space is supported, and false means the opposite. 5919 * @syscap SystemCapability.WindowManager.WindowManager.Core 5920 * @since 8 5921 * @deprecated since 9 5922 * @useinstead ohos.window.Window#isWindowSupportWideGamut 5923 */ 5924 isSupportWideGamut(): Promise<boolean>; 5925 5926 /** 5927 * Whether the window supports thr wide gamut setting. 5928 * 5929 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 5930 * @syscap SystemCapability.WindowManager.WindowManager.Core 5931 * @since 8 5932 * @deprecated since 9 5933 * @useinstead ohos.window.Window#isWindowSupportWideGamut 5934 */ 5935 isSupportWideGamut(callback: AsyncCallback<boolean>): void; 5936 5937 /** 5938 * Whether the window supports thr wide gamut setting. 5939 * 5940 * @returns { Promise<boolean> } Promise used to return the result. 5941 * The value true means that the wide-gamut color space is supported, and false means the opposite. 5942 * @throws { BusinessError } 1300002 - This window state is abnormal. 5943 * @syscap SystemCapability.WindowManager.WindowManager.Core 5944 * @since 9 5945 */ 5946 /** 5947 * Whether the window supports thr wide gamut setting. 5948 * 5949 * @returns { Promise<boolean> } Promise used to return the result. 5950 * The value true means that the wide-gamut color space is supported, and false means the opposite. 5951 * @throws { BusinessError } 1300002 - This window state is abnormal. 5952 * @syscap SystemCapability.WindowManager.WindowManager.Core 5953 * @atomicservice 5954 * @since 12 5955 */ 5956 isWindowSupportWideGamut(): Promise<boolean>; 5957 5958 /** 5959 * Whether the window supports thr wide gamut setting. 5960 * 5961 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 5962 * @throws { BusinessError } 1300002 - This window state is abnormal. 5963 * @syscap SystemCapability.WindowManager.WindowManager.Core 5964 * @since 9 5965 */ 5966 /** 5967 * Whether the window supports thr wide gamut setting. 5968 * 5969 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 5970 * @throws { BusinessError } 1300002 - This window state is abnormal. 5971 * @syscap SystemCapability.WindowManager.WindowManager.Core 5972 * @atomicservice 5973 * @since 12 5974 */ 5975 isWindowSupportWideGamut(callback: AsyncCallback<boolean>): void; 5976 5977 /** 5978 * Sets the specified color space. 5979 * 5980 * @param { ColorSpace } colorSpace the specified color space. 5981 * @returns { Promise<void> } Promise that returns no value. 5982 * @syscap SystemCapability.WindowManager.WindowManager.Core 5983 * @since 8 5984 * @deprecated since 9 5985 * @useinstead ohos.window.Window#setWindowColorSpace 5986 */ 5987 setColorSpace(colorSpace: ColorSpace): Promise<void>; 5988 5989 /** 5990 * Sets the specified color space. 5991 * 5992 * @param { ColorSpace } colorSpace the specified color space. 5993 * @param { AsyncCallback<void> } callback Callback used to return the result. 5994 * @syscap SystemCapability.WindowManager.WindowManager.Core 5995 * @since 8 5996 * @deprecated since 9 5997 * @useinstead ohos.window.Window#setWindowColorSpace 5998 */ 5999 setColorSpace(colorSpace: ColorSpace, callback: AsyncCallback<void>): void; 6000 6001 /** 6002 * Sets the specified color space. 6003 * 6004 * @param { ColorSpace } colorSpace the specified color space. 6005 * @returns { Promise<void> } Promise that returns no value. 6006 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6007 * 2. Incorrect parameter types; 6008 * 3. Parameter verification failed. 6009 * @throws { BusinessError } 1300002 - This window state is abnormal. 6010 * @syscap SystemCapability.WindowManager.WindowManager.Core 6011 * @since 9 6012 */ 6013 /** 6014 * Sets the specified color space. 6015 * 6016 * @param { ColorSpace } colorSpace the specified color space. 6017 * @returns { Promise<void> } Promise that returns no value. 6018 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6019 * 2. Incorrect parameter types; 6020 * 3. Parameter verification failed. 6021 * @throws { BusinessError } 1300002 - This window state is abnormal. 6022 * @syscap SystemCapability.WindowManager.WindowManager.Core 6023 * @crossplatform 6024 * @since 11 6025 */ 6026 /** 6027 * Sets the specified color space. 6028 * 6029 * @param { ColorSpace } colorSpace the specified color space. 6030 * @returns { Promise<void> } Promise that returns no value. 6031 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6032 * 2. Incorrect parameter types; 6033 * 3. Parameter verification failed. 6034 * @throws { BusinessError } 1300002 - This window state is abnormal. 6035 * @syscap SystemCapability.WindowManager.WindowManager.Core 6036 * @crossplatform 6037 * @atomicservice 6038 * @since 12 6039 */ 6040 setWindowColorSpace(colorSpace: ColorSpace): Promise<void>; 6041 6042 /** 6043 * Sets the specified color space. 6044 * 6045 * @param { ColorSpace } colorSpace the specified color space. 6046 * @param { AsyncCallback<void> } callback Callback used to return the result. 6047 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6048 * 2. Incorrect parameter types; 6049 * 3. Parameter verification failed. 6050 * @throws { BusinessError } 1300002 - This window state is abnormal. 6051 * @syscap SystemCapability.WindowManager.WindowManager.Core 6052 * @since 9 6053 */ 6054 /** 6055 * Sets the specified color space. 6056 * 6057 * @param { ColorSpace } colorSpace the specified color space. 6058 * @param { AsyncCallback<void> } callback Callback used to return the result. 6059 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6060 * 2. Incorrect parameter types; 6061 * 3. Parameter verification failed. 6062 * @throws { BusinessError } 1300002 - This window state is abnormal. 6063 * @syscap SystemCapability.WindowManager.WindowManager.Core 6064 * @crossplatform 6065 * @since 11 6066 */ 6067 /** 6068 * Sets the specified color space. 6069 * 6070 * @param { ColorSpace } colorSpace the specified color space. 6071 * @param { AsyncCallback<void> } callback Callback used to return the result. 6072 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6073 * 2. Incorrect parameter types; 6074 * 3. Parameter verification failed. 6075 * @throws { BusinessError } 1300002 - This window state is abnormal. 6076 * @syscap SystemCapability.WindowManager.WindowManager.Core 6077 * @crossplatform 6078 * @atomicservice 6079 * @since 12 6080 */ 6081 setWindowColorSpace(colorSpace: ColorSpace, callback: AsyncCallback<void>): void; 6082 6083 /** 6084 * Obtains the set color space. 6085 * 6086 * @returns { Promise<ColorSpace> } Promise used to return the current color space. 6087 * @syscap SystemCapability.WindowManager.WindowManager.Core 6088 * @since 8 6089 * @deprecated since 9 6090 * @useinstead ohos.window.Window#getWindowColorSpace 6091 */ 6092 getColorSpace(): Promise<ColorSpace>; 6093 6094 /** 6095 * Obtains the set color space. 6096 * 6097 * @param { AsyncCallback<ColorSpace> } callback Callback used to return the result. 6098 * @syscap SystemCapability.WindowManager.WindowManager.Core 6099 * @since 8 6100 * @deprecated since 9 6101 * @useinstead ohos.window.Window#getWindowColorSpace 6102 */ 6103 getColorSpace(callback: AsyncCallback<ColorSpace>): void; 6104 6105 /** 6106 * Obtains the set color space. 6107 * 6108 * @returns { ColorSpace } Color space obtained. 6109 * @throws { BusinessError } 1300002 - This window state is abnormal. 6110 * @syscap SystemCapability.WindowManager.WindowManager.Core 6111 * @since 9 6112 */ 6113 /** 6114 * Obtains the set color space. 6115 * 6116 * @returns { ColorSpace } Color space obtained. 6117 * @throws { BusinessError } 1300002 - This window state is abnormal. 6118 * @syscap SystemCapability.WindowManager.WindowManager.Core 6119 * @crossplatform 6120 * @since 11 6121 */ 6122 /** 6123 * Obtains the set color space. 6124 * 6125 * @returns { ColorSpace } Color space obtained. 6126 * @throws { BusinessError } 1300002 - This window state is abnormal. 6127 * @syscap SystemCapability.WindowManager.WindowManager.Core 6128 * @crossplatform 6129 * @atomicservice 6130 * @since 12 6131 */ 6132 getWindowColorSpace(): ColorSpace; 6133 6134 /** 6135 * Sets the background color of window. 6136 * 6137 * @param { string } color the specified color. 6138 * @returns { Promise<void> } Promise that returns no value. 6139 * @syscap SystemCapability.WindowManager.WindowManager.Core 6140 * @since 6 6141 * @deprecated since 9 6142 * @useinstead ohos.window.Window#setWindowBackgroundColor 6143 */ 6144 setBackgroundColor(color: string): Promise<void>; 6145 6146 /** 6147 * Sets the background color of window. 6148 * 6149 * @param { string } color the specified color. 6150 * @param { AsyncCallback<void> } callback Callback used to return the result. 6151 * @syscap SystemCapability.WindowManager.WindowManager.Core 6152 * @since 6 6153 * @deprecated since 9 6154 * @useinstead ohos.window.Window#setWindowBackgroundColor 6155 */ 6156 setBackgroundColor(color: string, callback: AsyncCallback<void>): void; 6157 6158 /** 6159 * Sets the background color of window. 6160 * 6161 * @param { string } color the specified color. 6162 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6163 * 2. Incorrect parameter types. 6164 * @throws { BusinessError } 1300002 - This window state is abnormal. 6165 * @syscap SystemCapability.WindowManager.WindowManager.Core 6166 * @since 9 6167 */ 6168 /** 6169 * Sets the background color of window. 6170 * 6171 * @param { string } color the specified color. 6172 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6173 * 2. Incorrect parameter types. 6174 * @throws { BusinessError } 1300002 - This window state is abnormal. 6175 * @syscap SystemCapability.WindowManager.WindowManager.Core 6176 * @crossplatform 6177 * @since 10 6178 */ 6179 /** 6180 * Sets the background color of window. 6181 * 6182 * @param { string } color the specified color. 6183 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6184 * 2. Incorrect parameter types. 6185 * @throws { BusinessError } 1300002 - This window state is abnormal. 6186 * @syscap SystemCapability.WindowManager.WindowManager.Core 6187 * @crossplatform 6188 * @atomicservice 6189 * @since 11 6190 */ 6191 setWindowBackgroundColor(color: string): void; 6192 6193 /** 6194 * Sets the brightness of window. 6195 * 6196 * @param { number } brightness the specified brightness value. 6197 * @returns { Promise<void> } Promise that returns no value. 6198 * @syscap SystemCapability.WindowManager.WindowManager.Core 6199 * @since 6 6200 * @deprecated since 9 6201 * @useinstead ohos.window.Window#setWindowBrightness 6202 */ 6203 setBrightness(brightness: number): Promise<void>; 6204 6205 /** 6206 * Sets the brightness of window. 6207 * 6208 * @param { number } brightness the specified brightness value. 6209 * @param { AsyncCallback<void> } callback Callback used to return the result. 6210 * @syscap SystemCapability.WindowManager.WindowManager.Core 6211 * @since 6 6212 * @deprecated since 9 6213 * @useinstead ohos.window.Window#setWindowBrightness 6214 */ 6215 setBrightness(brightness: number, callback: AsyncCallback<void>): void; 6216 6217 /** 6218 * Set whether the main window is topmost. 6219 * 6220 * @param { boolean } isTopmost - Main window is topmost if true. 6221 * @returns { Promise<void> } Promise that returns no value. 6222 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6223 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6224 * 2. Incorrect parameter types. 6225 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 6226 * @throws { BusinessError } 1300002 - This window state is abnormal. 6227 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6228 * @throws { BusinessError } 1300004 - Unauthorized operation. 6229 * @syscap SystemCapability.Window.SessionManager 6230 * @systemapi 6231 * @since 12 6232 */ 6233 setTopmost(isTopmost: boolean): Promise<void>; 6234 6235 /** 6236 * Set whether the main window is topmost. 6237 * 6238 * @permission ohos.permission.WINDOW_TOPMOST 6239 * @param { boolean } isWindowTopmost - Main window is topmost if true. 6240 * @returns { Promise<void> } Promise that returns no value. 6241 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 6242 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6243 * 2. Incorrect parameter types. 6244 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 6245 * @throws { BusinessError } 1300002 - This window state is abnormal. 6246 * @throws { BusinessError } 1300004 - Unauthorized operation. 6247 * @syscap SystemCapability.Window.SessionManager 6248 * @atomicservice 6249 * @since 14 6250 */ 6251 setWindowTopmost(isWindowTopmost: boolean): Promise<void>; 6252 6253 /** 6254 * Sets the brightness of window. 6255 * 6256 * @param { number } brightness the specified brightness value. 6257 * @returns { Promise<void> } Promise that returns no value. 6258 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6259 * 2. Incorrect parameter types. 6260 * @throws { BusinessError } 1300002 - This window state is abnormal. 6261 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6262 * @syscap SystemCapability.WindowManager.WindowManager.Core 6263 * @since 9 6264 */ 6265 /** 6266 * Sets the brightness of window. 6267 * 6268 * @param { number } brightness the specified brightness value. 6269 * @returns { Promise<void> } Promise that returns no value. 6270 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6271 * 2. Incorrect parameter types. 6272 * @throws { BusinessError } 1300002 - This window state is abnormal. 6273 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6274 * @syscap SystemCapability.WindowManager.WindowManager.Core 6275 * @crossplatform 6276 * @since 10 6277 */ 6278 /** 6279 * Sets the brightness of window. 6280 * 6281 * @param { number } brightness the specified brightness value. 6282 * @returns { Promise<void> } Promise that returns no value. 6283 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6284 * 2. Incorrect parameter types. 6285 * @throws { BusinessError } 1300002 - This window state is abnormal. 6286 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6287 * @syscap SystemCapability.WindowManager.WindowManager.Core 6288 * @crossplatform 6289 * @atomicservice 6290 * @since 11 6291 */ 6292 setWindowBrightness(brightness: number): Promise<void>; 6293 6294 /** 6295 * Sets the brightness of window. 6296 * 6297 * @param { number } brightness the specified brightness value. 6298 * @param { AsyncCallback<void> } callback Callback used to return the result. 6299 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6300 * 2. Incorrect parameter types. 6301 * @throws { BusinessError } 1300002 - This window state is abnormal. 6302 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6303 * @syscap SystemCapability.WindowManager.WindowManager.Core 6304 * @since 9 6305 */ 6306 /** 6307 * Sets the brightness of window. 6308 * 6309 * @param { number } brightness the specified brightness value. 6310 * @param { AsyncCallback<void> } callback Callback used to return the result. 6311 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6312 * 2. Incorrect parameter types. 6313 * @throws { BusinessError } 1300002 - This window state is abnormal. 6314 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6315 * @syscap SystemCapability.WindowManager.WindowManager.Core 6316 * @crossplatform 6317 * @since 10 6318 */ 6319 /** 6320 * Sets the brightness of window. 6321 * 6322 * @param { number } brightness the specified brightness value. 6323 * @param { AsyncCallback<void> } callback Callback used to return the result. 6324 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6325 * 2. Incorrect parameter types. 6326 * @throws { BusinessError } 1300002 - This window state is abnormal. 6327 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6328 * @syscap SystemCapability.WindowManager.WindowManager.Core 6329 * @crossplatform 6330 * @atomicservice 6331 * @since 11 6332 */ 6333 setWindowBrightness(brightness: number, callback: AsyncCallback<void>): void; 6334 6335 /** 6336 * Sets the dimBehind of window. 6337 * 6338 * @param { number } dimBehindValue - The specified dimBehind. 6339 * @param { AsyncCallback<void> } callback Callback used to return the result. 6340 * @syscap SystemCapability.WindowManager.WindowManager.Core 6341 * @since 7 6342 * @deprecated since 9 6343 */ 6344 setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void; 6345 6346 /** 6347 * Sets the dimBehind of window. 6348 * 6349 * @param { number } dimBehindValue - The specified dimBehind. 6350 * @returns { Promise<void> } Promise that returns no value. 6351 * @syscap SystemCapability.WindowManager.WindowManager.Core 6352 * @since 7 6353 * @deprecated since 9 6354 */ 6355 setDimBehind(dimBehindValue: number): Promise<void>; 6356 6357 /** 6358 * Sets whether focusable or not. 6359 * 6360 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 6361 * @returns { Promise<void> } Promise that returns no value. 6362 * @syscap SystemCapability.WindowManager.WindowManager.Core 6363 * @since 7 6364 * @deprecated since 9 6365 * @useinstead ohos.window.Window#setWindowFocusable 6366 */ 6367 setFocusable(isFocusable: boolean): Promise<void>; 6368 6369 /** 6370 * Sets whether focusable or not. 6371 * 6372 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 6373 * @param { AsyncCallback<void> } callback Callback used to return the result. 6374 * @syscap SystemCapability.WindowManager.WindowManager.Core 6375 * @since 7 6376 * @deprecated since 9 6377 * @useinstead ohos.window.Window#setWindowFocusable 6378 */ 6379 setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 6380 6381 /** 6382 * Sets whether focusable or not. 6383 * 6384 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 6385 * @returns { Promise<void> } Promise that returns no value. 6386 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6387 * 2. Incorrect parameter types. 6388 * @throws { BusinessError } 1300002 - This window state is abnormal. 6389 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6390 * @syscap SystemCapability.WindowManager.WindowManager.Core 6391 * @since 9 6392 */ 6393 /** 6394 * Sets whether focusable or not. 6395 * 6396 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 6397 * @returns { Promise<void> } Promise that returns no value. 6398 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6399 * 2. Incorrect parameter types. 6400 * @throws { BusinessError } 1300002 - This window state is abnormal. 6401 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6402 * @syscap SystemCapability.WindowManager.WindowManager.Core 6403 * @atomicservice 6404 * @since 12 6405 */ 6406 setWindowFocusable(isFocusable: boolean): Promise<void>; 6407 6408 /** 6409 * Sets whether focusable or not. 6410 * 6411 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 6412 * @param { AsyncCallback<void> } callback Callback used to return the result. 6413 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6414 * 2. Incorrect parameter types. 6415 * @throws { BusinessError } 1300002 - This window state is abnormal. 6416 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6417 * @syscap SystemCapability.WindowManager.WindowManager.Core 6418 * @since 9 6419 */ 6420 /** 6421 * Sets whether focusable or not. 6422 * 6423 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 6424 * @param { AsyncCallback<void> } callback Callback used to return the result. 6425 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6426 * 2. Incorrect parameter types. 6427 * @throws { BusinessError } 1300002 - This window state is abnormal. 6428 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6429 * @syscap SystemCapability.WindowManager.WindowManager.Core 6430 * @atomicservice 6431 * @since 12 6432 */ 6433 setWindowFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 6434 6435 /** 6436 * Window requests to get focus or lose focus. 6437 * 6438 * @param { boolean } isFocused - Window requests to get focus if true, requests to lose focus if false. 6439 * @returns { Promise<void> } - Promise that returns no value. 6440 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 6441 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6442 * 2. Incorrect parameter types. 6443 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 6444 * @throws { BusinessError } 1300002 - This window state is abnormal. 6445 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6446 * @syscap SystemCapability.Window.SessionManager 6447 * @systemapi 6448 * @since 13 6449 */ 6450 requestFocus(isFocused: boolean): Promise<void>; 6451 6452 /** 6453 * Sets whether keep screen on or not. 6454 * 6455 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6456 * @returns { Promise<void> } that returns no value. 6457 * @syscap SystemCapability.WindowManager.WindowManager.Core 6458 * @since 6 6459 * @deprecated since 9 6460 * @useinstead ohos.window.Window#setWindowKeepScreenOn 6461 */ 6462 setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 6463 6464 /** 6465 * Sets whether keep screen on or not. 6466 * 6467 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6468 * @param { AsyncCallback<void> } callback Callback used to return the result. 6469 * @syscap SystemCapability.WindowManager.WindowManager.Core 6470 * @since 6 6471 * @deprecated since 9 6472 * @useinstead ohos.window.Window#setWindowKeepScreenOn 6473 */ 6474 setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 6475 6476 /** 6477 * Sets whether keep screen on or not. 6478 * 6479 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6480 * @returns { Promise<void> } Promise that returns no value. 6481 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6482 * 2. Incorrect parameter types. 6483 * @throws { BusinessError } 1300002 - This window state is abnormal. 6484 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6485 * @syscap SystemCapability.WindowManager.WindowManager.Core 6486 * @since 9 6487 */ 6488 /** 6489 * Sets whether keep screen on or not. 6490 * 6491 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6492 * @returns { Promise<void> } Promise that returns no value. 6493 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6494 * 2. Incorrect parameter types. 6495 * @throws { BusinessError } 1300002 - This window state is abnormal. 6496 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6497 * @syscap SystemCapability.WindowManager.WindowManager.Core 6498 * @crossplatform 6499 * @since 10 6500 */ 6501 /** 6502 * Sets whether keep screen on or not. 6503 * 6504 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6505 * @returns { Promise<void> } Promise that returns no value. 6506 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6507 * 2. Incorrect parameter types. 6508 * @throws { BusinessError } 1300002 - This window state is abnormal. 6509 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6510 * @syscap SystemCapability.WindowManager.WindowManager.Core 6511 * @crossplatform 6512 * @atomicservice 6513 * @since 11 6514 */ 6515 setWindowKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 6516 6517 /** 6518 * Sets whether keep screen on or not. 6519 * 6520 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6521 * @param { AsyncCallback<void> } callback Callback used to return the result. 6522 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6523 * 2. Incorrect parameter types. 6524 * @throws { BusinessError } 1300002 - This window state is abnormal. 6525 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6526 * @syscap SystemCapability.WindowManager.WindowManager.Core 6527 * @since 9 6528 */ 6529 /** 6530 * Sets whether keep screen on or not. 6531 * 6532 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6533 * @param { AsyncCallback<void> } callback Callback used to return the result. 6534 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6535 * 2. Incorrect parameter types. 6536 * @throws { BusinessError } 1300002 - This window state is abnormal. 6537 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6538 * @syscap SystemCapability.WindowManager.WindowManager.Core 6539 * @crossplatform 6540 * @since 10 6541 */ 6542 /** 6543 * Sets whether keep screen on or not. 6544 * 6545 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 6546 * @param { AsyncCallback<void> } callback Callback used to return the result. 6547 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6548 * 2. Incorrect parameter types. 6549 * @throws { BusinessError } 1300002 - This window state is abnormal. 6550 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6551 * @syscap SystemCapability.WindowManager.WindowManager.Core 6552 * @crossplatform 6553 * @atomicservice 6554 * @since 11 6555 */ 6556 setWindowKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 6557 6558 /** 6559 * Sets whether to wake up the screen when this ability is restored. 6560 * 6561 * @param { boolean } wakeUp Specifies whether to wake up the screen. True means to wake it up, false means not. 6562 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6563 * 2. Incorrect parameter types. 6564 * @throws { BusinessError } 1300002 - This window state is abnormal. 6565 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6566 * @syscap SystemCapability.WindowManager.WindowManager.Core 6567 * @systemapi Hide this for inner system use. 6568 * @since 9 6569 */ 6570 /** 6571 * Sets whether to wake up the screen when this ability is restored. 6572 * 6573 * @param { boolean } wakeUp Specifies whether to wake up the screen. True means to wake it up, false means not. 6574 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6575 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6576 * 2. Incorrect parameter types. 6577 * @throws { BusinessError } 1300002 - This window state is abnormal. 6578 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6579 * @syscap SystemCapability.WindowManager.WindowManager.Core 6580 * @systemapi Hide this for inner system use. 6581 * @since 12 6582 */ 6583 setWakeUpScreen(wakeUp: boolean): void; 6584 6585 /** 6586 * Sets whether outside can be touch or not. 6587 * 6588 * @param { boolean } touchable outside can be touch if true, or not if false. 6589 * @returns { Promise<void> } Promise that returns no value. 6590 * @syscap SystemCapability.WindowManager.WindowManager.Core 6591 * @since 7 6592 * @deprecated since 9 6593 */ 6594 setOutsideTouchable(touchable: boolean): Promise<void>; 6595 6596 /** 6597 * Sets whether outside can be touch or not. 6598 * 6599 * @param { boolean } touchable outside can be touch if true, or not if false. 6600 * @param { AsyncCallback<void> } callback Callback used to return the result. 6601 * @syscap SystemCapability.WindowManager.WindowManager.Core 6602 * @since 7 6603 * @deprecated since 9 6604 */ 6605 setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void; 6606 6607 /** 6608 * Sets whether is private mode or not. 6609 * 6610 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 6611 * @returns { Promise<void> } Promise that returns no value. 6612 * @syscap SystemCapability.WindowManager.WindowManager.Core 6613 * @since 7 6614 * @deprecated since 9 6615 * @useinstead ohos.window.Window#setWindowPrivacyMode 6616 */ 6617 setPrivacyMode(isPrivacyMode: boolean): Promise<void>; 6618 6619 /** 6620 * Sets whether is private mode or not. 6621 * 6622 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 6623 * @param { AsyncCallback<void> } callback Callback used to return the result. 6624 * @syscap SystemCapability.WindowManager.WindowManager.Core 6625 * @since 7 6626 * @deprecated since 9 6627 * @useinstead ohos.window.Window#setWindowPrivacyMode 6628 */ 6629 setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 6630 6631 /** 6632 * Sets whether is private mode or not. 6633 * 6634 * @permission ohos.permission.PRIVACY_WINDOW 6635 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 6636 * @returns { Promise<void> } Promise that returns no value. 6637 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 6638 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6639 * 2. Incorrect parameter types. 6640 * @throws { BusinessError } 1300002 - This window state is abnormal. 6641 * @syscap SystemCapability.WindowManager.WindowManager.Core 6642 * @since 9 6643 */ 6644 /** 6645 * Sets whether is private mode or not. 6646 * 6647 * @permission ohos.permission.PRIVACY_WINDOW 6648 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 6649 * @returns { Promise<void> } Promise that returns no value. 6650 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 6651 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6652 * 2. Incorrect parameter types. 6653 * @throws { BusinessError } 1300002 - This window state is abnormal. 6654 * @syscap SystemCapability.WindowManager.WindowManager.Core 6655 * @atomicservice 6656 * @since 12 6657 */ 6658 setWindowPrivacyMode(isPrivacyMode: boolean): Promise<void>; 6659 6660 /** 6661 * Sets whether is private mode or not. 6662 * 6663 * @permission ohos.permission.PRIVACY_WINDOW 6664 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 6665 * @param { AsyncCallback<void> } callback Callback used to return the result. 6666 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 6667 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6668 * 2. Incorrect parameter types. 6669 * @throws { BusinessError } 1300002 - This window state is abnormal. 6670 * @syscap SystemCapability.WindowManager.WindowManager.Core 6671 * @since 9 6672 */ 6673 /** 6674 * Sets whether is private mode or not. 6675 * 6676 * @permission ohos.permission.PRIVACY_WINDOW 6677 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 6678 * @param { AsyncCallback<void> } callback Callback used to return the result. 6679 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 6680 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6681 * 2. Incorrect parameter types. 6682 * @throws { BusinessError } 1300002 - This window state is abnormal. 6683 * @syscap SystemCapability.WindowManager.WindowManager.Core 6684 * @atomicservice 6685 * @since 12 6686 */ 6687 setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 6688 6689 /** 6690 * Ignore this window during screenshot. 6691 * 6692 * @param { boolean } isSkip skip if true, or not if false. 6693 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6694 * 2. Incorrect parameter types. 6695 * @throws { BusinessError } 1300002 - This window state is abnormal. 6696 * @syscap SystemCapability.WindowManager.WindowManager.Core 6697 * @systemapi Hide this for inner system use. 6698 * @since 9 6699 */ 6700 /** 6701 * Ignore this window during screenshot. 6702 * 6703 * @param { boolean } isSkip skip if true, or not if false. 6704 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6705 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6706 * 2. Incorrect parameter types. 6707 * @throws { BusinessError } 1300002 - This window state is abnormal. 6708 * @syscap SystemCapability.WindowManager.WindowManager.Core 6709 * @systemapi Hide this for inner system use. 6710 * @since 12 6711 */ 6712 setSnapshotSkip(isSkip: boolean): void; 6713 6714 /** 6715 * Sets whether is touchable or not. 6716 * 6717 * @param { boolean } isTouchable is touchable if true, or not if false. 6718 * @returns { Promise<void> } Promise that returns no value. 6719 * @syscap SystemCapability.WindowManager.WindowManager.Core 6720 * @since 7 6721 * @deprecated since 9 6722 * @useinstead ohos.window.Window#setWindowTouchable 6723 */ 6724 setTouchable(isTouchable: boolean): Promise<void>; 6725 6726 /** 6727 * Sets whether is touchable or not. 6728 * 6729 * @param { boolean } isTouchable is touchable if true, or not if false. 6730 * @param { AsyncCallback<void> } callback Callback used to return the result. 6731 * @syscap SystemCapability.WindowManager.WindowManager.Core 6732 * @since 7 6733 * @deprecated since 9 6734 * @useinstead ohos.window.Window#setWindowTouchable 6735 */ 6736 setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 6737 6738 /** 6739 * Sets whether is touchable or not. 6740 * 6741 * @param { boolean } isTouchable is touchable if true, or not if false. 6742 * @returns { Promise<void> } Promise that returns no value. 6743 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6744 * 2. Incorrect parameter types. 6745 * @throws { BusinessError } 1300002 - This window state is abnormal. 6746 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6747 * @syscap SystemCapability.WindowManager.WindowManager.Core 6748 * @since 9 6749 */ 6750 /** 6751 * Sets whether is touchable or not. 6752 * 6753 * @param { boolean } isTouchable is touchable if true, or not if false. 6754 * @returns { Promise<void> } Promise that returns no value. 6755 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6756 * 2. Incorrect parameter types. 6757 * @throws { BusinessError } 1300002 - This window state is abnormal. 6758 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6759 * @syscap SystemCapability.WindowManager.WindowManager.Core 6760 * @atomicservice 6761 * @since 12 6762 */ 6763 setWindowTouchable(isTouchable: boolean): Promise<void>; 6764 6765 /** 6766 * Sets whether is touchable or not. 6767 * 6768 * @param { boolean } isTouchable is touchable if true, or not if false. 6769 * @param { AsyncCallback<void> } callback Callback used to return the result. 6770 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6771 * 2. Incorrect parameter types. 6772 * @throws { BusinessError } 1300002 - This window state is abnormal. 6773 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6774 * @syscap SystemCapability.WindowManager.WindowManager.Core 6775 * @since 9 6776 */ 6777 /** 6778 * Sets whether is touchable or not. 6779 * 6780 * @param { boolean } isTouchable is touchable if true, or not if false. 6781 * @param { AsyncCallback<void> } callback Callback used to return the result. 6782 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6783 * 2. Incorrect parameter types. 6784 * @throws { BusinessError } 1300002 - This window state is abnormal. 6785 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6786 * @syscap SystemCapability.WindowManager.WindowManager.Core 6787 * @atomicservice 6788 * @since 12 6789 */ 6790 setWindowTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 6791 6792 /** 6793 * Set handwrite flag on the window. This flag means only response handwrite event. 6794 * 6795 * @param { boolean } enable - Add handwrite flag to window if true, or remove flag if false. 6796 * @returns { Promise<void> } - The promise returned by the function. 6797 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6798 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6799 * 2. Incorrect parameter types. 6800 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 6801 * @throws { BusinessError } 1300002 - This window state is abnormal. 6802 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6803 * @syscap SystemCapability.Window.SessionManager 6804 * @systemapi Hide this for inner system use. 6805 * @since 12 6806 */ 6807 setHandwritingFlag(enable: boolean): Promise<void>; 6808 6809 /** 6810 * Sets the flag of the window is forbidden to move in split screen mode 6811 * 6812 * @param { boolean } isForbidSplitMove the flag of the window is forbidden to move in split screen mode 6813 * @param { AsyncCallback<void> } callback Callback used to return the result. 6814 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6815 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6816 * 2. Incorrect parameter types. 6817 * @throws { BusinessError } 1300002 - This window state is abnormal. 6818 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6819 * @syscap SystemCapability.WindowManager.WindowManager.Core 6820 * @systemapi 6821 * @since 9 6822 */ 6823 setForbidSplitMove(isForbidSplitMove: boolean, callback: AsyncCallback<void>): void; 6824 6825 /** 6826 * Sets the flag of the window is forbidden to move in split screen mode 6827 * 6828 * @param { boolean } isForbidSplitMove the flag of the window is forbidden to move in split screen mode 6829 * @returns { Promise<void> } Promise that returns no value. 6830 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6831 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6832 * 2. Incorrect parameter types. 6833 * @throws { BusinessError } 1300002 - This window state is abnormal. 6834 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 6835 * @syscap SystemCapability.WindowManager.WindowManager.Core 6836 * @systemapi 6837 * @since 9 6838 */ 6839 setForbidSplitMove(isForbidSplitMove: boolean): Promise<void>; 6840 6841 /** 6842 * Obtains snapshot of window 6843 * 6844 * @param { AsyncCallback<image.PixelMap> } callback Callback used to return the result. 6845 * @throws { BusinessError } 1300002 - This window state is abnormal. 6846 * @syscap SystemCapability.WindowManager.WindowManager.Core 6847 * @since 9 6848 */ 6849 /** 6850 * Obtains snapshot of window 6851 * 6852 * @param { AsyncCallback<image.PixelMap> } callback Callback used to return the result. 6853 * @throws { BusinessError } 1300002 - This window state is abnormal. 6854 * @syscap SystemCapability.WindowManager.WindowManager.Core 6855 * @atomicservice 6856 * @since 12 6857 */ 6858 snapshot(callback: AsyncCallback<image.PixelMap>): void; 6859 6860 /** 6861 * Obtains snapshot of window 6862 * 6863 * @returns { Promise<image.PixelMap> } Promise that returns no value. 6864 * @throws { BusinessError } 1300002 - This window state is abnormal. 6865 * @syscap SystemCapability.WindowManager.WindowManager.Core 6866 * @since 9 6867 */ 6868 /** 6869 * Obtains snapshot of window 6870 * 6871 * @returns { Promise<image.PixelMap> } Promise that returns no value. 6872 * @throws { BusinessError } 1300002 - This window state is abnormal. 6873 * @syscap SystemCapability.WindowManager.WindowManager.Core 6874 * @atomicservice 6875 * @since 12 6876 */ 6877 snapshot(): Promise<image.PixelMap>; 6878 6879 /** 6880 * Sets opacity of window 6881 * 6882 * @param { number } opacity Interval is 0.f-1.f. 6883 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6884 * 2. Incorrect parameter types; 6885 * 3. Parameter verification failed. 6886 * @throws { BusinessError } 1300002 - This window state is abnormal. 6887 * @throws { BusinessError } 1300004 - Unauthorized operation. 6888 * @syscap SystemCapability.WindowManager.WindowManager.Core 6889 * @systemapi 6890 * @since 9 6891 */ 6892 /** 6893 * Sets opacity of window 6894 * 6895 * @param { number } opacity Interval is 0.f-1.f. 6896 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6897 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6898 * 2. Incorrect parameter types; 6899 * 3. Parameter verification failed. 6900 * @throws { BusinessError } 1300002 - This window state is abnormal. 6901 * @throws { BusinessError } 1300004 - Unauthorized operation. 6902 * @syscap SystemCapability.WindowManager.WindowManager.Core 6903 * @systemapi 6904 * @since 12 6905 */ 6906 opacity(opacity: number): void; 6907 6908 /** 6909 * Sets scale options of window. 6910 * 6911 * @param { ScaleOptions } scaleOptions scale param of window. 6912 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6913 * 2. Incorrect parameter types; 6914 * 3. Parameter verification failed. 6915 * @throws { BusinessError } 1300002 - This window state is abnormal. 6916 * @throws { BusinessError } 1300004 - Unauthorized operation. 6917 * @syscap SystemCapability.WindowManager.WindowManager.Core 6918 * @systemapi 6919 * @since 9 6920 */ 6921 /** 6922 * Sets scale options of window. 6923 * 6924 * @param { ScaleOptions } scaleOptions scale param of window. 6925 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6926 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6927 * 2. Incorrect parameter types; 6928 * 3. Parameter verification failed. 6929 * @throws { BusinessError } 1300002 - This window state is abnormal. 6930 * @throws { BusinessError } 1300004 - Unauthorized operation. 6931 * @syscap SystemCapability.WindowManager.WindowManager.Core 6932 * @systemapi 6933 * @since 12 6934 */ 6935 scale(scaleOptions: ScaleOptions): void; 6936 6937 /** 6938 * Sets rotate options of window. 6939 * 6940 * @param { RotateOptions } rotateOptions rotate param of window. 6941 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6942 * 2. Incorrect parameter types; 6943 * 3. Parameter verification failed. 6944 * @throws { BusinessError } 1300002 - This window state is abnormal. 6945 * @throws { BusinessError } 1300004 - Unauthorized operation. 6946 * @syscap SystemCapability.WindowManager.WindowManager.Core 6947 * @systemapi 6948 * @since 9 6949 */ 6950 /** 6951 * Sets rotate options of window. 6952 * 6953 * @param { RotateOptions } rotateOptions rotate param of window. 6954 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6955 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6956 * 2. Incorrect parameter types; 6957 * 3. Parameter verification failed. 6958 * @throws { BusinessError } 1300002 - This window state is abnormal. 6959 * @throws { BusinessError } 1300004 - Unauthorized operation. 6960 * @syscap SystemCapability.WindowManager.WindowManager.Core 6961 * @systemapi 6962 * @since 12 6963 */ 6964 rotate(rotateOptions: RotateOptions): void; 6965 6966 /** 6967 * Sets translate options of window. 6968 * 6969 * @param { TranslateOptions } translateOptions translate param of window. 6970 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6971 * 2. Incorrect parameter types; 6972 * 3. Parameter verification failed. 6973 * @throws { BusinessError } 1300002 - This window state is abnormal. 6974 * @throws { BusinessError } 1300004 - Unauthorized operation. 6975 * @syscap SystemCapability.WindowManager.WindowManager.Core 6976 * @systemapi 6977 * @since 9 6978 */ 6979 /** 6980 * Sets translate options of window. 6981 * 6982 * @param { TranslateOptions } translateOptions translate param of window. 6983 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6984 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 6985 * 2. Incorrect parameter types; 6986 * 3. Parameter verification failed. 6987 * @throws { BusinessError } 1300002 - This window state is abnormal. 6988 * @throws { BusinessError } 1300004 - Unauthorized operation. 6989 * @syscap SystemCapability.WindowManager.WindowManager.Core 6990 * @systemapi 6991 * @since 12 6992 */ 6993 translate(translateOptions: TranslateOptions): void; 6994 6995 /** 6996 * Get Transition Controller. 6997 * 6998 * @returns { TransitionController } 6999 * @throws { BusinessError } 1300002 - This window state is abnormal. 7000 * @throws { BusinessError } 1300004 - Unauthorized operation. 7001 * @syscap SystemCapability.WindowManager.WindowManager.Core 7002 * @systemapi 7003 * @since 9 7004 */ 7005 /** 7006 * Get Transition Controller. 7007 * 7008 * @returns { TransitionController } 7009 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7010 * @throws { BusinessError } 1300002 - This window state is abnormal. 7011 * @throws { BusinessError } 1300004 - Unauthorized operation. 7012 * @syscap SystemCapability.WindowManager.WindowManager.Core 7013 * @systemapi 7014 * @since 12 7015 */ 7016 getTransitionController(): TransitionController; 7017 7018 /** 7019 * Sets the window blur radius. 7020 * 7021 * @param { number } radius the blur radius. 7022 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7023 * 2. Incorrect parameter types; 7024 * 3. Parameter verification failed. 7025 * @throws { BusinessError } 1300002 - This window state is abnormal. 7026 * @throws { BusinessError } 1300004 - Unauthorized operation. 7027 * @syscap SystemCapability.WindowManager.WindowManager.Core 7028 * @systemapi Hide this for inner system use. 7029 * @since 9 7030 */ 7031 /** 7032 * Sets the window blur radius. 7033 * 7034 * @param { number } radius the blur radius. 7035 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7036 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7037 * 2. Incorrect parameter types; 7038 * 3. Parameter verification failed. 7039 * @throws { BusinessError } 1300002 - This window state is abnormal. 7040 * @throws { BusinessError } 1300004 - Unauthorized operation. 7041 * @syscap SystemCapability.WindowManager.WindowManager.Core 7042 * @systemapi Hide this for inner system use. 7043 * @since 12 7044 */ 7045 setBlur(radius: number): void; 7046 7047 /** 7048 * Sets the window backdrop blur radius. 7049 * 7050 * @param { number } radius the blur radius. 7051 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7052 * 2. Incorrect parameter types; 7053 * 3. Parameter verification failed. 7054 * @throws { BusinessError } 1300002 - This window state is abnormal. 7055 * @throws { BusinessError } 1300004 - Unauthorized operation. 7056 * @syscap SystemCapability.WindowManager.WindowManager.Core 7057 * @systemapi Hide this for inner system use. 7058 * @since 9 7059 */ 7060 /** 7061 * Sets the window backdrop blur radius. 7062 * 7063 * @param { number } radius the blur radius. 7064 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7065 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7066 * 2. Incorrect parameter types; 7067 * 3. Parameter verification failed. 7068 * @throws { BusinessError } 1300002 - This window state is abnormal. 7069 * @throws { BusinessError } 1300004 - Unauthorized operation. 7070 * @syscap SystemCapability.WindowManager.WindowManager.Core 7071 * @systemapi Hide this for inner system use. 7072 * @since 12 7073 */ 7074 setBackdropBlur(radius: number): void; 7075 7076 /** 7077 * Sets the window backdrop blur style. 7078 * 7079 * @param { BlurStyle } blurStyle the specified blur style. 7080 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7081 * 2. Incorrect parameter types; 7082 * 3. Parameter verification failed. 7083 * @throws { BusinessError } 1300002 - This window state is abnormal. 7084 * @throws { BusinessError } 1300004 - Unauthorized operation. 7085 * @syscap SystemCapability.WindowManager.WindowManager.Core 7086 * @systemapi Hide this for inner system use. 7087 * @since 9 7088 */ 7089 /** 7090 * Sets the window backdrop blur style. 7091 * 7092 * @param { BlurStyle } blurStyle the specified blur style. 7093 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7094 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7095 * 2. Incorrect parameter types; 7096 * 3. Parameter verification failed. 7097 * @throws { BusinessError } 1300002 - This window state is abnormal. 7098 * @throws { BusinessError } 1300004 - Unauthorized operation. 7099 * @syscap SystemCapability.WindowManager.WindowManager.Core 7100 * @systemapi Hide this for inner system use. 7101 * @since 12 7102 */ 7103 setBackdropBlurStyle(blurStyle: BlurStyle): void; 7104 7105 /** 7106 * Sets shadow. 7107 * 7108 * @param { number } radius the radius of the shadow. 7109 * @param { string } color the color of the shadow. 7110 * @param { number } offsetX the offset of the shadow on the x-axis. 7111 * @param { number } offsetY the offset of the shadow on the y-axis. 7112 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7113 * 2. Incorrect parameter types; 7114 * 3. Parameter verification failed. 7115 * @throws { BusinessError } 1300002 - This window state is abnormal. 7116 * @throws { BusinessError } 1300004 - Unauthorized operation. 7117 * @syscap SystemCapability.WindowManager.WindowManager.Core 7118 * @systemapi Hide this for inner system use. 7119 * @since 9 7120 */ 7121 /** 7122 * Sets shadow. 7123 * 7124 * @param { number } radius the radius of the shadow. 7125 * @param { string } color the color of the shadow. 7126 * @param { number } offsetX the offset of the shadow on the x-axis. 7127 * @param { number } offsetY the offset of the shadow on the y-axis. 7128 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7129 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7130 * 2. Incorrect parameter types; 7131 * 3. Parameter verification failed. 7132 * @throws { BusinessError } 1300002 - This window state is abnormal. 7133 * @throws { BusinessError } 1300004 - Unauthorized operation. 7134 * @syscap SystemCapability.WindowManager.WindowManager.Core 7135 * @systemapi Hide this for inner system use. 7136 * @since 12 7137 */ 7138 setShadow(radius: number, color?: string, offsetX?: number, offsetY?: number): void; 7139 7140 /** 7141 * Sets corner radius. 7142 * 7143 * @param { number } cornerRadius the corner radius. 7144 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7145 * 2. Incorrect parameter types; 7146 * 3. Parameter verification failed. 7147 * @throws { BusinessError } 1300002 - This window state is abnormal. 7148 * @throws { BusinessError } 1300004 - Unauthorized operation. 7149 * @syscap SystemCapability.WindowManager.WindowManager.Core 7150 * @systemapi Hide this for inner system use. 7151 * @since 9 7152 */ 7153 /** 7154 * Sets corner radius. 7155 * 7156 * @param { number } cornerRadius the corner radius. 7157 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7158 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7159 * 2. Incorrect parameter types; 7160 * 3. Parameter verification failed. 7161 * @throws { BusinessError } 1300002 - This window state is abnormal. 7162 * @throws { BusinessError } 1300004 - Unauthorized operation. 7163 * @syscap SystemCapability.WindowManager.WindowManager.Core 7164 * @systemapi Hide this for inner system use. 7165 * @since 12 7166 */ 7167 setCornerRadius(cornerRadius: number): void; 7168 7169 /** 7170 * Raise app sub window to app top 7171 * 7172 * @param { AsyncCallback<void> } callback - The callback of raiseToAppTop 7173 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7174 * @throws { BusinessError } 1300002 - This window state is abnormal. 7175 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7176 * @throws { BusinessError } 1300004 - Unauthorized operation. 7177 * @throws { BusinessError } 1300009 - The parent window is invalid. 7178 * @syscap SystemCapability.WindowManager.WindowManager.Core 7179 * @systemapi Hide this for inner system use. 7180 * @since 10 7181 */ 7182 raiseToAppTop(callback: AsyncCallback<void>): void; 7183 7184 /** 7185 * Raise app sub window to app top 7186 * 7187 * @returns { Promise<void> } - The promise returned by the function 7188 * @throws { BusinessError } 1300002 - This window state is abnormal. 7189 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7190 * @throws { BusinessError } 1300004 - Unauthorized operation. 7191 * @throws { BusinessError } 1300009 - The parent window is invalid. 7192 * @syscap SystemCapability.WindowManager.WindowManager.Core 7193 * @since 14 7194 */ 7195 raiseToAppTop(): Promise<void>; 7196 7197 /** 7198 * Sets the aspect ratio of window 7199 * 7200 * @param { number } ratio - The aspect ratio of window except decoration 7201 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 7202 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7203 * 2. Incorrect parameter types; 7204 * 3. Parameter verification failed. 7205 * @throws { BusinessError } 1300002 - This window state is abnormal. 7206 * @throws { BusinessError } 1300004 - Unauthorized operation. 7207 * @syscap SystemCapability.WindowManager.WindowManager.Core 7208 * @since 10 7209 */ 7210 /** 7211 * Sets the aspect ratio of window 7212 * 7213 * @param { number } ratio - The aspect ratio of window except decoration 7214 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 7215 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7216 * 2. Incorrect parameter types; 7217 * 3. Parameter verification failed. 7218 * @throws { BusinessError } 1300002 - This window state is abnormal. 7219 * @throws { BusinessError } 1300004 - Unauthorized operation. 7220 * @syscap SystemCapability.WindowManager.WindowManager.Core 7221 * @atomicservice 7222 * @since 12 7223 */ 7224 setAspectRatio(ratio: number, callback: AsyncCallback<void>): void; 7225 7226 /** 7227 * Sets the aspect ratio of window 7228 * 7229 * @param { number } ratio - The aspect ratio of window except decoration 7230 * @returns { Promise<void> } - The promise returned by the function. 7231 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7232 * 2. Incorrect parameter types; 7233 * 3. Parameter verification failed. 7234 * @throws { BusinessError } 1300002 - This window state is abnormal. 7235 * @throws { BusinessError } 1300004 - Unauthorized operation. 7236 * @syscap SystemCapability.WindowManager.WindowManager.Core 7237 * @since 10 7238 */ 7239 /** 7240 * Sets the aspect ratio of window 7241 * 7242 * @param { number } ratio - The aspect ratio of window except decoration 7243 * @returns { Promise<void> } - The promise returned by the function. 7244 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7245 * 2. Incorrect parameter types; 7246 * 3. Parameter verification failed. 7247 * @throws { BusinessError } 1300002 - This window state is abnormal. 7248 * @throws { BusinessError } 1300004 - Unauthorized operation. 7249 * @syscap SystemCapability.WindowManager.WindowManager.Core 7250 * @atomicservice 7251 * @since 12 7252 */ 7253 setAspectRatio(ratio: number): Promise<void>; 7254 7255 /** 7256 * Resets the aspect ratio of window 7257 * 7258 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 7259 * @throws { BusinessError } 1300002 - This window state is abnormal. 7260 * @throws { BusinessError } 1300004 - Unauthorized operation. 7261 * @syscap SystemCapability.WindowManager.WindowManager.Core 7262 * @since 10 7263 */ 7264 /** 7265 * Resets the aspect ratio of window 7266 * 7267 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 7268 * @throws { BusinessError } 1300002 - This window state is abnormal. 7269 * @throws { BusinessError } 1300004 - Unauthorized operation. 7270 * @syscap SystemCapability.WindowManager.WindowManager.Core 7271 * @atomicservice 7272 * @since 12 7273 */ 7274 resetAspectRatio(callback: AsyncCallback<void>): void; 7275 7276 /** 7277 * Resets the aspect ratio of window 7278 * 7279 * @returns { Promise<void> } - The promise returned by the function. 7280 * @throws { BusinessError } 1300002 - This window state is abnormal. 7281 * @throws { BusinessError } 1300004 - Unauthorized operation. 7282 * @syscap SystemCapability.WindowManager.WindowManager.Core 7283 * @since 10 7284 */ 7285 /** 7286 * Resets the aspect ratio of window 7287 * 7288 * @returns { Promise<void> } - The promise returned by the function. 7289 * @throws { BusinessError } 1300002 - This window state is abnormal. 7290 * @throws { BusinessError } 1300004 - Unauthorized operation. 7291 * @syscap SystemCapability.WindowManager.WindowManager.Core 7292 * @atomicservice 7293 * @since 12 7294 */ 7295 resetAspectRatio(): Promise<void>; 7296 7297 /** 7298 * Set the watermark flag on the window. 7299 * 7300 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false. 7301 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkFlag. 7302 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 7303 * <br>2. Incorrect parameter types. 7304 * @throws { BusinessError } 1300002 - This window state is abnormal. 7305 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7306 * @throws { BusinessError } 1300008 - The display device is abnormal. 7307 * @syscap SystemCapability.WindowManager.WindowManager.Core 7308 * @systemapi Hide this for inner system use. 7309 * @since 10 7310 */ 7311 /** 7312 * Set the watermark flag on the window. 7313 * 7314 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false. 7315 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkFlag. 7316 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7317 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 7318 * <br>2. Incorrect parameter types. 7319 * @throws { BusinessError } 1300002 - This window state is abnormal. 7320 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7321 * @throws { BusinessError } 1300008 - The display device is abnormal. 7322 * @syscap SystemCapability.WindowManager.WindowManager.Core 7323 * @systemapi Hide this for inner system use. 7324 * @since 12 7325 */ 7326 setWaterMarkFlag(enable: boolean, callback: AsyncCallback<void>): void; 7327 7328 /** 7329 * Set the watermark flag on the window 7330 * 7331 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false 7332 * @returns { Promise<void> } - The promise returned by the function 7333 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 7334 * <br>2. Incorrect parameter types. 7335 * @throws { BusinessError } 1300002 - This window state is abnormal. 7336 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7337 * @throws { BusinessError } 1300008 - The display device is abnormal. 7338 * @syscap SystemCapability.WindowManager.WindowManager.Core 7339 * @systemapi Hide this for inner system use. 7340 * @since 10 7341 */ 7342 /** 7343 * Set the watermark flag on the window 7344 * 7345 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false 7346 * @returns { Promise<void> } - The promise returned by the function 7347 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7348 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 7349 * <br>2. Incorrect parameter types. 7350 * @throws { BusinessError } 1300002 - This window state is abnormal. 7351 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7352 * @throws { BusinessError } 1300008 - The display device is abnormal. 7353 * @syscap SystemCapability.WindowManager.WindowManager.Core 7354 * @systemapi Hide this for inner system use. 7355 * @since 12 7356 */ 7357 setWaterMarkFlag(enable: boolean): Promise<void>; 7358 7359 /** 7360 * Raise one app sub window above another. 7361 * 7362 * @param { number } windowId - Indicates target window id. 7363 * @param { AsyncCallback<void> } callback - The callback of raiseAboveTarget. 7364 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7365 * @throws { BusinessError } 401 - Parameter error. Possible cause: Mandatory parameters are left unspecified. 7366 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7367 * @throws { BusinessError } 1300002 - This window state is abnormal. 7368 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7369 * @throws { BusinessError } 1300004 - Unauthorized operation. 7370 * @throws { BusinessError } 1300009 - The parent window is invalid. 7371 * @syscap SystemCapability.Window.SessionManager 7372 * @systemapi Hide this for inner system use. 7373 * @since 10 7374 */ 7375 raiseAboveTarget(windowId: number, callback: AsyncCallback<void>): void; 7376 7377 /** 7378 * Raise one app sub window above another. 7379 * 7380 * @param { number } windowId - Indicates target window id. 7381 * @returns { Promise<void> } - The promise returned by the function. 7382 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7383 * @throws { BusinessError } 401 - Parameter error. Possible cause: Mandatory parameters are left unspecified. 7384 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7385 * @throws { BusinessError } 1300002 - This window state is abnormal. 7386 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7387 * @throws { BusinessError } 1300004 - Unauthorized operation. 7388 * @throws { BusinessError } 1300009 - The parent window is invalid. 7389 * @syscap SystemCapability.Window.SessionManager 7390 * @systemapi Hide this for inner system use. 7391 * @since 10 7392 */ 7393 raiseAboveTarget(windowId: number): Promise<void>; 7394 7395 /** 7396 * Set whether to enable an app sub window to raise itself by click. 7397 * 7398 * @param { boolean } enable - Disable app sub window to raise itself by by click if false. 7399 * @param { AsyncCallback<void> } callback - The callback of setRaiseByClickEnabled. 7400 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7401 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7402 * 2. Incorrect parameter types. 7403 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7404 * @throws { BusinessError } 1300002 - This window state is abnormal. 7405 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7406 * @throws { BusinessError } 1300004 - Unauthorized operation. 7407 * @throws { BusinessError } 1300009 - The parent window is invalid. 7408 * @syscap SystemCapability.Window.SessionManager 7409 * @systemapi Hide this for inner system use. 7410 * @since 10 7411 */ 7412 setRaiseByClickEnabled(enable: boolean, callback: AsyncCallback<void>): void; 7413 7414 /** 7415 * Set whether to enable an app sub window to raise itself by click. 7416 * 7417 * @param { boolean } enable - Disable app sub window to raise itself by by click if false. 7418 * @returns { Promise<void> } - The promise returned by the function. 7419 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7420 * 2. Incorrect parameter types. 7421 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7422 * @throws { BusinessError } 1300002 - This window state is abnormal. 7423 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7424 * @throws { BusinessError } 1300004 - Unauthorized operation. 7425 * @throws { BusinessError } 1300009 - The parent window is invalid. 7426 * @syscap SystemCapability.Window.SessionManager 7427 * @since 14 7428 */ 7429 setRaiseByClickEnabled(enable: boolean): Promise<void>; 7430 7431 /** 7432 * Minimize app main window and hide app subWindow. 7433 * 7434 * @param { AsyncCallback<void> } callback - The callback of Minimize. 7435 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7436 * @throws { BusinessError } 1300002 - This window state is abnormal. 7437 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7438 * @syscap SystemCapability.Window.SessionManager 7439 * @since 11 7440 */ 7441 /** 7442 * Minimize app main window and hide app subWindow. 7443 * 7444 * @param { AsyncCallback<void> } callback - The callback of Minimize. 7445 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7446 * @throws { BusinessError } 1300002 - This window state is abnormal. 7447 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7448 * @syscap SystemCapability.Window.SessionManager 7449 * @atomicservice 7450 * @since 12 7451 */ 7452 minimize(callback: AsyncCallback<void>): void; 7453 7454 /** 7455 * Minimize app main window and hide app subWindow. 7456 * 7457 * @returns { Promise<void> } - The promise returned by the function. 7458 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7459 * @throws { BusinessError } 1300002 - This window state is abnormal. 7460 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7461 * @syscap SystemCapability.Window.SessionManager 7462 * @since 11 7463 */ 7464 /** 7465 * Minimize app main window and hide app subWindow. 7466 * 7467 * @returns { Promise<void> } - The promise returned by the function. 7468 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7469 * @throws { BusinessError } 1300002 - This window state is abnormal. 7470 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7471 * @syscap SystemCapability.Window.SessionManager 7472 * @atomicservice 7473 * @since 12 7474 */ 7475 minimize(): Promise<void>; 7476 7477 /** 7478 * Maximize app main window. 7479 * @param { MaximizePresentation } presentation - set window presentation when maximize. 7480 * @returns { Promise<void> } - The promise returned by the function. 7481 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7482 * @throws { BusinessError } 1300002 - This window state is abnormal. 7483 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7484 * @throws { BusinessError } 1300004 - Unauthorized operation. 7485 * @throws { BusinessError } 1300005 - This window stage is abnormal. 7486 * @syscap SystemCapability.Window.SessionManager 7487 * @atomicservice 7488 * @since 12 7489 */ 7490 maximize(presentation?: MaximizePresentation): Promise<void>; 7491 7492 /** 7493 * Set whether to enable a window to resize by drag. 7494 * 7495 * @param { boolean } enable - Disable window to resize by drag if false. 7496 * @param { AsyncCallback<void> } callback - The callback of setResizeByDragEnabled. 7497 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7498 * 2. Incorrect parameter types. 7499 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7500 * @throws { BusinessError } 1300002 - This window state is abnormal. 7501 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7502 * @syscap SystemCapability.Window.SessionManager 7503 * @atomicservice 7504 * @since 14 7505 */ 7506 setResizeByDragEnabled(enable: boolean, callback: AsyncCallback<void>): void; 7507 7508 /** 7509 * Set whether to enable a window to resize by drag. 7510 * 7511 * @param { boolean } enable - Disable window to resize by drag if false. 7512 * @returns { Promise<void> } - The promise returned by the function. 7513 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7514 * 2. Incorrect parameter types. 7515 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7516 * @throws { BusinessError } 1300002 - This window state is abnormal. 7517 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7518 * @syscap SystemCapability.Window.SessionManager 7519 * @atomicservice 7520 * @since 14 7521 */ 7522 setResizeByDragEnabled(enable: boolean): Promise<void>; 7523 7524 /** 7525 * Hide the non-system floating windows. 7526 * 7527 * @param { boolean } shouldHide - Hide the non-system floating windows if true, otherwise means the opposite. 7528 * @param { AsyncCallback<void> } callback - The callback of hideNonSystemFloatingWindows. 7529 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7530 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7531 * 2. Incorrect parameter types. 7532 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7533 * @throws { BusinessError } 1300002 - This window state is abnormal. 7534 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7535 * @throws { BusinessError } 1300004 - Unauthorized operation. 7536 * @syscap SystemCapability.Window.SessionManager 7537 * @systemapi Hide this for inner system use. 7538 * @since 11 7539 */ 7540 hideNonSystemFloatingWindows(shouldHide: boolean, callback: AsyncCallback<void>): void; 7541 7542 /** 7543 * Hide the non-system floating windows. 7544 * 7545 * @param { boolean } shouldHide - Hide the non-system floating windows if true, otherwise means the opposite. 7546 * @returns { Promise<void> } - The promise returned by the function. 7547 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7548 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7549 * 2. Incorrect parameter types. 7550 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7551 * @throws { BusinessError } 1300002 - This window state is abnormal. 7552 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7553 * @throws { BusinessError } 1300004 - Unauthorized operation. 7554 * @syscap SystemCapability.Window.SessionManager 7555 * @systemapi Hide this for inner system use. 7556 * @since 11 7557 */ 7558 hideNonSystemFloatingWindows(shouldHide: boolean): Promise<void>; 7559 7560 /** 7561 * Get the window limits of current window. 7562 * 7563 * @returns { WindowLimits } - The limits of window. 7564 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7565 * @throws { BusinessError } 1300002 - This window state is abnormal. 7566 * @syscap SystemCapability.Window.SessionManager 7567 * @since 11 7568 */ 7569 /** 7570 * Get the window limits of current window. 7571 * 7572 * @returns { WindowLimits } - The limits of window. 7573 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7574 * @throws { BusinessError } 1300002 - This window state is abnormal. 7575 * @syscap SystemCapability.Window.SessionManager 7576 * @atomicservice 7577 * @since 12 7578 */ 7579 getWindowLimits(): WindowLimits; 7580 7581 /** 7582 * Set the window limits of a window. 7583 * 7584 * @param { WindowLimits } windowLimits - window limits of the window. 7585 * @returns { Promise<WindowLimits> } - Promise is used to return the limits of window. 7586 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7587 * 2. Incorrect parameter types; 7588 * 3. Parameter verification failed. 7589 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7590 * @throws { BusinessError } 1300002 - This window state is abnormal. 7591 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7592 * @throws { BusinessError } 1300004 - Unauthorized operation. 7593 * @syscap SystemCapability.Window.SessionManager 7594 * @since 11 7595 */ 7596 /** 7597 * Set the window limits of a window. 7598 * 7599 * @param { WindowLimits } windowLimits - window limits of the window. 7600 * @returns { Promise<WindowLimits> } - Promise is used to return the limits of window. 7601 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7602 * 2. Incorrect parameter types; 7603 * 3. Parameter verification failed. 7604 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7605 * @throws { BusinessError } 1300002 - This window state is abnormal. 7606 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7607 * @throws { BusinessError } 1300004 - Unauthorized operation. 7608 * @syscap SystemCapability.Window.SessionManager 7609 * @atomicservice 7610 * @since 12 7611 */ 7612 setWindowLimits(windowLimits: WindowLimits): Promise<WindowLimits>; 7613 7614 /** 7615 * Set whether to enable the single frame composer. 7616 * 7617 * @param { boolean } enable - Enable the single frame composer if true, otherwise means the opposite. 7618 * @returns { Promise<void> } - The promise returned by the function. 7619 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7620 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7621 * 2. Incorrect parameter types. 7622 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7623 * @throws { BusinessError } 1300002 - This window state is abnormal. 7624 * @syscap SystemCapability.Window.SessionManager 7625 * @systemapi Hide this for inner system use. 7626 * @since 11 7627 */ 7628 setSingleFrameComposerEnabled(enable: boolean): Promise<void>; 7629 7630 /** 7631 * When get focused, keep the keyboard created by other windows, support system window and app subwindow. 7632 * 7633 * @param { boolean } keepKeyboardFlag - keep the keyboard if true, otherwise means the opposite. 7634 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7635 * 2. Incorrect parameter types. 7636 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7637 * @throws { BusinessError } 1300002 - This window state is abnormal. 7638 * @throws { BusinessError } 1300004 - Unauthorized operation. 7639 * @syscap SystemCapability.Window.SessionManager 7640 * @since 11 7641 */ 7642 /** 7643 * When get focused, keep the keyboard created by other windows, support system window and app subwindow. 7644 * 7645 * @param { boolean } keepKeyboardFlag - keep the keyboard if true, otherwise means the opposite. 7646 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7647 * 2. Incorrect parameter types. 7648 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7649 * @throws { BusinessError } 1300002 - This window state is abnormal. 7650 * @throws { BusinessError } 1300004 - Unauthorized operation. 7651 * @syscap SystemCapability.Window.SessionManager 7652 * @atomicservice 7653 * @since 12 7654 */ 7655 keepKeyboardOnFocus(keepKeyboardFlag: boolean): void; 7656 7657 /** 7658 * Recover app main window. 7659 * 7660 * @returns { Promise<void> } - The promise returned by the function. 7661 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7662 * @throws { BusinessError } 1300001 - Repeated operation. 7663 * @throws { BusinessError } 1300002 - This window state is abnormal. 7664 * @syscap SystemCapability.Window.SessionManager 7665 * @since 11 7666 */ 7667 /** 7668 * Recover app main window. 7669 * 7670 * @returns { Promise<void> } - The promise returned by the function. 7671 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7672 * @throws { BusinessError } 1300001 - Repeated operation. 7673 * @throws { BusinessError } 1300002 - This window state is abnormal. 7674 * @syscap SystemCapability.Window.SessionManager 7675 * @atomicservice 7676 * @since 12 7677 */ 7678 recover(): Promise<void>; 7679 7680 /** 7681 * After the app main window is minimized, if the Ability is not in the background state, you can restore app main window. 7682 * 7683 * @returns { Promise<void> } - The promise returned by the function. 7684 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7685 * @throws { BusinessError } 1300002 - This window state is abnormal. 7686 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7687 * @throws { BusinessError } 1300004 - Unauthorized operation. 7688 * @syscap SystemCapability.Window.SessionManager 7689 * @atomicservice 7690 * @since 14 7691 */ 7692 restore(): Promise<void>; 7693 7694 /** 7695 * Set the visibility of the window decor. 7696 * 7697 * @param { boolean } - Enable the decor visible if true, otherwise means the opposite. 7698 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7699 * 2. Incorrect parameter types. 7700 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7701 * @throws { BusinessError } 1300002 - This window state is abnormal. 7702 * @throws { BusinessError } 1300004 - Unauthorized operation. 7703 * @syscap SystemCapability.Window.SessionManager 7704 * @since 11 7705 */ 7706 /** 7707 * Set the visibility of the window decor. 7708 * 7709 * @param { boolean } isVisible - Enable the decor visible if true, otherwise means the opposite. 7710 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7711 * 2. Incorrect parameter types. 7712 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7713 * @throws { BusinessError } 1300002 - This window state is abnormal. 7714 * @throws { BusinessError } 1300004 - Unauthorized operation. 7715 * @syscap SystemCapability.Window.SessionManager 7716 * @atomicservice 7717 * @since 12 7718 */ 7719 setWindowDecorVisible(isVisible: boolean): void; 7720 7721 /** 7722 * Set whether window can be moved by drag title. 7723 * 7724 * @param { boolean } enabled - Enable the window title move if true, otherwise means the opposite. 7725 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7726 * 2. Incorrect parameter types. 7727 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7728 * @throws { BusinessError } 1300002 - This window state is abnormal. 7729 * @throws { BusinessError } 1300004 - Unauthorized operation. 7730 * @syscap SystemCapability.Window.SessionManager 7731 * @atomicservice 7732 * @since 14 7733 */ 7734 setWindowTitleMoveEnabled(enabled: boolean): void; 7735 7736 /** 7737 * Set the modality of the window. 7738 * 7739 * @param { boolean } isModal - Enable the window modal if true, otherwise means the opposite. 7740 * @returns { Promise<void> } Promise that returns no value. 7741 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7742 * 2. Incorrect parameter types. 7743 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7744 * @throws { BusinessError } 1300002 - This window state is abnormal. 7745 * @throws { BusinessError } 1300004 - Unauthorized operation. 7746 * @syscap SystemCapability.Window.SessionManager 7747 * @atomicservice 7748 * @since 12 7749 */ 7750 setSubWindowModal(isModal: boolean): Promise<void>; 7751 7752 /** 7753 * Set the modality of the window. 7754 * 7755 * @param { boolean } isModal - Enable the window modal if true, otherwise means the opposite. 7756 * @param { ModalityType } modalityType - Set modality type when the window modal is true. 7757 * @returns { Promise<void> } Promise that returns no value. 7758 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7759 * 2. Incorrect parameter types. 7760 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7761 * @throws { BusinessError } 1300002 - This window state is abnormal. 7762 * @throws { BusinessError } 1300004 - Unauthorized operation. 7763 * @syscap SystemCapability.Window.SessionManager 7764 * @atomicservice 7765 * @since 14 7766 */ 7767 setSubWindowModal(isModal: boolean, modalityType: ModalityType): Promise<void>; 7768 7769 /** 7770 * Set the height of the window decor. 7771 * 7772 * @param { number } - The height of window decor. 7773 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7774 * 2. Incorrect parameter types; 7775 * 3. Parameter verification failed. 7776 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7777 * @throws { BusinessError } 1300002 - This window state is abnormal. 7778 * @syscap SystemCapability.Window.SessionManager 7779 * @since 11 7780 */ 7781 /** 7782 * Set the height of the window decor. 7783 * 7784 * @param { number } height - The height of window decor. 7785 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7786 * 2. Incorrect parameter types; 7787 * 3. Parameter verification failed. 7788 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7789 * @throws { BusinessError } 1300002 - This window state is abnormal. 7790 * @syscap SystemCapability.Window.SessionManager 7791 * @atomicservice 7792 * @since 12 7793 */ 7794 setWindowDecorHeight(height: number): void; 7795 7796 /** 7797 * Get the height of the window decor. 7798 * 7799 * @returns { number } - The height of window decor. 7800 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7801 * @throws { BusinessError } 1300002 - This window state is abnormal. 7802 * @syscap SystemCapability.Window.SessionManager 7803 * @since 11 7804 */ 7805 /** 7806 * Get the height of the window decor. 7807 * 7808 * @returns { number } - The height of window decor. 7809 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7810 * @throws { BusinessError } 1300002 - This window state is abnormal. 7811 * @syscap SystemCapability.Window.SessionManager 7812 * @atomicservice 7813 * @since 12 7814 */ 7815 getWindowDecorHeight(): number; 7816 7817 /** 7818 * Set the style of the window decor. 7819 * 7820 * @param { DecorButtonStyle } dectorStyle - The style of window decor. 7821 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7822 * 2. Incorrect parameter types; 7823 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7824 * @throws { BusinessError } 1300002 - This window state is abnormal. 7825 * @throws { BusinessError } 1300004 - Unauthorized operation. 7826 * @syscap SystemCapability.Window.SessionManager 7827 * @atomicservice 7828 * @since 14 7829 */ 7830 setDecorButtonStyle(dectorStyle: DecorButtonStyle): void; 7831 7832 /** 7833 * Get the style of the window decor. 7834 * 7835 * @returns { DecorButtonStyle } - The style of window decor. 7836 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7837 * @throws { BusinessError } 1300002 - This window state is abnormal. 7838 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7839 * @throws { BusinessError } 1300004 - Unauthorized operation. 7840 * @syscap SystemCapability.Window.SessionManager 7841 * @atomicservice 7842 * @since 14 7843 */ 7844 getDecorButtonStyle(): DecorButtonStyle; 7845 7846 /** 7847 * Set touchable areas. By default, the entire window area is touchable. 7848 * If touchable areas are set in the window, touch events outside the areas will be transparent transmitted. 7849 * If the window area changes, you need to reset it. 7850 * 7851 * @param { Array<Rect> } rects - Touchable areas. The maximum size cannot exceed 10, touchable area cannot exceed the window's area. 7852 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7853 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7854 * 2. Incorrect parameter types. 7855 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7856 * @throws { BusinessError } 1300002 - This window state is abnormal. 7857 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7858 * @syscap SystemCapability.Window.SessionManager 7859 * @systemapi 7860 * @since 12 7861 */ 7862 setTouchableAreas(rects: Array<Rect>): void; 7863 7864 /** 7865 * Get the area of window title buttons. 7866 * 7867 * @returns { TitleButtonRect } - The area of window title buttons. 7868 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7869 * @throws { BusinessError } 1300002 - This window state is abnormal. 7870 * @syscap SystemCapability.Window.SessionManager 7871 * @since 11 7872 */ 7873 /** 7874 * Get the area of window title buttons. 7875 * 7876 * @returns { TitleButtonRect } - The area of window title buttons. 7877 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7878 * @throws { BusinessError } 1300002 - This window state is abnormal. 7879 * @syscap SystemCapability.Window.SessionManager 7880 * @atomicservice 7881 * @since 12 7882 */ 7883 getTitleButtonRect(): TitleButtonRect; 7884 7885 /** 7886 * Set whether to display the maximize, minimize, split buttons of main window. 7887 * 7888 * @param { boolean } isMaximizeVisible - Display maximize button if true, or hide maximize button if false. 7889 * @param { boolean } isMinimizeVisible - Display minimize button if true, or hide minimize button if false. 7890 * @param { boolean } isSplitVisible - Display split button if true, or hide split button if false. 7891 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7892 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7893 * 2. Incorrect parameter types. 7894 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7895 * @throws { BusinessError } 1300002 - This window state is abnormal. 7896 * @throws { BusinessError } 1300004 - Unauthorized operation. 7897 * @syscap SystemCapability.Window.SessionManager 7898 * @systemapi Hide this for inner system use. 7899 * @since 12 7900 */ 7901 setTitleButtonVisible(isMaximizeVisible: boolean, isMinimizeVisible: boolean, isSplitVisible: boolean): void; 7902 7903 /** 7904 * Set whether to display the maximize, minimize, close buttons of main window. 7905 * 7906 * @param { boolean } isMaximizeButtonVisible - Display maximize button if true, or hide maximize button if false. 7907 * @param { boolean } isMinimizeButtonVisible - Display minimize button if true, or hide minimize button if false. 7908 * @param { boolean } isCloseButtonVisible - Display close button if true, or hide close button if false. 7909 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7910 * 2. Incorrect parameter types. 7911 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7912 * @throws { BusinessError } 1300002 - This window state is abnormal. 7913 * @throws { BusinessError } 1300004 - Unauthorized operation. 7914 * @syscap SystemCapability.Window.SessionManager 7915 * @atomicservice 7916 * @since 14 7917 */ 7918 setWindowTitleButtonVisible(isMaximizeButtonVisible: boolean, isMinimizeButtonVisible: boolean, isCloseButtonVisible?: boolean): void; 7919 7920 /** 7921 * Enable landscape multiWindow 7922 * 7923 * @returns { Promise<void> } Promise that returns no value. 7924 * @throws {BusinessError} 1300002 - This window state is abnormal. 7925 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 7926 * @syscap SystemCapability.Window.SessionManager 7927 * @atomicservice 7928 * @since 12 7929 */ 7930 enableLandscapeMultiWindow(): Promise<void>; 7931 7932 /** 7933 * Start moving window. 7934 * 7935 * @returns { Promise<void> } Promise that returns no value. 7936 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7937 * @throws { BusinessError } 1300001 - Repeated operation. 7938 * @throws { BusinessError } 1300002 - This window state is abnormal. 7939 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7940 * @throws { BusinessError } 1300004 - Unauthorized operation. 7941 * @syscap SystemCapability.Window.SessionManager 7942 * @atomicservice 7943 * @since 14 7944 */ 7945 startMoving(): Promise<void>; 7946 7947 /** 7948 * Enable drag window. 7949 * 7950 * @param { boolean } enable - The value true means to enable window dragging, and false means the opposite. 7951 * @returns { Promise<void> } Promise that returns no value. 7952 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7953 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7954 * 2. Incorrect parameter types; 7955 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7956 * @throws { BusinessError } 1300002 - This window state is abnormal. 7957 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 7958 * @throws { BusinessError } 1300004 - Unauthorized operation. 7959 * @syscap SystemCapability.Window.SessionManager 7960 * @systemapi Hide this for inner system use. 7961 * @since 14 7962 */ 7963 enableDrag(enable: boolean): Promise<void>; 7964 7965 /** 7966 * Disable landscape multiWindow 7967 * 7968 * @returns { Promise<void> } Promise that returns no value. 7969 * @throws {BusinessError} 1300002 - This window state is abnormal. 7970 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 7971 * @syscap SystemCapability.Window.SessionManager 7972 * @atomicservice 7973 * @since 12 7974 */ 7975 disableLandscapeMultiWindow(): Promise<void>; 7976 7977 /** 7978 * Register the callback of title buttons area change. 7979 * 7980 * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. 7981 * @param { Callback<TitleButtonRect> } callback - Callback used to return the current title buttons area. 7982 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7983 * 2. Incorrect parameter types; 7984 * 3. Parameter verification failed. 7985 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7986 * @throws { BusinessError } 1300002 - This window state is abnormal. 7987 * @syscap SystemCapability.Window.SessionManager 7988 * @since 11 7989 */ 7990 /** 7991 * Register the callback of title buttons area change. 7992 * 7993 * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. 7994 * @param { Callback<TitleButtonRect> } callback - Callback used to return the current title buttons area. 7995 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 7996 * 2. Incorrect parameter types; 7997 * 3. Parameter verification failed. 7998 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 7999 * @throws { BusinessError } 1300002 - This window state is abnormal. 8000 * @syscap SystemCapability.Window.SessionManager 8001 * @atomicservice 8002 * @since 12 8003 */ 8004 on(type: 'windowTitleButtonRectChange', callback: Callback<TitleButtonRect>): void; 8005 8006 /** 8007 * Unregister the callback of title buttons area change. 8008 * 8009 * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. 8010 * @param { Callback<TitleButtonRect> } callback - Callback used to return the current title buttons area. 8011 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 8012 * 2. Parameter verification failed. 8013 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8014 * @throws { BusinessError } 1300002 - This window state is abnormal. 8015 * @syscap SystemCapability.Window.SessionManager 8016 * @since 11 8017 */ 8018 /** 8019 * Unregister the callback of title buttons area change. 8020 * 8021 * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. 8022 * @param { Callback<TitleButtonRect> } callback - Callback used to return the current title buttons area. 8023 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 8024 * 2. Parameter verification failed. 8025 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8026 * @throws { BusinessError } 1300002 - This window state is abnormal. 8027 * @syscap SystemCapability.Window.SessionManager 8028 * @atomicservice 8029 * @since 12 8030 */ 8031 off(type: 'windowTitleButtonRectChange', callback?: Callback<TitleButtonRect>): void; 8032 8033 /** 8034 * Set the window mask of window 8035 * 8036 * @param { Array<Array<number>> } windowMask - The mask of window. The value of the array is 0 and 1, the other number is illegal value. 8037 * @returns { Promise<void> } Promise that returns no value. 8038 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8039 * 2. Incorrect parameter types. 8040 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8041 * @throws { BusinessError } 1300002 - This window state is abnormal. 8042 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8043 * @throws { BusinessError } 1300004 - Unauthorized operation. 8044 * @syscap SystemCapability.Window.SessionManager 8045 * @atomicservice 8046 * @since 12 8047 */ 8048 setWindowMask(windowMask: Array<Array<number>>): Promise<void>; 8049 8050 /** 8051 * Register the callback of windowRectChange 8052 * 8053 * @param { 'windowRectChange' } type - The value is fixed at 'windowRectChange', indicating the window rect change event. 8054 * @param { Callback<RectChangeOptions> } callback - Callback used to return the RectChangeOptions. 8055 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8056 * 2. Incorrect parameter types; 8057 * 3. Parameter verification failed. 8058 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8059 * @throws { BusinessError } 1300002 - This window state is abnormal. 8060 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8061 * @syscap SystemCapability.Window.SessionManager 8062 * @atomicservice 8063 * @since 12 8064 */ 8065 on(type: 'windowRectChange', callback: Callback<RectChangeOptions>): void; 8066 8067 /** 8068 * Unregister the callback of windowRectChange 8069 * 8070 * @param { 'windowRectChange' } type - The value is fixed at 'windowRectChange', indicating the window rect change event. 8071 * @param { Callback<RectChangeOptions> } callback - Callback used to return the RectChangeOptions. 8072 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 8073 * 2. Parameter verification failed. 8074 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8075 * @throws { BusinessError } 1300002 - This window state is abnormal. 8076 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8077 * @syscap SystemCapability.Window.SessionManager 8078 * @atomicservice 8079 * @since 12 8080 */ 8081 off(type: 'windowRectChange', callback?: Callback<RectChangeOptions>): void; 8082 8083 /** 8084 * Set gray scale of window. 8085 * 8086 * @param { number } grayScale - The value of gray scale. 8087 * @returns { Promise<void> } - The promise returned by the function. 8088 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8089 * 2. Incorrect parameter types; 8090 * 3. Parameter verification failed. 8091 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8092 * @throws { BusinessError } 1300002 - This window state is abnormal. 8093 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8094 * @syscap SystemCapability.Window.SessionManager 8095 * @atomicservice 8096 * @since 12 8097 */ 8098 setWindowGrayScale(grayScale: number): Promise<void>; 8099 8100 /** 8101 * Set whether to enable immersive mode. 8102 * 8103 * @param { boolean } enabled - The value true means to enable immersive mode, and false means the opposite. 8104 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8105 * 2. Incorrect parameter types; 8106 * @throws { BusinessError } 1300002 - This window state is abnormal. 8107 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8108 * @throws { BusinessError } 1300004 - Unauthorized operation. 8109 * @syscap SystemCapability.WindowManager.WindowManager.Core 8110 * @atomicservice 8111 * @since 12 8112 */ 8113 setImmersiveModeEnabledState(enabled: boolean): void; 8114 8115 /** 8116 * Get whether the immersive mode is enabled or not. 8117 * 8118 * @returns { boolean } - The value true means the immersive mode is enabled, and false means the opposite. 8119 * @throws { BusinessError } 1300002 - This window state is abnormal. 8120 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8121 * @throws { BusinessError } 1300004 - Unauthorized operation. 8122 * @syscap SystemCapability.WindowManager.WindowManager.Core 8123 * @atomicservice 8124 * @since 12 8125 */ 8126 getImmersiveModeEnabledState(): boolean; 8127 8128 /** 8129 * Get the window status of current window. 8130 * 8131 * @returns { WindowStatusType } - The status of window. 8132 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8133 * @throws { BusinessError } 1300002 - This window state is abnormal. 8134 * @syscap SystemCapability.Window.SessionManager 8135 * @atomicservice 8136 * @since 12 8137 */ 8138 getWindowStatus(): WindowStatusType; 8139 8140 /** 8141 * Checks whether the window is focused. 8142 * 8143 * @returns { boolean } - Whether the window is focused. The value true means that the window is focused, and false means the opposite. 8144 * @throws { BusinessError } 1300002 - This window state is abnormal. 8145 * @syscap SystemCapability.WindowManager.WindowManager.Core 8146 * @atomicservice 8147 * @since 12 8148 */ 8149 isFocused(): boolean; 8150 8151 /** 8152 * Create sub window with options. 8153 * 8154 * @param { string } name - window name of sub window 8155 * @param { SubWindowOptions } options - options of sub window creation 8156 * @returns { Promise<Window> } Promise used to return the subwindow. 8157 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8158 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8159 * @throws { BusinessError } 1300002 - This window state is abnormal. 8160 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8161 * @throws { BusinessError } 1300004 - Unauthorized operation. 8162 * @syscap SystemCapability.Window.SessionManager 8163 * @StageModelOnly 8164 * @atomicservice 8165 * @since 12 8166 */ 8167 createSubWindowWithOptions(name: string, options: SubWindowOptions): Promise<Window>; 8168 8169 /** 8170 * Set whether the title bar and dock bar will show, when the mouse hovers over hot area. 8171 * 8172 * @param { boolean } isTitleHoverShown - The value true means to display the title bar, and false means the opposite. 8173 * @param { boolean } isDockHoverShown - The value true means to display the dock bar, and false means the opposite. 8174 * @returns { Promise<void> } Promise that returns no value. 8175 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8176 * 2. Incorrect parameter types; 8177 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8178 * @throws { BusinessError } 1300002 - This window state is abnormal. 8179 * @throws { BusinessError } 1300004 - Unauthorized operation. 8180 * @syscap SystemCapability.Window.SessionManager 8181 * @atomicservice 8182 * @since 14 8183 */ 8184 setTitleAndDockHoverShown(isTitleHoverShown?: boolean, isDockHoverShown?: boolean): Promise<void>; 8185 } 8186 8187 /** 8188 * Window stage callback event type 8189 * 8190 * @enum { number } 8191 * @syscap SystemCapability.WindowManager.WindowManager.Core 8192 * @StageModelOnly 8193 * @since 9 8194 */ 8195 /** 8196 * Window stage callback event type 8197 * 8198 * @enum { number } 8199 * @syscap SystemCapability.WindowManager.WindowManager.Core 8200 * @StageModelOnly 8201 * @crossplatform 8202 * @since 10 8203 */ 8204 /** 8205 * Window stage callback event type 8206 * 8207 * @enum { number } 8208 * @syscap SystemCapability.WindowManager.WindowManager.Core 8209 * @StageModelOnly 8210 * @crossplatform 8211 * @atomicservice 8212 * @since 11 8213 */ 8214 enum WindowStageEventType { 8215 /** 8216 * The window stage is running in the foreground. 8217 * 8218 * @syscap SystemCapability.WindowManager.WindowManager.Core 8219 * @StageModelOnly 8220 * @since 9 8221 */ 8222 /** 8223 * The window stage is running in the foreground. 8224 * 8225 * @syscap SystemCapability.WindowManager.WindowManager.Core 8226 * @StageModelOnly 8227 * @crossplatform 8228 * @since 10 8229 */ 8230 /** 8231 * The window stage is running in the foreground. 8232 * 8233 * @syscap SystemCapability.WindowManager.WindowManager.Core 8234 * @StageModelOnly 8235 * @crossplatform 8236 * @atomicservice 8237 * @since 11 8238 */ 8239 SHOWN = 1, 8240 /** 8241 * The window stage gains focus. 8242 * 8243 * @syscap SystemCapability.WindowManager.WindowManager.Core 8244 * @StageModelOnly 8245 * @since 9 8246 */ 8247 /** 8248 * The window stage gains focus. 8249 * 8250 * @syscap SystemCapability.WindowManager.WindowManager.Core 8251 * @StageModelOnly 8252 * @crossplatform 8253 * @since 10 8254 */ 8255 /** 8256 * The window stage gains focus. 8257 * 8258 * @syscap SystemCapability.WindowManager.WindowManager.Core 8259 * @StageModelOnly 8260 * @crossplatform 8261 * @atomicservice 8262 * @since 11 8263 */ 8264 ACTIVE, 8265 /** 8266 * The window stage loses focus. 8267 * 8268 * @syscap SystemCapability.WindowManager.WindowManager.Core 8269 * @StageModelOnly 8270 * @since 9 8271 */ 8272 /** 8273 * The window stage loses focus. 8274 * 8275 * @syscap SystemCapability.WindowManager.WindowManager.Core 8276 * @StageModelOnly 8277 * @crossplatform 8278 * @since 10 8279 */ 8280 /** 8281 * The window stage loses focus. 8282 * 8283 * @syscap SystemCapability.WindowManager.WindowManager.Core 8284 * @StageModelOnly 8285 * @crossplatform 8286 * @atomicservice 8287 * @since 11 8288 */ 8289 INACTIVE, 8290 /** 8291 * The window stage is running in the background. 8292 * 8293 * @syscap SystemCapability.WindowManager.WindowManager.Core 8294 * @StageModelOnly 8295 * @since 9 8296 */ 8297 /** 8298 * The window stage is running in the background. 8299 * 8300 * @syscap SystemCapability.WindowManager.WindowManager.Core 8301 * @StageModelOnly 8302 * @crossplatform 8303 * @since 10 8304 */ 8305 /** 8306 * The window stage is running in the background. 8307 * 8308 * @syscap SystemCapability.WindowManager.WindowManager.Core 8309 * @StageModelOnly 8310 * @crossplatform 8311 * @atomicservice 8312 * @since 11 8313 */ 8314 HIDDEN, 8315 /** 8316 * The window stage is interactive in the foreground. 8317 * 8318 * @syscap SystemCapability.WindowManager.WindowManager.Core 8319 * @StageModelOnly 8320 * @crossplatform 8321 * @atomicservice 8322 * @since 11 8323 */ 8324 RESUMED, 8325 /** 8326 * The window stage is not interactive in the foreground. 8327 * 8328 * @syscap SystemCapability.WindowManager.WindowManager.Core 8329 * @StageModelOnly 8330 * @crossplatform 8331 * @atomicservice 8332 * @since 11 8333 */ 8334 PAUSED 8335 } 8336 8337 /** 8338 * Enum for window modality Type 8339 * 8340 * @enum { number } 8341 * @syscap SystemCapability.Window.SessionManager 8342 * @atomicservice 8343 * @since 14 8344 */ 8345 enum ModalityType { 8346 /** 8347 * The value means window modality. 8348 * 8349 * @syscap SystemCapability.Window.SessionManager 8350 * @atomicservice 8351 * @since 14 8352 */ 8353 WINDOW_MODALITY = 0, 8354 /** 8355 * The value means application modality. 8356 * 8357 * @syscap SystemCapability.Window.SessionManager 8358 * @atomicservice 8359 * @since 14 8360 */ 8361 APPLICATION_MODALITY = 1, 8362 } 8363 8364 /** 8365 * Options for subwindow creation 8366 * 8367 * @interface SubWindowOptions 8368 * @syscap SystemCapability.Window.SessionManager 8369 * @since 11 8370 */ 8371 /** 8372 * Options for subwindow creation 8373 * 8374 * @interface SubWindowOptions 8375 * @syscap SystemCapability.Window.SessionManager 8376 * @atomicservice 8377 * @since 12 8378 */ 8379 interface SubWindowOptions { 8380 /** 8381 * Indicates subwindow title 8382 * 8383 * @type { string } 8384 * @syscap SystemCapability.Window.SessionManager 8385 * @since 11 8386 */ 8387 /** 8388 * Indicates subwindow title 8389 * 8390 * @type { string } 8391 * @syscap SystemCapability.Window.SessionManager 8392 * @atomicservice 8393 * @since 12 8394 */ 8395 title: string; 8396 /** 8397 * Indicates decor of subwindow 8398 * 8399 * @type { boolean } 8400 * @syscap SystemCapability.Window.SessionManager 8401 * @since 11 8402 */ 8403 /** 8404 * Indicates decor of subwindow 8405 * 8406 * @type { boolean } 8407 * @syscap SystemCapability.Window.SessionManager 8408 * @atomicservice 8409 * @since 12 8410 */ 8411 decorEnabled: boolean; 8412 /** 8413 * Indicates modality of subwindow 8414 * 8415 * @type { ?boolean } 8416 * @syscap SystemCapability.Window.SessionManager 8417 * @atomicservice 8418 * @since 12 8419 */ 8420 isModal?: boolean; 8421 /** 8422 * Indicates whether subwindow is topmost 8423 * 8424 * @type { ?boolean } 8425 * @syscap SystemCapability.Window.SessionManager 8426 * @systemapi Hide this for inner system use. 8427 * @since 12 8428 */ 8429 isTopmost?: boolean; 8430 /** 8431 * Indicates modality type of subwindow 8432 * 8433 * @type { ?ModalityType } 8434 * @syscap SystemCapability.Window.SessionManager 8435 * @atomicservice 8436 * @since 14 8437 */ 8438 modalityType?: ModalityType; 8439 } 8440 /** 8441 * WindowStage 8442 * 8443 * @interface WindowStage 8444 * @syscap SystemCapability.WindowManager.WindowManager.Core 8445 * @since 9 8446 */ 8447 /** 8448 * WindowStage 8449 * 8450 * @interface WindowStage 8451 * @syscap SystemCapability.WindowManager.WindowManager.Core 8452 * @crossplatform 8453 * @since 10 8454 */ 8455 /** 8456 * WindowStage 8457 * 8458 * @interface WindowStage 8459 * @syscap SystemCapability.WindowManager.WindowManager.Core 8460 * @crossplatform 8461 * @atomicservice 8462 * @since 11 8463 */ 8464 interface WindowStage { 8465 /** 8466 * Get main window of the stage. 8467 * 8468 * @returns { Promise<Window> } Callback used to return the subwindow. 8469 * @throws { BusinessError } 1300002 - This window state is abnormal. 8470 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8471 * @syscap SystemCapability.WindowManager.WindowManager.Core 8472 * @StageModelOnly 8473 * @since 9 8474 */ 8475 /** 8476 * Get main window of the stage. 8477 * 8478 * @returns { Promise<Window> } Callback used to return the subwindow. 8479 * @throws { BusinessError } 1300002 - This window state is abnormal. 8480 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8481 * @syscap SystemCapability.WindowManager.WindowManager.Core 8482 * @StageModelOnly 8483 * @crossplatform 8484 * @since 10 8485 */ 8486 /** 8487 * Get main window of the stage. 8488 * 8489 * @returns { Promise<Window> } Callback used to return the subwindow. 8490 * @throws { BusinessError } 1300002 - This window state is abnormal. 8491 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8492 * @syscap SystemCapability.WindowManager.WindowManager.Core 8493 * @StageModelOnly 8494 * @crossplatform 8495 * @atomicservice 8496 * @since 11 8497 */ 8498 getMainWindow(): Promise<Window>; 8499 /** 8500 * Get main window of the stage. 8501 * 8502 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 8503 * @throws { BusinessError } 1300002 - This window state is abnormal. 8504 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8505 * @syscap SystemCapability.WindowManager.WindowManager.Core 8506 * @StageModelOnly 8507 * @since 9 8508 */ 8509 /** 8510 * Get main window of the stage. 8511 * 8512 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 8513 * @throws { BusinessError } 1300002 - This window state is abnormal. 8514 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8515 * @syscap SystemCapability.WindowManager.WindowManager.Core 8516 * @StageModelOnly 8517 * @crossplatform 8518 * @since 10 8519 */ 8520 /** 8521 * Get main window of the stage. 8522 * 8523 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 8524 * @throws { BusinessError } 1300002 - This window state is abnormal. 8525 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8526 * @syscap SystemCapability.WindowManager.WindowManager.Core 8527 * @StageModelOnly 8528 * @crossplatform 8529 * @atomicservice 8530 * @since 11 8531 */ 8532 getMainWindow(callback: AsyncCallback<Window>): void; 8533 /** 8534 * Get main window of the stage. 8535 * 8536 * @returns { Window } 8537 * @throws { BusinessError } 1300002 - This window state is abnormal. 8538 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8539 * @syscap SystemCapability.WindowManager.WindowManager.Core 8540 * @StageModelOnly 8541 * @since 9 8542 */ 8543 /** 8544 * Get main window of the stage. 8545 * 8546 * @returns { Window } 8547 * @throws { BusinessError } 1300002 - This window state is abnormal. 8548 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8549 * @syscap SystemCapability.WindowManager.WindowManager.Core 8550 * @StageModelOnly 8551 * @crossplatform 8552 * @since 10 8553 */ 8554 /** 8555 * Get main window of the stage. 8556 * 8557 * @returns { Window } 8558 * @throws { BusinessError } 1300002 - This window state is abnormal. 8559 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8560 * @syscap SystemCapability.WindowManager.WindowManager.Core 8561 * @StageModelOnly 8562 * @crossplatform 8563 * @atomicservice 8564 * @since 11 8565 */ 8566 getMainWindowSync(): Window; 8567 /** 8568 * Create sub window of the stage. 8569 * 8570 * @param { string } name window name of sub window 8571 * @returns { Promise<Window> } Promise used to return the subwindow. 8572 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8573 * @throws { BusinessError } 1300002 - This window state is abnormal. 8574 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8575 * @syscap SystemCapability.WindowManager.WindowManager.Core 8576 * @StageModelOnly 8577 * @since 9 8578 */ 8579 /** 8580 * Create sub window of the stage. 8581 * 8582 * @param { string } name window name of sub window 8583 * @returns { Promise<Window> } Promise used to return the subwindow. 8584 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8585 * @throws { BusinessError } 1300002 - This window state is abnormal. 8586 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8587 * @syscap SystemCapability.WindowManager.WindowManager.Core 8588 * @StageModelOnly 8589 * @crossplatform 8590 * @since 10 8591 */ 8592 /** 8593 * Create sub window of the stage. 8594 * 8595 * @param { string } name window name of sub window 8596 * @returns { Promise<Window> } Promise used to return the subwindow. 8597 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8598 * @throws { BusinessError } 1300002 - This window state is abnormal. 8599 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8600 * @syscap SystemCapability.WindowManager.WindowManager.Core 8601 * @StageModelOnly 8602 * @crossplatform 8603 * @atomicservice 8604 * @since 11 8605 */ 8606 createSubWindow(name: string): Promise<Window>; 8607 /** 8608 * Create sub window of the stage. 8609 * 8610 * @param { string } name window name of sub window 8611 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 8612 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8613 * @throws { BusinessError } 1300002 - This window state is abnormal. 8614 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8615 * @syscap SystemCapability.WindowManager.WindowManager.Core 8616 * @StageModelOnly 8617 * @since 9 8618 */ 8619 /** 8620 * Create sub window of the stage. 8621 * 8622 * @param { string } name window name of sub window 8623 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 8624 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8625 * @throws { BusinessError } 1300002 - This window state is abnormal. 8626 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8627 * @syscap SystemCapability.WindowManager.WindowManager.Core 8628 * @StageModelOnly 8629 * @crossplatform 8630 * @since 10 8631 */ 8632 /** 8633 * Create sub window of the stage. 8634 * 8635 * @param { string } name window name of sub window 8636 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 8637 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8638 * @throws { BusinessError } 1300002 - This window state is abnormal. 8639 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8640 * @syscap SystemCapability.WindowManager.WindowManager.Core 8641 * @StageModelOnly 8642 * @crossplatform 8643 * @atomicservice 8644 * @since 11 8645 */ 8646 createSubWindow(name: string, callback: AsyncCallback<Window>): void; 8647 /** 8648 * Create sub window of the stage. 8649 * 8650 * @param { string } name - window name of sub window 8651 * @param { SubWindowOptions } options - options of sub window creation 8652 * @returns { Promise<Window> } Promise used to return the subwindow. 8653 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8654 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8655 * @throws { BusinessError } 1300002 - This window state is abnormal. 8656 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8657 * @syscap SystemCapability.Window.SessionManager 8658 * @StageModelOnly 8659 * @since 11 8660 */ 8661 /** 8662 * Create sub window of the stage. 8663 * 8664 * @param { string } name - window name of sub window 8665 * @param { SubWindowOptions } options - options of sub window creation 8666 * @returns { Promise<Window> } Promise used to return the subwindow. 8667 * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. 8668 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 8669 * @throws { BusinessError } 1300002 - This window state is abnormal. 8670 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8671 * @syscap SystemCapability.Window.SessionManager 8672 * @StageModelOnly 8673 * @atomicservice 8674 * @since 12 8675 */ 8676 createSubWindowWithOptions(name: string, options: SubWindowOptions): Promise<Window>; 8677 /** 8678 * Get sub window of the stage. 8679 * 8680 * @returns { Promise<Array<Window>> } 8681 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8682 * @syscap SystemCapability.WindowManager.WindowManager.Core 8683 * @StageModelOnly 8684 * @since 9 8685 */ 8686 /** 8687 * Get sub window of the stage. 8688 * 8689 * @returns { Promise<Array<Window>> } 8690 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8691 * @syscap SystemCapability.WindowManager.WindowManager.Core 8692 * @StageModelOnly 8693 * @crossplatform 8694 * @since 10 8695 */ 8696 /** 8697 * Get sub window of the stage. 8698 * 8699 * @returns { Promise<Array<Window>> } 8700 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8701 * @syscap SystemCapability.WindowManager.WindowManager.Core 8702 * @StageModelOnly 8703 * @crossplatform 8704 * @atomicservice 8705 * @since 11 8706 */ 8707 getSubWindow(): Promise<Array<Window>>; 8708 /** 8709 * Get sub window of the stage. 8710 * 8711 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 8712 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8713 * @syscap SystemCapability.WindowManager.WindowManager.Core 8714 * @StageModelOnly 8715 * @since 9 8716 */ 8717 /** 8718 * Get sub window of the stage. 8719 * 8720 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 8721 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8722 * @syscap SystemCapability.WindowManager.WindowManager.Core 8723 * @StageModelOnly 8724 * @crossplatform 8725 * @since 10 8726 */ 8727 /** 8728 * Get sub window of the stage. 8729 * 8730 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 8731 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8732 * @syscap SystemCapability.WindowManager.WindowManager.Core 8733 * @StageModelOnly 8734 * @crossplatform 8735 * @atomicservice 8736 * @since 11 8737 */ 8738 getSubWindow(callback: AsyncCallback<Array<Window>>): void; 8739 /** 8740 * Loads content 8741 * 8742 * @param { string } path Path of the page to which the content will be loaded 8743 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 8744 * @param { AsyncCallback<void> } callback Callback used to return the result. 8745 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8746 * 2. Incorrect parameter types. 8747 * @throws { BusinessError } 1300002 - This window state is abnormal. 8748 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8749 * @syscap SystemCapability.WindowManager.WindowManager.Core 8750 * @StageModelOnly 8751 * @since 9 8752 */ 8753 /** 8754 * Loads content 8755 * 8756 * @param { string } path Path of the page to which the content will be loaded 8757 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 8758 * @param { AsyncCallback<void> } callback Callback used to return the result. 8759 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8760 * 2. Incorrect parameter types. 8761 * @throws { BusinessError } 1300002 - This window state is abnormal. 8762 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8763 * @syscap SystemCapability.WindowManager.WindowManager.Core 8764 * @StageModelOnly 8765 * @crossplatform 8766 * @since 10 8767 */ 8768 /** 8769 * Loads content 8770 * 8771 * @param { string } path Path of the page to which the content will be loaded 8772 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 8773 * @param { AsyncCallback<void> } callback Callback used to return the result. 8774 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8775 * 2. Incorrect parameter types. 8776 * @throws { BusinessError } 1300002 - This window state is abnormal. 8777 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8778 * @syscap SystemCapability.WindowManager.WindowManager.Core 8779 * @StageModelOnly 8780 * @crossplatform 8781 * @atomicservice 8782 * @since 11 8783 */ 8784 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 8785 /** 8786 * Loads content 8787 * 8788 * @param { string } path of the page to which the content will be loaded 8789 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 8790 * @returns { Promise<void> } 8791 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8792 * 2. Incorrect parameter types. 8793 * @throws { BusinessError } 1300002 - This window state is abnormal. 8794 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8795 * @syscap SystemCapability.WindowManager.WindowManager.Core 8796 * @StageModelOnly 8797 * @since 9 8798 */ 8799 /** 8800 * Loads content 8801 * 8802 * @param { string } path of the page to which the content will be loaded 8803 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 8804 * @returns { Promise<void> } 8805 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8806 * 2. Incorrect parameter types. 8807 * @throws { BusinessError } 1300002 - This window state is abnormal. 8808 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8809 * @syscap SystemCapability.WindowManager.WindowManager.Core 8810 * @StageModelOnly 8811 * @crossplatform 8812 * @since 10 8813 */ 8814 /** 8815 * Loads content 8816 * 8817 * @param { string } path of the page to which the content will be loaded 8818 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 8819 * @returns { Promise<void> } 8820 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8821 * 2. Incorrect parameter types. 8822 * @throws { BusinessError } 1300002 - This window state is abnormal. 8823 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8824 * @syscap SystemCapability.WindowManager.WindowManager.Core 8825 * @StageModelOnly 8826 * @crossplatform 8827 * @atomicservice 8828 * @since 11 8829 */ 8830 loadContent(path: string, storage?: LocalStorage): Promise<void>; 8831 /** 8832 * Loads content 8833 * 8834 * @param { string } path of the page to which the content will be loaded 8835 * @param { AsyncCallback<void> } callback Callback used to return the result. 8836 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8837 * 2. Incorrect parameter types. 8838 * @throws { BusinessError } 1300002 - This window state is abnormal. 8839 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8840 * @syscap SystemCapability.WindowManager.WindowManager.Core 8841 * @StageModelOnly 8842 * @since 9 8843 */ 8844 /** 8845 * Loads content 8846 * 8847 * @param { string } path of the page to which the content will be loaded 8848 * @param { AsyncCallback<void> } callback Callback used to return the result. 8849 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8850 * 2. Incorrect parameter types. 8851 * @throws { BusinessError } 1300002 - This window state is abnormal. 8852 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8853 * @syscap SystemCapability.WindowManager.WindowManager.Core 8854 * @StageModelOnly 8855 * @crossplatform 8856 * @since 10 8857 */ 8858 /** 8859 * Loads content 8860 * 8861 * @param { string } path of the page to which the content will be loaded 8862 * @param { AsyncCallback<void> } callback Callback used to return the result. 8863 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8864 * 2. Incorrect parameter types. 8865 * @throws { BusinessError } 1300002 - This window state is abnormal. 8866 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8867 * @syscap SystemCapability.WindowManager.WindowManager.Core 8868 * @StageModelOnly 8869 * @crossplatform 8870 * @atomicservice 8871 * @since 11 8872 */ 8873 loadContent(path: string, callback: AsyncCallback<void>): void; 8874 8875 /** 8876 * Loads content by named router 8877 * 8878 * @param { string } name - name of the page to which the content will be loaded. 8879 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 8880 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8881 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8882 * 2. Incorrect parameter types. 8883 * @throws { BusinessError } 1300002 - This window state is abnormal. 8884 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8885 * @syscap SystemCapability.WindowManager.WindowManager.Core 8886 * @stagemodelonly 8887 * @crossplatform 8888 * @atomicservice 8889 * @since 11 8890 */ 8891 loadContentByName(name: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 8892 8893 /** 8894 * Loads content by named router 8895 * 8896 * @param { string } name - name of the page to which the content will be loaded. 8897 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8898 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8899 * 2. Incorrect parameter types. 8900 * @throws { BusinessError } 1300002 - This window state is abnormal. 8901 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8902 * @syscap SystemCapability.WindowManager.WindowManager.Core 8903 * @stagemodelonly 8904 * @crossplatform 8905 * @atomicservice 8906 * @since 11 8907 */ 8908 loadContentByName(name: string, callback: AsyncCallback<void>): void; 8909 8910 /** 8911 * Loads content by named router 8912 * 8913 * @param { string } name - name of the page to which the content will be loaded. 8914 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 8915 * @returns { Promise<void> } Promise that returns no value. 8916 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8917 * 2. Incorrect parameter types. 8918 * @throws { BusinessError } 1300002 - This window state is abnormal. 8919 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 8920 * @syscap SystemCapability.WindowManager.WindowManager.Core 8921 * @stagemodelonly 8922 * @crossplatform 8923 * @atomicservice 8924 * @since 11 8925 */ 8926 loadContentByName(name: string, storage?: LocalStorage): Promise<void>; 8927 8928 /** 8929 * Window stage event callback on. 8930 * 8931 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 8932 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 8933 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8934 * 2. Incorrect parameter types; 8935 * 3. Parameter verification failed. 8936 * @throws { BusinessError } 1300002 - This window state is abnormal. 8937 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8938 * @syscap SystemCapability.WindowManager.WindowManager.Core 8939 * @StageModelOnly 8940 * @since 9 8941 */ 8942 /** 8943 * Window stage event callback on. 8944 * 8945 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 8946 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 8947 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8948 * 2. Incorrect parameter types; 8949 * 3. Parameter verification failed. 8950 * @throws { BusinessError } 1300002 - This window state is abnormal. 8951 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8952 * @syscap SystemCapability.WindowManager.WindowManager.Core 8953 * @StageModelOnly 8954 * @crossplatform 8955 * @since 10 8956 */ 8957 /** 8958 * Window stage event callback on. 8959 * 8960 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 8961 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 8962 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 8963 * 2. Incorrect parameter types; 8964 * 3. Parameter verification failed. 8965 * @throws { BusinessError } 1300002 - This window state is abnormal. 8966 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8967 * @syscap SystemCapability.WindowManager.WindowManager.Core 8968 * @StageModelOnly 8969 * @crossplatform 8970 * @atomicservice 8971 * @since 11 8972 */ 8973 on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void; 8974 /** 8975 * Window stage event callback off. 8976 * 8977 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 8978 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 8979 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 8980 * 2. Parameter verification failed. 8981 * @throws { BusinessError } 1300002 - This window state is abnormal. 8982 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8983 * @syscap SystemCapability.WindowManager.WindowManager.Core 8984 * @StageModelOnly 8985 * @since 9 8986 */ 8987 /** 8988 * Window stage event callback off. 8989 * 8990 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 8991 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 8992 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 8993 * 2. Parameter verification failed. 8994 * @throws { BusinessError } 1300002 - This window state is abnormal. 8995 * @throws { BusinessError } 1300005 - This window stage is abnormal. 8996 * @syscap SystemCapability.WindowManager.WindowManager.Core 8997 * @StageModelOnly 8998 * @crossplatform 8999 * @since 10 9000 */ 9001 /** 9002 * Window stage event callback off. 9003 * 9004 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 9005 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 9006 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; 9007 * 2. Parameter verification failed. 9008 * @throws { BusinessError } 1300002 - This window state is abnormal. 9009 * @throws { BusinessError } 1300005 - This window stage is abnormal. 9010 * @syscap SystemCapability.WindowManager.WindowManager.Core 9011 * @StageModelOnly 9012 * @crossplatform 9013 * @atomicservice 9014 * @since 11 9015 */ 9016 off(eventType: 'windowStageEvent', callback?: Callback<WindowStageEventType>): void; 9017 9018 /** 9019 * Window stage close callback on. 9020 * 9021 * @param { 'windowStageClose' } eventType The value is fixed at 'windowStageClose', indicating the window stage close event. 9022 * @param { Callback<void> } callback Callback function requires a boolean return value to determine whether to close the current main window. 9023 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9024 * 2. Incorrect parameter types; 9025 * 3. Parameter verification failed. 9026 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9027 * @throws { BusinessError } 1300002 - This window state is abnormal. 9028 * @syscap SystemCapability.Window.SessionManager 9029 * @stagemodelonly 9030 * @atomicservice 9031 * @since 14 9032 */ 9033 on(eventType: 'windowStageClose', callback: Callback<void>): void; 9034 9035 /** 9036 * Window stage close callback off. 9037 * 9038 * @param { 'windowStageClose' } eventType The value is fixed at 'windowStageClose', indicating the window stage close event. 9039 * @param { Callback<void> } callback Callback function requires a boolean return value to determine whether to close the current main window. 9040 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9041 * 2. Incorrect parameter types; 9042 * 3. Parameter verification failed. 9043 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9044 * @throws { BusinessError } 1300002 - This window state is abnormal. 9045 * @syscap SystemCapability.Window.SessionManager 9046 * @stagemodelonly 9047 * @atomicservice 9048 * @since 14 9049 */ 9050 off(eventType: 'windowStageClose', callback?: Callback<void>): void; 9051 9052 /** 9053 * Disable window decoration. It must be called before loadContent. 9054 * 9055 * @throws { BusinessError } 1300002 - This window state is abnormal. 9056 * @throws { BusinessError } 1300005 - This window stage is abnormal. 9057 * @syscap SystemCapability.WindowManager.WindowManager.Core 9058 * @systemapi 9059 * @StageModelOnly 9060 * @since 9 9061 */ 9062 /** 9063 * Disable window decoration. It must be called before loadContent. 9064 * 9065 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 9066 * @throws { BusinessError } 1300002 - This window state is abnormal. 9067 * @throws { BusinessError } 1300005 - This window stage is abnormal. 9068 * @syscap SystemCapability.WindowManager.WindowManager.Core 9069 * @systemapi 9070 * @StageModelOnly 9071 * @since 12 9072 */ 9073 disableWindowDecor(): void; 9074 9075 /** 9076 * Sets whether can show on lock screen or not 9077 * 9078 * @param { boolean } showOnLockScreen can show on lock screen if true, or not if false 9079 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9080 * 2. Incorrect parameter types. 9081 * @throws { BusinessError } 1300002 - This window state is abnormal. 9082 * @throws { BusinessError } 1300005 - This window stage is abnormal. 9083 * @syscap SystemCapability.WindowManager.WindowManager.Core 9084 * @systemapi Hide this for inner system use. 9085 * @StageModelOnly 9086 * @since 9 9087 */ 9088 /** 9089 * Sets whether can show on lock screen or not 9090 * 9091 * @param { boolean } showOnLockScreen can show on lock screen if true, or not if false 9092 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 9093 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9094 * 2. Incorrect parameter types. 9095 * @throws { BusinessError } 1300002 - This window state is abnormal. 9096 * @throws { BusinessError } 1300005 - This window stage is abnormal. 9097 * @syscap SystemCapability.WindowManager.WindowManager.Core 9098 * @systemapi Hide this for inner system use. 9099 * @StageModelOnly 9100 * @since 12 9101 */ 9102 setShowOnLockScreen(showOnLockScreen: boolean): void; 9103 9104 /** 9105 * Set whether to use default density. 9106 * 9107 * @param { boolean } enabled - Use default density if true, or follow system density change if false 9108 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9109 * 2. Incorrect parameter types. 9110 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9111 * @throws { BusinessError } 1300002 - This window state is abnormal. 9112 * @throws { BusinessError } 1300005 - This window stage is abnormal. 9113 * @syscap SystemCapability.Window.SessionManager 9114 * @StageModelOnly 9115 * @atomicservice 9116 * @since 12 9117 */ 9118 setDefaultDensityEnabled(enabled: boolean): void; 9119 9120 /** 9121 * Remove the starting window, it must be used with configuration "enable.remove.starting.window". 9122 * 9123 * @returns { Promise<void> } - The promise returned by the function. 9124 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9125 * @throws { BusinessError } 1300002 - This window state is abnormal. 9126 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 9127 * @syscap SystemCapability.Window.SessionManager 9128 * @StageModelOnly 9129 * @atomicservice 9130 * @since 14 9131 */ 9132 removeStartingWindow(): Promise<void>; 9133 9134 /** 9135 * Set the application modality of the windowStage. 9136 * 9137 * @param { boolean } isModal - Enable the window modal if true, otherwise means the opposite. 9138 * @returns { Promise<void> } Promise that returns no value. 9139 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9140 * 2. Incorrect parameter types. 9141 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9142 * @throws { BusinessError } 1300002 - This window state is abnormal. 9143 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 9144 * @syscap SystemCapability.Window.SessionManager 9145 * @StageModelOnly 9146 * @atomicservice 9147 * @since 14 9148 */ 9149 setWindowModal(isModal: boolean): Promise<void>; 9150 9151 /** 9152 * Set to automatically save the window rect. 9153 * 9154 * @param { boolean } enabled - Enable the window rect auto-save if true, otherwise means the opposite. 9155 * @returns { Promise<void> } Promise that returns no value. 9156 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 9157 * 2. Incorrect parameter types. 9158 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9159 * @throws { BusinessError } 1300002 - This window state is abnormal. 9160 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 9161 * @syscap SystemCapability.Window.SessionManager 9162 * @StageModelOnly 9163 * @atomicservice 9164 * @since 14 9165 */ 9166 setWindowRectAutoSave(enabled: boolean): Promise<void>; 9167 9168 /** 9169 * Whether the window supports the window rect auto-save. 9170 * 9171 * @returns { Promise<boolean> } Promise used to return the result. 9172 * The value true means that the window rect auto-save is supported, and false means the opposite. 9173 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 9174 * @throws { BusinessError } 1300002 - This window state is abnormal. 9175 * @syscap SystemCapability.Window.SessionManager 9176 * @StageModelOnly 9177 * @atomicservice 9178 * @since 14 9179 */ 9180 isWindowRectAutoSave(): Promise<boolean>; 9181 } 9182 9183 /** 9184 * Attribute of the window for UI service extension ability. 9185 * 9186 * @enum { number } 9187 * @syscap SystemCapability.Window.SessionManager 9188 * @systemapi Hide this for inner system use. 9189 * @stagemodelonly 9190 * @since 14 9191 */ 9192 enum ExtensionWindowAttribute { 9193 /** 9194 * System window. 9195 * 9196 * @syscap SystemCapability.Window.SessionManager 9197 * @systemapi Hide this for inner system use. 9198 * @stagemodelonly 9199 * @since 14 9200 */ 9201 SYSTEM_WINDOW, 9202 9203 /** 9204 * Sub window. 9205 * 9206 * @syscap SystemCapability.Window.SessionManager 9207 * @systemapi Hide this for inner system use. 9208 * @stagemodelonly 9209 * @since 14 9210 */ 9211 SUB_WINDOW 9212 } 9213 9214 /** 9215 * Options for system window creation. 9216 * 9217 * @interface SystemWindowOptions 9218 * @syscap SystemCapability.Window.SessionManager 9219 * @systemapi Hide this for inner system use. 9220 * @stagemodelonly 9221 * @since 14 9222 */ 9223 interface SystemWindowOptions { 9224 /** 9225 * Indicates window type. 9226 * 9227 * @type { WindowType } 9228 * @syscap SystemCapability.Window.SessionManager 9229 * @systemapi Hide this for inner system use. 9230 * @stagemodelonly 9231 * @since 14 9232 */ 9233 windowType: WindowType; 9234 } 9235 9236 /** 9237 * Configuration of the window for UI service extension ability. 9238 * 9239 * @interface ExtensionWindowConfig 9240 * @syscap SystemCapability.Window.SessionManager 9241 * @systemapi Hide this for inner system use. 9242 * @stagemodelonly 9243 * @since 14 9244 */ 9245 interface ExtensionWindowConfig { 9246 /** 9247 * Window name. 9248 * 9249 * @type { string } 9250 * @syscap SystemCapability.Window.SessionManager 9251 * @systemapi Hide this for inner system use. 9252 * @stagemodelonly 9253 * @since 14 9254 */ 9255 windowName: string; 9256 9257 /** 9258 * Defines whether the window is a subwindow or a system window. 9259 * 9260 * @type { ExtensionWindowAttribute } 9261 * @syscap SystemCapability.Window.SessionManager 9262 * @systemapi Hide this for inner system use. 9263 * @stagemodelonly 9264 * @since 14 9265 */ 9266 windowAttribute: ExtensionWindowAttribute; 9267 9268 /** 9269 * The position and size of window. 9270 * 9271 * @type { Rect } 9272 * @syscap SystemCapability.Window.SessionManager 9273 * @systemapi Hide this for inner system use. 9274 * @stagemodelonly 9275 * @since 14 9276 */ 9277 windowRect: Rect; 9278 9279 /** 9280 * The options of sub window creation. 9281 * 9282 * @type { ?SubWindowOptions } 9283 * @syscap SystemCapability.Window.SessionManager 9284 * @systemapi Hide this for inner system use. 9285 * @stagemodelonly 9286 * @since 14 9287 */ 9288 subWindowOptions?: SubWindowOptions; 9289 9290 /** 9291 * The options of system window creation. 9292 * 9293 * @type { ?SystemWindowOptions } 9294 * @syscap SystemCapability.Window.SessionManager 9295 * @systemapi Hide this for inner system use. 9296 * @stagemodelonly 9297 * @since 14 9298 */ 9299 systemWindowOptions?: SystemWindowOptions; 9300 } 9301} 9302 9303export default window; 9304