openharmony 鸿蒙 arkts-apis-window-e

2025-06-12 浏览 (1)

Enums

NOTE

The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.

WindowType7+

Enumerates the window types.

System capability: SystemCapability.WindowManager.WindowManager.Core

NameValueDescription
TYPE_APP0Child window of an application.
Model restriction: This API can be used only in the FA model.
TYPE_SYSTEM_ALERT1System alert window.
NOTE
This property is supported since API version 7 and deprecated since API version 11.
TYPE_FLOAT9+8Floating window.
Model restriction: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 12.
TYPE_DIALOG10+16Modal window.
Model restriction: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 12.
TYPE_MAIN18+32Main window of an application.
This window type cannot be used when creating a window. It is only for reading purposes in the return value of the getWindowProperties API.

AvoidAreaType7+

Enumerates the types of areas that window content should avoid.

System capability: SystemCapability.WindowManager.WindowManager.Core

Atomic service API: This API can be used in atomic services since API version 11.

NameValueDescription
TYPE_SYSTEM0Default area of the system. It contains the status bar and three-button navigation bar.
TYPE_CUTOUT1Notch area.
TYPE_SYSTEM_GESTURE9+2Gesture area. Currently, no device has this type of avoid area.
TYPE_KEYBOARD9+3Soft keyboard area.
TYPE_NAVIGATION_INDICATOR11+4Bottom navigation bar. OpenHarmony devices do not support this capability.

Orientation9+

Enumerates the window orientations.

NameValueDescription
UNSPECIFIED0Unspecified. The orientation is determined by the system.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
PORTRAIT1Portrait.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 11.
LANDSCAPE2Landscape.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
PORTRAIT_INVERTED3Reverse portrait.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 12.
LANDSCAPE_INVERTED4Reverse landscape.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 12.
AUTO_ROTATION5Automatically rotates with the sensor. The orientation can be portrait, landscape, reverse portrait, or reverse landscape.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 11.
AUTO_ROTATION_PORTRAIT6Automatically rotates with the sensor in the vertical direction. The orientation can be portrait or reverse portrait.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
AUTO_ROTATION_LANDSCAPE7Automatically rotates with the sensor in the horizontal direction. The orientation can be landscape or reverse landscape.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 12.
AUTO_ROTATION_RESTRICTED8Automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation can be portrait, landscape, reverse portrait, or reverse landscape.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 12.
AUTO_ROTATION_PORTRAIT_RESTRICTED9Automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation can be portrait or reverse portrait.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
AUTO_ROTATION_LANDSCAPE_RESTRICTED10Automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation can be landscape or reverse landscape.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
LOCKED11Locked.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
AUTO_ROTATION_UNSPECIFIED12+12Automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation that can be rotated to is determined by the system. For example, the window can rotate to portrait, landscape, or reverse landscape, but not reverse portrait, on a certain device.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Window.SessionManager
USER_ROTATION_PORTRAIT12+13Temporarily rotates to portrait mode, and then automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation that can be rotated to is determined by the system.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Window.SessionManager
USER_ROTATION_LANDSCAPE12+14Temporarily rotates to landscape mode, and then automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation that can be rotated to is determined by the system.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Window.SessionManager
USER_ROTATION_PORTRAIT_INVERTED12+15Temporarily rotates to reverse portrait mode, and then automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation that can be rotated to is determined by the system.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Window.SessionManager
USER_ROTATION_LANDSCAPE_INVERTED12+16Temporarily rotates to reverse landscape mode, and then automatically rotates with the sensor, under the restriction of the rotation switch in the Control Panel. The orientation that can be rotated to is determined by the system.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Window.SessionManager
FOLLOW_DESKTOP12+17Follows the orientation of the home screen.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Window.SessionManager

RectChangeReason12+

Enumerates the reasons for window rectangle (position and size) changes.

System capability: SystemCapability.Window.SessionManager

Atomic service API: This API can be used in atomic services since API version 12.

NameValueDescription
UNDEFINED0Default value.
MAXIMIZE1The window is maximized.
RECOVER2The window is restored to the previous state.
MOVE3The window is moved.
DRAG4The window is zoomed in or out by dragging.
DRAG_START5The window starts zooming in or out.
DRAG_END6The window finishes zooming in or out.

ColorSpace8+

Enumerates the color spaces.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.WindowManager.WindowManager.Core

NameValueDescription
DEFAULT0Default SRGB gamut.
WIDE_GAMUT1Wide-gamut.

WindowEventType10+

Enumerates the window lifecycle states.

Atomic service API: This API can be used in atomic services since API version 11.

NameValueDescription
WINDOW_SHOWN1The window is running in the foreground.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_ACTIVE2The window gains focus.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_INACTIVE3The window loses focus.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_HIDDEN4The window is running in the background.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_DESTROYED11+7The window is destroyed.
System capability: SystemCapability.Window.SessionManager

WindowStatusType11+

Enumerates the window modes.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
UNDEFINED0The window mode is not defined by the application.
FULL_SCREEN1The application is displayed in full screen.
MAXIMIZE2The application window is maximized.
MINIMIZE3The application window is minimized.
FLOATING4The application is displayed in a floating window.
SPLIT_SCREEN5The application is displayed in split-screen mode.

MaximizePresentation12+

Enumerates the layout when the window is maximized.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
FOLLOW_APP_IMMERSIVE_SETTING0The window, when maximized, follows the immersive layout of the application.
Atomic service API: This API can be used in atomic services since API version 12.
EXIT_IMMERSIVE1The window, when maximized, exits the immersive layout.
Atomic service API: This API can be used in atomic services since API version 12.
ENTER_IMMERSIVE2The window, when maximized, transitions into the immersive layout, and the window title bar and dock bar are displayed when the cursor hovers over the hot zone.
Atomic service API: This API can be used in atomic services since API version 12.
ENTER_IMMERSIVE_DISABLE_TITLE_AND_DOCK_HOVER14+3The window, when maximized, transitions into the immersive layout, and the window title bar and dock bar are not displayed when the cursor hovers over the hot zone.
Atomic service API: This API can be used in atomic services since API version 14.

WindowAnimationCurve20+

Enumerates the types of window animation curves.

Atomic service API: This API can be used in atomic services since API version 20.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
LINEAR0The animation speed is constant from start to finish.
When this curve type is used, duration in WindowAnimationConfig is mandatory.
When this curve type is used, param in WindowAnimationConfig is optional and does not take effect.
INTERPOLATION_SPRING1Interpolator spring curve, an animation curve from 0 to 1, where the actual animation values are interpolated based on the curve. The animation duration is subject to the curve parameters, rather than the duration parameter in WindowAnimationConfig.
When this curve type is used, duration in WindowAnimationConfig is optional and does not take effect.
When this curve type is used, param in WindowAnimationConfig is mandatory.

WindowTransitionType20+

Enumerates the types of window transition animations.

Atomic service API: This API can be used in atomic services since API version 20.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
DESTROY0Transition animation when the window is destroyed.

WindowAnchor20+

Enumerates the window anchor points.

Atomic service API: This API can be used in atomic services since API version 20.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
TOP_START0Top left corner of the window.
TOP1Horizontal center point along the top edge of the window.
TOP_END2Top right corner of the window.
START3Vertical center point along the left edge of the window.
CENTER4Center point of the window, both horizontally and vertically.
END5Vertical center point along the right edge of the window.
BOTTOM_START6Bottom left corner of the window.
BOTTOM7Horizontal center point along the bottom edge of the window.
BOTTOM_END8Bottom right corner of the window.

RotationChangeType19+

Enumerates the types of window rotation events.

Atomic service API: This API can be used in atomic services since API version 19.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
WINDOW_WILL_ROTATE0The window is about to rotate.
WINDOW_DID_ROTATE1The window has finished rotating.

RectType19+

Enumerates the types of window rectangle coordinate systems.

Atomic service API: This API can be used in atomic services since API version 19.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
RELATIVE_TO_SCREEN0The window rectangle is relative to the screen coordinate system.
RELATIVE_TO_PARENT_WINDOW1The window rectangle is relative to the parent window coordinate system.

GlobalWindowMode20+

Enumerates the window modes.

Atomic service API: This API can be used in atomic services since API version 20.

System capability: SystemCapability.Window.SessionManager

NameValueDescription
FULLSCREEN1Full-screen window.
SPLIT1 << 1Split-screen window.
FLOAT1 << 2Floating window.
PIP1 << 3PiP.

WindowStageEventType9+

Enumerates the lifecycle states of a window stage.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.WindowManager.WindowManager.Core

Atomic service API: This API can be used in atomic services since API version 11.

NameValueDescription
SHOWN1The window stage is shown in the foreground, for example, when launching from the application icon, triggered whether it is the first launch or resuming from the background.
ACTIVE2The window stage gains focus, for example, the state of the application window after handling a click event, or the state after the application is launched.
INACTIVE3The window stage loses focus, for example, the state of the window that was in focus when a new application is opened or another window is clicked.
HIDDEN4The window stage is running in the background, for example, when the application exists after swiping up or the application window is closed.
RESUMED11+5The window stage is interactive in the foreground, for example, when an application is opened and can interact with the user.
PAUSED11+6The window stage is non-interactive in the foreground, for example, when the application enters the recent tasks screen after swiping up from the bottom of the screen.

ModalityType14+

Enumerates the modality types of the child window.

System capability: SystemCapability.Window.SessionManager

Atomic service API: This API can be used in atomic services since API version 14.

NameValueDescription
WINDOW_MODALITY0Window-modal. Select this value when you want the parent window not to respond to user interactions.
APPLICATION_MODALITY1Application-modal. Select this value when you want both the parent window and all windows of other instances of the application not to respond to user interactions.
This API can be used only on 2-in-1 devices.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/MY6w1k