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 './basic' ; 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"; 24 25/** 26 * Window manager. 27 * @syscap SystemCapability.WindowManager.WindowManager.Core 28 */ 29declare namespace window { 30 /** 31 * The type of a window. 32 * @syscap SystemCapability.WindowManager.WindowManager.Core 33 * @since 7 34 */ 35 enum WindowType { 36 /** 37 * App. 38 * @FAModelOnly 39 */ 40 TYPE_APP, 41 /** 42 * System alert. 43 */ 44 TYPE_SYSTEM_ALERT, 45 /** 46 * Input method. 47 * @systemapi Hide this for inner system use. 48 * @since 9 49 * @StageModelOnly 50 */ 51 TYPE_INPUT_METHOD, 52 /** 53 * Status bar. 54 * @systemapi Hide this for inner system use. 55 * @since 9 56 * @StageModelOnly 57 */ 58 TYPE_STATUS_BAR, 59 /** 60 * Panel. 61 * @systemapi Hide this for inner system use. 62 * @since 9 63 * @StageModelOnly 64 */ 65 TYPE_PANEL, 66 /** 67 * Keyguard. 68 * @systemapi Hide this for inner system use. 69 * @since 9 70 * @StageModelOnly 71 */ 72 TYPE_KEYGUARD, 73 /** 74 * Volume. 75 * @systemapi Hide this for inner system use. 76 * @since 9 77 * @StageModelOnly 78 */ 79 TYPE_VOLUME_OVERLAY, 80 /** 81 * Navigation bar. 82 * @systemapi Hide this for inner system use. 83 * @since 9 84 * @StageModelOnly 85 */ 86 TYPE_NAVIGATION_BAR, 87 /** 88 * Float. 89 * @permission ohos.permission.SYSTEM_FLOAT_WINDOW 90 * @since 9 91 * @StageModelOnly 92 */ 93 TYPE_FLOAT, 94 /** 95 * Wallpaper. 96 * @systemapi Hide this for inner system use. 97 * @since 9 98 * @StageModelOnly 99 */ 100 TYPE_WALLPAPER, 101 /** 102 * Desktop. 103 * @systemapi Hide this for inner system use. 104 * @since 9 105 * @StageModelOnly 106 */ 107 TYPE_DESKTOP, 108 /** 109 * Recent. 110 * @systemapi Hide this for inner system use. 111 * @since 9 112 * @StageModelOnly 113 */ 114 TYPE_LAUNCHER_RECENT, 115 /** 116 * Dock. 117 * @systemapi Hide this for inner system use. 118 * @since 9 119 * @StageModelOnly 120 */ 121 TYPE_LAUNCHER_DOCK, 122 /** 123 * Voice interaction. 124 * @systemapi Hide this for inner system use. 125 * @since 9 126 * @StageModelOnly 127 */ 128 TYPE_VOICE_INTERACTION, 129 /** 130 * Pointer. 131 * @systemapi Hide this for inner system use. 132 * @since 9 133 * @StageModelOnly 134 */ 135 TYPE_POINTER, 136 /** 137 * Float camera. 138 * @systemapi Hide this for inner system use. 139 * @since 9 140 * @StageModelOnly 141 */ 142 TYPE_FLOAT_CAMERA, 143 /** 144 * Dialog. 145 * @systemapi Hide this for inner system use. 146 * @since 9 147 * @StageModelOnly 148 */ 149 TYPE_DIALOG, 150 /** 151 * Screenshot. 152 * @systemapi Hide this for inner system use. 153 * @since 9 154 * @StageModelOnly 155 */ 156 TYPE_SCREENSHOT 157 } 158 159 /** 160 * Describes the type of avoid area 161 * @syscap SystemCapability.WindowManager.WindowManager.Core 162 * @since 7 163 */ 164 enum AvoidAreaType { 165 /** 166 * Default area of the system 167 */ 168 TYPE_SYSTEM, 169 170 /** 171 * Notch 172 */ 173 TYPE_CUTOUT, 174 175 /** 176 * Area for system gesture 177 * @since 9 178 */ 179 TYPE_SYSTEM_GESTURE, 180 181 /** 182 * Area for keyboard 183 * @since 9 184 */ 185 TYPE_KEYBOARD 186 } 187 /** 188 * Describes the window mode of an application 189 * @systemapi Hide this for inner system use. 190 * @since 7 191 */ 192 enum WindowMode { 193 UNDEFINED = 1, 194 FULLSCREEN, 195 PRIMARY, 196 SECONDARY, 197 FLOATING 198 } 199 200 /** 201 * Describes the mode of window layout 202 * @syscap SystemCapability.WindowManager.WindowManager.Core 203 * @systemapi Hide this for inner system use. 204 * @since 9 205 */ 206 enum WindowLayoutMode { 207 /** 208 * CASCADE 209 * @systemapi Hide this for inner system use. 210 * @since 9 211 */ 212 WINDOW_LAYOUT_MODE_CASCADE, 213 /** 214 * TILE 215 * @systemapi Hide this for inner system use. 216 * @since 9 217 */ 218 WINDOW_LAYOUT_MODE_TILE 219 } 220 221 /** 222 * Properties of status bar and navigation bar, it couldn't update automatically 223 * @syscap SystemCapability.WindowManager.WindowManager.Core 224 * @since 6 225 */ 226 interface SystemBarProperties { 227 /** 228 * The color of the status bar. 229 * @since 6 230 */ 231 statusBarColor?: string; 232 233 /** 234 * The light icon of the status bar. 235 * @since 7 236 */ 237 isStatusBarLightIcon?: boolean; 238 239 /** 240 * The content color of the status bar 241 * @since 8 242 */ 243 statusBarContentColor?: string; 244 245 /** 246 * The color of the navigation bar. 247 * @since 6 248 */ 249 navigationBarColor?: string; 250 251 /** 252 * The light icon of the navigation bar. 253 * @since 7 254 */ 255 isNavigationBarLightIcon?: boolean; 256 257 /** 258 * The content color of the navigation bar 259 * @since 8 260 */ 261 navigationBarContentColor?: string; 262 } 263 264 /** 265 * System bar tint of region 266 * @syscap SystemCapability.WindowManager.WindowManager.Core 267 * @systemapi Hide this for inner system use. 268 * @since 8 269 */ 270 interface SystemBarRegionTint { 271 /** 272 * System bar type 273 */ 274 type: WindowType; 275 276 /** 277 * The visibility of system bar 278 */ 279 isEnable?: boolean; 280 281 /** 282 * The region of system bar 283 */ 284 region?: Rect; 285 286 /** 287 * The background color of the system bar. 288 */ 289 backgroundColor?: string; 290 291 /** 292 * The content color of the system bar. 293 */ 294 contentColor?: string 295 } 296 297 /** 298 * System bar tint state for systemui 299 * @syscap SystemCapability.WindowManager.WindowManager.Core 300 * @systemapi Hide this for inner system use. 301 * @since 8 302 */ 303 interface SystemBarTintState { 304 /** 305 * Id of display 306 */ 307 displayId: number; 308 /** 309 * Region tint of systembar 310 */ 311 regionTint: Array<SystemBarRegionTint>; 312 } 313 314 /** 315 * Rectangle 316 * @syscap SystemCapability.WindowManager.WindowManager.Core 317 * @since 7 318 */ 319 interface Rect { 320 left: number; 321 322 top: number; 323 324 width: number; 325 326 height: number; 327 } 328 329 /** 330 * Avoid area 331 * @syscap SystemCapability.WindowManager.WindowManager.Core 332 * @since 7 333 */ 334 interface AvoidArea { 335 /** 336 * Whether avoidArea is visible on screen 337 * @since 9 338 */ 339 visible: boolean; 340 341 /** 342 * Rectangle on the left of the screen 343 */ 344 leftRect: Rect; 345 346 /** 347 * Rectangle on the top of the screen 348 */ 349 topRect: Rect; 350 351 /** 352 * Rectangle on the right of the screen 353 */ 354 rightRect: Rect; 355 356 /** 357 * Rectangle on the bottom of the screen 358 */ 359 bottomRect: Rect; 360 } 361 362 /** 363 * Window size 364 * @syscap SystemCapability.WindowManager.WindowManager.Core 365 * @since 7 366 */ 367 interface Size { 368 /** 369 * The width of the window. 370 */ 371 width: number; 372 373 /** 374 * The height of the window. 375 */ 376 height: number; 377 } 378 379 /** 380 * Properties of window, it couldn't update automatically 381 * @syscap SystemCapability.WindowManager.WindowManager.Core 382 * @since 6 383 */ 384 interface WindowProperties { 385 /** 386 * The position and size of the window 387 * @since 7 388 */ 389 windowRect: Rect; 390 391 /** 392 * Window type 393 * @since 7 394 */ 395 type: WindowType; 396 397 /** 398 * Whether the window is displayed in full screen mode. The default value is false. 399 * @since 6 400 */ 401 isFullScreen: boolean 402 403 /** 404 * Whether the window layout is in full screen mode(whether the window is immersive). The default value is false. 405 * @since 7 406 */ 407 isLayoutFullScreen: boolean 408 409 /** 410 * Whether the window can gain focus. The default value is true 411 * @since 7 412 */ 413 focusable: boolean 414 415 /** 416 * Whether the window is touchable. The default value is false 417 * @since 7 418 */ 419 touchable: boolean 420 421 /** 422 * Brightness value of window. 423 * @since 6 424 */ 425 brightness: number 426 427 /** 428 * The dimbehind value of window. 429 * @since 7 430 * @deprecated since 9 431 */ 432 dimBehindValue: number 433 434 /** 435 * Whether keep screen on. 436 * @since 6 437 */ 438 isKeepScreenOn: boolean 439 440 /** 441 * Whether make window in privacy mode or not. 442 * @since 7 443 */ 444 isPrivacyMode: boolean 445 446 /** 447 * Whether is round corner or not. 448 * @since 7 449 * @deprecated since 9 450 */ 451 isRoundCorner: boolean 452 453 /** 454 * Whether is transparent or not. 455 * @since 7 456 */ 457 isTransparent: boolean 458 459 /** 460 * Window id. 461 * @since 9 462 */ 463 id: number 464 } 465 466 /** 467 * Type of allowing the specified of color space. 468 * @since 8 469 */ 470 enum ColorSpace { 471 /** 472 * Default color space. 473 */ 474 DEFAULT, 475 /** 476 * Wide gamut color space. The specific wide color gamut depends on thr screen. 477 */ 478 WIDE_GAMUT, 479 } 480 /** 481 * Describes the scale Transition Options of window 482 * @syscap SystemCapability.WindowManager.WindowManager.Core 483 * @since 9 484 * @systemapi 485 */ 486 interface ScaleOptions { 487 /** 488 * The scale param of x direction. Default is 1.f 489 * @since 9 490 */ 491 x?: number; 492 493 /** 494 * The scale param of y direction. Default is 1.f 495 * @since 9 496 */ 497 y?: number; 498 499 /** 500 * The scale param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 501 * @since 9 502 */ 503 pivotX?: number; 504 505 /** 506 * The scale param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 507 * @since 9 508 */ 509 pivotY?: number; 510 } 511 512 /** 513 * Describes the rotate Transition Options of window 514 * @syscap SystemCapability.WindowManager.WindowManager.Core 515 * @since 9 516 * @systemapi 517 */ 518 interface RotateOptions { 519 /** 520 * The rotate degree of x direction. Default value is 0.f 521 * @since 9 522 */ 523 x?: number; 524 525 /** 526 * The rotate degree of y direction. Default value is 0.f 527 * @since 9 528 */ 529 y?: number; 530 531 /** 532 * The rotate degree of z direction. Default value is 0.f 533 * @since 9 534 */ 535 z?: number; 536 537 /** 538 * The param of pivot point of x. Default is 0.5f, Interval is 0.f - 1.f 539 * @since 9 540 */ 541 pivotX?: number; 542 543 /** 544 * The param of pivot point of y. Default is 0.5f, Interval is 0.f - 1.f 545 * @since 9 546 */ 547 pivotY?: number; 548 } 549 550 /** 551 * Describes the translate Transition Options of window 552 * @syscap SystemCapability.WindowManager.WindowManager.Core 553 * @since 9 554 * @systemapi 555 */ 556 interface TranslateOptions { 557 /** 558 * The translate pixel param of x direction. Default is 0.f 559 * @since 9 560 */ 561 x?: number; 562 563 /** 564 * The translate pixel param of y direction. Default is 0.f 565 * @since 9 566 */ 567 y?: number; 568 569 /** 570 * The translate pixel param of z direction. Default is 0.f 571 * @since 9 572 */ 573 z?: number; 574 } 575 576 /** 577 * Transition Context 578 * @syscap SystemCapability.WindowManager.WindowManager.Core 579 * @systemapi 580 * @since 9 581 */ 582 interface TransitionContext { 583 /** 584 * The target window with animation 585 * @since 9 586 */ 587 toWindow: Window 588 589 /** 590 * Set complete state of animation transition 591 * @param isCompleted is Completed if true, or not if false. 592 * @throws {BusinessError} 401 - Parameter error. 593 * @since 9 594 */ 595 completeTransition(isCompleted: boolean): void; 596 } 597 598 /** 599 * Transition Controller 600 * @syscap SystemCapability.WindowManager.WindowManager.Core 601 * @systemapi 602 * @since 9 603 */ 604 interface TransitionController { 605 /** 606 * Animation configuration when showing window 607 * @param context transition Context. 608 * @since 9 609 * @throws {BusinessError} 401 - Parameter error. 610 */ 611 animationForShown(context: TransitionContext): void; 612 /** 613 * Animation configuration when hiding window 614 * @param context transition context. 615 * @since 9 616 * @throws {BusinessError} 401 - Parameter error. 617 */ 618 animationForHidden(context: TransitionContext): void; 619 } 620 621 /** 622 * Configuration parameters for window creation. 623 * @since 9 624 */ 625 interface Configuration { 626 /** 627 * Indicates window id. 628 * @since 9 629 */ 630 name: string 631 632 /** 633 * Indicates window type 634 * @since 9 635 */ 636 windowType: WindowType 637 638 /** 639 * Indicates window context. 640 * @since 9 641 */ 642 ctx?: BaseContext 643 644 /** 645 * Indicates display ID. 646 * @since 9 647 */ 648 displayId?: number 649 650 /** 651 * Indicates Parent window id 652 * @since 9 653 */ 654 parentId?: number 655 } 656 657 /** 658 * Create a window with a specific configuration 659 * @param Configuration Configuration parameters for window creation. 660 * @since 9 661 * @throws {BusinessError} 201 - Permission verification failed. 662 * @throws {BusinessError} 401 - Parameter error. 663 * @throws {BusinessError} 1300001 - Repeated operation. 664 * @throws {BusinessError} 1300006 - This window context is abnormal. 665 */ 666 function createWindow(config: Configuration, callback: AsyncCallback<Window>): void; 667 668 /** 669 * Create a window with a specific configuration 670 * @param Configuration Configuration parameters for window creation. 671 * @since 9 672 * @throws {BusinessError} 201 - Permission verification failed. 673 * @throws {BusinessError} 401 - Parameter error. 674 * @throws {BusinessError} 1300001 - Repeated operation. 675 * @throws {BusinessError} 1300006 - This window context is abnormal. 676 */ 677 function createWindow(config: Configuration): Promise<Window>; 678 679 /** 680 * Create a sub window with a specific id and type, only support 7. 681 * @param id Indicates window id. 682 * @param type Indicates window type. 683 * @since 7 684 * @deprecated since 9 685 * @useinstead ohos.window#createWindow 686 * @FAModelOnly 687 */ 688 function create(id: string, type: WindowType, callback: AsyncCallback<Window>): void; 689 690 /** 691 * Create a sub window with a specific id and type, only support 7. 692 * @param id Indicates window id. 693 * @param type Indicates window type. 694 * @since 7 695 * @deprecated since 9 696 * @useinstead ohos.window#createWindow 697 * @FAModelOnly 698 */ 699 function create(id: string, type: WindowType): Promise<Window>; 700 701 /** 702 * Create a system or float window with a specific id and type. 703 * @param ctx Indicates the context on which the window depends 704 * @param id Indicates window id. 705 * @param type Indicates window type. 706 * @since 8 707 * @deprecated since 9 708 * @useinstead ohos.window#createWindow 709 */ 710 function create(ctx: BaseContext, id: string, type: WindowType): Promise<Window>; 711 712 /** 713 * Create a system or float window with a specific id and type. 714 * @param ctx Indicates the context on which the window depends 715 * @param id Indicates window id. 716 * @param type Indicates window type. 717 * @since 8 718 * @deprecated since 9 719 * @useinstead ohos.window#createWindow 720 */ 721 function create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback<Window>): void; 722 723 /** 724 * Find the window by id. 725 * @param id Indicates window id. 726 * @since 7 727 * @deprecated since 9 728 * @useinstead ohos.window#findWindow 729 */ 730 function find(id: string, callback: AsyncCallback<Window>): void; 731 732 /** 733 * Find the window by id. 734 * @param id Indicates window id. 735 * @since 7 736 * @deprecated since 9 737 * @useinstead ohos.window#findWindow 738 */ 739 function find(id: string): Promise<Window>; 740 741 /** 742 * Find the window by name. 743 * @param name Indicates window name. 744 * @throws {BusinessError} 401 - Parameter error. 745 * @since 9 746 */ 747 function findWindow(name: string): Window; 748 749 /** 750 * Get the final show window. 751 * @param id Indicates window id. 752 * @since 6 753 * @deprecated since 9 754 * @useinstead ohos.window#getLastWindow 755 * @FAModelOnly 756 */ 757 function getTopWindow(callback: AsyncCallback<Window>): void; 758 759 /** 760 * Get the final show window. 761 * @since 6 762 * @deprecated since 9 763 * @useinstead ohos.window#getLastWindow 764 * @FAModelOnly 765 */ 766 function getTopWindow(): Promise<Window>; 767 768 /** 769 * Get the final show window. 770 * @param ctx Indicates the context on which the window depends 771 * @since 8 772 * @deprecated since 9 773 * @useinstead ohos.window#getLastWindow 774 */ 775 function getTopWindow(ctx: BaseContext): Promise<Window>; 776 777 /** 778 * Get the final show window. 779 * @param ctx Indicates the context on which the window depends 780 * @since 8 781 * @deprecated since 9 782 * @useinstead ohos.window#getLastWindow 783 */ 784 function getTopWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 785 786 /** 787 * Get the final show window. 788 * @param ctx Indicates the context on which the window depends. 789 * @throws {BusinessError} 401 - Parameter error. 790 * @throws {BusinessError} 1300002 - This window state is abnormal. 791 * @throws {BusinessError} 1300006 - This window context is abnormal. 792 * @since 9 793 */ 794 function getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; 795 796 /** 797 * Get the final show window. 798 * @throws {BusinessError} 401 - Parameter error. 799 * @throws {BusinessError} 1300002 - This window state is abnormal. 800 * @throws {BusinessError} 1300006 - This window context is abnormal. 801 * @since 9 802 */ 803 function getLastWindow(ctx: BaseContext): Promise<Window>; 804 805 /** 806 * Minimize all app windows. 807 * @systemapi Hide this for inner system use. 808 * @throws {BusinessError} 401 - Parameter error. 809 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 810 * @since 9 811 */ 812 function minimizeAll(id: number, callback: AsyncCallback<void>): void; 813 814 /** 815 * Minimize all app windows. 816 * @systemapi Hide this for inner system use. 817 * @throws {BusinessError} 401 - Parameter error. 818 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 819 * @since 9 820 */ 821 function minimizeAll(id: number): Promise<void>; 822 823 /** 824 * Toggle shown state for all app windows. Minimize or restore all app windows. 825 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 826 * @systemapi Hide this for inner system use. 827 * @since 9 828 */ 829 function toggleShownStateForAllAppWindows(callback: AsyncCallback<void>): void; 830 831 /** 832 * Toggle shown state for all app windows. Minimize or restore all app windows. 833 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 834 * @systemapi Hide this for inner system use. 835 * @since 9 836 */ 837 function toggleShownStateForAllAppWindows(): Promise<void>; 838 839 /** 840 * Set the layout mode of a window. 841 * @param mode the layout mode of a window. 842 * @systemapi Hide this for inner system use. 843 * @throws {BusinessError} 401 - Parameter error. 844 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 845 * @since 9 846 */ 847 function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback<void>): void; 848 849 /** 850 * Set the layout mode of a window. 851 * @param mode the layout mode of a window. 852 * @systemapi Hide this for inner system use. 853 * @throws {BusinessError} 401 - Parameter error. 854 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 855 * @since 9 856 */ 857 function setWindowLayoutMode(mode: WindowLayoutMode): Promise<void>; 858 859 /** 860 * Register the callback of systemBarTintChange 861 * @param type: 'systemBarTintChange' 862 * @systemapi Hide this for inner system use. 863 * @throws {BusinessError} 401 - Parameter error. 864 * @since 8 865 */ 866 function on(type: 'systemBarTintChange', callback: Callback<SystemBarTintState>): void; 867 868 /** 869 * Unregister the callback of systemBarTintChange 870 * @param type: 'systemBarTintChange' 871 * @systemapi Hide this for inner system use. 872 * @throws {BusinessError} 401 - Parameter error. 873 * @since 8 874 */ 875 function off(type: 'systemBarTintChange', callback?: Callback<SystemBarTintState>): void; 876 877 /** 878 * Display orientation 879 * @syscap SystemCapability.WindowManager.WindowManager.Core 880 * @since 9 881 */ 882 enum Orientation { 883 /** 884 * Default value. The direction mode is not clearly defined. It is determined by the system. 885 * @since 9 886 */ 887 UNSPECIFIED = 0, 888 889 /** 890 * Display in portrait orientation. 891 * @since 9 892 */ 893 PORTRAIT = 1, 894 895 /** 896 * Display in landscape orientation. 897 * @since 9 898 */ 899 LANDSCAPE = 2, 900 901 /** 902 * Display in inverted portrait orientation. 903 * @since 9 904 */ 905 PORTRAIT_INVERTED = 3, 906 907 /** 908 * Display in inverted landscape orientation. 909 * @since 9 910 */ 911 LANDSCAPE_INVERTED = 4, 912 913 /** 914 * Follow the rotation of the sensor, ignore auto rotation lock. 915 * @since 9 916 */ 917 AUTO_ROTATION = 5, 918 919 /** 920 * Follow the rotation of the sensor, only work in the vertical direction, ignore auto rotation lock. 921 * @since 9 922 */ 923 AUTO_ROTATION_PORTRAIT = 6, 924 925 /** 926 * Follow the rotation of the sensor, only work in the horizontal direction, ignore auto rotation lock. 927 * @since 9 928 */ 929 AUTO_ROTATION_LANDSCAPE = 7, 930 931 /** 932 * Follow the rotation of the sensor, controlled by auto rotation lock. 933 * @since 9 934 */ 935 AUTO_ROTATION_RESTRICTED = 8, 936 937 /** 938 * Follow the rotation of the sensor, only work in the vertical direction, controlled by auto rotation lock. 939 * @since 9 940 */ 941 AUTO_ROTATION_PORTRAIT_RESTRICTED = 9, 942 943 /** 944 * Follow the rotation of the sensor, only work in the horizontal direction, controlled by auto rotation lock. 945 * @since 9 946 */ 947 AUTO_ROTATION_LANDSCAPE_RESTRICTED = 10, 948 949 /** 950 * Locked mode, keep the same direction as previous one. 951 * @since 9 952 */ 953 LOCKED = 11, 954 } 955 956 /** 957 * Type of blur style 958 * @syscap SystemCapability.WindowManager.WindowManager.Core 959 * @systemapi Hide this for inner system use. 960 * @since 9 961 */ 962 enum BlurStyle { 963 /** 964 * Close blur. 965 * @since 9 966 */ 967 OFF, 968 /** 969 * Blur style thin. 970 * @since 9 971 */ 972 THIN, 973 /** 974 * Blur style regular. 975 * @since 9 976 */ 977 REGULAR, 978 /** 979 * Blur style thick. 980 * @since 9 981 */ 982 THICK, 983 } 984 985 interface Window { 986 /** 987 * Hide window. 988 * @throws {BusinessError} 1300002 - This window state is abnormal. 989 * @systemapi Hide this for inner system use. 990 * @since 7 991 */ 992 hide (callback: AsyncCallback<void>): void; 993 994 /** 995 * Hide window. 996 * @throws {BusinessError} 1300002 - This window state is abnormal. 997 * @systemapi Hide this for inner system use. 998 * @since 7 999 */ 1000 hide(): Promise<void>; 1001 1002 /** 1003 * Hide window with animation. 1004 * @throws {BusinessError} 1300002 - This window state is abnormal. 1005 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1006 * @throws {BusinessError} 1300004 - Unauthorized operation. 1007 * @since 9 1008 * @systemapi 1009 */ 1010 hideWithAnimation(callback: AsyncCallback<void>): void; 1011 1012 /** 1013 * Hide window with animation. 1014 * @throws {BusinessError} 1300002 - This window state is abnormal. 1015 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1016 * @throws {BusinessError} 1300004 - Unauthorized operation. 1017 * @since 9 1018 * @systemapi 1019 */ 1020 hideWithAnimation(): Promise<void>; 1021 1022 /** 1023 * Show window. 1024 * @since 7 1025 * @deprecated since 9 1026 * @useinstead ohos.window.Window#showWindow 1027 */ 1028 show(callback: AsyncCallback<void>): void; 1029 1030 /** 1031 * Show window. 1032 * @since 7 1033 * @deprecated since 9 1034 * @useinstead ohos.window.Window#showWindow 1035 */ 1036 show(): Promise<void>; 1037 1038 /** 1039 * Show window. 1040 * @throws {BusinessError} 1300002 - This window state is abnormal. 1041 * @since 9 1042 */ 1043 showWindow(callback: AsyncCallback<void>): void; 1044 1045 /** 1046 * Show window. 1047 * @throws {BusinessError} 1300002 - This window state is abnormal. 1048 * @since 9 1049 */ 1050 showWindow(): Promise<void>; 1051 1052 /** 1053 * Show window with animation. 1054 * @throws {BusinessError} 1300002 - This window state is abnormal. 1055 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1056 * @throws {BusinessError} 1300004 - Unauthorized operation. 1057 * @since 9 1058 * @systemapi 1059 */ 1060 showWithAnimation(callback: AsyncCallback<void>): void; 1061 1062 /** 1063 * Show window with animation. 1064 * @throws {BusinessError} 1300002 - This window state is abnormal. 1065 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1066 * @throws {BusinessError} 1300004 - Unauthorized operation. 1067 * @since 9 1068 * @systemapi 1069 */ 1070 showWithAnimation(): Promise<void>; 1071 1072 /** 1073 * Destroy the window. 1074 * @since 7 1075 * @deprecated since 9 1076 * @useinstead ohos.window.Window#destroyWindow 1077 */ 1078 destroy(callback: AsyncCallback<void>): void; 1079 1080 /** 1081 * Destroy the window. 1082 * @since 7 1083 * @deprecated since 9 1084 * @useinstead ohos.window.Window#destroyWindow 1085 */ 1086 destroy(): Promise<void>; 1087 1088 /** 1089 * Destroy the window. 1090 * @throws {BusinessError} 1300002 - This window state is abnormal. 1091 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1092 * @since 9 1093 */ 1094 destroyWindow(callback: AsyncCallback<void>): void; 1095 1096 /** 1097 * Destroy the window. 1098 * @throws {BusinessError} 1300002 - This window state is abnormal. 1099 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1100 * @since 9 1101 */ 1102 destroyWindow(): Promise<void>; 1103 1104 /** 1105 * Set the position of a window. 1106 * @param x Indicate the X-coordinate of the window. 1107 * @param y Indicate the Y-coordinate of the window. 1108 * @syscap SystemCapability.WindowManager.WindowManager.Core 1109 * @since 7 1110 * @deprecated since 9 1111 * @useinstead ohos.window.Window#moveWindowTo 1112 */ 1113 moveTo(x: number, y: number): Promise<void>; 1114 1115 /** 1116 * Set the position of a window. 1117 * @param x Indicate the X-coordinate of the window. 1118 * @param y Indicate the Y-coordinate of the window. 1119 * @syscap SystemCapability.WindowManager.WindowManager.Core 1120 * @since 7 1121 * @deprecated since 9 1122 * @useinstead ohos.window.Window#moveWindowTo 1123 */ 1124 moveTo(x: number, y: number, callback: AsyncCallback<void>): void; 1125 1126 /** 1127 * Set the position of a window. 1128 * @param x Indicate the X-coordinate of the window. 1129 * @param y Indicate the Y-coordinate of the window. 1130 * @throws {BusinessError} 401 - Parameter error. 1131 * @throws {BusinessError} 1300002 - This window state is abnormal. 1132 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1133 * @syscap SystemCapability.WindowManager.WindowManager.Core 1134 * @since 9 1135 */ 1136 moveWindowTo(x: number, y: number): Promise<void>; 1137 1138 /** 1139 * Set the position of a window. 1140 * @param x Indicate the X-coordinate of the window. 1141 * @param y Indicate the Y-coordinate of the window. 1142 * @throws {BusinessError} 401 - Parameter error. 1143 * @throws {BusinessError} 1300002 - This window state is abnormal. 1144 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1145 * @syscap SystemCapability.WindowManager.WindowManager.Core 1146 * @since 9 1147 */ 1148 moveWindowTo(x: number, y: number, callback: AsyncCallback<void>): void; 1149 1150 /** 1151 * Set the size of a window . 1152 * @param width Indicates the width of the window. 1153 * @param height Indicates the height of the window. 1154 * @syscap SystemCapability.WindowManager.WindowManager.Core 1155 * @since 7 1156 * @deprecated since 9 1157 * @useinstead ohos.window.Window#resize 1158 */ 1159 resetSize(width: number, height: number): Promise<void>; 1160 1161 /** 1162 * Set the size of a window . 1163 * @param width Indicates the width of the window. 1164 * @param height Indicates the height of the window. 1165 * @syscap SystemCapability.WindowManager.WindowManager.Core 1166 * @since 7 1167 * @deprecated since 9 1168 * @useinstead ohos.window.Window#resize 1169 */ 1170 resetSize(width: number, height: number, callback: AsyncCallback<void>): void; 1171 1172 /** 1173 * Set the size of a window . 1174 * @param width Indicates the width of the window. 1175 * @param height Indicates the height of the window. 1176 * @throws {BusinessError} 401 - Parameter error. 1177 * @throws {BusinessError} 1300002 - This window state is abnormal. 1178 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1179 * @syscap SystemCapability.WindowManager.WindowManager.Core 1180 * @since 9 1181 */ 1182 resize(width: number, height: number): Promise<void>; 1183 1184 /** 1185 * Set the size of a window . 1186 * @param width Indicates the width of the window. 1187 * @param height Indicates the height of the window. 1188 * @throws {BusinessError} 401 - Parameter error. 1189 * @throws {BusinessError} 1300002 - This window state is abnormal. 1190 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1191 * @syscap SystemCapability.WindowManager.WindowManager.Core 1192 * @since 9 1193 */ 1194 resize(width: number, height: number, callback: AsyncCallback<void>): void; 1195 1196 /** 1197 * Set the type of a window. 1198 * @param type Indicate the type of a window. 1199 * @syscap SystemCapability.WindowManager.WindowManager.Core 1200 * @systemapi Hide this for inner system use. 1201 * @since 7 1202 * @deprecated since 9 1203 */ 1204 setWindowType(type: WindowType): Promise<void>; 1205 1206 /** 1207 * Set the type of a window. 1208 * @param type Indicate the type of a window. 1209 * @syscap SystemCapability.WindowManager.WindowManager.Core 1210 * @systemapi Hide this for inner system use. 1211 * @since 7 1212 * @deprecated since 9 1213 */ 1214 setWindowType(type: WindowType, callback: AsyncCallback<void>): void; 1215 1216 /** 1217 * Set the mode of a window. 1218 * @param mode Indicate the mode of a window. 1219 * @throws {BusinessError} 401 - Parameter error. 1220 * @throws {BusinessError} 1300002 - This window state is abnormal. 1221 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1222 * @syscap SystemCapability.WindowManager.WindowManager.Core 1223 * @systemapi Hide this for inner system use. 1224 * @since 9 1225 */ 1226 setWindowMode(mode: WindowMode): Promise<void>; 1227 1228 /** 1229 * Set the mode of a window. 1230 * @param mode Indicate the mode of a window. 1231 * @throws {BusinessError} 401 - Parameter error. 1232 * @throws {BusinessError} 1300002 - This window state is abnormal. 1233 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1234 * @syscap SystemCapability.WindowManager.WindowManager.Core 1235 * @systemapi Hide this for inner system use. 1236 * @since 9 1237 */ 1238 setWindowMode(mode: WindowMode, callback: AsyncCallback<void>): void; 1239 1240 /** 1241 * Get the properties of current window 1242 * @syscap SystemCapability.WindowManager.WindowManager.Core 1243 * @since 6 1244 * @deprecated since 9 1245 * @useinstead ohos.window.Window#getWindowProperties 1246 */ 1247 getProperties(callback: AsyncCallback<WindowProperties>): void; 1248 1249 /** 1250 * Get the properties of current window 1251 * @syscap SystemCapability.WindowManager.WindowManager.Core 1252 * @since 6 1253 * @deprecated since 9 1254 * @useinstead ohos.window.Window#getWindowProperties 1255 */ 1256 getProperties(): Promise<WindowProperties>; 1257 1258 /** 1259 * Get the properties of current window 1260 * @throws {BusinessError} 1300002 - This window state is abnormal. 1261 * @syscap SystemCapability.WindowManager.WindowManager.Core 1262 * @since 9 1263 */ 1264 getWindowProperties(): WindowProperties; 1265 1266 /** 1267 * Get the avoid area 1268 * @param type Type of the area 1269 * @since 7 1270 * @deprecated since 9 1271 * @useinstead ohos.window.Window#getWindowAvoidArea 1272 */ 1273 getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): void; 1274 1275 /** 1276 * Get the avoid area 1277 * @param type Type of the area 1278 * @since 7 1279 * @deprecated since 9 1280 * @useinstead ohos.window.Window#getWindowAvoidArea 1281 */ 1282 getAvoidArea(type: AvoidAreaType): Promise<AvoidArea>; 1283 1284 /** 1285 * Get the avoid area 1286 * @param type Type of the area 1287 * @throws {BusinessError} 401 - Parameter error. 1288 * @throws {BusinessError} 1300002 - This window state is abnormal. 1289 * @since 9 1290 */ 1291 getWindowAvoidArea(type: AvoidAreaType): AvoidArea; 1292 1293 /** 1294 * Set the flag of the window is shown full screen 1295 * @param isFullScreen the flag of the window is shown full screen 1296 * @syscap SystemCapability.WindowManager.WindowManager.Core 1297 * @since 6 1298 * @deprecated since 9 1299 * @useinstead ohos.window.Window#setWindowSystemBarEnable 1300 */ 1301 setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void; 1302 1303 /** 1304 * Set the flag of the window is shown full screen 1305 * @param isFullScreen the flag of the window is shown full screen 1306 * @syscap SystemCapability.WindowManager.WindowManager.Core 1307 * @since 6 1308 * @deprecated since 9 1309 * @useinstead ohos.window.Window#setWindowSystemBarEnable 1310 */ 1311 setFullScreen(isFullScreen: boolean): Promise<void>; 1312 1313 /** 1314 * Set the property of the window can layout in full screen 1315 * @param isLayoutFullScreen the window can layout in full screen 1316 * @syscap SystemCapability.WindowManager.WindowManager.Core 1317 * @since 7 1318 * @deprecated since 9 1319 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 1320 */ 1321 setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 1322 1323 /** 1324 * Set the property of the window can layout in full screen 1325 * @param isLayoutFullScreen the window can layout in full screen 1326 * @syscap SystemCapability.WindowManager.WindowManager.Core 1327 * @since 7 1328 * @deprecated since 9 1329 * @useinstead ohos.window.Window#setWindowLayoutFullScreen 1330 */ 1331 setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 1332 1333 /** 1334 * Set the property of the window can layout in full screen 1335 * @param isLayoutFullScreen the window can layout in full screen 1336 * @syscap SystemCapability.WindowManager.WindowManager.Core 1337 * @throws {BusinessError} 401 - Parameter error. 1338 * @throws {BusinessError} 1300002 - This window state is abnormal. 1339 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1340 * @since 9 1341 */ 1342 setWindowLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void; 1343 1344 /** 1345 * Set the property of the window can layout in full screen 1346 * @param isLayoutFullScreen the window can layout in full screen 1347 * @syscap SystemCapability.WindowManager.WindowManager.Core 1348 * @throws {BusinessError} 401 - Parameter error. 1349 * @throws {BusinessError} 1300002 - This window state is abnormal. 1350 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1351 * @since 9 1352 */ 1353 setWindowLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; 1354 1355 /** 1356 * Set the system bar to have visible. 1357 * @param names the set of system bar 1358 * @syscap SystemCapability.WindowManager.WindowManager.Core 1359 * @since 7 1360 * @deprecated since 9 1361 * @useinstead ohos.window.Window#setWindowSystemBarEnable 1362 */ 1363 setSystemBarEnable(names: Array<'status'|'navigation'>, callback: AsyncCallback<void>): void; 1364 1365 /** 1366 * Set the system bar to have visible. 1367 * @param names the set of system bar 1368 * @syscap SystemCapability.WindowManager.WindowManager.Core 1369 * @since 7 1370 * @deprecated since 9 1371 * @useinstead ohos.window.Window#setWindowSystemBarEnable 1372 */ 1373 setSystemBarEnable(names: Array<'status'|'navigation'>): Promise<void>; 1374 1375 /** 1376 * Set the system bar to have visible. 1377 * @param names the set of system bar 1378 * @syscap SystemCapability.WindowManager.WindowManager.Core 1379 * @throws {BusinessError} 401 - Parameter error. 1380 * @throws {BusinessError} 1300002 - This window state is abnormal. 1381 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1382 * @since 9 1383 */ 1384 setWindowSystemBarEnable(names: Array<'status'|'navigation'>, callback: AsyncCallback<void>): void; 1385 1386 /** 1387 * Set the system bar to have visible. 1388 * @param names the set of system bar 1389 * @syscap SystemCapability.WindowManager.WindowManager.Core 1390 * @throws {BusinessError} 401 - Parameter error. 1391 * @throws {BusinessError} 1300002 - This window state is abnormal. 1392 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1393 * @since 9 1394 */ 1395 setWindowSystemBarEnable(names: Array<'status'|'navigation'>): Promise<void>; 1396 1397 /** 1398 * Set the properties of system bar 1399 * @param systemBarProperties the properties of system bar 1400 * @syscap SystemCapability.WindowManager.WindowManager.Core 1401 * @since 6 1402 * @deprecated since 9 1403 * @useinstead ohos.window.Window#setWindowSystemBarProperties 1404 */ 1405 setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 1406 1407 /** 1408 * Set the properties of system bar 1409 * @param systemBarProperties the properties of system bar 1410 * @syscap SystemCapability.WindowManager.WindowManager.Core 1411 * @since 6 1412 * @deprecated since 9 1413 * @useinstead ohos.window.Window#setWindowSystemBarProperties 1414 */ 1415 setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 1416 1417 /** 1418 * Set the properties of system bar 1419 * @param systemBarProperties the properties of system bar 1420 * @syscap SystemCapability.WindowManager.WindowManager.Core 1421 * @throws {BusinessError} 401 - Parameter error. 1422 * @throws {BusinessError} 801 - Capability not supported. 1423 * @throws {BusinessError} 1300002 - This window state is abnormal. 1424 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1425 * @since 9 1426 */ 1427 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void; 1428 1429 /** 1430 * Set the properties of system bar 1431 * @param systemBarProperties the properties of system bar 1432 * @syscap SystemCapability.WindowManager.WindowManager.Core 1433 * @throws {BusinessError} 401 - Parameter error. 1434 * @throws {BusinessError} 801 - Capability not supported. 1435 * @throws {BusinessError} 1300002 - This window state is abnormal. 1436 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1437 * @since 9 1438 */ 1439 setWindowSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; 1440 1441 /** 1442 * Set the preferred orientation config of the window 1443 * @param orientation the orientation config of the window 1444 * @syscap SystemCapability.WindowManager.WindowManager.Core 1445 * @throws {BusinessError} 401 - Parameter error. 1446 * @throws {BusinessError} 1300002 - This window state is abnormal. 1447 * @since 9 1448 */ 1449 setPreferredOrientation(orientation: Orientation): Promise<void>; 1450 1451 /** 1452 * Set the preferred orientation config of the window 1453 * @param orientation the orientation config of the window 1454 * @syscap SystemCapability.WindowManager.WindowManager.Core 1455 * @throws {BusinessError} 401 - Parameter error. 1456 * @throws {BusinessError} 1300002 - This window state is abnormal. 1457 * @since 9 1458 */ 1459 setPreferredOrientation(orientation: Orientation, callback: AsyncCallback<void>): void; 1460 1461 /** 1462 * Loads content 1463 * @param path path Path of the page to which the content will be loaded 1464 * @param storage storage The data object shared within the content instance loaded by the window 1465 * @syscap SystemCapability.WindowManager.WindowManager.Core 1466 * @throws {BusinessError} 401 - Parameter error. 1467 * @throws {BusinessError} 1300002 - This window state is abnormal. 1468 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1469 * @since 9 1470 * @StageModelOnly 1471 */ 1472 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 1473 1474 /** 1475 * Loads content 1476 * @param path path of the page to which the content will be loaded 1477 * @param storage storage The data object shared within the content instance loaded by the window 1478 * @syscap SystemCapability.WindowManager.WindowManager.Core 1479 * @throws {BusinessError} 401 - Parameter error. 1480 * @throws {BusinessError} 1300002 - This window state is abnormal. 1481 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1482 * @since 9 1483 * @StageModelOnly 1484 */ 1485 loadContent(path: string, storage: LocalStorage): Promise<void>; 1486 1487 /** 1488 * Loads content 1489 * @param path path of the page to which the content will be loaded 1490 * @syscap SystemCapability.WindowManager.WindowManager.Core 1491 * @since 7 1492 * @deprecated since 9 1493 * @useinstead ohos.window.Window#setUIContent 1494 */ 1495 loadContent(path: string, callback: AsyncCallback<void>): void; 1496 1497 /** 1498 * Loads content 1499 * @param path path of the page to which the content will be loaded 1500 * @syscap SystemCapability.WindowManager.WindowManager.Core 1501 * @since 7 1502 * @deprecated since 9 1503 * @useinstead ohos.window.Window#setUIContent 1504 */ 1505 loadContent(path: string): Promise<void>; 1506 1507 /** 1508 * Loads content 1509 * @param path path of the page to which the content will be loaded 1510 * @syscap SystemCapability.WindowManager.WindowManager.Core 1511 * @throws {BusinessError} 401 - Parameter error. 1512 * @throws {BusinessError} 1300002 - This window state is abnormal. 1513 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1514 * @since 9 1515 */ 1516 setUIContent(path: string, callback: AsyncCallback<void>): void; 1517 1518 /** 1519 * Loads content 1520 * @param path path of the page to which the content will be loaded 1521 * @syscap SystemCapability.WindowManager.WindowManager.Core 1522 * @throws {BusinessError} 401 - Parameter error. 1523 * @throws {BusinessError} 1300002 - This window state is abnormal. 1524 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1525 * @since 9 1526 */ 1527 setUIContent(path: string): Promise<void>; 1528 1529 /** 1530 * Checks whether the window is displayed 1531 * @syscap SystemCapability.WindowManager.WindowManager.Core 1532 * @since 7 1533 * @deprecated since 9 1534 * @useinstead ohos.window.Window#isWindowShowing 1535 */ 1536 isShowing(callback: AsyncCallback<boolean>): void; 1537 1538 /** 1539 * Checks whether the window is displayed 1540 * @syscap SystemCapability.WindowManager.WindowManager.Core 1541 * @since 7 1542 * @deprecated since 9 1543 * @useinstead ohos.window.Window#isWindowShowing 1544 */ 1545 isShowing(): Promise<boolean>; 1546 1547 /** 1548 * Checks whether the window is displayed 1549 * @throws {BusinessError} 1300002 - This window state is abnormal. 1550 * @syscap SystemCapability.WindowManager.WindowManager.Core 1551 * @since 9 1552 */ 1553 isWindowShowing(): boolean; 1554 1555 /** 1556 * Register the callback of windowSizeChange 1557 * @param type: 'windowSizeChange' 1558 * @throws {BusinessError} 401 - Parameter error. 1559 * @syscap SystemCapability.WindowManager.WindowManager.Core 1560 * @since 7 1561 */ 1562 on(type: 'windowSizeChange', callback: Callback<Size>): void; 1563 1564 /** 1565 * Unregister the callback of windowSizeChange 1566 * @param type: 'windowSizeChange' 1567 * @throws {BusinessError} 401 - Parameter error. 1568 * @syscap SystemCapability.WindowManager.WindowManager.Core 1569 * @since 7 1570 */ 1571 off(type: 'windowSizeChange', callback?: Callback<Size>): void; 1572 1573 /** 1574 * Register the callback of systemAvoidAreaChange 1575 * @param type: 'systemAvoidAreaChange' 1576 * @syscap SystemCapability.WindowManager.WindowManager.Core 1577 * @since 7 1578 * @deprecated since 9 1579 * @useinstead ohos.window.Window#on_avoidAreaChange 1580 */ 1581 on(type: 'systemAvoidAreaChange', callback: Callback<AvoidArea>): void; 1582 1583 /** 1584 * Unregister the callback of systemAvoidAreaChange 1585 * @param type: 'systemAvoidAreaChange' 1586 * @syscap SystemCapability.WindowManager.WindowManager.Core 1587 * @since 7 1588 * @deprecated since 9 1589 * @useinstead ohos.window.Window#off_avoidAreaChange 1590 */ 1591 off(type: 'systemAvoidAreaChange', callback?: Callback<AvoidArea>): void; 1592 1593 /** 1594 * Register the callback of avoidAreaChange 1595 * @param type: 'avoidAreaChange' 1596 * @throws {BusinessError} 401 - Parameter error. 1597 * @syscap SystemCapability.WindowManager.WindowManager.Core 1598 * @since 9 1599 */ 1600 on(type: 'avoidAreaChange', callback: Callback<{ type: AvoidAreaType, area: AvoidArea }>): void; 1601 1602 /** 1603 * Unregister the callback of avoidAreaChange 1604 * @param type: 'avoidAreaChange' 1605 * @throws {BusinessError} 401 - Parameter error. 1606 * @syscap SystemCapability.WindowManager.WindowManager.Core 1607 * @since 9 1608 */ 1609 off(type: 'avoidAreaChange', callback?: Callback<{ type: AvoidAreaType, area: AvoidArea }>): void; 1610 1611 /** 1612 * Register the callback of keyboardHeightChange 1613 * @param type: 'keyboardHeightChange' 1614 * @syscap SystemCapability.WindowManager.WindowManager.Core 1615 * @since 7 1616 * @throws {BusinessError} 401 - Parameter error. 1617 */ 1618 on(type: 'keyboardHeightChange', callback: Callback<number>): void; 1619 1620 /** 1621 * Unregister the callback of keyboardHeightChange 1622 * @param type: 'keyboardHeightChange' 1623 * @syscap SystemCapability.WindowManager.WindowManager.Core 1624 * @since 7 1625 * @throws {BusinessError} 401 - Parameter error. 1626 */ 1627 off(type: 'keyboardHeightChange', callback?: Callback<number>): void; 1628 1629 /** 1630 * Touch outside callback on. 1631 * @throws {BusinessError} 401 - Parameter error. 1632 * @systemapi Hide this for inner system use. 1633 * @since 9 1634 */ 1635 on(type: 'touchOutside', callback: Callback<void>): void; 1636 1637 /** 1638 * Touch outside callback off. 1639 * @throws {BusinessError} 401 - Parameter error. 1640 * @systemapi Hide this for inner system use. 1641 * @since 9 1642 */ 1643 off(type: 'touchOutside', callback?: Callback<void>): void; 1644 1645 /** 1646 * Register the callback of screenshot, only the focused window called back 1647 * @param type: 'screenshot' 1648 * @throws {BusinessError} 401 - Parameter error. 1649 * @syscap SystemCapability.WindowManager.WindowManager.Core 1650 * @since 9 1651 */ 1652 on(type: 'screenshot', callback: Callback<void>): void; 1653 1654 /** 1655 * Unregister the callback of screenshot 1656 * @param type: 'screenshot' 1657 * @throws {BusinessError} 401 - Parameter error. 1658 * @syscap SystemCapability.WindowManager.WindowManager.Core 1659 * @since 9 1660 */ 1661 off(type: 'screenshot', callback?: Callback<void>): void; 1662 1663 /** 1664 * Bind dialog to the target window. 1665 * @param token token of the target window. 1666 * @param deathCallback the callback of dialogDeath. 1667 * @throws {BusinessError} 401 - Parameter error. 1668 * @throws {BusinessError} 1300002 - This window state is abnormal. 1669 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1670 * @systemapi Hide this for inner system use. 1671 * @since 9 1672 */ 1673 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>): Promise<void>; 1674 1675 /** 1676 * Bind dialog to the target window. 1677 * @param token token of the target window. 1678 * @param deathCallback the callback of dialogDeath. 1679 * @throws {BusinessError} 401 - Parameter error. 1680 * @throws {BusinessError} 1300002 - This window state is abnormal. 1681 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1682 * @systemapi Hide this for inner system use. 1683 * @since 9 1684 */ 1685 bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback<void>, callback: AsyncCallback<void>): void; 1686 1687 /** 1688 * Bind dialog to the target window. 1689 * @param requestInfo requestInfo of the target window. 1690 * @param deathCallback the callback of dialogDeath. 1691 * @throws {BusinessError} 401 - Parameter error. 1692 * @throws {BusinessError} 1300002 - This window state is abnormal. 1693 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1694 * @systemapi Hide this for inner system use. 1695 * @since 9 1696 */ 1697 bindDialogTarget(requestInfo: dialogRequest.RequestInfo, deathCallback: Callback<void>): Promise<void>; 1698 1699 /** 1700 * Bind dialog to the target window. 1701 * @param requestInfo requestInfo of the target window. 1702 * @param deathCallback the callback of dialogDeath. 1703 * @throws {BusinessError} 401 - Parameter error. 1704 * @throws {BusinessError} 1300002 - This window state is abnormal. 1705 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1706 * @systemapi Hide this for inner system use. 1707 * @since 9 1708 */ 1709 bindDialogTarget(requestInfo: dialogRequest.RequestInfo, deathCallback: Callback<void>, callback: AsyncCallback<void>): void; 1710 1711 /** 1712 * Whether the window supports thr wide gamut setting. 1713 * @since 8 1714 * @deprecated since 9 1715 * @useinstead ohos.window.Window#isWindowSupportWideGamut 1716 */ 1717 isSupportWideGamut(): Promise<boolean>; 1718 1719 /** 1720 * Whether the window supports thr wide gamut setting. 1721 * @since 8 1722 * @deprecated since 9 1723 * @useinstead ohos.window.Window#isWindowSupportWideGamut 1724 */ 1725 isSupportWideGamut(callback: AsyncCallback<boolean>): void; 1726 1727 /** 1728 * Whether the window supports thr wide gamut setting. 1729 * @throws {BusinessError} 1300002 - This window state is abnormal. 1730 * @since 9 1731 */ 1732 isWindowSupportWideGamut(): Promise<boolean>; 1733 1734 /** 1735 * Whether the window supports thr wide gamut setting. 1736 * @throws {BusinessError} 1300002 - This window state is abnormal. 1737 * @since 9 1738 */ 1739 isWindowSupportWideGamut(callback: AsyncCallback<boolean>): void; 1740 1741 /** 1742 * Sets the specified color space. 1743 * @param colorSpace the specified color space. 1744 * @since 8 1745 * @deprecated since 9 1746 * @useinstead ohos.window.Window#setWindowColorSpace 1747 */ 1748 setColorSpace(colorSpace:ColorSpace): Promise<void>; 1749 1750 /** 1751 * Sets the specified color space. 1752 * @param colorSpace the specified color space. 1753 * @since 8 1754 * @deprecated since 9 1755 * @useinstead ohos.window.Window#setWindowColorSpace 1756 */ 1757 setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): void; 1758 1759 /** 1760 * Sets the specified color space. 1761 * @param colorSpace the specified color space. 1762 * @throws {BusinessError} 401 - Parameter error. 1763 * @throws {BusinessError} 1300002 - This window state is abnormal. 1764 * @since 9 1765 */ 1766 setWindowColorSpace(colorSpace:ColorSpace): Promise<void>; 1767 1768 /** 1769 * Sets the specified color space. 1770 * @param colorSpace the specified color space. 1771 * @throws {BusinessError} 401 - Parameter error. 1772 * @throws {BusinessError} 1300002 - This window state is abnormal. 1773 * @since 9 1774 */ 1775 setWindowColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): void; 1776 1777 /** 1778 * Obtains the set color space. 1779 * @since 8 1780 * @deprecated since 9 1781 * @useinstead ohos.window.Window#getWindowColorSpace 1782 */ 1783 getColorSpace(): Promise<ColorSpace>; 1784 1785 /** 1786 * Obtains the set color space. 1787 * @since 8 1788 * @deprecated since 9 1789 * @useinstead ohos.window.Window#getWindowColorSpace 1790 */ 1791 getColorSpace(callback: AsyncCallback<ColorSpace>): void; 1792 1793 /** 1794 * Obtains the set color space. 1795 * @throws {BusinessError} 1300002 - This window state is abnormal. 1796 * @since 9 1797 */ 1798 getWindowColorSpace(): ColorSpace; 1799 1800 /** 1801 * Sets the background color of window. 1802 * @param color the specified color. 1803 * @syscap SystemCapability.WindowManager.WindowManager.Core 1804 * @since 6 1805 * @deprecated since 9 1806 * @useinstead ohos.window.Window#setWindowBackgroundColor 1807 */ 1808 setBackgroundColor(color: string): Promise<void>; 1809 1810 /** 1811 * Sets the background color of window. 1812 * @param color the specified color. 1813 * @syscap SystemCapability.WindowManager.WindowManager.Core 1814 * @since 6 1815 * @deprecated since 9 1816 * @useinstead ohos.window.Window#setWindowBackgroundColor 1817 */ 1818 setBackgroundColor(color: string, callback: AsyncCallback<void>): void; 1819 1820 /** 1821 * Sets the background color of window. 1822 * @param color the specified color. 1823 * @throws {BusinessError} 401 - Parameter error. 1824 * @throws {BusinessError} 1300002 - This window state is abnormal. 1825 * @syscap SystemCapability.WindowManager.WindowManager.Core 1826 * @since 9 1827 */ 1828 setWindowBackgroundColor(color: string): void; 1829 1830 /** 1831 * Sets the brightness of window. 1832 * @param brightness the specified brightness value. 1833 * @syscap SystemCapability.WindowManager.WindowManager.Core 1834 * @since 6 1835 * @deprecated since 9 1836 * @useinstead ohos.window.Window#setWindowBrightness 1837 */ 1838 setBrightness(brightness: number): Promise<void>; 1839 1840 /** 1841 * Sets the brightness of window. 1842 * @param brightness the specified brightness value. 1843 * @syscap SystemCapability.WindowManager.WindowManager.Core 1844 * @since 6 1845 * @deprecated since 9 1846 * @useinstead ohos.window.Window#setWindowBrightness 1847 */ 1848 setBrightness(brightness: number, callback: AsyncCallback<void>): void; 1849 1850 /** 1851 * Sets the brightness of window. 1852 * @param brightness the specified brightness value. 1853 * @syscap SystemCapability.WindowManager.WindowManager.Core 1854 * @throws {BusinessError} 401 - Parameter error. 1855 * @throws {BusinessError} 1300002 - This window state is abnormal. 1856 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1857 * @since 9 1858 */ 1859 setWindowBrightness(brightness: number): Promise<void>; 1860 1861 /** 1862 * Sets the brightness of window. 1863 * @param brightness the specified brightness value. 1864 * @syscap SystemCapability.WindowManager.WindowManager.Core 1865 * @throws {BusinessError} 401 - Parameter error. 1866 * @throws {BusinessError} 1300002 - This window state is abnormal. 1867 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1868 * @since 9 1869 */ 1870 setWindowBrightness(brightness: number, callback: AsyncCallback<void>): void; 1871 1872 /** 1873 * Sets the dimBehind of window. 1874 * @param dimBehindValue the specified dimBehind. 1875 * @syscap SystemCapability.WindowManager.WindowManager.Core 1876 * @since 7 1877 * @deprecated since 9 1878 */ 1879 setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void; 1880 1881 /** 1882 * Sets the dimBehind of window. 1883 * @param dimBehind the specified dimBehind. 1884 * @syscap SystemCapability.WindowManager.WindowManager.Core 1885 * @since 7 1886 * @deprecated since 9 1887 */ 1888 setDimBehind(dimBehindValue: number): Promise<void>; 1889 1890 /** 1891 * Sets whether focusable or not. 1892 * @param isFocusable can be focus if true, or can not be focus if false. 1893 * @syscap SystemCapability.WindowManager.WindowManager.Core 1894 * @since 7 1895 * @deprecated since 9 1896 * @useinstead ohos.window.Window#setWindowFocusable 1897 */ 1898 setFocusable(isFocusable: boolean): Promise<void>; 1899 1900 /** 1901 * Sets whether focusable or not. 1902 * @param isFocusable can be focus if true, or can not be focus if false. 1903 * @syscap SystemCapability.WindowManager.WindowManager.Core 1904 * @since 7 1905 * @deprecated since 9 1906 * @useinstead ohos.window.Window#setWindowFocusable 1907 */ 1908 setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 1909 1910 /** 1911 * Sets whether focusable or not. 1912 * @param isFocusable can be focus if true, or can not be focus if false. 1913 * @syscap SystemCapability.WindowManager.WindowManager.Core 1914 * @throws {BusinessError} 401 - Parameter error. 1915 * @throws {BusinessError} 1300002 - This window state is abnormal. 1916 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1917 * @since 9 1918 */ 1919 setWindowFocusable(isFocusable: boolean): Promise<void>; 1920 1921 /** 1922 * Sets whether focusable or not. 1923 * @param isFocusable can be focus if true, or can not be focus if false. 1924 * @syscap SystemCapability.WindowManager.WindowManager.Core 1925 * @throws {BusinessError} 401 - Parameter error. 1926 * @throws {BusinessError} 1300002 - This window state is abnormal. 1927 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1928 * @since 9 1929 */ 1930 setWindowFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; 1931 1932 /** 1933 * Sets whether keep screen on or not. 1934 * @param isKeepScreenOn keep screen on if true, or not if false. 1935 * @syscap SystemCapability.WindowManager.WindowManager.Core 1936 * @since 6 1937 * @deprecated since 9 1938 * @useinstead ohos.window.Window#setWindowKeepScreenOn 1939 */ 1940 setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 1941 1942 /** 1943 * Sets whether keep screen on or not. 1944 * @param isKeepScreenOn keep screen on if true, or not if false. 1945 * @syscap SystemCapability.WindowManager.WindowManager.Core 1946 * @since 6 1947 * @deprecated since 9 1948 * @useinstead ohos.window.Window#setWindowKeepScreenOn 1949 */ 1950 setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 1951 1952 /** 1953 * Sets whether keep screen on or not. 1954 * @param isKeepScreenOn keep screen on if true, or not if false. 1955 * @throws {BusinessError} 401 - Parameter error. 1956 * @throws {BusinessError} 1300002 - This window state is abnormal. 1957 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1958 * @syscap SystemCapability.WindowManager.WindowManager.Core 1959 * @since 9 1960 */ 1961 setWindowKeepScreenOn(isKeepScreenOn: boolean): Promise<void>; 1962 1963 /** 1964 * Sets whether keep screen on or not. 1965 * @param isKeepScreenOn keep screen on if true, or not if false. 1966 * @throws {BusinessError} 401 - Parameter error. 1967 * @throws {BusinessError} 1300002 - This window state is abnormal. 1968 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1969 * @syscap SystemCapability.WindowManager.WindowManager.Core 1970 * @since 9 1971 */ 1972 setWindowKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; 1973 1974 /** 1975 * Sets whether to wake up the screen when this ability is restored. 1976 * @param wakeUp Specifies whether to wake up the screen. True means to wake it up, false means not. 1977 * @throws {BusinessError} 401 - Parameter error. 1978 * @throws {BusinessError} 1300002 - This window state is abnormal. 1979 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 1980 * @syscap SystemCapability.WindowManager.WindowManager.Core 1981 * @systemapi Hide this for inner system use. 1982 * @since 9 1983 */ 1984 setWakeUpScreen(wakeUp: boolean): void; 1985 1986 /** 1987 * Sets whether outside can be touch or not. 1988 * @param touchable outside can be touch if true, or not if false. 1989 * @syscap SystemCapability.WindowManager.WindowManager.Core 1990 * @since 7 1991 * @deprecated since 9 1992 */ 1993 setOutsideTouchable(touchable: boolean): Promise<void>; 1994 1995 /** 1996 * Sets whether outside can be touch or not. 1997 * @param touchable outside can be touch if true, or not if false. 1998 * @syscap SystemCapability.WindowManager.WindowManager.Core 1999 * @since 7 2000 * @deprecated since 9 2001 */ 2002 setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void; 2003 2004 /** 2005 * Sets whether is private mode or not. 2006 * @param isPrivacyMode in private mode if true, or not if false. 2007 * @syscap SystemCapability.WindowManager.WindowManager.Core 2008 * @since 7 2009 * @deprecated since 9 2010 * @useinstead ohos.window.Window#setWindowPrivacyMode 2011 */ 2012 setPrivacyMode(isPrivacyMode: boolean): Promise<void>; 2013 2014 /** 2015 * Sets whether is private mode or not. 2016 * @param isPrivacyMode in private mode if true, or not if false. 2017 * @syscap SystemCapability.WindowManager.WindowManager.Core 2018 * @since 7 2019 * @deprecated since 9 2020 * @useinstead ohos.window.Window#setWindowPrivacyMode 2021 */ 2022 setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 2023 2024 /** 2025 * Sets whether is private mode or not. 2026 * @param isPrivacyMode in private mode if true, or not if false. 2027 * @throws {BusinessError} 201 - Permission verification failed. 2028 * @throws {BusinessError} 401 - Parameter error. 2029 * @throws {BusinessError} 1300002 - This window state is abnormal. 2030 * @permission ohos.permission.PRIVACY_WINDOW 2031 * @syscap SystemCapability.WindowManager.WindowManager.Core 2032 * @since 9 2033 */ 2034 setWindowPrivacyMode(isPrivacyMode: boolean): Promise<void>; 2035 2036 /** 2037 * Sets whether is private mode or not. 2038 * @param isPrivacyMode in private mode if true, or not if false. 2039 * @throws {BusinessError} 201 - Permission verification failed. 2040 * @throws {BusinessError} 401 - Parameter error. 2041 * @throws {BusinessError} 1300002 - This window state is abnormal. 2042 * @permission ohos.permission.PRIVACY_WINDOW 2043 * @syscap SystemCapability.WindowManager.WindowManager.Core 2044 * @since 9 2045 */ 2046 setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; 2047 2048 /** 2049 * Ignore this window during screenshot. 2050 * @param isSkip skip if true, or not if false. 2051 * @throws {BusinessError} 401 - Parameter error. 2052 * @throws {BusinessError} 1300002 - This window state is abnormal. 2053 * @syscap SystemCapability.WindowManager.WindowManager.Core 2054 * @systemapi Hide this for inner system use. 2055 * @since 9 2056 */ 2057 setSnapshotSkip(isSkip: boolean): void; 2058 2059 /** 2060 * Sets whether is touchable or not. 2061 * @param isTouchable is touchable if true, or not if false. 2062 * @syscap SystemCapability.WindowManager.WindowManager.Core 2063 * @since 7 2064 * @deprecated since 9 2065 * @useinstead ohos.window.Window#setWindowTouchable 2066 */ 2067 setTouchable(isTouchable: boolean): Promise<void>; 2068 2069 /** 2070 * Sets whether is touchable or not. 2071 * @param isTouchable is touchable if true, or not if false. 2072 * @syscap SystemCapability.WindowManager.WindowManager.Core 2073 * @since 7 2074 * @deprecated since 9 2075 * @useinstead ohos.window.Window#setWindowTouchable 2076 */ 2077 setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 2078 2079 /** 2080 * Sets whether is touchable or not. 2081 * @param isTouchable is touchable if true, or not if false. 2082 * @throws {BusinessError} 401 - Parameter error. 2083 * @throws {BusinessError} 1300002 - This window state is abnormal. 2084 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 2085 * @syscap SystemCapability.WindowManager.WindowManager.Core 2086 * @since 9 2087 */ 2088 setWindowTouchable(isTouchable: boolean): Promise<void>; 2089 2090 /** 2091 * Sets whether is touchable or not. 2092 * @param isTouchable is touchable if true, or not if false. 2093 * @throws {BusinessError} 401 - Parameter error. 2094 * @throws {BusinessError} 1300002 - This window state is abnormal. 2095 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 2096 * @syscap SystemCapability.WindowManager.WindowManager.Core 2097 * @since 9 2098 */ 2099 setWindowTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; 2100 2101 /** 2102 * Sets the flag of the window is forbidden to move in split screen mode 2103 * @param isForbidSplitMove the flag of the window is forbidden to move in split screen mode 2104 * @throws {BusinessError} 401 - Parameter error. 2105 * @throws {BusinessError} 1300002 - This window state is abnormal. 2106 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 2107 * @syscap SystemCapability.WindowManager.WindowManager.Core 2108 * @systemapi 2109 * @since 9 2110 */ 2111 setForbidSplitMove(isForbidSplitMove: boolean, callback: AsyncCallback<void>): void; 2112 2113 /** 2114 * Sets the flag of the window is forbidden to move in split screen mode 2115 * @param isForbidSplitMove the flag of the window is forbidden to move in split screen mode 2116 * @throws {BusinessError} 401 - Parameter error. 2117 * @throws {BusinessError} 1300002 - This window state is abnormal. 2118 * @throws {BusinessError} 1300003 - This window manager service works abnormally. 2119 * @syscap SystemCapability.WindowManager.WindowManager.Core 2120 * @systemapi 2121 * @since 9 2122 */ 2123 setForbidSplitMove(isForbidSplitMove: boolean): Promise<void>; 2124 2125 /** 2126 * Obtains snapshot of window 2127 * @throws {BusinessError} 1300002 - This window state is abnormal. 2128 * @syscap SystemCapability.WindowManager.WindowManager.Core 2129 * @since 9 2130 */ 2131 snapshot(callback: AsyncCallback<image.PixelMap>): void; 2132 2133 /** 2134 * Obtains snapshot of window 2135 * @throws {BusinessError} 1300002 - This window state is abnormal. 2136 * @syscap SystemCapability.WindowManager.WindowManager.Core 2137 * @since 9 2138 */ 2139 snapshot(): Promise<image.PixelMap>; 2140 2141 /** Sets opacity of window 2142 * @param opacity Interval is 0.f-1.f. 2143 * @throws {BusinessError} 401 - Parameter error. 2144 * @throws {BusinessError} 1300002 - This window state is abnormal. 2145 * @throws {BusinessError} 1300004 - Unauthorized operation. 2146 * @systemapi 2147 * @since 9 2148 */ 2149 opacity(opacity: number): void; 2150 2151 /** 2152 * Sets scale options of window. 2153 * @param scaleOptions scale param of window. 2154 * @throws {BusinessError} 401 - Parameter error. 2155 * @throws {BusinessError} 1300002 - This window state is abnormal. 2156 * @throws {BusinessError} 1300004 - Unauthorized operation. 2157 * @systemapi 2158 * @since 9 2159 */ 2160 scale(scaleOptions: ScaleOptions): void; 2161 2162 /** 2163 * Sets rotate options of window. 2164 * @param rotateOptions rotate param of window. 2165 * @throws {BusinessError} 401 - Parameter error. 2166 * @throws {BusinessError} 1300002 - This window state is abnormal. 2167 * @throws {BusinessError} 1300004 - Unauthorized operation. 2168 * @systemapi 2169 * @since 9 2170 */ 2171 rotate(rotateOptions: RotateOptions): void; 2172 2173 /** 2174 * Sets translate options of window. 2175 * @param translateOptions translate param of window. 2176 * @throws {BusinessError} 401 - Parameter error. 2177 * @throws {BusinessError} 1300002 - This window state is abnormal. 2178 * @throws {BusinessError} 1300004 - Unauthorized operation. 2179 * @systemapi 2180 * @since 9 2181 */ 2182 translate(translateOptions: TranslateOptions): void; 2183 2184 /** 2185 * Get Transition Controller. 2186 * @throws {BusinessError} 1300002 - This window state is abnormal. 2187 * @throws {BusinessError} 1300004 - Unauthorized operation. 2188 * @systemapi 2189 * @since 9 2190 */ 2191 getTransitionController(): TransitionController; 2192 2193 /** 2194 * Sets the window blur radius. 2195 * @param radius the blur radius. 2196 * @throws {BusinessError} 401 - Parameter error. 2197 * @throws {BusinessError} 1300002 - This window state is abnormal. 2198 * @throws {BusinessError} 1300004 - Unauthorized operation. 2199 * @systemapi Hide this for inner system use. 2200 * @since 9 2201 */ 2202 setBlur(radius: number): void; 2203 2204 /** 2205 * Sets the window backdrop blur radius. 2206 * @param radius the blur radius. 2207 * @throws {BusinessError} 401 - Parameter error. 2208 * @throws {BusinessError} 1300002 - This window state is abnormal. 2209 * @throws {BusinessError} 1300004 - Unauthorized operation. 2210 * @systemapi Hide this for inner system use. 2211 * @since 9 2212 */ 2213 setBackdropBlur(radius: number): void; 2214 2215 /** 2216 * Sets the window backdrop blur style. 2217 * @param blurStyle the specified blur style. 2218 * @throws {BusinessError} 401 - Parameter error. 2219 * @throws {BusinessError} 1300002 - This window state is abnormal. 2220 * @throws {BusinessError} 1300004 - Unauthorized operation. 2221 * @systemapi Hide this for inner system use. 2222 * @since 9 2223 */ 2224 setBackdropBlurStyle(blurStyle: BlurStyle): void; 2225 2226 /** 2227 * Sets shadow. 2228 * @param radius the radius of the shadow. 2229 * @param color the color of the shadow. 2230 * @param offsetX the offset of the shadow on the x-axis. 2231 * @param offsetY the offset of the shadow on the y-axis. 2232 * @throws {BusinessError} 401 - Parameter error. 2233 * @throws {BusinessError} 1300002 - This window state is abnormal. 2234 * @throws {BusinessError} 1300004 - Unauthorized operation. 2235 * @systemapi Hide this for inner system use. 2236 * @since 9 2237 */ 2238 setShadow(radius: number, color?: string, offsetX?: number, offsetY?: number): void; 2239 2240 /** 2241 * Sets corner radius. 2242 * @param cornerRadius the corner radius. 2243 * @throws {BusinessError} 401 - Parameter error. 2244 * @throws {BusinessError} 1300002 - This window state is abnormal. 2245 * @throws {BusinessError} 1300004 - Unauthorized operation. 2246 * @systemapi Hide this for inner system use. 2247 * @since 9 2248 */ 2249 setCornerRadius(cornerRadius: number): void; 2250 } 2251 /** 2252 * Window stage callback event type 2253 * @syscap SystemCapability.WindowManager.WindowManager.Core 2254 * @since 9 2255 * @StageModelOnly 2256 */ 2257 enum WindowStageEventType { 2258 /** 2259 * The window stage is running in the foreground. 2260 * @since 9 2261 */ 2262 SHOWN = 1, 2263 /** 2264 * The window stage gains focus. 2265 * @since 9 2266 */ 2267 ACTIVE, 2268 /** 2269 * The window stage loses focus. 2270 * @since 9 2271 */ 2272 INACTIVE, 2273 /** 2274 * The window stage is running in the background. 2275 * @since 9 2276 */ 2277 HIDDEN, 2278 } 2279 /** 2280 * WindowStage 2281 * @syscap SystemCapability.WindowManager.WindowManager.Core 2282 * @since 9 2283 */ 2284 interface WindowStage { 2285 /** 2286 * Get main window of the stage. 2287 * @throws {BusinessError} 1300002 - This window state is abnormal. 2288 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2289 * @since 9 2290 * @StageModelOnly 2291 */ 2292 getMainWindow(): Promise<Window>; 2293 /** 2294 * Get main window of the stage. 2295 * @throws {BusinessError} 1300002 - This window state is abnormal. 2296 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2297 * @since 9 2298 * @StageModelOnly 2299 */ 2300 getMainWindow(callback: AsyncCallback<Window>): void; 2301 /** 2302 * Get main window of the stage. 2303 * @throws {BusinessError} 1300002 - This window state is abnormal. 2304 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2305 * @since 9 2306 * @StageModelOnly 2307 */ 2308 getMainWindowSync(): Window; 2309 /** 2310 * Create sub window of the stage. 2311 * @param name window name of sub window 2312 * @throws {BusinessError} 401 - Parameter error. 2313 * @throws {BusinessError} 1300002 - This window state is abnormal. 2314 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2315 * @since 9 2316 * @StageModelOnly 2317 */ 2318 createSubWindow(name: string): Promise<Window>; 2319 /** 2320 * Create sub window of the stage. 2321 * @param name window name of sub window 2322 * @throws {BusinessError} 401 - Parameter error. 2323 * @throws {BusinessError} 1300002 - This window state is abnormal. 2324 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2325 * @since 9 2326 * @StageModelOnly 2327 */ 2328 createSubWindow(name: string, callback: AsyncCallback<Window>): void; 2329 /** 2330 * Get sub window of the stage. 2331 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2332 * @since 9 2333 * @StageModelOnly 2334 */ 2335 getSubWindow(): Promise<Array<Window>>; 2336 /** 2337 * Get sub window of the stage. 2338 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2339 * @since 9 2340 * @StageModelOnly 2341 */ 2342 getSubWindow(callback: AsyncCallback<Array<Window>>): void; 2343 /** 2344 * Loads content 2345 * @param path path Path of the page to which the content will be loaded 2346 * @param storage storage The data object shared within the content instance loaded by the window 2347 * @throws {BusinessError} 401 - Parameter error. 2348 * @throws {BusinessError} 1300002 - This window state is abnormal. 2349 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2350 * @syscap SystemCapability.WindowManager.WindowManager.Core 2351 * @since 9 2352 * @StageModelOnly 2353 */ 2354 loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): void; 2355 /** 2356 * Loads content 2357 * @param path path of the page to which the content will be loaded 2358 * @param storage storage The data object shared within the content instance loaded by the window 2359 * @throws {BusinessError} 401 - Parameter error. 2360 * @throws {BusinessError} 1300002 - This window state is abnormal. 2361 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2362 * @syscap SystemCapability.WindowManager.WindowManager.Core 2363 * @since 9 2364 * @StageModelOnly 2365 */ 2366 loadContent(path: string, storage?: LocalStorage): Promise<void>; 2367 /** 2368 * Loads content 2369 * @param path path of the page to which the content will be loaded 2370 * @throws {BusinessError} 401 - Parameter error. 2371 * @throws {BusinessError} 1300002 - This window state is abnormal. 2372 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2373 * @syscap SystemCapability.WindowManager.WindowManager.Core 2374 * @since 9 2375 * @StageModelOnly 2376 */ 2377 loadContent(path: string, callback: AsyncCallback<void>): void; 2378 /** 2379 * Window stage event callback on. 2380 * @throws {BusinessError} 401 - Parameter error. 2381 * @throws {BusinessError} 1300002 - This window state is abnormal. 2382 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2383 * @since 9 2384 * @StageModelOnly 2385 */ 2386 on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void; 2387 /** 2388 * Window stage event callback off. 2389 * @throws {BusinessError} 401 - Parameter error. 2390 * @throws {BusinessError} 1300002 - This window state is abnormal. 2391 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2392 * @since 9 2393 * @StageModelOnly 2394 */ 2395 off(eventType: 'windowStageEvent', callback?: Callback<WindowStageEventType>): void; 2396 2397 /** 2398 * Disable window decoration. It must be called before loadContent. 2399 * @throws {BusinessError} 1300002 - This window state is abnormal. 2400 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2401 * @systemapi 2402 * @since 9 2403 * @StageModelOnly 2404 */ 2405 disableWindowDecor(): void; 2406 2407 /** 2408 * Sets whether can show on lock screen or not 2409 * @param showOnLockScreen can show on lock screen if true, or not if false 2410 * @throws {BusinessError} 401 - Parameter error. 2411 * @throws {BusinessError} 1300002 - This window state is abnormal. 2412 * @throws {BusinessError} 1300005 - This window stage is abnormal. 2413 * @syscap SystemCapability.WindowManager.WindowManager.Core 2414 * @systemapi Hide this for inner system use. 2415 * @since 9 2416 * @StageModelOnly 2417 */ 2418 setShowOnLockScreen(showOnLockScreen: boolean): void; 2419 } 2420} 2421 2422export default window; 2423