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