2022-04-11 08:39:47 +00:00
|
|
|
/*
|
2023-05-17 06:03:24 +00:00
|
|
|
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2022-04-11 08:39:47 +00:00
|
|
|
|
2023-04-04 02:17:06 +00:00
|
|
|
import { AsyncCallback, Callback } from './@ohos.base';
|
2022-04-11 08:39:47 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Interface of screen manager
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @namespace screen
|
2022-04-11 08:39:47 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
declare namespace screen {
|
|
|
|
/**
|
2023-05-17 06:03:24 +00:00
|
|
|
* Get all screen instances, then can get or set detail information.
|
|
|
|
*
|
|
|
|
* @param { AsyncCallback<Array<Screen>> } callback the callback of all screens info
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function getAllScreens(callback: AsyncCallback<Array<Screen>>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all screen instances, then can get or set detail information.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Array<Screen>> } the result of all screens info
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-04-11 08:39:47 +00:00
|
|
|
function getAllScreens(): Promise<Array<Screen>>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the callback for screen changes.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes
|
|
|
|
* @param { Callback<number> } callback Callback used to return the screen ID
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback<number>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregister the callback for screen changes.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes
|
|
|
|
* @param { Callback<number> } callback Callback used to return the screen ID
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback<number>): void;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Make screens as expand-screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { Array<ExpandOption> } options Parameters for expanding the screen
|
|
|
|
* @param { AsyncCallback<number> } callback callback used to return the group ID of the expanded screens
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function makeExpand(options: Array<ExpandOption>, callback: AsyncCallback<number>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Make screens as expand-screen
|
|
|
|
*
|
|
|
|
* @param { Array<ExpandOption> } options Parameters for expanding the screen
|
|
|
|
* @returns { Promise<number> } used to return the group ID of the expanded screens
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function makeExpand(options: Array<ExpandOption>): Promise<number>;
|
2022-04-11 08:39:47 +00:00
|
|
|
|
2023-04-26 09:50:36 +00:00
|
|
|
/**
|
|
|
|
* Stop expand screens
|
|
|
|
*
|
|
|
|
* @param { Array<number> } expandScreen IDs of expand screens to stop
|
|
|
|
* @param { AsyncCallback<number> } callback used to return the result
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-04-26 09:50:36 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function stopExpand(expandScreen: Array<number>, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stop expand screens
|
|
|
|
*
|
|
|
|
* @param { Array<number> } expandScreen IDs of expand screens to stop
|
|
|
|
* @returns { Promise<void> } promise used to return the result
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-04-26 09:50:36 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function stopExpand(expandScreen: Array<number>): Promise<void>;
|
|
|
|
|
2022-04-11 08:39:47 +00:00
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Make screens as mirror-screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { number } mainScreen ID of the primary screen
|
|
|
|
* @param { Array<number> } mirrorScreen IDs of secondary screens
|
|
|
|
* @param { AsyncCallback<number> } callback Callback used to return the group ID of the secondary screens
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function makeMirror(mainScreen: number, mirrorScreen: Array<number>, callback: AsyncCallback<number>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Make screens as mirror-screen
|
|
|
|
*
|
|
|
|
* @param { number } mainScreen ID of the primary screen
|
|
|
|
* @param { Array<number> } mirrorScreen IDs of secondary screens
|
|
|
|
* @returns { Promise<number> } Promise used to return the group ID of the secondary screens
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function makeMirror(mainScreen: number, mirrorScreen: Array<number>): Promise<number>;
|
2022-04-11 08:39:47 +00:00
|
|
|
|
2023-04-26 09:50:36 +00:00
|
|
|
/**
|
|
|
|
* Stop mirror screens
|
|
|
|
*
|
|
|
|
* @param { Array<number> } mirrorScreen IDs of mirror screens to stop
|
|
|
|
* @param { AsyncCallback<void> } callback used to return the result
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-04-26 09:50:36 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function stopMirror(mirrorScreen: Array<number>, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stop mirror screens
|
|
|
|
*
|
|
|
|
* @param { Array<number> } mirrorScreen IDs of mirror screens to stop
|
|
|
|
* @returns { Promise<void> } promise used to return the result
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-04-26 09:50:36 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function stopMirror(mirrorScreen: Array<number>): Promise<void>;
|
|
|
|
|
2022-05-18 14:54:23 +00:00
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Create virtual screen. if surfaceId is valid, this permission is necessary.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
2022-08-17 08:21:21 +00:00
|
|
|
* @permission ohos.permission.CAPTURE_SCREEN
|
2023-05-17 06:03:24 +00:00
|
|
|
* @param { VirtualScreenOption } options Indicates the options of the virtual screen.
|
|
|
|
* @param { AsyncCallback<Screen> } callback Callback used to return the created virtual screen
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission verification failed.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-05-18 14:54:23 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function createVirtualScreen(options: VirtualScreenOption, callback: AsyncCallback<Screen>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create virtual screen. if surfaceId is valid, this permission is necessary.
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.CAPTURE_SCREEN
|
|
|
|
* @param { VirtualScreenOption } options Indicates the options of the virtual screen.
|
|
|
|
* @returns { Promise<Screen> } Promise used to return the created virtual screen
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission verification failed.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function createVirtualScreen(options: VirtualScreenOption): Promise<Screen>;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { number } screenId Indicates the screen id of the virtual screen.
|
|
|
|
* @param { AsyncCallback<void> } callback Callback used to return the result.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400002 - Unauthorized operation.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-05-18 14:54:23 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function destroyVirtualScreen(screenId: number, callback: AsyncCallback<void>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy virtual screen.
|
|
|
|
*
|
|
|
|
* @param { number } screenId Indicates the screen id of the virtual screen.
|
|
|
|
* @returns { Promise<void> } Promise that returns no value.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400002 - Unauthorized operation.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function destroyVirtualScreen(screenId: number): Promise<void>;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set surface for the virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
2022-07-14 07:16:01 +00:00
|
|
|
* @permission ohos.permission.CAPTURE_SCREEN
|
2023-05-17 06:03:24 +00:00
|
|
|
* @param { number } screenId Indicates the screen id of the virtual screen.
|
|
|
|
* @param { string } surfaceId Indicates the surface id.
|
|
|
|
* @param { AsyncCallback<void> } callback Callback used to return the result
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission verification failed.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-05-18 14:54:23 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function setVirtualScreenSurface(screenId: number, surfaceId: string, callback: AsyncCallback<void>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set surface for the virtual screen.
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.CAPTURE_SCREEN
|
|
|
|
* @param { number } screenId Indicates the screen id of the virtual screen.
|
|
|
|
* @param { string } surfaceId Indicates the surface id.
|
|
|
|
* @returns { Promise<void> } Promise that returns no value
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission verification failed.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400001 - Invalid display or screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function setVirtualScreenSurface(screenId: number, surfaceId: string): Promise<void>;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
2022-06-24 06:32:13 +00:00
|
|
|
/**
|
|
|
|
* Get screen rotation lock status.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { AsyncCallback<boolean> } callback If true, auto rotate is locked. If false, auto rotate is unlocked
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-06-24 06:32:13 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function isScreenRotationLocked(callback: AsyncCallback<boolean>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get screen rotation lock status.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } If true, auto rotate is locked. If false, auto rotate is unlocked
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-06-24 06:32:13 +00:00
|
|
|
function isScreenRotationLocked(): Promise<boolean>;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2022-06-24 06:32:13 +00:00
|
|
|
/**
|
|
|
|
* Set screen rotation lock status.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } isLocked Indicates whether the screen rotation switch is locked.
|
|
|
|
* @param { AsyncCallback<void> } callback Callback used to return the result.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-06-24 06:32:13 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function setScreenRotationLocked(isLocked: boolean, callback: AsyncCallback<void>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set screen rotation lock status.
|
|
|
|
*
|
|
|
|
* @param { boolean } isLocked Indicates whether the screen rotation switch is locked.
|
|
|
|
* @returns { Promise<void> } Promise that returns no value.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
function setScreenRotationLocked(isLocked: boolean): Promise<void>;
|
2022-06-24 06:32:13 +00:00
|
|
|
|
2022-04-11 08:39:47 +00:00
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* The parameter of making expand screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @interface ExpandOption
|
2022-04-11 08:39:47 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
2023-05-17 06:03:24 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
interface ExpandOption {
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Screen id
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
screenId: number;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* The start coordinate X of the screen origin
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
startX: number;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* The start coordinate Y of the screen origin
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
startY: number;
|
|
|
|
}
|
|
|
|
|
2022-05-18 14:54:23 +00:00
|
|
|
/**
|
|
|
|
* The parameter for creating virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @interface VirtualScreenOption
|
2022-05-18 14:54:23 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
2023-05-17 06:03:24 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-05-18 14:54:23 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
interface VirtualScreenOption {
|
|
|
|
/**
|
|
|
|
* Indicates the name of the virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-05-18 14:54:23 +00:00
|
|
|
*/
|
2023-05-17 06:03:24 +00:00
|
|
|
name: string;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the width of the virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-05-18 14:54:23 +00:00
|
|
|
*/
|
2023-05-17 06:03:24 +00:00
|
|
|
width: number;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the height of the virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-05-18 14:54:23 +00:00
|
|
|
*/
|
2023-05-17 06:03:24 +00:00
|
|
|
height: number;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the density of the virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-05-18 14:54:23 +00:00
|
|
|
*/
|
2023-05-17 06:03:24 +00:00
|
|
|
density: number;
|
2022-05-18 14:54:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the surface id of the virtual screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-05-18 14:54:23 +00:00
|
|
|
*/
|
2023-05-17 06:03:24 +00:00
|
|
|
surfaceId: string;
|
2022-05-18 14:54:23 +00:00
|
|
|
}
|
|
|
|
|
2023-01-16 09:05:39 +00:00
|
|
|
/**
|
|
|
|
* Indicate the source mode of the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2023-01-16 09:05:39 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum ScreenSourceMode {
|
|
|
|
/**
|
|
|
|
* Indicate that the screen is the default screen.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-01-16 09:05:39 +00:00
|
|
|
*/
|
|
|
|
SCREEN_MAIN = 0,
|
|
|
|
|
|
|
|
/**
|
2023-05-17 06:03:24 +00:00
|
|
|
* Indicate that the screen is in mirror mode.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-01-16 09:05:39 +00:00
|
|
|
*/
|
|
|
|
SCREEN_MIRROR = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicate that the screen is in extend mode.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-01-16 09:05:39 +00:00
|
|
|
*/
|
|
|
|
SCREEN_EXTEND = 2,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicate that the screen stands alone.
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-01-16 09:05:39 +00:00
|
|
|
*/
|
2023-05-17 06:03:24 +00:00
|
|
|
SCREEN_ALONE = 3
|
2023-01-16 09:05:39 +00:00
|
|
|
}
|
|
|
|
|
2022-04-11 08:39:47 +00:00
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Interface for screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @interface Screen
|
2022-04-11 08:39:47 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
2023-05-17 06:03:24 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
interface Screen {
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Screen id
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
readonly id: number;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Group id
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
readonly parent: number;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Mode supported by the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
readonly supportedModeInfo: Array<ScreenModeInfo>;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Currently active mode
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
readonly activeModeIndex: number;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Orientation of the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
readonly orientation: Orientation;
|
|
|
|
|
2023-01-16 09:05:39 +00:00
|
|
|
/**
|
|
|
|
* Source mode of the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2023-01-16 09:05:39 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly sourceMode: ScreenSourceMode;
|
|
|
|
|
2022-04-11 08:39:47 +00:00
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Set the orientation of the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { Orientation } orientation Screen orientation.
|
|
|
|
* @param { AsyncCallback<void> } callback Callback used to return the result.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
setOrientation(orientation: Orientation, callback: AsyncCallback<void>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the orientation of the screen
|
|
|
|
*
|
|
|
|
* @param { Orientation } orientation Screen orientation.
|
|
|
|
* @returns { Promise<void> } Promise that returns no value.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-04-11 08:39:47 +00:00
|
|
|
setOrientation(orientation: Orientation): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Active the mode
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { number } modeIndex Index of the mode to set.
|
|
|
|
* @param { AsyncCallback<void> } callback Callback used to return the result.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-04-11 08:39:47 +00:00
|
|
|
*/
|
|
|
|
setScreenActiveMode(modeIndex: number, callback: AsyncCallback<void>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Active the mode
|
|
|
|
*
|
|
|
|
* @param { number } modeIndex Index of the mode to set.
|
|
|
|
* @returns { Promise<void> } Promise that returns no value.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-04-11 08:39:47 +00:00
|
|
|
setScreenActiveMode(modeIndex: number): Promise<void>;
|
2022-05-17 11:02:23 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Set display density of the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @param { number } densityDpi Pixel density. The value ranges from 80 to 640.
|
|
|
|
* @param { AsyncCallback<void> } callback Callback used to return the result.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
2022-05-17 11:02:23 +00:00
|
|
|
*/
|
|
|
|
setDensityDpi(densityDpi: number, callback: AsyncCallback<void>): void;
|
2023-05-17 06:03:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set display density of the screen
|
|
|
|
*
|
|
|
|
* @param { number } densityDpi Pixel density. The value ranges from 80 to 640.
|
|
|
|
* @returns { Promise<void> } Promise that returns no value.
|
2023-05-23 13:02:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
|
2023-05-17 06:03:24 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-05-17 11:02:23 +00:00
|
|
|
setDensityDpi(densityDpi: number): Promise<void>;
|
2022-04-11 08:39:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-08-17 08:21:21 +00:00
|
|
|
* Screen orientation
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
2022-04-11 08:39:47 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
2023-05-17 06:03:24 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
enum Orientation {
|
|
|
|
UNSPECIFIED = 0,
|
|
|
|
VERTICAL = 1,
|
|
|
|
HORIZONTAL = 2,
|
|
|
|
REVERSE_VERTICAL = 3,
|
2023-05-17 06:03:24 +00:00
|
|
|
REVERSE_HORIZONTAL = 4
|
2022-04-11 08:39:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-11-24 02:08:04 +00:00
|
|
|
* The information of the screen
|
2023-05-17 06:03:24 +00:00
|
|
|
*
|
|
|
|
* @interface ScreenModeInfo
|
2022-04-11 08:39:47 +00:00
|
|
|
* @syscap SystemCapability.WindowManager.WindowManager.Core
|
2023-05-17 06:03:24 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-04-11 08:39:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
interface ScreenModeInfo {
|
|
|
|
id: number;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
refreshRate: number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default screen;
|