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 21/// <reference path="../component/common_ts_ets_api.d.ts"/> 22 23import { AsyncCallback, Callback } from './@ohos.base'; 24import BaseContext from './application/BaseContext'; 25import { LocalStorage } from 'StateManagement'; 26import image from './@ohos.multimedia.image'; 27import rpc from './@ohos.rpc'; 28import dialogRequest from './@ohos.app.ability.dialogRequest'; 29import { UIContext } from './@ohos.arkui.UIContext'; 30 31/** 32 * Window manager. 33 * 34 * @namespace window 35 * @syscap SystemCapability.WindowManager.WindowManager.Core 36 */ 37/** 38 * Window manager. 39 * 40 * @namespace window 41 * @syscap SystemCapability.WindowManager.WindowManager.Core 42 * @crossplatform 43 * @since 10 44 */ 45/** 46 * Window manager. 47 * 48 * @namespace window 49 * @syscap SystemCapability.WindowManager.WindowManager.Core 50 * @crossplatform 51 * @atomicservice 52 * @since 11 53 */ 54declare namespace window { 55 /** 56 * The type of a window. 57 * 58 * @enum { number } 59 * @syscap SystemCapability.WindowManager.WindowManager.Core 60 * @since 7 61 */ 62 enum WindowType { 63 /** 64 * App. 65 * 66 * @syscap SystemCapability.WindowManager.WindowManager.Core 67 * @FAModelOnly 68 * @since 7 69 */ 70 TYPE_APP, 71 /** 72 * System alert. 73 * 74 * @syscap SystemCapability.WindowManager.WindowManager.Core 75 * @since 7 76 * @deprecated since 11 77 */ 78 TYPE_SYSTEM_ALERT, 79 /** 80 * Input method. 81 * 82 * @syscap SystemCapability.WindowManager.WindowManager.Core 83 * @systemapi Hide this for inner system use. 84 * @StageModelOnly 85 * @since 9 86 */ 87 TYPE_INPUT_METHOD, 88 /** 89 * Status bar. 90 * 91 * @syscap SystemCapability.WindowManager.WindowManager.Core 92 * @systemapi Hide this for inner system use. 93 * @StageModelOnly 94 * @since 9 95 */ 96 TYPE_STATUS_BAR, 97 /** 98 * Panel. 99 * 100 * @syscap SystemCapability.WindowManager.WindowManager.Core 101 * @systemapi Hide this for inner system use. 102 * @StageModelOnly 103 * @since 9 104 */ 105 TYPE_PANEL, 106 /** 107 * Keyguard. 108 * 109 * @syscap SystemCapability.WindowManager.WindowManager.Core 110 * @systemapi Hide this for inner system use. 111 * @StageModelOnly 112 * @since 9 113 */ 114 TYPE_KEYGUARD, 115 /** 116 * Volume. 117 * 118 * @syscap SystemCapability.WindowManager.WindowManager.Core 119 * @systemapi Hide this for inner system use. 120 * @StageModelOnly 121 * @since 9 122 */ 123 TYPE_VOLUME_OVERLAY, 124 /** 125 * Navigation bar. 126 * 127 * @syscap SystemCapability.WindowManager.WindowManager.Core 128 * @systemapi Hide this for inner system use. 129 * @StageModelOnly 130 * @since 9 131 */ 132 TYPE_NAVIGATION_BAR, 133 /** 134 * Float. 135 * 136 * @permission ohos.permission.SYSTEM_FLOAT_WINDOW 137 * @syscap SystemCapability.WindowManager.WindowManager.Core 138 * @StageModelOnly 139 * @since 9 140 */ 141 TYPE_FLOAT, 142 /** 143 * Wallpaper. 144 * 145 * @syscap SystemCapability.WindowManager.WindowManager.Core 146 * @systemapi Hide this for inner system use. 147 * @StageModelOnly 148 * @since 9 149 */ 150 TYPE_WALLPAPER, 151 /** 152 * Desktop. 153 * 154 * @syscap SystemCapability.WindowManager.WindowManager.Core 155 * @systemapi Hide this for inner system use. 156 * @StageModelOnly 157 * @since 9 158 */ 159 TYPE_DESKTOP, 160 /** 161 * Recent. 162 * 163 * @syscap SystemCapability.WindowManager.WindowManager.Core 164 * @systemapi Hide this for inner system use. 165 * @StageModelOnly 166 * @since 9 167 */ 168 TYPE_LAUNCHER_RECENT, 169 /** 170 * Dock. 171 * 172 * @syscap SystemCapability.WindowManager.WindowManager.Core 173 * @systemapi Hide this for inner system use. 174 * @StageModelOnly 175 * @since 9 176 */ 177 TYPE_LAUNCHER_DOCK, 178 /** 179 * Voice interaction. 180 * 181 * @syscap SystemCapability.WindowManager.WindowManager.Core 182 * @systemapi Hide this for inner system use. 183 * @StageModelOnly 184 * @since 9 185 */ 186 TYPE_VOICE_INTERACTION, 187 /** 188 * Pointer. 189 * 190 * @syscap SystemCapability.WindowManager.WindowManager.Core 191 * @systemapi Hide this for inner system use. 192 * @StageModelOnly 193 * @since 9 194 */ 195 TYPE_POINTER, 196 /** 197 * Float camera. 198 * 199 * @syscap SystemCapability.WindowManager.WindowManager.Core 200 * @systemapi Hide this for inner system use. 201 * @StageModelOnly 202 * @since 9 203 */ 204 TYPE_FLOAT_CAMERA, 205 /** 206 * Dialog. 207 * 208 * @syscap SystemCapability.WindowManager.WindowManager.Core 209 * @StageModelOnly 210 * @since 10 211 */ 212 TYPE_DIALOG, 213 /** 214 * Screenshot. 215 * 216 * @syscap SystemCapability.WindowManager.WindowManager.Core 217 * @systemapi Hide this for inner system use. 218 * @StageModelOnly 219 * @since 9 220 */ 221 TYPE_SCREENSHOT, 222 /** 223 * System Toast. 224 * 225 * @syscap SystemCapability.WindowManager.WindowManager.Core 226 * @systemapi Hide this for inner system use. 227 * @StageModelOnly 228 * @since 11 229 */ 230 TYPE_SYSTEM_TOAST, 231 /** 232 * Divider. 233 * 234 * @syscap SystemCapability.WindowManager.WindowManager.Core 235 * @systemapi Hide this for inner system use. 236 * @StageModelOnly 237 * @since 11 238 */ 239 TYPE_DIVIDER, 240 /** 241 * Global Search. 242 * 243 * @syscap SystemCapability.WindowManager.WindowManager.Core 244 * @systemapi Hide this for inner system use. 245 * @StageModelOnly 246 * @since 11 247 */ 248 TYPE_GLOBAL_SEARCH 249 } 250 251 /** 252 * Describes the type of avoid area 253 * 254 * @enum { number } 255 * @syscap SystemCapability.WindowManager.WindowManager.Core 256 * @since 7 257 */ 258 /** 259 * Describes the type of avoid area 260 * 261 * @enum { number } 262 * @syscap SystemCapability.WindowManager.WindowManager.Core 263 * @atomicservice 264 * @since 11 265 */ 266 enum AvoidAreaType { 267 /** 268 * Default area of the system 269 * 270 * @syscap SystemCapability.WindowManager.WindowManager.Core 271 * @since 7 272 */ 273 /** 274 * Default area of the system 275 * 276 * @syscap SystemCapability.WindowManager.WindowManager.Core 277 * @atomicservice 278 * @since 11 279 */ 280 TYPE_SYSTEM, 281 282 /** 283 * Notch 284 * 285 * @syscap SystemCapability.WindowManager.WindowManager.Core 286 * @since 7 287 */ 288 /** 289 * Notch 290 * 291 * @syscap SystemCapability.WindowManager.WindowManager.Core 292 * @atomicservice 293 * @since 11 294 */ 295 TYPE_CUTOUT, 296 297 /** 298 * Area for system gesture 299 * 300 * @syscap SystemCapability.WindowManager.WindowManager.Core 301 * @since 9 302 */ 303 /** 304 * Area for system gesture 305 * 306 * @syscap SystemCapability.WindowManager.WindowManager.Core 307 * @atomicservice 308 * @since 11 309 */ 310 TYPE_SYSTEM_GESTURE, 311 312 /** 313 * Area for keyboard 314 * 315 * @syscap SystemCapability.WindowManager.WindowManager.Core 316 * @since 9 317 */ 318 /** 319 * Area for keyboard 320 * 321 * @syscap SystemCapability.WindowManager.WindowManager.Core 322 * @atomicservice 323 * @since 11 324 */ 325 TYPE_KEYBOARD, 326 327 /** 328 * Area for navigation indicator 329 * 330 * @syscap SystemCapability.WindowManager.WindowManager.Core 331 * @atomicservice 332 * @since 11 333 */ 334 TYPE_NAVIGATION_INDICATOR 335 } 336 /** 337 * Describes the window mode of an application 338 * 339 * @enum { number } 340 * @syscap SystemCapability.WindowManager.WindowManager.Core 341 * @systemapi Hide this for inner system use. 342 * @since 7 343 */ 344 enum WindowMode { 345 /** 346 * Undefined mode of the window 347 * 348 * @syscap SystemCapability.WindowManager.WindowManager.Core 349 * @systemapi Hide this for inner system use. 350 * @since 7 351 */ 352 UNDEFINED = 1, 353 /** 354 * Fullscreen mode of the window 355 * 356 * @syscap SystemCapability.WindowManager.WindowManager.Core 357 * @systemapi Hide this for inner system use. 358 * @since 7 359 */ 360 FULLSCREEN, 361 /** 362 * Primary mode of the window 363 * 364 * @syscap SystemCapability.WindowManager.WindowManager.Core 365 * @systemapi Hide this for inner system use. 366 * @since 7 367 */ 368 PRIMARY, 369 /** 370 * Secondary mode of the window 371 * 372 * @syscap SystemCapability.WindowManager.WindowManager.Core 373 * @systemapi Hide this for inner system use. 374 * @since 7 375 */ 376 SECONDARY, 377 /** 378 * Floating mode of the window 379 * 380 * @syscap SystemCapability.WindowManager.WindowManager.Core 381 * @systemapi Hide this for inner system use. 382 * @since 7 383 */ 384 FLOATING 385 } 386 387 /** 388 * Describes the mode of window layout 389 * 390 * @enum { number } 391 * @syscap SystemCapability.WindowManager.WindowManager.Core 392 * @systemapi Hide this for inner system use. 393 * @since 9 394 */ 395 enum WindowLayoutMode { 396 /** 397 * CASCADE 398 * 399 * @syscap SystemCapability.WindowManager.WindowManager.Core 400 * @systemapi Hide this for inner system use. 401 * @since 9 402 */ 403 WINDOW_LAYOUT_MODE_CASCADE, 404 /** 405 * TILE 406 * 407 * @syscap SystemCapability.WindowManager.WindowManager.Core 408 * @systemapi Hide this for inner system use. 409 * @since 9 410 */ 411 WINDOW_LAYOUT_MODE_TILE 412 } 413 414 /** 415 * Describes the window status of an application 416 * 417 * @enum { number } 418 * @syscap SystemCapability.Window.SessionManager 419 * @since 11 420 */ 421 enum WindowStatusType { 422 /** 423 * Undefined status of the window 424 * 425 * @syscap SystemCapability.Window.SessionManager 426 * @since 11 427 */ 428 UNDEFINED = 0, 429 /** 430 * Full screen status of the window 431 * 432 * @syscap SystemCapability.Window.SessionManager 433 * @since 11 434 */ 435 FULL_SCREEN, 436 /** 437 * Maximize status of the window 438 * 439 * @syscap SystemCapability.Window.SessionManager 440 * @since 11 441 */ 442 MAXIMIZE, 443 /** 444 * Minimize status of the window 445 * 446 * @syscap SystemCapability.Window.SessionManager 447 * @since 11 448 */ 449 MINIMIZE, 450 /** 451 * Floating status of the window 452 * 453 * @syscap SystemCapability.Window.SessionManager 454 * @since 11 455 */ 456 FLOATING, 457 /** 458 * Split screen status of the window 459 * 460 * @syscap SystemCapability.Window.SessionManager 461 * @since 11 462 */ 463 SPLIT_SCREEN 464 } 465 466 /** 467 * Properties of status bar and navigation bar, it couldn't update automatically 468 * 469 * @interface SystemBarProperties 470 * @syscap SystemCapability.WindowManager.WindowManager.Core 471 * @since 6 472 */ 473 interface SystemBarProperties { 474 /** 475 * The color of the status bar. 476 * 477 * @syscap SystemCapability.WindowManager.WindowManager.Core 478 * @since 6 479 */ 480 statusBarColor?: string; 481 482 /** 483 * The light icon of the status bar. 484 * 485 * @syscap SystemCapability.WindowManager.WindowManager.Core 486 * @since 7 487 */ 488 isStatusBarLightIcon?: boolean; 489 490 /** 491 * The content color of the status bar 492 * 493 * @syscap SystemCapability.WindowManager.WindowManager.Core 494 * @since 8 495 */ 496 statusBarContentColor?: string; 497 498 /** 499 * The color of the navigation bar. 500 * 501 * @syscap SystemCapability.WindowManager.WindowManager.Core 502 * @since 6 503 */ 504 navigationBarColor?: string; 505 506 /** 507 * The light icon of the navigation bar. 508 * 509 * @syscap SystemCapability.WindowManager.WindowManager.Core 510 * @since 7 511 */ 512 isNavigationBarLightIcon?: boolean; 513 514 /** 515 * The content color of the navigation bar 516 * 517 * @syscap SystemCapability.WindowManager.WindowManager.Core 518 * @since 8 519 */ 520 navigationBarContentColor?: string; 521 } 522 523 /** 524 * System bar tint of region 525 * 526 * @interface SystemBarRegionTint 527 * @syscap SystemCapability.WindowManager.WindowManager.Core 528 * @systemapi Hide this for inner system use. 529 * @since 8 530 */ 531 interface SystemBarRegionTint { 532 /** 533 * System bar type 534 * 535 * @syscap SystemCapability.WindowManager.WindowManager.Core 536 * @systemapi Hide this for inner system use. 537 * @since 8 538 */ 539 type: WindowType; 540 541 /** 542 * The visibility of system bar 543 * 544 * @syscap SystemCapability.WindowManager.WindowManager.Core 545 * @systemapi Hide this for inner system use. 546 * @since 8 547 */ 548 isEnable?: boolean; 549 550 /** 551 * The region of system bar 552 * 553 * @syscap SystemCapability.WindowManager.WindowManager.Core 554 * @systemapi Hide this for inner system use. 555 * @since 8 556 */ 557 region?: Rect; 558 559 /** 560 * The background color of the system bar. 561 * 562 * @syscap SystemCapability.WindowManager.WindowManager.Core 563 * @systemapi Hide this for inner system use. 564 * @since 8 565 */ 566 backgroundColor?: string; 567 568 /** 569 * The content color of the system bar. 570 * 571 * @syscap SystemCapability.WindowManager.WindowManager.Core 572 * @systemapi Hide this for inner system use. 573 * @since 8 574 */ 575 contentColor?: string; 576 } 577 578 /** 579 * System bar tint state for systemui 580 * 581 * @interface SystemBarTintState 582 * @syscap SystemCapability.WindowManager.WindowManager.Core 583 * @systemapi Hide this for inner system use. 584 * @since 8 585 */ 586 interface SystemBarTintState { 587 /** 588 * Id of display 589 * 590 * @syscap SystemCapability.WindowManager.WindowManager.Core 591 * @systemapi Hide this for inner system use. 592 * @since 8 593 */ 594 displayId: number; 595 /** 596 * Region tint of systembar 597 * 598 * @syscap SystemCapability.WindowManager.WindowManager.Core 599 * @systemapi Hide this for inner system use. 600 * @since 8 601 */ 602 regionTint: Array<SystemBarRegionTint>; 603 } 604 605 /** 606 * Rectangle 607 * 608 * @interface Rect 609 * @syscap SystemCapability.WindowManager.WindowManager.Core 610 * @since 7 611 */ 612 /** 613 * Rectangle 614 * 615 * @interface Rect 616 * @syscap SystemCapability.WindowManager.WindowManager.Core 617 * @crossplatform 618 * @since 10 619 */ 620 /** 621 * Rectangle 622 * 623 * @interface Rect 624 * @syscap SystemCapability.WindowManager.WindowManager.Core 625 * @crossplatform 626 * @atomicservice 627 * @since 11 628 */ 629 interface Rect { 630 631 /** 632 * The left of the Rect. 633 * 634 * @syscap SystemCapability.WindowManager.WindowManager.Core 635 * @since 7 636 */ 637 /** 638 * The left of the Rect. 639 * 640 * @syscap SystemCapability.WindowManager.WindowManager.Core 641 * @crossplatform 642 * @since 10 643 */ 644 /** 645 * The left of the Rect. 646 * 647 * @syscap SystemCapability.WindowManager.WindowManager.Core 648 * @crossplatform 649 * @atomicservice 650 * @since 11 651 */ 652 left: number; 653 654 /** 655 * The top of the Rect. 656 * 657 * @syscap SystemCapability.WindowManager.WindowManager.Core 658 * @since 7 659 */ 660 /** 661 * The top of the Rect. 662 * 663 * @syscap SystemCapability.WindowManager.WindowManager.Core 664 * @crossplatform 665 * @since 10 666 */ 667 /** 668 * The top of the Rect. 669 * 670 * @syscap SystemCapability.WindowManager.WindowManager.Core 671 * @crossplatform 672 * @atomicservice 673 * @since 11 674 */ 675 top: number; 676 677 /** 678 * The width of the Rect. 679 * 680 * @syscap SystemCapability.WindowManager.WindowManager.Core 681 * @since 7 682 */ 683 /** 684 * The width of the Rect. 685 * 686 * @syscap SystemCapability.WindowManager.WindowManager.Core 687 * @crossplatform 688 * @since 10 689 */ 690 /** 691 * The width of the Rect. 692 * 693 * @syscap SystemCapability.WindowManager.WindowManager.Core 694 * @crossplatform 695 * @atomicservice 696 * @since 11 697 */ 698 width: number; 699 700 /** 701 * The height of the Rect. 702 * 703 * @syscap SystemCapability.WindowManager.WindowManager.Core 704 * @since 7 705 */ 706 /** 707 * The height of the Rect. 708 * 709 * @syscap SystemCapability.WindowManager.WindowManager.Core 710 * @crossplatform 711 * @since 10 712 */ 713 /** 714 * The height of the Rect. 715 * 716 * @syscap SystemCapability.WindowManager.WindowManager.Core 717 * @crossplatform 718 * @atomicservice 719 * @since 11 720 */ 721 height: number; 722 } 723 724 /** 725 * Avoid area 726 * 727 * @interface AvoidArea 728 * @syscap SystemCapability.WindowManager.WindowManager.Core 729 * @since 7 730 */ 731 /** 732 * Avoid area 733 * 734 * @interface AvoidArea 735 * @syscap SystemCapability.WindowManager.WindowManager.Core 736 * @atomicservice 737 * @since 11 738 */ 739 interface AvoidArea { 740 /** 741 * Whether avoidArea is visible on screen 742 * 743 * @type { boolean } 744 * @syscap SystemCapability.WindowManager.WindowManager.Core 745 * @since 9 746 */ 747 /** 748 * Whether avoidArea is visible on screen 749 * 750 * @type { boolean } 751 * @syscap SystemCapability.WindowManager.WindowManager.Core 752 * @atomicservice 753 * @since 11 754 */ 755 visible: boolean; 756 757 /** 758 * Rectangle on the left of the screen 759 * 760 * @type { Rect } 761 * @syscap SystemCapability.WindowManager.WindowManager.Core 762 * @since 7 763 */ 764 /** 765 * Rectangle on the left of the screen 766 * 767 * @type { Rect } 768 * @syscap SystemCapability.WindowManager.WindowManager.Core 769 * @atomicservice 770 * @since 11 771 */ 772 leftRect: Rect; 773 774 /** 775 * Rectangle on the top of the screen 776 * 777 * @type { Rect } 778 * @syscap SystemCapability.WindowManager.WindowManager.Core 779 * @since 7 780 */ 781 /** 782 * Rectangle on the top of the screen 783 * 784 * @type { Rect } 785 * @syscap SystemCapability.WindowManager.WindowManager.Core 786 * @atomicservice 787 * @since 11 788 */ 789 topRect: Rect; 790 791 /** 792 * Rectangle on the right of the screen 793 * 794 * @type { Rect } 795 * @syscap SystemCapability.WindowManager.WindowManager.Core 796 * @since 7 797 */ 798 /** 799 * Rectangle on the right of the screen 800 * 801 * @type { Rect } 802 * @syscap SystemCapability.WindowManager.WindowManager.Core 803 * @atomicservice 804 * @since 11 805 */ 806 rightRect: Rect; 807 808 /** 809 * Rectangle on the bottom of the screen 810 * 811 * @type { Rect } 812 * @syscap SystemCapability.WindowManager.WindowManager.Core 813 * @since 7 814 */ 815 /** 816 * Rectangle on the bottom of the screen 817 * 818 * @type { Rect } 819 * @syscap SystemCapability.WindowManager.WindowManager.Core 820 * @atomicservice 821 * @since 11 822 */ 823 bottomRect: Rect; 824 } 825 826 /** 827 * Window size 828 * 829 * @interface Size 830 * @syscap SystemCapability.WindowManager.WindowManager.Core 831 * @since 7 832 */ 833 /** 834 * Window size 835 * 836 * @interface Size 837 * @syscap SystemCapability.WindowManager.WindowManager.Core 838 * @crossplatform 839 * @since 10 840 */ 841 /** 842 * Window size 843 * 844 * @interface Size 845 * @syscap SystemCapability.WindowManager.WindowManager.Core 846 * @crossplatform 847 * @atomicservice 848 * @since 11 849 */ 850 interface Size { 851 /** 852 * The width of the window. 853 * 854 * @type { number } 855 * @syscap SystemCapability.WindowManager.WindowManager.Core 856 * @since 7 857 */ 858 /** 859 * The width of the window. 860 * 861 * @type { number } 862 * @syscap SystemCapability.WindowManager.WindowManager.Core 863 * @crossplatform 864 * @since 10 865 */ 866 /** 867 * The width of the window. 868 * 869 * @type { number } 870 * @syscap SystemCapability.WindowManager.WindowManager.Core 871 * @crossplatform 872 * @atomicservice 873 * @since 11 874 */ 875 width: number; 876 877 /** 878 * The height of the window. 879 * 880 * @syscap SystemCapability.WindowManager.WindowManager.Core 881 * @since 7 882 */ 883 /** 884 * The height of the window. 885 * 886 * @type { number } 887 * @syscap SystemCapability.WindowManager.WindowManager.Core 888 * @crossplatform 889 * @since 10 890 */ 891 /** 892 * The height of the window. 893 * 894 * @type { number } 895 * @syscap SystemCapability.WindowManager.WindowManager.Core 896 * @crossplatform 897 * @atomicservice 898 * @since 11 899 */ 900 height: number; 901 } 902 903 /** 904 * Properties of window, it couldn't update automatically 905 * 906 * @interface WindowProperties 907 * @syscap SystemCapability.WindowManager.WindowManager.Core 908 * @since 6 909 */ 910 /** 911 * Properties of window, it couldn't update automatically 912 * 913 * @interface WindowProperties 914 * @syscap SystemCapability.WindowManager.WindowManager.Core 915 * @crossplatform 916 * @since 10 917 */ 918 /** 919 * Properties of window, it couldn't update automatically 920 * 921 * @interface WindowProperties 922 * @syscap SystemCapability.WindowManager.WindowManager.Core 923 * @crossplatform 924 * @atomicservice 925 * @since 11 926 */ 927 interface WindowProperties { 928 /** 929 * The position and size of the window 930 * 931 * @type { Rect } 932 * @syscap SystemCapability.WindowManager.WindowManager.Core 933 * @since 7 934 */ 935 /** 936 * The position and size of the window 937 * 938 * @type { Rect } 939 * @syscap SystemCapability.WindowManager.WindowManager.Core 940 * @crossplatform 941 * @since 10 942 */ 943 /** 944 * The position and size of the window 945 * 946 * @type { Rect } 947 * @syscap SystemCapability.WindowManager.WindowManager.Core 948 * @crossplatform 949 * @atomicservice 950 * @since 11 951 */ 952 windowRect: Rect; 953 954 /** 955 * The position relative to the window and size of drawable area 956 * 957 * @type { Rect } 958 * @syscap SystemCapability.WindowManager.WindowManager.Core 959 * @since 11 960 */ 961 drawableRect: Rect; 962 963 /** 964 * Window type 965 * 966 * @type { WindowType } 967 * @syscap SystemCapability.WindowManager.WindowManager.Core 968 * @since 7 969 */ 970 type: WindowType; 971 972 /** 973 * Whether the window is displayed in full screen mode. The default value is false. 974 * 975 * @type { boolean } 976 * @syscap SystemCapability.WindowManager.WindowManager.Core 977 * @since 6 978 */ 979 isFullScreen: boolean; 980 981 /** 982 * Whether the window layout is in full screen mode(whether the window is immersive). The default value is false. 983 * 984 * @type { boolean } 985 * @syscap SystemCapability.WindowManager.WindowManager.Core 986 * @since 7 987 */ 988 isLayoutFullScreen: boolean; 989 990 /** 991 * Whether the window can gain focus. The default value is true 992 * 993 * @type { boolean } 994 * @syscap SystemCapability.WindowManager.WindowManager.Core 995 * @since 7 996 */ 997 focusable: boolean; 998 999 /** 1000 * Whether the window is touchable. The default value is false 1001 * 1002 * @type { boolean } 1003 * @syscap SystemCapability.WindowManager.WindowManager.Core 1004 * @since 7 1005 */ 1006 touchable: boolean; 1007 1008 /** 1009 * Brightness value of window. 1010 * 1011 * @syscap SystemCapability.WindowManager.WindowManager.Core 1012 * @since 6 1013 */ 1014 /** 1015 * Brightness value of window. 1016 * 1017 * @type { number } 1018 * @syscap SystemCapability.WindowManager.WindowManager.Core 1019 * @crossplatform 1020 * @since 10 1021 */ 1022 /** 1023 * Brightness value of window. 1024 * 1025 * @type { number } 1026 * @syscap SystemCapability.WindowManager.WindowManager.Core 1027 * @crossplatform 1028 * @atomicservice 1029 * @since 11 1030 */ 1031 brightness: number; 1032 1033 /** 1034 * The dimbehind value of window. 1035 * 1036 * @type { number } 1037 * @syscap SystemCapability.WindowManager.WindowManager.Core 1038 * @since 7 1039 * @deprecated since 9 1040 */ 1041 dimBehindValue: number; 1042 1043 /** 1044 * Whether keep screen on. 1045 * 1046 * @syscap SystemCapability.WindowManager.WindowManager.Core 1047 * @since 6 1048 */ 1049 /** 1050 * Whether keep screen on. 1051 * 1052 * @type { boolean } 1053 * @syscap SystemCapability.WindowManager.WindowManager.Core 1054 * @crossplatform 1055 * @since 10 1056 */ 1057 /** 1058 * Whether keep screen on. 1059 * 1060 * @type { boolean } 1061 * @syscap SystemCapability.WindowManager.WindowManager.Core 1062 * @crossplatform 1063 * @atomicservice 1064 * @since 11 1065 */ 1066 isKeepScreenOn: boolean; 1067 1068 /** 1069 * Whether make window in privacy mode or not. 1070 * 1071 * @type { boolean } 1072 * @syscap SystemCapability.WindowManager.WindowManager.Core 1073 * @since 7 1074 */ 1075 isPrivacyMode: boolean; 1076 1077 /** 1078 * Whether is round corner or not. 1079 * 1080 * @type { boolean } 1081 * @syscap SystemCapability.WindowManager.WindowManager.Core 1082 * @since 7 1083 * @deprecated since 9 1084 */ 1085 isRoundCorner: boolean; 1086 1087 /** 1088 * Whether is transparent or not. 1089 * 1090 * @type { boolean } 1091 * @syscap SystemCapability.WindowManager.WindowManager.Core 1092 * @since 7 1093 */ 1094 isTransparent: boolean; 1095 1096 /** 1097 * Window id. 1098 * 1099 * @type { number } 1100 * @syscap SystemCapability.WindowManager.WindowManager.Core 1101 * @since 9 1102 */ 1103 id: number; 1104 } 1105 1106 /** 1107 * Type of allowing the specified of color space. 1108 * 1109 * @enum { number } 1110 * @syscap SystemCapability.WindowManager.WindowManager.Core 1111 * @since 8 1112 */ 1113 /** 1114 * Type of allowing the specified of color space. 1115 * 1116 * @enum { number } 1117 * @syscap SystemCapability.WindowManager.WindowManager.Core 1118 * @crossplatform 1119 * @since 11 1120 */ 1121 enum ColorSpace { 1122 /** 1123 * Default color space. 1124 * 1125 * @syscap SystemCapability.WindowManager.WindowManager.Core 1126 * @since 8 1127 */ 1128 /** 1129 * Default color space. 1130 * 1131 * @syscap SystemCapability.WindowManager.WindowManager.Core 1132 * @crossplatform 1133 * @since 11 1134 */ 1135 DEFAULT, 1136 /** 1137 * Wide gamut color space. The specific wide color gamut depends on thr screen. 1138 * 1139 * @syscap SystemCapability.WindowManager.WindowManager.Core 1140 * @since 8 1141 */ 1142 /** 1143 * Wide gamut color space. The specific wide color gamut depends on thr screen. 1144 * 1145 * @syscap SystemCapability.WindowManager.WindowManager.Core 1146 * @crossplatform 1147 * @since 11 1148 */ 1149 WIDE_GAMUT 1150 } 1151 /** 1152 * Describes the scale Transition Options of window 1153 * 1154 * @interface ScaleOptions 1155 * @syscap SystemCapability.WindowManager.WindowManager.Core 1156 * @systemapi 1157 * @since 9 1158 */ 1159 interface ScaleOptions { 1160 /** 1161 * The scale param of x direction. Default is 1.f 1162 * 1163 * @syscap SystemCapability.WindowManager.WindowManager.Core 1164 * @systemapi 1165 * @since 9 1166 */ 1167 x?: number; 1168 1169 /** 1170 * The scale param of y direction. Default is 1.f 1171 * 1172 * @syscap SystemCapability.WindowManager.WindowManager.Core 1173 * @systemapi 1174 * @since 9 1175 */ 1176 y?: number; 1177 1178 /** 1179 * The scale param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 1180 * 1181 * @syscap SystemCapability.WindowManager.WindowManager.Core 1182 * @systemapi 1183 * @since 9 1184 */ 1185 pivotX?: number; 1186 1187 /** 1188 * The scale param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 1189 * 1190 * @syscap SystemCapability.WindowManager.WindowManager.Core 1191 * @systemapi 1192 * @since 9 1193 */ 1194 pivotY?: number; 1195 } 1196 1197 /** 1198 * Describes the rotate Transition Options of window 1199 * 1200 * @interface RotateOptions 1201 * @syscap SystemCapability.WindowManager.WindowManager.Core 1202 * @systemapi 1203 * @since 9 1204 */ 1205 interface RotateOptions { 1206 /** 1207 * The rotate degree of x direction. Default value is 0.f 1208 * 1209 * @type { ?number } 1210 * @syscap SystemCapability.WindowManager.WindowManager.Core 1211 * @systemapi 1212 * @since 9 1213 */ 1214 x?: number; 1215 1216 /** 1217 * The rotate degree of y direction. Default value is 0.f 1218 * 1219 * @type { ?number } 1220 * @syscap SystemCapability.WindowManager.WindowManager.Core 1221 * @systemapi 1222 * @since 9 1223 */ 1224 y?: number; 1225 1226 /** 1227 * The rotate degree of z direction. Default value is 0.f 1228 * 1229 * @type { ?number } 1230 * @syscap SystemCapability.WindowManager.WindowManager.Core 1231 * @systemapi 1232 * @since 9 1233 */ 1234 z?: number; 1235 1236 /** 1237 * The param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 1238 * 1239 * @type { ?number } 1240 * @syscap SystemCapability.WindowManager.WindowManager.Core 1241 * @systemapi 1242 * @since 9 1243 */ 1244 pivotX?: number; 1245 1246 /** 1247 * The param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 1248 * 1249 * @type { ?number } 1250 * @syscap SystemCapability.WindowManager.WindowManager.Core 1251 * @systemapi 1252 * @since 9 1253 */ 1254 pivotY?: number; 1255 } 1256 1257 /** 1258 * Describes the translate Transition Options of window 1259 * 1260 * @interface TranslateOptions 1261 * @syscap SystemCapability.WindowManager.WindowManager.Core 1262 * @systemapi 1263 * @since 9 1264 */ 1265 interface TranslateOptions { 1266 /** 1267 * The translate pixel param of x direction. Default is 0.f 1268 * 1269 * @type { ?number } 1270 * @syscap SystemCapability.WindowManager.WindowManager.Core 1271 * @systemapi 1272 * @since 9 1273 */ 1274 x?: number; 1275 1276 /** 1277 * The translate pixel param of y direction. Default is 0.f 1278 * 1279 * @type { ?number } 1280 * @syscap SystemCapability.WindowManager.WindowManager.Core 1281 * @systemapi 1282 * @since 9 1283 */ 1284 y?: number; 1285 1286 /** 1287 * The translate pixel param of z direction. Default is 0.f 1288 * 1289 * @type { ?number } 1290 * @syscap SystemCapability.WindowManager.WindowManager.Core 1291 * @systemapi 1292 * @since 9 1293 */ 1294 z?: number; 1295 } 1296 1297 /** 1298 * Transition Context 1299 * 1300 * @interface TransitionContext 1301 * @syscap SystemCapability.WindowManager.WindowManager.Core 1302 * @systemapi 1303 * @since 9 1304 */ 1305 interface TransitionContext { 1306 /** 1307 * The target window with animation 1308 * 1309 * @type { Window } 1310 * @syscap SystemCapability.WindowManager.WindowManager.Core 1311 * @systemapi 1312 * @since 9 1313 */ 1314 toWindow: Window; 1315 1316 /** 1317 * Set complete state of animation transition 1318 * 1319 * @param { boolean } isCompleted - Whether the transition is complete. The value true means that the transition is complete, and false means the opposite. 1320 * @throws { BusinessError } 401 - Parameter error. 1321 * @syscap SystemCapability.WindowManager.WindowManager.Core 1322 * @systemapi 1323 * @since 9 1324 */ 1325 completeTransition(isCompleted: boolean): void; 1326 } 1327 1328 /** 1329 * Transition Controller 1330 * 1331 * @interface TransitionController 1332 * @syscap SystemCapability.WindowManager.WindowManager.Core 1333 * @systemapi 1334 * @since 9 1335 */ 1336 interface TransitionController { 1337 /** 1338 * Animation configuration when showing window 1339 * 1340 * @param { TransitionContext } context - The transition context. 1341 * @throws { BusinessError } 401 - Parameter error. 1342 * @syscap SystemCapability.WindowManager.WindowManager.Core 1343 * @systemapi 1344 * @since 9 1345 */ 1346 animationForShown(context: TransitionContext): void; 1347 /** 1348 * Animation configuration when hiding window 1349 * 1350 * @param { TransitionContext } context - The transition context. 1351 * @throws { BusinessError } 401 - Parameter error. 1352 * @syscap SystemCapability.WindowManager.WindowManager.Core 1353 * @systemapi 1354 * @since 9 1355 */ 1356 animationForHidden(context: TransitionContext): void; 1357 } 1358 1359 /** 1360 * Configuration parameters for window creation. 1361 * 1362 * @interface Configuration 1363 * @syscap SystemCapability.WindowManager.WindowManager.Core 1364 * @since 9 1365 */ 1366 interface Configuration { 1367 /** 1368 * Indicates window id. 1369 * 1370 * @syscap SystemCapability.WindowManager.WindowManager.Core 1371 * @since 9 1372 */ 1373 name: string; 1374 1375 /** 1376 * Indicates window type 1377 * 1378 * @type { WindowType } 1379 * @syscap SystemCapability.WindowManager.WindowManager.Core 1380 * @since 9 1381 */ 1382 windowType: WindowType; 1383 1384 /** 1385 * Indicates window context. 1386 * 1387 * @type { ?BaseContext } 1388 * @syscap SystemCapability.WindowManager.WindowManager.Core 1389 * @since 9 1390 */ 1391 ctx?: BaseContext; 1392 1393 /** 1394 * Indicates display ID. 1395 * 1396 * @type { ?number } 1397 * @syscap SystemCapability.WindowManager.WindowManager.Core 1398 * @since 9 1399 */ 1400 displayId?: number; 1401 1402 /** 1403 * Indicates Parent window id 1404 * 1405 * @type { ?number } 1406 * @syscap SystemCapability.WindowManager.WindowManager.Core 1407 * @since 9 1408 */ 1409 parentId?: number; 1410 } 1411 1412 /** 1413 * Limits of window. 1414 * 1415 * @interface WindowLimits 1416 * @syscap SystemCapability.Window.SessionManager 1417 * @since 11 1418 */ 1419 interface WindowLimits { 1420 1421 /** 1422 * The maximum width of the window. 1423 * 1424 * @type { ?number } 1425 * @syscap SystemCapability.Window.SessionManager 1426 * @since 11 1427 */ 1428 maxWidth?: number; 1429 1430 /** 1431 * The maximum height of the window. 1432 * 1433 * @type { ?number } 1434 * @syscap SystemCapability.Window.SessionManager 1435 * @since 11 1436 */ 1437 maxHeight?: number; 1438 1439 /** 1440 * The minimum width of the window. 1441 * 1442 * @type { ?number } 1443 * @syscap SystemCapability.Window.SessionManager 1444 * @since 11 1445 */ 1446 minWidth?: number; 1447 1448 /** 1449 * The minimum height of the window. 1450 * 1451 * @type { ?number } 1452 * @syscap SystemCapability.Window.SessionManager 1453 * @since 11 1454 */ 1455 minHeight?: number; 1456 } 1457 1458 /** 1459 * Rectangular area of the title buttons relative to the upper right corner of the window. 1460 * 1461 * @interface TitleButtonRect 1462 * @syscap SystemCapability.Window.SessionManager 1463 * @since 11 1464 */ 1465 interface TitleButtonRect { 1466 1467 /** 1468 * The right of the Rect. 1469 * 1470 * @type { number } 1471 * @syscap SystemCapability.Window.SessionManager 1472 * @since 11 1473 */ 1474 right: number; 1475 1476 /** 1477 * The top of the Rect. 1478 * 1479 * @type { number } 1480 * @syscap SystemCapability.Window.SessionManager 1481 * @since 11 1482 */ 1483 top: number; 1484 1485 /** 1486 * The width of the Rect. 1487 * 1488 * @type { number } 1489 * @syscap SystemCapability.Window.SessionManager 1490 * @since 11 1491 */ 1492 width: number; 1493 1494 /** 1495 * The height of the Rect. 1496 * 1497 * @type { number } 1498 * @syscap SystemCapability.Window.SessionManager 1499 * @since 11 1500 */ 1501 height: number; 1502 } 1503 1504 /** 1505 * Create a window with a specific configuration 1506 * 1507 * @param { Configuration } config - Parameters for window creation. 1508 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 1509 * @throws { BusinessError } 201 - Permission verification failed. 1510 * @throws { BusinessError } 401 - Parameter error. 1511 * @throws { BusinessError } 1300001 - Repeated operation. 1512 * @throws { BusinessError } 1300006 - This window context is abnormal. 1513 * @throws { BusinessError } 1300008 - The operation is on invalid display. 1514 * @throws { BusinessError } 1300009 - The parent window is invalid. 1515 * @syscap SystemCapability.WindowManager.WindowManager.Core 1516 * @since 9 1517 */ 1518 function createWindow(config: Configuration, callback: AsyncCallback<Window>): void; 1519 1520 /** 1521 * Create a window with a specific configuration 1522 * 1523 * @param { Configuration } config - Parameters for window creation. 1524 * @returns { Promise<Window> } Promise used to return the window created. 1525 * @throws { BusinessError } 201 - Permission verification failed. 1526 * @throws { BusinessError } 401 - Parameter error. 1527 * @throws { BusinessError } 1300001 - Repeated operation. 1528 * @throws { BusinessError } 1300006 - This window context is abnormal. 1529 * @throws { BusinessError } 1300008 - The operation is on invalid display. 1530 * @throws { BusinessError } 1300009 - The parent window is invalid. 1531 * @syscap SystemCapability.WindowManager.WindowManager.Core 1532 * @since 9 1533 */ 1534 function createWindow(config: Configuration): Promise<Window>; 1535 1536 /** 1537 * Create a sub window with a specific id and type, only support 7. 1538 * 1539 * @param { string } id - Indicates window id. 1540 * @param { WindowType } type - Indicates window type. 1541 * @param { AsyncCallback<Window> } callback - Callback used to return the subwindow created. 1542 * @syscap SystemCapability.WindowManager.WindowManager.Core 1543 * @FAModelOnly 1544 * @since 7 1545 * @deprecated since 9 1546 * @useinstead ohos.window#createWindow 1547 */ 1548 function create(id: string, type: WindowType, callback: AsyncCallback<Window>): void; 1549 1550 /** 1551 * Create a sub window with a specific id and type, only support 7. 1552 * 1553 * @param { string } id - Indicates window id. 1554 * @param { WindowType } type - Indicates window type. 1555 * @returns { Promise<Window> } Promise used to return the subwindow created. 1556 * @syscap SystemCapability.WindowManager.WindowManager.Core 1557 * @FAModelOnly 1558 * @since 7 1559 * @deprecated since 9 1560 * @useinstead ohos.window#createWindow 1561 */ 1562 function create(id: string, type: WindowType): Promise<Window>; 1563 1564 /** 1565 * Create a system or float window with a specific id and type. 1566 * 1567 * @param { BaseContext } ctx - Indicates the context on which the window depends 1568 * @param { string } id - Indicates window id. 1569 * @param { WindowType } type - Indicates window type. 1570 * @returns { Promise<Window> } Promise used to return the window created. 1571 * @syscap SystemCapability.WindowManager.WindowManager.Core 1572 * @since 8 1573 * @deprecated since 9 1574 * @useinstead ohos.window#createWindow 1575 */ 1576 function create(ctx: BaseContext, id: string, type: WindowType): Promise<Window>; 1577 1578 /** 1579 * Create a system or float window with a specific id and type. 1580 * 1581 * @param { BaseContext } ctx - Indicates the context on which the window depends 1582 * @param { string } id - Indicates window id. 1583 * @param { WindowType } type - Indicates window type. 1584 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 1585 * @syscap SystemCapability.WindowManager.WindowManager.Core 1586 * @since 8 1587 * @deprecated since 9 1588 * @useinstead ohos.window#createWindow 1589 */ 1590 function create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback<Window>): void; 1591 1592 /** 1593 * Find the window by id. 1594 * 1595 * @param { string } id - Indicates window id. 1596 * @param { AsyncCallback<Window> } callback - Callback used to return the window found. 1597 * @syscap SystemCapability.WindowManager.WindowManager.Core 1598 * @since 7 1599 * @deprecated since 9 1600 * @useinstead ohos.window#findWindow 1601 */ 1602 function find(id: string, callback: AsyncCallback<Window>): void; 1603 1604 /** 1605 * Find the window by id. 1606 * 1607 * @param { string } id - Indicates window id. 1608 * @returns { Promise<Window> } Window found. 1609 * @syscap SystemCapability.WindowManager.WindowManager.Core 1610 * @since 7 1611 * @deprecated since 9 1612 * @useinstead ohos.window#findWindow 1613 */ 1614 function find(id: string): Promise<Window>; 1615 1616 /** 1617 * Find the window by name. 1618 * 1619 * @param { string } name - Indicates window name. 1620 * @returns { Window } Window found. 1621 * @throws { BusinessError } 401 - Parameter error. 1622 * @throws { BusinessError } 1300002 - This window state is abnormal. 1623 * @syscap SystemCapability.WindowManager.WindowManager.Core 1624 * @since 9 1625 */ 1626 /** 1627 * Find the window by name. 1628 * 1629 * @param { string } name - Indicates window name. 1630 * @returns { Window } Window found. 1631 * @throws { BusinessError } 401 - Parameter error. 1632 * @throws { BusinessError } 1300002 - This window state is abnormal. 1633 * @syscap SystemCapability.WindowManager.WindowManager.Core 1634 * @crossplatform 1635 * @since 10 1636 */ 1637 /** 1638 * Find the window by name. 1639 * 1640 * @param { string } name - Indicates window name. 1641 * @returns { Window } Window found. 1642 * @throws { BusinessError } 401 - Parameter error. 1643 * @throws { BusinessError } 1300002 - This window state is abnormal. 1644 * @syscap SystemCapability.WindowManager.WindowManager.Core 1645 * @crossplatform 1646 * @atomicservice 1647 * @since 11 1648 */ 1649 function findWindow(name: string): Window; 1650 1651 /** 1652 * Get the final show window. 1653 * 1654 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1655 * @syscap SystemCapability.WindowManager.WindowManager.Core 1656 * @FAModelOnly 1657 * @since 6 1658 * @deprecated since 9 1659 * @useinstead ohos.window#getLastWindow 1660 */ 1661 function getTopWindow(callback: AsyncCallback<Window>): void; 1662 1663 /** 1664 * Get the final show window. 1665 * 1666 * @returns { Promise<Window> } Promise used to return the top window obtained. 1667 * @syscap SystemCapability.WindowManager.WindowManager.Core 1668 * @FAModelOnly 1669 * @since 6 1670 * @deprecated since 9 1671 * @useinstead ohos.window#getLastWindow 1672 */ 1673 function getTopWindow(): Promise<Window>; 1674 1675 /** 1676 * Get the final show window. 1677 * 1678 * @param { BaseContext } ctx - Indicates the context on which the window depends 1679 * @returns { Promise<Window> } Promise used to return the top window obtained. 1680 * @syscap SystemCapability.WindowManager.WindowManager.Core 1681 * @since 8 1682 * @deprecated since 9 1683 * @useinstead ohos.window#getLastWindow 1684 */ 1685 function getTopWindow(ctx: BaseContext): Promise<Window>; 1686 1687 /** 1688 * Get the final show window. 1689 * 1690 * @param { BaseContext } ctx - Indicates the context on which the window depends 1691 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1692 * @syscap SystemCapability.WindowManager.WindowManager.Core 1693 * @since 8 1694 * @deprecated since 9 1695 * @useinstead ohos.window#getLastWindow 1696 */ 1697 function getTopWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 1698 1699 /** 1700 * Get the final show window. 1701 * 1702 * @param { BaseContext } ctx - Current application context. 1703 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1704 * @throws { BusinessError } 401 - Parameter error. 1705 * @throws { BusinessError } 1300002 - This window state is abnormal. 1706 * @throws { BusinessError } 1300006 - This window context is abnormal. 1707 * @syscap SystemCapability.WindowManager.WindowManager.Core 1708 * @since 9 1709 */ 1710 /** 1711 * Get the final show window. 1712 * 1713 * @param { BaseContext } ctx - Current application context. 1714 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1715 * @throws { BusinessError } 401 - Parameter error. 1716 * @throws { BusinessError } 1300002 - This window state is abnormal. 1717 * @throws { BusinessError } 1300006 - This window context is abnormal. 1718 * @syscap SystemCapability.WindowManager.WindowManager.Core 1719 * @crossplatform 1720 * @since 10 1721 */ 1722 function getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 1723 1724 /** 1725 * Get the final show window. 1726 * 1727 * @param { BaseContext } ctx - Current application context. 1728 * @returns { Promise<Window> } Promise used to return the top window obtained. 1729 * @throws { BusinessError } 401 - Parameter error. 1730 * @throws { BusinessError } 1300002 - This window state is abnormal. 1731 * @throws { BusinessError } 1300006 - This window context is abnormal. 1732 * @syscap SystemCapability.WindowManager.WindowManager.Core 1733 * @since 9 1734 */ 1735 /** 1736 * Get the final show window. 1737 * 1738 * @param { BaseContext } ctx - Current application context. 1739 * @returns { Promise<Window> } Promise used to return the top window obtained. 1740 * @throws { BusinessError } 401 - Parameter error. 1741 * @throws { BusinessError } 1300002 - This window state is abnormal. 1742 * @throws { BusinessError } 1300006 - This window context is abnormal. 1743 * @syscap SystemCapability.WindowManager.WindowManager.Core 1744 * @crossplatform 1745 * @since 10 1746 */ 1747 function getLastWindow(ctx: BaseContext): Promise<Window>; 1748 1749 /** 1750 * Minimize all app windows. 1751 * 1752 * @param { number } id - ID of the display. 1753 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1754 * @throws { BusinessError } 401 - Parameter error. 1755 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1756 * @syscap SystemCapability.WindowManager.WindowManager.Core 1757 * @systemapi Hide this for inner system use. 1758 * @since 9 1759 */ 1760 function minimizeAll(id: number, callback: AsyncCallback<void>): void; 1761 1762 /** 1763 * Minimize all app windows. 1764 * 1765 * @param { number } id - ID of the display. 1766 * @returns { Promise<void> } Promise that returns no value. 1767 * @throws { BusinessError } 401 - Parameter error. 1768 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1769 * @syscap SystemCapability.WindowManager.WindowManager.Core 1770 * @systemapi Hide this for inner system use. 1771 * @since 9 1772 */ 1773 function minimizeAll(id: number): Promise<void>; 1774 1775 /** 1776 * Toggle shown state for all app windows. Minimize or restore all app windows. 1777 * 1778 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1779 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1780 * @syscap SystemCapability.WindowManager.WindowManager.Core 1781 * @systemapi Hide this for inner system use. 1782 * @since 9 1783 */ 1784 function toggleShownStateForAllAppWindows(callback: AsyncCallback<void>): void; 1785 1786 /** 1787 * Toggle shown state for all app windows. Minimize or restore all app windows. 1788 * 1789 * @returns { Promise<void> } Promise that returns no value. 1790 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1791 * @syscap SystemCapability.WindowManager.WindowManager.Core 1792 * @systemapi Hide this for inner system use. 1793 * @since 9 1794 */ 1795 function toggleShownStateForAllAppWindows(): Promise<void>; 1796 1797 /** 1798 * Set the layout mode of a window. 1799 * 1800 * @param { WindowLayoutMode } mode - The layout mode of a window. 1801 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1802 * @throws { BusinessError } 401 - Parameter error. 1803 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1804 * @syscap SystemCapability.WindowManager.WindowManager.Core 1805 * @systemapi Hide this for inner system use. 1806 * @since 9 1807 */ 1808 function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback<void>): void; 1809 1810 /** 1811 * Set the layout mode of a window. 1812 * 1813 * @param { WindowLayoutMode } mode - The layout mode of a window. 1814 * @returns { Promise<void> } Promise that returns no value. 1815 * @throws { BusinessError } 401 - Parameter error. 1816 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1817 * @syscap SystemCapability.WindowManager.WindowManager.Core 1818 * @systemapi Hide this for inner system use. 1819 * @since 9 1820 */ 1821 function setWindowLayoutMode(mode: WindowLayoutMode): Promise<void>; 1822 1823 /** 1824 * Sets whether to enable gesture navigation. 1825 * 1826 * @param { boolean } enable - Gesture navigation if true, or disable if false. 1827 * @param { AsyncCallback<void> } callback - The callback of setGestureNavigationEnabled. 1828 * @throws { BusinessError } 401 - Parameter error.. 1829 * @throws { BusinessError } 1300002 - This window state is abnormal. 1830 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1831 * @syscap SystemCapability.WindowManager.WindowManager.Core 1832 * @systemapi Hide this for inner system use. 1833 * @since 10 1834 */ 1835 function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback<void>): void; 1836 1837 /** 1838 * Sets whether to enable gesture navigation. 1839 * 1840 * @param { boolean } enable - Gesture navigation if true, or disable if false. 1841 * @returns { Promise<void> } - The promise returned by the function. 1842 * @throws { BusinessError } 401 - Parameter error.. 1843 * @throws { BusinessError } 1300002 - This window state is abnormal. 1844 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1845 * @syscap SystemCapability.WindowManager.WindowManager.Core 1846 * @systemapi Hide this for inner system use. 1847 * @since 10 1848 */ 1849 function setGestureNavigationEnabled(enable: boolean): Promise<void>; 1850 1851 /** 1852 * Set watermark image. 1853 * 1854 * @param { image.PixelMap } pixelMap - Watermark image. 1855 * @param { boolean } enable - Show watermark if true. 1856 * @returns { Promise<void> } - Promise that returns no value. 1857 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1858 * @throws { BusinessError } 401 - Parameter error. 1859 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1860 * @syscap SystemCapability.WindowManager.WindowManager.Core 1861 * @systemapi Hide this for inner system use. 1862 * @since 10 1863 */ 1864 function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise<void>; 1865 1866 /** 1867 * Set watermark image. 1868 * 1869 * @param { image.PixelMap } pixelMap - Watermark image. 1870 * @param { boolean } enable - Show watermark if true. 1871 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkImage. 1872 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1873 * @throws { BusinessError } 401 - Parameter error. 1874 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1875 * @syscap SystemCapability.WindowManager.WindowManager.Core 1876 * @systemapi Hide this for inner system use. 1877 * @since 10 1878 */ 1879 function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCallback<void>): void; 1880 1881 /** 1882 * Shift window focus within the same application. And the window type contains only main window and subwindow. 1883 * 1884 * @param { number } sourceWindowId - Window id which the focus shift from. 1885 * @param { number } targetWindowId - Window id which the focus shift to. 1886 * @returns { Promise<void> } - Promise that returns no value. 1887 * @throws { BusinessError } 401 - Parameter error. 1888 * @throws { BusinessError } 801 - Capability not supported. 1889 * @throws { BusinessError } 1300002 - This window state is abnormal. 1890 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1891 * @throws { BusinessError } 1300004 - Unauthorized operation. 1892 * @syscap SystemCapability.Window.SessionManager 1893 * @since 11 1894 */ 1895 function shiftAppWindowFocus(sourceWindowId: number, targetWindowId: number): Promise<void>; 1896 1897 /** 1898 * Register the callback of systemBarTintChange 1899 * 1900 * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. 1901 * @param { Callback<SystemBarTintState> } callback - Callback used to return the properties of the system bar. 1902 * @throws { BusinessError } 401 - Parameter error. 1903 * @syscap SystemCapability.WindowManager.WindowManager.Core 1904 * @systemapi Hide this for inner system use. 1905 * @since 8 1906 */ 1907 function on(type: 'systemBarTintChange', callback: Callback<SystemBarTintState>): void; 1908 1909 /** 1910 * Unregister the callback of systemBarTintChange 1911 * 1912 * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. 1913 * @param { Callback<SystemBarTintState> } callback - Callback used to return the properties of the system bar. 1914 * @throws { BusinessError } 401 - Parameter error. 1915 * @syscap SystemCapability.WindowManager.WindowManager.Core 1916 * @systemapi Hide this for inner system use. 1917 * @since 8 1918 */ 1919 function off(type: 'systemBarTintChange', callback?: Callback<SystemBarTintState>): void; 1920 1921 /** 1922 * Register the callback for gesture navigation enabled changes. 1923 * 1924 * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. 1925 * @param { Callback<boolean> } callback Callback used to return the result whether gesture navigation enabled or not. 1926 * @throws { BusinessError } 401 - Parameter error.. 1927 * @throws { BusinessError } 1300002 - This window state is abnormal. 1928 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1929 * @syscap SystemCapability.WindowManager.WindowManager.Core 1930 * @systemapi Hide this for inner system use. 1931 * @since 10 1932 */ 1933 function on(type: 'gestureNavigationEnabledChange', callback: Callback<boolean>): void; 1934 1935 /** 1936 * Unregister the callback for gesture navigation enabled changes. 1937 * 1938 * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. 1939 * @param { Callback<boolean> } callback Callback used to return the result whether gesture navigation enabled or not. 1940 * @throws { BusinessError } 401 - Parameter error.. 1941 * @throws { BusinessError } 1300002 - This window state is abnormal. 1942 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1943 * @syscap SystemCapability.WindowManager.WindowManager.Core 1944 * @systemapi Hide this for inner system use. 1945 * @since 10 1946 */ 1947 function off(type: 'gestureNavigationEnabledChange', callback?: Callback<boolean>): void; 1948 1949 /** 1950 * Register the callback for watermark flag change. 1951 * 1952 * @param { 'waterMarkFlagChange' } type the event of watermark flag change. 1953 * @param { Callback<boolean> } callback Callback used to return the result whether watermark flag change or not. 1954 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1955 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1956 * @syscap SystemCapability.WindowManager.WindowManager.Core 1957 * @systemapi Hide this for inner system use. 1958 * @since 10 1959 */ 1960 function on(type: 'waterMarkFlagChange', callback: Callback<boolean>): void; 1961 1962 /** 1963 * Unregister the callback for watermark flag change. 1964 * 1965 * @param { 'waterMarkFlagChange' } type the event of watermark flag change. 1966 * @param { Callback<boolean> } callback Callback used to return the result whether watermark flag change or not. 1967 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1968 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1969 * @syscap SystemCapability.WindowManager.WindowManager.Core 1970 * @systemapi Hide this for inner system use. 1971 * @since 10 1972 */ 1973 function off(type: 'waterMarkFlagChange', callback?: Callback<boolean>): void; 1974 /** 1975 * Display orientation 1976 * 1977 * @enum { number } 1978 * @syscap SystemCapability.WindowManager.WindowManager.Core 1979 * @since 9 1980 */ 1981 /** 1982 * Display orientation 1983 * 1984 * @enum { number } 1985 * @syscap SystemCapability.WindowManager.WindowManager.Core 1986 * @crossplatform 1987 * @since 10 1988 */ 1989 /** 1990 * Display orientation 1991 * 1992 * @enum { number } 1993 * @syscap SystemCapability.WindowManager.WindowManager.Core 1994 * @crossplatform 1995 * @atomicservice 1996 * @since 11 1997 */ 1998 enum Orientation { 1999 /** 2000 * Default value. The direction mode is not clearly defined. It is determined by the system. 2001 * 2002 * @syscap SystemCapability.WindowManager.WindowManager.Core 2003 * @since 9 2004 */ 2005 /** 2006 * Default value. The direction mode is not clearly defined. It is determined by the system. 2007 * 2008 * @syscap SystemCapability.WindowManager.WindowManager.Core 2009 * @crossplatform 2010 * @since 10 2011 */ 2012 UNSPECIFIED = 0, 2013 2014 /** 2015 * Display in portrait orientation. 2016 * 2017 * @syscap SystemCapability.WindowManager.WindowManager.Core 2018 * @since 9 2019 */ 2020 /** 2021 * Display in portrait orientation. 2022 * 2023 * @syscap SystemCapability.WindowManager.WindowManager.Core 2024 * @crossplatform 2025 * @since 10 2026 */ 2027 /** 2028 * Display in portrait orientation. 2029 * 2030 * @syscap SystemCapability.WindowManager.WindowManager.Core 2031 * @crossplatform 2032 * @atomicservice 2033 * @since 11 2034 */ 2035 PORTRAIT = 1, 2036 2037 /** 2038 * Display in landscape orientation. 2039 * 2040 * @syscap SystemCapability.WindowManager.WindowManager.Core 2041 * @since 9 2042 */ 2043 /** 2044 * Display in landscape orientation. 2045 * 2046 * @syscap SystemCapability.WindowManager.WindowManager.Core 2047 * @crossplatform 2048 * @since 10 2049 */ 2050 LANDSCAPE = 2, 2051 2052 /** 2053 * Display in inverted portrait orientation. 2054 * 2055 * @syscap SystemCapability.WindowManager.WindowManager.Core 2056 * @since 9 2057 */ 2058 /** 2059 * Display in inverted portrait orientation. 2060 * 2061 * @syscap SystemCapability.WindowManager.WindowManager.Core 2062 * @crossplatform 2063 * @since 10 2064 */ 2065 PORTRAIT_INVERTED = 3, 2066 2067 /** 2068 * Display in inverted landscape orientation. 2069 * 2070 * @syscap SystemCapability.WindowManager.WindowManager.Core 2071 * @since 9 2072 */ 2073 /** 2074 * Display in inverted landscape orientation. 2075 * 2076 * @syscap SystemCapability.WindowManager.WindowManager.Core 2077 * @crossplatform 2078 * @since 10 2079 */ 2080 LANDSCAPE_INVERTED = 4, 2081 2082 /** 2083 * Follow the rotation of the sensor, ignore auto rotation lock. 2084 * 2085 * @syscap SystemCapability.WindowManager.WindowManager.Core 2086 * @since 9 2087 */ 2088 /** 2089 * Follow the rotation of the sensor, ignore auto rotation lock. 2090 * 2091 * @syscap SystemCapability.WindowManager.WindowManager.Core 2092 * @atomicservice 2093 * @since 11 2094 */ 2095 AUTO_ROTATION = 5, 2096 2097 /** 2098 * Follow the rotation of the sensor, only work in the vertical direction, ignore auto rotation lock. 2099 * 2100 * @syscap SystemCapability.WindowManager.WindowManager.Core 2101 * @since 9 2102 */ 2103 AUTO_ROTATION_PORTRAIT = 6, 2104 2105 /** 2106 * Follow the rotation of the sensor, only work in the horizontal direction, ignore auto rotation lock. 2107 * 2108 * @syscap SystemCapability.WindowManager.WindowManager.Core 2109 * @since 9 2110 */ 2111 AUTO_ROTATION_LANDSCAPE = 7, 2112 2113 /** 2114 * Follow the rotation of the sensor, controlled by auto rotation lock. 2115 * 2116 * @syscap SystemCapability.WindowManager.WindowManager.Core 2117 * @since 9 2118 */ 2119 AUTO_ROTATION_RESTRICTED = 8, 2120 2121 /** 2122 * Follow the rotation of the sensor, only work in the vertical direction, controlled by auto rotation lock. 2123 * 2124 * @syscap SystemCapability.WindowManager.WindowManager.Core 2125 * @since 9 2126 */ 2127 AUTO_ROTATION_PORTRAIT_RESTRICTED = 9, 2128 2129 /** 2130 * Follow the rotation of the sensor, only work in the horizontal direction, controlled by auto rotation lock. 2131 * 2132 * @syscap SystemCapability.WindowManager.WindowManager.Core 2133 * @since 9 2134 */ 2135 AUTO_ROTATION_LANDSCAPE_RESTRICTED = 10, 2136 2137 /** 2138 * Locked mode, keep the same direction as previous one. 2139 * 2140 * @syscap SystemCapability.WindowManager.WindowManager.Core 2141 * @since 9 2142 */ 2143 LOCKED = 11 2144 } 2145 2146 /** 2147 * Type of blur style 2148 * 2149 * @enum { number } 2150 * @syscap SystemCapability.WindowManager.WindowManager.Core 2151 * @systemapi Hide this for inner system use. 2152 * @since 9 2153 */ 2154 enum BlurStyle { 2155 /** 2156 * Close blur. 2157 * 2158 * @syscap SystemCapability.WindowManager.WindowManager.Core 2159 * @systemapi Hide this for inner system use. 2160 * @since 9 2161 */ 2162 OFF, 2163 /** 2164 * Blur style thin. 2165 * 2166 * @syscap SystemCapability.WindowManager.WindowManager.Core 2167 * @systemapi Hide this for inner system use. 2168 * @since 9 2169 */ 2170 THIN, 2171 /** 2172 * Blur style regular. 2173 * 2174 * @syscap SystemCapability.WindowManager.WindowManager.Core 2175 * @systemapi Hide this for inner system use. 2176 * @since 9 2177 */ 2178 REGULAR, 2179 /** 2180 * Blur style thick. 2181 * 2182 * @syscap SystemCapability.WindowManager.WindowManager.Core 2183 * @systemapi Hide this for inner system use. 2184 * @since 9 2185 */ 2186 THICK 2187 } 2188 2189 /** 2190 * Enum for window callback event type 2191 * 2192 * @enum { number } 2193 * @syscap SystemCapability.WindowManager.WindowManager.Core 2194 * @since 10 2195 */ 2196 /** 2197 * Enum for window callback event type 2198 * 2199 * @enum { number } 2200 * @syscap SystemCapability.WindowManager.WindowManager.Core 2201 * @crossplatform 2202 * @atomicservice 2203 * @since 11 2204 */ 2205 enum WindowEventType { 2206 /** 2207 * The value of window event is window show 2208 * 2209 * @syscap SystemCapability.WindowManager.WindowManager.Core 2210 * @since 10 2211 */ 2212 /** 2213 * The value of window event is window show 2214 * 2215 * @syscap SystemCapability.WindowManager.WindowManager.Core 2216 * @crossplatform 2217 * @atomicservice 2218 * @since 11 2219 */ 2220 WINDOW_SHOWN = 1, 2221 /** 2222 * The value of window event is window active 2223 * 2224 * @syscap SystemCapability.WindowManager.WindowManager.Core 2225 * @since 10 2226 */ 2227 /** 2228 * The value of window event is window active 2229 * 2230 * @syscap SystemCapability.WindowManager.WindowManager.Core 2231 * @crossplatform 2232 * @atomicservice 2233 * @since 11 2234 */ 2235 WINDOW_ACTIVE = 2, 2236 /** 2237 * The value of window event is window inactive 2238 * 2239 * @syscap SystemCapability.WindowManager.WindowManager.Core 2240 * @since 10 2241 */ 2242 /** 2243 * The value of window event is window inactive 2244 * 2245 * @syscap SystemCapability.WindowManager.WindowManager.Core 2246 * @crossplatform 2247 * @atomicservice 2248 * @since 11 2249 */ 2250 WINDOW_INACTIVE = 3, 2251 /** 2252 * The value of window event is window hide 2253 * 2254 * @syscap SystemCapability.WindowManager.WindowManager.Core 2255 * @since 10 2256 */ 2257 /** 2258 * The value of window event is window hide 2259 * 2260 * @syscap SystemCapability.WindowManager.WindowManager.Core 2261 * @crossplatform 2262 * @atomicservice 2263 * @since 11 2264 */ 2265 WINDOW_HIDDEN = 4, 2266 /** 2267 * The value of window event is window destroy 2268 * 2269 * @syscap SystemCapability.Window.SessionManager 2270 * @atomicservice 2271 * @since 11 2272 */ 2273 WINDOW_DESTROYED = 7 2274 } 2275 2276 /** 2277 * Specific system bar type. 2278 * 2279 * @syscap SystemCapability.Window.SessionManager 2280 * @atomicservice 2281 * @since 11 2282 */ 2283 type SpecificSystemBar = 'status' | 'navigation' | 'navigationIndicator'; 2284 2285 /** 2286 * Window 2287 * 2288 * @interface Window 2289 * @syscap SystemCapability.WindowManager.WindowManager.Core 2290 * @since 6 2291 */ 2292 /** 2293 * Window 2294 * 2295 * @interface Window 2296 * @syscap SystemCapability.WindowManager.WindowManager.Core 2297 * @crossplatform 2298 * @atomicservice 2299 * @since 11 2300 */ 2301 interface Window { 2302 /** 2303 * Hide window. 2304 * 2305 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2306 * @throws { BusinessError } 1300002 - This window state is abnormal. 2307 * @syscap SystemCapability.WindowManager.WindowManager.Core 2308 * @systemapi Hide this for inner system use. 2309 * @since 7 2310 */ 2311 hide(callback: AsyncCallback<void>): void; 2312 2313 /** 2314 * Hide window. 2315 * 2316 * @returns { Promise<void> } Promise that returns no value. 2317 * @throws { BusinessError } 1300002 - This window state is abnormal. 2318 * @syscap SystemCapability.WindowManager.WindowManager.Core 2319 * @systemapi Hide this for inner system use. 2320 * @since 7 2321 */ 2322 hide(): Promise<void>; 2323 2324 /** 2325 * Hide window with animation. 2326 * 2327 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2328 * @throws { BusinessError } 1300002 - This window state is abnormal. 2329 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2330 * @throws { BusinessError } 1300004 - Unauthorized operation. 2331 * @syscap SystemCapability.WindowManager.WindowManager.Core 2332 * @systemapi 2333 * @since 9 2334 */ 2335 hideWithAnimation(callback: AsyncCallback<void>): void; 2336 2337 /** 2338 * Hide window with animation. 2339 * 2340 * @returns { Promise<void> } Promise that returns no value. 2341 * @throws { BusinessError } 1300002 - This window state is abnormal. 2342 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2343 * @throws { BusinessError } 1300004 - Unauthorized operation. 2344 * @syscap SystemCapability.WindowManager.WindowManager.Core 2345 * @systemapi 2346 * @since 9 2347 */ 2348 hideWithAnimation(): Promise<void>; 2349 2350 /** 2351 * Show window. 2352 * 2353 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2354 * @syscap SystemCapability.WindowManager.WindowManager.Core 2355 * @since 7 2356 * @deprecated since 9 2357 * @useinstead ohos.window.Window#showWindow 2358 */ 2359 show(callback: AsyncCallback<void>): void; 2360 2361 /** 2362 * Show window. 2363 * 2364 * @returns { Promise<void> } Promise that returns no value. 2365 * @syscap SystemCapability.WindowManager.WindowManager.Core 2366 * @since 7 2367 * @deprecated since 9 2368 * @useinstead ohos.window.Window#showWindow 2369 */ 2370 show(): Promise<void>; 2371 2372 /** 2373 * Show window. 2374 * 2375 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2376 * @throws { BusinessError } 1300002 - This window state is abnormal. 2377 * @syscap SystemCapability.WindowManager.WindowManager.Core 2378 * @since 9 2379 */ 2380 /** 2381 * Show window. 2382 * 2383 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2384 * @throws { BusinessError } 1300002 - This window state is abnormal. 2385 * @syscap SystemCapability.WindowManager.WindowManager.Core 2386 * @crossplatform 2387 * @since 10 2388 */ 2389 /** 2390 * Show window. 2391 * 2392 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2393 * @throws { BusinessError } 1300002 - This window state is abnormal. 2394 * @syscap SystemCapability.WindowManager.WindowManager.Core 2395 * @crossplatform 2396 * @atomicservice 2397 * @since 11 2398 */ 2399 showWindow(callback: AsyncCallback<void>): void; 2400 2401 /** 2402 * Show window. 2403 * 2404 * @returns { Promise<void> } Promise that returns no value. 2405 * @throws { BusinessError } 1300002 - This window state is abnormal. 2406 * @syscap SystemCapability.WindowManager.WindowManager.Core 2407 * @since 9 2408 */ 2409 /** 2410 * Show window. 2411 * 2412 * @returns { Promise<void> } Promise that returns no value. 2413 * @throws { BusinessError } 1300002 - This window state is abnormal. 2414 * @syscap SystemCapability.WindowManager.WindowManager.Core 2415 * @crossplatform 2416 * @since 10 2417 */ 2418 /** 2419 * Show window. 2420 * 2421 * @returns { Promise<void> } Promise that returns no value. 2422 * @throws { BusinessError } 1300002 - This window state is abnormal. 2423 * @syscap SystemCapability.WindowManager.WindowManager.Core 2424 * @crossplatform 2425 * @atomicservice 2426 * @since 11 2427 */ 2428 showWindow(): Promise<void>; 2429 2430 /** 2431 * Show window with animation. 2432 * 2433 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2434 * @throws { BusinessError } 1300002 - This window state is abnormal. 2435 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2436 * @throws { BusinessError } 1300004 - Unauthorized operation. 2437 * @syscap SystemCapability.WindowManager.WindowManager.Core 2438 * @systemapi 2439 * @since 9 2440 */ 2441 showWithAnimation(callback: AsyncCallback<void>): void; 2442 2443 /** 2444 * Show window with animation. 2445 * 2446 * @returns { Promise<void> } Promise that returns no value. 2447 * @throws { BusinessError } 1300002 - This window state is abnormal. 2448 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2449 * @throws { BusinessError } 1300004 - Unauthorized operation. 2450 * @syscap SystemCapability.WindowManager.WindowManager.Core 2451 * @systemapi 2452 * @since 9 2453 */ 2454 showWithAnimation(): Promise<void>; 2455 2456 /** 2457 * Destroy the window. 2458 * 2459 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2460 * @syscap SystemCapability.WindowManager.WindowManager.Core 2461 * @since 7 2462 * @deprecated since 9 2463 * @useinstead ohos.window.Window#destroyWindow 2464 */ 2465 destroy(callback: AsyncCallback<void>): void; 2466 2467 /** 2468 * Destroy the window. 2469 * 2470 * @returns { Promise<void> } Promise that returns no value. 2471 * @syscap SystemCapability.WindowManager.WindowManager.Core 2472 * @since 7 2473 * @deprecated since 9 2474 * @useinstead ohos.window.Window#destroyWindow 2475 */ 2476 destroy(): Promise<void>; 2477 2478 /** 2479 * Destroy the window. 2480 * 2481 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2482 * @throws { BusinessError } 1300002 - This window state is abnormal. 2483 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2484 * @syscap SystemCapability.WindowManager.WindowManager.Core 2485 * @since 9 2486 */ 2487 /** 2488 * Destroy the window. 2489 * 2490 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2491 * @throws { BusinessError } 1300002 - This window state is abnormal. 2492 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2493 * @syscap SystemCapability.WindowManager.WindowManager.Core 2494 * @crossplatform 2495 * @since 10 2496 */ 2497 /** 2498 * Destroy the window. 2499 * 2500 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2501 * @throws { BusinessError } 1300002 - This window state is abnormal. 2502 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2503 * @syscap SystemCapability.WindowManager.WindowManager.Core 2504 * @crossplatform 2505 * @atomicservice 2506 * @since 11 2507 */ 2508 destroyWindow(callback: AsyncCallback<void>): void; 2509 2510 /** 2511 * Destroy the window. 2512 * 2513 * @returns { Promise<void> } Promise that returns no value. 2514 * @throws { BusinessError } 1300002 - This window state is abnormal. 2515 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2516 * @syscap SystemCapability.WindowManager.WindowManager.Core 2517 * @since 9 2518 */ 2519 /** 2520 * Destroy the window. 2521 * 2522 * @returns { Promise<void> } Promise that returns no value. 2523 * @throws { BusinessError } 1300002 - This window state is abnormal. 2524 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2525 * @syscap SystemCapability.WindowManager.WindowManager.Core 2526 * @crossplatform 2527 * @since 10 2528 */ 2529 /** 2530 * Destroy the window. 2531 * 2532 * @returns { Promise<void> } Promise that returns no value. 2533 * @throws { BusinessError } 1300002 - This window state is abnormal. 2534 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2535 * @syscap SystemCapability.WindowManager.WindowManager.Core 2536 * @crossplatform 2537 * @atomicservice 2538 * @since 11 2539 */ 2540 destroyWindow(): Promise<void>; 2541 2542 /** 2543 * Set the position of a window. 2544 * 2545 * @param { number } x - Indicate the X-coordinate of the window. 2546 * @param { number } y - Indicate the Y-coordinate of the window. 2547 * @returns { Promise<void> } Promise that returns no value. 2548 * @syscap SystemCapability.WindowManager.WindowManager.Core 2549 * @since 7 2550 * @deprecated since 9 2551 * @useinstead ohos.window.Window#moveWindowTo 2552 */ 2553 moveTo(x: number, y: number): Promise<void>; 2554 2555 /** 2556 * Set the position of a window. 2557 * 2558 * @param { number } x - Indicate the X-coordinate of the window. 2559 * @param { number } y - Indicate the Y-coordinate of the window. 2560 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2561 * @syscap SystemCapability.WindowManager.WindowManager.Core 2562 * @since 7 2563 * @deprecated since 9 2564 * @useinstead ohos.window.Window#moveWindowTo 2565 */ 2566 moveTo(x: number, y: number, callback: AsyncCallback<void>): void; 2567 2568 /** 2569 * Set the position of a window. 2570 * 2571 * @param { number } x - Indicate the X-coordinate of the window. 2572 * @param { number } y - Indicate the Y-coordinate of the window. 2573 * @returns { Promise<void> } Promise that returns no value. 2574 * @throws { BusinessError } 401 - Parameter error. 2575 * @throws { BusinessError } 1300002 - This window state is abnormal. 2576 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2577 * @syscap SystemCapability.WindowManager.WindowManager.Core 2578 * @since 9 2579 */ 2580 /** 2581 * Set the position of a window. 2582 * 2583 * @param { number } x - Indicate the X-coordinate of the window. 2584 * @param { number } y - Indicate the Y-coordinate of the window. 2585 * @returns { Promise<void> } Promise that returns no value. 2586 * @throws { BusinessError } 401 - Parameter error. 2587 * @throws { BusinessError } 1300002 - This window state is abnormal. 2588 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2589 * @syscap SystemCapability.WindowManager.WindowManager.Core 2590 * @crossplatform 2591 * @since 10 2592 */ 2593 /** 2594 * Set the position of a window. 2595 * 2596 * @param { number } x - Indicate the X-coordinate of the window. 2597 * @param { number } y - Indicate the Y-coordinate of the window. 2598 * @returns { Promise<void> } Promise that returns no value. 2599 * @throws { BusinessError } 401 - Parameter error. 2600 * @throws { BusinessError } 1300002 - This window state is abnormal. 2601 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2602 * @syscap SystemCapability.WindowManager.WindowManager.Core 2603 * @crossplatform 2604 * @atomicservice 2605 * @since 11 2606 */ 2607 moveWindowTo(x: number, y: number): Promise<void>; 2608 2609 /** 2610 * Set the position of a window. 2611 * 2612 * @param { number } x - Indicate the X-coordinate of the window. 2613 * @param { number } y - Indicate the Y-coordinate of the window. 2614 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2615 * @throws { BusinessError } 401 - Parameter error. 2616 * @throws { BusinessError } 1300002 - This window state is abnormal. 2617 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2618 * @syscap SystemCapability.WindowManager.WindowManager.Core 2619 * @since 9 2620 */ 2621 /** 2622 * Set the position of a window. 2623 * 2624 * @param { number } x - Indicate the X-coordinate of the window. 2625 * @param { number } y - Indicate the Y-coordinate of the window. 2626 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2627 * @throws { BusinessError } 401 - Parameter error. 2628 * @throws { BusinessError } 1300002 - This window state is abnormal. 2629 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2630 * @syscap SystemCapability.WindowManager.WindowManager.Core 2631 * @crossplatform 2632 * @since 10 2633 */ 2634 /** 2635 * Set the position of a window. 2636 * 2637 * @param { number } x - Indicate the X-coordinate of the window. 2638 * @param { number } y - Indicate the Y-coordinate of the window. 2639 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2640 * @throws { BusinessError } 401 - Parameter error. 2641 * @throws { BusinessError } 1300002 - This window state is abnormal. 2642 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2643 * @syscap SystemCapability.WindowManager.WindowManager.Core 2644 * @crossplatform 2645 * @atomicservice 2646 * @since 11 2647 */ 2648 moveWindowTo(x: number, y: number, callback: AsyncCallback<void>): void; 2649 2650 /** 2651 * Set the size of a window . 2652 * 2653 * @param { number } width - Indicates the width of the window. 2654 * @param { number } height - Indicates the height of the window. 2655 * @returns { Promise<void> } Promise that returns no value. 2656 * @syscap SystemCapability.WindowManager.WindowManager.Core 2657 * @since 7 2658 * @deprecated since 9 2659 * @useinstead ohos.window.Window#resize 2660 */ 2661 resetSize(width: number, height: number): Promise<void>; 2662 2663 /** 2664 * Set the size of a window . 2665 * 2666 * @param { number } width - Indicates the width of the window. 2667 * @param { number } height - Indicates the height of the window. 2668 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2669 * @syscap SystemCapability.WindowManager.WindowManager.Core 2670 * @since 7 2671 * @deprecated since 9 2672 * @useinstead ohos.window.Window#resize 2673 */ 2674 resetSize(width: number, height: number, callback: AsyncCallback<void>): void; 2675 2676 /** 2677 * Set the size of a window . 2678 * 2679 * @param { number } width - Indicates the width of the window. 2680 * @param { number } height - Indicates the height of the window. 2681 * @returns { Promise<void> } Promise that returns no value. 2682 * @throws { BusinessError } 401 - Parameter error. 2683 * @throws { BusinessError } 1300002 - This window state is abnormal. 2684 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2685 * @syscap SystemCapability.WindowManager.WindowManager.Core 2686 * @since 9 2687 */ 2688 /** 2689 * Set the size of a window . 2690 * 2691 * @param { number } width - Indicates the width of the window. 2692 * @param { number } height - Indicates the height of the window. 2693 * @returns { Promise<void> } Promise that returns no value. 2694 * @throws { BusinessError } 401 - Parameter error. 2695 * @throws { BusinessError } 1300002 - This window state is abnormal. 2696 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2697 * @syscap SystemCapability.WindowManager.WindowManager.Core 2698 * @crossplatform 2699 * @since 10 2700 */ 2701 /** 2702 * Set the size of a window . 2703 * 2704 * @param { number } width - Indicates the width of the window. 2705 * @param { number } height - Indicates the height of the window. 2706 * @returns { Promise<void> } Promise that returns no value. 2707 * @throws { BusinessError } 401 - Parameter error. 2708 * @throws { BusinessError } 1300002 - This window state is abnormal. 2709 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2710 * @syscap SystemCapability.WindowManager.WindowManager.Core 2711 * @crossplatform 2712 * @atomicservice 2713 * @since 11 2714 */ 2715 resize(width: number, height: number): Promise<void>; 2716 2717 /** 2718 * Set the size of a window . 2719 * 2720 * @param { number } width - Indicates the width of the window. 2721 * @param { number } height - Indicates the height of the window. 2722 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2723 * @throws { BusinessError } 401 - Parameter error. 2724 * @throws { BusinessError } 1300002 - This window state is abnormal. 2725 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2726 * @syscap SystemCapability.WindowManager.WindowManager.Core 2727 * @since 9 2728 */ 2729 /** 2730 * Set the size of a window . 2731 * 2732 * @param { number } width - Indicates the width of the window. 2733 * @param { number } height - Indicates the height of the window. 2734 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2735 * @throws { BusinessError } 401 - Parameter error. 2736 * @throws { BusinessError } 1300002 - This window state is abnormal. 2737 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2738 * @syscap SystemCapability.WindowManager.WindowManager.Core 2739 * @crossplatform 2740 * @since 10 2741 */ 2742 /** 2743 * Set the size of a window . 2744 * 2745 * @param { number } width - Indicates the width of the window. 2746 * @param { number } height - Indicates the height of the window. 2747 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2748 * @throws { BusinessError } 401 - Parameter error. 2749 * @throws { BusinessError } 1300002 - This window state is abnormal. 2750 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2751 * @syscap SystemCapability.WindowManager.WindowManager.Core 2752 * @crossplatform 2753 * @atomicservice 2754 * @since 11 2755 */ 2756 resize(width: number, height: number, callback: AsyncCallback<void>): void; 2757 2758 /** 2759 * Set the type of a window. 2760 * 2761 * @param { WindowType } type - Indicate the type of a window. 2762 * @returns { Promise<void> } Promise that returns no value. 2763 * @syscap SystemCapability.WindowManager.WindowManager.Core 2764 * @systemapi Hide this for inner system use. 2765 * @since 7 2766 * @deprecated since 9 2767 */ 2768 setWindowType(type: WindowType): Promise<void>; 2769 2770 /** 2771 * Set the type of a window. 2772 * 2773 * @param { WindowType } type - Indicate the type of a window. 2774 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2775 * @syscap SystemCapability.WindowManager.WindowManager.Core 2776 * @systemapi Hide this for inner system use. 2777 * @since 7 2778 * @deprecated since 9 2779 */ 2780 setWindowType(type: WindowType, callback: AsyncCallback<void>): void; 2781 2782 /** 2783 * Set the mode of a window. 2784 * 2785 * @param { WindowMode } mode - Indicate the mode of a window. 2786 * @returns { Promise<void> } Promise that returns no value. 2787 * @throws { BusinessError } 401 - Parameter error. 2788 * @throws { BusinessError } 1300002 - This window state is abnormal. 2789 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2790 * @syscap SystemCapability.WindowManager.WindowManager.Core 2791 * @systemapi Hide this for inner system use. 2792 * @since 9 2793 */ 2794 setWindowMode(mode: WindowMode): Promise<void>; 2795 2796 /** 2797 * Set the mode of a window. 2798 * 2799 * @param { WindowMode } mode - Indicate the mode of a window. 2800 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2801 * @throws { BusinessError } 401 - Parameter error. 2802 * @throws { BusinessError } 1300002 - This window state is abnormal. 2803 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2804 * @syscap SystemCapability.WindowManager.WindowManager.Core 2805 * @systemapi Hide this for inner system use. 2806 * @since 9 2807 */ 2808 setWindowMode(mode: WindowMode, callback: AsyncCallback<void>): void; 2809 2810 /** 2811 * Get the properties of current window 2812 * 2813 * @param { AsyncCallback<WindowProperties> } callback - Callback used to return the window properties. 2814 * @syscap SystemCapability.WindowManager.WindowManager.Core 2815 * @since 6 2816 * @deprecated since 9 2817 * @useinstead ohos.window.Window#getWindowProperties 2818 */ 2819 getProperties(callback: AsyncCallback<WindowProperties>): void; 2820 2821 /** 2822 * Get the properties of current window 2823 * 2824 * @returns { Promise<WindowProperties> } Promise used to return the window properties. 2825 * @syscap SystemCapability.WindowManager.WindowManager.Core 2826 * @since 6 2827 * @deprecated since 9 2828 * @useinstead ohos.window.Window#getWindowProperties 2829 */ 2830 getProperties(): Promise<WindowProperties>; 2831 2832 /** 2833 * Get the properties of current window 2834 * 2835 * @returns { WindowProperties } Return the window properties. 2836 * @throws { BusinessError } 1300002 - This window state is abnormal. 2837 * @syscap SystemCapability.WindowManager.WindowManager.Core 2838 * @since 9 2839 */ 2840 /** 2841 * Get the properties of current window 2842 * 2843 * @returns { WindowProperties } Return the window properties. 2844 * @throws { BusinessError } 1300002 - This window state is abnormal. 2845 * @syscap SystemCapability.WindowManager.WindowManager.Core 2846 * @crossplatform 2847 * @since 10 2848 */ 2849 /** 2850 * Get the properties of current window 2851 * 2852 * @returns { WindowProperties } Return the window properties. 2853 * @throws { BusinessError } 1300002 - This window state is abnormal. 2854 * @syscap SystemCapability.WindowManager.WindowManager.Core 2855 * @crossplatform 2856 * @atomicservice 2857 * @since 11 2858 */ 2859 getWindowProperties(): WindowProperties; 2860 2861 /** 2862 * Get the avoid area 2863 * 2864 * @param { AvoidAreaType } type - Type of the area 2865 * @param { AsyncCallback<AvoidArea> } callback - Callback used to return the area. 2866 * @syscap SystemCapability.WindowManager.WindowManager.Core 2867 * @since 7 2868 * @deprecated since 9 2869 * @useinstead ohos.window.Window#getWindowAvoidArea 2870 */ 2871 getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): void; 2872 2873 /** 2874 * Get the avoid area 2875 * 2876 * @param { AvoidAreaType } type - Type of the area 2877 * @returns { Promise<AvoidArea> } Area where the window cannot be displayed. 2878 * @syscap SystemCapability.WindowManager.WindowManager.Core 2879 * @since 7 2880 * @deprecated since 9 2881 * @useinstead ohos.window.Window#getWindowAvoidArea 2882 */ 2883 getAvoidArea(type: AvoidAreaType): Promise<AvoidArea>; 2884 2885 /** 2886 * Get the avoid area 2887 * 2888 * @param { AvoidAreaType } type - Type of the area 2889 * @returns { AvoidArea } Area where the window cannot be displayed. 2890 * @throws { BusinessError } 401 - Parameter error. 2891 * @throws { BusinessError } 1300002 - This window state is abnormal. 2892 * @syscap SystemCapability.WindowManager.WindowManager.Core 2893 * @since 9 2894 */ 2895 /** 2896 * Get the avoid area 2897 * 2898 * @param { AvoidAreaType } type - Type of the area 2899 * @returns { AvoidArea } Area where the window cannot be displayed. 2900 * @throws { BusinessError } 401 - Parameter error. 2901 * @throws { BusinessError } 1300002 - This window state is abnormal. 2902 * @syscap SystemCapability.WindowManager.WindowManager.Core 2903 * @atomicservice 2904 * @since 11 2905 */ 2906 getWindowAvoidArea(type: AvoidAreaType): AvoidArea; 2907 2908 /** 2909 * Set the flag of the window is shown full screen 2910 * 2911 * @param { boolean } isFullScreen - The flag of the window is shown full screen 2912 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2913 * @syscap SystemCapability.WindowManager.WindowManager.Core 2914 * @since 6 2915 * @deprecated since 9 2916 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2917 */ 2918 setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void; 2919 2920 /** 2921 * Set the flag of the window is shown full screen 2922 * 2923 * @param { boolean } isFullScreen - The flag of the window is shown full screen 2924 * @returns { Promise<void> } Promise that returns no value. 2925 * @syscap SystemCapability.WindowManager.WindowManager.Core 2926 * @since 6 2927 * @deprecated since 9 2928 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2929 */ 2930 setFullScreen(isFullScreen: boolean): Promise<void>; 2931 2932 /** 2933 * Set the property of the window can layout in full screen 2934 * 2935 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2936 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2937 * @syscap SystemCapability.WindowManager.WindowManager.Core 2938 * @since 7 2939 * @deprecated since 9 2940 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 2941 */ 2942 setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 2943 2944 /** 2945 * Set the property of the window can layout in full screen 2946 * 2947 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2948 * @returns { Promise<void> } Promise that returns no value. 2949 * @syscap SystemCapability.WindowManager.WindowManager.Core 2950 * @since 7 2951 * @deprecated since 9 2952 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 2953 */ 2954 setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 2955 2956 /** 2957 * Set the property of the window can layout in full screen 2958 * 2959 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2960 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2961 * @throws { BusinessError } 401 - Parameter error. 2962 * @throws { BusinessError } 1300002 - This window state is abnormal. 2963 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2964 * @syscap SystemCapability.WindowManager.WindowManager.Core 2965 * @since 9 2966 */ 2967 setWindowLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 2968 2969 /** 2970 * Set the property of the window can layout in full screen 2971 * 2972 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2973 * @returns { Promise<void> } Promise that returns no value. 2974 * @throws { BusinessError } 401 - Parameter error. 2975 * @throws { BusinessError } 1300002 - This window state is abnormal. 2976 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2977 * @syscap SystemCapability.WindowManager.WindowManager.Core 2978 * @since 9 2979 */ 2980 setWindowLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 2981 2982 /** 2983 * Set the system bar to have visible. 2984 * 2985 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2986 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2987 * @syscap SystemCapability.WindowManager.WindowManager.Core 2988 * @since 7 2989 * @deprecated since 9 2990 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2991 */ 2992 setSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void; 2993 2994 /** 2995 * Set the system bar to have visible. 2996 * 2997 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2998 * @returns { Promise<void> } Promise that returns no value. 2999 * @syscap SystemCapability.WindowManager.WindowManager.Core 3000 * @since 7 3001 * @deprecated since 9 3002 * @useinstead ohos.window.Window#setWindowSystemBarEnable 3003 */ 3004 setSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void>; 3005 3006 /** 3007 * Set the system bar to have visible. 3008 * 3009 * @param { Array<'status' | 'navigation'> } names - The set of system bar 3010 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3011 * @throws { BusinessError } 401 - Parameter error. 3012 * @throws { BusinessError } 1300002 - This window state is abnormal. 3013 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3014 * @syscap SystemCapability.WindowManager.WindowManager.Core 3015 * @since 9 3016 */ 3017 /** 3018 * Set the system bar to have visible. 3019 * 3020 * @param { Array<'status' | 'navigation'> } names - The set of system bar 3021 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3022 * @throws { BusinessError } 401 - Parameter error. 3023 * @throws { BusinessError } 1300002 - This window state is abnormal. 3024 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3025 * @syscap SystemCapability.WindowManager.WindowManager.Core 3026 * @crossplatform 3027 * @since 10 3028 */ 3029 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void; 3030 3031 /** 3032 * Set the system bar to have visible. 3033 * 3034 * @param { Array<'status' | 'navigation'> } names - The set of system bar 3035 * @returns { Promise<void> } Promise that returns no value. 3036 * @throws { BusinessError } 401 - Parameter error. 3037 * @throws { BusinessError } 1300002 - This window state is abnormal. 3038 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3039 * @syscap SystemCapability.WindowManager.WindowManager.Core 3040 * @since 9 3041 */ 3042 /** 3043 * Set the system bar to have visible. 3044 * 3045 * @param { Array<'status' | 'navigation'> } names - The set of system bar 3046 * @returns { Promise<void> } Promise that returns no value. 3047 * @throws { BusinessError } 401 - Parameter error. 3048 * @throws { BusinessError } 1300002 - This window state is abnormal. 3049 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3050 * @syscap SystemCapability.WindowManager.WindowManager.Core 3051 * @crossplatform 3052 * @since 10 3053 */ 3054 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void>; 3055 3056 /** 3057 * Set specific system bar to have visible. 3058 * 3059 * @param {SpecificSystemBar} name - the set of system bar 3060 * @param {boolean} enable - Show specific system bar if true, or hide specific system bar if false. 3061 * @returns { Promise<void> } Promise that returns no value. 3062 * @throws {BusinessError} 401 - Parameter error. 3063 * @throws {BusinessError} 1300002 - This window state is abnormal. 3064 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 3065 * @syscap SystemCapability.Window.SessionManager 3066 * @atomicservice 3067 * @since 11 3068 */ 3069 setSpecificSystemBarEnabled(name: SpecificSystemBar, enable: boolean): Promise<void>; 3070 3071 /** 3072 * Set the properties of system bar 3073 * 3074 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 3075 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3076 * @syscap SystemCapability.WindowManager.WindowManager.Core 3077 * @since 6 3078 * @deprecated since 9 3079 * @useinstead ohos.window.Window#setWindowSystemBarProperties 3080 */ 3081 setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 3082 3083 /** 3084 * Set the properties of system bar 3085 * 3086 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 3087 * @returns { Promise<void> } Promise that returns no value. 3088 * @syscap SystemCapability.WindowManager.WindowManager.Core 3089 * @since 6 3090 * @deprecated since 9 3091 * @useinstead ohos.window.Window#setWindowSystemBarProperties 3092 */ 3093 setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 3094 3095 /** 3096 * Set the properties of system bar 3097 * 3098 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 3099 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3100 * @throws { BusinessError } 401 - Parameter error. 3101 * @throws { BusinessError } 801 - Capability not supported. 3102 * @throws { BusinessError } 1300002 - This window state is abnormal. 3103 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3104 * @syscap SystemCapability.WindowManager.WindowManager.Core 3105 * @since 9 3106 */ 3107 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 3108 3109 /** 3110 * Set the properties of system bar 3111 * 3112 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 3113 * @returns { Promise<void> } Promise that returns no value. 3114 * @throws { BusinessError } 401 - Parameter error. 3115 * @throws { BusinessError } 801 - Capability not supported. 3116 * @throws { BusinessError } 1300002 - This window state is abnormal. 3117 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3118 * @syscap SystemCapability.WindowManager.WindowManager.Core 3119 * @since 9 3120 */ 3121 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 3122 3123 /** 3124 * Set the preferred orientation config of the window 3125 * 3126 * @param { Orientation } orientation - The orientation config of the window 3127 * @returns { Promise<void> } Promise that returns no value. 3128 * @throws { BusinessError } 401 - Parameter error. 3129 * @throws { BusinessError } 1300002 - This window state is abnormal. 3130 * @syscap SystemCapability.WindowManager.WindowManager.Core 3131 * @since 9 3132 */ 3133 /** 3134 * Set the preferred orientation config of the window 3135 * 3136 * @param { Orientation } orientation - The orientation config of the window 3137 * @returns { Promise<void> } Promise that returns no value. 3138 * @throws { BusinessError } 401 - Parameter error. 3139 * @throws { BusinessError } 1300002 - This window state is abnormal. 3140 * @syscap SystemCapability.WindowManager.WindowManager.Core 3141 * @crossplatform 3142 * @since 10 3143 */ 3144 /** 3145 * Set the preferred orientation config of the window 3146 * 3147 * @param { Orientation } orientation - The orientation config of the window 3148 * @returns { Promise<void> } Promise that returns no value. 3149 * @throws { BusinessError } 401 - Parameter error. 3150 * @throws { BusinessError } 1300002 - This window state is abnormal. 3151 * @syscap SystemCapability.WindowManager.WindowManager.Core 3152 * @crossplatform 3153 * @atomicservice 3154 * @since 11 3155 */ 3156 setPreferredOrientation(orientation: Orientation): Promise<void>; 3157 3158 /** 3159 * Set the preferred orientation config of the window 3160 * 3161 * @param { Orientation } orientation - The orientation config of the window 3162 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3163 * @throws { BusinessError } 401 - Parameter error. 3164 * @throws { BusinessError } 1300002 - This window state is abnormal. 3165 * @syscap SystemCapability.WindowManager.WindowManager.Core 3166 * @since 9 3167 */ 3168 /** 3169 * Set the preferred orientation config of the window 3170 * 3171 * @param { Orientation } orientation - The orientation config of the window 3172 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3173 * @throws { BusinessError } 401 - Parameter error. 3174 * @throws { BusinessError } 1300002 - This window state is abnormal. 3175 * @syscap SystemCapability.WindowManager.WindowManager.Core 3176 * @crossplatform 3177 * @since 10 3178 */ 3179 /** 3180 * Set the preferred orientation config of the window 3181 * 3182 * @param { Orientation } orientation - The orientation config of the window 3183 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3184 * @throws { BusinessError } 401 - Parameter error. 3185 * @throws { BusinessError } 1300002 - This window state is abnormal. 3186 * @syscap SystemCapability.WindowManager.WindowManager.Core 3187 * @crossplatform 3188 * @atomicservice 3189 * @since 11 3190 */ 3191 setPreferredOrientation(orientation: Orientation, callback: AsyncCallback<void>): void; 3192 3193 /** 3194 * Loads content 3195 * 3196 * @param { string } path - Path of the page to which the content will be loaded 3197 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 3198 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3199 * @throws { BusinessError } 401 - Parameter error. 3200 * @throws { BusinessError } 1300002 - This window state is abnormal. 3201 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3202 * @syscap SystemCapability.WindowManager.WindowManager.Core 3203 * @StageModelOnly 3204 * @since 9 3205 */ 3206 /** 3207 * Loads content 3208 * 3209 * @param { string } path - Path of the page to which the content will be loaded 3210 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 3211 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3212 * @throws { BusinessError } 401 - Parameter error. 3213 * @throws { BusinessError } 1300002 - This window state is abnormal. 3214 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3215 * @syscap SystemCapability.WindowManager.WindowManager.Core 3216 * @StageModelOnly 3217 * @crossplatform 3218 * @since 10 3219 */ 3220 /** 3221 * Loads content 3222 * 3223 * @param { string } path - Path of the page to which the content will be loaded 3224 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 3225 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3226 * @throws { BusinessError } 401 - Parameter error. 3227 * @throws { BusinessError } 1300002 - This window state is abnormal. 3228 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3229 * @syscap SystemCapability.WindowManager.WindowManager.Core 3230 * @StageModelOnly 3231 * @crossplatform 3232 * @atomicservice 3233 * @since 11 3234 */ 3235 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 3236 3237 /** 3238 * Loads content 3239 * 3240 * @param { string } path - Path of the page to which the content will be loaded 3241 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 3242 * @returns { Promise<void> } Promise that returns no value. 3243 * @throws { BusinessError } 401 - Parameter error. 3244 * @throws { BusinessError } 1300002 - This window state is abnormal. 3245 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3246 * @syscap SystemCapability.WindowManager.WindowManager.Core 3247 * @StageModelOnly 3248 * @since 9 3249 */ 3250 /** 3251 * Loads content 3252 * 3253 * @param { string } path - Path of the page to which the content will be loaded 3254 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 3255 * @returns { Promise<void> } Promise that returns no value. 3256 * @throws { BusinessError } 401 - Parameter error. 3257 * @throws { BusinessError } 1300002 - This window state is abnormal. 3258 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3259 * @syscap SystemCapability.WindowManager.WindowManager.Core 3260 * @StageModelOnly 3261 * @crossplatform 3262 * @since 10 3263 */ 3264 /** 3265 * Loads content 3266 * 3267 * @param { string } path - Path of the page to which the content will be loaded 3268 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 3269 * @returns { Promise<void> } Promise that returns no value. 3270 * @throws { BusinessError } 401 - Parameter error. 3271 * @throws { BusinessError } 1300002 - This window state is abnormal. 3272 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3273 * @syscap SystemCapability.WindowManager.WindowManager.Core 3274 * @StageModelOnly 3275 * @crossplatform 3276 * @atomicservice 3277 * @since 11 3278 */ 3279 loadContent(path: string, storage: LocalStorage): Promise<void>; 3280 3281 /** 3282 * Loads content 3283 * 3284 * @param { string } path - Path of the page to which the content will be loaded 3285 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3286 * @syscap SystemCapability.WindowManager.WindowManager.Core 3287 * @since 7 3288 * @deprecated since 9 3289 * @useinstead ohos.window.Window#setUIContent 3290 */ 3291 loadContent(path: string, callback: AsyncCallback<void>): void; 3292 3293 /** 3294 * Loads content 3295 * 3296 * @param { string } path - Path of the page to which the content will be loaded 3297 * @returns { Promise<void> } Promise that returns no value. 3298 * @syscap SystemCapability.WindowManager.WindowManager.Core 3299 * @since 7 3300 * @deprecated since 9 3301 * @useinstead ohos.window.Window#setUIContent 3302 */ 3303 loadContent(path: string): Promise<void>; 3304 3305 /** 3306 * Get the UIContext associate with the window content. 3307 * 3308 * @returns { UIContext } the object of UIContext. 3309 * @throws { BusinessError } 401 - If param is invalid 3310 * @throws { BusinessError } 1300002 - This window state is abnormal. 3311 * @syscap SystemCapability.WindowManager.WindowManager.Core 3312 * @stagemodelonly 3313 * @crossplatform 3314 * @since 10 3315 */ 3316 /** 3317 * Get the UIContext associate with the window content. 3318 * 3319 * @returns { UIContext } the object of UIContext. 3320 * @throws { BusinessError } 401 - If param is invalid 3321 * @throws { BusinessError } 1300002 - This window state is abnormal. 3322 * @syscap SystemCapability.WindowManager.WindowManager.Core 3323 * @stagemodelonly 3324 * @crossplatform 3325 * @atomicservice 3326 * @since 11 3327 */ 3328 getUIContext() : UIContext; 3329 3330 /** 3331 * Loads content 3332 * 3333 * @param { string } path - Path of the page to which the content will be loaded 3334 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3335 * @throws { BusinessError } 401 - Parameter error. 3336 * @throws { BusinessError } 1300002 - This window state is abnormal. 3337 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3338 * @syscap SystemCapability.WindowManager.WindowManager.Core 3339 * @since 9 3340 */ 3341 /** 3342 * Loads content 3343 * 3344 * @param { string } path - Path of the page to which the content will be loaded 3345 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3346 * @throws { BusinessError } 401 - Parameter error. 3347 * @throws { BusinessError } 1300002 - This window state is abnormal. 3348 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3349 * @syscap SystemCapability.WindowManager.WindowManager.Core 3350 * @crossplatform 3351 * @since 10 3352 */ 3353 /** 3354 * Loads content 3355 * 3356 * @param { string } path - Path of the page to which the content will be loaded 3357 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3358 * @throws { BusinessError } 401 - Parameter error. 3359 * @throws { BusinessError } 1300002 - This window state is abnormal. 3360 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3361 * @syscap SystemCapability.WindowManager.WindowManager.Core 3362 * @crossplatform 3363 * @atomicservice 3364 * @since 11 3365 */ 3366 setUIContent(path: string, callback: AsyncCallback<void>): void; 3367 3368 /** 3369 * Loads content 3370 * 3371 * @param { string } path - Path of the page to which the content will be loaded 3372 * @returns { Promise<void> } Promise that returns no value. 3373 * @throws { BusinessError } 401 - Parameter error. 3374 * @throws { BusinessError } 1300002 - This window state is abnormal. 3375 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3376 * @syscap SystemCapability.WindowManager.WindowManager.Core 3377 * @since 9 3378 */ 3379 /** 3380 * Loads content 3381 * 3382 * @param { string } path - Path of the page to which the content will be loaded 3383 * @returns { Promise<void> } Promise that returns no value. 3384 * @throws { BusinessError } 401 - Parameter error. 3385 * @throws { BusinessError } 1300002 - This window state is abnormal. 3386 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3387 * @syscap SystemCapability.WindowManager.WindowManager.Core 3388 * @crossplatform 3389 * @since 10 3390 */ 3391 /** 3392 * Loads content 3393 * 3394 * @param { string } path - Path of the page to which the content will be loaded 3395 * @returns { Promise<void> } Promise that returns no value. 3396 * @throws { BusinessError } 401 - Parameter error. 3397 * @throws { BusinessError } 1300002 - This window state is abnormal. 3398 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3399 * @syscap SystemCapability.WindowManager.WindowManager.Core 3400 * @crossplatform 3401 * @atomicservice 3402 * @since 11 3403 */ 3404 setUIContent(path: string): Promise<void>; 3405 3406 /** 3407 * Loads content by named router 3408 * 3409 * @param { string } name - name of the page to which the content will be loaded. 3410 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 3411 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3412 * @throws { BusinessError } 401 - Parameter error. 3413 * @throws { BusinessError } 1300002 - This window state is abnormal. 3414 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3415 * @syscap SystemCapability.WindowManager.WindowManager.Core 3416 * @stagemodelonly 3417 * @crossplatform 3418 * @atomicservice 3419 * @since 11 3420 */ 3421 loadContentByName(name: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 3422 3423 /** 3424 * Loads content by named router 3425 * 3426 * @param { string } name - name of the page to which the content will be loaded. 3427 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3428 * @throws { BusinessError } 401 - Parameter error. 3429 * @throws { BusinessError } 1300002 - This window state is abnormal. 3430 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3431 * @syscap SystemCapability.WindowManager.WindowManager.Core 3432 * @stagemodelonly 3433 * @crossplatform 3434 * @atomicservice 3435 * @since 11 3436 */ 3437 loadContentByName(name: string, callback: AsyncCallback<void>): void; 3438 3439 /** 3440 * Loads content by named router 3441 * 3442 * @param { string } name - name of the page to which the content will be loaded. 3443 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 3444 * @returns { Promise<void> } Promise that returns no value. 3445 * @throws { BusinessError } 401 - Parameter error. 3446 * @throws { BusinessError } 1300002 - This window state is abnormal. 3447 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3448 * @syscap SystemCapability.WindowManager.WindowManager.Core 3449 * @stagemodelonly 3450 * @crossplatform 3451 * @atomicservice 3452 * @since 11 3453 */ 3454 loadContentByName(name: string, storage?: LocalStorage): Promise<void>; 3455 3456 /** 3457 * Checks whether the window is displayed 3458 * 3459 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 3460 * @syscap SystemCapability.WindowManager.WindowManager.Core 3461 * @since 7 3462 * @deprecated since 9 3463 * @useinstead ohos.window.Window#isWindowShowing 3464 */ 3465 isShowing(callback: AsyncCallback<boolean>): void; 3466 3467 /** 3468 * Checks whether the window is displayed 3469 * 3470 * @returns { Promise<boolean> } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 3471 * @syscap SystemCapability.WindowManager.WindowManager.Core 3472 * @since 7 3473 * @deprecated since 9 3474 * @useinstead ohos.window.Window#isWindowShowing 3475 */ 3476 isShowing(): Promise<boolean>; 3477 3478 /** 3479 * Checks whether the window is displayed 3480 * 3481 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 3482 * @throws { BusinessError } 1300002 - This window state is abnormal. 3483 * @syscap SystemCapability.WindowManager.WindowManager.Core 3484 * @since 9 3485 */ 3486 /** 3487 * Checks whether the window is displayed 3488 * 3489 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 3490 * @throws { BusinessError } 1300002 - This window state is abnormal. 3491 * @syscap SystemCapability.WindowManager.WindowManager.Core 3492 * @crossplatform 3493 * @since 10 3494 */ 3495 /** 3496 * Checks whether the window is displayed 3497 * 3498 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 3499 * @throws { BusinessError } 1300002 - This window state is abnormal. 3500 * @syscap SystemCapability.WindowManager.WindowManager.Core 3501 * @crossplatform 3502 * @atomicservice 3503 * @since 11 3504 */ 3505 isWindowShowing(): boolean; 3506 3507 /** 3508 * Register the callback of windowSizeChange 3509 * 3510 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 3511 * @param { Callback<Size> } callback - Callback used to return the window size. 3512 * @throws { BusinessError } 401 - Parameter error. 3513 * @syscap SystemCapability.WindowManager.WindowManager.Core 3514 * @since 7 3515 */ 3516 /** 3517 * Register the callback of windowSizeChange 3518 * 3519 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 3520 * @param { Callback<Size> } callback - Callback used to return the window size. 3521 * @throws { BusinessError } 401 - Parameter error. 3522 * @syscap SystemCapability.WindowManager.WindowManager.Core 3523 * @atomicservice 3524 * @since 11 3525 */ 3526 on(type: 'windowSizeChange', callback: Callback<Size>): void; 3527 3528 /** 3529 * Unregister the callback of windowSizeChange 3530 * 3531 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 3532 * @param { Callback<Size> } callback - Callback used to return the window size. 3533 * @throws { BusinessError } 401 - Parameter error. 3534 * @syscap SystemCapability.WindowManager.WindowManager.Core 3535 * @since 7 3536 */ 3537 /** 3538 * Unregister the callback of windowSizeChange 3539 * 3540 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 3541 * @param { Callback<Size> } callback - Callback used to return the window size. 3542 * @throws { BusinessError } 401 - Parameter error. 3543 * @syscap SystemCapability.WindowManager.WindowManager.Core 3544 * @atomicservice 3545 * @since 11 3546 */ 3547 off(type: 'windowSizeChange', callback?: Callback<Size>): void; 3548 3549 /** 3550 * Register the callback of systemAvoidAreaChange 3551 * 3552 * @param { 'systemAvoidAreaChange' } type - The value is fixed at 'systemAvoidAreaChange', indicating the event of changes to the avoid area. 3553 * @param { Callback<AvoidArea> } callback - Callback used to return the area. 3554 * @syscap SystemCapability.WindowManager.WindowManager.Core 3555 * @since 7 3556 * @deprecated since 9 3557 * @useinstead ohos.window.Window#on_avoidAreaChange 3558 */ 3559 on(type: 'systemAvoidAreaChange', callback: Callback<AvoidArea>): void; 3560 3561 /** 3562 * Unregister the callback of systemAvoidAreaChange 3563 * 3564 * @param { 'systemAvoidAreaChange' } type - The value is fixed at 'systemAvoidAreaChange', indicating the event of changes to the avoid area. 3565 * @param { Callback<AvoidArea> } callback - Callback used to return the area. 3566 * @syscap SystemCapability.WindowManager.WindowManager.Core 3567 * @since 7 3568 * @deprecated since 9 3569 * @useinstead ohos.window.Window#off_avoidAreaChange 3570 */ 3571 off(type: 'systemAvoidAreaChange', callback?: Callback<AvoidArea>): void; 3572 3573 /** 3574 * Register the callback of avoidAreaChange 3575 * 3576 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 3577 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 3578 * @throws { BusinessError } 401 - Parameter error. 3579 * @syscap SystemCapability.WindowManager.WindowManager.Core 3580 * @since 9 3581 */ 3582 /** 3583 * Register the callback of avoidAreaChange 3584 * 3585 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 3586 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 3587 * @throws { BusinessError } 401 - Parameter error. 3588 * @syscap SystemCapability.WindowManager.WindowManager.Core 3589 * @atomicservice 3590 * @since 11 3591 */ 3592 on(type: 'avoidAreaChange', callback: Callback<{ type: AvoidAreaType, area: AvoidArea }>): void; 3593 3594 /** 3595 * Unregister the callback of avoidAreaChange 3596 * 3597 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 3598 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 3599 * @throws { BusinessError } 401 - Parameter error. 3600 * @syscap SystemCapability.WindowManager.WindowManager.Core 3601 * @since 9 3602 */ 3603 /** 3604 * Unregister the callback of avoidAreaChange 3605 * 3606 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 3607 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 3608 * @throws { BusinessError } 401 - Parameter error. 3609 * @syscap SystemCapability.WindowManager.WindowManager.Core 3610 * @atomicservice 3611 * @since 11 3612 */ 3613 off(type: 'avoidAreaChange', callback?: Callback<{ type: AvoidAreaType, area: AvoidArea }>): void; 3614 3615 /** 3616 * Register the callback of keyboardHeightChange 3617 * 3618 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 3619 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 3620 * @throws { BusinessError } 401 - Parameter error. 3621 * @syscap SystemCapability.WindowManager.WindowManager.Core 3622 * @since 7 3623 */ 3624 on(type: 'keyboardHeightChange', callback: Callback<number>): void; 3625 3626 /** 3627 * Unregister the callback of keyboardHeightChange 3628 * 3629 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 3630 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 3631 * @throws { BusinessError } 401 - Parameter error. 3632 * @syscap SystemCapability.WindowManager.WindowManager.Core 3633 * @since 7 3634 */ 3635 off(type: 'keyboardHeightChange', callback?: Callback<number>): void; 3636 3637 /** 3638 * Touch outside callback on. 3639 * 3640 * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. 3641 * @param { Callback<void> } callback - Callback used to return the click event outside this window. 3642 * @throws { BusinessError } 401 - Parameter error. 3643 * @syscap SystemCapability.WindowManager.WindowManager.Core 3644 * @atomicservice 3645 * @since 11 3646 */ 3647 on(type: 'touchOutside', callback: Callback<void>): void; 3648 3649 /** 3650 * Touch outside callback off. 3651 * 3652 * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. 3653 * @param { Callback<void> } callback - Callback used to return the click event outside this window. 3654 * @throws { BusinessError } 401 - Parameter error. 3655 * @syscap SystemCapability.WindowManager.WindowManager.Core 3656 * @atomicservice 3657 * @since 11 3658 */ 3659 off(type: 'touchOutside', callback?: Callback<void>): void; 3660 3661 /** 3662 * Window visibility change callback on. 3663 * 3664 * @param { 'windowVisibilityChange' } type - The value is fixed at 'windowVisibilityChange', indicating the window visibility change. 3665 * @param { Callback<boolean> } callback - Callback used to notify the window visibility change. 3666 * @throws { BusinessError } 401 - Parameter error. 3667 * @throws { BusinessError } 801 - Capability not supported on this device. 3668 * @throws { BusinessError } 1300002 - This window state is abnormal. 3669 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3670 * @syscap SystemCapability.Window.SessionManager 3671 * @since 11 3672 */ 3673 on(type: 'windowVisibilityChange', callback: Callback<boolean>): void; 3674 3675 /** 3676 * Window visibility change callback off. 3677 * 3678 * @param { 'windowVisibilityChange' } type - The value is fixed at 'windowVisibilityChange', indicating the window visibility change. 3679 * @param { Callback<boolean> } callback - Callback used to notify the window visibility change. 3680 * @throws { BusinessError } 401 - Parameter error. 3681 * @throws { BusinessError } 801 - Capability not supported on this device. 3682 * @throws { BusinessError } 1300002 - This window state is abnormal. 3683 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3684 * @syscap SystemCapability.Window.SessionManager 3685 * @since 11 3686 */ 3687 off(type: 'windowVisibilityChange', callback?: Callback<boolean>): void; 3688 3689 /** 3690 * Register the callback of screenshot, only the focused window called back 3691 * 3692 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 3693 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 3694 * @throws { BusinessError } 401 - Parameter error. 3695 * @syscap SystemCapability.WindowManager.WindowManager.Core 3696 * @since 9 3697 */ 3698 on(type: 'screenshot', callback: Callback<void>): void; 3699 3700 /** 3701 * Unregister the callback of screenshot 3702 * 3703 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 3704 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 3705 * @throws { BusinessError } 401 - Parameter error. 3706 * @syscap SystemCapability.WindowManager.WindowManager.Core 3707 * @since 9 3708 */ 3709 off(type: 'screenshot', callback?: Callback<void>): void; 3710 3711 /** 3712 * Register the callback of dialogTargetTouch 3713 * 3714 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', indicating the click event of the target window in the modal window mode. 3715 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 3716 * @throws { BusinessError } 401 - Parameter error. 3717 * @syscap SystemCapability.WindowManager.WindowManager.Core 3718 * @since 10 3719 */ 3720 on(type: 'dialogTargetTouch', callback: Callback<void>): void; 3721 3722 /** 3723 * Unregister the callback of dialogTargetTouch 3724 * 3725 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', 3726 * indicating the click event of the target window in the modal window mode. 3727 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 3728 * @throws { BusinessError } 401 - Parameter error. 3729 * @syscap SystemCapability.WindowManager.WindowManager.Core 3730 * @since 10 3731 */ 3732 off(type: 'dialogTargetTouch', callback?: Callback<void>): void; 3733 3734 /** 3735 * Register the callback of windowEvent 3736 * 3737 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 3738 * @param { Callback<WindowEventType> } callback - the callback of window event 3739 * @throws { BusinessError } 401 - Parameter error. 3740 * @syscap SystemCapability.WindowManager.WindowManager.Core 3741 * @since 10 3742 */ 3743 /** 3744 * Register the callback of windowEvent 3745 * 3746 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 3747 * @param { Callback<WindowEventType> } callback - the callback of window event 3748 * @throws { BusinessError } 401 - Parameter error. 3749 * @syscap SystemCapability.WindowManager.WindowManager.Core 3750 * @crossplatform 3751 * @atomicservice 3752 * @since 11 3753 */ 3754 on(type: 'windowEvent', callback: Callback<WindowEventType>): void; 3755 3756 /** 3757 * Unregister the callback of windowEvent 3758 * 3759 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 3760 * @param { Callback<WindowEventType> } callback - the callback of window event 3761 * @throws { BusinessError } 401 - Parameter error. 3762 * @syscap SystemCapability.WindowManager.WindowManager.Core 3763 * @since 10 3764 */ 3765 /** 3766 * Unregister the callback of windowEvent 3767 * 3768 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 3769 * @param { Callback<WindowEventType> } callback - the callback of window event 3770 * @throws { BusinessError } 401 - Parameter error. 3771 * @syscap SystemCapability.WindowManager.WindowManager.Core 3772 * @crossplatform 3773 * @atomicservice 3774 * @since 11 3775 */ 3776 off(type: 'windowEvent', callback?: Callback<WindowEventType>): void; 3777 3778 /** 3779 * Register the callback of windowStatusChange 3780 * 3781 * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. 3782 * @param { Callback<WindowStatusType> } callback - Callback used to return the window status. 3783 * @throws { BusinessError } 401 - Parameter error. 3784 * @throws { BusinessError } 801 - Capability not supported on this device. 3785 * @syscap SystemCapability.Window.SessionManager 3786 * @since 11 3787 */ 3788 on(type: 'windowStatusChange', callback: Callback<WindowStatusType>): void; 3789 3790 /** 3791 * Unregister the callback of windowStatusChange 3792 * 3793 * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. 3794 * @param { Callback<WindowStatusType> } callback - Callback used to return the window status. 3795 * @throws { BusinessError } 401 - Parameter error. 3796 * @throws { BusinessError } 801 - Capability not supported on this device. 3797 * @syscap SystemCapability.Window.SessionManager 3798 * @since 11 3799 */ 3800 off(type: 'windowStatusChange', callback?: Callback<WindowStatusType>): void; 3801 3802 /** 3803 * Bind dialog to the target window. 3804 * 3805 * @param { rpc.RemoteObject } token - token of the target window. 3806 * @param { Callback<void> } deathCallback - the callback of dialogDeath. 3807 * @returns { Promise<void> } Promise that returns no value. 3808 * @throws { BusinessError } 401 - Parameter error. 3809 * @throws { BusinessError } 1300002 - This window state is abnormal. 3810 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3811 * @syscap SystemCapability.WindowManager.WindowManager.Core 3812 * @systemapi Hide this for inner system use. 3813 * @since 9 3814 */ 3815 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>): Promise<void>; 3816 3817 /** 3818 * Bind dialog to the target window. 3819 * 3820 * @param { rpc.RemoteObject } token token of the target window. 3821 * @param { Callback<void> } deathCallback the callback of dialogDeath. 3822 * @param { AsyncCallback<void> } callback Callback used to return the result. 3823 * @throws { BusinessError } 401 - Parameter error. 3824 * @throws { BusinessError } 1300002 - This window state is abnormal. 3825 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3826 * @syscap SystemCapability.WindowManager.WindowManager.Core 3827 * @systemapi Hide this for inner system use. 3828 * @since 9 3829 */ 3830 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>, callback: AsyncCallback<void>): void; 3831 3832 /** 3833 * Bind dialog to the target window. 3834 * 3835 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 3836 * @param { Callback<void> } deathCallback the callback of dialogDeath. 3837 * @returns { Promise<void> } Promise that returns no value. 3838 * @throws { BusinessError } 401 - Parameter error. 3839 * @throws { BusinessError } 1300002 - This window state is abnormal. 3840 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3841 * @syscap SystemCapability.WindowManager.WindowManager.Core 3842 * @systemapi Hide this for inner system use. 3843 * @since 9 3844 */ 3845 bindDialogTarget(requestInfo: dialogRequest.RequestInfo, deathCallback: Callback<void>): Promise<void>; 3846 3847 /** 3848 * Bind dialog to the target window. 3849 * 3850 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 3851 * @param { Callback<void> } deathCallback the callback of dialogDeath. 3852 * @param { AsyncCallback<void> } callback Callback used to return the result. 3853 * @throws { BusinessError } 401 - Parameter error. 3854 * @throws { BusinessError } 1300002 - This window state is abnormal. 3855 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3856 * @syscap SystemCapability.WindowManager.WindowManager.Core 3857 * @systemapi Hide this for inner system use. 3858 * @since 9 3859 */ 3860 bindDialogTarget( 3861 requestInfo: dialogRequest.RequestInfo, 3862 deathCallback: Callback<void>, 3863 callback: AsyncCallback<void> 3864 ): void; 3865 3866 /** 3867 * Whether the window supports thr wide gamut setting. 3868 * 3869 * @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. 3870 * @syscap SystemCapability.WindowManager.WindowManager.Core 3871 * @since 8 3872 * @deprecated since 9 3873 * @useinstead ohos.window.Window#isWindowSupportWideGamut 3874 */ 3875 isSupportWideGamut(): Promise<boolean>; 3876 3877 /** 3878 * Whether the window supports thr wide gamut setting. 3879 * 3880 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 3881 * @syscap SystemCapability.WindowManager.WindowManager.Core 3882 * @since 8 3883 * @deprecated since 9 3884 * @useinstead ohos.window.Window#isWindowSupportWideGamut 3885 */ 3886 isSupportWideGamut(callback: AsyncCallback<boolean>): void; 3887 3888 /** 3889 * Whether the window supports thr wide gamut setting. 3890 * 3891 * @returns { Promise<boolean> } Promise used to return the result. 3892 * The value true means that the wide-gamut color space is supported, and false means the opposite. 3893 * @throws { BusinessError } 1300002 - This window state is abnormal. 3894 * @syscap SystemCapability.WindowManager.WindowManager.Core 3895 * @since 9 3896 */ 3897 isWindowSupportWideGamut(): Promise<boolean>; 3898 3899 /** 3900 * Whether the window supports thr wide gamut setting. 3901 * 3902 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 3903 * @throws { BusinessError } 1300002 - This window state is abnormal. 3904 * @syscap SystemCapability.WindowManager.WindowManager.Core 3905 * @since 9 3906 */ 3907 isWindowSupportWideGamut(callback: AsyncCallback<boolean>): void; 3908 3909 /** 3910 * Sets the specified color space. 3911 * 3912 * @param { ColorSpace } colorSpace the specified color space. 3913 * @returns { Promise<void> } Promise that returns no value. 3914 * @syscap SystemCapability.WindowManager.WindowManager.Core 3915 * @since 8 3916 * @deprecated since 9 3917 * @useinstead ohos.window.Window#setWindowColorSpace 3918 */ 3919 setColorSpace(colorSpace: ColorSpace): Promise<void>; 3920 3921 /** 3922 * Sets the specified color space. 3923 * 3924 * @param { ColorSpace } colorSpace the specified color space. 3925 * @param { AsyncCallback<void> } callback Callback used to return the result. 3926 * @syscap SystemCapability.WindowManager.WindowManager.Core 3927 * @since 8 3928 * @deprecated since 9 3929 * @useinstead ohos.window.Window#setWindowColorSpace 3930 */ 3931 setColorSpace(colorSpace: ColorSpace, callback: AsyncCallback<void>): void; 3932 3933 /** 3934 * Sets the specified color space. 3935 * 3936 * @param { ColorSpace } colorSpace the specified color space. 3937 * @returns { Promise<void> } Promise that returns no value. 3938 * @throws { BusinessError } 401 - Parameter error. 3939 * @throws { BusinessError } 1300002 - This window state is abnormal. 3940 * @syscap SystemCapability.WindowManager.WindowManager.Core 3941 * @since 9 3942 */ 3943 /** 3944 * Sets the specified color space. 3945 * 3946 * @param { ColorSpace } colorSpace the specified color space. 3947 * @returns { Promise<void> } Promise that returns no value. 3948 * @throws { BusinessError } 401 - Parameter error. 3949 * @throws { BusinessError } 1300002 - This window state is abnormal. 3950 * @syscap SystemCapability.WindowManager.WindowManager.Core 3951 * @crossplatform 3952 * @since 11 3953 */ 3954 setWindowColorSpace(colorSpace: ColorSpace): Promise<void>; 3955 3956 /** 3957 * Sets the specified color space. 3958 * 3959 * @param { ColorSpace } colorSpace the specified color space. 3960 * @param { AsyncCallback<void> } callback Callback used to return the result. 3961 * @throws { BusinessError } 401 - Parameter error. 3962 * @throws { BusinessError } 1300002 - This window state is abnormal. 3963 * @syscap SystemCapability.WindowManager.WindowManager.Core 3964 * @since 9 3965 */ 3966 /** 3967 * Sets the specified color space. 3968 * 3969 * @param { ColorSpace } colorSpace the specified color space. 3970 * @param { AsyncCallback<void> } callback Callback used to return the result. 3971 * @throws { BusinessError } 401 - Parameter error. 3972 * @throws { BusinessError } 1300002 - This window state is abnormal. 3973 * @syscap SystemCapability.WindowManager.WindowManager.Core 3974 * @crossplatform 3975 * @since 11 3976 */ 3977 setWindowColorSpace(colorSpace: ColorSpace, callback: AsyncCallback<void>): void; 3978 3979 /** 3980 * Obtains the set color space. 3981 * 3982 * @returns { Promise<ColorSpace> } Promise used to return the current color space. 3983 * @syscap SystemCapability.WindowManager.WindowManager.Core 3984 * @since 8 3985 * @deprecated since 9 3986 * @useinstead ohos.window.Window#getWindowColorSpace 3987 */ 3988 getColorSpace(): Promise<ColorSpace>; 3989 3990 /** 3991 * Obtains the set color space. 3992 * 3993 * @param { AsyncCallback<ColorSpace> } callback Callback used to return the result. 3994 * @syscap SystemCapability.WindowManager.WindowManager.Core 3995 * @since 8 3996 * @deprecated since 9 3997 * @useinstead ohos.window.Window#getWindowColorSpace 3998 */ 3999 getColorSpace(callback: AsyncCallback<ColorSpace>): void; 4000 4001 /** 4002 * Obtains the set color space. 4003 * 4004 * @returns { ColorSpace } Color space obtained. 4005 * @throws { BusinessError } 1300002 - This window state is abnormal. 4006 * @syscap SystemCapability.WindowManager.WindowManager.Core 4007 * @since 9 4008 */ 4009 /** 4010 * Obtains the set color space. 4011 * 4012 * @returns { ColorSpace } Color space obtained. 4013 * @throws { BusinessError } 1300002 - This window state is abnormal. 4014 * @syscap SystemCapability.WindowManager.WindowManager.Core 4015 * @crossplatform 4016 * @since 11 4017 */ 4018 getWindowColorSpace(): ColorSpace; 4019 4020 /** 4021 * Sets the background color of window. 4022 * 4023 * @param { string } color the specified color. 4024 * @returns { Promise<void> } Promise that returns no value. 4025 * @syscap SystemCapability.WindowManager.WindowManager.Core 4026 * @since 6 4027 * @deprecated since 9 4028 * @useinstead ohos.window.Window#setWindowBackgroundColor 4029 */ 4030 setBackgroundColor(color: string): Promise<void>; 4031 4032 /** 4033 * Sets the background color of window. 4034 * 4035 * @param { string } color the specified color. 4036 * @param { AsyncCallback<void> } callback Callback used to return the result. 4037 * @syscap SystemCapability.WindowManager.WindowManager.Core 4038 * @since 6 4039 * @deprecated since 9 4040 * @useinstead ohos.window.Window#setWindowBackgroundColor 4041 */ 4042 setBackgroundColor(color: string, callback: AsyncCallback<void>): void; 4043 4044 /** 4045 * Sets the background color of window. 4046 * 4047 * @param { string } color the specified color. 4048 * @throws { BusinessError } 401 - Parameter error. 4049 * @throws { BusinessError } 1300002 - This window state is abnormal. 4050 * @syscap SystemCapability.WindowManager.WindowManager.Core 4051 * @since 9 4052 */ 4053 /** 4054 * Sets the background color of window. 4055 * 4056 * @param { string } color the specified color. 4057 * @throws { BusinessError } 401 - Parameter error. 4058 * @throws { BusinessError } 1300002 - This window state is abnormal. 4059 * @syscap SystemCapability.WindowManager.WindowManager.Core 4060 * @crossplatform 4061 * @since 10 4062 */ 4063 /** 4064 * Sets the background color of window. 4065 * 4066 * @param { string } color the specified color. 4067 * @throws { BusinessError } 401 - Parameter error. 4068 * @throws { BusinessError } 1300002 - This window state is abnormal. 4069 * @syscap SystemCapability.WindowManager.WindowManager.Core 4070 * @crossplatform 4071 * @atomicservice 4072 * @since 11 4073 */ 4074 setWindowBackgroundColor(color: string): void; 4075 4076 /** 4077 * Sets the brightness of window. 4078 * 4079 * @param { number } brightness the specified brightness value. 4080 * @returns { Promise<void> } Promise that returns no value. 4081 * @syscap SystemCapability.WindowManager.WindowManager.Core 4082 * @since 6 4083 * @deprecated since 9 4084 * @useinstead ohos.window.Window#setWindowBrightness 4085 */ 4086 setBrightness(brightness: number): Promise<void>; 4087 4088 /** 4089 * Sets the brightness of window. 4090 * 4091 * @param { number } brightness the specified brightness value. 4092 * @param { AsyncCallback<void> } callback Callback used to return the result. 4093 * @syscap SystemCapability.WindowManager.WindowManager.Core 4094 * @since 6 4095 * @deprecated since 9 4096 * @useinstead ohos.window.Window#setWindowBrightness 4097 */ 4098 setBrightness(brightness: number, callback: AsyncCallback<void>): void; 4099 4100 /** 4101 * Sets the brightness of window. 4102 * 4103 * @param { number } brightness the specified brightness value. 4104 * @returns { Promise<void> } Promise that returns no value. 4105 * @throws { BusinessError } 401 - Parameter error. 4106 * @throws { BusinessError } 1300002 - This window state is abnormal. 4107 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4108 * @syscap SystemCapability.WindowManager.WindowManager.Core 4109 * @since 9 4110 */ 4111 /** 4112 * Sets the brightness of window. 4113 * 4114 * @param { number } brightness the specified brightness value. 4115 * @returns { Promise<void> } Promise that returns no value. 4116 * @throws { BusinessError } 401 - Parameter error. 4117 * @throws { BusinessError } 1300002 - This window state is abnormal. 4118 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4119 * @syscap SystemCapability.WindowManager.WindowManager.Core 4120 * @crossplatform 4121 * @since 10 4122 */ 4123 /** 4124 * Sets the brightness of window. 4125 * 4126 * @param { number } brightness the specified brightness value. 4127 * @returns { Promise<void> } Promise that returns no value. 4128 * @throws { BusinessError } 401 - Parameter error. 4129 * @throws { BusinessError } 1300002 - This window state is abnormal. 4130 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4131 * @syscap SystemCapability.WindowManager.WindowManager.Core 4132 * @crossplatform 4133 * @atomicservice 4134 * @since 11 4135 */ 4136 setWindowBrightness(brightness: number): Promise<void>; 4137 4138 /** 4139 * Sets the brightness of window. 4140 * 4141 * @param { number } brightness the specified brightness value. 4142 * @param { AsyncCallback<void> } callback Callback used to return the result. 4143 * @throws { BusinessError } 401 - Parameter error. 4144 * @throws { BusinessError } 1300002 - This window state is abnormal. 4145 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4146 * @syscap SystemCapability.WindowManager.WindowManager.Core 4147 * @since 9 4148 */ 4149 /** 4150 * Sets the brightness of window. 4151 * 4152 * @param { number } brightness the specified brightness value. 4153 * @param { AsyncCallback<void> } callback Callback used to return the result. 4154 * @throws { BusinessError } 401 - Parameter error. 4155 * @throws { BusinessError } 1300002 - This window state is abnormal. 4156 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4157 * @syscap SystemCapability.WindowManager.WindowManager.Core 4158 * @crossplatform 4159 * @since 10 4160 */ 4161 /** 4162 * Sets the brightness of window. 4163 * 4164 * @param { number } brightness the specified brightness value. 4165 * @param { AsyncCallback<void> } callback Callback used to return the result. 4166 * @throws { BusinessError } 401 - Parameter error. 4167 * @throws { BusinessError } 1300002 - This window state is abnormal. 4168 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4169 * @syscap SystemCapability.WindowManager.WindowManager.Core 4170 * @crossplatform 4171 * @atomicservice 4172 * @since 11 4173 */ 4174 setWindowBrightness(brightness: number, callback: AsyncCallback<void>): void; 4175 4176 /** 4177 * Sets the dimBehind of window. 4178 * 4179 * @param { number } dimBehindValue - The specified dimBehind. 4180 * @param { AsyncCallback<void> } callback Callback used to return the result. 4181 * @syscap SystemCapability.WindowManager.WindowManager.Core 4182 * @since 7 4183 * @deprecated since 9 4184 */ 4185 setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void; 4186 4187 /** 4188 * Sets the dimBehind of window. 4189 * 4190 * @param { number } dimBehindValue - The specified dimBehind. 4191 * @returns { Promise<void> } Promise that returns no value. 4192 * @syscap SystemCapability.WindowManager.WindowManager.Core 4193 * @since 7 4194 * @deprecated since 9 4195 */ 4196 setDimBehind(dimBehindValue: number): Promise<void>; 4197 4198 /** 4199 * Sets whether focusable or not. 4200 * 4201 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 4202 * @returns { Promise<void> } Promise that returns no value. 4203 * @syscap SystemCapability.WindowManager.WindowManager.Core 4204 * @since 7 4205 * @deprecated since 9 4206 * @useinstead ohos.window.Window#setWindowFocusable 4207 */ 4208 setFocusable(isFocusable: boolean): Promise<void>; 4209 4210 /** 4211 * Sets whether focusable or not. 4212 * 4213 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 4214 * @param { AsyncCallback<void> } callback Callback used to return the result. 4215 * @syscap SystemCapability.WindowManager.WindowManager.Core 4216 * @since 7 4217 * @deprecated since 9 4218 * @useinstead ohos.window.Window#setWindowFocusable 4219 */ 4220 setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 4221 4222 /** 4223 * Sets whether focusable or not. 4224 * 4225 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 4226 * @returns { Promise<void> } Promise that returns no value. 4227 * @throws { BusinessError } 401 - Parameter error. 4228 * @throws { BusinessError } 1300002 - This window state is abnormal. 4229 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4230 * @syscap SystemCapability.WindowManager.WindowManager.Core 4231 * @since 9 4232 */ 4233 setWindowFocusable(isFocusable: boolean): Promise<void>; 4234 4235 /** 4236 * Sets whether focusable or not. 4237 * 4238 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 4239 * @param { AsyncCallback<void> } callback Callback used to return the result. 4240 * @throws { BusinessError } 401 - Parameter error. 4241 * @throws { BusinessError } 1300002 - This window state is abnormal. 4242 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4243 * @syscap SystemCapability.WindowManager.WindowManager.Core 4244 * @since 9 4245 */ 4246 setWindowFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 4247 4248 /** 4249 * Sets whether keep screen on or not. 4250 * 4251 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4252 * @returns { Promise<void> } that returns no value. 4253 * @syscap SystemCapability.WindowManager.WindowManager.Core 4254 * @since 6 4255 * @deprecated since 9 4256 * @useinstead ohos.window.Window#setWindowKeepScreenOn 4257 */ 4258 setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 4259 4260 /** 4261 * Sets whether keep screen on or not. 4262 * 4263 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4264 * @param { AsyncCallback<void> } callback Callback used to return the result. 4265 * @syscap SystemCapability.WindowManager.WindowManager.Core 4266 * @since 6 4267 * @deprecated since 9 4268 * @useinstead ohos.window.Window#setWindowKeepScreenOn 4269 */ 4270 setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 4271 4272 /** 4273 * Sets whether keep screen on or not. 4274 * 4275 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4276 * @returns { Promise<void> } Promise that returns no value. 4277 * @throws { BusinessError } 401 - Parameter error. 4278 * @throws { BusinessError } 1300002 - This window state is abnormal. 4279 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4280 * @syscap SystemCapability.WindowManager.WindowManager.Core 4281 * @since 9 4282 */ 4283 /** 4284 * Sets whether keep screen on or not. 4285 * 4286 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4287 * @returns { Promise<void> } Promise that returns no value. 4288 * @throws { BusinessError } 401 - Parameter error. 4289 * @throws { BusinessError } 1300002 - This window state is abnormal. 4290 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4291 * @syscap SystemCapability.WindowManager.WindowManager.Core 4292 * @crossplatform 4293 * @since 10 4294 */ 4295 /** 4296 * Sets whether keep screen on or not. 4297 * 4298 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4299 * @returns { Promise<void> } Promise that returns no value. 4300 * @throws { BusinessError } 401 - Parameter error. 4301 * @throws { BusinessError } 1300002 - This window state is abnormal. 4302 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4303 * @syscap SystemCapability.WindowManager.WindowManager.Core 4304 * @crossplatform 4305 * @atomicservice 4306 * @since 11 4307 */ 4308 setWindowKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 4309 4310 /** 4311 * Sets whether keep screen on or not. 4312 * 4313 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4314 * @param { AsyncCallback<void> } callback Callback used to return the result. 4315 * @throws { BusinessError } 401 - Parameter error. 4316 * @throws { BusinessError } 1300002 - This window state is abnormal. 4317 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4318 * @syscap SystemCapability.WindowManager.WindowManager.Core 4319 * @since 9 4320 */ 4321 /** 4322 * Sets whether keep screen on or not. 4323 * 4324 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4325 * @param { AsyncCallback<void> } callback Callback used to return the result. 4326 * @throws { BusinessError } 401 - Parameter error. 4327 * @throws { BusinessError } 1300002 - This window state is abnormal. 4328 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4329 * @syscap SystemCapability.WindowManager.WindowManager.Core 4330 * @crossplatform 4331 * @since 10 4332 */ 4333 /** 4334 * Sets whether keep screen on or not. 4335 * 4336 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 4337 * @param { AsyncCallback<void> } callback Callback used to return the result. 4338 * @throws { BusinessError } 401 - Parameter error. 4339 * @throws { BusinessError } 1300002 - This window state is abnormal. 4340 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4341 * @syscap SystemCapability.WindowManager.WindowManager.Core 4342 * @crossplatform 4343 * @atomicservice 4344 * @since 11 4345 */ 4346 setWindowKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 4347 4348 /** 4349 * Sets whether to wake up the screen when this ability is restored. 4350 * 4351 * @param { boolean } wakeUp Specifies whether to wake up the screen. True means to wake it up, false means not. 4352 * @throws { BusinessError } 401 - Parameter error. 4353 * @throws { BusinessError } 1300002 - This window state is abnormal. 4354 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4355 * @syscap SystemCapability.WindowManager.WindowManager.Core 4356 * @systemapi Hide this for inner system use. 4357 * @since 9 4358 */ 4359 setWakeUpScreen(wakeUp: boolean): void; 4360 4361 /** 4362 * Sets whether outside can be touch or not. 4363 * 4364 * @param { boolean } touchable outside can be touch if true, or not if false. 4365 * @returns { Promise<void> } Promise that returns no value. 4366 * @syscap SystemCapability.WindowManager.WindowManager.Core 4367 * @since 7 4368 * @deprecated since 9 4369 */ 4370 setOutsideTouchable(touchable: boolean): Promise<void>; 4371 4372 /** 4373 * Sets whether outside can be touch or not. 4374 * 4375 * @param { boolean } touchable outside can be touch if true, or not if false. 4376 * @param { AsyncCallback<void> } callback Callback used to return the result. 4377 * @syscap SystemCapability.WindowManager.WindowManager.Core 4378 * @since 7 4379 * @deprecated since 9 4380 */ 4381 setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void; 4382 4383 /** 4384 * Sets whether is private mode or not. 4385 * 4386 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 4387 * @returns { Promise<void> } Promise that returns no value. 4388 * @syscap SystemCapability.WindowManager.WindowManager.Core 4389 * @since 7 4390 * @deprecated since 9 4391 * @useinstead ohos.window.Window#setWindowPrivacyMode 4392 */ 4393 setPrivacyMode(isPrivacyMode: boolean): Promise<void>; 4394 4395 /** 4396 * Sets whether is private mode or not. 4397 * 4398 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 4399 * @param { AsyncCallback<void> } callback Callback used to return the result. 4400 * @syscap SystemCapability.WindowManager.WindowManager.Core 4401 * @since 7 4402 * @deprecated since 9 4403 * @useinstead ohos.window.Window#setWindowPrivacyMode 4404 */ 4405 setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 4406 4407 /** 4408 * Sets whether is private mode or not. 4409 * 4410 * @permission ohos.permission.PRIVACY_WINDOW 4411 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 4412 * @returns { Promise<void> } Promise that returns no value. 4413 * @throws { BusinessError } 201 - Permission verification failed. 4414 * @throws { BusinessError } 401 - Parameter error. 4415 * @throws { BusinessError } 1300002 - This window state is abnormal. 4416 * @syscap SystemCapability.WindowManager.WindowManager.Core 4417 * @since 9 4418 */ 4419 setWindowPrivacyMode(isPrivacyMode: boolean): Promise<void>; 4420 4421 /** 4422 * Sets whether is private mode or not. 4423 * 4424 * @permission ohos.permission.PRIVACY_WINDOW 4425 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 4426 * @param { AsyncCallback<void> } callback Callback used to return the result. 4427 * @throws { BusinessError } 201 - Permission verification failed. 4428 * @throws { BusinessError } 401 - Parameter error. 4429 * @throws { BusinessError } 1300002 - This window state is abnormal. 4430 * @syscap SystemCapability.WindowManager.WindowManager.Core 4431 * @since 9 4432 */ 4433 setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 4434 4435 /** 4436 * Ignore this window during screenshot. 4437 * 4438 * @param { boolean } isSkip skip if true, or not if false. 4439 * @throws { BusinessError } 401 - Parameter error. 4440 * @throws { BusinessError } 1300002 - This window state is abnormal. 4441 * @syscap SystemCapability.WindowManager.WindowManager.Core 4442 * @systemapi Hide this for inner system use. 4443 * @since 9 4444 */ 4445 setSnapshotSkip(isSkip: boolean): void; 4446 4447 /** 4448 * Sets whether is touchable or not. 4449 * 4450 * @param { boolean } isTouchable is touchable if true, or not if false. 4451 * @returns { Promise<void> } Promise that returns no value. 4452 * @syscap SystemCapability.WindowManager.WindowManager.Core 4453 * @since 7 4454 * @deprecated since 9 4455 * @useinstead ohos.window.Window#setWindowTouchable 4456 */ 4457 setTouchable(isTouchable: boolean): Promise<void>; 4458 4459 /** 4460 * Sets whether is touchable or not. 4461 * 4462 * @param { boolean } isTouchable is touchable if true, or not if false. 4463 * @param { AsyncCallback<void> } callback Callback used to return the result. 4464 * @syscap SystemCapability.WindowManager.WindowManager.Core 4465 * @since 7 4466 * @deprecated since 9 4467 * @useinstead ohos.window.Window#setWindowTouchable 4468 */ 4469 setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 4470 4471 /** 4472 * Sets whether is touchable or not. 4473 * 4474 * @param { boolean } isTouchable is touchable if true, or not if false. 4475 * @returns { Promise<void> } Promise that returns no value. 4476 * @throws { BusinessError } 401 - Parameter error. 4477 * @throws { BusinessError } 1300002 - This window state is abnormal. 4478 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4479 * @syscap SystemCapability.WindowManager.WindowManager.Core 4480 * @since 9 4481 */ 4482 setWindowTouchable(isTouchable: boolean): Promise<void>; 4483 4484 /** 4485 * Sets whether is touchable or not. 4486 * 4487 * @param { boolean } isTouchable is touchable if true, or not if false. 4488 * @param { AsyncCallback<void> } callback Callback used to return the result. 4489 * @throws { BusinessError } 401 - Parameter error. 4490 * @throws { BusinessError } 1300002 - This window state is abnormal. 4491 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4492 * @syscap SystemCapability.WindowManager.WindowManager.Core 4493 * @since 9 4494 */ 4495 setWindowTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 4496 4497 /** 4498 * Sets the flag of the window is forbidden to move in split screen mode 4499 * 4500 * @param { boolean } isForbidSplitMove the flag of the window is forbidden to move in split screen mode 4501 * @param { AsyncCallback<void> } callback Callback used to return the result. 4502 * @throws { BusinessError } 401 - Parameter error. 4503 * @throws { BusinessError } 1300002 - This window state is abnormal. 4504 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4505 * @syscap SystemCapability.WindowManager.WindowManager.Core 4506 * @systemapi 4507 * @since 9 4508 */ 4509 setForbidSplitMove(isForbidSplitMove: boolean, callback: AsyncCallback<void>): void; 4510 4511 /** 4512 * Sets the flag of the window is forbidden to move in split screen mode 4513 * 4514 * @param { boolean } isForbidSplitMove the flag of the window is forbidden to move in split screen mode 4515 * @returns { Promise<void> } Promise that returns no value. 4516 * @throws { BusinessError } 401 - Parameter error. 4517 * @throws { BusinessError } 1300002 - This window state is abnormal. 4518 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4519 * @syscap SystemCapability.WindowManager.WindowManager.Core 4520 * @systemapi 4521 * @since 9 4522 */ 4523 setForbidSplitMove(isForbidSplitMove: boolean): Promise<void>; 4524 4525 /** 4526 * Obtains snapshot of window 4527 * 4528 * @param { AsyncCallback<image.PixelMap> } callback Callback used to return the result. 4529 * @throws { BusinessError } 1300002 - This window state is abnormal. 4530 * @syscap SystemCapability.WindowManager.WindowManager.Core 4531 * @since 9 4532 */ 4533 snapshot(callback: AsyncCallback<image.PixelMap>): void; 4534 4535 /** 4536 * Obtains snapshot of window 4537 * 4538 * @returns { Promise<image.PixelMap> } Promise that returns no value. 4539 * @throws { BusinessError } 1300002 - This window state is abnormal. 4540 * @syscap SystemCapability.WindowManager.WindowManager.Core 4541 * @since 9 4542 */ 4543 snapshot(): Promise<image.PixelMap>; 4544 4545 /** 4546 * Sets opacity of window 4547 * 4548 * @param { number } opacity Interval is 0.f-1.f. 4549 * @throws { BusinessError } 401 - Parameter error. 4550 * @throws { BusinessError } 1300002 - This window state is abnormal. 4551 * @throws { BusinessError } 1300004 - Unauthorized operation. 4552 * @syscap SystemCapability.WindowManager.WindowManager.Core 4553 * @systemapi 4554 * @since 9 4555 */ 4556 opacity(opacity: number): void; 4557 4558 /** 4559 * Sets scale options of window. 4560 * 4561 * @param { ScaleOptions } scaleOptions scale param of window. 4562 * @throws { BusinessError } 401 - Parameter error. 4563 * @throws { BusinessError } 1300002 - This window state is abnormal. 4564 * @throws { BusinessError } 1300004 - Unauthorized operation. 4565 * @syscap SystemCapability.WindowManager.WindowManager.Core 4566 * @systemapi 4567 * @since 9 4568 */ 4569 scale(scaleOptions: ScaleOptions): void; 4570 4571 /** 4572 * Sets rotate options of window. 4573 * 4574 * @param { RotateOptions } rotateOptions rotate param of window. 4575 * @throws { BusinessError } 401 - Parameter error. 4576 * @throws { BusinessError } 1300002 - This window state is abnormal. 4577 * @throws { BusinessError } 1300004 - Unauthorized operation. 4578 * @syscap SystemCapability.WindowManager.WindowManager.Core 4579 * @systemapi 4580 * @since 9 4581 */ 4582 rotate(rotateOptions: RotateOptions): void; 4583 4584 /** 4585 * Sets translate options of window. 4586 * 4587 * @param { TranslateOptions } translateOptions translate param of window. 4588 * @throws { BusinessError } 401 - Parameter error. 4589 * @throws { BusinessError } 1300002 - This window state is abnormal. 4590 * @throws { BusinessError } 1300004 - Unauthorized operation. 4591 * @syscap SystemCapability.WindowManager.WindowManager.Core 4592 * @systemapi 4593 * @since 9 4594 */ 4595 translate(translateOptions: TranslateOptions): void; 4596 4597 /** 4598 * Get Transition Controller. 4599 * 4600 * @returns { TransitionController } 4601 * @throws { BusinessError } 1300002 - This window state is abnormal. 4602 * @throws { BusinessError } 1300004 - Unauthorized operation. 4603 * @syscap SystemCapability.WindowManager.WindowManager.Core 4604 * @systemapi 4605 * @since 9 4606 */ 4607 getTransitionController(): TransitionController; 4608 4609 /** 4610 * Sets the window blur radius. 4611 * 4612 * @param { number } radius the blur radius. 4613 * @throws { BusinessError } 401 - Parameter error. 4614 * @throws { BusinessError } 1300002 - This window state is abnormal. 4615 * @throws { BusinessError } 1300004 - Unauthorized operation. 4616 * @syscap SystemCapability.WindowManager.WindowManager.Core 4617 * @systemapi Hide this for inner system use. 4618 * @since 9 4619 */ 4620 setBlur(radius: number): void; 4621 4622 /** 4623 * Sets the window backdrop blur radius. 4624 * 4625 * @param { number } radius the blur radius. 4626 * @throws { BusinessError } 401 - Parameter error. 4627 * @throws { BusinessError } 1300002 - This window state is abnormal. 4628 * @throws { BusinessError } 1300004 - Unauthorized operation. 4629 * @syscap SystemCapability.WindowManager.WindowManager.Core 4630 * @systemapi Hide this for inner system use. 4631 * @since 9 4632 */ 4633 setBackdropBlur(radius: number): void; 4634 4635 /** 4636 * Sets the window backdrop blur style. 4637 * 4638 * @param { BlurStyle } blurStyle the specified blur style. 4639 * @throws { BusinessError } 401 - Parameter error. 4640 * @throws { BusinessError } 1300002 - This window state is abnormal. 4641 * @throws { BusinessError } 1300004 - Unauthorized operation. 4642 * @syscap SystemCapability.WindowManager.WindowManager.Core 4643 * @systemapi Hide this for inner system use. 4644 * @since 9 4645 */ 4646 setBackdropBlurStyle(blurStyle: BlurStyle): void; 4647 4648 /** 4649 * Sets shadow. 4650 * 4651 * @param { number } radius the radius of the shadow. 4652 * @param { string } color the color of the shadow. 4653 * @param { number } offsetX the offset of the shadow on the x-axis. 4654 * @param { number } offsetY the offset of the shadow on the y-axis. 4655 * @throws { BusinessError } 401 - Parameter error. 4656 * @throws { BusinessError } 1300002 - This window state is abnormal. 4657 * @throws { BusinessError } 1300004 - Unauthorized operation. 4658 * @syscap SystemCapability.WindowManager.WindowManager.Core 4659 * @systemapi Hide this for inner system use. 4660 * @since 9 4661 */ 4662 setShadow(radius: number, color?: string, offsetX?: number, offsetY?: number): void; 4663 4664 /** 4665 * Sets corner radius. 4666 * 4667 * @param { number } cornerRadius the corner radius. 4668 * @throws { BusinessError } 401 - Parameter error. 4669 * @throws { BusinessError } 1300002 - This window state is abnormal. 4670 * @throws { BusinessError } 1300004 - Unauthorized operation. 4671 * @syscap SystemCapability.WindowManager.WindowManager.Core 4672 * @systemapi Hide this for inner system use. 4673 * @since 9 4674 */ 4675 setCornerRadius(cornerRadius: number): void; 4676 4677 /** 4678 * Raise app sub window to app top 4679 * 4680 * @param { AsyncCallback<void> } callback - The callback of raiseToAppTop 4681 * @throws { BusinessError } 201 - Permission verification failed. 4682 * @throws { BusinessError } 1300002 - This window state is abnormal. 4683 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4684 * @throws { BusinessError } 1300004 - Unauthorized operation. 4685 * @throws { BusinessError } 1300009 - The parent window is invalid. 4686 * @syscap SystemCapability.WindowManager.WindowManager.Core 4687 * @systemapi Hide this for inner system use. 4688 * @since 10 4689 */ 4690 raiseToAppTop(callback: AsyncCallback<void>): void; 4691 4692 /** 4693 * Raise app sub window to app top 4694 * 4695 * @returns { Promise<void> } - The promise returned by the function 4696 * @throws { BusinessError } 201 - Permission verification failed. 4697 * @throws { BusinessError } 1300002 - This window state is abnormal. 4698 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4699 * @throws { BusinessError } 1300004 - Unauthorized operation. 4700 * @throws { BusinessError } 1300009 - The parent window is invalid. 4701 * @syscap SystemCapability.WindowManager.WindowManager.Core 4702 * @systemapi Hide this for inner system use. 4703 * @since 10 4704 */ 4705 raiseToAppTop(): Promise<void>; 4706 4707 /** 4708 * Sets the aspect ratio of window 4709 * 4710 * @param { number } ratio - The aspect ratio of window except decoration 4711 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 4712 * @throws { BusinessError } 401 - Parameter error. 4713 * @throws { BusinessError } 1300002 - This window state is abnormal. 4714 * @throws { BusinessError } 1300004 - Unauthorized operation. 4715 * @syscap SystemCapability.WindowManager.WindowManager.Core 4716 * @since 10 4717 */ 4718 setAspectRatio(ratio: number, callback: AsyncCallback<void>): void; 4719 4720 /** 4721 * Sets the aspect ratio of window 4722 * 4723 * @param { number } ratio - The aspect ratio of window except decoration 4724 * @returns { Promise<void> } - The promise returned by the function. 4725 * @throws { BusinessError } 401 - Parameter error. 4726 * @throws { BusinessError } 1300002 - This window state is abnormal. 4727 * @throws { BusinessError } 1300004 - Unauthorized operation. 4728 * @syscap SystemCapability.WindowManager.WindowManager.Core 4729 * @since 10 4730 */ 4731 setAspectRatio(ratio: number): Promise<void>; 4732 4733 /** 4734 * Resets the aspect ratio of window 4735 * 4736 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 4737 * @throws { BusinessError } 1300002 - This window state is abnormal. 4738 * @throws { BusinessError } 1300004 - Unauthorized operation. 4739 * @syscap SystemCapability.WindowManager.WindowManager.Core 4740 * @since 10 4741 */ 4742 resetAspectRatio(callback: AsyncCallback<void>): void; 4743 4744 /** 4745 * Resets the aspect ratio of window 4746 * 4747 * @returns { Promise<void> } - The promise returned by the function. 4748 * @throws { BusinessError } 1300002 - This window state is abnormal. 4749 * @throws { BusinessError } 1300004 - Unauthorized operation. 4750 * @syscap SystemCapability.WindowManager.WindowManager.Core 4751 * @since 10 4752 */ 4753 resetAspectRatio(): Promise<void>; 4754 4755 /** 4756 * Set the watermark flag on the window. 4757 * 4758 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false. 4759 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkFlag. 4760 * @throws { BusinessError } 1300002 - This window state is abnormal. 4761 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4762 * @throws { BusinessError } 1300008 - The operation is on invalid display. 4763 * @syscap SystemCapability.WindowManager.WindowManager.Core 4764 * @systemapi Hide this for inner system use. 4765 * @since 10 4766 */ 4767 setWaterMarkFlag(enable: boolean, callback: AsyncCallback<void>): void; 4768 4769 /** 4770 * Set the watermark flag on the window 4771 * 4772 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false 4773 * @returns { Promise<void> } - The promise returned by the function 4774 * @throws { BusinessError } 1300002 - This window state is abnormal. 4775 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4776 * @throws { BusinessError } 1300008 - The operation is on invalid display. 4777 * @syscap SystemCapability.WindowManager.WindowManager.Core 4778 * @systemapi Hide this for inner system use. 4779 * @since 10 4780 */ 4781 setWaterMarkFlag(enable: boolean): Promise<void>; 4782 4783 /** 4784 * Raise one app sub window above another. 4785 * 4786 * @param { number } windowId - Indicates target window id. 4787 * @param { AsyncCallback<void> } callback - The callback of raiseAboveTarget. 4788 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4789 * @throws { BusinessError } 401 - Parameter error. 4790 * @throws { BusinessError } 801 - Capability not supported on this device. 4791 * @throws { BusinessError } 1300002 - This window state is abnormal. 4792 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4793 * @throws { BusinessError } 1300004 - Unauthorized operation. 4794 * @throws { BusinessError } 1300009 - The parent window is invalid. 4795 * @syscap SystemCapability.Window.SessionManager 4796 * @systemapi Hide this for inner system use. 4797 * @since 10 4798 */ 4799 raiseAboveTarget(windowId: number, callback: AsyncCallback<void>): void; 4800 4801 /** 4802 * Raise one app sub window above another. 4803 * 4804 * @param { number } windowId - Indicates target window id. 4805 * @returns { Promise<void> } - The promise returned by the function. 4806 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4807 * @throws { BusinessError } 401 - Parameter error. 4808 * @throws { BusinessError } 801 - Capability not supported on this device. 4809 * @throws { BusinessError } 1300002 - This window state is abnormal. 4810 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4811 * @throws { BusinessError } 1300004 - Unauthorized operation. 4812 * @throws { BusinessError } 1300009 - The parent window is invalid. 4813 * @syscap SystemCapability.Window.SessionManager 4814 * @systemapi Hide this for inner system use. 4815 * @since 10 4816 */ 4817 raiseAboveTarget(windowId: number): Promise<void>; 4818 4819 /** 4820 * Set whether to enable an app sub window to raise itself by click. 4821 * 4822 * @param { boolean } enable - Disable app sub window to raise itself by by click if false. 4823 * @param { AsyncCallback<void> } callback - The callback of setRaiseByClickEnabled. 4824 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4825 * @throws { BusinessError } 401 - Parameter error. 4826 * @throws { BusinessError } 801 - Capability not supported on this device. 4827 * @throws { BusinessError } 1300002 - This window state is abnormal. 4828 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4829 * @throws { BusinessError } 1300004 - Unauthorized operation. 4830 * @throws { BusinessError } 1300009 - The parent window is invalid. 4831 * @syscap SystemCapability.Window.SessionManager 4832 * @systemapi Hide this for inner system use. 4833 * @since 10 4834 */ 4835 setRaiseByClickEnabled(enable: boolean, callback: AsyncCallback<void>): void; 4836 4837 /** 4838 * Set whether to enable an app sub window to raise itself by click. 4839 * 4840 * @param { boolean } enable - Disable app sub window to raise itself by by click if false. 4841 * @returns { Promise<void> } - The promise returned by the function. 4842 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4843 * @throws { BusinessError } 401 - Parameter error. 4844 * @throws { BusinessError } 801 - Capability not supported on this device. 4845 * @throws { BusinessError } 1300002 - This window state is abnormal. 4846 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4847 * @throws { BusinessError } 1300004 - Unauthorized operation. 4848 * @throws { BusinessError } 1300009 - The parent window is invalid. 4849 * @syscap SystemCapability.Window.SessionManager 4850 * @systemapi Hide this for inner system use. 4851 * @since 10 4852 */ 4853 setRaiseByClickEnabled(enable: boolean): Promise<void>; 4854 4855 /** 4856 * Minimize app main window and hide app subWindow. 4857 * 4858 * @param { AsyncCallback<void> } callback - The callback of Minimize. 4859 * @throws { BusinessError } 801 - Capability not supported on this device. 4860 * @throws { BusinessError } 1300002 - This window state is abnormal. 4861 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4862 * @syscap SystemCapability.Window.SessionManager 4863 * @since 11 4864 */ 4865 minimize(callback: AsyncCallback<void>): void; 4866 4867 /** 4868 * Minimize app main window and hide app subWindow. 4869 * 4870 * @returns { Promise<void> } - The promise returned by the function. 4871 * @throws { BusinessError } 801 - Capability not supported on this device. 4872 * @throws { BusinessError } 1300002 - This window state is abnormal. 4873 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4874 * @syscap SystemCapability.Window.SessionManager 4875 * @since 11 4876 */ 4877 minimize(): Promise<void>; 4878 4879 /** 4880 * Set whether to enable a window to resize by drag. 4881 * 4882 * @param { boolean } enable - Disable window to resize by drag if false. 4883 * @param { AsyncCallback<void> } callback - The callback of setResizeByDragEnabled. 4884 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4885 * @throws { BusinessError } 401 - Parameter error. 4886 * @throws { BusinessError } 801 - Capability not supported on this device. 4887 * @throws { BusinessError } 1300002 - This window state is abnormal. 4888 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4889 * @throws { BusinessError } 1300004 - Unauthorized operation. 4890 * @syscap SystemCapability.Window.SessionManager 4891 * @systemapi Hide this for inner system use. 4892 * @since 10 4893 */ 4894 /** 4895 * Set whether to enable a window to resize by drag. 4896 * 4897 * @param { boolean } enable - Disable window to resize by drag if false. 4898 * @param { AsyncCallback<void> } callback - The callback of setResizeByDragEnabled. 4899 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4900 * @throws { BusinessError } 401 - Parameter error. 4901 * @throws { BusinessError } 801 - Capability not supported on this device. 4902 * @throws { BusinessError } 1300002 - This window state is abnormal. 4903 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4904 * @syscap SystemCapability.Window.SessionManager 4905 * @systemapi Hide this for inner system use. 4906 * @since 11 4907 */ 4908 setResizeByDragEnabled(enable: boolean, callback: AsyncCallback<void>): void; 4909 4910 /** 4911 * Set whether to enable a window to resize by drag. 4912 * 4913 * @param { boolean } enable - Disable window to resize by drag if false. 4914 * @returns { Promise<void> } - The promise returned by the function. 4915 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4916 * @throws { BusinessError } 401 - Parameter error. 4917 * @throws { BusinessError } 801 - Capability not supported on this device. 4918 * @throws { BusinessError } 1300002 - This window state is abnormal. 4919 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4920 * @syscap SystemCapability.Window.SessionManager 4921 * @systemapi Hide this for inner system use. 4922 * @since 10 4923 */ 4924 setResizeByDragEnabled(enable: boolean): Promise<void>; 4925 4926 /** 4927 * Hide the non-system floating windows. 4928 * 4929 * @param { boolean } shouldHide - Hide the non-system floating windows if true, otherwise means the opposite. 4930 * @param { AsyncCallback<void> } callback - The callback of hideNonSystemFloatingWindows. 4931 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4932 * @throws { BusinessError } 401 - Parameter error. 4933 * @throws { BusinessError } 801 - Capability not supported on this device. 4934 * @throws { BusinessError } 1300002 - This window state is abnormal. 4935 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4936 * @throws { BusinessError } 1300004 - Unauthorized operation. 4937 * @syscap SystemCapability.Window.SessionManager 4938 * @systemapi Hide this for inner system use. 4939 * @since 11 4940 */ 4941 hideNonSystemFloatingWindows(shouldHide: boolean, callback: AsyncCallback<void>): void; 4942 4943 /** 4944 * Hide the non-system floating windows. 4945 * 4946 * @param { boolean } shouldHide - Hide the non-system floating windows if true, otherwise means the opposite. 4947 * @returns { Promise<void> } - The promise returned by the function. 4948 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4949 * @throws { BusinessError } 401 - Parameter error. 4950 * @throws { BusinessError } 801 - Capability not supported on this device. 4951 * @throws { BusinessError } 1300002 - This window state is abnormal. 4952 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4953 * @throws { BusinessError } 1300004 - Unauthorized operation. 4954 * @syscap SystemCapability.Window.SessionManager 4955 * @systemapi Hide this for inner system use. 4956 * @since 11 4957 */ 4958 hideNonSystemFloatingWindows(shouldHide: boolean): Promise<void>; 4959 4960 /** 4961 * Get the window limits of current window. 4962 * 4963 * @returns { WindowLimits } - The limits of window. 4964 * @throws { BusinessError } 801 - Capability not supported on this device. 4965 * @throws { BusinessError } 1300002 - This window state is abnormal. 4966 * @syscap SystemCapability.Window.SessionManager 4967 * @since 11 4968 */ 4969 getWindowLimits(): WindowLimits; 4970 4971 /** 4972 * Set the window limits of a window. 4973 * 4974 * @param { WindowLimits } windowLimits - window limits of the window. 4975 * @returns { Promise<WindowLimits> } - Promise is used to return the limits of window. 4976 * @throws { BusinessError } 401 - Parameter error. 4977 * @throws { BusinessError } 801 - Capability not supported on this device. 4978 * @throws { BusinessError } 1300002 - This window state is abnormal. 4979 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 4980 * @throws { BusinessError } 1300004 - Unauthorized operation. 4981 * @syscap SystemCapability.Window.SessionManager 4982 * @since 11 4983 */ 4984 setWindowLimits(windowLimits: WindowLimits): Promise<WindowLimits>; 4985 4986 /** 4987 * Set whether to enable the single frame composer. 4988 * 4989 * @param { boolean } enable - Enable the single frame composer if true, otherwise means the opposite. 4990 * @returns { Promise<void> } - The promise returned by the function. 4991 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4992 * @throws { BusinessError } 401 - Parameter error. 4993 * @throws { BusinessError } 801 - Capability not supported on this device. 4994 * @throws { BusinessError } 1300002 - This window state is abnormal. 4995 * @syscap SystemCapability.Window.SessionManager 4996 * @systemapi Hide this for inner system use. 4997 * @since 11 4998 */ 4999 setSingleFrameComposerEnabled(enable: boolean): Promise<void>; 5000 5001 /** 5002 * When get focused, keep the keyboard created by other windows, support system window and app subwindow. 5003 * 5004 * @param { boolean } keepKeyboardFlag - keep the keyboard if true, otherwise means the opposite. 5005 * @throws { BusinessError } 401 - Parameter error. 5006 * @throws { BusinessError } 801 - Capability not supported on this device. 5007 * @throws { BusinessError } 1300002 - This window state is abnormal. 5008 * @throws { BusinessError } 1300004 - Unauthorized operation. 5009 * @syscap SystemCapability.Window.SessionManager 5010 * @since 11 5011 */ 5012 keepKeyboardOnFocus(keepKeyboardFlag: boolean): void; 5013 5014 /** 5015 * Recover app main window. 5016 * 5017 * @returns { Promise<void> } - The promise returned by the function. 5018 * @throws { BusinessError } 801 - Capability not supported on this device. 5019 * @throws { BusinessError } 1300001 - Repeated operation. 5020 * @throws { BusinessError } 1300002 - This window state is abnormal. 5021 * @syscap SystemCapability.Window.SessionManager 5022 * @since 11 5023 */ 5024 recover(): Promise<void>; 5025 5026 /** 5027 * Set the visibility of the window decor. 5028 * 5029 * @param { boolean } - Enable the decor visible if true, otherwise means the opposite. 5030 * @throws { BusinessError } 401 - Parameter error. 5031 * @throws { BusinessError } 801 - Capability not supported on this device. 5032 * @throws { BusinessError } 1300002 - This window state is abnormal. 5033 * @throws { BusinessError } 1300004 - Unauthorized operation. 5034 * @syscap SystemCapability.Window.SessionManager 5035 * @since 11 5036 */ 5037 setWindowDecorVisible(isVisible: boolean): void; 5038 5039 /** 5040 * Set the height of the window decor. 5041 * 5042 * @param { number } - The height of window decor. 5043 * @throws { BusinessError } 401 - Parameter error. 5044 * @throws { BusinessError } 801 - Capability not supported on this device. 5045 * @throws { BusinessError } 1300002 - This window state is abnormal. 5046 * @syscap SystemCapability.Window.SessionManager 5047 * @since 11 5048 */ 5049 setWindowDecorHeight(height: number): void; 5050 5051 /** 5052 * Get the height of the window decor. 5053 * 5054 * @returns { number } - The height of window decor. 5055 * @throws { BusinessError } 801 - Capability not supported on this device. 5056 * @throws { BusinessError } 1300002 - This window state is abnormal. 5057 * @syscap SystemCapability.Window.SessionManager 5058 * @since 11 5059 */ 5060 getWindowDecorHeight(): number; 5061 5062 /** 5063 * Get the area of window title buttons. 5064 * 5065 * @returns { TitleButtonRect } - The area of window title buttons. 5066 * @throws { BusinessError } 801 - Capability not supported on this device. 5067 * @throws { BusinessError } 1300002 - This window state is abnormal. 5068 * @syscap SystemCapability.Window.SessionManager 5069 * @since 11 5070 */ 5071 getTitleButtonRect(): TitleButtonRect; 5072 5073 /** 5074 * Register the callback of title buttons area change. 5075 * 5076 * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. 5077 * @param { Callback<TitleButtonRect> } callback - Callback used to return the current title buttons area. 5078 * @throws { BusinessError } 401 - Parameter error. 5079 * @throws { BusinessError } 801 - Capability not supported on this device. 5080 * @throws { BusinessError } 1300002 - This window state is abnormal. 5081 * @syscap SystemCapability.Window.SessionManager 5082 * @since 11 5083 */ 5084 on(type: 'windowTitleButtonRectChange', callback: Callback<TitleButtonRect>): void; 5085 5086 /** 5087 * Unregister the callback of title buttons area change. 5088 * 5089 * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. 5090 * @param { Callback<TitleButtonRect> } callback - Callback used to return the current title buttons area. 5091 * @throws { BusinessError } 401 - Parameter error. 5092 * @throws { BusinessError } 801 - Capability not supported on this device. 5093 * @throws { BusinessError } 1300002 - This window state is abnormal. 5094 * @syscap SystemCapability.Window.SessionManager 5095 * @since 11 5096 */ 5097 off(type: 'windowTitleButtonRectChange', callback?: Callback<TitleButtonRect>): void; 5098 } 5099 /** 5100 * Window stage callback event type 5101 * 5102 * @enum { number } 5103 * @syscap SystemCapability.WindowManager.WindowManager.Core 5104 * @StageModelOnly 5105 * @since 9 5106 */ 5107 /** 5108 * Window stage callback event type 5109 * 5110 * @enum { number } 5111 * @syscap SystemCapability.WindowManager.WindowManager.Core 5112 * @StageModelOnly 5113 * @crossplatform 5114 * @since 10 5115 */ 5116 /** 5117 * Window stage callback event type 5118 * 5119 * @enum { number } 5120 * @syscap SystemCapability.WindowManager.WindowManager.Core 5121 * @StageModelOnly 5122 * @crossplatform 5123 * @atomicservice 5124 * @since 11 5125 */ 5126 enum WindowStageEventType { 5127 /** 5128 * The window stage is running in the foreground. 5129 * 5130 * @syscap SystemCapability.WindowManager.WindowManager.Core 5131 * @StageModelOnly 5132 * @since 9 5133 */ 5134 /** 5135 * The window stage is running in the foreground. 5136 * 5137 * @syscap SystemCapability.WindowManager.WindowManager.Core 5138 * @StageModelOnly 5139 * @crossplatform 5140 * @since 10 5141 */ 5142 /** 5143 * The window stage is running in the foreground. 5144 * 5145 * @syscap SystemCapability.WindowManager.WindowManager.Core 5146 * @StageModelOnly 5147 * @crossplatform 5148 * @atomicservice 5149 * @since 11 5150 */ 5151 SHOWN = 1, 5152 /** 5153 * The window stage gains focus. 5154 * 5155 * @syscap SystemCapability.WindowManager.WindowManager.Core 5156 * @StageModelOnly 5157 * @since 9 5158 */ 5159 /** 5160 * The window stage gains focus. 5161 * 5162 * @syscap SystemCapability.WindowManager.WindowManager.Core 5163 * @StageModelOnly 5164 * @crossplatform 5165 * @since 10 5166 */ 5167 /** 5168 * The window stage gains focus. 5169 * 5170 * @syscap SystemCapability.WindowManager.WindowManager.Core 5171 * @StageModelOnly 5172 * @crossplatform 5173 * @atomicservice 5174 * @since 11 5175 */ 5176 ACTIVE, 5177 /** 5178 * The window stage loses focus. 5179 * 5180 * @syscap SystemCapability.WindowManager.WindowManager.Core 5181 * @StageModelOnly 5182 * @since 9 5183 */ 5184 /** 5185 * The window stage loses focus. 5186 * 5187 * @syscap SystemCapability.WindowManager.WindowManager.Core 5188 * @StageModelOnly 5189 * @crossplatform 5190 * @since 10 5191 */ 5192 /** 5193 * The window stage loses focus. 5194 * 5195 * @syscap SystemCapability.WindowManager.WindowManager.Core 5196 * @StageModelOnly 5197 * @crossplatform 5198 * @atomicservice 5199 * @since 11 5200 */ 5201 INACTIVE, 5202 /** 5203 * The window stage is running in the background. 5204 * 5205 * @syscap SystemCapability.WindowManager.WindowManager.Core 5206 * @StageModelOnly 5207 * @since 9 5208 */ 5209 /** 5210 * The window stage is running in the background. 5211 * 5212 * @syscap SystemCapability.WindowManager.WindowManager.Core 5213 * @StageModelOnly 5214 * @crossplatform 5215 * @since 10 5216 */ 5217 /** 5218 * The window stage is running in the background. 5219 * 5220 * @syscap SystemCapability.WindowManager.WindowManager.Core 5221 * @StageModelOnly 5222 * @crossplatform 5223 * @atomicservice 5224 * @since 11 5225 */ 5226 HIDDEN, 5227 /** 5228 * The window stage is interactive in the foreground. 5229 * 5230 * @syscap SystemCapability.WindowManager.WindowManager.Core 5231 * @StageModelOnly 5232 * @crossplatform 5233 * @atomicservice 5234 * @since 11 5235 */ 5236 RESUMED, 5237 /** 5238 * The window stage is not interactive in the foreground. 5239 * 5240 * @syscap SystemCapability.WindowManager.WindowManager.Core 5241 * @StageModelOnly 5242 * @crossplatform 5243 * @atomicservice 5244 * @since 11 5245 */ 5246 PAUSED 5247 } 5248 /** 5249 * Options for subwindow creation 5250 * 5251 * @interface SubWindowOptions 5252 * @syscap SystemCapability.Window.SessionManager 5253 * @since 11 5254 */ 5255 interface SubWindowOptions { 5256 /** 5257 * Indicates subwindow title 5258 * 5259 * @type { string } 5260 * @syscap SystemCapability.Window.SessionManager 5261 * @since 11 5262 */ 5263 title: string; 5264 /** 5265 * Indicates decor of subwindow 5266 * 5267 * @type { boolean } 5268 * @syscap SystemCapability.Window.SessionManager 5269 * @since 11 5270 */ 5271 decorEnabled: boolean; 5272 } 5273 /** 5274 * WindowStage 5275 * 5276 * @interface WindowStage 5277 * @syscap SystemCapability.WindowManager.WindowManager.Core 5278 * @since 9 5279 */ 5280 /** 5281 * WindowStage 5282 * 5283 * @interface WindowStage 5284 * @syscap SystemCapability.WindowManager.WindowManager.Core 5285 * @crossplatform 5286 * @since 10 5287 */ 5288 /** 5289 * WindowStage 5290 * 5291 * @interface WindowStage 5292 * @syscap SystemCapability.WindowManager.WindowManager.Core 5293 * @crossplatform 5294 * @atomicservice 5295 * @since 11 5296 */ 5297 interface WindowStage { 5298 /** 5299 * Get main window of the stage. 5300 * 5301 * @returns { Promise<Window> } Callback used to return the subwindow. 5302 * @throws { BusinessError } 1300002 - This window state is abnormal. 5303 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5304 * @syscap SystemCapability.WindowManager.WindowManager.Core 5305 * @StageModelOnly 5306 * @since 9 5307 */ 5308 /** 5309 * Get main window of the stage. 5310 * 5311 * @returns { Promise<Window> } Callback used to return the subwindow. 5312 * @throws { BusinessError } 1300002 - This window state is abnormal. 5313 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5314 * @syscap SystemCapability.WindowManager.WindowManager.Core 5315 * @StageModelOnly 5316 * @crossplatform 5317 * @since 10 5318 */ 5319 /** 5320 * Get main window of the stage. 5321 * 5322 * @returns { Promise<Window> } Callback used to return the subwindow. 5323 * @throws { BusinessError } 1300002 - This window state is abnormal. 5324 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5325 * @syscap SystemCapability.WindowManager.WindowManager.Core 5326 * @StageModelOnly 5327 * @crossplatform 5328 * @atomicservice 5329 * @since 11 5330 */ 5331 getMainWindow(): Promise<Window>; 5332 /** 5333 * Get main window of the stage. 5334 * 5335 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 5336 * @throws { BusinessError } 1300002 - This window state is abnormal. 5337 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5338 * @syscap SystemCapability.WindowManager.WindowManager.Core 5339 * @StageModelOnly 5340 * @since 9 5341 */ 5342 /** 5343 * Get main window of the stage. 5344 * 5345 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 5346 * @throws { BusinessError } 1300002 - This window state is abnormal. 5347 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5348 * @syscap SystemCapability.WindowManager.WindowManager.Core 5349 * @StageModelOnly 5350 * @crossplatform 5351 * @since 10 5352 */ 5353 /** 5354 * Get main window of the stage. 5355 * 5356 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 5357 * @throws { BusinessError } 1300002 - This window state is abnormal. 5358 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5359 * @syscap SystemCapability.WindowManager.WindowManager.Core 5360 * @StageModelOnly 5361 * @crossplatform 5362 * @atomicservice 5363 * @since 11 5364 */ 5365 getMainWindow(callback: AsyncCallback<Window>): void; 5366 /** 5367 * Get main window of the stage. 5368 * 5369 * @returns { Window } 5370 * @throws { BusinessError } 1300002 - This window state is abnormal. 5371 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5372 * @syscap SystemCapability.WindowManager.WindowManager.Core 5373 * @StageModelOnly 5374 * @since 9 5375 */ 5376 /** 5377 * Get main window of the stage. 5378 * 5379 * @returns { Window } 5380 * @throws { BusinessError } 1300002 - This window state is abnormal. 5381 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5382 * @syscap SystemCapability.WindowManager.WindowManager.Core 5383 * @StageModelOnly 5384 * @crossplatform 5385 * @since 10 5386 */ 5387 /** 5388 * Get main window of the stage. 5389 * 5390 * @returns { Window } 5391 * @throws { BusinessError } 1300002 - This window state is abnormal. 5392 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5393 * @syscap SystemCapability.WindowManager.WindowManager.Core 5394 * @StageModelOnly 5395 * @crossplatform 5396 * @atomicservice 5397 * @since 11 5398 */ 5399 getMainWindowSync(): Window; 5400 /** 5401 * Create sub window of the stage. 5402 * 5403 * @param { string } name window name of sub window 5404 * @returns { Promise<Window> } Promise used to return the subwindow. 5405 * @throws { BusinessError } 401 - Parameter error. 5406 * @throws { BusinessError } 1300002 - This window state is abnormal. 5407 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5408 * @syscap SystemCapability.WindowManager.WindowManager.Core 5409 * @StageModelOnly 5410 * @since 9 5411 */ 5412 /** 5413 * Create sub window of the stage. 5414 * 5415 * @param { string } name window name of sub window 5416 * @returns { Promise<Window> } Promise used to return the subwindow. 5417 * @throws { BusinessError } 401 - Parameter error. 5418 * @throws { BusinessError } 1300002 - This window state is abnormal. 5419 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5420 * @syscap SystemCapability.WindowManager.WindowManager.Core 5421 * @StageModelOnly 5422 * @crossplatform 5423 * @since 10 5424 */ 5425 /** 5426 * Create sub window of the stage. 5427 * 5428 * @param { string } name window name of sub window 5429 * @returns { Promise<Window> } Promise used to return the subwindow. 5430 * @throws { BusinessError } 401 - Parameter error. 5431 * @throws { BusinessError } 1300002 - This window state is abnormal. 5432 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5433 * @syscap SystemCapability.WindowManager.WindowManager.Core 5434 * @StageModelOnly 5435 * @crossplatform 5436 * @atomicservice 5437 * @since 11 5438 */ 5439 createSubWindow(name: string): Promise<Window>; 5440 /** 5441 * Create sub window of the stage. 5442 * 5443 * @param { string } name window name of sub window 5444 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 5445 * @throws { BusinessError } 401 - Parameter error. 5446 * @throws { BusinessError } 1300002 - This window state is abnormal. 5447 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5448 * @syscap SystemCapability.WindowManager.WindowManager.Core 5449 * @StageModelOnly 5450 * @since 9 5451 */ 5452 /** 5453 * Create sub window of the stage. 5454 * 5455 * @param { string } name window name of sub window 5456 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 5457 * @throws { BusinessError } 401 - Parameter error. 5458 * @throws { BusinessError } 1300002 - This window state is abnormal. 5459 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5460 * @syscap SystemCapability.WindowManager.WindowManager.Core 5461 * @StageModelOnly 5462 * @crossplatform 5463 * @since 10 5464 */ 5465 /** 5466 * Create sub window of the stage. 5467 * 5468 * @param { string } name window name of sub window 5469 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 5470 * @throws { BusinessError } 401 - Parameter error. 5471 * @throws { BusinessError } 1300002 - This window state is abnormal. 5472 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5473 * @syscap SystemCapability.WindowManager.WindowManager.Core 5474 * @StageModelOnly 5475 * @crossplatform 5476 * @atomicservice 5477 * @since 11 5478 */ 5479 createSubWindow(name: string, callback: AsyncCallback<Window>): void; 5480 /** 5481 * Create sub window of the stage. 5482 * 5483 * @param { string } name - window name of sub window 5484 * @param { SubWindowOptions } options - options of sub window creation 5485 * @returns { Promise<Window> } Promise used to return the subwindow. 5486 * @throws { BusinessError } 401 - Parameter error. 5487 * @throws { BusinessError } 801 - Capability not supported on this device. 5488 * @throws { BusinessError } 1300002 - This window state is abnormal. 5489 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5490 * @syscap SystemCapability.Window.SessionManager 5491 * @StageModelOnly 5492 * @since 11 5493 */ 5494 createSubWindowWithOptions(name: string, options: SubWindowOptions): Promise<Window>; 5495 /** 5496 * Get sub window of the stage. 5497 * 5498 * @returns { Promise<Array<Window>> } 5499 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5500 * @syscap SystemCapability.WindowManager.WindowManager.Core 5501 * @StageModelOnly 5502 * @since 9 5503 */ 5504 /** 5505 * Get sub window of the stage. 5506 * 5507 * @returns { Promise<Array<Window>> } 5508 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5509 * @syscap SystemCapability.WindowManager.WindowManager.Core 5510 * @StageModelOnly 5511 * @crossplatform 5512 * @since 10 5513 */ 5514 /** 5515 * Get sub window of the stage. 5516 * 5517 * @returns { Promise<Array<Window>> } 5518 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5519 * @syscap SystemCapability.WindowManager.WindowManager.Core 5520 * @StageModelOnly 5521 * @crossplatform 5522 * @atomicservice 5523 * @since 11 5524 */ 5525 getSubWindow(): Promise<Array<Window>>; 5526 /** 5527 * Get sub window of the stage. 5528 * 5529 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 5530 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5531 * @syscap SystemCapability.WindowManager.WindowManager.Core 5532 * @StageModelOnly 5533 * @since 9 5534 */ 5535 /** 5536 * Get sub window of the stage. 5537 * 5538 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 5539 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5540 * @syscap SystemCapability.WindowManager.WindowManager.Core 5541 * @StageModelOnly 5542 * @crossplatform 5543 * @since 10 5544 */ 5545 /** 5546 * Get sub window of the stage. 5547 * 5548 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 5549 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5550 * @syscap SystemCapability.WindowManager.WindowManager.Core 5551 * @StageModelOnly 5552 * @crossplatform 5553 * @atomicservice 5554 * @since 11 5555 */ 5556 getSubWindow(callback: AsyncCallback<Array<Window>>): void; 5557 /** 5558 * Loads content 5559 * 5560 * @param { string } path Path of the page to which the content will be loaded 5561 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 5562 * @param { AsyncCallback<void> } callback Callback used to return the result. 5563 * @throws { BusinessError } 401 - Parameter error. 5564 * @throws { BusinessError } 1300002 - This window state is abnormal. 5565 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5566 * @syscap SystemCapability.WindowManager.WindowManager.Core 5567 * @StageModelOnly 5568 * @since 9 5569 */ 5570 /** 5571 * Loads content 5572 * 5573 * @param { string } path Path of the page to which the content will be loaded 5574 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 5575 * @param { AsyncCallback<void> } callback Callback used to return the result. 5576 * @throws { BusinessError } 401 - Parameter error. 5577 * @throws { BusinessError } 1300002 - This window state is abnormal. 5578 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5579 * @syscap SystemCapability.WindowManager.WindowManager.Core 5580 * @StageModelOnly 5581 * @crossplatform 5582 * @since 10 5583 */ 5584 /** 5585 * Loads content 5586 * 5587 * @param { string } path Path of the page to which the content will be loaded 5588 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 5589 * @param { AsyncCallback<void> } callback Callback used to return the result. 5590 * @throws { BusinessError } 401 - Parameter error. 5591 * @throws { BusinessError } 1300002 - This window state is abnormal. 5592 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5593 * @syscap SystemCapability.WindowManager.WindowManager.Core 5594 * @StageModelOnly 5595 * @crossplatform 5596 * @atomicservice 5597 * @since 11 5598 */ 5599 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 5600 /** 5601 * Loads content 5602 * 5603 * @param { string } path of the page to which the content will be loaded 5604 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 5605 * @returns { Promise<void> } 5606 * @throws { BusinessError } 401 - Parameter error. 5607 * @throws { BusinessError } 1300002 - This window state is abnormal. 5608 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5609 * @syscap SystemCapability.WindowManager.WindowManager.Core 5610 * @StageModelOnly 5611 * @since 9 5612 */ 5613 /** 5614 * Loads content 5615 * 5616 * @param { string } path of the page to which the content will be loaded 5617 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 5618 * @returns { Promise<void> } 5619 * @throws { BusinessError } 401 - Parameter error. 5620 * @throws { BusinessError } 1300002 - This window state is abnormal. 5621 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5622 * @syscap SystemCapability.WindowManager.WindowManager.Core 5623 * @StageModelOnly 5624 * @crossplatform 5625 * @since 10 5626 */ 5627 /** 5628 * Loads content 5629 * 5630 * @param { string } path of the page to which the content will be loaded 5631 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 5632 * @returns { Promise<void> } 5633 * @throws { BusinessError } 401 - Parameter error. 5634 * @throws { BusinessError } 1300002 - This window state is abnormal. 5635 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5636 * @syscap SystemCapability.WindowManager.WindowManager.Core 5637 * @StageModelOnly 5638 * @crossplatform 5639 * @atomicservice 5640 * @since 11 5641 */ 5642 loadContent(path: string, storage?: LocalStorage): Promise<void>; 5643 /** 5644 * Loads content 5645 * 5646 * @param { string } path of the page to which the content will be loaded 5647 * @param { AsyncCallback<void> } callback Callback used to return the result. 5648 * @throws { BusinessError } 401 - Parameter error. 5649 * @throws { BusinessError } 1300002 - This window state is abnormal. 5650 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5651 * @syscap SystemCapability.WindowManager.WindowManager.Core 5652 * @StageModelOnly 5653 * @since 9 5654 */ 5655 /** 5656 * Loads content 5657 * 5658 * @param { string } path of the page to which the content will be loaded 5659 * @param { AsyncCallback<void> } callback Callback used to return the result. 5660 * @throws { BusinessError } 401 - Parameter error. 5661 * @throws { BusinessError } 1300002 - This window state is abnormal. 5662 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5663 * @syscap SystemCapability.WindowManager.WindowManager.Core 5664 * @StageModelOnly 5665 * @crossplatform 5666 * @since 10 5667 */ 5668 /** 5669 * Loads content 5670 * 5671 * @param { string } path of the page to which the content will be loaded 5672 * @param { AsyncCallback<void> } callback Callback used to return the result. 5673 * @throws { BusinessError } 401 - Parameter error. 5674 * @throws { BusinessError } 1300002 - This window state is abnormal. 5675 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5676 * @syscap SystemCapability.WindowManager.WindowManager.Core 5677 * @StageModelOnly 5678 * @crossplatform 5679 * @atomicservice 5680 * @since 11 5681 */ 5682 loadContent(path: string, callback: AsyncCallback<void>): void; 5683 5684 /** 5685 * Loads content by named router 5686 * 5687 * @param { string } name - name of the page to which the content will be loaded. 5688 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 5689 * @param { AsyncCallback<void> } callback - Callback used to return the result. 5690 * @throws { BusinessError } 401 - Parameter error. 5691 * @throws { BusinessError } 1300002 - This window state is abnormal. 5692 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5693 * @syscap SystemCapability.WindowManager.WindowManager.Core 5694 * @stagemodelonly 5695 * @crossplatform 5696 * @atomicservice 5697 * @since 11 5698 */ 5699 loadContentByName(name: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 5700 5701 /** 5702 * Loads content by named router 5703 * 5704 * @param { string } name - name of the page to which the content will be loaded. 5705 * @param { AsyncCallback<void> } callback - Callback used to return the result. 5706 * @throws { BusinessError } 401 - Parameter error. 5707 * @throws { BusinessError } 1300002 - This window state is abnormal. 5708 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5709 * @syscap SystemCapability.WindowManager.WindowManager.Core 5710 * @stagemodelonly 5711 * @crossplatform 5712 * @atomicservice 5713 * @since 11 5714 */ 5715 loadContentByName(name: string, callback: AsyncCallback<void>): void; 5716 5717 /** 5718 * Loads content by named router 5719 * 5720 * @param { string } name - name of the page to which the content will be loaded. 5721 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window. 5722 * @returns { Promise<void> } Promise that returns no value. 5723 * @throws { BusinessError } 401 - Parameter error. 5724 * @throws { BusinessError } 1300002 - This window state is abnormal. 5725 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 5726 * @syscap SystemCapability.WindowManager.WindowManager.Core 5727 * @stagemodelonly 5728 * @crossplatform 5729 * @atomicservice 5730 * @since 11 5731 */ 5732 loadContentByName(name: string, storage?: LocalStorage): Promise<void>; 5733 5734 /** 5735 * Window stage event callback on. 5736 * 5737 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 5738 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 5739 * @throws { BusinessError } 401 - Parameter error. 5740 * @throws { BusinessError } 1300002 - This window state is abnormal. 5741 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5742 * @syscap SystemCapability.WindowManager.WindowManager.Core 5743 * @StageModelOnly 5744 * @since 9 5745 */ 5746 /** 5747 * Window stage event callback on. 5748 * 5749 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 5750 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 5751 * @throws { BusinessError } 401 - Parameter error. 5752 * @throws { BusinessError } 1300002 - This window state is abnormal. 5753 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5754 * @syscap SystemCapability.WindowManager.WindowManager.Core 5755 * @StageModelOnly 5756 * @crossplatform 5757 * @since 10 5758 */ 5759 /** 5760 * Window stage event callback on. 5761 * 5762 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 5763 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 5764 * @throws { BusinessError } 401 - Parameter error. 5765 * @throws { BusinessError } 1300002 - This window state is abnormal. 5766 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5767 * @syscap SystemCapability.WindowManager.WindowManager.Core 5768 * @StageModelOnly 5769 * @crossplatform 5770 * @atomicservice 5771 * @since 11 5772 */ 5773 on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void; 5774 /** 5775 * Window stage event callback off. 5776 * 5777 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 5778 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 5779 * @throws { BusinessError } 401 - Parameter error. 5780 * @throws { BusinessError } 1300002 - This window state is abnormal. 5781 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5782 * @syscap SystemCapability.WindowManager.WindowManager.Core 5783 * @StageModelOnly 5784 * @since 9 5785 */ 5786 /** 5787 * Window stage event callback off. 5788 * 5789 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 5790 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 5791 * @throws { BusinessError } 401 - Parameter error. 5792 * @throws { BusinessError } 1300002 - This window state is abnormal. 5793 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5794 * @syscap SystemCapability.WindowManager.WindowManager.Core 5795 * @StageModelOnly 5796 * @crossplatform 5797 * @since 10 5798 */ 5799 /** 5800 * Window stage event callback off. 5801 * 5802 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 5803 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 5804 * @throws { BusinessError } 401 - Parameter error. 5805 * @throws { BusinessError } 1300002 - This window state is abnormal. 5806 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5807 * @syscap SystemCapability.WindowManager.WindowManager.Core 5808 * @StageModelOnly 5809 * @crossplatform 5810 * @atomicservice 5811 * @since 11 5812 */ 5813 off(eventType: 'windowStageEvent', callback?: Callback<WindowStageEventType>): void; 5814 5815 /** 5816 * Disable window decoration. It must be called before loadContent. 5817 * 5818 * @throws { BusinessError } 1300002 - This window state is abnormal. 5819 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5820 * @syscap SystemCapability.WindowManager.WindowManager.Core 5821 * @systemapi 5822 * @StageModelOnly 5823 * @since 9 5824 */ 5825 disableWindowDecor(): void; 5826 5827 /** 5828 * Sets whether can show on lock screen or not 5829 * 5830 * @param { boolean } showOnLockScreen can show on lock screen if true, or not if false 5831 * @throws { BusinessError } 401 - Parameter error. 5832 * @throws { BusinessError } 1300002 - This window state is abnormal. 5833 * @throws { BusinessError } 1300005 - This window stage is abnormal. 5834 * @syscap SystemCapability.WindowManager.WindowManager.Core 5835 * @systemapi Hide this for inner system use. 5836 * @StageModelOnly 5837 * @since 9 5838 */ 5839 setShowOnLockScreen(showOnLockScreen: boolean): void; 5840 } 5841} 5842 5843export default window; 5844