• 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 aafwk
21 * @devices phone, tablet
22 * @permission N/A
23 */
24declare namespace wantConstant {
25  /**
26   * the constant for action of the want
27   * @name Action
28   * @since 6
29   * @sysCap aafwk
30   * @devices phone, tablet
31   * @permission N/A
32   */
33  export enum Action {
34    /**
35     * Indicates the action of backing home.
36     *
37     * @since 1
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 showing the application selection dialog box.
132     *
133     * @since 6
134     */
135    ACTION_SELECT = "ohos.want.action.select",
136
137    /**
138     * Indicates the action of sending a single data record.
139     *
140     * @since 6
141     */
142    ACTION_SEND_DATA = "ohos.want.action.sendData",
143
144    /**
145     * Indicates the action of sending multiple data records.
146     *
147     * @since 6
148     */
149    ACTION_SEND_MULTIPLE_DATA = "ohos.want.action.sendMultipleData",
150
151    /**
152     * Indicates the action of requesting the media scanner to scan files and adding the files to the media library.
153     *
154     * @since 6
155     */
156    ACTION_SCAN_MEDIA_FILE = "ohos.want.action.scanMediaFile",
157
158    /**
159     * Indicates the action of viewing data.
160     *
161     * @since 6
162     */
163    ACTION_VIEW_DATA = "ohos.want.action.viewData",
164
165    /**
166     * Indicates the action of editing data.
167     *
168     * @since 6
169     */
170    ACTION_EDIT_DATA = "ohos.want.action.editData",
171
172    /**
173     * Indicates the choices you will show with {@link #ACTION_PICKER}.
174     *
175     * @since 6
176     */
177    INTENT_PARAMS_INTENT = "ability.want.params.INTENT",
178
179    /**
180     * Indicates the CharSequence dialog title when used with a {@link #ACTION_PICKER}.
181     *
182     * @since 6
183     */
184    INTENT_PARAMS_TITLE = "ability.want.params.TITLE",
185
186    /**
187     * Indicates the action of select file.
188     *
189     * @since 7
190     */
191    ACTION_FILE_SELECT = "ohos.action.fileSelect",
192
193    /**
194     * Indicates the URI holding a stream of data associated with the Intent when used with a {@link #ACTION_SEND_DATA}.
195     *
196     * @since 7
197     */
198    PARAMS_STREAM = "ability.params.stream",
199  }
200
201  /**
202   * the constant for Entity of the want
203   * @name Action
204   * @since 6
205   * @sysCap aafwk
206   * @devices phone, tablet
207   * @permission N/A
208   */
209  export enum Entity {
210    /**
211     * Indicates the default entity, which is used if the entity is not specified.
212     *
213     * @since 6
214     */
215    ENTITY_DEFAULT = "entity.system.default",
216
217    /**
218     * Indicates the home screen entity.
219     *
220     * @since 6
221     */
222    ENTITY_HOME = "entity.system.home",
223
224    /**
225     * Indicates the voice interaction entity.
226     *
227     * @since 6
228     */
229    ENTITY_VOICE = "entity.system.voice",
230
231    /**
232     * Indicates the browser category.
233     *
234     * @since 6
235     */
236    ENTITY_BROWSABLE = "entity.system.browsable",
237
238    /**
239     * Indicates the video category.
240     */
241    ENTITY_VIDEO = "entity.system.video"
242  }
243
244  export enum Flags {
245    /**
246     * Indicates the grant to perform read operations on the URI.
247     *
248     * @hide
249     */
250    FLAG_AUTH_READ_URI_PERMISSION = 0x00000001,
251
252    /**
253     * Indicates the grant to perform write operations on the URI.
254     *
255     * @hide
256     */
257    FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002,
258
259    /**
260     * Returns the result to the source ability.
261     */
262    FLAG_ABILITY_FORWARD_RESULT = 0x00000004,
263
264    /**
265     * Determines whether an ability on the local device can be migrated to a remote device.
266     */
267    FLAG_ABILITY_CONTINUATION = 0x00000008,
268
269    /**
270     * Specifies whether a component does not belong to OHOS.
271     */
272    FLAG_NOT_OHOS_COMPONENT = 0x00000010,
273
274    /**
275     * Specifies whether an ability is started.
276     */
277    FLAG_ABILITY_FORM_ENABLED = 0x00000020,
278
279    /**
280     * Indicates the grant for possible persisting on the URI.
281     *
282     * @hide
283     */
284    FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040,
285
286    /**
287     * Returns the result to the source ability slice.
288     *
289     * @hide
290     */
291    FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080,
292
293    /**
294     * Supports multi-device startup in the distributed scheduling system.
295     */
296    FLAG_ABILITYSLICE_MULTI_DEVICE = 0x00000100,
297
298    /**
299     * Indicates that an ability using the Service template is started regardless of whether the host application has
300     * been started.
301     */
302    FLAG_START_FOREGROUND_ABILITY = 0x00000200,
303
304    /**
305     * Indicates the continuation is reversible.
306     *
307     * @hide
308     */
309    FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400,
310
311    /**
312     * Install the specified ability if it's not installed.
313     */
314    FLAG_INSTALL_ON_DEMAND = 0x00000800,
315
316    /**
317     * Install the specifiedi ability with background mode if it's not installed.
318     */
319    FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000,
320
321    /**
322     * Indicates the operation of clearing other missions. This flag can be set for the {@code Intent} passed to
323     * {@link ohos.app.Context#startAbility} and must be used together with {@link FLAG_ABILITY_NEW_MISSION}.
324     */
325    FLAG_ABILITY_CLEAR_MISSION = 0x00008000,
326
327    /**
328     * Indicates the operation of creating a task on the historical mission stack.
329     */
330    FLAG_ABILITY_NEW_MISSION = 0x10000000,
331
332    /**
333     * Indicates that the existing instance of the ability to start will be reused if it is already at the top of
334     * the mission stack. Otherwise, a new ability instance will be created.
335     *
336     */
337    FLAG_ABILITY_MISSION_TOP = 0x20000000
338  }
339}
340
341export default wantConstant;