161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit ArkUI 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Interface of screen manager 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @namespace screen 2761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 2861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 2961847f8eSopenharmony_ci * @since 9 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace screen { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Get all screen instances, then can get or set detail information. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @param { AsyncCallback<Array<Screen>> } callback the callback of all screens info 3661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 3761847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 3861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 3961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4061847f8eSopenharmony_ci * @since 9 4161847f8eSopenharmony_ci */ 4261847f8eSopenharmony_ci function getAllScreens(callback: AsyncCallback<Array<Screen>>): void; 4361847f8eSopenharmony_ci 4461847f8eSopenharmony_ci /** 4561847f8eSopenharmony_ci * Get all screen instances, then can get or set detail information. 4661847f8eSopenharmony_ci * 4761847f8eSopenharmony_ci * @returns { Promise<Array<Screen>> } the result of all screens info 4861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 4961847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 5061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 5161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 5261847f8eSopenharmony_ci * @since 9 5361847f8eSopenharmony_ci */ 5461847f8eSopenharmony_ci function getAllScreens(): Promise<Array<Screen>>; 5561847f8eSopenharmony_ci 5661847f8eSopenharmony_ci /** 5761847f8eSopenharmony_ci * Register the callback for screen changes. 5861847f8eSopenharmony_ci * 5961847f8eSopenharmony_ci * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string 6061847f8eSopenharmony_ci * type and cannot be empty. 6161847f8eSopenharmony_ci * @param { Callback<number> } callback Callback used to return the screen ID. This parameter is callable. 6261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 6461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 6561847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 6661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6761847f8eSopenharmony_ci * @since 9 6861847f8eSopenharmony_ci */ 6961847f8eSopenharmony_ci function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback<number>): void; 7061847f8eSopenharmony_ci 7161847f8eSopenharmony_ci /** 7261847f8eSopenharmony_ci * Unregister the callback for screen changes. 7361847f8eSopenharmony_ci * 7461847f8eSopenharmony_ci * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string 7561847f8eSopenharmony_ci * type and cannot be empty. 7661847f8eSopenharmony_ci * @param { Callback<number> } callback Callback used to return the screen ID. If this parameter is specified, it must 7761847f8eSopenharmony_ci * be a callback. 7861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 8061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 8161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 8261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 8361847f8eSopenharmony_ci * @since 9 8461847f8eSopenharmony_ci */ 8561847f8eSopenharmony_ci function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback<number>): void; 8661847f8eSopenharmony_ci 8761847f8eSopenharmony_ci /** 8861847f8eSopenharmony_ci * Make screens as expand-screen 8961847f8eSopenharmony_ci * 9061847f8eSopenharmony_ci * @param { Array<ExpandOption> } options Parameters for expanding the screen. The options must be valid, and make 9161847f8eSopenharmony_ci * sure it's type of Array<ExpandOption>. 9261847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback callback used to return the group ID of the expanded screens. It must 9361847f8eSopenharmony_ci * be a callback. 9461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 9561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 9661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 9761847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 9861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 9961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 10061847f8eSopenharmony_ci * @since 9 10161847f8eSopenharmony_ci */ 10261847f8eSopenharmony_ci function makeExpand(options: Array<ExpandOption>, callback: AsyncCallback<number>): void; 10361847f8eSopenharmony_ci 10461847f8eSopenharmony_ci /** 10561847f8eSopenharmony_ci * Make screens as expand-screen 10661847f8eSopenharmony_ci * 10761847f8eSopenharmony_ci * @param { Array<ExpandOption> } options Parameters for expanding the screen. The options must be valid, and make 10861847f8eSopenharmony_ci * sure it's type of Array<ExpandOption>. 10961847f8eSopenharmony_ci * @returns { Promise<number> } used to return the group ID of the expanded screens 11061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 11161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 11261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 11361847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 11461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 11561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 11661847f8eSopenharmony_ci * @since 9 11761847f8eSopenharmony_ci */ 11861847f8eSopenharmony_ci function makeExpand(options: Array<ExpandOption>): Promise<number>; 11961847f8eSopenharmony_ci 12061847f8eSopenharmony_ci /** 12161847f8eSopenharmony_ci * Stop expand screens 12261847f8eSopenharmony_ci * 12361847f8eSopenharmony_ci * @param { Array<number> } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not 12461847f8eSopenharmony_ci * exceed 1000. 12561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback used to return the result 12661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 12761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 12861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 12961847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 13061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 13161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 13261847f8eSopenharmony_ci * @since 10 13361847f8eSopenharmony_ci */ 13461847f8eSopenharmony_ci function stopExpand(expandScreen: Array<number>, callback: AsyncCallback<void>): void; 13561847f8eSopenharmony_ci 13661847f8eSopenharmony_ci /** 13761847f8eSopenharmony_ci * Stop expand screens 13861847f8eSopenharmony_ci * 13961847f8eSopenharmony_ci * @param { Array<number> } expandScreen IDs of expand screens to stop. The size of the expandScreen Array should not 14061847f8eSopenharmony_ci * exceed 1000. 14161847f8eSopenharmony_ci * @returns { Promise<void> } promise used to return the result 14261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 14361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 14461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 14561847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 14661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 14761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 14861847f8eSopenharmony_ci * @since 10 14961847f8eSopenharmony_ci */ 15061847f8eSopenharmony_ci function stopExpand(expandScreen: Array<number>): Promise<void>; 15161847f8eSopenharmony_ci 15261847f8eSopenharmony_ci /** 15361847f8eSopenharmony_ci * Make screens as mirror-screen 15461847f8eSopenharmony_ci * 15561847f8eSopenharmony_ci * @param { number } mainScreen ID of the primary screen. It's type should be int. 15661847f8eSopenharmony_ci * @param { Array<number> } mirrorScreen IDs of secondary screens 15761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback Callback used to return the group ID of the secondary screens 15861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 15961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 16061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 16161847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 16261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 16361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 16461847f8eSopenharmony_ci * @since 9 16561847f8eSopenharmony_ci */ 16661847f8eSopenharmony_ci function makeMirror(mainScreen: number, mirrorScreen: Array<number>, callback: AsyncCallback<number>): void; 16761847f8eSopenharmony_ci 16861847f8eSopenharmony_ci /** 16961847f8eSopenharmony_ci * Make screens as mirror-screen 17061847f8eSopenharmony_ci * 17161847f8eSopenharmony_ci * @param { number } mainScreen ID of the primary screen. It's type should be int. 17261847f8eSopenharmony_ci * @param { Array<number> } mirrorScreen IDs of secondary screens 17361847f8eSopenharmony_ci * @returns { Promise<number> } Promise used to return the group ID of the secondary screens 17461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 17561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 17661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 17761847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 17861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 17961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 18061847f8eSopenharmony_ci * @since 9 18161847f8eSopenharmony_ci */ 18261847f8eSopenharmony_ci function makeMirror(mainScreen: number, mirrorScreen: Array<number>): Promise<number>; 18361847f8eSopenharmony_ci 18461847f8eSopenharmony_ci /** 18561847f8eSopenharmony_ci * Stop mirror screens 18661847f8eSopenharmony_ci * 18761847f8eSopenharmony_ci * @param { Array<number> } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not 18861847f8eSopenharmony_ci * exceed 1000. 18961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback used to return the result 19061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 19161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 19261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 19361847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 19461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 19561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 19661847f8eSopenharmony_ci * @since 10 19761847f8eSopenharmony_ci */ 19861847f8eSopenharmony_ci function stopMirror(mirrorScreen: Array<number>, callback: AsyncCallback<void>): void; 19961847f8eSopenharmony_ci 20061847f8eSopenharmony_ci /** 20161847f8eSopenharmony_ci * Stop mirror screens 20261847f8eSopenharmony_ci * 20361847f8eSopenharmony_ci * @param { Array<number> } mirrorScreen IDs of mirror screens to stop. The size of the mirrorScreen Array should not 20461847f8eSopenharmony_ci * exceed 1000. 20561847f8eSopenharmony_ci * @returns { Promise<void> } promise used to return the result 20661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 20761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 20861847f8eSopenharmony_ci * 2. Incorrect parameter types. 3. Parameter verification failed. 20961847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 21061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 21161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 21261847f8eSopenharmony_ci * @since 10 21361847f8eSopenharmony_ci */ 21461847f8eSopenharmony_ci function stopMirror(mirrorScreen: Array<number>): Promise<void>; 21561847f8eSopenharmony_ci 21661847f8eSopenharmony_ci /** 21761847f8eSopenharmony_ci * Create virtual screen. if surfaceId is valid, this permission is necessary. 21861847f8eSopenharmony_ci * 21961847f8eSopenharmony_ci * @permission ohos.permission.CAPTURE_SCREEN 22061847f8eSopenharmony_ci * @param { VirtualScreenOption } options Indicates the options of the virtual screen. 22161847f8eSopenharmony_ci * @param { AsyncCallback<Screen> } callback Callback used to return the created virtual screen 22261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 22361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 22461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 22561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 22661847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 22761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 22861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 22961847f8eSopenharmony_ci * @since 9 23061847f8eSopenharmony_ci */ 23161847f8eSopenharmony_ci function createVirtualScreen(options: VirtualScreenOption, callback: AsyncCallback<Screen>): void; 23261847f8eSopenharmony_ci 23361847f8eSopenharmony_ci /** 23461847f8eSopenharmony_ci * Create virtual screen. if surfaceId is valid, this permission is necessary. 23561847f8eSopenharmony_ci * 23661847f8eSopenharmony_ci * @permission ohos.permission.CAPTURE_SCREEN 23761847f8eSopenharmony_ci * @param { VirtualScreenOption } options Indicates the options of the virtual screen. 23861847f8eSopenharmony_ci * @returns { Promise<Screen> } Promise used to return the created virtual screen 23961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 24061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 24161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 24261847f8eSopenharmony_ci * 2. Incorrect parameter types. 24361847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 24461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 24561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 24661847f8eSopenharmony_ci * @since 9 24761847f8eSopenharmony_ci */ 24861847f8eSopenharmony_ci function createVirtualScreen(options: VirtualScreenOption): Promise<Screen>; 24961847f8eSopenharmony_ci 25061847f8eSopenharmony_ci /** 25161847f8eSopenharmony_ci * Destroy virtual screen. 25261847f8eSopenharmony_ci * 25361847f8eSopenharmony_ci * @param { number } screenId Indicates the screen id of the virtual screen. 25461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback used to return the result. 25561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 25661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 25761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 25861847f8eSopenharmony_ci * @throws { BusinessError } 1400002 - Unauthorized operation. 25961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 26061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 26161847f8eSopenharmony_ci * @since 9 26261847f8eSopenharmony_ci */ 26361847f8eSopenharmony_ci function destroyVirtualScreen(screenId: number, callback: AsyncCallback<void>): void; 26461847f8eSopenharmony_ci 26561847f8eSopenharmony_ci /** 26661847f8eSopenharmony_ci * Destroy virtual screen. 26761847f8eSopenharmony_ci * 26861847f8eSopenharmony_ci * @param { number } screenId Indicates the screen id of the virtual screen. 26961847f8eSopenharmony_ci * @returns { Promise<void> } Promise that returns no value. 27061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 27161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 27261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 27361847f8eSopenharmony_ci * @throws { BusinessError } 1400002 - Unauthorized operation. 27461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 27561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 27661847f8eSopenharmony_ci * @since 9 27761847f8eSopenharmony_ci */ 27861847f8eSopenharmony_ci function destroyVirtualScreen(screenId: number): Promise<void>; 27961847f8eSopenharmony_ci 28061847f8eSopenharmony_ci /** 28161847f8eSopenharmony_ci * Set surface for the virtual screen. 28261847f8eSopenharmony_ci * 28361847f8eSopenharmony_ci * @permission ohos.permission.CAPTURE_SCREEN 28461847f8eSopenharmony_ci * @param { number } screenId Indicates the screen id of the virtual screen. 28561847f8eSopenharmony_ci * @param { string } surfaceId Indicates the surface id. 28661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback used to return the result 28761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 28861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 28961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 29061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 29161847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 29261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 29361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 29461847f8eSopenharmony_ci * @since 9 29561847f8eSopenharmony_ci */ 29661847f8eSopenharmony_ci function setVirtualScreenSurface(screenId: number, surfaceId: string, callback: AsyncCallback<void>): void; 29761847f8eSopenharmony_ci 29861847f8eSopenharmony_ci /** 29961847f8eSopenharmony_ci * Set surface for the virtual screen. 30061847f8eSopenharmony_ci * 30161847f8eSopenharmony_ci * @permission ohos.permission.CAPTURE_SCREEN 30261847f8eSopenharmony_ci * @param { number } screenId Indicates the screen id of the virtual screen. 30361847f8eSopenharmony_ci * @param { string } surfaceId Indicates the surface id. 30461847f8eSopenharmony_ci * @returns { Promise<void> } Promise that returns no value 30561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 30661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 30761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 30861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 30961847f8eSopenharmony_ci * @throws { BusinessError } 1400001 - Invalid display or screen. 31061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 31161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 31261847f8eSopenharmony_ci * @since 9 31361847f8eSopenharmony_ci */ 31461847f8eSopenharmony_ci function setVirtualScreenSurface(screenId: number, surfaceId: string): Promise<void>; 31561847f8eSopenharmony_ci 31661847f8eSopenharmony_ci /** 31761847f8eSopenharmony_ci * Get screen rotation lock status. 31861847f8eSopenharmony_ci * 31961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback If true, auto rotate is locked. If false, auto rotate is unlocked 32061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 32161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 32261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 32361847f8eSopenharmony_ci * @since 9 32461847f8eSopenharmony_ci */ 32561847f8eSopenharmony_ci function isScreenRotationLocked(callback: AsyncCallback<boolean>): void; 32661847f8eSopenharmony_ci 32761847f8eSopenharmony_ci /** 32861847f8eSopenharmony_ci * Get screen rotation lock status. 32961847f8eSopenharmony_ci * 33061847f8eSopenharmony_ci * @returns { Promise<boolean> } If true, auto rotate is locked. If false, auto rotate is unlocked 33161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 33261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 33361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 33461847f8eSopenharmony_ci * @since 9 33561847f8eSopenharmony_ci */ 33661847f8eSopenharmony_ci function isScreenRotationLocked(): Promise<boolean>; 33761847f8eSopenharmony_ci 33861847f8eSopenharmony_ci /** 33961847f8eSopenharmony_ci * Set screen rotation lock status. 34061847f8eSopenharmony_ci * 34161847f8eSopenharmony_ci * @param { boolean } isLocked Indicates whether the screen rotation switch is locked. 34261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback used to return the result. 34361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 34461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 34561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 34661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 34761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 34861847f8eSopenharmony_ci * @since 9 34961847f8eSopenharmony_ci */ 35061847f8eSopenharmony_ci function setScreenRotationLocked(isLocked: boolean, callback: AsyncCallback<void>): void; 35161847f8eSopenharmony_ci 35261847f8eSopenharmony_ci /** 35361847f8eSopenharmony_ci * Set screen rotation lock status. 35461847f8eSopenharmony_ci * 35561847f8eSopenharmony_ci * @param { boolean } isLocked Indicates whether the screen rotation switch is locked. 35661847f8eSopenharmony_ci * @returns { Promise<void> } Promise that returns no value. 35761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 35861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 35961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 36061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 36161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 36261847f8eSopenharmony_ci * @since 9 36361847f8eSopenharmony_ci */ 36461847f8eSopenharmony_ci function setScreenRotationLocked(isLocked: boolean): Promise<void>; 36561847f8eSopenharmony_ci 36661847f8eSopenharmony_ci /** 36761847f8eSopenharmony_ci * Set multi screen mode(mirror/extend). 36861847f8eSopenharmony_ci * 36961847f8eSopenharmony_ci * @param { number } primaryScreenId - primary screen id. 37061847f8eSopenharmony_ci * @param { number } secondaryScreenId - secondary screen id. 37161847f8eSopenharmony_ci * @param { MultiScreenMode } secondaryScreenMode - secondary screen mode. 37261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 37361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 37461847f8eSopenharmony_ci * 2. Incorrect parameter types. 37561847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 37661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 37761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 37861847f8eSopenharmony_ci * @since 13 37961847f8eSopenharmony_ci */ 38061847f8eSopenharmony_ci function setMultiScreenMode(primaryScreenId: number, secondaryScreenId: number, 38161847f8eSopenharmony_ci secondaryScreenMode: MultiScreenMode): Promise<void>; 38261847f8eSopenharmony_ci 38361847f8eSopenharmony_ci /** 38461847f8eSopenharmony_ci * Set multi screen relative position. 38561847f8eSopenharmony_ci * 38661847f8eSopenharmony_ci * @param { MultiScreenPositionOptions } mainScreenOptions - main screen position. 38761847f8eSopenharmony_ci * @param { MultiScreenPositionOptions } secondaryScreenOptions - secondary screen position. 38861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. 38961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 39061847f8eSopenharmony_ci * 2. Incorrect parameter types. 39161847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 39261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 39361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 39461847f8eSopenharmony_ci * @since 13 39561847f8eSopenharmony_ci */ 39661847f8eSopenharmony_ci function setMultiScreenRelativePosition(mainScreenOptions: MultiScreenPositionOptions, 39761847f8eSopenharmony_ci secondaryScreenOptions: MultiScreenPositionOptions): Promise<void>; 39861847f8eSopenharmony_ci 39961847f8eSopenharmony_ci /** 40061847f8eSopenharmony_ci * Indicate the screen mode 40161847f8eSopenharmony_ci * 40261847f8eSopenharmony_ci * @enum { number } 40361847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 40461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 40561847f8eSopenharmony_ci * @since 13 40661847f8eSopenharmony_ci */ 40761847f8eSopenharmony_ci enum MultiScreenMode { 40861847f8eSopenharmony_ci 40961847f8eSopenharmony_ci /** 41061847f8eSopenharmony_ci * Indicate that the screen is in mirror mode. 41161847f8eSopenharmony_ci * 41261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 41361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 41461847f8eSopenharmony_ci * @since 13 41561847f8eSopenharmony_ci */ 41661847f8eSopenharmony_ci SCREEN_MIRROR = 0, 41761847f8eSopenharmony_ci 41861847f8eSopenharmony_ci /** 41961847f8eSopenharmony_ci * Indicate that the screen is in extend mode. 42061847f8eSopenharmony_ci * 42161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 42261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 42361847f8eSopenharmony_ci * @since 13 42461847f8eSopenharmony_ci */ 42561847f8eSopenharmony_ci SCREEN_EXTEND = 1 42661847f8eSopenharmony_ci } 42761847f8eSopenharmony_ci 42861847f8eSopenharmony_ci /** 42961847f8eSopenharmony_ci * The parameter of making extend screen 43061847f8eSopenharmony_ci * 43161847f8eSopenharmony_ci * @interface MultiScreenPositionOptions 43261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 43361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 43461847f8eSopenharmony_ci * @since 13 43561847f8eSopenharmony_ci */ 43661847f8eSopenharmony_ci interface MultiScreenPositionOptions { 43761847f8eSopenharmony_ci /** 43861847f8eSopenharmony_ci * Screen id 43961847f8eSopenharmony_ci * 44061847f8eSopenharmony_ci * @type { number } 44161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 44261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 44361847f8eSopenharmony_ci * @since 13 44461847f8eSopenharmony_ci */ 44561847f8eSopenharmony_ci id: number; 44661847f8eSopenharmony_ci 44761847f8eSopenharmony_ci /** 44861847f8eSopenharmony_ci * The start coordinate X of the screen origin 44961847f8eSopenharmony_ci * 45061847f8eSopenharmony_ci * @type { number } 45161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 45261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 45361847f8eSopenharmony_ci * @since 13 45461847f8eSopenharmony_ci */ 45561847f8eSopenharmony_ci startX: number; 45661847f8eSopenharmony_ci 45761847f8eSopenharmony_ci /** 45861847f8eSopenharmony_ci * The start coordinate Y of the screen origin 45961847f8eSopenharmony_ci * 46061847f8eSopenharmony_ci * @type { number } 46161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 46261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 46361847f8eSopenharmony_ci * @since 13 46461847f8eSopenharmony_ci */ 46561847f8eSopenharmony_ci startY: number; 46661847f8eSopenharmony_ci } 46761847f8eSopenharmony_ci 46861847f8eSopenharmony_ci /** 46961847f8eSopenharmony_ci * The parameter of making expand screen 47061847f8eSopenharmony_ci * 47161847f8eSopenharmony_ci * @interface ExpandOption 47261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 47361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 47461847f8eSopenharmony_ci * @since 9 47561847f8eSopenharmony_ci */ 47661847f8eSopenharmony_ci interface ExpandOption { 47761847f8eSopenharmony_ci /** 47861847f8eSopenharmony_ci * Screen id 47961847f8eSopenharmony_ci * 48061847f8eSopenharmony_ci * @type { number } 48161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 48261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 48361847f8eSopenharmony_ci * @since 9 48461847f8eSopenharmony_ci */ 48561847f8eSopenharmony_ci screenId: number; 48661847f8eSopenharmony_ci 48761847f8eSopenharmony_ci /** 48861847f8eSopenharmony_ci * The start coordinate X of the screen origin 48961847f8eSopenharmony_ci * 49061847f8eSopenharmony_ci * @type { number } 49161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 49261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 49361847f8eSopenharmony_ci * @since 9 49461847f8eSopenharmony_ci */ 49561847f8eSopenharmony_ci startX: number; 49661847f8eSopenharmony_ci 49761847f8eSopenharmony_ci /** 49861847f8eSopenharmony_ci * The start coordinate Y of the screen origin 49961847f8eSopenharmony_ci * 50061847f8eSopenharmony_ci * @type { number } 50161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 50261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 50361847f8eSopenharmony_ci * @since 9 50461847f8eSopenharmony_ci */ 50561847f8eSopenharmony_ci startY: number; 50661847f8eSopenharmony_ci } 50761847f8eSopenharmony_ci 50861847f8eSopenharmony_ci /** 50961847f8eSopenharmony_ci * The parameter for creating virtual screen. 51061847f8eSopenharmony_ci * 51161847f8eSopenharmony_ci * @interface VirtualScreenOption 51261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 51361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 51461847f8eSopenharmony_ci * @since 9 51561847f8eSopenharmony_ci */ 51661847f8eSopenharmony_ci interface VirtualScreenOption { 51761847f8eSopenharmony_ci /** 51861847f8eSopenharmony_ci * Indicates the name of the virtual screen. 51961847f8eSopenharmony_ci * 52061847f8eSopenharmony_ci * @type { string } 52161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 52261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 52361847f8eSopenharmony_ci * @since 9 52461847f8eSopenharmony_ci */ 52561847f8eSopenharmony_ci name: string; 52661847f8eSopenharmony_ci 52761847f8eSopenharmony_ci /** 52861847f8eSopenharmony_ci * Indicates the width of the virtual screen. 52961847f8eSopenharmony_ci * 53061847f8eSopenharmony_ci * @type { number } 53161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 53261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 53361847f8eSopenharmony_ci * @since 9 53461847f8eSopenharmony_ci */ 53561847f8eSopenharmony_ci width: number; 53661847f8eSopenharmony_ci 53761847f8eSopenharmony_ci /** 53861847f8eSopenharmony_ci * Indicates the height of the virtual screen. 53961847f8eSopenharmony_ci * 54061847f8eSopenharmony_ci * @type { number } 54161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 54261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 54361847f8eSopenharmony_ci * @since 9 54461847f8eSopenharmony_ci */ 54561847f8eSopenharmony_ci height: number; 54661847f8eSopenharmony_ci 54761847f8eSopenharmony_ci /** 54861847f8eSopenharmony_ci * Indicates the density of the virtual screen. 54961847f8eSopenharmony_ci * 55061847f8eSopenharmony_ci * @type { number } 55161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 55261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 55361847f8eSopenharmony_ci * @since 9 55461847f8eSopenharmony_ci */ 55561847f8eSopenharmony_ci density: number; 55661847f8eSopenharmony_ci 55761847f8eSopenharmony_ci /** 55861847f8eSopenharmony_ci * Indicates the surface id of the virtual screen. 55961847f8eSopenharmony_ci * 56061847f8eSopenharmony_ci * @type { string } 56161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 56261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 56361847f8eSopenharmony_ci * @since 9 56461847f8eSopenharmony_ci */ 56561847f8eSopenharmony_ci surfaceId: string; 56661847f8eSopenharmony_ci } 56761847f8eSopenharmony_ci 56861847f8eSopenharmony_ci /** 56961847f8eSopenharmony_ci * Indicate the source mode of the screen 57061847f8eSopenharmony_ci * 57161847f8eSopenharmony_ci * @enum { number } 57261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 57361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 57461847f8eSopenharmony_ci * @since 10 57561847f8eSopenharmony_ci */ 57661847f8eSopenharmony_ci enum ScreenSourceMode { 57761847f8eSopenharmony_ci /** 57861847f8eSopenharmony_ci * Indicate that the screen is the default screen. 57961847f8eSopenharmony_ci * 58061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 58161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 58261847f8eSopenharmony_ci * @since 10 58361847f8eSopenharmony_ci */ 58461847f8eSopenharmony_ci SCREEN_MAIN = 0, 58561847f8eSopenharmony_ci 58661847f8eSopenharmony_ci /** 58761847f8eSopenharmony_ci * Indicate that the screen is in mirror mode. 58861847f8eSopenharmony_ci * 58961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 59061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 59161847f8eSopenharmony_ci * @since 10 59261847f8eSopenharmony_ci */ 59361847f8eSopenharmony_ci SCREEN_MIRROR = 1, 59461847f8eSopenharmony_ci 59561847f8eSopenharmony_ci /** 59661847f8eSopenharmony_ci * Indicate that the screen is in extend mode. 59761847f8eSopenharmony_ci * 59861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 59961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 60061847f8eSopenharmony_ci * @since 10 60161847f8eSopenharmony_ci */ 60261847f8eSopenharmony_ci SCREEN_EXTEND = 2, 60361847f8eSopenharmony_ci 60461847f8eSopenharmony_ci /** 60561847f8eSopenharmony_ci * Indicate that the screen stands alone. 60661847f8eSopenharmony_ci * 60761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 60861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 60961847f8eSopenharmony_ci * @since 10 61061847f8eSopenharmony_ci */ 61161847f8eSopenharmony_ci SCREEN_ALONE = 3 61261847f8eSopenharmony_ci } 61361847f8eSopenharmony_ci 61461847f8eSopenharmony_ci /** 61561847f8eSopenharmony_ci * Interface for screen 61661847f8eSopenharmony_ci * 61761847f8eSopenharmony_ci * @interface Screen 61861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 61961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 62061847f8eSopenharmony_ci * @since 9 62161847f8eSopenharmony_ci */ 62261847f8eSopenharmony_ci interface Screen { 62361847f8eSopenharmony_ci /** 62461847f8eSopenharmony_ci * Screen id 62561847f8eSopenharmony_ci * 62661847f8eSopenharmony_ci * @type { number } 62761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 62861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 62961847f8eSopenharmony_ci * @since 9 63061847f8eSopenharmony_ci */ 63161847f8eSopenharmony_ci readonly id: number; 63261847f8eSopenharmony_ci 63361847f8eSopenharmony_ci /** 63461847f8eSopenharmony_ci * Group id 63561847f8eSopenharmony_ci * 63661847f8eSopenharmony_ci * @type { number } 63761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 63861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 63961847f8eSopenharmony_ci * @since 9 64061847f8eSopenharmony_ci */ 64161847f8eSopenharmony_ci readonly parent: number; 64261847f8eSopenharmony_ci 64361847f8eSopenharmony_ci /** 64461847f8eSopenharmony_ci * Mode supported by the screen 64561847f8eSopenharmony_ci * 64661847f8eSopenharmony_ci * @type { Array<ScreenModeInfo> } 64761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 64861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 64961847f8eSopenharmony_ci * @since 9 65061847f8eSopenharmony_ci */ 65161847f8eSopenharmony_ci readonly supportedModeInfo: Array<ScreenModeInfo>; 65261847f8eSopenharmony_ci 65361847f8eSopenharmony_ci /** 65461847f8eSopenharmony_ci * Currently active mode 65561847f8eSopenharmony_ci * 65661847f8eSopenharmony_ci * @type { number } 65761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 65861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 65961847f8eSopenharmony_ci * @since 9 66061847f8eSopenharmony_ci */ 66161847f8eSopenharmony_ci readonly activeModeIndex: number; 66261847f8eSopenharmony_ci 66361847f8eSopenharmony_ci /** 66461847f8eSopenharmony_ci * Orientation of the screen 66561847f8eSopenharmony_ci * 66661847f8eSopenharmony_ci * @type { Orientation } 66761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 66861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 66961847f8eSopenharmony_ci * @since 9 67061847f8eSopenharmony_ci */ 67161847f8eSopenharmony_ci readonly orientation: Orientation; 67261847f8eSopenharmony_ci 67361847f8eSopenharmony_ci /** 67461847f8eSopenharmony_ci * Source mode of the screen 67561847f8eSopenharmony_ci * 67661847f8eSopenharmony_ci * @type { ScreenSourceMode } 67761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 67861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 67961847f8eSopenharmony_ci * @since 10 68061847f8eSopenharmony_ci */ 68161847f8eSopenharmony_ci readonly sourceMode: ScreenSourceMode; 68261847f8eSopenharmony_ci 68361847f8eSopenharmony_ci /** 68461847f8eSopenharmony_ci * Set the orientation of the screen 68561847f8eSopenharmony_ci * 68661847f8eSopenharmony_ci * @param { Orientation } orientation Screen orientation. orientation value must from enum Orientation. 68761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback used to return the result. 68861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 68961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 69061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 69161847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 69261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 69361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 69461847f8eSopenharmony_ci * @since 9 69561847f8eSopenharmony_ci */ 69661847f8eSopenharmony_ci setOrientation(orientation: Orientation, callback: AsyncCallback<void>): void; 69761847f8eSopenharmony_ci 69861847f8eSopenharmony_ci /** 69961847f8eSopenharmony_ci * Set the orientation of the screen 70061847f8eSopenharmony_ci * 70161847f8eSopenharmony_ci * @param { Orientation } orientation Screen orientation. orientation value must from enum Orientation. 70261847f8eSopenharmony_ci * @returns { Promise<void> } Promise that returns no value. 70361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 70461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 70561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 70661847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 70761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 70861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 70961847f8eSopenharmony_ci * @since 9 71061847f8eSopenharmony_ci */ 71161847f8eSopenharmony_ci setOrientation(orientation: Orientation): Promise<void>; 71261847f8eSopenharmony_ci 71361847f8eSopenharmony_ci /** 71461847f8eSopenharmony_ci * Active the mode 71561847f8eSopenharmony_ci * 71661847f8eSopenharmony_ci * @param { number } modeIndex Index of the mode to set. 71761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback used to return the result. 71861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 71961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 72061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 72161847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 72261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 72361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 72461847f8eSopenharmony_ci * @since 9 72561847f8eSopenharmony_ci */ 72661847f8eSopenharmony_ci setScreenActiveMode(modeIndex: number, callback: AsyncCallback<void>): void; 72761847f8eSopenharmony_ci 72861847f8eSopenharmony_ci /** 72961847f8eSopenharmony_ci * Active the mode 73061847f8eSopenharmony_ci * 73161847f8eSopenharmony_ci * @param { number } modeIndex Index of the mode to set. 73261847f8eSopenharmony_ci * @returns { Promise<void> } Promise that returns no value. 73361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 73461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 73561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 73661847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 73761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 73861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 73961847f8eSopenharmony_ci * @since 9 74061847f8eSopenharmony_ci */ 74161847f8eSopenharmony_ci setScreenActiveMode(modeIndex: number): Promise<void>; 74261847f8eSopenharmony_ci 74361847f8eSopenharmony_ci /** 74461847f8eSopenharmony_ci * Set display density of the screen 74561847f8eSopenharmony_ci * 74661847f8eSopenharmony_ci * @param { number } densityDpi Pixel density. The value ranges from 80 to 640. 74761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback used to return the result. 74861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 74961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 75061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 75161847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 75261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 75361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 75461847f8eSopenharmony_ci * @since 9 75561847f8eSopenharmony_ci */ 75661847f8eSopenharmony_ci setDensityDpi(densityDpi: number, callback: AsyncCallback<void>): void; 75761847f8eSopenharmony_ci 75861847f8eSopenharmony_ci /** 75961847f8eSopenharmony_ci * Set display density of the screen 76061847f8eSopenharmony_ci * 76161847f8eSopenharmony_ci * @param { number } densityDpi Pixel density. The value ranges from 80 to 640. 76261847f8eSopenharmony_ci * @returns { Promise<void> } Promise that returns no value. 76361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 76461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 76561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 76661847f8eSopenharmony_ci * @throws { BusinessError } 1400003 - This display manager service works abnormally. 76761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 76861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 76961847f8eSopenharmony_ci * @since 9 77061847f8eSopenharmony_ci */ 77161847f8eSopenharmony_ci setDensityDpi(densityDpi: number): Promise<void>; 77261847f8eSopenharmony_ci } 77361847f8eSopenharmony_ci 77461847f8eSopenharmony_ci /** 77561847f8eSopenharmony_ci * Screen orientation 77661847f8eSopenharmony_ci * 77761847f8eSopenharmony_ci * @enum { number } 77861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 77961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 78061847f8eSopenharmony_ci * @since 9 78161847f8eSopenharmony_ci */ 78261847f8eSopenharmony_ci enum Orientation { 78361847f8eSopenharmony_ci /** 78461847f8eSopenharmony_ci * Indicates that the orientation of the screen is unspecified. 78561847f8eSopenharmony_ci * 78661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 78761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 78861847f8eSopenharmony_ci * @since 9 78961847f8eSopenharmony_ci */ 79061847f8eSopenharmony_ci UNSPECIFIED = 0, 79161847f8eSopenharmony_ci 79261847f8eSopenharmony_ci /** 79361847f8eSopenharmony_ci * Indicates that the orientation of the screen is vertical. 79461847f8eSopenharmony_ci * 79561847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 79661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 79761847f8eSopenharmony_ci * @since 9 79861847f8eSopenharmony_ci */ 79961847f8eSopenharmony_ci VERTICAL = 1, 80061847f8eSopenharmony_ci 80161847f8eSopenharmony_ci /** 80261847f8eSopenharmony_ci * Indicates that the orientation of the screen is horizontal. 80361847f8eSopenharmony_ci * 80461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 80561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 80661847f8eSopenharmony_ci * @since 9 80761847f8eSopenharmony_ci */ 80861847f8eSopenharmony_ci HORIZONTAL = 2, 80961847f8eSopenharmony_ci 81061847f8eSopenharmony_ci /** 81161847f8eSopenharmony_ci * Indicates that the orientation of the screen is reverse_vertical. 81261847f8eSopenharmony_ci * 81361847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 81461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 81561847f8eSopenharmony_ci * @since 9 81661847f8eSopenharmony_ci */ 81761847f8eSopenharmony_ci REVERSE_VERTICAL = 3, 81861847f8eSopenharmony_ci 81961847f8eSopenharmony_ci /** 82061847f8eSopenharmony_ci * Indicates that the orientation of the screen is reverse_horizontal. 82161847f8eSopenharmony_ci * 82261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 82361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 82461847f8eSopenharmony_ci * @since 9 82561847f8eSopenharmony_ci */ 82661847f8eSopenharmony_ci REVERSE_HORIZONTAL = 4 82761847f8eSopenharmony_ci } 82861847f8eSopenharmony_ci 82961847f8eSopenharmony_ci /** 83061847f8eSopenharmony_ci * The information of the screen 83161847f8eSopenharmony_ci * 83261847f8eSopenharmony_ci * @interface ScreenModeInfo 83361847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 83461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 83561847f8eSopenharmony_ci * @since 9 83661847f8eSopenharmony_ci */ 83761847f8eSopenharmony_ci interface ScreenModeInfo { 83861847f8eSopenharmony_ci /** 83961847f8eSopenharmony_ci * Screen id 84061847f8eSopenharmony_ci * 84161847f8eSopenharmony_ci * @type { number } 84261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 84361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 84461847f8eSopenharmony_ci * @since 9 84561847f8eSopenharmony_ci */ 84661847f8eSopenharmony_ci id: number; 84761847f8eSopenharmony_ci 84861847f8eSopenharmony_ci /** 84961847f8eSopenharmony_ci * Indicates the width of the screen 85061847f8eSopenharmony_ci * 85161847f8eSopenharmony_ci * @type { number } 85261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 85361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 85461847f8eSopenharmony_ci * @since 9 85561847f8eSopenharmony_ci */ 85661847f8eSopenharmony_ci width: number; 85761847f8eSopenharmony_ci 85861847f8eSopenharmony_ci /** 85961847f8eSopenharmony_ci * Indicates the height of the screen 86061847f8eSopenharmony_ci * 86161847f8eSopenharmony_ci * @type { number } 86261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 86361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 86461847f8eSopenharmony_ci * @since 9 86561847f8eSopenharmony_ci */ 86661847f8eSopenharmony_ci height: number; 86761847f8eSopenharmony_ci 86861847f8eSopenharmony_ci /** 86961847f8eSopenharmony_ci * Indicates the refreshRate of the screen 87061847f8eSopenharmony_ci * 87161847f8eSopenharmony_ci * @type { number } 87261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 87361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 87461847f8eSopenharmony_ci * @since 9 87561847f8eSopenharmony_ci */ 87661847f8eSopenharmony_ci refreshRate: number; 87761847f8eSopenharmony_ci } 87861847f8eSopenharmony_ci} 87961847f8eSopenharmony_ci 88061847f8eSopenharmony_ciexport default screen; 881