diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 69d0beedad1e139ad9a900b986a8cdb2fdcf76d0..86cbfbbf50ba3bc430741bccb2a599820f0e2b4e 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -3733,10 +3733,10 @@ declare namespace window { /** * Get windows by coordinate. * - * @param { number } displayId - Indicate the id of display. - * @param { number } windowNumber - Indicate the Number of query windows. - * @param { number } x - Indicate the X-coordinate of the window. - * @param { number } y - Indicate the Y-coordinate of the window. + * @param { long } displayId - Indicate the id of display. + * @param { int } windowNumber - Indicate the Number of query windows. + * @param { int } x - Indicate the X-coordinate of the window. + * @param { int } y - Indicate the Y-coordinate of the window. * @returns { Promise> } Promise used to return the window. * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. @@ -3746,7 +3746,7 @@ declare namespace window { * @since 14 dynamic * @since 20 static */ - function getWindowsByCoordinate(displayId: number, windowNumber?: number, x?: number, y?: number): + function getWindowsByCoordinate(displayId: long, windowNumber?: int, x?: int, y?: int): Promise>; /** @@ -3823,10 +3823,24 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 8 dynamic - * @since 20 static */ function on(type: 'systemBarTintChange', callback: Callback): void; + /** + * Register the callback of systemBarTintChange + * + * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. + * @param { Callback } callback - Callback used to return the properties of the system bar. + * @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; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + function onSystemBarTintChange(callback: Callback): void; + /** * Unregister the callback of systemBarTintChange * @@ -3838,10 +3852,23 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 8 dynamic - * @since 20 static */ function off(type: 'systemBarTintChange', callback?: Callback): void; + /** + * Unregister the callback of systemBarTintChange + * + * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. + * @param { Callback } callback - Callback used to return the properties of the system bar. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + function offSystemBarTintChange(callback?: Callback): void; + /** * Register the callback for gesture navigation enabled changes. * @@ -3856,10 +3883,26 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 10 dynamic - * @since 20 static */ function on(type: 'gestureNavigationEnabledChange', callback: Callback): void; + /** + * Register the callback for gesture navigation enabled changes. + * + * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. + * @param { Callback } callback Callback used to return the result whether gesture navigation enabled or not. + * @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. + * 3. Parameter verification failed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + function onGestureNavigationEnabledChange(callback: Callback): void; + /** * Unregister the callback for gesture navigation enabled changes. * @@ -3873,10 +3916,25 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 10 dynamic - * @since 20 static */ function off(type: 'gestureNavigationEnabledChange', callback?: Callback): void; + /** + * Unregister the callback for gesture navigation enabled changes. + * + * @param { 'gestureNavigationEnabledChange' } type the event of gesture navigation enabled changes. + * @param { Callback } callback Callback used to return the result whether gesture navigation enabled or not. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + function offGestureNavigationEnabledChange(callback?: Callback): void; + /** * Register the callback for watermark flag change. * @@ -3890,10 +3948,25 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 10 dynamic - * @since 20 static */ function on(type: 'waterMarkFlagChange', callback: Callback): void; + /** + * Register the callback for watermark flag change. + * + * @param { 'waterMarkFlagChange' } type the event of watermark flag change. + * @param { Callback } callback Callback used to return the result whether watermark flag change or not. + * @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. 3.Parameter verification failed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + function onWaterMarkFlagChange(callback: Callback): void; + /** * Unregister the callback for watermark flag change. * @@ -3907,10 +3980,25 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 10 dynamic - * @since 20 static */ function off(type: 'waterMarkFlagChange', callback?: Callback): void; + /** + * Unregister the callback for watermark flag change. + * + * @param { 'waterMarkFlagChange' } type the event of watermark flag change. + * @param { Callback } callback Callback used to return the result whether watermark flag change or not. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 22 static + */ + function offWaterMarkFlagChange(callback?: Callback): void; + /** * Sets starting window background color * @@ -6733,10 +6821,24 @@ declare namespace window { * @crossplatform * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'windowSizeChange', callback: Callback): void; + /** + * Register the callback of windowSizeChange + * + * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. + * @param { Callback } callback - Callback used to return the window size. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + onWindowSizeChange(callback: Callback): void; + /** * Unregister the callback of windowSizeChange * @@ -6769,10 +6871,23 @@ declare namespace window { * @crossplatform * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'windowSizeChange', callback?: Callback): void; + /** + * Unregister the callback of windowSizeChange + * + * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. + * @param { Callback } callback - Callback used to return the window size. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + offWindowSizeChange(callback?: Callback): void; + /** * Register the callback of systemAvoidAreaChange * @@ -6843,10 +6958,25 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since 20 dynamic&static + * @since 20 dynamic */ on(type: 'avoidAreaChange', callback: Callback): void; + /** + * Register the callback of avoidAreaChange + * + * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. + * @param { Callback } callback - Callback used to return the area. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + onAvoidAreaChange(callback: Callback): void; + /** * Unregister the callback of avoidAreaChange * @@ -6889,10 +7019,24 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since 20 dynamic&static + * @since 20 dynamic */ off(type: 'avoidAreaChange', callback?: Callback): void; + /** + * Unregister the callback of avoidAreaChange + * + * @param { 'avoidAreaChange' } type - The value is fixed at 'avoidAreaChange', indicating the event of changes to the avoid area. + * @param { Callback } callback - Callback used to return the area. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + offAvoidAreaChange(callback?: Callback): void; + /** * Register the callback of keyboardHeightChange * @@ -7097,10 +7241,25 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 14 dynamic - * @since 20 static */ on(type: 'displayIdChange', callback: Callback): void; + /** + * Window displayId change callback on. + * + * @param { 'displayIdChange' } type - The value is fixed at 'displayIdChange', indicating the Display this window is current showing has changed. + * @param { Callback } callback - Callback used to notify the Display this window is current showing has changed. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onDisplayIdChange(callback: Callback): void; + /** * Window displayId change callback off. * @@ -7113,10 +7272,24 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 14 dynamic - * @since 20 static */ off(type: 'displayIdChange', callback?: Callback): void; + /** + * Window displayId change callback off. + * + * @param { 'displayIdChange' } type - The value is fixed at 'displayIdChange', indicating the Display this window is current showing has changed. + * @param { Callback } callback - Callback used to notify the Display this window is current showing has changed. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offDisplayIdChange(callback?: Callback): void; + /** * Window visibility change callback on. * @@ -7146,10 +7319,27 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'windowVisibilityChange', callback: Callback): void; + /** + * Subscribes to the visibility status change event of this window. + * + * @param { 'windowVisibilityChange' } type - Event type. The value is fixed at 'windowVisibilityChange', indicating the visibility status change event. + * @param { Callback } callback - Callback used to return the visibility status of the window, which is a Boolean value. + * The value true means that the window is visible, and false means the opposite. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @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. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onWindowVisibilityChange(callback: Callback): void; + /** * Window visibility change callback off. * @@ -7178,10 +7368,27 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'windowVisibilityChange', callback?: Callback): void; + /** + * Unsubscribes from the visibility status change event of this window. + * + * @param { 'windowVisibilityChange' } type - Event type. The value is fixed at 'windowVisibilityChange', indicating the visibility status change event. + * @param { Callback } callback - Callback used to return the visibility status of the window. + * If a value is passed in, the corresponding subscription is canceled. + * If no value is passed in, all subscriptions to the specified event are canceled. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @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. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offWindowVisibilityChange(callback?: Callback): void; + /** * System density change callback on. * @@ -7195,10 +7402,25 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic - * @since 20 static */ on(type: 'systemDensityChange', callback: Callback): void; + /** + * System density change callback on. + * + * @param { 'systemDensityChange' } type - The value is fixed at 'systemDensityChange', indicating the system density is current has changed. + * @param { Callback } callback - Callback used to notify the system density is current has changed. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onSystemDensityChange(callback: Callback): void; + /** * System density change callback off. * @@ -7211,10 +7433,24 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic - * @since 20 static */ off(type: 'systemDensityChange', callback?: Callback): void; + /** + * System density change callback off. + * + * @param { 'systemDensityChange' } type - The value is fixed at 'systemDensityChange', indicating the system density is current showing has changed. + * @param { Callback } callback - Callback used to notify the system density is current has changed. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offSystemDensityChange(callback?: Callback): void; + /** * Register Callback for window spans multiple screens and displays in full screen mode changed. * @@ -7233,6 +7469,24 @@ declare namespace window { */ on(type: 'mainWindowFullScreenAcrossDisplaysChanged', callback: Callback): void; + /** + * Register Callback for window spans multiple screens and displays in full screen mode changed. + * + * + * @param { 'mainWindowFullScreenAcrossDisplaysChanged' } type - The value is fixed at 'mainWindowFullScreenAcrossDisplaysChanged', + * indicating the window spans multiple screens and displays in full screen mode changed. + * @param { Callback } callback - Callback used to notify the window spans multiple screens and displays in full screen mode changed. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @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 22 static + */ + onMainWindowFullScreenAcrossDisplaysChangedcallback: Callback): void; + /** * Unregister Callback for window spans multiple screens and displays in full screen mode changed. * @@ -7250,6 +7504,23 @@ declare namespace window { */ off(type: 'mainWindowFullScreenAcrossDisplaysChanged', callback?: Callback): void; + /** + * Unregister Callback for window spans multiple screens and displays in full screen mode changed. + * + * @param { 'mainWindowFullScreenAcrossDisplaysChanged' } type - The value is fixed at 'mainWindowFullScreenAcrossDisplaysChanged', + * indicating the window spans multiple screens and displays in full screen mode changed. + * @param { Callback } [callback] - Callback used to notify the window spans multiple screens and displays in full screen mode changed. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @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 22 static + */ + offMainWindowFullScreenAcrossDisplaysChanged(callback?: Callback): void; + /** * Subscribes to non-interaction events in a window within the specified period. * Interaction events include physical keyboard input events and screen touch/click events, but not soft keyboard input events. @@ -7310,10 +7581,23 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'screenshot', callback: Callback): void; + /** + * Register the callback of screenshot, only the focused window called back + * + * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. + * @param { Callback } callback - Callback invoked when a screenshot event occurs. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 22 static + */ + onScreenshot(callback: Callback): void; + /** * Unregister the callback of screenshot * @@ -7334,10 +7618,22 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'screenshot', callback?: Callback): void; + /** + * Unregister the callback of screenshot + * + * @param { 'screenshot' } type - The value is fixed at 'screenshot', indicating the screenshot event. + * @param { Callback } callback - Callback invoked when a screenshot event occurs. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 22 static + */ + offScreenshot(callback?: Callback): void; + /** * Register the callback of screenshot app event * @@ -7350,6 +7646,18 @@ declare namespace window { */ on(type: 'screenshotAppEvent', callback: Callback): void; + /** + * Register the callback of screenshot app event + * + * @param { 'screenshotAppEvent' } type - The value is fixed at 'screenshotAppEvent', indicating the screenshot app event. + * @param { Callback } callback - Callback invoked when a screenshot app event occurs. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 22 static + */ + onScreenshotAppEvent(callback: Callback): void; + /** * Unregister the callback of screenshot app event * @@ -7362,6 +7670,18 @@ declare namespace window { */ off(type: 'screenshotAppEvent', callback?: Callback): void; + /** + * Unregister the callback of screenshot app event + * + * @param { 'screenshotAppEvent' } type - The value is fixed at 'screenshotAppEvent', indicating the screenshot app event. + * @param { Callback } callback - Callback invoked when a screenshot app event occurs. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 22 static + */ + offScreenshotAppEvent(callback?: Callback): void; + /** * Register the callback of dialogTargetTouch *