• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Enums
2<!--Kit: ArkUI-->
3<!--Subsystem: Window-->
4<!--Owner: @waterwin-->
5<!--Designer: @nyankomiya-->
6<!--Tester: @qinliwen0417-->
7<!--Adviser: @ge-yafang-->
8
9> **NOTE**
10>
11> 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.
12
13## WindowType<sup>7+</sup>
14
15Enumerates the window types.
16
17**System capability**: SystemCapability.WindowManager.WindowManager.Core
18
19| Name                                 | Value| Description                                                                                    |
20|-------------------------------------| ------ |----------------------------------------------------------------------------------------|
21| TYPE_APP                            | 0      | Child window of an application.<br>**Model restriction**: This API can be used only in the FA model.                                                  |
22| TYPE_SYSTEM_ALERT<sup>(deprecated)</sup>               | 1     | System alert window.<br>Note: This property is supported since API version 7 and deprecated since API version 11.<br>                           |
23| TYPE_FLOAT<sup>9+</sup>             | 8      | Floating window.<br>**Model restriction**: This API can be used only in the stage model.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
24| TYPE_DIALOG<sup>10+</sup>           | 16      | Modal window.<br>**Model restriction**: This API can be used only in the stage model.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
25| TYPE_MAIN<sup>18+</sup>             | 32      | Main window of an application.<br>This window type cannot be used when creating a window. It is only for reading purposes in the return value of the **getWindowProperties** API.                              |
26
27## AvoidAreaType<sup>7+</sup>
28
29Enumerates the types of areas that window content should avoid.
30
31**System capability**: SystemCapability.WindowManager.WindowManager.Core
32
33**Atomic service API**: This API can be used in atomic services since API version 11.
34
35| Name                            | Value  | Description                                                        |
36| -------------------------------- | ---- | ------------------------------------------------------------ |
37| TYPE_SYSTEM                      | 0    | Default area of the system. <!--RP11-->It contains the status bar and three-button navigation bar.<!--RP11End-->       |
38| TYPE_CUTOUT                      | 1    | Notch area.                                                             |
39| TYPE_SYSTEM_GESTURE<sup>9+</sup> | 2    | Gesture area. Currently, no device has this type of avoid area.                                   |
40| TYPE_KEYBOARD<sup>9+</sup>       | 3    | Soft keyboard area.                                                             |
41| TYPE_NAVIGATION_INDICATOR<sup>11+</sup> | 4    | Bottom navigation bar. <!--RP12-->OpenHarmony devices do not support this capability.<!--RP12End-->                             |
42
43## Orientation<sup>9+</sup>
44
45Enumerates the window orientations. <!--Del-->For details of the differences between different enumerated values, see [What is the difference between orientation values 8 to 10 or 12 and values 13 to 16 (API version 9)](../../faqs/faqs-window-manager.md#what-is-the-difference-between-orientation-values-8-to-10-or-12-and-values-13-to-16-api-version-9).<!--DelEnd-->
46
47| Name                                 | Value  | Description                         |
48| ------------------------------------- | ---- | ----------------------------- |
49| UNSPECIFIED                           | 0    | Unspecified. The orientation is determined by the system.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
50| PORTRAIT                              | 1    | Portrait.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
51| LANDSCAPE                             | 2    | Landscape.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
52| PORTRAIT_INVERTED                     | 3    | Reverse portrait.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
53| LANDSCAPE_INVERTED                    | 4    | Reverse landscape.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
54| AUTO_ROTATION                         | 5    | Automatically rotates with the sensor. The orientation can be portrait, landscape, reverse portrait, or reverse landscape.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
55| AUTO_ROTATION_PORTRAIT                | 6    | Automatically rotates with the sensor in the vertical direction. The orientation can be portrait or reverse portrait.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
56| AUTO_ROTATION_LANDSCAPE               | 7    | Automatically rotates with the sensor in the horizontal direction. The orientation can be landscape or reverse landscape.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
57| 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.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
58| 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
59| 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
60| LOCKED                                | 11   | Locked.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
61| AUTO_ROTATION_UNSPECIFIED<sup>12+</sup>        | 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.Window.SessionManager|
62| USER_ROTATION_PORTRAIT<sup>12+</sup>           | 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.Window.SessionManager|
63| USER_ROTATION_LANDSCAPE<sup>12+</sup>          | 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.Window.SessionManager|
64| USER_ROTATION_PORTRAIT_INVERTED<sup>12+</sup>  | 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.Window.SessionManager|
65| USER_ROTATION_LANDSCAPE_INVERTED<sup>12+</sup> | 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.Window.SessionManager|
66| FOLLOW_DESKTOP<sup>12+</sup>                   | 17   | Follows the orientation of the home screen.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<br>**System capability**: SystemCapability.Window.SessionManager|
67
68## RectChangeReason<sup>12+</sup>
69
70Enumerates the reasons for window rectangle (position and size) changes.
71
72**System capability**: SystemCapability.Window.SessionManager
73
74**Atomic service API**: This API can be used in atomic services since API version 12.
75
76| Name                 | Value  | Description                                                        |
77| --------------------- | ---- | ------------------------------------------------------------ |
78| UNDEFINED                 | 0    | Default value.                                                  |
79| MAXIMIZE                | 1    | The window is maximized.                                                  |
80| RECOVER              | 2    | The window is restored to the previous state.                                                  |
81| MOVE | 3    | The window is moved.|
82| DRAG  | 4    | The window is zoomed in or out by dragging.|
83| DRAG_START  | 5    | The window starts zooming in or out.|
84| DRAG_END  | 6    | The window finishes zooming in or out.|
85
86## ColorSpace<sup>8+</sup>
87
88Enumerates the color spaces.
89
90**Atomic service API**: This API can be used in atomic services since API version 12.
91
92**System capability**: SystemCapability.WindowManager.WindowManager.Core
93
94| Name      | Value| Description          |
95| ---------- | ------ | -------------- |
96| DEFAULT    | 0      | Default SRGB gamut.|
97| WIDE_GAMUT | 1      | Wide-gamut.  |
98
99## WindowEventType<sup>10+</sup>
100
101Enumerates the window lifecycle states.
102
103**Atomic service API**: This API can be used in atomic services since API version 11.
104
105| Name      | Value| Description      |
106| ---------- | ------ | ---------- |
107| WINDOW_SHOWN      | 1      | The window is running in the foreground.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
108| WINDOW_ACTIVE     | 2      | The window gains focus.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
109| WINDOW_INACTIVE   | 3      | The window loses focus.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
110| WINDOW_HIDDEN     | 4      | The window is running in the background.<br>**System capability**: SystemCapability.WindowManager.WindowManager.Core|
111| WINDOW_DESTROYED<sup>11+</sup>  | 7      | The window is destroyed.<br>**System capability**: SystemCapability.Window.SessionManager|
112
113## WindowStatusType<sup>11+</sup>
114
115Enumerates the window modes.
116
117**Atomic service API**: This API can be used in atomic services since API version 12.
118
119**System capability**: SystemCapability.Window.SessionManager
120
121| Name      | Value  | Description                         |
122| ---------- | ---- | ----------------------------- |
123| UNDEFINED  | 0    | The window mode is not defined by the application.      |
124| FULL_SCREEN | 1    | The application window is in full-screen mode. On 2-in-1 devices, the window covers the entire screen without a dock bar or status bar.            |
125| MAXIMIZE    | 2    | The application window is maximized. On 2-in-1 devices, the window covers the entire screen with a dock bar and status bar.  |
126| MINIMIZE    | 3    | The application window is minimized.  |
127| FLOATING    | 4    | The application is displayed in a floating window.  |
128| SPLIT_SCREEN  | 5    | The application is displayed in split-screen mode.  |
129
130## MaximizePresentation<sup>12+</sup>
131
132Enumerates the layout when the window is maximized.
133
134**System capability**: SystemCapability.Window.SessionManager
135
136| Name      | Value  | Description                         |
137| ---------- | ---- | ----------------------------- |
138| FOLLOW_APP_IMMERSIVE_SETTING  | 0    | The window, when maximized, follows the application's full-screen mode.<br>**Atomic service API**: This API can be used in atomic services since API version 12.      |
139| EXIT_IMMERSIVE | 1    | The window, when maximized, exits full-screen mode if it is set to full-screen.<br>**Atomic service API**: This API can be used in atomic services since API version 12.            |
140| ENTER_IMMERSIVE    | 2    | The window, when maximized, transitions into the full-screen mode, and the window title bar and dock bar are displayed when the cursor hovers over the hot zone.<br>**Atomic service API**: This API can be used in atomic services since API version 12.  |
141| ENTER_IMMERSIVE_DISABLE_TITLE_AND_DOCK_HOVER<sup>14+</sup>    | 3    | The window, when maximized, transitions into the full-screen mode, and the window title bar and dock bar are not displayed when the cursor hovers over the hot zone.<br>**Atomic service API**: This API can be used in atomic services since API version 14.  |
142
143## WindowAnimationCurve<sup>20+</sup>
144
145Enumerates the types of window animation curves.
146
147**Atomic service API**: This API can be used in atomic services since API version 20.
148
149**System capability**: SystemCapability.Window.SessionManager
150
151| Name               | Value  | Description                                                        |
152| ------------------- | ---- | ------------------------------------------------------------ |
153| LINEAR              | 0    | The animation speed is constant from start to finish.<br>When this curve type is used, **duration** in [WindowAnimationConfig](arkts-apis-window-i.md#windowanimationconfig20) is mandatory.<br>When this curve type is used, **param** in [WindowAnimationConfig](arkts-apis-window-i.md#windowanimationconfig20) is optional and does not take effect.|
154| 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](arkts-apis-window-i.md#windowanimationconfig20).<br>When this curve type is used, **duration** in [WindowAnimationConfig](arkts-apis-window-i.md#windowanimationconfig20) is optional and does not take effect.<br>When this curve type is used, **param** in [WindowAnimationConfig](arkts-apis-window-i.md#windowanimationconfig20) is mandatory.|
155| CUBIC_BEZIER | 2 | Cubic Bézier curve.<br>When this curve type is used, **param** and **duration** in [WindowAnimationConfig](arkts-apis-window-i.md#windowanimationconfig20) are mandatory.|
156
157## WindowTransitionType<sup>20+</sup>
158
159Enumerates the types of window transition animations.
160
161**Atomic service API**: This API can be used in atomic services since API version 20.
162
163**System capability**: SystemCapability.Window.SessionManager
164
165| Name   | Value  | Description                      |
166| ------- | ---- | -------------------------- |
167| DESTROY | 0    | Transition animation when the window is destroyed.|
168
169## AnimationType<sup>20+</sup>
170
171Enumerates the types of window animations.
172
173**System capability**: SystemCapability.Window.SessionManager
174
175| Name   | Value  | Description                      |
176| ------- | ---- | -------------------------- |
177| FADE_IN_OUT | 0    | Fade-in/fade-out animation. The fade-in animation takes effect during window display, and the fade-out animation takes effect during window hiding.|
178
179## WindowAnchor<sup>20+</sup>
180
181Enumerates the window anchor points.
182
183**System capability**: SystemCapability.Window.SessionManager
184
185| Name      | Value  | Description                         |
186| ---------- | ---- | ----------------------------- |
187| TOP_START  | 0    | Top left corner of the window.|
188| TOP  | 1    | Horizontal center point along the top edge of the window.|
189| TOP_END  | 2    | Top right corner of the window.|
190| START  | 3    | Vertical center point along the left edge of the window.|
191| CENTER  | 4    | Center point of the window, both horizontally and vertically.|
192| END  | 5    | Vertical center point along the right edge of the window.|
193| BOTTOM_START  | 6    | Bottom left corner of the window.|
194| BOTTOM  | 7    | Horizontal center point along the bottom edge of the window.|
195| BOTTOM_END  | 8    | Bottom right corner of the window.|
196
197## RotationChangeType<sup>19+</sup>
198
199Enumerates the types of window rotation events.
200
201**Atomic service API**: This API can be used in atomic services since API version 19.
202
203**System capability**: SystemCapability.Window.SessionManager
204
205| Name  |  Value| Description                  |
206| ------ | ---- | --------------------- |
207| WINDOW_WILL_ROTATE| 0 | The window is about to rotate.|
208| WINDOW_DID_ROTATE | 1 | The window has finished rotating.|
209
210## RectType<sup>19+</sup>
211
212Enumerates the types of window rectangle coordinate systems.
213
214**Atomic service API**: This API can be used in atomic services since API version 19.
215
216**System capability**: SystemCapability.Window.SessionManager
217
218| Name  | Value| Description                  |
219| ------ | ---- | --------------------- |
220| RELATIVE_TO_SCREEN | 0 | The window rectangle is relative to the screen coordinate system.|
221| RELATIVE_TO_PARENT_WINDOW | 1 | The window rectangle is relative to the parent window coordinate system.|
222
223## GlobalWindowMode<sup>20+</sup>
224
225Enumerates the window modes.
226
227**Atomic service API**: This API can be used in atomic services since API version 20.
228
229**System capability**: SystemCapability.Window.SessionManager
230
231| Name  | Value| Description                   |
232| ------ | --- | ------------------------ |
233| FULLSCREEN | 1 | Full-screen window. The first binary bit from right to left is 1. |
234| SPLIT  | 1 << 1 | Split-screen window. The second binary bit from right to left is 1.|
235| FLOAT   | 1 << 2  | Floating window. The third binary bit from right to left is 1.|
236| PIP   | 1 << 3  | PiP window. The fourth binary bit from right to left is 1.|
237
238## WindowStageEventType<sup>9+</sup>
239
240Enumerates the lifecycle events of a WindowStage.
241
242**Model restriction**: This API can be used only in the stage model.
243
244**System capability**: SystemCapability.WindowManager.WindowManager.Core
245
246**Atomic service API**: This API can be used in atomic services since API version 11.
247
248| Name      | Value| Description      |
249| ---------- | ------ | ---------- |
250| SHOWN      | 1      | The WindowStage 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.|
251| ACTIVE     | 2      | The WindowStage gains focus, for example, the state of the application window after handling a click event, or the state after the application is launched.|
252| INACTIVE   | 3      | The WindowStage loses focus, for example, the state of the window that was in focus when a new application is opened or another window is clicked.|
253| HIDDEN     | 4      | The WindowStage is running in the background, for example, when the application exists after swiping up or the application window is closed.|
254| RESUMED<sup>11+</sup> | 5      | The WindowStage is in the foreground and interactive, for example, when the application is open and can interact with the user.|
255| PAUSED<sup>11+</sup>  | 6      | The WindowStage is in the foreground but not interactive, for example, when the application is in the foreground and is entering the multitasking screen.|
256
257## WindowStageLifecycleEventType<sup>20+</sup>
258
259Enumerates the lifecycle state types of a WindowStage.
260
261**Model restriction**: This API can be used only in the stage model.
262
263**System capability**: SystemCapability.Window.SessionManager
264
265| Name      | Value| Description      |
266| ---------- | ------ | ---------- |
267| SHOWN      | 1      | The WindowStage 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.|
268| RESUMED    | 2      | The WindowStage is in the foreground and interactive, for example, when the application is open and can interact with the user.|
269| PAUSED     | 3      | The WindowStage is in the foreground but not interactive, for example, when the application is in the foreground and is entering the multitasking screen.|
270| HIDDEN     | 4      | The WindowStage is running in the background, for example, when the application exists after swiping up or the application window is closed.|
271
272## ModalityType<sup>14+</sup>
273
274Enumerates the modality types of the child window.
275
276**System capability**: SystemCapability.Window.SessionManager
277
278**Atomic service API**: This API can be used in atomic services since API version 14.
279
280| Name                | Value     | Description      |
281| -------------------- | ------ | ---------- |
282| WINDOW_MODALITY      | 0      | Window-modal. Select this value when you want the parent window not to respond to user interactions.|
283| APPLICATION_MODALITY | 1      | Application-modal. This type is effective only in [freeform window](../../windowmanager/window-terminology.md#freeform-window) mode.<br> Select this value when other instances of the application should also not respond to user operations.<br> **Device behavior differences**: This enumerated value can be properly called on 2-in-1 devices and tablets. If it is used as an input parameter on other device types, error code 801 is returned.|
284
285## ScreenshotEventType<sup>20+</sup>
286
287Enumerates the screenshot event types.
288
289**System capability**: SystemCapability.WindowManager.WindowManager.Core
290
291| Name  | Value| Description                  |
292| ------ | ---- | --------------------- |
293| SYSTEM_SCREENSHOT | 0 | System screenshot succeeds.|
294| SYSTEM_SCREENSHOT_ABORT | 1 | System screenshot aborted.|
295| SCROLL_SHOT_START | 2 | Scroll screenshot starts.|
296| SCROLL_SHOT_END | 3 | Scroll screenshot ends.|
297| SCROLL_SHOT_ABORT | 4 | Scroll screenshot aborted.|
298
299<!--no_check-->