harmony 鸿蒙Enums

  • 2025-06-12
  • 浏览 (4)

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

Name Value Description
TYPE_APP 0 Child window of an application.
Model restriction: This API can be used only in the FA model.
TYPE_SYSTEM_ALERT 1 System alert window.
NOTE
This property is supported since API version 7 and deprecated since API version 11.
TYPE_FLOAT9+ 8 Floating 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+ 16 Modal 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+ 32 Main 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.

Name Value Description
TYPE_SYSTEM 0 Default area of the system. It contains the status bar and three-button navigation bar.
TYPE_CUTOUT 1 Notch area.
TYPE_SYSTEM_GESTURE9+ 2 Gesture area. Currently, no device has this type of avoid area.
TYPE_KEYBOARD9+ 3 Soft keyboard area.
TYPE_NAVIGATION_INDICATOR11+ 4 Bottom navigation bar. OpenHarmony devices do not support this capability.

Orientation9+

Enumerates the window orientations.

Name Value Description
UNSPECIFIED 0 Unspecified. 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
PORTRAIT 1 Portrait.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 11.
LANDSCAPE 2 Landscape.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
PORTRAIT_INVERTED 3 Reverse portrait.
System capability: SystemCapability.WindowManager.WindowManager.Core
Atomic service API: This API can be used in atomic services since API version 12.
LANDSCAPE_INVERTED 4 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 5 Automatically 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_PORTRAIT 6 Automatically 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_LANDSCAPE 7 Automatically 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_RESTRICTED 8 Automatically 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_RESTRICTED 9 Automatically 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_RESTRICTED 10 Automatically 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
LOCKED 11 Locked.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.WindowManager.WindowManager.Core
AUTO_ROTATION_UNSPECIFIED12+ 12 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. 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+ 13 Temporarily 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+ 14 Temporarily 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+ 15 Temporarily 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+ 16 Temporarily 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+ 17 Follows 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.

Name Value Description
UNDEFINED 0 Default value.
MAXIMIZE 1 The window is maximized.
RECOVER 2 The window is restored to the previous state.
MOVE 3 The window is moved.
DRAG 4 The window is zoomed in or out by dragging.
DRAG_START 5 The window starts zooming in or out.
DRAG_END 6 The 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

Name Value Description
DEFAULT 0 Default SRGB gamut.
WIDE_GAMUT 1 Wide-gamut.

WindowEventType10+

Enumerates the window lifecycle states.

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

Name Value Description
WINDOW_SHOWN 1 The window is running in the foreground.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_ACTIVE 2 The window gains focus.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_INACTIVE 3 The window loses focus.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_HIDDEN 4 The window is running in the background.
System capability: SystemCapability.WindowManager.WindowManager.Core
WINDOW_DESTROYED11+ 7 The 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

Name Value Description
UNDEFINED 0 The window mode is not defined by the application.
FULL_SCREEN 1 The application is displayed in full screen.
MAXIMIZE 2 The application window is maximized.
MINIMIZE 3 The application window is minimized.
FLOATING 4 The application is displayed in a floating window.
SPLIT_SCREEN 5 The application is displayed in split-screen mode.

MaximizePresentation12+

Enumerates the layout when the window is maximized.

System capability: SystemCapability.Window.SessionManager

Name Value Description
FOLLOW_APP_IMMERSIVE_SETTING 0 The 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_IMMERSIVE 1 The window, when maximized, exits the immersive layout.
Atomic service API: This API can be used in atomic services since API version 12.
ENTER_IMMERSIVE 2 The 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+ 3 The 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

Name Value Description
LINEAR 0 The 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_SPRING 1 Interpolator 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

Name Value Description
DESTROY 0 Transition 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

Name Value Description
TOP_START 0 Top left corner of the window.
TOP 1 Horizontal center point along the top edge of the window.
TOP_END 2 Top right corner of the window.
START 3 Vertical center point along the left edge of the window.
CENTER 4 Center point of the window, both horizontally and vertically.
END 5 Vertical center point along the right edge of the window.
BOTTOM_START 6 Bottom left corner of the window.
BOTTOM 7 Horizontal center point along the bottom edge of the window.
BOTTOM_END 8 Bottom 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

Name Value Description
WINDOW_WILL_ROTATE 0 The window is about to rotate.
WINDOW_DID_ROTATE 1 The 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

Name Value Description
RELATIVE_TO_SCREEN 0 The window rectangle is relative to the screen coordinate system.
RELATIVE_TO_PARENT_WINDOW 1 The 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

Name Value Description
FULLSCREEN 1 Full-screen window.
SPLIT 1 << 1 Split-screen window.
FLOAT 1 << 2 Floating window.
PIP 1 << 3 PiP.

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.

Name Value Description
SHOWN 1 The 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.
ACTIVE 2 The 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.
INACTIVE 3 The 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.
HIDDEN 4 The window stage is running in the background, for example, when the application exists after swiping up or the application window is closed.
RESUMED11+ 5 The window stage is interactive in the foreground, for example, when an application is opened and can interact with the user.
PAUSED11+ 6 The 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.

Name Value Description
WINDOW_MODALITY 0 Window-modal. Select this value when you want the parent window not to respond to user interactions.
APPLICATION_MODALITY 1 Application-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

0  赞