• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.ability.wantConstant (wantConstant)
2
3The **wantConstant** module provides the actions, entities, and flags used in **Want** objects.
4
5> **NOTE**
6>
7> The APIs of this module are supported since API version 6 and deprecated since API version 9. You are advised to use [@ohos.app.ability.wantConstant](js-apis-app-ability-wantConstant.md) instead. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8
9## Modules to Import
10
11```ts
12import wantConstant from '@ohos.ability.wantConstant';
13```
14
15## wantConstant.Action
16
17Enumerates the action constants of the **Want** object.
18
19**System capability**: SystemCapability.Ability.AbilityBase
20
21| Name     | Value         | Description    |
22| ------------ | ------------------ | ---------------------- |
23| ACTION_HOME                                 | ohos.want.action.home                    | Action of returning to the home page.                                       |
24| ACTION_DIAL                                 | ohos.want.action.dial                    | Action of launching the numeric keypad.                          |
25| ACTION_SEARCH                               | ohos.want.action.search                  | Action of launching the search function.                                |
26| ACTION_WIRELESS_SETTINGS                    | ohos.settings.wireless                   | Action of launching the UI that provides wireless network settings, for example, Wi-Fi options.   |
27| ACTION_MANAGE_APPLICATIONS_SETTINGS         | ohos.settings.manage.applications        | Action of launching the UI for managing installed applications.                 |
28| ACTION_APPLICATION_DETAILS_SETTINGS         | ohos.settings.application.details        | Action of launching the UI that displays the details of an application.            |
29| ACTION_SET_ALARM                            | ohos.want.action.setAlarm                | Action of launching the UI for setting the alarm clock.                         |
30| ACTION_SHOW_ALARMS                          | ohos.want.action.showAlarms              | Action of launching the UI that displays all alarms.                    |
31| ACTION_SNOOZE_ALARM                         | ohos.want.action.snoozeAlarm             | Action of launching the UI for snoozing an alarm.                      |
32| ACTION_DISMISS_ALARM                        | ohos.want.action.dismissAlarm            | Action of launching the UI for deleting an alarm.                            |
33| ACTION_DISMISS_TIMER                        | ohos.want.action.dismissTimer            | Action of launching the UI for dismissing a timer.                          |
34|  ACTION_SEND_SMS                            | ohos.want.action.sendSms                 | Action of launching the UI for sending an SMS message.                             |
35| ACTION_CHOOSE                               | ohos.want.action.choose                  | Action of launching the UI for opening a contact or picture.                     |
36| ACTION_IMAGE_CAPTURE<sup>8+</sup>           | ohos.want.action.imageCapture            | Action of launching the UI for photographing.                                  |
37| ACTION_VIDEO_CAPTURE<sup>8+</sup>           | ohos.want.action.videoCapture            | Action of launching the UI for shooting a video.                            |
38| ACTION_SELECT                               | ohos.want.action.select                  | Action of launching the UI for application selection.                            |
39| ACTION_SEND_DATA                            | ohos.want.action.sendData                | Action of launching the UI for sending a single data record.                                 |
40| ACTION_SEND_MULTIPLE_DATA                   | ohos.want.action.sendMultipleData        | Action of launching the UI for sending multiple data records.                                 |
41| ACTION_SCAN_MEDIA_FILE                      | ohos.want.action.scanMediaFile           | Action of requesting a media scanner to scan a file and add the file to the media library.         |
42| ACTION_VIEW_DATA                            | ohos.want.action.viewData                | Action of viewing data.                                         |
43|  ACTION_EDIT_DATA                           | ohos.want.action.editData                | Action of editing data.                                          |
44|  INTENT_PARAMS_INTENT                       | ability.want.params.INTENT               | Action of displaying selection options with an action selector.                            |
45|  INTENT_PARAMS_TITLE                        | ability.want.params.TITLE                | Title of the character sequence dialog box used with the action selector.               |
46|  ACTION_FILE_SELECT<sup>7+</sup>            | ohos.action.fileSelect                   | Action of selecting a file.                                         |
47|  PARAMS_STREAM<sup>7+</sup>                 | ability.params.stream                    | URI of the data stream associated with the target when the data is sent. The value must be an array of the string type. |
48|  ACTION_APP_ACCOUNT_OAUTH <sup>8+</sup>     | ohos.account.appAccount.action.oauth     | Action of providing the OAuth service.                                    |
49|   DLP_PARAMS_INDEX<sup>9+</sup>    |ohos.dlp.params.index      |Action of obtaining the DLP index.<br>**System API**: This is a system API and cannot be called by third-party applications. |
50
51## wantConstant.Entity
52
53Enumerates the entity constants of the **Want** object.
54
55**System capability**: SystemCapability.Ability.AbilityBase
56
57| Name     | Value         | Description    |
58| ------------ | ------------------ | ---------------------- |
59| ENTITY_DEFAULT                             | entity.system.default                    | Default entity. The default entity is used if no entity is specified.       |
60| ENTITY_HOME                                | entity.system.home                       | Home screen entity.                                   |
61| ENTITY_VOICE                               | entity.system.voice                      | Voice interaction entity.                                 |
62| ENTITY_BROWSABLE                           | entity.system.browsable                  | Browser type entity.                                   |
63| ENTITY_VIDEO                               | entity.system.video                      | Video type entity.                                     |
64
65
66## wantConstant.Flags
67
68Enumerates the flags that specify how the Want will be handled.
69
70**System capability**: SystemCapability.Ability.AbilityBase
71
72| Name                                | Value      | Description                                                        |
73| ------------------------------------ | ---------- | ------------------------------------------------------------ |
74| FLAG_AUTH_READ_URI_PERMISSION        | 0x00000001 | Grants the permission to read the URI.                                 |
75| FLAG_AUTH_WRITE_URI_PERMISSION       | 0x00000002 | Grants the permission to write data to the URI.                                 |
76| FLAG_ABILITY_FORWARD_RESULT          | 0x00000004 | Returns the result to the ability.                                          |
77| FLAG_ABILITY_CONTINUATION            | 0x00000008 | Indicates whether the ability on the local device can be continued on a remote device.                  |
78| FLAG_NOT_OHOS_COMPONENT              | 0x00000010 | Indicates that a component does not belong to OHOS.                                        |
79| FLAG_ABILITY_FORM_ENABLED            | 0x00000020 | Indicates that an ability is enabled.                                         |
80| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Grants the permission to make the URI persistent.<br>**System API**: This is a system API and cannot be called by third-party applications. |
81| FLAG_AUTH_PREFIX_URI_PERMISSION      | 0x00000080 | Grants the permission to verify URIs by prefix matching.<br>**System API**: This is a system API and cannot be called by third-party applications.|
82| FLAG_ABILITYSLICE_MULTI_DEVICE       | 0x00000100 | Indicates the support for cross-device startup in the distributed scheduler.                              |
83| FLAG_START_FOREGROUND_ABILITY        | 0x00000200 | Indicates that the ServiceAbility is started regardless of whether the host application has been started.        |
84| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation is reversible.<br>**System API**: This is a system API and cannot be called by third-party applications.     |
85| FLAG_INSTALL_ON_DEMAND               | 0x00000800 | Indicates that the specific ability will be installed if it has not been installed.                             |
86| FLAG_INSTALL_WITH_BACKGROUND_MODE    | 0x80000000 | Indicates that the specific ability will be installed in the background if it has not been installed.                             |
87| FLAG_ABILITY_CLEAR_MISSION           | 0x00008000 | Clears other operation missions. This flag can be set for the **Want** object in the [startAbility](js-apis-ability-featureAbility.md#startability) API passed to the **FeatureAbility** module and must be used together with **flag_ABILITY_NEW_MISSION**.|
88| FLAG_ABILITY_NEW_MISSION             | 0x10000000 | Creates a mission on the history mission stack.                              |
89| FLAG_ABILITY_MISSION_TOP             | 0x20000000 | Reuses an ability instance if it is on the top of an existing mission stack; creates an ability instance otherwise.|
90