diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index d3fffd2bfdf4f893ed5642514928fd3f6958885b..4cdcdde0180cd94cfd8fe98e26108fd42c0d5f1e 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7866,11 +7866,23 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ isWindowSupportWideGamut(): Promise; + /** + * Whether the window supports thr wide gamut setting. + * + * @returns { Promise } Promise used to return the result. + * The value true means that the wide-gamut color space is supported, and false means the opposite. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + isWindowSupportWideGamutReturnPromise(): Promise; + /** * Whether the window supports thr wide gamut setting. * @@ -7886,11 +7898,31 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ isWindowSupportWideGamut(callback: AsyncCallback): void; + /** + * Whether the window supports thr wide gamut setting. + * + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + isWindowSupportWideGamutWithCallback(callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload isWindowSupportWideGamut { + isWindowSupportWideGamutReturnPromise, + isWindowSupportWideGamutWithCallback + }; + /** * Sets the specified color space. * @@ -7952,11 +7984,26 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ setWindowColorSpace(colorSpace: ColorSpace): Promise; + /** + * Sets the specified color space. + * + * @param { ColorSpace } colorSpace the specified color space. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + setWindowColorSpaceReturnPromise(colorSpace: ColorSpace): Promise; + /** * Sets the specified color space. * @@ -7994,11 +8041,35 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ setWindowColorSpace(colorSpace: ColorSpace, callback: AsyncCallback): void; + /** + * Sets the specified color space. + * + * @param { ColorSpace } colorSpace the specified color space. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + setWindowColorSpaceWithCallback(colorSpace: ColorSpace, callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setWindowColorSpace { + setWindowColorSpaceReturnPromise, + setWindowColorSpaceWithCallback + }; + /** * Obtains the set color space. * @@ -8491,11 +8562,26 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * */ setWindowKeepScreenOn(isKeepScreenOn: boolean): Promise; + /** + * Sets whether keep screen on or not. + * + * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + setWindowKeepScreenOnReturnPromise(isKeepScreenOn: boolean): Promise; + /** * Sets whether keep screen on or not. * @@ -8533,11 +8619,32 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * */ setWindowKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback): void; + /** + * Sets whether keep screen on or not. + * + * @param { boolean } isKeepScreenOn keep screen on if true, or not if false. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + setWindowKeepScreenOnWithCallback(isKeepScreenOn: boolean, callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setWindowKeepScreenOn { setWindowKeepScreenOnWithCallback, setWindowKeepScreenOnReturnPromise }; + /** * Sets whether to wake up the screen when this ability is restored. * @@ -8651,11 +8758,27 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'20', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * */ setWindowPrivacyMode(isPrivacyMode: boolean): Promise; + /** + * Sets whether is private mode or not. + * + * @permission ohos.permission.PRIVACY_WINDOW + * @param { boolean } isPrivacyMode in private mode if true, or not if false. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + setWindowPrivacyModeReturnPromise(isPrivacyMode: boolean): Promise; + /** * Sets whether is private mode or not. * @@ -8696,11 +8819,33 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'20', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * */ setWindowPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback): void; + /** + * Sets whether is private mode or not. + * + * @permission ohos.permission.PRIVACY_WINDOW + * @param { boolean } isPrivacyMode in private mode if true, or not if false. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + setWindowPrivacyModeWithCallback(isPrivacyMode: boolean, callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setWindowPrivacyMode { setWindowPrivacyModeReturnPromise, setWindowPrivacyModeWithCallback }; + /** * Ignore this window during screenshot. * @@ -8871,19 +9016,30 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ snapshot(callback: AsyncCallback): void; + /** + * Obtains snapshot of window + * + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + snapshotWithCallback(callback: AsyncCallback): void; + /** * Obtains snapshot of window * * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 + * */ /** * Obtains snapshot of window @@ -8892,11 +9048,28 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ snapshot(): Promise; + /** + * Obtains snapshot of window + * + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 20 + * @arkts 1.2 + */ + snapshotReturnPromise(): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload snapshot { snapshotWithCallback, snapshotReturnPromise }; + /** * Obtains snapshot of window * @@ -9428,11 +9601,29 @@ declare namespace window { * @throws { BusinessError } 1300008 - The display device is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ setWaterMarkFlag(enable: boolean, callback: AsyncCallback): void; + /** + * Set the watermark flag on the window. + * + * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false. + * @param { AsyncCallback } callback - The callback of setWaterMarkFlag. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300008 - The display device is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + setWaterMarkFlagWithCallback(enable: boolean, callback: AsyncCallback): void; + /** * Set the watermark flag on the window * @@ -9460,11 +9651,35 @@ declare namespace window { * @throws { BusinessError } 1300008 - The display device is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * */ setWaterMarkFlag(enable: boolean): Promise; + /** + * Set the watermark flag on the window + * + * @param { boolean } enable - Add water mark flag to window if true, or remove flag if false + * @returns { Promise } - The promise returned by the function + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300008 - The display device is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + setWaterMarkFlagReturnPromise(enable: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setWaterMarkFlag { setWaterMarkFlagWithCallback, setWaterMarkFlagReturnPromise }; + /** * Raise one app sub window above another. * @@ -9665,11 +9880,30 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * */ hideNonSystemFloatingWindows(shouldHide: boolean, callback: AsyncCallback): void; + /** + * Hide the non-system floating windows. + * + * @param { boolean } shouldHide - Hide the non-system floating windows if true, otherwise means the opposite. + * @param { AsyncCallback } callback - The callback of hideNonSystemFloatingWindows. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + hideNonSystemFloatingWindowsWithCallback(shouldHide: boolean, callback: AsyncCallback): void; + /** * Hide the non-system floating windows. * @@ -9684,11 +9918,36 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * */ hideNonSystemFloatingWindows(shouldHide: boolean): Promise; + /** + * Hide the non-system floating windows. + * + * @param { boolean } shouldHide - Hide the non-system floating windows if true, otherwise means the opposite. + * @returns { Promise } - The promise returned by the function. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + hideNonSystemFloatingWindowsReturnPromise(shouldHide: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload hideNonSystemFloatingWindows { hideNonSystemFloatingWindowsWithCallback, hideNonSystemFloatingWindowsReturnPromise }; + /** * Get the window limits of current window. *