1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit ArkUI 19 */ 20 21import type { AsyncCallback, Callback } from './@ohos.base'; 22import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; 23import type hdrCapability from './@ohos.graphics.hdrCapability'; 24 25/** 26 * Interface of display manager. 27 * 28 * @namespace display 29 * @syscap SystemCapability.WindowManager.WindowManager.Core 30 * @since 7 31 */ 32/** 33 * Interface of display manager. 34 * 35 * @namespace display 36 * @syscap SystemCapability.WindowManager.WindowManager.Core 37 * @crossplatform 38 * @since 10 39 */ 40/** 41 * Interface of display manager. 42 * 43 * @namespace display 44 * @syscap SystemCapability.WindowManager.WindowManager.Core 45 * @crossplatform 46 * @atomicservice 47 * @since 11 48 */ 49declare namespace display { 50 /** 51 * Obtain the default display. 52 * 53 * @param { AsyncCallback<Display> } callback the result of display 54 * @syscap SystemCapability.WindowManager.WindowManager.Core 55 * @since 7 56 * @deprecated since 9 57 * @useinstead ohos.display#getDefaultDisplaySync 58 */ 59 function getDefaultDisplay(callback: AsyncCallback<Display>): void; 60 61 /** 62 * Obtain the default display. 63 * 64 * @returns { Promise<Display> } the result of display 65 * @syscap SystemCapability.WindowManager.WindowManager.Core 66 * @since 7 67 * @deprecated since 9 68 * @useinstead ohos.display#getDefaultDisplaySync 69 */ 70 function getDefaultDisplay(): Promise<Display>; 71 72 /** 73 * Obtain the default display. 74 * 75 * @returns { Display } the result of display 76 * @throws { BusinessError } 1400001 - Invalid display or screen. 77 * @syscap SystemCapability.WindowManager.WindowManager.Core 78 * @since 9 79 */ 80 /** 81 * Obtain the default display. 82 * 83 * @returns { Display } the result of display 84 * @throws { BusinessError } 1400001 - Invalid display or screen. 85 * @syscap SystemCapability.WindowManager.WindowManager.Core 86 * @crossplatform 87 * @since 10 88 */ 89 /** 90 * Obtain the default display. 91 * 92 * @returns { Display } the result of display 93 * @throws { BusinessError } 1400001 - Invalid display or screen. 94 * @syscap SystemCapability.WindowManager.WindowManager.Core 95 * @crossplatform 96 * @atomicservice 97 * @since 11 98 */ 99 function getDefaultDisplaySync(): Display; 100 101 /** 102 * Obtain the primary display. 103 * 104 * @returns { Display } the result of primary display 105 * @throws { BusinessError } 1400001 - Invalid display or screen. 106 * @syscap SystemCapability.WindowManager.WindowManager.Core 107 * @crossplatform 108 * @atomicservice 109 * @since 14 110 */ 111 function getPrimaryDisplaySync(): Display; 112 113 /** 114 * Obtain the target display. 115 * 116 * @param { number } displayId Display id to query. This parameter should be greater than or equal to 0. 117 * @returns { Display } the result of display 118 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 119 * 2. Incorrect parameter types. 120 * 3. Parameter verification failed. 121 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 122 * @syscap SystemCapability.WindowManager.WindowManager.Core 123 * @atomicservice 124 * @since 12 125 */ 126 function getDisplayByIdSync(displayId: number): Display; 127 128 /** 129 * Obtain all displays. 130 * 131 * @param { AsyncCallback<Array<Display>> } callback the result of all displays 132 * @syscap SystemCapability.WindowManager.WindowManager.Core 133 * @since 7 134 * @deprecated since 9 135 * @useinstead ohos.display#getAllDisplays 136 */ 137 function getAllDisplay(callback: AsyncCallback<Array<Display>>): void; 138 139 /** 140 * Obtain all displays. 141 * 142 * @returns { Promise<Array<Display>> } the result of all displays 143 * @syscap SystemCapability.WindowManager.WindowManager.Core 144 * @since 7 145 * @deprecated since 9 146 * @useinstead ohos.display#getAllDisplays 147 */ 148 function getAllDisplay(): Promise<Array<Display>>; 149 150 /** 151 * Obtain all displays. 152 * 153 * @param { AsyncCallback<Array<Display>> } callback the result of all displays 154 * @throws { BusinessError } 1400001 - Invalid display or screen. 155 * @syscap SystemCapability.WindowManager.WindowManager.Core 156 * @since 9 157 */ 158 /** 159 * Obtain all displays. 160 * 161 * @param { AsyncCallback<Array<Display>> } callback the result of all displays 162 * @throws { BusinessError } 1400001 - Invalid display or screen. 163 * @syscap SystemCapability.WindowManager.WindowManager.Core 164 * @atomicservice 165 * @since 12 166 */ 167 function getAllDisplays(callback: AsyncCallback<Array<Display>>): void; 168 169 /** 170 * Obtain all displays. 171 * 172 * @returns { Promise<Array<Display>> } the result of all displays 173 * @throws { BusinessError } 1400001 - Invalid display or screen. 174 * @syscap SystemCapability.WindowManager.WindowManager.Core 175 * @since 9 176 */ 177 /** 178 * Obtain all displays. 179 * 180 * @returns { Promise<Array<Display>> } the result of all displays 181 * @throws { BusinessError } 1400001 - Invalid display or screen. 182 * @syscap SystemCapability.WindowManager.WindowManager.Core 183 * @atomicservice 184 * @since 12 185 */ 186 function getAllDisplays(): Promise<Array<Display>>; 187 188 /** 189 * Obtain all display physical resolution 190 * 191 * @returns { Promise<Array<DisplayPhysicalResolution>> } the result of all display physical resolution 192 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 193 * @syscap SystemCapability.WindowManager.WindowManager.Core 194 * @atomicservice 195 * @since 12 196 */ 197 function getAllDisplayPhysicalResolution(): Promise<Array<DisplayPhysicalResolution>>; 198 199 /** 200 * Check whether there is a privacy window on the current display. 201 * 202 * @param { number } displayId Display id to query. This parameter should be greater than or equal to 0. 203 * @returns { boolean } true means there is a privacy window on the current display 204 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 205 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 206 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 207 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 208 * @syscap SystemCapability.WindowManager.WindowManager.Core 209 * @systemapi Hide this for inner system use. 210 * @since 9 211 */ 212 function hasPrivateWindow(displayId: number): boolean; 213 214 /** 215 * Register the callback for display changes. 216 * 217 * @param { 'add' | 'remove' | 'change' } type the event of display change 218 * @param { Callback<number> } callback the display id of changed 219 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 220 * <br>2. Incorrect parameter types. 221 * @syscap SystemCapability.WindowManager.WindowManager.Core 222 * @since 7 223 */ 224 /** 225 * Register the callback for display changes. 226 * 227 * @param { 'add' | 'remove' | 'change' } type the event of display change 228 * @param { Callback<number> } callback the display id of changed 229 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 230 * <br>2. Incorrect parameter types. 231 * @syscap SystemCapability.WindowManager.WindowManager.Core 232 * @atomicservice 233 * @since 12 234 */ 235 function on(type: 'add' | 'remove' | 'change', callback: Callback<number>): void; 236 237 /** 238 * Unregister the callback for display changes. 239 * 240 * @param { 'add' | 'remove' | 'change' } type the event of display change event 241 * @param { Callback<number> } callback the display id of changed 242 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 243 * <br>2. Incorrect parameter types. 244 * @syscap SystemCapability.WindowManager.WindowManager.Core 245 * @since 7 246 */ 247 /** 248 * Unregister the callback for display changes. 249 * 250 * @param { 'add' | 'remove' | 'change' } type the event of display change event 251 * @param { Callback<number> } callback the display id of changed 252 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 253 * <br>2. Incorrect parameter types. 254 * @syscap SystemCapability.WindowManager.WindowManager.Core 255 * @atomicservice 256 * @since 12 257 */ 258 function off(type: 'add' | 'remove' | 'change', callback?: Callback<number>): void; 259 260 /** 261 * Register the callback for private mode changes. 262 * 263 * @param { 'privateModeChange' } type the event of private mode changes 264 * @param { Callback<boolean> } callback Callback used to return the result whether display is on private mode or not 265 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 267 * <br>2. Incorrect parameter types. 268 * @syscap SystemCapability.WindowManager.WindowManager.Core 269 * @systemapi Hide this for inner system use. 270 * @since 10 271 */ 272 function on(type: 'privateModeChange', callback: Callback<boolean>): void; 273 274 /** 275 * Unregister the callback for private mode changes. 276 * 277 * @param { 'privateModeChange' } type the event of private mode changes 278 * @param { Callback<boolean> } callback Callback used to return the result whether display is on private mode or not 279 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 280 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 281 * <br>2. Incorrect parameter types. 282 * @syscap SystemCapability.WindowManager.WindowManager.Core 283 * @systemapi Hide this for inner system use. 284 * @since 10 285 */ 286 function off(type: 'privateModeChange', callback?: Callback<boolean>): void; 287 288 /** 289 * Check whether the device is foldable. 290 * 291 * @returns { boolean } true means the device is foldable. 292 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 293 * @syscap SystemCapability.Window.SessionManager 294 * @since 10 295 */ 296 /** 297 * Check whether the device is foldable. 298 * 299 * @returns { boolean } true means the device is foldable. 300 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 301 * @syscap SystemCapability.Window.SessionManager 302 * @atomicservice 303 * @since 12 304 */ 305 function isFoldable(): boolean; 306 307 /** 308 * Get the current fold status of the foldable device. 309 * 310 * @returns { FoldStatus } fold status of device. 311 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 312 * @syscap SystemCapability.Window.SessionManager 313 * @since 10 314 */ 315 /** 316 * Get the current fold status of the foldable device. 317 * 318 * @returns { FoldStatus } fold status of device. 319 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 320 * @syscap SystemCapability.Window.SessionManager 321 * @atomicservice 322 * @since 12 323 */ 324 function getFoldStatus(): FoldStatus; 325 326 /** 327 * Register the callback for fold status changes. 328 * 329 * @param { 'foldStatusChange' } type the event of fold status changes 330 * @param { Callback<FoldStatus> } callback Callback used to return the current fold status of device 331 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 332 * <br>2. Incorrect parameter types. 333 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 334 * @syscap SystemCapability.Window.SessionManager 335 * @since 10 336 */ 337 /** 338 * Register the callback for fold status changes. 339 * 340 * @param { 'foldStatusChange' } type the event of fold status changes 341 * @param { Callback<FoldStatus> } callback Callback used to return the current fold status of device 342 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 343 * <br>2. Incorrect parameter types. 344 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 345 * @syscap SystemCapability.Window.SessionManager 346 * @atomicservice 347 * @since 12 348 */ 349 function on(type: 'foldStatusChange', callback: Callback<FoldStatus>): void; 350 351 /** 352 * Unregister the callback for fold status changes. 353 * 354 * @param { 'foldStatusChange' } type the event of fold status changes 355 * @param { Callback<FoldStatus> } callback Callback used to return the current fold status of device 356 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 357 * <br>2. Incorrect parameter types. 358 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 359 * @syscap SystemCapability.Window.SessionManager 360 * @since 10 361 */ 362 /** 363 * Unregister the callback for fold status changes. 364 * 365 * @param { 'foldStatusChange' } type the event of fold status changes 366 * @param { Callback<FoldStatus> } callback Callback used to return the current fold status of device 367 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 368 * <br>2. Incorrect parameter types. 369 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 370 * @syscap SystemCapability.Window.SessionManager 371 * @atomicservice 372 * @since 12 373 */ 374 function off(type: 'foldStatusChange', callback?: Callback<FoldStatus>): void; 375 376 /** 377 * Register the callback for fold angle changes. 378 * 379 * @param { 'foldAngleChange' } type the event of fold angle changes. 380 * @param { Callback<Array<number>> } callback Callback used to return the current fold angle of device. 381 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 382 * <br>2. Incorrect parameter types. 383 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 384 * @syscap SystemCapability.Window.SessionManager 385 * @atomicservice 386 * @since 12 387 */ 388 function on(type: 'foldAngleChange', callback: Callback<Array<number>>): void; 389 390 /** 391 * Unregister the callback for fold angle changes. 392 * 393 * @param { 'foldAngleChange' } type the event of fold angle changes. 394 * @param { Callback<Array<number>> } callback Callback used to return the current fold angle of device. 395 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 396 * <br>2. Incorrect parameter types. 397 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 398 * @syscap SystemCapability.Window.SessionManager 399 * @atomicservice 400 * @since 12 401 */ 402 function off(type: 'foldAngleChange', callback?: Callback<Array<number>>): void; 403 404 /** 405 * Register the callback for device capture status changes. 406 * 407 * @param { 'captureStatusChange' } type the event of capture status changes. 408 * @param { Callback<boolean> } callback Callback used to return the device capture status. 409 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 410 * <br>2. Incorrect parameter types. 411 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 412 * @syscap SystemCapability.Window.SessionManager 413 * @atomicservice 414 * @since 12 415 */ 416 function on(type: 'captureStatusChange', callback: Callback<boolean>): void; 417 418 /** 419 * Unregister the callback for device capture status changes. 420 * 421 * @param { 'captureStatusChange' } type the event of capture status changes. 422 * @param { Callback<boolean> } callback Callback used to return the device capture status. 423 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 424 * <br>2. Incorrect parameter types. 425 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 426 * @syscap SystemCapability.Window.SessionManager 427 * @atomicservice 428 * @since 12 429 */ 430 function off(type: 'captureStatusChange', callback?: Callback<boolean>): void; 431 432 433 /** 434 * Check whether the device is captured. 435 * 436 * @returns { boolean } true means the device is captured. 437 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 438 * @syscap SystemCapability.Window.SessionManager 439 * @atomicservice 440 * @since 12 441 */ 442 function isCaptured(): boolean; 443 444 /** 445 * Get the display mode of the foldable device. 446 * 447 * @returns { FoldDisplayMode } display mode of the foldable device. 448 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 449 * @syscap SystemCapability.Window.SessionManager 450 * @since 10 451 */ 452 /** 453 * Get the display mode of the foldable device. 454 * 455 * @returns { FoldDisplayMode } display mode of the foldable device. 456 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 457 * @syscap SystemCapability.Window.SessionManager 458 * @atomicservice 459 * @since 12 460 */ 461 function getFoldDisplayMode(): FoldDisplayMode; 462 463 /** 464 * Change the display mode of the foldable device. 465 * 466 * @param { FoldDisplayMode } mode target display mode to change. 467 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 468 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 469 * <br>2. Incorrect parameter types. 470 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 471 * @syscap SystemCapability.Window.SessionManager 472 * @systemapi Hide this for inner system use. 473 * @since 10 474 */ 475 function setFoldDisplayMode(mode: FoldDisplayMode): void; 476 477 /** 478 * Register the callback for fold display mode changes. 479 * 480 * @param { 'foldDisplayModeChange' } type the event of fold display mode changes 481 * @param { Callback<FoldDisplayMode> } callback Callback used to return the current fold display mode 482 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 483 * <br>2. Incorrect parameter types. 484 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 485 * @syscap SystemCapability.Window.SessionManager 486 * @since 10 487 */ 488 /** 489 * Register the callback for fold display mode changes. 490 * 491 * @param { 'foldDisplayModeChange' } type the event of fold display mode changes 492 * @param { Callback<FoldDisplayMode> } callback Callback used to return the current fold display mode 493 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 494 * <br>2. Incorrect parameter types. 495 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 496 * @syscap SystemCapability.Window.SessionManager 497 * @atomicservice 498 * @since 12 499 */ 500 function on(type: 'foldDisplayModeChange', callback: Callback<FoldDisplayMode>): void; 501 502 /** 503 * Unregister the callback for fold display mode changes. 504 * 505 * @param { 'foldDisplayModeChange' } type the event of fold display mode changes 506 * @param { Callback<FoldDisplayMode> } callback Callback used to return the current fold display mode 507 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 508 * <br>2. Incorrect parameter types. 509 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 510 * @syscap SystemCapability.Window.SessionManager 511 * @since 10 512 */ 513 /** 514 * Unregister the callback for fold display mode changes. 515 * 516 * @param { 'foldDisplayModeChange' } type the event of fold display mode changes 517 * @param { Callback<FoldDisplayMode> } callback Callback used to return the current fold display mode 518 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 519 * <br>2. Incorrect parameter types. 520 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 521 * @syscap SystemCapability.Window.SessionManager 522 * @atomicservice 523 * @since 12 524 */ 525 function off(type: 'foldDisplayModeChange', callback?: Callback<FoldDisplayMode>): void; 526 527 /** 528 * Get the fold crease region in the current display mode. 529 * 530 * @returns { FoldCreaseRegion } fold crease region in the current display mode. 531 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 532 * @syscap SystemCapability.Window.SessionManager 533 * @since 10 534 */ 535 /** 536 * Get the fold crease region in the current display mode. 537 * 538 * @returns { FoldCreaseRegion } fold crease region in the current display mode. 539 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 540 * @syscap SystemCapability.Window.SessionManager 541 * @atomicservice 542 * @since 12 543 */ 544 function getCurrentFoldCreaseRegion(): FoldCreaseRegion; 545 546 /** 547 * set fold status locked or not. 548 * 549 * @param { boolean } locked - fold status is locked or not. 550 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 551 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 552 * <br>2. Incorrect parameter types. 553 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 554 * @syscap SystemCapability.Window.SessionManager 555 * @systemapi Hide this for inner system use. 556 * @since 11 557 */ 558 function setFoldStatusLocked(locked: boolean): void; 559 560 /** 561 * Enumerates the fold status. 562 * 563 * @enum { number } 564 * @syscap SystemCapability.Window.SessionManager 565 * @since 10 566 */ 567 /** 568 * Enumerates the fold status. 569 * 570 * @enum { number } 571 * @syscap SystemCapability.Window.SessionManager 572 * @atomicservice 573 * @since 12 574 */ 575 enum FoldStatus { 576 /** 577 * Fold Status Unknown. 578 * 579 * @syscap SystemCapability.Window.SessionManager 580 * @since 10 581 */ 582 /** 583 * Fold Status Unknown. 584 * 585 * @syscap SystemCapability.Window.SessionManager 586 * @atomicservice 587 * @since 12 588 */ 589 FOLD_STATUS_UNKNOWN = 0, 590 /** 591 * Fold Status Expanded. 592 * 593 * @syscap SystemCapability.Window.SessionManager 594 * @since 10 595 */ 596 /** 597 * Fold Status Expanded. 598 * 599 * @syscap SystemCapability.Window.SessionManager 600 * @atomicservice 601 * @since 12 602 */ 603 FOLD_STATUS_EXPANDED, 604 /** 605 * Fold Status Folded. 606 * 607 * @syscap SystemCapability.Window.SessionManager 608 * @since 10 609 */ 610 /** 611 * Fold Status Folded. 612 * 613 * @syscap SystemCapability.Window.SessionManager 614 * @atomicservice 615 * @since 12 616 */ 617 FOLD_STATUS_FOLDED, 618 /** 619 * Fold Status Half Folded. 620 * 621 * @syscap SystemCapability.Window.SessionManager 622 * @since 10 623 */ 624 /** 625 * Fold Status Half Folded. 626 * 627 * @syscap SystemCapability.Window.SessionManager 628 * @atomicservice 629 * @since 12 630 */ 631 FOLD_STATUS_HALF_FOLDED, 632 /** 633 * Fold Status Expanded With Second Expanded. 634 * 635 * @syscap SystemCapability.Window.SessionManager 636 * @atomicservice 637 * @since 15 638 */ 639 FOLD_STATUS_EXPANDED_WITH_SECOND_EXPANDED = 11, 640 /** 641 * Fold Status Expanded With Second Half Folded. 642 * 643 * @syscap SystemCapability.Window.SessionManager 644 * @atomicservice 645 * @since 15 646 */ 647 FOLD_STATUS_EXPANDED_WITH_SECOND_HALF_FOLDED = 21, 648 /** 649 * Fold Status Folded With Second Expanded. 650 * 651 * @syscap SystemCapability.Window.SessionManager 652 * @atomicservice 653 * @since 15 654 */ 655 FOLD_STATUS_FOLDED_WITH_SECOND_EXPANDED = 12, 656 /** 657 * Fold Status Folded With Second Half Folded. 658 * 659 * @syscap SystemCapability.Window.SessionManager 660 * @atomicservice 661 * @since 15 662 */ 663 FOLD_STATUS_FOLDED_WITH_SECOND_HALF_FOLDED = 22, 664 /** 665 * Fold Status Half Folded With Second Expanded. 666 * 667 * @syscap SystemCapability.Window.SessionManager 668 * @atomicservice 669 * @since 15 670 */ 671 FOLD_STATUS_HALF_FOLDED_WITH_SECOND_EXPANDED = 13, 672 /** 673 * Fold Status Half Folded With Second Half Folded. 674 * 675 * @syscap SystemCapability.Window.SessionManager 676 * @atomicservice 677 * @since 15 678 */ 679 FOLD_STATUS_HALF_FOLDED_WITH_SECOND_HALF_FOLDED = 23 680 } 681 682 /** 683 * Enumerates the fold display mode. 684 * 685 * @enum { number } 686 * @syscap SystemCapability.Window.SessionManager 687 * @since 10 688 */ 689 /** 690 * Enumerates the fold display mode. 691 * 692 * @enum { number } 693 * @syscap SystemCapability.Window.SessionManager 694 * @atomicservice 695 * @since 12 696 */ 697 enum FoldDisplayMode { 698 /** 699 * Unknown Display. 700 * 701 * @syscap SystemCapability.Window.SessionManager 702 * @since 10 703 */ 704 /** 705 * Unknown Display. 706 * 707 * @syscap SystemCapability.Window.SessionManager 708 * @atomicservice 709 * @since 12 710 */ 711 FOLD_DISPLAY_MODE_UNKNOWN = 0, 712 /** 713 * Full Display. 714 * 715 * @syscap SystemCapability.Window.SessionManager 716 * @since 10 717 */ 718 /** 719 * Full Display. 720 * 721 * @syscap SystemCapability.Window.SessionManager 722 * @atomicservice 723 * @since 12 724 */ 725 FOLD_DISPLAY_MODE_FULL, 726 /** 727 * Main Display. 728 * 729 * @syscap SystemCapability.Window.SessionManager 730 * @since 10 731 */ 732 /** 733 * Main Display. 734 * 735 * @syscap SystemCapability.Window.SessionManager 736 * @atomicservice 737 * @since 12 738 */ 739 FOLD_DISPLAY_MODE_MAIN, 740 /** 741 * Sub Display. 742 * 743 * @syscap SystemCapability.Window.SessionManager 744 * @since 10 745 */ 746 /** 747 * Sub Display. 748 * 749 * @syscap SystemCapability.Window.SessionManager 750 * @atomicservice 751 * @since 12 752 */ 753 FOLD_DISPLAY_MODE_SUB, 754 /** 755 * Coordination Display. 756 * 757 * @syscap SystemCapability.Window.SessionManager 758 * @since 10 759 */ 760 /** 761 * Coordination Display. 762 * 763 * @syscap SystemCapability.Window.SessionManager 764 * @atomicservice 765 * @since 12 766 */ 767 FOLD_DISPLAY_MODE_COORDINATION 768 } 769 770 /** 771 * Enumerates the display states. 772 * 773 * @enum { number } 774 * @syscap SystemCapability.WindowManager.WindowManager.Core 775 * @since 7 776 */ 777 /** 778 * Enumerates the display states. 779 * 780 * @enum { number } 781 * @syscap SystemCapability.WindowManager.WindowManager.Core 782 * @atomicservice 783 * @since 12 784 */ 785 enum DisplayState { 786 /** 787 * Unknown. 788 * 789 * @syscap SystemCapability.WindowManager.WindowManager.Core 790 * @since 7 791 */ 792 /** 793 * Unknown. 794 * 795 * @syscap SystemCapability.WindowManager.WindowManager.Core 796 * @atomicservice 797 * @since 12 798 */ 799 STATE_UNKNOWN = 0, 800 /** 801 * Screen off. 802 * 803 * @syscap SystemCapability.WindowManager.WindowManager.Core 804 * @since 7 805 */ 806 /** 807 * Screen off. 808 * 809 * @syscap SystemCapability.WindowManager.WindowManager.Core 810 * @atomicservice 811 * @since 12 812 */ 813 STATE_OFF, 814 /** 815 * Screen on. 816 * 817 * @syscap SystemCapability.WindowManager.WindowManager.Core 818 * @since 7 819 */ 820 /** 821 * Screen on. 822 * 823 * @syscap SystemCapability.WindowManager.WindowManager.Core 824 * @atomicservice 825 * @since 12 826 */ 827 STATE_ON, 828 /** 829 * Doze, but it will update for some important system messages. 830 * 831 * @syscap SystemCapability.WindowManager.WindowManager.Core 832 * @since 7 833 */ 834 /** 835 * Doze, but it will update for some important system messages. 836 * 837 * @syscap SystemCapability.WindowManager.WindowManager.Core 838 * @atomicservice 839 * @since 12 840 */ 841 STATE_DOZE, 842 /** 843 * Doze and not update. 844 * 845 * @syscap SystemCapability.WindowManager.WindowManager.Core 846 * @since 7 847 */ 848 /** 849 * Doze and not update. 850 * 851 * @syscap SystemCapability.WindowManager.WindowManager.Core 852 * @atomicservice 853 * @since 12 854 */ 855 STATE_DOZE_SUSPEND, 856 /** 857 * VR node. 858 * 859 * @syscap SystemCapability.WindowManager.WindowManager.Core 860 * @since 7 861 */ 862 /** 863 * VR node. 864 * 865 * @syscap SystemCapability.WindowManager.WindowManager.Core 866 * @atomicservice 867 * @since 12 868 */ 869 STATE_VR, 870 /** 871 * Screen on and not update. 872 * 873 * @syscap SystemCapability.WindowManager.WindowManager.Core 874 * @since 7 875 */ 876 /** 877 * Screen on and not update. 878 * 879 * @syscap SystemCapability.WindowManager.WindowManager.Core 880 * @atomicservice 881 * @since 12 882 */ 883 STATE_ON_SUSPEND 884 } 885 886 /** 887 * Enumerates the display orientation. 888 * 889 * @enum { number } 890 * @syscap SystemCapability.WindowManager.WindowManager.Core 891 * @crossplatform 892 * @since 10 893 */ 894 /** 895 * Enumerates the display orientation. 896 * 897 * @enum { number } 898 * @syscap SystemCapability.WindowManager.WindowManager.Core 899 * @crossplatform 900 * @atomicservice 901 * @since 12 902 */ 903 enum Orientation { 904 /** 905 * Indicate that the display content is in portrait mode. 906 * 907 * @syscap SystemCapability.WindowManager.WindowManager.Core 908 * @crossplatform 909 * @since 10 910 */ 911 /** 912 * Indicate that the display content is in portrait mode. 913 * 914 * @syscap SystemCapability.WindowManager.WindowManager.Core 915 * @crossplatform 916 * @atomicservice 917 * @since 12 918 */ 919 PORTRAIT = 0, 920 921 /** 922 * Indicate that the display content is in landscape mode. 923 * 924 * @syscap SystemCapability.WindowManager.WindowManager.Core 925 * @crossplatform 926 * @since 10 927 */ 928 /** 929 * Indicate that the display content is in landscape mode. 930 * 931 * @syscap SystemCapability.WindowManager.WindowManager.Core 932 * @crossplatform 933 * @atomicservice 934 * @since 12 935 */ 936 LANDSCAPE = 1, 937 938 /** 939 * Indicate that the display content is in the opposite direction of the portrait mode. 940 * 941 * @syscap SystemCapability.WindowManager.WindowManager.Core 942 * @crossplatform 943 * @since 10 944 */ 945 /** 946 * Indicate that the display content is in the opposite direction of the portrait mode. 947 * 948 * @syscap SystemCapability.WindowManager.WindowManager.Core 949 * @crossplatform 950 * @atomicservice 951 * @since 12 952 */ 953 PORTRAIT_INVERTED = 2, 954 955 /** 956 * Indicate that the display content is in the opposite direction of the landscape mode. 957 * 958 * @syscap SystemCapability.WindowManager.WindowManager.Core 959 * @crossplatform 960 * @since 10 961 */ 962 /** 963 * Indicate that the display content is in the opposite direction of the landscape mode. 964 * 965 * @syscap SystemCapability.WindowManager.WindowManager.Core 966 * @crossplatform 967 * @atomicservice 968 * @since 12 969 */ 970 LANDSCAPE_INVERTED = 3 971 } 972 973 /** 974 * Fold Crease Region 975 * 976 * @interface FoldCreaseRegion 977 * @syscap SystemCapability.Window.SessionManager 978 * @since 10 979 */ 980 /** 981 * Fold Crease Region 982 * 983 * @interface FoldCreaseRegion 984 * @syscap SystemCapability.Window.SessionManager 985 * @atomicservice 986 * @since 12 987 */ 988 interface FoldCreaseRegion { 989 /** 990 * The display ID is used to identify the screen where the crease is located. 991 * 992 * @type { number } 993 * @readonly 994 * @syscap SystemCapability.Window.SessionManager 995 * @since 10 996 */ 997 /** 998 * The display ID is used to identify the screen where the crease is located. 999 * 1000 * @type { number } 1001 * @readonly 1002 * @syscap SystemCapability.Window.SessionManager 1003 * @atomicservice 1004 * @since 12 1005 */ 1006 readonly displayId: number; 1007 1008 /** 1009 * Crease Region. 1010 * 1011 * @type { Array<Rect> } 1012 * @readonly 1013 * @syscap SystemCapability.Window.SessionManager 1014 * @since 10 1015 */ 1016 /** 1017 * Crease Region. 1018 * 1019 * @type { Array<Rect> } 1020 * @readonly 1021 * @syscap SystemCapability.Window.SessionManager 1022 * @atomicservice 1023 * @since 12 1024 */ 1025 readonly creaseRects: Array<Rect>; 1026 } 1027 1028 /** 1029 * Rectangle 1030 * 1031 * @interface Rect 1032 * @syscap SystemCapability.WindowManager.WindowManager.Core 1033 * @since 9 1034 */ 1035 /** 1036 * Rectangle 1037 * 1038 * @interface Rect 1039 * @syscap SystemCapability.WindowManager.WindowManager.Core 1040 * @atomicservice 1041 * @since 12 1042 */ 1043 interface Rect { 1044 /** 1045 * The X-axis coordinate of the upper left vertex of the rectangle, in pixels. 1046 * 1047 * @type { number } 1048 * @syscap SystemCapability.WindowManager.WindowManager.Core 1049 * @since 9 1050 */ 1051 /** 1052 * The X-axis coordinate of the upper left vertex of the rectangle, in pixels. 1053 * 1054 * @type { number } 1055 * @syscap SystemCapability.WindowManager.WindowManager.Core 1056 * @atomicservice 1057 * @since 12 1058 */ 1059 left: number; 1060 1061 /** 1062 * The Y-axis coordinate of the upper left vertex of the rectangle, in pixels. 1063 * 1064 * @type { number } 1065 * @syscap SystemCapability.WindowManager.WindowManager.Core 1066 * @since 9 1067 */ 1068 /** 1069 * The Y-axis coordinate of the upper left vertex of the rectangle, in pixels. 1070 * 1071 * @type { number } 1072 * @syscap SystemCapability.WindowManager.WindowManager.Core 1073 * @atomicservice 1074 * @since 12 1075 */ 1076 top: number; 1077 1078 /** 1079 * Width of the rectangle, in pixels. 1080 * 1081 * @type { number } 1082 * @syscap SystemCapability.WindowManager.WindowManager.Core 1083 * @since 9 1084 */ 1085 /** 1086 * Width of the rectangle, in pixels. 1087 * 1088 * @type { number } 1089 * @syscap SystemCapability.WindowManager.WindowManager.Core 1090 * @atomicservice 1091 * @since 12 1092 */ 1093 width: number; 1094 1095 /** 1096 * Height of the rectangle, in pixels. 1097 * 1098 * @type { number } 1099 * @syscap SystemCapability.WindowManager.WindowManager.Core 1100 * @since 9 1101 */ 1102 /** 1103 * Height of the rectangle, in pixels. 1104 * 1105 * @type { number } 1106 * @syscap SystemCapability.WindowManager.WindowManager.Core 1107 * @atomicservice 1108 * @since 12 1109 */ 1110 height: number; 1111 } 1112 1113 /** 1114 * Curved area rects of the waterfall display. 1115 * 1116 * @interface WaterfallDisplayAreaRects 1117 * @syscap SystemCapability.WindowManager.WindowManager.Core 1118 * @since 9 1119 */ 1120 /** 1121 * Curved area rects of the waterfall display. 1122 * 1123 * @interface WaterfallDisplayAreaRects 1124 * @syscap SystemCapability.WindowManager.WindowManager.Core 1125 * @atomicservice 1126 * @since 12 1127 */ 1128 interface WaterfallDisplayAreaRects { 1129 /** 1130 * Indicates the size of left side curved area of the waterfall screen. 1131 * 1132 * @type { Rect } 1133 * @readonly 1134 * @syscap SystemCapability.WindowManager.WindowManager.Core 1135 * @since 9 1136 */ 1137 /** 1138 * Indicates the size of left side curved area of the waterfall screen. 1139 * 1140 * @type { Rect } 1141 * @readonly 1142 * @syscap SystemCapability.WindowManager.WindowManager.Core 1143 * @atomicservice 1144 * @since 12 1145 */ 1146 readonly left: Rect; 1147 1148 /** 1149 * Indicates the size of right side curved area of the waterfall screen. 1150 * 1151 * @type { Rect } 1152 * @readonly 1153 * @syscap SystemCapability.WindowManager.WindowManager.Core 1154 * @since 9 1155 */ 1156 /** 1157 * Indicates the size of right side curved area of the waterfall screen. 1158 * 1159 * @type { Rect } 1160 * @readonly 1161 * @syscap SystemCapability.WindowManager.WindowManager.Core 1162 * @atomicservice 1163 * @since 12 1164 */ 1165 readonly right: Rect; 1166 1167 /** 1168 * Indicates the size of top side curved area of the waterfall screen. 1169 * 1170 * @type { Rect } 1171 * @readonly 1172 * @syscap SystemCapability.WindowManager.WindowManager.Core 1173 * @since 9 1174 */ 1175 /** 1176 * Indicates the size of top side curved area of the waterfall screen. 1177 * 1178 * @type { Rect } 1179 * @readonly 1180 * @syscap SystemCapability.WindowManager.WindowManager.Core 1181 * @atomicservice 1182 * @since 12 1183 */ 1184 readonly top: Rect; 1185 1186 /** 1187 * Indicates the size of bottom side curved area of the waterfall screen. 1188 * 1189 * @type { Rect } 1190 * @readonly 1191 * @syscap SystemCapability.WindowManager.WindowManager.Core 1192 * @since 9 1193 */ 1194 /** 1195 * Indicates the size of bottom side curved area of the waterfall screen. 1196 * 1197 * @type { Rect } 1198 * @readonly 1199 * @syscap SystemCapability.WindowManager.WindowManager.Core 1200 * @atomicservice 1201 * @since 12 1202 */ 1203 readonly bottom: Rect; 1204 } 1205 1206 /** 1207 * Cutout information of the display. 1208 * 1209 * @interface CutoutInfo 1210 * @syscap SystemCapability.WindowManager.WindowManager.Core 1211 * @since 9 1212 */ 1213 /** 1214 * Cutout information of the display. 1215 * 1216 * @interface CutoutInfo 1217 * @syscap SystemCapability.WindowManager.WindowManager.Core 1218 * @atomicservice 1219 * @since 12 1220 */ 1221 interface CutoutInfo { 1222 /** 1223 * Bounding rectangles of the cutout areas of the display. 1224 * 1225 * @type { Array<Rect> } 1226 * @readonly 1227 * @syscap SystemCapability.WindowManager.WindowManager.Core 1228 * @since 9 1229 */ 1230 /** 1231 * Bounding rectangles of the cutout areas of the display. 1232 * 1233 * @type { Array<Rect> } 1234 * @readonly 1235 * @syscap SystemCapability.WindowManager.WindowManager.Core 1236 * @atomicservice 1237 * @since 12 1238 */ 1239 readonly boundingRects: Array<Rect>; 1240 1241 /** 1242 * Rectangles of curved parts on each side of a waterfall display. 1243 * 1244 * @type { WaterfallDisplayAreaRects } 1245 * @readonly 1246 * @syscap SystemCapability.WindowManager.WindowManager.Core 1247 * @since 9 1248 */ 1249 /** 1250 * Rectangles of curved parts on each side of a waterfall display. 1251 * 1252 * @type { WaterfallDisplayAreaRects } 1253 * @readonly 1254 * @syscap SystemCapability.WindowManager.WindowManager.Core 1255 * @atomicservice 1256 * @since 12 1257 */ 1258 readonly waterfallDisplayAreaRects: WaterfallDisplayAreaRects; 1259 } 1260 1261 /** 1262 * Define display physical resolution. 1263 * 1264 * @interface DisplayPhysicalResolution 1265 * @syscap SystemCapability.WindowManager.WindowManager.Core 1266 * @crossplatform 1267 * @atomicservice 1268 * @since 12 1269 */ 1270 interface DisplayPhysicalResolution { 1271 /** 1272 * fold display mode. 1273 * 1274 * @type { FoldDisplayMode } 1275 * @syscap SystemCapability.WindowManager.WindowManager.Core 1276 * @atomicservice 1277 * @since 12 1278 */ 1279 foldDisplayMode: FoldDisplayMode; 1280 1281 /** 1282 * Display physical width, in pixels. 1283 * 1284 * @type { number } 1285 * @syscap SystemCapability.WindowManager.WindowManager.Core 1286 * @crossplatform 1287 * @atomicservice 1288 * @since 12 1289 */ 1290 physicalWidth: number; 1291 1292 /** 1293 * Display physical height, in pixels. 1294 * 1295 * @type { number } 1296 * @syscap SystemCapability.WindowManager.WindowManager.Core 1297 * @crossplatform 1298 * @atomicservice 1299 * @since 12 1300 */ 1301 physicalHeight: number; 1302 } 1303 1304 /** 1305 * Define properties of the display. They cannot be updated automatically. 1306 * 1307 * @interface Display 1308 * @syscap SystemCapability.WindowManager.WindowManager.Core 1309 * @since 7 1310 */ 1311 /** 1312 * Define properties of the display. They cannot be updated automatically. 1313 * 1314 * @interface Display 1315 * @syscap SystemCapability.WindowManager.WindowManager.Core 1316 * @crossplatform 1317 * @since 10 1318 */ 1319 /** 1320 * Define properties of the display. They cannot be updated automatically. 1321 * 1322 * @interface Display 1323 * @syscap SystemCapability.WindowManager.WindowManager.Core 1324 * @crossplatform 1325 * @atomicservice 1326 * @since 11 1327 */ 1328 interface Display { 1329 /** 1330 * Display ID. 1331 * 1332 * @type { number } 1333 * @syscap SystemCapability.WindowManager.WindowManager.Core 1334 * @since 7 1335 */ 1336 /** 1337 * Display ID. 1338 * 1339 * @type { number } 1340 * @syscap SystemCapability.WindowManager.WindowManager.Core 1341 * @crossplatform 1342 * @since 10 1343 */ 1344 /** 1345 * Display ID. 1346 * 1347 * @type { number } 1348 * @syscap SystemCapability.WindowManager.WindowManager.Core 1349 * @crossplatform 1350 * @atomicservice 1351 * @since 12 1352 */ 1353 id: number; 1354 1355 /** 1356 * Display name. 1357 * 1358 * @type { string } 1359 * @syscap SystemCapability.WindowManager.WindowManager.Core 1360 * @since 7 1361 */ 1362 /** 1363 * Display name. 1364 * 1365 * @type { string } 1366 * @syscap SystemCapability.WindowManager.WindowManager.Core 1367 * @atomicservice 1368 * @since 12 1369 */ 1370 name: string; 1371 1372 /** 1373 * The display is alive. 1374 * 1375 * @type { boolean } 1376 * @syscap SystemCapability.WindowManager.WindowManager.Core 1377 * @since 7 1378 */ 1379 /** 1380 * The display is alive. 1381 * 1382 * @type { boolean } 1383 * @syscap SystemCapability.WindowManager.WindowManager.Core 1384 * @atomicservice 1385 * @since 12 1386 */ 1387 alive: boolean; 1388 1389 /** 1390 * The state of display. 1391 * 1392 * @type { DisplayState } 1393 * @syscap SystemCapability.WindowManager.WindowManager.Core 1394 * @since 7 1395 */ 1396 /** 1397 * The state of display. 1398 * 1399 * @type { DisplayState } 1400 * @syscap SystemCapability.WindowManager.WindowManager.Core 1401 * @atomicservice 1402 * @since 12 1403 */ 1404 state: DisplayState; 1405 1406 /** 1407 * Refresh rate, in Hz. 1408 * 1409 * @type { number } 1410 * @syscap SystemCapability.WindowManager.WindowManager.Core 1411 * @since 7 1412 */ 1413 /** 1414 * Refresh rate, in Hz. 1415 * 1416 * @type { number } 1417 * @syscap SystemCapability.WindowManager.WindowManager.Core 1418 * @atomicservice 1419 * @since 12 1420 */ 1421 refreshRate: number; 1422 1423 /** 1424 * Rotation degrees of the display. 1425 * 1426 * @type { number } 1427 * @syscap SystemCapability.WindowManager.WindowManager.Core 1428 * @since 7 1429 */ 1430 /** 1431 * An enumeration value for rotation degrees of the display. 1432 * The value 0 indicates that the screen of the display rotates clockwise by 0°. 1433 * The value 1 indicates that the screen of the display rotates clockwise by 90°. 1434 * The value 2 indicates that the screen of the display rotates clockwise by 180°. 1435 * The value 3 indicates that the screen of the display rotates clockwise by 270°. 1436 * 1437 * @type { number } 1438 * @syscap SystemCapability.WindowManager.WindowManager.Core 1439 * @atomicservice 1440 * @since 11 1441 */ 1442 rotation: number; 1443 1444 /** 1445 * Display width, in pixels. 1446 * 1447 * @type { number } 1448 * @syscap SystemCapability.WindowManager.WindowManager.Core 1449 * @since 7 1450 */ 1451 /** 1452 * Display width, in pixels. 1453 * 1454 * @type { number } 1455 * @syscap SystemCapability.WindowManager.WindowManager.Core 1456 * @crossplatform 1457 * @since 10 1458 */ 1459 /** 1460 * Display width, in pixels. 1461 * 1462 * @type { number } 1463 * @syscap SystemCapability.WindowManager.WindowManager.Core 1464 * @crossplatform 1465 * @atomicservice 1466 * @since 11 1467 */ 1468 width: number; 1469 1470 /** 1471 * Display height, in pixels. 1472 * 1473 * @type { number } 1474 * @syscap SystemCapability.WindowManager.WindowManager.Core 1475 * @since 7 1476 */ 1477 /** 1478 * Display height, in pixels. 1479 * 1480 * @type { number } 1481 * @syscap SystemCapability.WindowManager.WindowManager.Core 1482 * @crossplatform 1483 * @since 10 1484 */ 1485 /** 1486 * Display height, in pixels. 1487 * 1488 * @type { number } 1489 * @syscap SystemCapability.WindowManager.WindowManager.Core 1490 * @crossplatform 1491 * @atomicservice 1492 * @since 11 1493 */ 1494 height: number; 1495 1496 /** 1497 * Display available width, in pixels. 1498 * 1499 * @type { number } 1500 * @syscap SystemCapability.WindowManager.WindowManager.Core 1501 * @crossplatform 1502 * @atomicservice 1503 * @since 12 1504 */ 1505 availableWidth: number; 1506 1507 /** 1508 * Display available height, in pixels. 1509 * 1510 * @type { number } 1511 * @syscap SystemCapability.WindowManager.WindowManager.Core 1512 * @crossplatform 1513 * @atomicservice 1514 * @since 12 1515 */ 1516 availableHeight: number; 1517 1518 /** 1519 * Display resolution. 1520 * 1521 * @type { number } 1522 * @syscap SystemCapability.WindowManager.WindowManager.Core 1523 * @since 7 1524 */ 1525 /** 1526 * Display resolution. 1527 * 1528 * @type { number } 1529 * @syscap SystemCapability.WindowManager.WindowManager.Core 1530 * @crossplatform 1531 * @since 11 1532 */ 1533 /** 1534 * Display resolution. 1535 * 1536 * @type { number } 1537 * @syscap SystemCapability.WindowManager.WindowManager.Core 1538 * @crossplatform 1539 * @atomicservice 1540 * @since 12 1541 */ 1542 densityDPI: number; 1543 1544 /** 1545 * Display orientation. 1546 * 1547 * @type { Orientation } 1548 * @syscap SystemCapability.WindowManager.WindowManager.Core 1549 * @crossplatform 1550 * @since 10 1551 */ 1552 /** 1553 * Display orientation. 1554 * 1555 * @type { Orientation } 1556 * @syscap SystemCapability.WindowManager.WindowManager.Core 1557 * @crossplatform 1558 * @atomicservice 1559 * @since 12 1560 */ 1561 orientation: Orientation; 1562 1563 /** 1564 * Display density, in pixels. The value for a low-resolution display is 1.0. 1565 * 1566 * @type { number } 1567 * @syscap SystemCapability.WindowManager.WindowManager.Core 1568 * @since 7 1569 */ 1570 /** 1571 * Display density, in pixels. The value for a low-resolution display is 1.0. 1572 * 1573 * @type { number } 1574 * @syscap SystemCapability.WindowManager.WindowManager.Core 1575 * @crossplatform 1576 * @atomicservice 1577 * @since 11 1578 */ 1579 densityPixels: number; 1580 1581 /** 1582 * Text scale density of the display. 1583 * 1584 * @type { number } 1585 * @syscap SystemCapability.WindowManager.WindowManager.Core 1586 * @since 7 1587 */ 1588 /** 1589 * Text scale density of the display. 1590 * 1591 * @type { number } 1592 * @syscap SystemCapability.WindowManager.WindowManager.Core 1593 * @crossplatform 1594 * @since 11 1595 */ 1596 /** 1597 * Text scale density of the display. 1598 * 1599 * @type { number } 1600 * @syscap SystemCapability.WindowManager.WindowManager.Core 1601 * @crossplatform 1602 * @atomicservice 1603 * @since 12 1604 */ 1605 scaledDensity: number; 1606 1607 /** 1608 * DPI on the x-axis. 1609 * 1610 * @type { number } 1611 * @syscap SystemCapability.WindowManager.WindowManager.Core 1612 * @since 7 1613 */ 1614 /** 1615 * DPI on the x-axis. 1616 * 1617 * @type { number } 1618 * @syscap SystemCapability.WindowManager.WindowManager.Core 1619 * @atomicservice 1620 * @since 12 1621 */ 1622 xDPI: number; 1623 1624 /** 1625 * DPI on the y-axis. 1626 * 1627 * @type { number } 1628 * @syscap SystemCapability.WindowManager.WindowManager.Core 1629 * @since 7 1630 */ 1631 /** 1632 * DPI on the y-axis. 1633 * 1634 * @type { number } 1635 * @syscap SystemCapability.WindowManager.WindowManager.Core 1636 * @atomicservice 1637 * @since 12 1638 */ 1639 yDPI: number; 1640 1641 /** 1642 * All supported color spaces. 1643 * 1644 * @type { Array<colorSpaceManager.ColorSpace> } 1645 * @syscap SystemCapability.WindowManager.WindowManager.Core 1646 * @since 11 1647 */ 1648 /** 1649 * All supported color spaces. 1650 * 1651 * @type { Array<colorSpaceManager.ColorSpace> } 1652 * @syscap SystemCapability.WindowManager.WindowManager.Core 1653 * @atomicservice 1654 * @since 12 1655 */ 1656 colorSpaces: Array<colorSpaceManager.ColorSpace>; 1657 1658 /** 1659 * All supported HDR formats. 1660 * 1661 * @type { Array<hdrCapability.HDRFormat> } 1662 * @syscap SystemCapability.WindowManager.WindowManager.Core 1663 * @since 11 1664 */ 1665 /** 1666 * All supported HDR formats. 1667 * 1668 * @type { Array<hdrCapability.HDRFormat> } 1669 * @syscap SystemCapability.WindowManager.WindowManager.Core 1670 * @atomicservice 1671 * @since 12 1672 */ 1673 hdrFormats: Array<hdrCapability.HDRFormat>; 1674 1675 /** 1676 * Obtain the cutout info of the display. 1677 * 1678 * @param { AsyncCallback<CutoutInfo> } callback 1679 * @throws { BusinessError } 1400001 - Invalid display or screen. 1680 * @syscap SystemCapability.WindowManager.WindowManager.Core 1681 * @since 9 1682 */ 1683 /** 1684 * Obtain the cutout info of the display. 1685 * 1686 * @param { AsyncCallback<CutoutInfo> } callback 1687 * @throws { BusinessError } 1400001 - Invalid display or screen. 1688 * @syscap SystemCapability.WindowManager.WindowManager.Core 1689 * @atomicservice 1690 * @since 12 1691 */ 1692 getCutoutInfo(callback: AsyncCallback<CutoutInfo>): void; 1693 1694 /** 1695 * Obtain the cutout info of the display. 1696 * 1697 * @returns { Promise<CutoutInfo> } 1698 * @throws { BusinessError } 1400001 - Invalid display or screen. 1699 * @syscap SystemCapability.WindowManager.WindowManager.Core 1700 * @since 9 1701 */ 1702 /** 1703 * Obtain the cutout info of the display. 1704 * 1705 * @returns { Promise<CutoutInfo> } 1706 * @throws { BusinessError } 1400001 - Invalid display or screen. 1707 * @syscap SystemCapability.WindowManager.WindowManager.Core 1708 * @atomicservice 1709 * @since 12 1710 */ 1711 getCutoutInfo(): Promise<CutoutInfo>; 1712 1713 /** 1714 * Check if current display has immersive window. 1715 * 1716 * @param { AsyncCallback<boolean> } callback 1717 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1718 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 1719 * @throws { BusinessError } 1400001 - Invalid display or screen. 1720 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 1721 * @syscap SystemCapability.Window.SessionManager 1722 * @systemapi Hide this for inner system use. 1723 * @since 11 1724 */ 1725 hasImmersiveWindow(callback: AsyncCallback<boolean>): void; 1726 1727 /** 1728 * Check if current display has immersive window. 1729 * 1730 * @returns { Promise<boolean> } 1731 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1732 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 1733 * @throws { BusinessError } 1400001 - Invalid display or screen. 1734 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 1735 * @syscap SystemCapability.Window.SessionManager 1736 * @systemapi Hide this for inner system use. 1737 * @since 11 1738 */ 1739 hasImmersiveWindow(): Promise<boolean>; 1740 1741 /** 1742 * Obtain the available area of the display. 1743 * 1744 * @returns { Promise<Rect> } 1745 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 1746 * @throws { BusinessError } 1400001 - Invalid display or screen. 1747 * @syscap SystemCapability.Window.SessionManager 1748 * @atomicservice 1749 * @since 12 1750 */ 1751 getAvailableArea(): Promise<Rect>; 1752 1753 /** 1754 * Register the callback for available area changes. 1755 * 1756 * @param { 'availableAreaChange' } type - the event of available area changes 1757 * @param { Callback<Rect> } callback - Callback used to return the available area 1758 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1759 * <br>2. Incorrect parameter types. 1760 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 1761 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 1762 * @syscap SystemCapability.Window.SessionManager 1763 * @atomicservice 1764 * @since 12 1765 */ 1766 on(type: 'availableAreaChange', callback: Callback<Rect>): void; 1767 1768 /** 1769 * Unregister the callback for available area changes. 1770 * 1771 * @param { 'availableAreaChange' } type - the event of available area changes 1772 * @param { Callback<Rect> } [callback] - Callback used to return the available area 1773 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1774 * <br>2. Incorrect parameter types. 1775 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 1776 * @throws { BusinessError } 1400003 - This display manager service works abnormally. 1777 * @syscap SystemCapability.Window.SessionManager 1778 * @atomicservice 1779 * @since 12 1780 */ 1781 off(type: 'availableAreaChange', callback?: Callback<Rect>): void; 1782 } 1783} 1784 1785export default display;