• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License"),
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * the constant for action and entity in the want
18 * @name wantConstant
19 * @since 6
20 * @syscap SystemCapability.Ability.AbilityBase
21 * @permission N/A
22 * @deprecated since 9
23 * @useinstead ohos.app.ability.wantConstant
24 */
25declare namespace wantConstant {
26  /**
27   * the constant for action of the want
28   * @name Action
29   * @since 6
30   * @syscap SystemCapability.Ability.AbilityBase
31   * @permission N/A
32   */
33  export enum Action {
34    /**
35     * Indicates the action of backing home.
36     *
37     * @since 6
38     */
39    ACTION_HOME = "ohos.want.action.home",
40
41    /**
42     * Indicates the action of starting a Page ability that displays a keypad.
43     *
44     * @since 6
45     */
46    ACTION_DIAL = "ohos.want.action.dial",
47
48    /**
49     * Indicates the action of starting a Page ability for search.
50     *
51     * @since 6
52     */
53    ACTION_SEARCH = "ohos.want.action.search",
54
55    /**
56     * Indicates the action of starting a Page ability that provides wireless network settings, for example,
57     * Wi-Fi options.
58     *
59     * @since 6
60     */
61    ACTION_WIRELESS_SETTINGS = "ohos.settings.wireless",
62
63    /**
64     * Indicates the action of starting a Page ability that manages installed applications.
65     *
66     * @since 6
67     */
68    ACTION_MANAGE_APPLICATIONS_SETTINGS = "ohos.settings.manage.applications",
69
70    /**
71     * Indicates the action of starting a Page ability that displays details of a specified application.
72     *
73     * <p>You must specify the application bundle name in the {@code package} attribute of the {@code Intent}
74     * containing this action.
75     *
76     * @since 6
77     */
78    ACTION_APPLICATION_DETAILS_SETTINGS = "ohos.settings.application.details",
79
80    /**
81     * Indicates the action of starting a Page ability for setting an alarm clock.
82     *
83     * @since 6
84     */
85    ACTION_SET_ALARM = "ohos.want.action.setAlarm",
86
87    /**
88     * Indicates the action of starting a Page ability that displays all alarm
89     * clocks.
90     *
91     * @since 6
92     */
93    ACTION_SHOW_ALARMS = "ohos.want.action.showAlarms",
94
95    /**
96     * Indicates the action of starting a Page ability for snoozing an alarm clock.
97     *
98     * @since 6
99     */
100    ACTION_SNOOZE_ALARM = "ohos.want.action.snoozeAlarm",
101
102    /**
103     * Indicates the action of starting a Page ability for deleting an alarm clock.
104     *
105     * @since 6
106     */
107    ACTION_DISMISS_ALARM = "ohos.want.action.dismissAlarm",
108
109    /**
110     * Indicates the action of starting a Page ability for dismissing a timer.
111     *
112     * @since 6
113     */
114    ACTION_DISMISS_TIMER = "ohos.want.action.dismissTimer",
115
116    /**
117     * Indicates the action of starting a Page ability for sending a sms.
118     *
119     * @since 6
120     */
121    ACTION_SEND_SMS = "ohos.want.action.sendSms",
122
123    /**
124     * Indicates the action of starting a Page ability for opening contacts or pictures.
125     *
126     * @since 6
127     */
128    ACTION_CHOOSE = "ohos.want.action.choose",
129
130    /**
131     * Indicates the action of starting a Page ability for take a picture.
132     *
133     * @since 8
134     */
135    ACTION_IMAGE_CAPTURE = "ohos.want.action.imageCapture",
136
137    /**
138     * Indicates the action of starting a Page ability for Take a video.
139     *
140     * @since 8
141     */
142    ACTION_VIDEO_CAPTURE = "ohos.want.action.videoCapture",
143
144    /**
145     * Indicates the action of showing the application selection dialog box.
146     *
147     * @since 6
148     */
149    ACTION_SELECT = "ohos.want.action.select",
150
151    /**
152     * Indicates the action of sending a single data record.
153     *
154     * @since 6
155     */
156    ACTION_SEND_DATA = "ohos.want.action.sendData",
157
158    /**
159     * Indicates the action of sending multiple data records.
160     *
161     * @since 6
162     */
163    ACTION_SEND_MULTIPLE_DATA = "ohos.want.action.sendMultipleData",
164
165    /**
166     * Indicates the action of requesting the media scanner to scan files and adding the files to the media library.
167     *
168     * @since 6
169     */
170    ACTION_SCAN_MEDIA_FILE = "ohos.want.action.scanMediaFile",
171
172    /**
173     * Indicates the action of viewing data.
174     *
175     * @since 6
176     */
177    ACTION_VIEW_DATA = "ohos.want.action.viewData",
178
179    /**
180     * Indicates the action of editing data.
181     *
182     * @since 6
183     */
184    ACTION_EDIT_DATA = "ohos.want.action.editData",
185
186    /**
187     * Indicates the choices you will show with {@link #ACTION_PICKER}.
188     *
189     * @since 6
190     */
191    INTENT_PARAMS_INTENT = "ability.want.params.INTENT",
192
193    /**
194     * Indicates the CharSequence dialog title when used with a {@link #ACTION_PICKER}.
195     *
196     * @since 6
197     */
198    INTENT_PARAMS_TITLE = "ability.want.params.TITLE",
199
200    /**
201     * Indicates the action of select file.
202     *
203     * @since 7
204     */
205    ACTION_FILE_SELECT = "ohos.action.fileSelect",
206
207    /**
208     * Indicates the URI holding a stream of data associated with the Intent when used with a {@link #ACTION_SEND_DATA}.
209     *
210     * @since 7
211     */
212    PARAMS_STREAM = "ability.params.stream",
213
214    /**
215     * Indicates the action of providing oauth service.
216     *
217     * @since 8
218     * @deprecated since 9
219     * @useinstead wantConstant.Action#ACTION_APP_ACCOUNT_AUTH
220     */
221    ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth"
222  }
223
224  /**
225   * the constant for Entity of the want
226   * @name Entity
227   * @since 6
228   * @syscap SystemCapability.Ability.AbilityBase
229   * @permission N/A
230   */
231  export enum Entity {
232    /**
233     * Indicates the default entity, which is used if the entity is not specified.
234     *
235     * @since 6
236     */
237    ENTITY_DEFAULT = "entity.system.default",
238
239    /**
240     * Indicates the home screen entity.
241     *
242     * @since 6
243     */
244    ENTITY_HOME = "entity.system.home",
245
246    /**
247     * Indicates the voice interaction entity.
248     *
249     * @since 6
250     */
251    ENTITY_VOICE = "entity.system.voice",
252
253    /**
254     * Indicates the browser category.
255     *
256     * @since 6
257     */
258    ENTITY_BROWSABLE = "entity.system.browsable",
259
260    /**
261     * Indicates the video category.
262     */
263    ENTITY_VIDEO = "entity.system.video"
264  }
265
266  export enum Flags {
267    /**
268     * Indicates the grant to perform read operations on the URI.
269     */
270    FLAG_AUTH_READ_URI_PERMISSION = 0x00000001,
271
272    /**
273     * Indicates the grant to perform write operations on the URI.
274     */
275    FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002,
276
277    /**
278     * Returns the result to the source ability.
279     */
280    FLAG_ABILITY_FORWARD_RESULT = 0x00000004,
281
282    /**
283     * Determines whether an ability on the local device can be migrated to a remote device.
284     */
285    FLAG_ABILITY_CONTINUATION = 0x00000008,
286
287    /**
288     * Specifies whether a component does not belong to OHOS.
289     */
290    FLAG_NOT_OHOS_COMPONENT = 0x00000010,
291
292    /**
293     * Specifies whether an ability is started.
294     */
295    FLAG_ABILITY_FORM_ENABLED = 0x00000020,
296
297    /**
298     * Indicates the grant for possible persisting on the URI.
299     *
300     * @systemapi Hide this for inner system use.
301     */
302    FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040,
303
304    /**
305     * Returns the result to the source ability slice.
306     *
307     * @systemapi Hide this for inner system use.
308     */
309    FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080,
310
311    /**
312     * Supports multi-device startup in the distributed scheduling system.
313     */
314    FLAG_ABILITYSLICE_MULTI_DEVICE = 0x00000100,
315
316    /**
317     * Indicates that an ability using the Service template is started regardless of whether the host application has
318     * been started.
319     */
320    FLAG_START_FOREGROUND_ABILITY = 0x00000200,
321
322    /**
323     * Indicates the continuation is reversible.
324     *
325     * @systemapi Hide this for inner system use.
326     */
327    FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400,
328
329    /**
330     * Install the specified ability if it's not installed.
331     */
332    FLAG_INSTALL_ON_DEMAND = 0x00000800,
333
334    /**
335     * Install the specified ability with background mode if it's not installed.
336     */
337    FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000,
338
339    /**
340     * Indicates the operation of clearing other missions. This flag can be set for the {@code Intent} passed to
341     * {@link ohos.app.Context#startAbility} and must be used together with {@link FLAG_ABILITY_NEW_MISSION}.
342     */
343    FLAG_ABILITY_CLEAR_MISSION = 0x00008000,
344
345    /**
346     * Indicates the operation of creating a task on the historical mission stack.
347     */
348    FLAG_ABILITY_NEW_MISSION = 0x10000000,
349
350    /**
351     * Indicates that the existing instance of the ability to start will be reused if it is already at the top of
352     * the mission stack. Otherwise, a new ability instance will be created.
353     *
354     */
355    FLAG_ABILITY_MISSION_TOP = 0x20000000
356  }
357}
358
359export default wantConstant;
360