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/// <reference path="../component/common_ts_ets_api.d.ts"/> 17 18import { AsyncCallback, Callback } from './@ohos.base'; 19import BaseContext from './application/BaseContext'; 20import { LocalStorage } from 'StateManagement'; 21import image from './@ohos.multimedia.image'; 22import rpc from './@ohos.rpc'; 23import dialogRequest from './@ohos.app.ability.dialogRequest'; 24import { UIContext } from './@ohos.arkui.UIContext'; 25 26/** 27 * Window manager. 28 * 29 * @namespace window 30 * @syscap SystemCapability.WindowManager.WindowManager.Core 31 */ 32/** 33 * Window manager. 34 * 35 * @namespace window 36 * @syscap SystemCapability.WindowManager.WindowManager.Core 37 * @crossplatform 38 * @since 10 39 */ 40declare namespace window { 41 /** 42 * The type of a window. 43 * 44 * @enum { number } 45 * @syscap SystemCapability.WindowManager.WindowManager.Core 46 * @since 7 47 */ 48 enum WindowType { 49 /** 50 * App. 51 * 52 * @syscap SystemCapability.WindowManager.WindowManager.Core 53 * @FAModelOnly 54 * @since 7 55 */ 56 TYPE_APP, 57 /** 58 * System alert. 59 * 60 * @syscap SystemCapability.WindowManager.WindowManager.Core 61 * @since 7 62 */ 63 TYPE_SYSTEM_ALERT, 64 /** 65 * Input method. 66 * 67 * @syscap SystemCapability.WindowManager.WindowManager.Core 68 * @systemapi Hide this for inner system use. 69 * @StageModelOnly 70 * @since 9 71 */ 72 TYPE_INPUT_METHOD, 73 /** 74 * Status bar. 75 * 76 * @syscap SystemCapability.WindowManager.WindowManager.Core 77 * @systemapi Hide this for inner system use. 78 * @StageModelOnly 79 * @since 9 80 */ 81 TYPE_STATUS_BAR, 82 /** 83 * Panel. 84 * 85 * @syscap SystemCapability.WindowManager.WindowManager.Core 86 * @systemapi Hide this for inner system use. 87 * @StageModelOnly 88 * @since 9 89 */ 90 TYPE_PANEL, 91 /** 92 * Keyguard. 93 * 94 * @syscap SystemCapability.WindowManager.WindowManager.Core 95 * @systemapi Hide this for inner system use. 96 * @StageModelOnly 97 * @since 9 98 */ 99 TYPE_KEYGUARD, 100 /** 101 * Volume. 102 * 103 * @syscap SystemCapability.WindowManager.WindowManager.Core 104 * @systemapi Hide this for inner system use. 105 * @StageModelOnly 106 * @since 9 107 */ 108 TYPE_VOLUME_OVERLAY, 109 /** 110 * Navigation bar. 111 * 112 * @syscap SystemCapability.WindowManager.WindowManager.Core 113 * @systemapi Hide this for inner system use. 114 * @StageModelOnly 115 * @since 9 116 */ 117 TYPE_NAVIGATION_BAR, 118 /** 119 * Float. 120 * 121 * @permission ohos.permission.SYSTEM_FLOAT_WINDOW 122 * @syscap SystemCapability.WindowManager.WindowManager.Core 123 * @StageModelOnly 124 * @since 9 125 */ 126 TYPE_FLOAT, 127 /** 128 * Wallpaper. 129 * 130 * @syscap SystemCapability.WindowManager.WindowManager.Core 131 * @systemapi Hide this for inner system use. 132 * @StageModelOnly 133 * @since 9 134 */ 135 TYPE_WALLPAPER, 136 /** 137 * Desktop. 138 * 139 * @syscap SystemCapability.WindowManager.WindowManager.Core 140 * @systemapi Hide this for inner system use. 141 * @StageModelOnly 142 * @since 9 143 */ 144 TYPE_DESKTOP, 145 /** 146 * Recent. 147 * 148 * @syscap SystemCapability.WindowManager.WindowManager.Core 149 * @systemapi Hide this for inner system use. 150 * @StageModelOnly 151 * @since 9 152 */ 153 TYPE_LAUNCHER_RECENT, 154 /** 155 * Dock. 156 * 157 * @syscap SystemCapability.WindowManager.WindowManager.Core 158 * @systemapi Hide this for inner system use. 159 * @StageModelOnly 160 * @since 9 161 */ 162 TYPE_LAUNCHER_DOCK, 163 /** 164 * Voice interaction. 165 * 166 * @syscap SystemCapability.WindowManager.WindowManager.Core 167 * @systemapi Hide this for inner system use. 168 * @StageModelOnly 169 * @since 9 170 */ 171 TYPE_VOICE_INTERACTION, 172 /** 173 * Pointer. 174 * 175 * @syscap SystemCapability.WindowManager.WindowManager.Core 176 * @systemapi Hide this for inner system use. 177 * @StageModelOnly 178 * @since 9 179 */ 180 TYPE_POINTER, 181 /** 182 * Float camera. 183 * 184 * @syscap SystemCapability.WindowManager.WindowManager.Core 185 * @systemapi Hide this for inner system use. 186 * @StageModelOnly 187 * @since 9 188 */ 189 TYPE_FLOAT_CAMERA, 190 /** 191 * Dialog. 192 * 193 * @syscap SystemCapability.WindowManager.WindowManager.Core 194 * @StageModelOnly 195 * @since 10 196 */ 197 TYPE_DIALOG, 198 /** 199 * Screenshot. 200 * 201 * @syscap SystemCapability.WindowManager.WindowManager.Core 202 * @systemapi Hide this for inner system use. 203 * @StageModelOnly 204 * @since 9 205 */ 206 TYPE_SCREENSHOT 207 } 208 209 /** 210 * Describes the type of avoid area 211 * 212 * @enum { number } 213 * @syscap SystemCapability.WindowManager.WindowManager.Core 214 * @since 7 215 */ 216 enum AvoidAreaType { 217 /** 218 * Default area of the system 219 * 220 * @syscap SystemCapability.WindowManager.WindowManager.Core 221 * @since 7 222 */ 223 TYPE_SYSTEM, 224 225 /** 226 * Notch 227 * 228 * @syscap SystemCapability.WindowManager.WindowManager.Core 229 * @since 7 230 */ 231 TYPE_CUTOUT, 232 233 /** 234 * Area for system gesture 235 * 236 * @syscap SystemCapability.WindowManager.WindowManager.Core 237 * @since 9 238 */ 239 TYPE_SYSTEM_GESTURE, 240 241 /** 242 * Area for keyboard 243 * 244 * @syscap SystemCapability.WindowManager.WindowManager.Core 245 * @since 9 246 */ 247 TYPE_KEYBOARD 248 } 249 /** 250 * Describes the window mode of an application 251 * 252 * @enum { number } 253 * @syscap SystemCapability.WindowManager.WindowManager.Core 254 * @systemapi Hide this for inner system use. 255 * @since 7 256 */ 257 enum WindowMode { 258 UNDEFINED = 1, 259 FULLSCREEN, 260 PRIMARY, 261 SECONDARY, 262 FLOATING 263 } 264 265 /** 266 * Describes the mode of window layout 267 * 268 * @enum { number } 269 * @syscap SystemCapability.WindowManager.WindowManager.Core 270 * @systemapi Hide this for inner system use. 271 * @since 9 272 */ 273 enum WindowLayoutMode { 274 /** 275 * CASCADE 276 * 277 * @syscap SystemCapability.WindowManager.WindowManager.Core 278 * @systemapi Hide this for inner system use. 279 * @since 9 280 */ 281 WINDOW_LAYOUT_MODE_CASCADE, 282 /** 283 * TILE 284 * 285 * @syscap SystemCapability.WindowManager.WindowManager.Core 286 * @systemapi Hide this for inner system use. 287 * @since 9 288 */ 289 WINDOW_LAYOUT_MODE_TILE 290 } 291 292 /** 293 * Properties of status bar and navigation bar, it couldn't update automatically 294 * 295 * @interface SystemBarProperties 296 * @syscap SystemCapability.WindowManager.WindowManager.Core 297 * @since 6 298 */ 299 interface SystemBarProperties { 300 /** 301 * The color of the status bar. 302 * 303 * @syscap SystemCapability.WindowManager.WindowManager.Core 304 * @since 6 305 */ 306 statusBarColor?: string; 307 308 /** 309 * The light icon of the status bar. 310 * 311 * @syscap SystemCapability.WindowManager.WindowManager.Core 312 * @since 7 313 */ 314 isStatusBarLightIcon?: boolean; 315 316 /** 317 * The content color of the status bar 318 * 319 * @syscap SystemCapability.WindowManager.WindowManager.Core 320 * @since 8 321 */ 322 statusBarContentColor?: string; 323 324 /** 325 * The color of the navigation bar. 326 * 327 * @syscap SystemCapability.WindowManager.WindowManager.Core 328 * @since 6 329 */ 330 navigationBarColor?: string; 331 332 /** 333 * The light icon of the navigation bar. 334 * 335 * @syscap SystemCapability.WindowManager.WindowManager.Core 336 * @since 7 337 */ 338 isNavigationBarLightIcon?: boolean; 339 340 /** 341 * The content color of the navigation bar 342 * 343 * @syscap SystemCapability.WindowManager.WindowManager.Core 344 * @since 8 345 */ 346 navigationBarContentColor?: string; 347 } 348 349 /** 350 * System bar tint of region 351 * 352 * @interface SystemBarRegionTint 353 * @syscap SystemCapability.WindowManager.WindowManager.Core 354 * @systemapi Hide this for inner system use. 355 * @since 8 356 */ 357 interface SystemBarRegionTint { 358 /** 359 * System bar type 360 * 361 * @syscap SystemCapability.WindowManager.WindowManager.Core 362 * @systemapi Hide this for inner system use. 363 * @since 8 364 */ 365 type: WindowType; 366 367 /** 368 * The visibility of system bar 369 * 370 * @syscap SystemCapability.WindowManager.WindowManager.Core 371 * @systemapi Hide this for inner system use. 372 * @since 8 373 */ 374 isEnable?: boolean; 375 376 /** 377 * The region of system bar 378 * 379 * @syscap SystemCapability.WindowManager.WindowManager.Core 380 * @systemapi Hide this for inner system use. 381 * @since 8 382 */ 383 region?: Rect; 384 385 /** 386 * The background color of the system bar. 387 * 388 * @syscap SystemCapability.WindowManager.WindowManager.Core 389 * @systemapi Hide this for inner system use. 390 * @since 8 391 */ 392 backgroundColor?: string; 393 394 /** 395 * The content color of the system bar. 396 * 397 * @syscap SystemCapability.WindowManager.WindowManager.Core 398 * @systemapi Hide this for inner system use. 399 * @since 8 400 */ 401 contentColor?: string; 402 } 403 404 /** 405 * System bar tint state for systemui 406 * 407 * @interface SystemBarTintState 408 * @syscap SystemCapability.WindowManager.WindowManager.Core 409 * @systemapi Hide this for inner system use. 410 * @since 8 411 */ 412 interface SystemBarTintState { 413 /** 414 * Id of display 415 * 416 * @syscap SystemCapability.WindowManager.WindowManager.Core 417 * @systemapi Hide this for inner system use. 418 * @since 8 419 */ 420 displayId: number; 421 /** 422 * Region tint of systembar 423 * 424 * @syscap SystemCapability.WindowManager.WindowManager.Core 425 * @systemapi Hide this for inner system use. 426 * @since 8 427 */ 428 regionTint: Array<SystemBarRegionTint>; 429 } 430 431 /** 432 * Rectangle 433 * 434 * @interface Rect 435 * @syscap SystemCapability.WindowManager.WindowManager.Core 436 * @since 7 437 */ 438 /** 439 * Rectangle 440 * 441 * @interface Rect 442 * @syscap SystemCapability.WindowManager.WindowManager.Core 443 * @crossplatform 444 * @since 10 445 */ 446 interface Rect { 447 448 /** 449 * The left of the Rect. 450 * 451 * @syscap SystemCapability.WindowManager.WindowManager.Core 452 * @since 7 453 */ 454 /** 455 * The left of the Rect. 456 * 457 * @syscap SystemCapability.WindowManager.WindowManager.Core 458 * @crossplatform 459 * @since 10 460 */ 461 left: number; 462 463 /** 464 * The top of the Rect. 465 * 466 * @syscap SystemCapability.WindowManager.WindowManager.Core 467 * @since 7 468 */ 469 /** 470 * The top of the Rect. 471 * 472 * @syscap SystemCapability.WindowManager.WindowManager.Core 473 * @crossplatform 474 * @since 10 475 */ 476 top: number; 477 478 /** 479 * The width of the Rect. 480 * 481 * @syscap SystemCapability.WindowManager.WindowManager.Core 482 * @since 7 483 */ 484 /** 485 * The width of the Rect. 486 * 487 * @syscap SystemCapability.WindowManager.WindowManager.Core 488 * @crossplatform 489 * @since 10 490 */ 491 width: number; 492 493 /** 494 * The height of the Rect. 495 * 496 * @syscap SystemCapability.WindowManager.WindowManager.Core 497 * @since 7 498 */ 499 /** 500 * The height of the Rect. 501 * 502 * @syscap SystemCapability.WindowManager.WindowManager.Core 503 * @crossplatform 504 * @since 10 505 */ 506 height: number; 507 } 508 509 /** 510 * Avoid area 511 * 512 * @interface AvoidArea 513 * @syscap SystemCapability.WindowManager.WindowManager.Core 514 * @since 7 515 */ 516 interface AvoidArea { 517 /** 518 * Whether avoidArea is visible on screen 519 * 520 * @type { boolean } 521 * @syscap SystemCapability.WindowManager.WindowManager.Core 522 * @since 9 523 */ 524 visible: boolean; 525 526 /** 527 * Rectangle on the left of the screen 528 * 529 * @type { Rect } 530 * @syscap SystemCapability.WindowManager.WindowManager.Core 531 * @since 7 532 */ 533 leftRect: Rect; 534 535 /** 536 * Rectangle on the top of the screen 537 * 538 * @type { Rect } 539 * @syscap SystemCapability.WindowManager.WindowManager.Core 540 * @since 7 541 */ 542 topRect: Rect; 543 544 /** 545 * Rectangle on the right of the screen 546 * 547 * @type { Rect } 548 * @syscap SystemCapability.WindowManager.WindowManager.Core 549 * @since 7 550 */ 551 rightRect: Rect; 552 553 /** 554 * Rectangle on the bottom of the screen 555 * 556 * @type { Rect } 557 * @syscap SystemCapability.WindowManager.WindowManager.Core 558 * @since 7 559 */ 560 bottomRect: Rect; 561 } 562 563 /** 564 * Window size 565 * 566 * @interface Size 567 * @syscap SystemCapability.WindowManager.WindowManager.Core 568 * @since 7 569 */ 570 /** 571 * Window size 572 * 573 * @interface Size 574 * @syscap SystemCapability.WindowManager.WindowManager.Core 575 * @crossplatform 576 * @since 10 577 */ 578 interface Size { 579 /** 580 * The width of the window. 581 * 582 * @type { number } 583 * @syscap SystemCapability.WindowManager.WindowManager.Core 584 * @since 7 585 */ 586 /** 587 * The width of the window. 588 * 589 * @type { number } 590 * @syscap SystemCapability.WindowManager.WindowManager.Core 591 * @crossplatform 592 * @since 10 593 */ 594 width: number; 595 596 /** 597 * The height of the window. 598 * 599 * @syscap SystemCapability.WindowManager.WindowManager.Core 600 * @since 7 601 */ 602 /** 603 * The height of the window. 604 * 605 * @type { number } 606 * @syscap SystemCapability.WindowManager.WindowManager.Core 607 * @crossplatform 608 * @since 10 609 */ 610 height: number; 611 } 612 613 /** 614 * Properties of window, it couldn't update automatically 615 * 616 * @interface WindowProperties 617 * @syscap SystemCapability.WindowManager.WindowManager.Core 618 * @since 6 619 */ 620 /** 621 * Properties of window, it couldn't update automatically 622 * 623 * @interface WindowProperties 624 * @syscap SystemCapability.WindowManager.WindowManager.Core 625 * @crossplatform 626 * @since 10 627 */ 628 interface WindowProperties { 629 /** 630 * The position and size of the window 631 * 632 * @type { Rect } 633 * @syscap SystemCapability.WindowManager.WindowManager.Core 634 * @since 7 635 */ 636 /** 637 * The position and size of the window 638 * 639 * @type { Rect } 640 * @syscap SystemCapability.WindowManager.WindowManager.Core 641 * @crossplatform 642 * @since 10 643 */ 644 windowRect: Rect; 645 646 /** 647 * Window type 648 * 649 * @type { WindowType } 650 * @syscap SystemCapability.WindowManager.WindowManager.Core 651 * @since 7 652 */ 653 type: WindowType; 654 655 /** 656 * Whether the window is displayed in full screen mode. The default value is false. 657 * 658 * @type { boolean } 659 * @syscap SystemCapability.WindowManager.WindowManager.Core 660 * @since 6 661 */ 662 isFullScreen: boolean; 663 664 /** 665 * Whether the window layout is in full screen mode(whether the window is immersive). The default value is false. 666 * 667 * @type { boolean } 668 * @syscap SystemCapability.WindowManager.WindowManager.Core 669 * @since 7 670 */ 671 isLayoutFullScreen: boolean; 672 673 /** 674 * Whether the window can gain focus. The default value is true 675 * 676 * @type { boolean } 677 * @syscap SystemCapability.WindowManager.WindowManager.Core 678 * @since 7 679 */ 680 focusable: boolean; 681 682 /** 683 * Whether the window is touchable. The default value is false 684 * 685 * @type { boolean } 686 * @syscap SystemCapability.WindowManager.WindowManager.Core 687 * @since 7 688 */ 689 touchable: boolean; 690 691 /** 692 * Brightness value of window. 693 * 694 * @syscap SystemCapability.WindowManager.WindowManager.Core 695 * @since 6 696 */ 697 /** 698 * Brightness value of window. 699 * 700 * @type { number } 701 * @syscap SystemCapability.WindowManager.WindowManager.Core 702 * @crossplatform 703 * @since 10 704 */ 705 brightness: number; 706 707 /** 708 * The dimbehind value of window. 709 * 710 * @type { number } 711 * @syscap SystemCapability.WindowManager.WindowManager.Core 712 * @since 7 713 * @deprecated since 9 714 */ 715 dimBehindValue: number; 716 717 /** 718 * Whether keep screen on. 719 * 720 * @syscap SystemCapability.WindowManager.WindowManager.Core 721 * @since 6 722 */ 723 /** 724 * Whether keep screen on. 725 * 726 * @type { boolean } 727 * @syscap SystemCapability.WindowManager.WindowManager.Core 728 * @crossplatform 729 * @since 10 730 */ 731 isKeepScreenOn: boolean; 732 733 /** 734 * Whether make window in privacy mode or not. 735 * 736 * @type { boolean } 737 * @syscap SystemCapability.WindowManager.WindowManager.Core 738 * @since 7 739 */ 740 isPrivacyMode: boolean; 741 742 /** 743 * Whether is round corner or not. 744 * 745 * @type { boolean } 746 * @syscap SystemCapability.WindowManager.WindowManager.Core 747 * @since 7 748 * @deprecated since 9 749 */ 750 isRoundCorner: boolean; 751 752 /** 753 * Whether is transparent or not. 754 * 755 * @type { boolean } 756 * @syscap SystemCapability.WindowManager.WindowManager.Core 757 * @since 7 758 */ 759 isTransparent: boolean; 760 761 /** 762 * Window id. 763 * 764 * @type { number } 765 * @syscap SystemCapability.WindowManager.WindowManager.Core 766 * @since 9 767 */ 768 id: number; 769 } 770 771 /** 772 * Type of allowing the specified of color space. 773 * 774 * @enum { number } 775 * @syscap SystemCapability.WindowManager.WindowManager.Core 776 * @since 8 777 */ 778 enum ColorSpace { 779 /** 780 * Default color space. 781 * 782 * @syscap SystemCapability.WindowManager.WindowManager.Core 783 * @since 8 784 */ 785 DEFAULT, 786 /** 787 * Wide gamut color space. The specific wide color gamut depends on thr screen. 788 * 789 * @syscap SystemCapability.WindowManager.WindowManager.Core 790 * @since 8 791 */ 792 WIDE_GAMUT 793 } 794 /** 795 * Describes the scale Transition Options of window 796 * 797 * @interface ScaleOptions 798 * @syscap SystemCapability.WindowManager.WindowManager.Core 799 * @systemapi 800 * @since 9 801 */ 802 interface ScaleOptions { 803 /** 804 * The scale param of x direction. Default is 1.f 805 * 806 * @syscap SystemCapability.WindowManager.WindowManager.Core 807 * @systemapi 808 * @since 9 809 */ 810 x?: number; 811 812 /** 813 * The scale param of y direction. Default is 1.f 814 * 815 * @syscap SystemCapability.WindowManager.WindowManager.Core 816 * @systemapi 817 * @since 9 818 */ 819 y?: number; 820 821 /** 822 * The scale param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 823 * 824 * @syscap SystemCapability.WindowManager.WindowManager.Core 825 * @systemapi 826 * @since 9 827 */ 828 pivotX?: number; 829 830 /** 831 * The scale param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 832 * 833 * @syscap SystemCapability.WindowManager.WindowManager.Core 834 * @systemapi 835 * @since 9 836 */ 837 pivotY?: number; 838 } 839 840 /** 841 * Describes the rotate Transition Options of window 842 * 843 * @interface RotateOptions 844 * @syscap SystemCapability.WindowManager.WindowManager.Core 845 * @systemapi 846 * @since 9 847 */ 848 interface RotateOptions { 849 /** 850 * The rotate degree of x direction. Default value is 0.f 851 * 852 * @type { ?number } 853 * @syscap SystemCapability.WindowManager.WindowManager.Core 854 * @systemapi 855 * @since 9 856 */ 857 x?: number; 858 859 /** 860 * The rotate degree of y direction. Default value is 0.f 861 * 862 * @type { ?number } 863 * @syscap SystemCapability.WindowManager.WindowManager.Core 864 * @systemapi 865 * @since 9 866 */ 867 y?: number; 868 869 /** 870 * The rotate degree of z direction. Default value is 0.f 871 * 872 * @type { ?number } 873 * @syscap SystemCapability.WindowManager.WindowManager.Core 874 * @systemapi 875 * @since 9 876 */ 877 z?: number; 878 879 /** 880 * The param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 881 * 882 * @type { ?number } 883 * @syscap SystemCapability.WindowManager.WindowManager.Core 884 * @systemapi 885 * @since 9 886 */ 887 pivotX?: number; 888 889 /** 890 * The param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 891 * 892 * @type { ?number } 893 * @syscap SystemCapability.WindowManager.WindowManager.Core 894 * @systemapi 895 * @since 9 896 */ 897 pivotY?: number; 898 } 899 900 /** 901 * Describes the translate Transition Options of window 902 * 903 * @interface TranslateOptions 904 * @syscap SystemCapability.WindowManager.WindowManager.Core 905 * @systemapi 906 * @since 9 907 */ 908 interface TranslateOptions { 909 /** 910 * The translate pixel param of x direction. Default is 0.f 911 * 912 * @type { ?number } 913 * @syscap SystemCapability.WindowManager.WindowManager.Core 914 * @systemapi 915 * @since 9 916 */ 917 x?: number; 918 919 /** 920 * The translate pixel param of y direction. Default is 0.f 921 * 922 * @type { ?number } 923 * @syscap SystemCapability.WindowManager.WindowManager.Core 924 * @systemapi 925 * @since 9 926 */ 927 y?: number; 928 929 /** 930 * The translate pixel param of z direction. Default is 0.f 931 * 932 * @type { ?number } 933 * @syscap SystemCapability.WindowManager.WindowManager.Core 934 * @systemapi 935 * @since 9 936 */ 937 z?: number; 938 } 939 940 /** 941 * Transition Context 942 * 943 * @interface TransitionContext 944 * @syscap SystemCapability.WindowManager.WindowManager.Core 945 * @systemapi 946 * @since 9 947 */ 948 interface TransitionContext { 949 /** 950 * The target window with animation 951 * 952 * @type { Window } 953 * @syscap SystemCapability.WindowManager.WindowManager.Core 954 * @systemapi 955 * @since 9 956 */ 957 toWindow: Window; 958 959 /** 960 * Set complete state of animation transition 961 * 962 * @param { boolean } isCompleted - Whether the transition is complete. The value true means that the transition is complete, and false means the opposite. 963 * @throws { BusinessError } 401 - Parameter error. 964 * @syscap SystemCapability.WindowManager.WindowManager.Core 965 * @systemapi 966 * @since 9 967 */ 968 completeTransition(isCompleted: boolean): void; 969 } 970 971 /** 972 * Transition Controller 973 * 974 * @interface TransitionController 975 * @syscap SystemCapability.WindowManager.WindowManager.Core 976 * @systemapi 977 * @since 9 978 */ 979 interface TransitionController { 980 /** 981 * Animation configuration when showing window 982 * 983 * @param { TransitionContext } context - The transition context. 984 * @throws { BusinessError } 401 - Parameter error. 985 * @syscap SystemCapability.WindowManager.WindowManager.Core 986 * @systemapi 987 * @since 9 988 */ 989 animationForShown(context: TransitionContext): void; 990 /** 991 * Animation configuration when hiding window 992 * 993 * @param { TransitionContext } context - The transition context. 994 * @throws { BusinessError } 401 - Parameter error. 995 * @syscap SystemCapability.WindowManager.WindowManager.Core 996 * @systemapi 997 * @since 9 998 */ 999 animationForHidden(context: TransitionContext): void; 1000 } 1001 1002 /** 1003 * Configuration parameters for window creation. 1004 * 1005 * @interface Configuration 1006 * @syscap SystemCapability.WindowManager.WindowManager.Core 1007 * @since 9 1008 */ 1009 interface Configuration { 1010 /** 1011 * Indicates window id. 1012 * 1013 * @syscap SystemCapability.WindowManager.WindowManager.Core 1014 * @since 9 1015 */ 1016 name: string; 1017 1018 /** 1019 * Indicates window type 1020 * 1021 * @type { WindowType } 1022 * @syscap SystemCapability.WindowManager.WindowManager.Core 1023 * @since 9 1024 */ 1025 windowType: WindowType; 1026 1027 /** 1028 * Indicates window context. 1029 * 1030 * @type { ?BaseContext } 1031 * @syscap SystemCapability.WindowManager.WindowManager.Core 1032 * @since 9 1033 */ 1034 ctx?: BaseContext; 1035 1036 /** 1037 * Indicates display ID. 1038 * 1039 * @type { ?number } 1040 * @syscap SystemCapability.WindowManager.WindowManager.Core 1041 * @since 9 1042 */ 1043 displayId?: number; 1044 1045 /** 1046 * Indicates Parent window id 1047 * 1048 * @type { ?number } 1049 * @syscap SystemCapability.WindowManager.WindowManager.Core 1050 * @since 9 1051 */ 1052 parentId?: number; 1053 } 1054 1055 /** 1056 * Create a window with a specific configuration 1057 * 1058 * @param { Configuration } config - Parameters for window creation. 1059 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 1060 * @throws { BusinessError } 201 - Permission verification failed. 1061 * @throws { BusinessError } 401 - Parameter error. 1062 * @throws { BusinessError } 1300001 - Repeated operation. 1063 * @throws { BusinessError } 1300006 - This window context is abnormal. 1064 * @throws { BusinessError } 1300008 - The operation is on invalid display. 1065 * @throws { BusinessError } 1300009 - The parent window is invalid. 1066 * @syscap SystemCapability.WindowManager.WindowManager.Core 1067 * @since 9 1068 */ 1069 function createWindow(config: Configuration, callback: AsyncCallback<Window>): void; 1070 1071 /** 1072 * Create a window with a specific configuration 1073 * 1074 * @param { Configuration } config - Parameters for window creation. 1075 * @returns { Promise<Window> } Promise used to return the window created. 1076 * @throws { BusinessError } 201 - Permission verification failed. 1077 * @throws { BusinessError } 401 - Parameter error. 1078 * @throws { BusinessError } 1300001 - Repeated operation. 1079 * @throws { BusinessError } 1300006 - This window context is abnormal. 1080 * @throws { BusinessError } 1300008 - The operation is on invalid display. 1081 * @throws { BusinessError } 1300009 - The parent window is invalid. 1082 * @syscap SystemCapability.WindowManager.WindowManager.Core 1083 * @since 9 1084 */ 1085 function createWindow(config: Configuration): Promise<Window>; 1086 1087 /** 1088 * Create a sub window with a specific id and type, only support 7. 1089 * 1090 * @param { string } id - Indicates window id. 1091 * @param { WindowType } type - Indicates window type. 1092 * @param { AsyncCallback<Window> } callback - Callback used to return the subwindow created. 1093 * @syscap SystemCapability.WindowManager.WindowManager.Core 1094 * @FAModelOnly 1095 * @since 7 1096 * @deprecated since 9 1097 * @useinstead ohos.window#createWindow 1098 */ 1099 function create(id: string, type: WindowType, callback: AsyncCallback<Window>): void; 1100 1101 /** 1102 * Create a sub window with a specific id and type, only support 7. 1103 * 1104 * @param { string } id - Indicates window id. 1105 * @param { WindowType } type - Indicates window type. 1106 * @returns { Promise<Window> } Promise used to return the subwindow created. 1107 * @syscap SystemCapability.WindowManager.WindowManager.Core 1108 * @FAModelOnly 1109 * @since 7 1110 * @deprecated since 9 1111 * @useinstead ohos.window#createWindow 1112 */ 1113 function create(id: string, type: WindowType): Promise<Window>; 1114 1115 /** 1116 * Create a system or float window with a specific id and type. 1117 * 1118 * @param { BaseContext } ctx - Indicates the context on which the window depends 1119 * @param { string } id - Indicates window id. 1120 * @param { WindowType } type - Indicates window type. 1121 * @returns { Promise<Window> } Promise used to return the window created. 1122 * @syscap SystemCapability.WindowManager.WindowManager.Core 1123 * @since 8 1124 * @deprecated since 9 1125 * @useinstead ohos.window#createWindow 1126 */ 1127 function create(ctx: BaseContext, id: string, type: WindowType): Promise<Window>; 1128 1129 /** 1130 * Create a system or float window with a specific id and type. 1131 * 1132 * @param { BaseContext } ctx - Indicates the context on which the window depends 1133 * @param { string } id - Indicates window id. 1134 * @param { WindowType } type - Indicates window type. 1135 * @param { AsyncCallback<Window> } callback - Callback used to return the window created. 1136 * @syscap SystemCapability.WindowManager.WindowManager.Core 1137 * @since 8 1138 * @deprecated since 9 1139 * @useinstead ohos.window#createWindow 1140 */ 1141 function create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback<Window>): void; 1142 1143 /** 1144 * Find the window by id. 1145 * 1146 * @param { string } id - Indicates window id. 1147 * @param { AsyncCallback<Window> } callback - Callback used to return the window found. 1148 * @syscap SystemCapability.WindowManager.WindowManager.Core 1149 * @since 7 1150 * @deprecated since 9 1151 * @useinstead ohos.window#findWindow 1152 */ 1153 function find(id: string, callback: AsyncCallback<Window>): void; 1154 1155 /** 1156 * Find the window by id. 1157 * 1158 * @param { string } id - Indicates window id. 1159 * @returns { Promise<Window> } Window found. 1160 * @syscap SystemCapability.WindowManager.WindowManager.Core 1161 * @since 7 1162 * @deprecated since 9 1163 * @useinstead ohos.window#findWindow 1164 */ 1165 function find(id: string): Promise<Window>; 1166 1167 /** 1168 * Find the window by name. 1169 * 1170 * @param { string } name - Indicates window name. 1171 * @returns { Window } Window found. 1172 * @throws { BusinessError } 401 - Parameter error. 1173 * @throws { BusinessError } 1300002 - This window state is abnormal. 1174 * @syscap SystemCapability.WindowManager.WindowManager.Core 1175 * @since 9 1176 */ 1177 /** 1178 * Find the window by name. 1179 * 1180 * @param { string } name - Indicates window name. 1181 * @returns { Window } Window found. 1182 * @throws { BusinessError } 401 - Parameter error. 1183 * @throws { BusinessError } 1300002 - This window state is abnormal. 1184 * @syscap SystemCapability.WindowManager.WindowManager.Core 1185 * @crossplatform 1186 * @since 10 1187 */ 1188 function findWindow(name: string): Window; 1189 1190 /** 1191 * Get the final show window. 1192 * 1193 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1194 * @syscap SystemCapability.WindowManager.WindowManager.Core 1195 * @FAModelOnly 1196 * @since 6 1197 * @deprecated since 9 1198 * @useinstead ohos.window#getLastWindow 1199 */ 1200 function getTopWindow(callback: AsyncCallback<Window>): void; 1201 1202 /** 1203 * Get the final show window. 1204 * 1205 * @returns { Promise<Window> } Promise used to return the top window obtained. 1206 * @syscap SystemCapability.WindowManager.WindowManager.Core 1207 * @FAModelOnly 1208 * @since 6 1209 * @deprecated since 9 1210 * @useinstead ohos.window#getLastWindow 1211 */ 1212 function getTopWindow(): Promise<Window>; 1213 1214 /** 1215 * Get the final show window. 1216 * 1217 * @param { BaseContext } ctx - Indicates the context on which the window depends 1218 * @returns { Promise<Window> } Promise used to return the top window obtained. 1219 * @syscap SystemCapability.WindowManager.WindowManager.Core 1220 * @since 8 1221 * @deprecated since 9 1222 * @useinstead ohos.window#getLastWindow 1223 */ 1224 function getTopWindow(ctx: BaseContext): Promise<Window>; 1225 1226 /** 1227 * Get the final show window. 1228 * 1229 * @param { BaseContext } ctx - Indicates the context on which the window depends 1230 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1231 * @syscap SystemCapability.WindowManager.WindowManager.Core 1232 * @since 8 1233 * @deprecated since 9 1234 * @useinstead ohos.window#getLastWindow 1235 */ 1236 function getTopWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 1237 1238 /** 1239 * Get the final show window. 1240 * 1241 * @param { BaseContext } ctx - Current application context. 1242 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1243 * @throws { BusinessError } 401 - Parameter error. 1244 * @throws { BusinessError } 1300002 - This window state is abnormal. 1245 * @throws { BusinessError } 1300006 - This window context is abnormal. 1246 * @syscap SystemCapability.WindowManager.WindowManager.Core 1247 * @since 9 1248 */ 1249 /** 1250 * Get the final show window. 1251 * 1252 * @param { BaseContext } ctx - Current application context. 1253 * @param { AsyncCallback<Window> } callback - Callback used to return the top window obtained. 1254 * @throws { BusinessError } 401 - Parameter error. 1255 * @throws { BusinessError } 1300002 - This window state is abnormal. 1256 * @throws { BusinessError } 1300006 - This window context is abnormal. 1257 * @syscap SystemCapability.WindowManager.WindowManager.Core 1258 * @crossplatform 1259 * @since 10 1260 */ 1261 function getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 1262 1263 /** 1264 * Get the final show window. 1265 * 1266 * @param { BaseContext } ctx - Current application context. 1267 * @returns { Promise<Window> } Promise used to return the top window obtained. 1268 * @throws { BusinessError } 401 - Parameter error. 1269 * @throws { BusinessError } 1300002 - This window state is abnormal. 1270 * @throws { BusinessError } 1300006 - This window context is abnormal. 1271 * @syscap SystemCapability.WindowManager.WindowManager.Core 1272 * @since 9 1273 */ 1274 /** 1275 * Get the final show window. 1276 * 1277 * @param { BaseContext } ctx - Current application context. 1278 * @returns { Promise<Window> } Promise used to return the top window obtained. 1279 * @throws { BusinessError } 401 - Parameter error. 1280 * @throws { BusinessError } 1300002 - This window state is abnormal. 1281 * @throws { BusinessError } 1300006 - This window context is abnormal. 1282 * @syscap SystemCapability.WindowManager.WindowManager.Core 1283 * @crossplatform 1284 * @since 10 1285 */ 1286 function getLastWindow(ctx: BaseContext): Promise<Window>; 1287 1288 /** 1289 * Minimize all app windows. 1290 * 1291 * @param { number } id - ID of the display. 1292 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1293 * @throws { BusinessError } 401 - Parameter error. 1294 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1295 * @syscap SystemCapability.WindowManager.WindowManager.Core 1296 * @systemapi Hide this for inner system use. 1297 * @since 9 1298 */ 1299 function minimizeAll(id: number, callback: AsyncCallback<void>): void; 1300 1301 /** 1302 * Minimize all app windows. 1303 * 1304 * @param { number } id - ID of the display. 1305 * @returns { Promise<void> } Promise that returns no value. 1306 * @throws { BusinessError } 401 - Parameter error. 1307 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1308 * @syscap SystemCapability.WindowManager.WindowManager.Core 1309 * @systemapi Hide this for inner system use. 1310 * @since 9 1311 */ 1312 function minimizeAll(id: number): Promise<void>; 1313 1314 /** 1315 * Toggle shown state for all app windows. Minimize or restore all app windows. 1316 * 1317 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1318 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1319 * @syscap SystemCapability.WindowManager.WindowManager.Core 1320 * @systemapi Hide this for inner system use. 1321 * @since 9 1322 */ 1323 function toggleShownStateForAllAppWindows(callback: AsyncCallback<void>): void; 1324 1325 /** 1326 * Toggle shown state for all app windows. Minimize or restore all app windows. 1327 * 1328 * @returns { Promise<void> } Promise that returns no value. 1329 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1330 * @syscap SystemCapability.WindowManager.WindowManager.Core 1331 * @systemapi Hide this for inner system use. 1332 * @since 9 1333 */ 1334 function toggleShownStateForAllAppWindows(): Promise<void>; 1335 1336 /** 1337 * Set the layout mode of a window. 1338 * 1339 * @param { WindowLayoutMode } mode - The layout mode of a window. 1340 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1341 * @throws { BusinessError } 401 - Parameter error. 1342 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1343 * @syscap SystemCapability.WindowManager.WindowManager.Core 1344 * @systemapi Hide this for inner system use. 1345 * @since 9 1346 */ 1347 function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback<void>): void; 1348 1349 /** 1350 * Set the layout mode of a window. 1351 * 1352 * @param { WindowLayoutMode } mode - The layout mode of a window. 1353 * @returns { Promise<void> } Promise that returns no value. 1354 * @throws { BusinessError } 401 - Parameter error. 1355 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1356 * @syscap SystemCapability.WindowManager.WindowManager.Core 1357 * @systemapi Hide this for inner system use. 1358 * @since 9 1359 */ 1360 function setWindowLayoutMode(mode: WindowLayoutMode): Promise<void>; 1361 1362 /** 1363 * Sets whether to enable gesture navigation. 1364 * 1365 * @param { boolean } enable - Gesture navigation if true, or disable if false. 1366 * @param { AsyncCallback<void> } callback - The callback of setGestureNavigationEnabled. 1367 * @throws { BusinessError } 401 - Parameter error.. 1368 * @throws { BusinessError } 1300002 - This window state is abnormal. 1369 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1370 * @syscap SystemCapability.WindowManager.WindowManager.Core 1371 * @systemapi Hide this for inner system use. 1372 * @since 10 1373 */ 1374 function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback<void>): void; 1375 1376 /** 1377 * Sets whether to enable gesture navigation. 1378 * 1379 * @param { boolean } enable - Gesture navigation if true, or disable if false. 1380 * @returns { Promise<void> } - The promise returned by the function. 1381 * @throws { BusinessError } 401 - Parameter error.. 1382 * @throws { BusinessError } 1300002 - This window state is abnormal. 1383 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1384 * @syscap SystemCapability.WindowManager.WindowManager.Core 1385 * @systemapi Hide this for inner system use. 1386 * @since 10 1387 */ 1388 function setGestureNavigationEnabled(enable: boolean): Promise<void>; 1389 1390 /** 1391 * Set watermark image. 1392 * 1393 * @param { image.PixelMap } pixelMap - Watermark image. 1394 * @param { boolean } enable - Show watermark if true. 1395 * @returns { Promise<void> } - Promise that returns no value. 1396 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1397 * @throws { BusinessError } 401 - Parameter error. 1398 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1399 * @syscap SystemCapability.WindowManager.WindowManager.Core 1400 * @systemapi Hide this for inner system use. 1401 * @since 10 1402 */ 1403 function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise<void>; 1404 1405 /** 1406 * Set watermark image. 1407 * 1408 * @param { image.PixelMap } pixelMap - Watermark image. 1409 * @param { boolean } enable - Show watermark if true. 1410 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkImage. 1411 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1412 * @throws { BusinessError } 401 - Parameter error. 1413 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1414 * @syscap SystemCapability.WindowManager.WindowManager.Core 1415 * @systemapi Hide this for inner system use. 1416 * @since 10 1417 */ 1418 function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCallback<void>): void; 1419 1420 /** 1421 * Register the callback of systemBarTintChange 1422 * 1423 * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. 1424 * @param { Callback<SystemBarTintState> } callback - Callback used to return the properties of the system bar. 1425 * @throws { BusinessError } 401 - Parameter error. 1426 * @syscap SystemCapability.WindowManager.WindowManager.Core 1427 * @systemapi Hide this for inner system use. 1428 * @since 8 1429 */ 1430 function on(type: 'systemBarTintChange', callback: Callback<SystemBarTintState>): void; 1431 1432 /** 1433 * Unregister the callback of systemBarTintChange 1434 * 1435 * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. 1436 * @param { Callback<SystemBarTintState> } callback - Callback used to return the properties of the system bar. 1437 * @throws { BusinessError } 401 - Parameter error. 1438 * @syscap SystemCapability.WindowManager.WindowManager.Core 1439 * @systemapi Hide this for inner system use. 1440 * @since 8 1441 */ 1442 function off(type: 'systemBarTintChange', callback?: Callback<SystemBarTintState>): void; 1443 1444 /** 1445 * Register the callback for gesture navigation enabled changes. 1446 * 1447 * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. 1448 * @param { Callback<boolean> } callback Callback used to return the result whether gesture navigation enabled or not. 1449 * @throws { BusinessError } 401 - Parameter error.. 1450 * @throws { BusinessError } 1300002 - This window state is abnormal. 1451 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1452 * @syscap SystemCapability.WindowManager.WindowManager.Core 1453 * @systemapi Hide this for inner system use. 1454 * @since 10 1455 */ 1456 function on(type: 'gestureNavigationEnabledChange', callback: Callback<boolean>): void; 1457 1458 /** 1459 * Unregister the callback for gesture navigation enabled changes. 1460 * 1461 * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. 1462 * @param { Callback<boolean> } callback Callback used to return the result whether gesture navigation enabled or not. 1463 * @throws { BusinessError } 401 - Parameter error.. 1464 * @throws { BusinessError } 1300002 - This window state is abnormal. 1465 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1466 * @syscap SystemCapability.WindowManager.WindowManager.Core 1467 * @systemapi Hide this for inner system use. 1468 * @since 10 1469 */ 1470 function off(type: 'gestureNavigationEnabledChange', callback?: Callback<boolean>): void; 1471 1472 /** 1473 * Register the callback for watermark flag change. 1474 * 1475 * @param { 'waterMarkFlagChange' } type the event of watermark flag change. 1476 * @param { Callback<boolean> } callback Callback used to return the result whether watermark flag change or not. 1477 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1478 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1479 * @syscap SystemCapability.WindowManager.WindowManager.Core 1480 * @systemapi Hide this for inner system use. 1481 * @since 10 1482 */ 1483 function on(type: 'waterMarkFlagChange', callback: Callback<boolean>): void; 1484 1485 /** 1486 * Unregister the callback for watermark flag change. 1487 * 1488 * @param { 'waterMarkFlagChange' } type the event of watermark flag change. 1489 * @param { Callback<boolean> } callback Callback used to return the result whether watermark flag change or not. 1490 * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 1491 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1492 * @syscap SystemCapability.WindowManager.WindowManager.Core 1493 * @systemapi Hide this for inner system use. 1494 * @since 10 1495 */ 1496 function off(type: 'waterMarkFlagChange', callback?: Callback<boolean>): void; 1497 /** 1498 * Display orientation 1499 * 1500 * @enum { number } 1501 * @syscap SystemCapability.WindowManager.WindowManager.Core 1502 * @since 9 1503 */ 1504 /** 1505 * Display orientation 1506 * 1507 * @enum { number } 1508 * @syscap SystemCapability.WindowManager.WindowManager.Core 1509 * @crossplatform 1510 * @since 10 1511 */ 1512 enum Orientation { 1513 /** 1514 * Default value. The direction mode is not clearly defined. It is determined by the system. 1515 * 1516 * @syscap SystemCapability.WindowManager.WindowManager.Core 1517 * @since 9 1518 */ 1519 /** 1520 * Default value. The direction mode is not clearly defined. It is determined by the system. 1521 * 1522 * @syscap SystemCapability.WindowManager.WindowManager.Core 1523 * @crossplatform 1524 * @since 10 1525 */ 1526 UNSPECIFIED = 0, 1527 1528 /** 1529 * Display in portrait orientation. 1530 * 1531 * @syscap SystemCapability.WindowManager.WindowManager.Core 1532 * @since 9 1533 */ 1534 /** 1535 * Display in portrait orientation. 1536 * 1537 * @syscap SystemCapability.WindowManager.WindowManager.Core 1538 * @crossplatform 1539 * @since 10 1540 */ 1541 PORTRAIT = 1, 1542 1543 /** 1544 * Display in landscape orientation. 1545 * 1546 * @syscap SystemCapability.WindowManager.WindowManager.Core 1547 * @since 9 1548 */ 1549 /** 1550 * Display in landscape orientation. 1551 * 1552 * @syscap SystemCapability.WindowManager.WindowManager.Core 1553 * @crossplatform 1554 * @since 10 1555 */ 1556 LANDSCAPE = 2, 1557 1558 /** 1559 * Display in inverted portrait orientation. 1560 * 1561 * @syscap SystemCapability.WindowManager.WindowManager.Core 1562 * @since 9 1563 */ 1564 /** 1565 * Display in inverted portrait orientation. 1566 * 1567 * @syscap SystemCapability.WindowManager.WindowManager.Core 1568 * @crossplatform 1569 * @since 10 1570 */ 1571 PORTRAIT_INVERTED = 3, 1572 1573 /** 1574 * Display in inverted landscape orientation. 1575 * 1576 * @syscap SystemCapability.WindowManager.WindowManager.Core 1577 * @since 9 1578 */ 1579 /** 1580 * Display in inverted landscape orientation. 1581 * 1582 * @syscap SystemCapability.WindowManager.WindowManager.Core 1583 * @crossplatform 1584 * @since 10 1585 */ 1586 LANDSCAPE_INVERTED = 4, 1587 1588 /** 1589 * Follow the rotation of the sensor, ignore auto rotation lock. 1590 * 1591 * @syscap SystemCapability.WindowManager.WindowManager.Core 1592 * @since 9 1593 */ 1594 AUTO_ROTATION = 5, 1595 1596 /** 1597 * Follow the rotation of the sensor, only work in the vertical direction, ignore auto rotation lock. 1598 * 1599 * @syscap SystemCapability.WindowManager.WindowManager.Core 1600 * @since 9 1601 */ 1602 AUTO_ROTATION_PORTRAIT = 6, 1603 1604 /** 1605 * Follow the rotation of the sensor, only work in the horizontal direction, ignore auto rotation lock. 1606 * 1607 * @syscap SystemCapability.WindowManager.WindowManager.Core 1608 * @since 9 1609 */ 1610 AUTO_ROTATION_LANDSCAPE = 7, 1611 1612 /** 1613 * Follow the rotation of the sensor, controlled by auto rotation lock. 1614 * 1615 * @syscap SystemCapability.WindowManager.WindowManager.Core 1616 * @since 9 1617 */ 1618 AUTO_ROTATION_RESTRICTED = 8, 1619 1620 /** 1621 * Follow the rotation of the sensor, only work in the vertical direction, controlled by auto rotation lock. 1622 * 1623 * @syscap SystemCapability.WindowManager.WindowManager.Core 1624 * @since 9 1625 */ 1626 AUTO_ROTATION_PORTRAIT_RESTRICTED = 9, 1627 1628 /** 1629 * Follow the rotation of the sensor, only work in the horizontal direction, controlled by auto rotation lock. 1630 * 1631 * @syscap SystemCapability.WindowManager.WindowManager.Core 1632 * @since 9 1633 */ 1634 AUTO_ROTATION_LANDSCAPE_RESTRICTED = 10, 1635 1636 /** 1637 * Locked mode, keep the same direction as previous one. 1638 * 1639 * @syscap SystemCapability.WindowManager.WindowManager.Core 1640 * @since 9 1641 */ 1642 LOCKED = 11 1643 } 1644 1645 /** 1646 * Type of blur style 1647 * 1648 * @enum { number } 1649 * @syscap SystemCapability.WindowManager.WindowManager.Core 1650 * @systemapi Hide this for inner system use. 1651 * @since 9 1652 */ 1653 enum BlurStyle { 1654 /** 1655 * Close blur. 1656 * 1657 * @syscap SystemCapability.WindowManager.WindowManager.Core 1658 * @systemapi Hide this for inner system use. 1659 * @since 9 1660 */ 1661 OFF, 1662 /** 1663 * Blur style thin. 1664 * 1665 * @syscap SystemCapability.WindowManager.WindowManager.Core 1666 * @systemapi Hide this for inner system use. 1667 * @since 9 1668 */ 1669 THIN, 1670 /** 1671 * Blur style regular. 1672 * 1673 * @syscap SystemCapability.WindowManager.WindowManager.Core 1674 * @systemapi Hide this for inner system use. 1675 * @since 9 1676 */ 1677 REGULAR, 1678 /** 1679 * Blur style thick. 1680 * 1681 * @syscap SystemCapability.WindowManager.WindowManager.Core 1682 * @systemapi Hide this for inner system use. 1683 * @since 9 1684 */ 1685 THICK 1686 } 1687 1688 /** 1689 * Enum for window callback event type 1690 * 1691 * @enum { number } 1692 * @syscap SystemCapability.WindowManager.WindowManager.Core 1693 * @since 10 1694 */ 1695 enum WindowEventType { 1696 /** 1697 * The value of window event is window show 1698 * 1699 * @syscap SystemCapability.WindowManager.WindowManager.Core 1700 * @since 10 1701 */ 1702 WINDOW_SHOWN = 1, 1703 /** 1704 * The value of window event is window active 1705 * 1706 * @syscap SystemCapability.WindowManager.WindowManager.Core 1707 * @since 10 1708 */ 1709 WINDOW_ACTIVE = 2, 1710 /** 1711 * The value of window event is window inactive 1712 * 1713 * @syscap SystemCapability.WindowManager.WindowManager.Core 1714 * @since 10 1715 */ 1716 WINDOW_INACTIVE = 3, 1717 /** 1718 * The value of window event is window hide 1719 * 1720 * @syscap SystemCapability.WindowManager.WindowManager.Core 1721 * @since 10 1722 */ 1723 WINDOW_HIDDEN = 4 1724 } 1725 interface Window { 1726 /** 1727 * Hide window. 1728 * 1729 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1730 * @throws { BusinessError } 1300002 - This window state is abnormal. 1731 * @syscap SystemCapability.WindowManager.WindowManager.Core 1732 * @systemapi Hide this for inner system use. 1733 * @since 7 1734 */ 1735 hide(callback: AsyncCallback<void>): void; 1736 1737 /** 1738 * Hide window. 1739 * 1740 * @returns { Promise<void> } Promise that returns no value. 1741 * @throws { BusinessError } 1300002 - This window state is abnormal. 1742 * @syscap SystemCapability.WindowManager.WindowManager.Core 1743 * @systemapi Hide this for inner system use. 1744 * @since 7 1745 */ 1746 hide(): Promise<void>; 1747 1748 /** 1749 * Hide window with animation. 1750 * 1751 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1752 * @throws { BusinessError } 1300002 - This window state is abnormal. 1753 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1754 * @throws { BusinessError } 1300004 - Unauthorized operation. 1755 * @syscap SystemCapability.WindowManager.WindowManager.Core 1756 * @systemapi 1757 * @since 9 1758 */ 1759 hideWithAnimation(callback: AsyncCallback<void>): void; 1760 1761 /** 1762 * Hide window with animation. 1763 * 1764 * @returns { Promise<void> } Promise that returns no value. 1765 * @throws { BusinessError } 1300002 - This window state is abnormal. 1766 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1767 * @throws { BusinessError } 1300004 - Unauthorized operation. 1768 * @syscap SystemCapability.WindowManager.WindowManager.Core 1769 * @systemapi 1770 * @since 9 1771 */ 1772 hideWithAnimation(): Promise<void>; 1773 1774 /** 1775 * Show window. 1776 * 1777 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1778 * @syscap SystemCapability.WindowManager.WindowManager.Core 1779 * @since 7 1780 * @deprecated since 9 1781 * @useinstead ohos.window.Window#showWindow 1782 */ 1783 show(callback: AsyncCallback<void>): void; 1784 1785 /** 1786 * Show window. 1787 * 1788 * @returns { Promise<void> } Promise that returns no value. 1789 * @syscap SystemCapability.WindowManager.WindowManager.Core 1790 * @since 7 1791 * @deprecated since 9 1792 * @useinstead ohos.window.Window#showWindow 1793 */ 1794 show(): Promise<void>; 1795 1796 /** 1797 * Show window. 1798 * 1799 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1800 * @throws { BusinessError } 1300002 - This window state is abnormal. 1801 * @syscap SystemCapability.WindowManager.WindowManager.Core 1802 * @since 9 1803 */ 1804 /** 1805 * Show window. 1806 * 1807 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1808 * @throws { BusinessError } 1300002 - This window state is abnormal. 1809 * @syscap SystemCapability.WindowManager.WindowManager.Core 1810 * @crossplatform 1811 * @since 10 1812 */ 1813 showWindow(callback: AsyncCallback<void>): void; 1814 1815 /** 1816 * Show window. 1817 * 1818 * @returns { Promise<void> } Promise that returns no value. 1819 * @throws { BusinessError } 1300002 - This window state is abnormal. 1820 * @syscap SystemCapability.WindowManager.WindowManager.Core 1821 * @since 9 1822 */ 1823 /** 1824 * Show window. 1825 * 1826 * @returns { Promise<void> } Promise that returns no value. 1827 * @throws { BusinessError } 1300002 - This window state is abnormal. 1828 * @syscap SystemCapability.WindowManager.WindowManager.Core 1829 * @crossplatform 1830 * @since 10 1831 */ 1832 showWindow(): Promise<void>; 1833 1834 /** 1835 * Show window with animation. 1836 * 1837 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1838 * @throws { BusinessError } 1300002 - This window state is abnormal. 1839 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1840 * @throws { BusinessError } 1300004 - Unauthorized operation. 1841 * @syscap SystemCapability.WindowManager.WindowManager.Core 1842 * @systemapi 1843 * @since 9 1844 */ 1845 showWithAnimation(callback: AsyncCallback<void>): void; 1846 1847 /** 1848 * Show window with animation. 1849 * 1850 * @returns { Promise<void> } Promise that returns no value. 1851 * @throws { BusinessError } 1300002 - This window state is abnormal. 1852 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1853 * @throws { BusinessError } 1300004 - Unauthorized operation. 1854 * @syscap SystemCapability.WindowManager.WindowManager.Core 1855 * @systemapi 1856 * @since 9 1857 */ 1858 showWithAnimation(): Promise<void>; 1859 1860 /** 1861 * Destroy the window. 1862 * 1863 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1864 * @syscap SystemCapability.WindowManager.WindowManager.Core 1865 * @since 7 1866 * @deprecated since 9 1867 * @useinstead ohos.window.Window#destroyWindow 1868 */ 1869 destroy(callback: AsyncCallback<void>): void; 1870 1871 /** 1872 * Destroy the window. 1873 * 1874 * @returns { Promise<void> } Promise that returns no value. 1875 * @syscap SystemCapability.WindowManager.WindowManager.Core 1876 * @since 7 1877 * @deprecated since 9 1878 * @useinstead ohos.window.Window#destroyWindow 1879 */ 1880 destroy(): Promise<void>; 1881 1882 /** 1883 * Destroy the window. 1884 * 1885 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1886 * @throws { BusinessError } 1300002 - This window state is abnormal. 1887 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1888 * @syscap SystemCapability.WindowManager.WindowManager.Core 1889 * @since 9 1890 */ 1891 /** 1892 * Destroy the window. 1893 * 1894 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1895 * @throws { BusinessError } 1300002 - This window state is abnormal. 1896 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1897 * @syscap SystemCapability.WindowManager.WindowManager.Core 1898 * @crossplatform 1899 * @since 10 1900 */ 1901 destroyWindow(callback: AsyncCallback<void>): void; 1902 1903 /** 1904 * Destroy the window. 1905 * 1906 * @returns { Promise<void> } Promise that returns no value. 1907 * @throws { BusinessError } 1300002 - This window state is abnormal. 1908 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1909 * @syscap SystemCapability.WindowManager.WindowManager.Core 1910 * @since 9 1911 */ 1912 /** 1913 * Destroy the window. 1914 * 1915 * @returns { Promise<void> } Promise that returns no value. 1916 * @throws { BusinessError } 1300002 - This window state is abnormal. 1917 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1918 * @syscap SystemCapability.WindowManager.WindowManager.Core 1919 * @crossplatform 1920 * @since 10 1921 */ 1922 destroyWindow(): Promise<void>; 1923 1924 /** 1925 * Set the position of a window. 1926 * 1927 * @param { number } x - Indicate the X-coordinate of the window. 1928 * @param { number } y - Indicate the Y-coordinate of the window. 1929 * @returns { Promise<void> } Promise that returns no value. 1930 * @syscap SystemCapability.WindowManager.WindowManager.Core 1931 * @since 7 1932 * @deprecated since 9 1933 * @useinstead ohos.window.Window#moveWindowTo 1934 */ 1935 moveTo(x: number, y: number): Promise<void>; 1936 1937 /** 1938 * Set the position of a window. 1939 * 1940 * @param { number } x - Indicate the X-coordinate of the window. 1941 * @param { number } y - Indicate the Y-coordinate of the window. 1942 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1943 * @syscap SystemCapability.WindowManager.WindowManager.Core 1944 * @since 7 1945 * @deprecated since 9 1946 * @useinstead ohos.window.Window#moveWindowTo 1947 */ 1948 moveTo(x: number, y: number, callback: AsyncCallback<void>): void; 1949 1950 /** 1951 * Set the position of a window. 1952 * 1953 * @param { number } x - Indicate the X-coordinate of the window. 1954 * @param { number } y - Indicate the Y-coordinate of the window. 1955 * @returns { Promise<void> } Promise that returns no value. 1956 * @throws { BusinessError } 401 - Parameter error. 1957 * @throws { BusinessError } 1300002 - This window state is abnormal. 1958 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1959 * @syscap SystemCapability.WindowManager.WindowManager.Core 1960 * @since 9 1961 */ 1962 /** 1963 * Set the position of a window. 1964 * 1965 * @param { number } x - Indicate the X-coordinate of the window. 1966 * @param { number } y - Indicate the Y-coordinate of the window. 1967 * @returns { Promise<void> } Promise that returns no value. 1968 * @throws { BusinessError } 401 - Parameter error. 1969 * @throws { BusinessError } 1300002 - This window state is abnormal. 1970 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1971 * @syscap SystemCapability.WindowManager.WindowManager.Core 1972 * @crossplatform 1973 * @since 10 1974 */ 1975 moveWindowTo(x: number, y: number): Promise<void>; 1976 1977 /** 1978 * Set the position of a window. 1979 * 1980 * @param { number } x - Indicate the X-coordinate of the window. 1981 * @param { number } y - Indicate the Y-coordinate of the window. 1982 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1983 * @throws { BusinessError } 401 - Parameter error. 1984 * @throws { BusinessError } 1300002 - This window state is abnormal. 1985 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1986 * @syscap SystemCapability.WindowManager.WindowManager.Core 1987 * @since 9 1988 */ 1989 /** 1990 * Set the position of a window. 1991 * 1992 * @param { number } x - Indicate the X-coordinate of the window. 1993 * @param { number } y - Indicate the Y-coordinate of the window. 1994 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1995 * @throws { BusinessError } 401 - Parameter error. 1996 * @throws { BusinessError } 1300002 - This window state is abnormal. 1997 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 1998 * @syscap SystemCapability.WindowManager.WindowManager.Core 1999 * @crossplatform 2000 * @since 10 2001 */ 2002 moveWindowTo(x: number, y: number, callback: AsyncCallback<void>): void; 2003 2004 /** 2005 * Set the size of a window . 2006 * 2007 * @param { number } width - Indicates the width of the window. 2008 * @param { number } height - Indicates the height of the window. 2009 * @returns { Promise<void> } Promise that returns no value. 2010 * @syscap SystemCapability.WindowManager.WindowManager.Core 2011 * @since 7 2012 * @deprecated since 9 2013 * @useinstead ohos.window.Window#resize 2014 */ 2015 resetSize(width: number, height: number): Promise<void>; 2016 2017 /** 2018 * Set the size of a window . 2019 * 2020 * @param { number } width - Indicates the width of the window. 2021 * @param { number } height - Indicates the height of the window. 2022 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2023 * @syscap SystemCapability.WindowManager.WindowManager.Core 2024 * @since 7 2025 * @deprecated since 9 2026 * @useinstead ohos.window.Window#resize 2027 */ 2028 resetSize(width: number, height: number, callback: AsyncCallback<void>): void; 2029 2030 /** 2031 * Set the size of a window . 2032 * 2033 * @param { number } width - Indicates the width of the window. 2034 * @param { number } height - Indicates the height of the window. 2035 * @returns { Promise<void> } Promise that returns no value. 2036 * @throws { BusinessError } 401 - Parameter error. 2037 * @throws { BusinessError } 1300002 - This window state is abnormal. 2038 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2039 * @syscap SystemCapability.WindowManager.WindowManager.Core 2040 * @since 9 2041 */ 2042 /** 2043 * Set the size of a window . 2044 * 2045 * @param { number } width - Indicates the width of the window. 2046 * @param { number } height - Indicates the height of the window. 2047 * @returns { Promise<void> } Promise that returns no value. 2048 * @throws { BusinessError } 401 - Parameter error. 2049 * @throws { BusinessError } 1300002 - This window state is abnormal. 2050 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2051 * @syscap SystemCapability.WindowManager.WindowManager.Core 2052 * @crossplatform 2053 * @since 10 2054 */ 2055 resize(width: number, height: number): Promise<void>; 2056 2057 /** 2058 * Set the size of a window . 2059 * 2060 * @param { number } width - Indicates the width of the window. 2061 * @param { number } height - Indicates the height of the window. 2062 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2063 * @throws { BusinessError } 401 - Parameter error. 2064 * @throws { BusinessError } 1300002 - This window state is abnormal. 2065 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2066 * @syscap SystemCapability.WindowManager.WindowManager.Core 2067 * @since 9 2068 */ 2069 /** 2070 * Set the size of a window . 2071 * 2072 * @param { number } width - Indicates the width of the window. 2073 * @param { number } height - Indicates the height of the window. 2074 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2075 * @throws { BusinessError } 401 - Parameter error. 2076 * @throws { BusinessError } 1300002 - This window state is abnormal. 2077 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2078 * @syscap SystemCapability.WindowManager.WindowManager.Core 2079 * @crossplatform 2080 * @since 10 2081 */ 2082 resize(width: number, height: number, callback: AsyncCallback<void>): void; 2083 2084 /** 2085 * Set the type of a window. 2086 * 2087 * @param { WindowType } type - Indicate the type of a window. 2088 * @returns { Promise<void> } Promise that returns no value. 2089 * @syscap SystemCapability.WindowManager.WindowManager.Core 2090 * @systemapi Hide this for inner system use. 2091 * @since 7 2092 * @deprecated since 9 2093 */ 2094 setWindowType(type: WindowType): Promise<void>; 2095 2096 /** 2097 * Set the type of a window. 2098 * 2099 * @param { WindowType } type - Indicate the type of a window. 2100 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2101 * @syscap SystemCapability.WindowManager.WindowManager.Core 2102 * @systemapi Hide this for inner system use. 2103 * @since 7 2104 * @deprecated since 9 2105 */ 2106 setWindowType(type: WindowType, callback: AsyncCallback<void>): void; 2107 2108 /** 2109 * Set the mode of a window. 2110 * 2111 * @param { WindowMode } mode - Indicate the mode of a window. 2112 * @returns { Promise<void> } Promise that returns no value. 2113 * @throws { BusinessError } 401 - Parameter error. 2114 * @throws { BusinessError } 1300002 - This window state is abnormal. 2115 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2116 * @syscap SystemCapability.WindowManager.WindowManager.Core 2117 * @systemapi Hide this for inner system use. 2118 * @since 9 2119 */ 2120 setWindowMode(mode: WindowMode): Promise<void>; 2121 2122 /** 2123 * Set the mode of a window. 2124 * 2125 * @param { WindowMode } mode - Indicate the mode of a window. 2126 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2127 * @throws { BusinessError } 401 - Parameter error. 2128 * @throws { BusinessError } 1300002 - This window state is abnormal. 2129 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2130 * @syscap SystemCapability.WindowManager.WindowManager.Core 2131 * @systemapi Hide this for inner system use. 2132 * @since 9 2133 */ 2134 setWindowMode(mode: WindowMode, callback: AsyncCallback<void>): void; 2135 2136 /** 2137 * Get the properties of current window 2138 * 2139 * @param { AsyncCallback<WindowProperties> } callback - Callback used to return the window properties. 2140 * @syscap SystemCapability.WindowManager.WindowManager.Core 2141 * @since 6 2142 * @deprecated since 9 2143 * @useinstead ohos.window.Window#getWindowProperties 2144 */ 2145 getProperties(callback: AsyncCallback<WindowProperties>): void; 2146 2147 /** 2148 * Get the properties of current window 2149 * 2150 * @returns { Promise<WindowProperties> } Promise used to return the window properties. 2151 * @syscap SystemCapability.WindowManager.WindowManager.Core 2152 * @since 6 2153 * @deprecated since 9 2154 * @useinstead ohos.window.Window#getWindowProperties 2155 */ 2156 getProperties(): Promise<WindowProperties>; 2157 2158 /** 2159 * Get the properties of current window 2160 * 2161 * @returns { WindowProperties } Return the window properties. 2162 * @throws { BusinessError } 1300002 - This window state is abnormal. 2163 * @syscap SystemCapability.WindowManager.WindowManager.Core 2164 * @since 9 2165 */ 2166 /** 2167 * Get the properties of current window 2168 * 2169 * @returns { WindowProperties } Return the window properties. 2170 * @throws { BusinessError } 1300002 - This window state is abnormal. 2171 * @syscap SystemCapability.WindowManager.WindowManager.Core 2172 * @crossplatform 2173 * @since 10 2174 */ 2175 getWindowProperties(): WindowProperties; 2176 2177 /** 2178 * Get the avoid area 2179 * 2180 * @param { AvoidAreaType } type - Type of the area 2181 * @param { AsyncCallback<AvoidArea> } callback - Callback used to return the area. 2182 * @syscap SystemCapability.WindowManager.WindowManager.Core 2183 * @since 7 2184 * @deprecated since 9 2185 * @useinstead ohos.window.Window#getWindowAvoidArea 2186 */ 2187 getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): void; 2188 2189 /** 2190 * Get the avoid area 2191 * 2192 * @param { AvoidAreaType } type - Type of the area 2193 * @returns { Promise<AvoidArea> } Area where the window cannot be displayed. 2194 * @syscap SystemCapability.WindowManager.WindowManager.Core 2195 * @since 7 2196 * @deprecated since 9 2197 * @useinstead ohos.window.Window#getWindowAvoidArea 2198 */ 2199 getAvoidArea(type: AvoidAreaType): Promise<AvoidArea>; 2200 2201 /** 2202 * Get the avoid area 2203 * 2204 * @param { AvoidAreaType } type - Type of the area 2205 * @returns { AvoidArea } Area where the window cannot be displayed. 2206 * @throws { BusinessError } 401 - Parameter error. 2207 * @throws { BusinessError } 1300002 - This window state is abnormal. 2208 * @syscap SystemCapability.WindowManager.WindowManager.Core 2209 * @since 9 2210 */ 2211 getWindowAvoidArea(type: AvoidAreaType): AvoidArea; 2212 2213 /** 2214 * Set the flag of the window is shown full screen 2215 * 2216 * @param { boolean } isFullScreen - The flag of the window is shown full screen 2217 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2218 * @syscap SystemCapability.WindowManager.WindowManager.Core 2219 * @since 6 2220 * @deprecated since 9 2221 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2222 */ 2223 setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void; 2224 2225 /** 2226 * Set the flag of the window is shown full screen 2227 * 2228 * @param { boolean } isFullScreen - The flag of the window is shown full screen 2229 * @returns { Promise<void> } Promise that returns no value. 2230 * @syscap SystemCapability.WindowManager.WindowManager.Core 2231 * @since 6 2232 * @deprecated since 9 2233 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2234 */ 2235 setFullScreen(isFullScreen: boolean): Promise<void>; 2236 2237 /** 2238 * Set the property of the window can layout in full screen 2239 * 2240 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2241 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2242 * @syscap SystemCapability.WindowManager.WindowManager.Core 2243 * @since 7 2244 * @deprecated since 9 2245 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 2246 */ 2247 setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 2248 2249 /** 2250 * Set the property of the window can layout in full screen 2251 * 2252 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2253 * @returns { Promise<void> } Promise that returns no value. 2254 * @syscap SystemCapability.WindowManager.WindowManager.Core 2255 * @since 7 2256 * @deprecated since 9 2257 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 2258 */ 2259 setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 2260 2261 /** 2262 * Set the property of the window can layout in full screen 2263 * 2264 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2265 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2266 * @throws { BusinessError } 401 - Parameter error. 2267 * @throws { BusinessError } 1300002 - This window state is abnormal. 2268 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2269 * @syscap SystemCapability.WindowManager.WindowManager.Core 2270 * @since 9 2271 */ 2272 setWindowLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 2273 2274 /** 2275 * Set the property of the window can layout in full screen 2276 * 2277 * @param { boolean } isLayoutFullScreen - The window can layout in full screen 2278 * @returns { Promise<void> } Promise that returns no value. 2279 * @throws { BusinessError } 401 - Parameter error. 2280 * @throws { BusinessError } 1300002 - This window state is abnormal. 2281 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2282 * @syscap SystemCapability.WindowManager.WindowManager.Core 2283 * @since 9 2284 */ 2285 setWindowLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 2286 2287 /** 2288 * Set the system bar to have visible. 2289 * 2290 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2291 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2292 * @syscap SystemCapability.WindowManager.WindowManager.Core 2293 * @since 7 2294 * @deprecated since 9 2295 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2296 */ 2297 setSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void; 2298 2299 /** 2300 * Set the system bar to have visible. 2301 * 2302 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2303 * @returns { Promise<void> } Promise that returns no value. 2304 * @syscap SystemCapability.WindowManager.WindowManager.Core 2305 * @since 7 2306 * @deprecated since 9 2307 * @useinstead ohos.window.Window#setWindowSystemBarEnable 2308 */ 2309 setSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void>; 2310 2311 /** 2312 * Set the system bar to have visible. 2313 * 2314 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2315 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2316 * @throws { BusinessError } 401 - Parameter error. 2317 * @throws { BusinessError } 1300002 - This window state is abnormal. 2318 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2319 * @syscap SystemCapability.WindowManager.WindowManager.Core 2320 * @since 9 2321 */ 2322 /** 2323 * Set the system bar to have visible. 2324 * 2325 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2326 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2327 * @throws { BusinessError } 401 - Parameter error. 2328 * @throws { BusinessError } 1300002 - This window state is abnormal. 2329 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2330 * @syscap SystemCapability.WindowManager.WindowManager.Core 2331 * @crossplatform 2332 * @since 10 2333 */ 2334 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void; 2335 2336 /** 2337 * Set the system bar to have visible. 2338 * 2339 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2340 * @returns { Promise<void> } Promise that returns no value. 2341 * @throws { BusinessError } 401 - Parameter error. 2342 * @throws { BusinessError } 1300002 - This window state is abnormal. 2343 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2344 * @syscap SystemCapability.WindowManager.WindowManager.Core 2345 * @since 9 2346 */ 2347 /** 2348 * Set the system bar to have visible. 2349 * 2350 * @param { Array<'status' | 'navigation'> } names - The set of system bar 2351 * @returns { Promise<void> } Promise that returns no value. 2352 * @throws { BusinessError } 401 - Parameter error. 2353 * @throws { BusinessError } 1300002 - This window state is abnormal. 2354 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2355 * @syscap SystemCapability.WindowManager.WindowManager.Core 2356 * @crossplatform 2357 * @since 10 2358 */ 2359 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void>; 2360 2361 /** 2362 * Set the properties of system bar 2363 * 2364 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 2365 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2366 * @syscap SystemCapability.WindowManager.WindowManager.Core 2367 * @since 6 2368 * @deprecated since 9 2369 * @useinstead ohos.window.Window#setWindowSystemBarProperties 2370 */ 2371 setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 2372 2373 /** 2374 * Set the properties of system bar 2375 * 2376 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 2377 * @returns { Promise<void> } Promise that returns no value. 2378 * @syscap SystemCapability.WindowManager.WindowManager.Core 2379 * @since 6 2380 * @deprecated since 9 2381 * @useinstead ohos.window.Window#setWindowSystemBarProperties 2382 */ 2383 setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 2384 2385 /** 2386 * Set the properties of system bar 2387 * 2388 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 2389 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2390 * @throws { BusinessError } 401 - Parameter error. 2391 * @throws { BusinessError } 801 - Capability not supported. 2392 * @throws { BusinessError } 1300002 - This window state is abnormal. 2393 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2394 * @syscap SystemCapability.WindowManager.WindowManager.Core 2395 * @since 9 2396 */ 2397 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 2398 2399 /** 2400 * Set the properties of system bar 2401 * 2402 * @param { SystemBarProperties } systemBarProperties - The properties of system bar 2403 * @returns { Promise<void> } Promise that returns no value. 2404 * @throws { BusinessError } 401 - Parameter error. 2405 * @throws { BusinessError } 801 - Capability not supported. 2406 * @throws { BusinessError } 1300002 - This window state is abnormal. 2407 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2408 * @syscap SystemCapability.WindowManager.WindowManager.Core 2409 * @since 9 2410 */ 2411 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 2412 2413 /** 2414 * Set the preferred orientation config of the window 2415 * 2416 * @param { Orientation } orientation - The orientation config of the window 2417 * @returns { Promise<void> } Promise that returns no value. 2418 * @throws { BusinessError } 401 - Parameter error. 2419 * @throws { BusinessError } 1300002 - This window state is abnormal. 2420 * @syscap SystemCapability.WindowManager.WindowManager.Core 2421 * @since 9 2422 */ 2423 /** 2424 * Set the preferred orientation config of the window 2425 * 2426 * @param { Orientation } orientation - The orientation config of the window 2427 * @returns { Promise<void> } Promise that returns no value. 2428 * @throws { BusinessError } 401 - Parameter error. 2429 * @throws { BusinessError } 1300002 - This window state is abnormal. 2430 * @syscap SystemCapability.WindowManager.WindowManager.Core 2431 * @crossplatform 2432 * @since 10 2433 */ 2434 setPreferredOrientation(orientation: Orientation): Promise<void>; 2435 2436 /** 2437 * Set the preferred orientation config of the window 2438 * 2439 * @param { Orientation } orientation - The orientation config of the window 2440 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2441 * @throws { BusinessError } 401 - Parameter error. 2442 * @throws { BusinessError } 1300002 - This window state is abnormal. 2443 * @syscap SystemCapability.WindowManager.WindowManager.Core 2444 * @since 9 2445 */ 2446 /** 2447 * Set the preferred orientation config of the window 2448 * 2449 * @param { Orientation } orientation - The orientation config of the window 2450 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2451 * @throws { BusinessError } 401 - Parameter error. 2452 * @throws { BusinessError } 1300002 - This window state is abnormal. 2453 * @syscap SystemCapability.WindowManager.WindowManager.Core 2454 * @crossplatform 2455 * @since 10 2456 */ 2457 setPreferredOrientation(orientation: Orientation, callback: AsyncCallback<void>): void; 2458 2459 /** 2460 * Loads content 2461 * 2462 * @param { string } path - Path of the page to which the content will be loaded 2463 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 2464 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2465 * @throws { BusinessError } 401 - Parameter error. 2466 * @throws { BusinessError } 1300002 - This window state is abnormal. 2467 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2468 * @syscap SystemCapability.WindowManager.WindowManager.Core 2469 * @StageModelOnly 2470 * @since 9 2471 */ 2472 /** 2473 * Loads content 2474 * 2475 * @param { string } path - Path of the page to which the content will be loaded 2476 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 2477 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2478 * @throws { BusinessError } 401 - Parameter error. 2479 * @throws { BusinessError } 1300002 - This window state is abnormal. 2480 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2481 * @syscap SystemCapability.WindowManager.WindowManager.Core 2482 * @StageModelOnly 2483 * @crossplatform 2484 * @since 10 2485 */ 2486 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 2487 2488 /** 2489 * Loads content 2490 * 2491 * @param { string } path - Path of the page to which the content will be loaded 2492 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 2493 * @returns { Promise<void> } Promise that returns no value. 2494 * @throws { BusinessError } 401 - Parameter error. 2495 * @throws { BusinessError } 1300002 - This window state is abnormal. 2496 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2497 * @syscap SystemCapability.WindowManager.WindowManager.Core 2498 * @StageModelOnly 2499 * @since 9 2500 */ 2501 /** 2502 * Loads content 2503 * 2504 * @param { string } path - Path of the page to which the content will be loaded 2505 * @param { LocalStorage } storage - The data object shared within the content instance loaded by the window 2506 * @returns { Promise<void> } Promise that returns no value. 2507 * @throws { BusinessError } 401 - Parameter error. 2508 * @throws { BusinessError } 1300002 - This window state is abnormal. 2509 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2510 * @syscap SystemCapability.WindowManager.WindowManager.Core 2511 * @StageModelOnly 2512 * @crossplatform 2513 * @since 10 2514 */ 2515 loadContent(path: string, storage: LocalStorage): Promise<void>; 2516 2517 /** 2518 * Loads content 2519 * 2520 * @param { string } path - Path of the page to which the content will be loaded 2521 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2522 * @syscap SystemCapability.WindowManager.WindowManager.Core 2523 * @since 7 2524 * @deprecated since 9 2525 * @useinstead ohos.window.Window#setUIContent 2526 */ 2527 loadContent(path: string, callback: AsyncCallback<void>): void; 2528 2529 /** 2530 * Loads content 2531 * 2532 * @param { string } path - Path of the page to which the content will be loaded 2533 * @returns { Promise<void> } Promise that returns no value. 2534 * @syscap SystemCapability.WindowManager.WindowManager.Core 2535 * @since 7 2536 * @deprecated since 9 2537 * @useinstead ohos.window.Window#setUIContent 2538 */ 2539 loadContent(path: string): Promise<void>; 2540 2541 /** 2542 * Get the UIContext associate with the window content. 2543 * 2544 * @returns { UIContext } the object of UIContext. 2545 * @throws { BusinessError } 401 - If param is invalid 2546 * @throws { BusinessError } 1300002 - This window state is abnormal. 2547 * @syscap SystemCapability.WindowManager.WindowManager.Core 2548 * @stagemodelonly 2549 * @crossplatform 2550 * @since 10 2551 */ 2552 getUIContext() : UIContext; 2553 2554 /** 2555 * Loads content 2556 * 2557 * @param { string } path - Path of the page to which the content will be loaded 2558 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2559 * @throws { BusinessError } 401 - Parameter error. 2560 * @throws { BusinessError } 1300002 - This window state is abnormal. 2561 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2562 * @syscap SystemCapability.WindowManager.WindowManager.Core 2563 * @since 9 2564 */ 2565 /** 2566 * Loads content 2567 * 2568 * @param { string } path - Path of the page to which the content will be loaded 2569 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2570 * @throws { BusinessError } 401 - Parameter error. 2571 * @throws { BusinessError } 1300002 - This window state is abnormal. 2572 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2573 * @syscap SystemCapability.WindowManager.WindowManager.Core 2574 * @crossplatform 2575 * @since 10 2576 */ 2577 setUIContent(path: string, callback: AsyncCallback<void>): void; 2578 2579 /** 2580 * Loads content 2581 * 2582 * @param { string } path - Path of the page to which the content will be loaded 2583 * @returns { Promise<void> } Promise that returns no value. 2584 * @throws { BusinessError } 401 - Parameter error. 2585 * @throws { BusinessError } 1300002 - This window state is abnormal. 2586 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2587 * @syscap SystemCapability.WindowManager.WindowManager.Core 2588 * @since 9 2589 */ 2590 /** 2591 * Loads content 2592 * 2593 * @param { string } path - Path of the page to which the content will be loaded 2594 * @returns { Promise<void> } Promise that returns no value. 2595 * @throws { BusinessError } 401 - Parameter error. 2596 * @throws { BusinessError } 1300002 - This window state is abnormal. 2597 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2598 * @syscap SystemCapability.WindowManager.WindowManager.Core 2599 * @crossplatform 2600 * @since 10 2601 */ 2602 setUIContent(path: string): Promise<void>; 2603 2604 /** 2605 * Checks whether the window is displayed 2606 * 2607 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 2608 * @syscap SystemCapability.WindowManager.WindowManager.Core 2609 * @since 7 2610 * @deprecated since 9 2611 * @useinstead ohos.window.Window#isWindowShowing 2612 */ 2613 isShowing(callback: AsyncCallback<boolean>): void; 2614 2615 /** 2616 * Checks whether the window is displayed 2617 * 2618 * @returns { Promise<boolean> } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 2619 * @syscap SystemCapability.WindowManager.WindowManager.Core 2620 * @since 7 2621 * @deprecated since 9 2622 * @useinstead ohos.window.Window#isWindowShowing 2623 */ 2624 isShowing(): Promise<boolean>; 2625 2626 /** 2627 * Checks whether the window is displayed 2628 * 2629 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 2630 * @throws { BusinessError } 1300002 - This window state is abnormal. 2631 * @syscap SystemCapability.WindowManager.WindowManager.Core 2632 * @since 9 2633 */ 2634 /** 2635 * Checks whether the window is displayed 2636 * 2637 * @returns { boolean } Whether the window is displayed. The value true means that the window is displayed, and false means the opposite. 2638 * @throws { BusinessError } 1300002 - This window state is abnormal. 2639 * @syscap SystemCapability.WindowManager.WindowManager.Core 2640 * @crossplatform 2641 * @since 10 2642 */ 2643 isWindowShowing(): boolean; 2644 2645 /** 2646 * Register the callback of windowSizeChange 2647 * 2648 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 2649 * @param { Callback<Size> } callback - Callback used to return the window size. 2650 * @throws { BusinessError } 401 - Parameter error. 2651 * @syscap SystemCapability.WindowManager.WindowManager.Core 2652 * @since 7 2653 */ 2654 on(type: 'windowSizeChange', callback: Callback<Size>): void; 2655 2656 /** 2657 * Unregister the callback of windowSizeChange 2658 * 2659 * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. 2660 * @param { Callback<Size> } callback - Callback used to return the window size. 2661 * @throws { BusinessError } 401 - Parameter error. 2662 * @syscap SystemCapability.WindowManager.WindowManager.Core 2663 * @since 7 2664 */ 2665 off(type: 'windowSizeChange', callback?: Callback<Size>): void; 2666 2667 /** 2668 * Register the callback of systemAvoidAreaChange 2669 * 2670 * @param { 'systemAvoidAreaChange' } type - The value is fixed at 'systemAvoidAreaChange', indicating the event of changes to the avoid area. 2671 * @param { Callback<AvoidArea> } callback - Callback used to return the area. 2672 * @syscap SystemCapability.WindowManager.WindowManager.Core 2673 * @since 7 2674 * @deprecated since 9 2675 * @useinstead ohos.window.Window#on_avoidAreaChange 2676 */ 2677 on(type: 'systemAvoidAreaChange', callback: Callback<AvoidArea>): void; 2678 2679 /** 2680 * Unregister the callback of systemAvoidAreaChange 2681 * 2682 * @param { 'systemAvoidAreaChange' } type - The value is fixed at 'systemAvoidAreaChange', indicating the event of changes to the avoid area. 2683 * @param { Callback<AvoidArea> } callback - Callback used to return the area. 2684 * @syscap SystemCapability.WindowManager.WindowManager.Core 2685 * @since 7 2686 * @deprecated since 9 2687 * @useinstead ohos.window.Window#off_avoidAreaChange 2688 */ 2689 off(type: 'systemAvoidAreaChange', callback?: Callback<AvoidArea>): void; 2690 2691 /** 2692 * Register the callback of avoidAreaChange 2693 * 2694 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 2695 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 2696 * @throws { BusinessError } 401 - Parameter error. 2697 * @syscap SystemCapability.WindowManager.WindowManager.Core 2698 * @since 9 2699 */ 2700 on(type: 'avoidAreaChange', callback: Callback<{ type: AvoidAreaType, area: AvoidArea }>): void; 2701 2702 /** 2703 * Unregister the callback of avoidAreaChange 2704 * 2705 * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. 2706 * @param { Callback<{ type: AvoidAreaType, area: AvoidArea }> } callback - Callback used to return the area. 2707 * @throws { BusinessError } 401 - Parameter error. 2708 * @syscap SystemCapability.WindowManager.WindowManager.Core 2709 * @since 9 2710 */ 2711 off(type: 'avoidAreaChange', callback?: Callback<{ type: AvoidAreaType, area: AvoidArea }>): void; 2712 2713 /** 2714 * Register the callback of keyboardHeightChange 2715 * 2716 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 2717 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 2718 * @throws { BusinessError } 401 - Parameter error. 2719 * @syscap SystemCapability.WindowManager.WindowManager.Core 2720 * @since 7 2721 */ 2722 on(type: 'keyboardHeightChange', callback: Callback<number>): void; 2723 2724 /** 2725 * Unregister the callback of keyboardHeightChange 2726 * 2727 * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. 2728 * @param { Callback<number> } callback - Callback used to return the current keyboard height. 2729 * @throws { BusinessError } 401 - Parameter error. 2730 * @syscap SystemCapability.WindowManager.WindowManager.Core 2731 * @since 7 2732 */ 2733 off(type: 'keyboardHeightChange', callback?: Callback<number>): void; 2734 2735 /** 2736 * Touch outside callback on. 2737 * 2738 * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. 2739 * @param { Callback<void> } callback - Callback used to return the click event outside this window. 2740 * @throws { BusinessError } 401 - Parameter error. 2741 * @syscap SystemCapability.WindowManager.WindowManager.Core 2742 * @systemapi Hide this for inner system use. 2743 * @since 9 2744 */ 2745 on(type: 'touchOutside', callback: Callback<void>): void; 2746 2747 /** 2748 * Touch outside callback off. 2749 * 2750 * @param { 'touchOutside' } type - The value is fixed at 'touchOutside', indicating the click event outside this window. 2751 * @param { Callback<void> } callback - Callback used to return the click event outside this window. 2752 * @throws { BusinessError } 401 - Parameter error. 2753 * @syscap SystemCapability.WindowManager.WindowManager.Core 2754 * @systemapi Hide this for inner system use. 2755 * @since 9 2756 */ 2757 off(type: 'touchOutside', callback?: Callback<void>): void; 2758 2759 /** 2760 * Register the callback of screenshot, only the focused window called back 2761 * 2762 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 2763 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 2764 * @throws { BusinessError } 401 - Parameter error. 2765 * @syscap SystemCapability.WindowManager.WindowManager.Core 2766 * @since 9 2767 */ 2768 on(type: 'screenshot', callback: Callback<void>): void; 2769 2770 /** 2771 * Unregister the callback of screenshot 2772 * 2773 * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. 2774 * @param { Callback<void> } callback - Callback invoked when a screenshot event occurs. 2775 * @throws { BusinessError } 401 - Parameter error. 2776 * @syscap SystemCapability.WindowManager.WindowManager.Core 2777 * @since 9 2778 */ 2779 off(type: 'screenshot', callback?: Callback<void>): void; 2780 2781 /** 2782 * Register the callback of dialogTargetTouch 2783 * 2784 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', indicating the click event of the target window in the modal window mode. 2785 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 2786 * @throws { BusinessError } 401 - Parameter error. 2787 * @syscap SystemCapability.WindowManager.WindowManager.Core 2788 * @since 10 2789 */ 2790 on(type: 'dialogTargetTouch', callback: Callback<void>): void; 2791 2792 /** 2793 * Unregister the callback of dialogTargetTouch 2794 * 2795 * @param { 'dialogTargetTouch' } type - The value is fixed at 'dialogTargetTouch', 2796 * indicating the click event of the target window in the modal window mode. 2797 * @param { Callback<void> } callback - Callback invoked when the click event occurs in the target window of the modal window mode. 2798 * @throws { BusinessError } 401 - Parameter error. 2799 * @syscap SystemCapability.WindowManager.WindowManager.Core 2800 * @since 10 2801 */ 2802 off(type: 'dialogTargetTouch', callback?: Callback<void>): void; 2803 2804 /** 2805 * Register the callback of windowEvent 2806 * 2807 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 2808 * @param { Callback<WindowEventType> } callback - the callback of window event 2809 * @throws { BusinessError } 401 - Parameter error. 2810 * @syscap SystemCapability.WindowManager.WindowManager.Core 2811 * @since 10 2812 */ 2813 on(type: 'windowEvent', callback: Callback<WindowEventType>): void; 2814 /** 2815 * Unregister the callback of windowEvent 2816 * 2817 * @param { 'windowEvent' } type - The value is fixed at 'windowEvent', indicating the window lifecycle change event. 2818 * @param { Callback<WindowEventType> } callback - the callback of window event 2819 * @throws { BusinessError } 401 - Parameter error. 2820 * @syscap SystemCapability.WindowManager.WindowManager.Core 2821 * @since 10 2822 */ 2823 off(type: 'windowEvent', callback?: Callback<WindowEventType>): void; 2824 2825 /** 2826 * Bind dialog to the target window. 2827 * 2828 * @param { rpc.RemoteObject } token - token of the target window. 2829 * @param { Callback<void> } deathCallback - the callback of dialogDeath. 2830 * @returns { Promise<void> } Promise that returns no value. 2831 * @throws { BusinessError } 401 - Parameter error. 2832 * @throws { BusinessError } 1300002 - This window state is abnormal. 2833 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2834 * @syscap SystemCapability.WindowManager.WindowManager.Core 2835 * @systemapi Hide this for inner system use. 2836 * @since 9 2837 */ 2838 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>): Promise<void>; 2839 2840 /** 2841 * Bind dialog to the target window. 2842 * 2843 * @param { rpc.RemoteObject } token token of the target window. 2844 * @param { Callback<void> } deathCallback the callback of dialogDeath. 2845 * @param { AsyncCallback<void> } callback Callback used to return the result. 2846 * @throws { BusinessError } 401 - Parameter error. 2847 * @throws { BusinessError } 1300002 - This window state is abnormal. 2848 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2849 * @syscap SystemCapability.WindowManager.WindowManager.Core 2850 * @systemapi Hide this for inner system use. 2851 * @since 9 2852 */ 2853 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>, callback: AsyncCallback<void>): void; 2854 2855 /** 2856 * Bind dialog to the target window. 2857 * 2858 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 2859 * @param { Callback<void> } deathCallback the callback of dialogDeath. 2860 * @returns { Promise<void> } Promise that returns no value. 2861 * @throws { BusinessError } 401 - Parameter error. 2862 * @throws { BusinessError } 1300002 - This window state is abnormal. 2863 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2864 * @syscap SystemCapability.WindowManager.WindowManager.Core 2865 * @systemapi Hide this for inner system use. 2866 * @since 9 2867 */ 2868 bindDialogTarget(requestInfo: dialogRequest.RequestInfo, deathCallback: Callback<void>): Promise<void>; 2869 2870 /** 2871 * Bind dialog to the target window. 2872 * 2873 * @param { dialogRequest.RequestInfo } requestInfo requestInfo of the target window. 2874 * @param { Callback<void> } deathCallback the callback of dialogDeath. 2875 * @param { AsyncCallback<void> } callback Callback used to return the result. 2876 * @throws { BusinessError } 401 - Parameter error. 2877 * @throws { BusinessError } 1300002 - This window state is abnormal. 2878 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 2879 * @syscap SystemCapability.WindowManager.WindowManager.Core 2880 * @systemapi Hide this for inner system use. 2881 * @since 9 2882 */ 2883 bindDialogTarget( 2884 requestInfo: dialogRequest.RequestInfo, 2885 deathCallback: Callback<void>, 2886 callback: AsyncCallback<void> 2887 ): void; 2888 2889 /** 2890 * Whether the window supports thr wide gamut setting. 2891 * 2892 * @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. 2893 * @syscap SystemCapability.WindowManager.WindowManager.Core 2894 * @since 8 2895 * @deprecated since 9 2896 * @useinstead ohos.window.Window#isWindowSupportWideGamut 2897 */ 2898 isSupportWideGamut(): Promise<boolean>; 2899 2900 /** 2901 * Whether the window supports thr wide gamut setting. 2902 * 2903 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 2904 * @syscap SystemCapability.WindowManager.WindowManager.Core 2905 * @since 8 2906 * @deprecated since 9 2907 * @useinstead ohos.window.Window#isWindowSupportWideGamut 2908 */ 2909 isSupportWideGamut(callback: AsyncCallback<boolean>): void; 2910 2911 /** 2912 * Whether the window supports thr wide gamut setting. 2913 * 2914 * @returns { Promise<boolean> } Promise used to return the result. 2915 * The value true means that the wide-gamut color space is supported, and false means the opposite. 2916 * @throws { BusinessError } 1300002 - This window state is abnormal. 2917 * @syscap SystemCapability.WindowManager.WindowManager.Core 2918 * @since 9 2919 */ 2920 isWindowSupportWideGamut(): Promise<boolean>; 2921 2922 /** 2923 * Whether the window supports thr wide gamut setting. 2924 * 2925 * @param { AsyncCallback<boolean> } callback Callback used to return the result. 2926 * @throws { BusinessError } 1300002 - This window state is abnormal. 2927 * @syscap SystemCapability.WindowManager.WindowManager.Core 2928 * @since 9 2929 */ 2930 isWindowSupportWideGamut(callback: AsyncCallback<boolean>): void; 2931 2932 /** 2933 * Sets the specified color space. 2934 * 2935 * @param { ColorSpace } colorSpace the specified color space. 2936 * @returns { Promise<void> } Promise that returns no value. 2937 * @syscap SystemCapability.WindowManager.WindowManager.Core 2938 * @since 8 2939 * @deprecated since 9 2940 * @useinstead ohos.window.Window#setWindowColorSpace 2941 */ 2942 setColorSpace(colorSpace: ColorSpace): Promise<void>; 2943 2944 /** 2945 * Sets the specified color space. 2946 * 2947 * @param { ColorSpace } colorSpace the specified color space. 2948 * @param { AsyncCallback<void> } callback Callback used to return the result. 2949 * @syscap SystemCapability.WindowManager.WindowManager.Core 2950 * @since 8 2951 * @deprecated since 9 2952 * @useinstead ohos.window.Window#setWindowColorSpace 2953 */ 2954 setColorSpace(colorSpace: ColorSpace, callback: AsyncCallback<void>): void; 2955 2956 /** 2957 * Sets the specified color space. 2958 * 2959 * @param { ColorSpace } colorSpace the specified color space. 2960 * @returns { Promise<void> } Promise that returns no value. 2961 * @throws { BusinessError } 401 - Parameter error. 2962 * @throws { BusinessError } 1300002 - This window state is abnormal. 2963 * @syscap SystemCapability.WindowManager.WindowManager.Core 2964 * @since 9 2965 */ 2966 setWindowColorSpace(colorSpace: ColorSpace): Promise<void>; 2967 2968 /** 2969 * Sets the specified color space. 2970 * 2971 * @param { ColorSpace } colorSpace the specified color space. 2972 * @param { AsyncCallback<void> } callback Callback used to return the result. 2973 * @throws { BusinessError } 401 - Parameter error. 2974 * @throws { BusinessError } 1300002 - This window state is abnormal. 2975 * @syscap SystemCapability.WindowManager.WindowManager.Core 2976 * @since 9 2977 */ 2978 setWindowColorSpace(colorSpace: ColorSpace, callback: AsyncCallback<void>): void; 2979 2980 /** 2981 * Obtains the set color space. 2982 * 2983 * @returns { Promise<ColorSpace> } Promise used to return the current color space. 2984 * @syscap SystemCapability.WindowManager.WindowManager.Core 2985 * @since 8 2986 * @deprecated since 9 2987 * @useinstead ohos.window.Window#getWindowColorSpace 2988 */ 2989 getColorSpace(): Promise<ColorSpace>; 2990 2991 /** 2992 * Obtains the set color space. 2993 * 2994 * @param { AsyncCallback<ColorSpace> } callback Callback used to return the result. 2995 * @syscap SystemCapability.WindowManager.WindowManager.Core 2996 * @since 8 2997 * @deprecated since 9 2998 * @useinstead ohos.window.Window#getWindowColorSpace 2999 */ 3000 getColorSpace(callback: AsyncCallback<ColorSpace>): void; 3001 3002 /** 3003 * Obtains the set color space. 3004 * 3005 * @returns { ColorSpace } Color space obtained. 3006 * @throws { BusinessError } 1300002 - This window state is abnormal. 3007 * @syscap SystemCapability.WindowManager.WindowManager.Core 3008 * @since 9 3009 */ 3010 getWindowColorSpace(): ColorSpace; 3011 3012 /** 3013 * Sets the background color of window. 3014 * 3015 * @param { string } color the specified color. 3016 * @returns { Promise<void> } Promise that returns no value. 3017 * @syscap SystemCapability.WindowManager.WindowManager.Core 3018 * @since 6 3019 * @deprecated since 9 3020 * @useinstead ohos.window.Window#setWindowBackgroundColor 3021 */ 3022 setBackgroundColor(color: string): Promise<void>; 3023 3024 /** 3025 * Sets the background color of window. 3026 * 3027 * @param { string } color the specified color. 3028 * @param { AsyncCallback<void> } callback Callback used to return the result. 3029 * @syscap SystemCapability.WindowManager.WindowManager.Core 3030 * @since 6 3031 * @deprecated since 9 3032 * @useinstead ohos.window.Window#setWindowBackgroundColor 3033 */ 3034 setBackgroundColor(color: string, callback: AsyncCallback<void>): void; 3035 3036 /** 3037 * Sets the background color of window. 3038 * 3039 * @param { string } color the specified color. 3040 * @throws { BusinessError } 401 - Parameter error. 3041 * @throws { BusinessError } 1300002 - This window state is abnormal. 3042 * @syscap SystemCapability.WindowManager.WindowManager.Core 3043 * @since 9 3044 */ 3045 /** 3046 * Sets the background color of window. 3047 * 3048 * @param { string } color the specified color. 3049 * @throws { BusinessError } 401 - Parameter error. 3050 * @throws { BusinessError } 1300002 - This window state is abnormal. 3051 * @syscap SystemCapability.WindowManager.WindowManager.Core 3052 * @crossplatform 3053 * @since 10 3054 */ 3055 setWindowBackgroundColor(color: string): void; 3056 3057 /** 3058 * Sets the brightness of window. 3059 * 3060 * @param { number } brightness the specified brightness value. 3061 * @returns { Promise<void> } Promise that returns no value. 3062 * @syscap SystemCapability.WindowManager.WindowManager.Core 3063 * @since 6 3064 * @deprecated since 9 3065 * @useinstead ohos.window.Window#setWindowBrightness 3066 */ 3067 setBrightness(brightness: number): Promise<void>; 3068 3069 /** 3070 * Sets the brightness of window. 3071 * 3072 * @param { number } brightness the specified brightness value. 3073 * @param { AsyncCallback<void> } callback Callback used to return the result. 3074 * @syscap SystemCapability.WindowManager.WindowManager.Core 3075 * @since 6 3076 * @deprecated since 9 3077 * @useinstead ohos.window.Window#setWindowBrightness 3078 */ 3079 setBrightness(brightness: number, callback: AsyncCallback<void>): void; 3080 3081 /** 3082 * Sets the brightness of window. 3083 * 3084 * @param { number } brightness the specified brightness value. 3085 * @returns { Promise<void> } Promise that returns no value. 3086 * @throws { BusinessError } 401 - Parameter error. 3087 * @throws { BusinessError } 1300002 - This window state is abnormal. 3088 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3089 * @syscap SystemCapability.WindowManager.WindowManager.Core 3090 * @since 9 3091 */ 3092 /** 3093 * Sets the brightness of window. 3094 * 3095 * @param { number } brightness the specified brightness value. 3096 * @returns { Promise<void> } Promise that returns no value. 3097 * @throws { BusinessError } 401 - Parameter error. 3098 * @throws { BusinessError } 1300002 - This window state is abnormal. 3099 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3100 * @syscap SystemCapability.WindowManager.WindowManager.Core 3101 * @crossplatform 3102 * @since 10 3103 */ 3104 setWindowBrightness(brightness: number): Promise<void>; 3105 3106 /** 3107 * Sets the brightness of window. 3108 * 3109 * @param { number } brightness the specified brightness value. 3110 * @param { AsyncCallback<void> } callback Callback used to return the result. 3111 * @throws { BusinessError } 401 - Parameter error. 3112 * @throws { BusinessError } 1300002 - This window state is abnormal. 3113 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3114 * @syscap SystemCapability.WindowManager.WindowManager.Core 3115 * @since 9 3116 */ 3117 /** 3118 * Sets the brightness of window. 3119 * 3120 * @param { number } brightness the specified brightness value. 3121 * @param { AsyncCallback<void> } callback Callback used to return the result. 3122 * @throws { BusinessError } 401 - Parameter error. 3123 * @throws { BusinessError } 1300002 - This window state is abnormal. 3124 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3125 * @syscap SystemCapability.WindowManager.WindowManager.Core 3126 * @crossplatform 3127 * @since 10 3128 */ 3129 setWindowBrightness(brightness: number, callback: AsyncCallback<void>): void; 3130 3131 /** 3132 * Sets the dimBehind of window. 3133 * 3134 * @param { number } dimBehindValue - The specified dimBehind. 3135 * @param { AsyncCallback<void> } callback Callback used to return the result. 3136 * @syscap SystemCapability.WindowManager.WindowManager.Core 3137 * @since 7 3138 * @deprecated since 9 3139 */ 3140 setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void; 3141 3142 /** 3143 * Sets the dimBehind of window. 3144 * 3145 * @param { number } dimBehindValue - The specified dimBehind. 3146 * @returns { Promise<void> } Promise that returns no value. 3147 * @syscap SystemCapability.WindowManager.WindowManager.Core 3148 * @since 7 3149 * @deprecated since 9 3150 */ 3151 setDimBehind(dimBehindValue: number): Promise<void>; 3152 3153 /** 3154 * Sets whether focusable or not. 3155 * 3156 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 3157 * @returns { Promise<void> } Promise that returns no value. 3158 * @syscap SystemCapability.WindowManager.WindowManager.Core 3159 * @since 7 3160 * @deprecated since 9 3161 * @useinstead ohos.window.Window#setWindowFocusable 3162 */ 3163 setFocusable(isFocusable: boolean): Promise<void>; 3164 3165 /** 3166 * Sets whether focusable or not. 3167 * 3168 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 3169 * @param { AsyncCallback<void> } callback Callback used to return the result. 3170 * @syscap SystemCapability.WindowManager.WindowManager.Core 3171 * @since 7 3172 * @deprecated since 9 3173 * @useinstead ohos.window.Window#setWindowFocusable 3174 */ 3175 setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 3176 3177 /** 3178 * Sets whether focusable or not. 3179 * 3180 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 3181 * @returns { Promise<void> } Promise that returns no value. 3182 * @throws { BusinessError } 401 - Parameter error. 3183 * @throws { BusinessError } 1300002 - This window state is abnormal. 3184 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3185 * @syscap SystemCapability.WindowManager.WindowManager.Core 3186 * @since 9 3187 */ 3188 setWindowFocusable(isFocusable: boolean): Promise<void>; 3189 3190 /** 3191 * Sets whether focusable or not. 3192 * 3193 * @param { boolean } isFocusable can be focus if true, or can not be focus if false. 3194 * @param { AsyncCallback<void> } callback Callback used to return the result. 3195 * @throws { BusinessError } 401 - Parameter error. 3196 * @throws { BusinessError } 1300002 - This window state is abnormal. 3197 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3198 * @syscap SystemCapability.WindowManager.WindowManager.Core 3199 * @since 9 3200 */ 3201 setWindowFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 3202 3203 /** 3204 * Sets whether keep screen on or not. 3205 * 3206 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 3207 * @returns { Promise<void> } that returns no value. 3208 * @syscap SystemCapability.WindowManager.WindowManager.Core 3209 * @since 6 3210 * @deprecated since 9 3211 * @useinstead ohos.window.Window#setWindowKeepScreenOn 3212 */ 3213 setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 3214 3215 /** 3216 * Sets whether keep screen on or not. 3217 * 3218 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 3219 * @param { AsyncCallback<void> } callback Callback used to return the result. 3220 * @syscap SystemCapability.WindowManager.WindowManager.Core 3221 * @since 6 3222 * @deprecated since 9 3223 * @useinstead ohos.window.Window#setWindowKeepScreenOn 3224 */ 3225 setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 3226 3227 /** 3228 * Sets whether keep screen on or not. 3229 * 3230 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 3231 * @returns { Promise<void> } Promise that returns no value. 3232 * @throws { BusinessError } 401 - Parameter error. 3233 * @throws { BusinessError } 1300002 - This window state is abnormal. 3234 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3235 * @syscap SystemCapability.WindowManager.WindowManager.Core 3236 * @since 9 3237 */ 3238 /** 3239 * Sets whether keep screen on or not. 3240 * 3241 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 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 * @crossplatform 3248 * @since 10 3249 */ 3250 setWindowKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 3251 3252 /** 3253 * Sets whether keep screen on or not. 3254 * 3255 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 3256 * @param { AsyncCallback<void> } callback Callback used to return the result. 3257 * @throws { BusinessError } 401 - Parameter error. 3258 * @throws { BusinessError } 1300002 - This window state is abnormal. 3259 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3260 * @syscap SystemCapability.WindowManager.WindowManager.Core 3261 * @since 9 3262 */ 3263 /** 3264 * Sets whether keep screen on or not. 3265 * 3266 * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. 3267 * @param { AsyncCallback<void> } callback Callback used to return the result. 3268 * @throws { BusinessError } 401 - Parameter error. 3269 * @throws { BusinessError } 1300002 - This window state is abnormal. 3270 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3271 * @syscap SystemCapability.WindowManager.WindowManager.Core 3272 * @crossplatform 3273 * @since 10 3274 */ 3275 setWindowKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 3276 3277 /** 3278 * Sets whether to wake up the screen when this ability is restored. 3279 * 3280 * @param { boolean } wakeUp Specifies whether to wake up the screen. True means to wake it up, false means not. 3281 * @throws { BusinessError } 401 - Parameter error. 3282 * @throws { BusinessError } 1300002 - This window state is abnormal. 3283 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3284 * @syscap SystemCapability.WindowManager.WindowManager.Core 3285 * @systemapi Hide this for inner system use. 3286 * @since 9 3287 */ 3288 setWakeUpScreen(wakeUp: boolean): void; 3289 3290 /** 3291 * Sets whether outside can be touch or not. 3292 * 3293 * @param { boolean } touchable outside can be touch if true, or not if false. 3294 * @returns { Promise<void> } Promise that returns no value. 3295 * @syscap SystemCapability.WindowManager.WindowManager.Core 3296 * @since 7 3297 * @deprecated since 9 3298 */ 3299 setOutsideTouchable(touchable: boolean): Promise<void>; 3300 3301 /** 3302 * Sets whether outside can be touch or not. 3303 * 3304 * @param { boolean } touchable outside can be touch if true, or not if false. 3305 * @param { AsyncCallback<void> } callback Callback used to return the result. 3306 * @syscap SystemCapability.WindowManager.WindowManager.Core 3307 * @since 7 3308 * @deprecated since 9 3309 */ 3310 setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void; 3311 3312 /** 3313 * Sets whether is private mode or not. 3314 * 3315 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 3316 * @returns { Promise<void> } Promise that returns no value. 3317 * @syscap SystemCapability.WindowManager.WindowManager.Core 3318 * @since 7 3319 * @deprecated since 9 3320 * @useinstead ohos.window.Window#setWindowPrivacyMode 3321 */ 3322 setPrivacyMode(isPrivacyMode: boolean): Promise<void>; 3323 3324 /** 3325 * Sets whether is private mode or not. 3326 * 3327 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 3328 * @param { AsyncCallback<void> } callback Callback used to return the result. 3329 * @syscap SystemCapability.WindowManager.WindowManager.Core 3330 * @since 7 3331 * @deprecated since 9 3332 * @useinstead ohos.window.Window#setWindowPrivacyMode 3333 */ 3334 setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 3335 3336 /** 3337 * Sets whether is private mode or not. 3338 * 3339 * @permission ohos.permission.PRIVACY_WINDOW 3340 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 3341 * @returns { Promise<void> } Promise that returns no value. 3342 * @throws { BusinessError } 201 - Permission verification failed. 3343 * @throws { BusinessError } 401 - Parameter error. 3344 * @throws { BusinessError } 1300002 - This window state is abnormal. 3345 * @syscap SystemCapability.WindowManager.WindowManager.Core 3346 * @since 9 3347 */ 3348 setWindowPrivacyMode(isPrivacyMode: boolean): Promise<void>; 3349 3350 /** 3351 * Sets whether is private mode or not. 3352 * 3353 * @permission ohos.permission.PRIVACY_WINDOW 3354 * @param { boolean } isPrivacyMode in private mode if true, or not if false. 3355 * @param { AsyncCallback<void> } callback Callback used to return the result. 3356 * @throws { BusinessError } 201 - Permission verification failed. 3357 * @throws { BusinessError } 401 - Parameter error. 3358 * @throws { BusinessError } 1300002 - This window state is abnormal. 3359 * @syscap SystemCapability.WindowManager.WindowManager.Core 3360 * @since 9 3361 */ 3362 setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 3363 3364 /** 3365 * Ignore this window during screenshot. 3366 * 3367 * @param { boolean } isSkip skip if true, or not if false. 3368 * @throws { BusinessError } 401 - Parameter error. 3369 * @throws { BusinessError } 1300002 - This window state is abnormal. 3370 * @syscap SystemCapability.WindowManager.WindowManager.Core 3371 * @systemapi Hide this for inner system use. 3372 * @since 9 3373 */ 3374 setSnapshotSkip(isSkip: boolean): void; 3375 3376 /** 3377 * Sets whether is touchable or not. 3378 * 3379 * @param { boolean } isTouchable is touchable if true, or not if false. 3380 * @returns { Promise<void> } Promise that returns no value. 3381 * @syscap SystemCapability.WindowManager.WindowManager.Core 3382 * @since 7 3383 * @deprecated since 9 3384 * @useinstead ohos.window.Window#setWindowTouchable 3385 */ 3386 setTouchable(isTouchable: boolean): Promise<void>; 3387 3388 /** 3389 * Sets whether is touchable or not. 3390 * 3391 * @param { boolean } isTouchable is touchable if true, or not if false. 3392 * @param { AsyncCallback<void> } callback Callback used to return the result. 3393 * @syscap SystemCapability.WindowManager.WindowManager.Core 3394 * @since 7 3395 * @deprecated since 9 3396 * @useinstead ohos.window.Window#setWindowTouchable 3397 */ 3398 setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 3399 3400 /** 3401 * Sets whether is touchable or not. 3402 * 3403 * @param { boolean } isTouchable is touchable if true, or not if false. 3404 * @returns { Promise<void> } Promise that returns no value. 3405 * @throws { BusinessError } 401 - Parameter error. 3406 * @throws { BusinessError } 1300002 - This window state is abnormal. 3407 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3408 * @syscap SystemCapability.WindowManager.WindowManager.Core 3409 * @since 9 3410 */ 3411 setWindowTouchable(isTouchable: boolean): Promise<void>; 3412 3413 /** 3414 * Sets whether is touchable or not. 3415 * 3416 * @param { boolean } isTouchable is touchable if true, or not if false. 3417 * @param { AsyncCallback<void> } callback Callback used to return the result. 3418 * @throws { BusinessError } 401 - Parameter error. 3419 * @throws { BusinessError } 1300002 - This window state is abnormal. 3420 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3421 * @syscap SystemCapability.WindowManager.WindowManager.Core 3422 * @since 9 3423 */ 3424 setWindowTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 3425 3426 /** 3427 * Sets the flag of the window is forbidden to move in split screen mode 3428 * 3429 * @param { boolean } isForbidSplitMove the flag of the window is forbidden to move in split screen mode 3430 * @param { AsyncCallback<void> } callback Callback used to return the result. 3431 * @throws { BusinessError } 401 - Parameter error. 3432 * @throws { BusinessError } 1300002 - This window state is abnormal. 3433 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3434 * @syscap SystemCapability.WindowManager.WindowManager.Core 3435 * @systemapi 3436 * @since 9 3437 */ 3438 setForbidSplitMove(isForbidSplitMove: boolean, callback: AsyncCallback<void>): void; 3439 3440 /** 3441 * Sets the flag of the window is forbidden to move in split screen mode 3442 * 3443 * @param { boolean } isForbidSplitMove the flag of the window is forbidden to move in split screen mode 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 * @systemapi 3450 * @since 9 3451 */ 3452 setForbidSplitMove(isForbidSplitMove: boolean): Promise<void>; 3453 3454 /** 3455 * Obtains snapshot of window 3456 * 3457 * @param { AsyncCallback<image.PixelMap> } callback Callback used to return the result. 3458 * @throws { BusinessError } 1300002 - This window state is abnormal. 3459 * @syscap SystemCapability.WindowManager.WindowManager.Core 3460 * @since 9 3461 */ 3462 snapshot(callback: AsyncCallback<image.PixelMap>): void; 3463 3464 /** 3465 * Obtains snapshot of window 3466 * 3467 * @returns { Promise<image.PixelMap> } Promise that returns no value. 3468 * @throws { BusinessError } 1300002 - This window state is abnormal. 3469 * @syscap SystemCapability.WindowManager.WindowManager.Core 3470 * @since 9 3471 */ 3472 snapshot(): Promise<image.PixelMap>; 3473 3474 /** 3475 * Sets opacity of window 3476 * 3477 * @param { number } opacity Interval is 0.f-1.f. 3478 * @throws { BusinessError } 401 - Parameter error. 3479 * @throws { BusinessError } 1300002 - This window state is abnormal. 3480 * @throws { BusinessError } 1300004 - Unauthorized operation. 3481 * @syscap SystemCapability.WindowManager.WindowManager.Core 3482 * @systemapi 3483 * @since 9 3484 */ 3485 opacity(opacity: number): void; 3486 3487 /** 3488 * Sets scale options of window. 3489 * 3490 * @param { ScaleOptions } scaleOptions scale param of window. 3491 * @throws { BusinessError } 401 - Parameter error. 3492 * @throws { BusinessError } 1300002 - This window state is abnormal. 3493 * @throws { BusinessError } 1300004 - Unauthorized operation. 3494 * @syscap SystemCapability.WindowManager.WindowManager.Core 3495 * @systemapi 3496 * @since 9 3497 */ 3498 scale(scaleOptions: ScaleOptions): void; 3499 3500 /** 3501 * Sets rotate options of window. 3502 * 3503 * @param { RotateOptions } rotateOptions rotate param of window. 3504 * @throws { BusinessError } 401 - Parameter error. 3505 * @throws { BusinessError } 1300002 - This window state is abnormal. 3506 * @throws { BusinessError } 1300004 - Unauthorized operation. 3507 * @syscap SystemCapability.WindowManager.WindowManager.Core 3508 * @systemapi 3509 * @since 9 3510 */ 3511 rotate(rotateOptions: RotateOptions): void; 3512 3513 /** 3514 * Sets translate options of window. 3515 * 3516 * @param { TranslateOptions } translateOptions translate param of window. 3517 * @throws { BusinessError } 401 - Parameter error. 3518 * @throws { BusinessError } 1300002 - This window state is abnormal. 3519 * @throws { BusinessError } 1300004 - Unauthorized operation. 3520 * @syscap SystemCapability.WindowManager.WindowManager.Core 3521 * @systemapi 3522 * @since 9 3523 */ 3524 translate(translateOptions: TranslateOptions): void; 3525 3526 /** 3527 * Get Transition Controller. 3528 * 3529 * @returns { TransitionController } 3530 * @throws { BusinessError } 1300002 - This window state is abnormal. 3531 * @throws { BusinessError } 1300004 - Unauthorized operation. 3532 * @syscap SystemCapability.WindowManager.WindowManager.Core 3533 * @systemapi 3534 * @since 9 3535 */ 3536 getTransitionController(): TransitionController; 3537 3538 /** 3539 * Sets the window blur radius. 3540 * 3541 * @param { number } radius the blur radius. 3542 * @throws { BusinessError } 401 - Parameter error. 3543 * @throws { BusinessError } 1300002 - This window state is abnormal. 3544 * @throws { BusinessError } 1300004 - Unauthorized operation. 3545 * @syscap SystemCapability.WindowManager.WindowManager.Core 3546 * @systemapi Hide this for inner system use. 3547 * @since 9 3548 */ 3549 setBlur(radius: number): void; 3550 3551 /** 3552 * Sets the window backdrop blur radius. 3553 * 3554 * @param { number } radius the blur radius. 3555 * @throws { BusinessError } 401 - Parameter error. 3556 * @throws { BusinessError } 1300002 - This window state is abnormal. 3557 * @throws { BusinessError } 1300004 - Unauthorized operation. 3558 * @syscap SystemCapability.WindowManager.WindowManager.Core 3559 * @systemapi Hide this for inner system use. 3560 * @since 9 3561 */ 3562 setBackdropBlur(radius: number): void; 3563 3564 /** 3565 * Sets the window backdrop blur style. 3566 * 3567 * @param { BlurStyle } blurStyle the specified blur style. 3568 * @throws { BusinessError } 401 - Parameter error. 3569 * @throws { BusinessError } 1300002 - This window state is abnormal. 3570 * @throws { BusinessError } 1300004 - Unauthorized operation. 3571 * @syscap SystemCapability.WindowManager.WindowManager.Core 3572 * @systemapi Hide this for inner system use. 3573 * @since 9 3574 */ 3575 setBackdropBlurStyle(blurStyle: BlurStyle): void; 3576 3577 /** 3578 * Sets shadow. 3579 * 3580 * @param { number } radius the radius of the shadow. 3581 * @param { string } color the color of the shadow. 3582 * @param { number } offsetX the offset of the shadow on the x-axis. 3583 * @param { number } offsetY the offset of the shadow on the y-axis. 3584 * @throws { BusinessError } 401 - Parameter error. 3585 * @throws { BusinessError } 1300002 - This window state is abnormal. 3586 * @throws { BusinessError } 1300004 - Unauthorized operation. 3587 * @syscap SystemCapability.WindowManager.WindowManager.Core 3588 * @systemapi Hide this for inner system use. 3589 * @since 9 3590 */ 3591 setShadow(radius: number, color?: string, offsetX?: number, offsetY?: number): void; 3592 3593 /** 3594 * Sets corner radius. 3595 * 3596 * @param { number } cornerRadius the corner radius. 3597 * @throws { BusinessError } 401 - Parameter error. 3598 * @throws { BusinessError } 1300002 - This window state is abnormal. 3599 * @throws { BusinessError } 1300004 - Unauthorized operation. 3600 * @syscap SystemCapability.WindowManager.WindowManager.Core 3601 * @systemapi Hide this for inner system use. 3602 * @since 9 3603 */ 3604 setCornerRadius(cornerRadius: number): void; 3605 3606 /** 3607 * Raise app sub window to app top 3608 * 3609 * @param { AsyncCallback<void> } callback - The callback of raiseToAppTop 3610 * @throws { BusinessError } 201 - Permission verification failed. 3611 * @throws { BusinessError } 1300002 - This window state is abnormal. 3612 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3613 * @throws { BusinessError } 1300004 - Unauthorized operation. 3614 * @throws { BusinessError } 1300009 - The parent window is invalid. 3615 * @syscap SystemCapability.WindowManager.WindowManager.Core 3616 * @systemapi Hide this for inner system use. 3617 * @since 10 3618 */ 3619 raiseToAppTop(callback: AsyncCallback<void>): void; 3620 3621 /** 3622 * Raise app sub window to app top 3623 * 3624 * @returns { Promise<void> } - The promise returned by the function 3625 * @throws { BusinessError } 201 - Permission verification failed. 3626 * @throws { BusinessError } 1300002 - This window state is abnormal. 3627 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3628 * @throws { BusinessError } 1300004 - Unauthorized operation. 3629 * @throws { BusinessError } 1300009 - The parent window is invalid. 3630 * @syscap SystemCapability.WindowManager.WindowManager.Core 3631 * @systemapi Hide this for inner system use. 3632 * @since 10 3633 */ 3634 raiseToAppTop(): Promise<void>; 3635 3636 /** 3637 * Sets the aspect ratio of window 3638 * 3639 * @param { number } ratio - The aspect ratio of window except decoration 3640 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 3641 * @throws { BusinessError } 401 - Parameter error. 3642 * @throws { BusinessError } 1300002 - This window state is abnormal. 3643 * @throws { BusinessError } 1300004 - Unauthorized operation. 3644 * @syscap SystemCapability.WindowManager.WindowManager.Core 3645 * @since 10 3646 */ 3647 setAspectRatio(ratio: number, callback: AsyncCallback<void>): void; 3648 3649 /** 3650 * Sets the aspect ratio of window 3651 * 3652 * @param { number } ratio - The aspect ratio of window except decoration 3653 * @returns { Promise<void> } - The promise returned by the function. 3654 * @throws { BusinessError } 401 - Parameter error. 3655 * @throws { BusinessError } 1300002 - This window state is abnormal. 3656 * @throws { BusinessError } 1300004 - Unauthorized operation. 3657 * @syscap SystemCapability.WindowManager.WindowManager.Core 3658 * @since 10 3659 */ 3660 setAspectRatio(ratio: number): Promise<void>; 3661 3662 /** 3663 * Resets the aspect ratio of window 3664 * 3665 * @param { AsyncCallback<void> } callback - The callback of setAspectRatio. 3666 * @throws { BusinessError } 1300002 - This window state is abnormal. 3667 * @throws { BusinessError } 1300004 - Unauthorized operation. 3668 * @syscap SystemCapability.WindowManager.WindowManager.Core 3669 * @since 10 3670 */ 3671 resetAspectRatio(callback: AsyncCallback<void>): void; 3672 3673 /** 3674 * Resets the aspect ratio of window 3675 * 3676 * @returns { Promise<void> } - The promise returned by the function. 3677 * @throws { BusinessError } 1300002 - This window state is abnormal. 3678 * @throws { BusinessError } 1300004 - Unauthorized operation. 3679 * @syscap SystemCapability.WindowManager.WindowManager.Core 3680 * @since 10 3681 */ 3682 resetAspectRatio(): Promise<void>; 3683 3684 /** 3685 * Set the watermark flag on the window. 3686 * 3687 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false. 3688 * @param { AsyncCallback<void> } callback - The callback of setWaterMarkFlag. 3689 * @throws { BusinessError } 1300002 - This window state is abnormal. 3690 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3691 * @throws { BusinessError } 1300008 - The operation is on invalid display. 3692 * @syscap SystemCapability.WindowManager.WindowManager.Core 3693 * @systemapi Hide this for inner system use. 3694 * @since 10 3695 */ 3696 setWaterMarkFlag(enable: boolean, callback: AsyncCallback<void>): void; 3697 3698 /** 3699 * Set the watermark flag on the window 3700 * 3701 * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false 3702 * @returns { Promise<void> } - The promise returned by the function 3703 * @throws { BusinessError } 1300002 - This window state is abnormal. 3704 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3705 * @throws { BusinessError } 1300008 - The operation is on invalid display. 3706 * @syscap SystemCapability.WindowManager.WindowManager.Core 3707 * @systemapi Hide this for inner system use. 3708 * @since 10 3709 */ 3710 setWaterMarkFlag(enable: boolean): Promise<void>; 3711 3712 /** 3713 * Raise one app sub window above another. 3714 * 3715 * @param { number } windowId - Indicates target window id. 3716 * @param { AsyncCallback<void> } callback - The callback of raiseAboveTarget. 3717 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3718 * @throws { BusinessError } 401 - Parameter error. 3719 * @throws { BusinessError } 801 - Capability not supported on this device. 3720 * @throws { BusinessError } 1300002 - This window state is abnormal. 3721 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3722 * @throws { BusinessError } 1300004 - Unauthorized operation. 3723 * @throws { BusinessError } 1300009 - The parent window is invalid. 3724 * @syscap SystemCapability.Window.SessionManager 3725 * @systemapi Hide this for inner system use. 3726 * @since 10 3727 */ 3728 raiseAboveTarget(windowId: number, callback: AsyncCallback<void>): void; 3729 3730 /** 3731 * Raise one app sub window above another. 3732 * 3733 * @param { number } windowId - Indicates target window id. 3734 * @returns { Promise<void> } - The promise returned by the function. 3735 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3736 * @throws { BusinessError } 401 - Parameter error. 3737 * @throws { BusinessError } 801 - Capability not supported on this device. 3738 * @throws { BusinessError } 1300002 - This window state is abnormal. 3739 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3740 * @throws { BusinessError } 1300004 - Unauthorized operation. 3741 * @throws { BusinessError } 1300009 - The parent window is invalid. 3742 * @syscap SystemCapability.Window.SessionManager 3743 * @systemapi Hide this for inner system use. 3744 * @since 10 3745 */ 3746 raiseAboveTarget(windowId: number): Promise<void>; 3747 3748 /** 3749 * Set whether to enable an app sub window to raise itself by click. 3750 * 3751 * @param { boolean } enable - Disable app sub window to raise itself by by click if false. 3752 * @param { AsyncCallback<void> } callback - The callback of setRaiseByClickEnabled. 3753 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3754 * @throws { BusinessError } 401 - Parameter error. 3755 * @throws { BusinessError } 801 - Capability not supported on this device. 3756 * @throws { BusinessError } 1300002 - This window state is abnormal. 3757 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3758 * @throws { BusinessError } 1300004 - Unauthorized operation. 3759 * @throws { BusinessError } 1300009 - The parent window is invalid. 3760 * @syscap SystemCapability.Window.SessionManager 3761 * @systemapi Hide this for inner system use. 3762 * @since 10 3763 */ 3764 setRaiseByClickEnabled(enable: boolean, callback: AsyncCallback<void>): void; 3765 3766 /** 3767 * Set whether to enable an app sub window to raise itself by click. 3768 * 3769 * @param { boolean } enable - Disable app sub window to raise itself by by click if false. 3770 * @returns { Promise<void> } - The promise returned by the function. 3771 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3772 * @throws { BusinessError } 401 - Parameter error. 3773 * @throws { BusinessError } 801 - Capability not supported on this device. 3774 * @throws { BusinessError } 1300002 - This window state is abnormal. 3775 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3776 * @throws { BusinessError } 1300004 - Unauthorized operation. 3777 * @throws { BusinessError } 1300009 - The parent window is invalid. 3778 * @syscap SystemCapability.Window.SessionManager 3779 * @systemapi Hide this for inner system use. 3780 * @since 10 3781 */ 3782 setRaiseByClickEnabled(enable: boolean): Promise<void>; 3783 3784 /** 3785 * Minimize app main window. 3786 * 3787 * @param { AsyncCallback<void> } callback - The callback of Minimize. 3788 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3789 * @throws { BusinessError } 801 - Capability not supported on this device. 3790 * @throws { BusinessError } 1300002 - This window state is abnormal. 3791 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3792 * @syscap SystemCapability.Window.SessionManager 3793 * @systemapi Hide this for inner system use. 3794 * @since 10 3795 */ 3796 minimize(callback: AsyncCallback<void>): void; 3797 3798 /** 3799 * Minimize app main window. 3800 * 3801 * @returns { Promise<void> } - The promise returned by the function. 3802 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3803 * @throws { BusinessError } 801 - Capability not supported on this device. 3804 * @throws { BusinessError } 1300002 - This window state is abnormal. 3805 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3806 * @syscap SystemCapability.Window.SessionManager 3807 * @systemapi Hide this for inner system use. 3808 * @since 10 3809 */ 3810 minimize(): Promise<void>; 3811 3812 /** 3813 * Set whether to enable a window to resize by drag. 3814 * 3815 * @param { boolean } enable - Disable window to resize by drag if false. 3816 * @param { AsyncCallback<void> } callback - The callback of setResizeByDragEnabled. 3817 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3818 * @throws { BusinessError } 401 - Parameter error. 3819 * @throws { BusinessError } 801 - Capability not supported on this device. 3820 * @throws { BusinessError } 1300002 - This window state is abnormal. 3821 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3822 * @throws { BusinessError } 1300004 - Unauthorized operation. 3823 * @syscap SystemCapability.Window.SessionManager 3824 * @systemapi Hide this for inner system use. 3825 * @since 10 3826 */ 3827 setResizeByDragEnabled(enable: boolean, callback: AsyncCallback<void>): void; 3828 3829 /** 3830 * Set whether to enable a window to resize by drag. 3831 * 3832 * @param { boolean } enable - Disable window to resize by drag if false. 3833 * @returns { Promise<void> } - The promise returned by the function. 3834 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 3835 * @throws { BusinessError } 401 - Parameter error. 3836 * @throws { BusinessError } 801 - Capability not supported on this device. 3837 * @throws { BusinessError } 1300002 - This window state is abnormal. 3838 * @throws { BusinessError } 1300003 - This window manager service works abnormally. 3839 * @syscap SystemCapability.Window.SessionManager 3840 * @systemapi Hide this for inner system use. 3841 * @since 10 3842 */ 3843 setResizeByDragEnabled(enable: boolean): Promise<void>; 3844 } 3845 /** 3846 * Window stage callback event type 3847 * 3848 * @enum { number } 3849 * @syscap SystemCapability.WindowManager.WindowManager.Core 3850 * @StageModelOnly 3851 * @since 9 3852 */ 3853 /** 3854 * Window stage callback event type 3855 * 3856 * @enum { number } 3857 * @syscap SystemCapability.WindowManager.WindowManager.Core 3858 * @StageModelOnly 3859 * @crossplatform 3860 * @since 10 3861 */ 3862 enum WindowStageEventType { 3863 /** 3864 * The window stage is running in the foreground. 3865 * 3866 * @syscap SystemCapability.WindowManager.WindowManager.Core 3867 * @StageModelOnly 3868 * @since 9 3869 */ 3870 /** 3871 * The window stage is running in the foreground. 3872 * 3873 * @syscap SystemCapability.WindowManager.WindowManager.Core 3874 * @StageModelOnly 3875 * @crossplatform 3876 * @since 10 3877 */ 3878 SHOWN = 1, 3879 /** 3880 * The window stage gains focus. 3881 * 3882 * @syscap SystemCapability.WindowManager.WindowManager.Core 3883 * @StageModelOnly 3884 * @since 9 3885 */ 3886 /** 3887 * The window stage gains focus. 3888 * 3889 * @syscap SystemCapability.WindowManager.WindowManager.Core 3890 * @StageModelOnly 3891 * @crossplatform 3892 * @since 10 3893 */ 3894 ACTIVE, 3895 /** 3896 * The window stage loses focus. 3897 * 3898 * @syscap SystemCapability.WindowManager.WindowManager.Core 3899 * @StageModelOnly 3900 * @since 9 3901 */ 3902 /** 3903 * The window stage loses focus. 3904 * 3905 * @syscap SystemCapability.WindowManager.WindowManager.Core 3906 * @StageModelOnly 3907 * @crossplatform 3908 * @since 10 3909 */ 3910 INACTIVE, 3911 /** 3912 * The window stage is running in the background. 3913 * 3914 * @syscap SystemCapability.WindowManager.WindowManager.Core 3915 * @StageModelOnly 3916 * @since 9 3917 */ 3918 /** 3919 * The window stage is running in the background. 3920 * 3921 * @syscap SystemCapability.WindowManager.WindowManager.Core 3922 * @StageModelOnly 3923 * @crossplatform 3924 * @since 10 3925 */ 3926 HIDDEN 3927 } 3928 /** 3929 * WindowStage 3930 * 3931 * @interface WindowStage 3932 * @syscap SystemCapability.WindowManager.WindowManager.Core 3933 * @since 9 3934 */ 3935 /** 3936 * WindowStage 3937 * 3938 * @interface WindowStage 3939 * @syscap SystemCapability.WindowManager.WindowManager.Core 3940 * @crossplatform 3941 * @since 10 3942 */ 3943 interface WindowStage { 3944 /** 3945 * Get main window of the stage. 3946 * 3947 * @returns { Promise<Window> } Callback used to return the subwindow. 3948 * @throws { BusinessError } 1300002 - This window state is abnormal. 3949 * @throws { BusinessError } 1300005 - This window stage is abnormal. 3950 * @syscap SystemCapability.WindowManager.WindowManager.Core 3951 * @StageModelOnly 3952 * @since 9 3953 */ 3954 /** 3955 * Get main window of the stage. 3956 * 3957 * @returns { Promise<Window> } Callback used to return the subwindow. 3958 * @throws { BusinessError } 1300002 - This window state is abnormal. 3959 * @throws { BusinessError } 1300005 - This window stage is abnormal. 3960 * @syscap SystemCapability.WindowManager.WindowManager.Core 3961 * @StageModelOnly 3962 * @crossplatform 3963 * @since 10 3964 */ 3965 getMainWindow(): Promise<Window>; 3966 /** 3967 * Get main window of the stage. 3968 * 3969 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 3970 * @throws { BusinessError } 1300002 - This window state is abnormal. 3971 * @throws { BusinessError } 1300005 - This window stage is abnormal. 3972 * @syscap SystemCapability.WindowManager.WindowManager.Core 3973 * @StageModelOnly 3974 * @since 9 3975 */ 3976 /** 3977 * Get main window of the stage. 3978 * 3979 * @param { AsyncCallback<Window> } callback Callback used to return the main window. 3980 * @throws { BusinessError } 1300002 - This window state is abnormal. 3981 * @throws { BusinessError } 1300005 - This window stage is abnormal. 3982 * @syscap SystemCapability.WindowManager.WindowManager.Core 3983 * @StageModelOnly 3984 * @crossplatform 3985 * @since 10 3986 */ 3987 getMainWindow(callback: AsyncCallback<Window>): void; 3988 /** 3989 * Get main window of the stage. 3990 * 3991 * @returns { Window } 3992 * @throws { BusinessError } 1300002 - This window state is abnormal. 3993 * @throws { BusinessError } 1300005 - This window stage is abnormal. 3994 * @syscap SystemCapability.WindowManager.WindowManager.Core 3995 * @StageModelOnly 3996 * @since 9 3997 */ 3998 /** 3999 * Get main window of the stage. 4000 * 4001 * @returns { Window } 4002 * @throws { BusinessError } 1300002 - This window state is abnormal. 4003 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4004 * @syscap SystemCapability.WindowManager.WindowManager.Core 4005 * @StageModelOnly 4006 * @crossplatform 4007 * @since 10 4008 */ 4009 getMainWindowSync(): Window; 4010 /** 4011 * Create sub window of the stage. 4012 * 4013 * @param { string } name window name of sub window 4014 * @returns { Promise<Window> } Promise used to return the subwindow. 4015 * @throws { BusinessError } 401 - Parameter error. 4016 * @throws { BusinessError } 1300002 - This window state is abnormal. 4017 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4018 * @syscap SystemCapability.WindowManager.WindowManager.Core 4019 * @StageModelOnly 4020 * @since 9 4021 */ 4022 /** 4023 * Create sub window of the stage. 4024 * 4025 * @param { string } name window name of sub window 4026 * @returns { Promise<Window> } Promise used to return the subwindow. 4027 * @throws { BusinessError } 401 - Parameter error. 4028 * @throws { BusinessError } 1300002 - This window state is abnormal. 4029 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4030 * @syscap SystemCapability.WindowManager.WindowManager.Core 4031 * @StageModelOnly 4032 * @crossplatform 4033 * @since 10 4034 */ 4035 createSubWindow(name: string): Promise<Window>; 4036 /** 4037 * Create sub window of the stage. 4038 * 4039 * @param { string } name window name of sub window 4040 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 4041 * @throws { BusinessError } 401 - Parameter error. 4042 * @throws { BusinessError } 1300002 - This window state is abnormal. 4043 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4044 * @syscap SystemCapability.WindowManager.WindowManager.Core 4045 * @StageModelOnly 4046 * @since 9 4047 */ 4048 /** 4049 * Create sub window of the stage. 4050 * 4051 * @param { string } name window name of sub window 4052 * @param { AsyncCallback<Window> } callback Callback used to return the subwindow. 4053 * @throws { BusinessError } 401 - Parameter error. 4054 * @throws { BusinessError } 1300002 - This window state is abnormal. 4055 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4056 * @syscap SystemCapability.WindowManager.WindowManager.Core 4057 * @StageModelOnly 4058 * @crossplatform 4059 * @since 10 4060 */ 4061 createSubWindow(name: string, callback: AsyncCallback<Window>): void; 4062 /** 4063 * Get sub window of the stage. 4064 * 4065 * @returns { Promise<Array<Window>> } 4066 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4067 * @syscap SystemCapability.WindowManager.WindowManager.Core 4068 * @StageModelOnly 4069 * @since 9 4070 */ 4071 /** 4072 * Get sub window of the stage. 4073 * 4074 * @returns { Promise<Array<Window>> } 4075 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4076 * @syscap SystemCapability.WindowManager.WindowManager.Core 4077 * @StageModelOnly 4078 * @crossplatform 4079 * @since 10 4080 */ 4081 getSubWindow(): Promise<Array<Window>>; 4082 /** 4083 * Get sub window of the stage. 4084 * 4085 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 4086 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4087 * @syscap SystemCapability.WindowManager.WindowManager.Core 4088 * @StageModelOnly 4089 * @since 9 4090 */ 4091 /** 4092 * Get sub window of the stage. 4093 * 4094 * @param { AsyncCallback<Array<Window>> } callback Callback used to return all the subwindows. 4095 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4096 * @syscap SystemCapability.WindowManager.WindowManager.Core 4097 * @StageModelOnly 4098 * @crossplatform 4099 * @since 10 4100 */ 4101 getSubWindow(callback: AsyncCallback<Array<Window>>): void; 4102 /** 4103 * Loads content 4104 * 4105 * @param { string } path Path of the page to which the content will be loaded 4106 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 4107 * @param { AsyncCallback<void> } callback Callback used to return the result. 4108 * @throws { BusinessError } 401 - Parameter error. 4109 * @throws { BusinessError } 1300002 - This window state is abnormal. 4110 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4111 * @syscap SystemCapability.WindowManager.WindowManager.Core 4112 * @StageModelOnly 4113 * @since 9 4114 */ 4115 /** 4116 * Loads content 4117 * 4118 * @param { string } path Path of the page to which the content will be loaded 4119 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 4120 * @param { AsyncCallback<void> } callback Callback used to return the result. 4121 * @throws { BusinessError } 401 - Parameter error. 4122 * @throws { BusinessError } 1300002 - This window state is abnormal. 4123 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4124 * @syscap SystemCapability.WindowManager.WindowManager.Core 4125 * @StageModelOnly 4126 * @crossplatform 4127 * @since 10 4128 */ 4129 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 4130 /** 4131 * Loads content 4132 * 4133 * @param { string } path of the page to which the content will be loaded 4134 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 4135 * @returns { Promise<void> } 4136 * @throws { BusinessError } 401 - Parameter error. 4137 * @throws { BusinessError } 1300002 - This window state is abnormal. 4138 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4139 * @syscap SystemCapability.WindowManager.WindowManager.Core 4140 * @StageModelOnly 4141 * @since 9 4142 */ 4143 /** 4144 * Loads content 4145 * 4146 * @param { string } path of the page to which the content will be loaded 4147 * @param { LocalStorage } storage The data object shared within the content instance loaded by the window 4148 * @returns { Promise<void> } 4149 * @throws { BusinessError } 401 - Parameter error. 4150 * @throws { BusinessError } 1300002 - This window state is abnormal. 4151 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4152 * @syscap SystemCapability.WindowManager.WindowManager.Core 4153 * @StageModelOnly 4154 * @crossplatform 4155 * @since 10 4156 */ 4157 loadContent(path: string, storage?: LocalStorage): Promise<void>; 4158 /** 4159 * Loads content 4160 * 4161 * @param { string } path of the page to which the content will be loaded 4162 * @param { AsyncCallback<void> } callback Callback used to return the result. 4163 * @throws { BusinessError } 401 - Parameter error. 4164 * @throws { BusinessError } 1300002 - This window state is abnormal. 4165 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4166 * @syscap SystemCapability.WindowManager.WindowManager.Core 4167 * @StageModelOnly 4168 * @since 9 4169 */ 4170 /** 4171 * Loads content 4172 * 4173 * @param { string } path of the page to which the content will be loaded 4174 * @param { AsyncCallback<void> } callback Callback used to return the result. 4175 * @throws { BusinessError } 401 - Parameter error. 4176 * @throws { BusinessError } 1300002 - This window state is abnormal. 4177 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4178 * @syscap SystemCapability.WindowManager.WindowManager.Core 4179 * @StageModelOnly 4180 * @crossplatform 4181 * @since 10 4182 */ 4183 loadContent(path: string, callback: AsyncCallback<void>): void; 4184 /** 4185 * Window stage event callback on. 4186 * 4187 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 4188 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 4189 * @throws { BusinessError } 401 - Parameter error. 4190 * @throws { BusinessError } 1300002 - This window state is abnormal. 4191 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4192 * @syscap SystemCapability.WindowManager.WindowManager.Core 4193 * @StageModelOnly 4194 * @since 9 4195 */ 4196 /** 4197 * Window stage event callback on. 4198 * 4199 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 4200 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 4201 * @throws { BusinessError } 401 - Parameter error. 4202 * @throws { BusinessError } 1300002 - This window state is abnormal. 4203 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4204 * @syscap SystemCapability.WindowManager.WindowManager.Core 4205 * @StageModelOnly 4206 * @crossplatform 4207 * @since 10 4208 */ 4209 on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void; 4210 /** 4211 * Window stage event callback off. 4212 * 4213 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 4214 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 4215 * @throws { BusinessError } 401 - Parameter error. 4216 * @throws { BusinessError } 1300002 - This window state is abnormal. 4217 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4218 * @syscap SystemCapability.WindowManager.WindowManager.Core 4219 * @StageModelOnly 4220 * @since 9 4221 */ 4222 /** 4223 * Window stage event callback off. 4224 * 4225 * @param { 'windowStageEvent' } eventType The value is fixed at 'windowStageEvent', indicating the window stage lifecycle change event. 4226 * @param { Callback<WindowStageEventType> } callback Callback used to return the window stage lifecycle state. 4227 * @throws { BusinessError } 401 - Parameter error. 4228 * @throws { BusinessError } 1300002 - This window state is abnormal. 4229 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4230 * @syscap SystemCapability.WindowManager.WindowManager.Core 4231 * @StageModelOnly 4232 * @crossplatform 4233 * @since 10 4234 */ 4235 off(eventType: 'windowStageEvent', callback?: Callback<WindowStageEventType>): void; 4236 4237 /** 4238 * Disable window decoration. It must be called before loadContent. 4239 * 4240 * @throws { BusinessError } 1300002 - This window state is abnormal. 4241 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4242 * @syscap SystemCapability.WindowManager.WindowManager.Core 4243 * @systemapi 4244 * @StageModelOnly 4245 * @since 9 4246 */ 4247 disableWindowDecor(): void; 4248 4249 /** 4250 * Sets whether can show on lock screen or not 4251 * 4252 * @param { boolean } showOnLockScreen can show on lock screen if true, or not if false 4253 * @throws { BusinessError } 401 - Parameter error. 4254 * @throws { BusinessError } 1300002 - This window state is abnormal. 4255 * @throws { BusinessError } 1300005 - This window stage is abnormal. 4256 * @syscap SystemCapability.WindowManager.WindowManager.Core 4257 * @systemapi Hide this for inner system use. 4258 * @StageModelOnly 4259 * @since 9 4260 */ 4261 setShowOnLockScreen(showOnLockScreen: boolean): void; 4262 } 4263} 4264 4265export default window; 4266