1/*
2 * Copyright (c) 2022-2024 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 * @file
18 * @kit AbilityKit
19 */
20
21/**
22 * the constant for params and flags in the want
23 *
24 * @namespace wantConstant
25 * @syscap SystemCapability.Ability.AbilityBase
26 * @since 9
27 */
28/**
29 * the constant for params and flags in the want
30 *
31 * @namespace wantConstant
32 * @syscap SystemCapability.Ability.AbilityBase
33 * @atomicservice
34 * @since 11
35 */
36declare namespace wantConstant {
37  /**
38   * The constant for params of the want
39   *
40   * @enum { string }
41   * @syscap SystemCapability.Ability.AbilityBase
42   * @since 9
43   */
44  /**
45   * The constant for params of the want
46   *
47   * @enum { string }
48   * @syscap SystemCapability.Ability.AbilityBase
49   * @atomicservice
50   * @since 11
51   */
52  export enum Params {
53    /**
54     * Indicates the param of sandbox flag.
55     *
56     * @syscap SystemCapability.Ability.AbilityBase
57     * @systemapi
58     * @since 9
59     */
60    DLP_PARAMS_SANDBOX = 'ohos.dlp.params.sandbox',
61
62    /**
63     * Indicates the param of dlp bundle name.
64     *
65     * @syscap SystemCapability.Ability.AbilityBase
66     * @systemapi
67     * @since 9
68     */
69    DLP_PARAMS_BUNDLE_NAME = 'ohos.dlp.params.bundleName',
70
71    /**
72     * Indicates the param of dlp module name.
73     *
74     * @syscap SystemCapability.Ability.AbilityBase
75     * @systemapi
76     * @since 9
77     */
78    DLP_PARAMS_MODULE_NAME = 'ohos.dlp.params.moduleName',
79
80    /**
81     * Indicates the param of dlp ability name.
82     *
83     * @syscap SystemCapability.Ability.AbilityBase
84     * @systemapi
85     * @since 9
86     */
87    DLP_PARAMS_ABILITY_NAME = 'ohos.dlp.params.abilityName',
88
89    /**
90     * Indicates the param of dlp bundle index.
91     *
92     * @syscap SystemCapability.Ability.AbilityBase
93     * @systemapi
94     * @since 9
95     */
96    DLP_PARAMS_INDEX = 'ohos.dlp.params.index',
97
98    /**
99     * Indicates the ability in this want can back to the current top ability even though they are not in the same
100     * mission stack.
101     *
102     * @syscap SystemCapability.Ability.AbilityBase
103     * @since 9
104     */
105    /**
106     * Indicates the ability in this want can back to the current top ability even though they are not in the same
107     * mission stack.
108     *
109     * @syscap SystemCapability.Ability.AbilityBase
110     * @atomicservice
111     * @since 11
112     */
113    ABILITY_BACK_TO_OTHER_MISSION_STACK = 'ability.params.backToOtherMissionStack',
114
115    /**
116     * Indicates the param of ability failure restart recovery identification
117     *
118     * @syscap SystemCapability.Ability.AbilityBase
119     * @since 10
120     */
121    /**
122     * Indicates the param of ability failure restart recovery identification
123     *
124     * @syscap SystemCapability.Ability.AbilityBase
125     * @atomicservice
126     * @since 11
127     */
128    ABILITY_RECOVERY_RESTART = 'ohos.ability.params.abilityRecoveryRestart',
129
130    /**
131     * Indicates the param of extra content title
132     *
133     * @syscap SystemCapability.Ability.AbilityBase
134     * @since 10
135     */
136    /**
137     * Indicates the param of extra content title
138     *
139     * @syscap SystemCapability.Ability.AbilityBase
140     * @atomicservice
141     * @since 11
142     */
143    CONTENT_TITLE_KEY = 'ohos.extra.param.key.contentTitle',
144
145    /**
146     * Indicates the param of extra shared abstract
147     *
148     * @syscap SystemCapability.Ability.AbilityBase
149     * @since 10
150     */
151    /**
152     * Indicates the param of extra shared abstract
153     *
154     * @syscap SystemCapability.Ability.AbilityBase
155     * @atomicservice
156     * @since 11
157     */
158    SHARE_ABSTRACT_KEY = 'ohos.extra.param.key.shareAbstract',
159
160    /**
161     * Indicates the param of extra shareURL
162     *
163     * @syscap SystemCapability.Ability.AbilityBase
164     * @since 10
165     */
166    /**
167     * Indicates the param of extra shareURL
168     *
169     * @syscap SystemCapability.Ability.AbilityBase
170     * @atomicservice
171     * @since 11
172     */
173    SHARE_URL_KEY = 'ohos.extra.param.key.shareUrl',
174
175    /**
176     * Indicates the param of extra support continue page stack.
177     * The default value of the param is true,
178     * and the system will automatically flow the page stack information by default.
179     *
180     * @syscap SystemCapability.Ability.AbilityBase
181     * @since 10
182     */
183    /**
184     * Indicates the param of extra support continue page stack.
185     * The default value of the param is true,
186     * and the system will automatically flow the page stack information by default.
187     *
188     * @syscap SystemCapability.Ability.AbilityBase
189     * @atomicservice
190     * @since 11
191     */
192    SUPPORT_CONTINUE_PAGE_STACK_KEY = 'ohos.extra.param.key.supportContinuePageStack',
193
194    /**
195     * Indicates the param of extra stop source ability on continue.
196     * The default value of the param is true,
197     * and the system will exit the source application by default.
198     *
199     * @syscap SystemCapability.Ability.AbilityBase
200     * @since 10
201     */
202    /**
203     * Indicates the param of extra stop source ability on continue.
204     * The default value of the param is true,
205     * and the system will exit the source application by default.
206     *
207     * @syscap SystemCapability.Ability.AbilityBase
208     * @atomicservice
209     * @since 11
210     */
211    SUPPORT_CONTINUE_SOURCE_EXIT_KEY = 'ohos.extra.param.key.supportContinueSourceExit',
212
213    /**
214     * Indicates the session ID of AssertFault.
215     *
216     * @syscap SystemCapability.Ability.AbilityBase
217     * @systemapi
218     * @stagemodelonly
219     * @since 12
220     */
221    ASSERT_FAULT_SESSION_ID = 'ohos.ability.params.asssertFaultSessionId',
222
223    /**
224     * Indicates the param of show mode key.
225     *
226     * @syscap SystemCapability.Ability.AbilityBase
227     * @atomicservice
228     * @since 12
229     */
230    SHOW_MODE_KEY = 'ohos.extra.param.key.showMode',
231
232    /**
233     * Cross-application sharing of file URIs.
234     *
235     * @syscap SystemCapability.Ability.AbilityBase
236     * @atomicservice
237     * @since 12
238     */
239    PARAMS_STREAM = 'ability.params.stream',
240
241    /**
242     * Indicates the param of app clone index.
243     *
244     * @syscap SystemCapability.Ability.AbilityBase
245     * @atomicservice
246     * @since 12
247     */
248    APP_CLONE_INDEX_KEY = 'ohos.extra.param.key.appCloneIndex',
249  
250    /**
251     * Indicates the param of caller's request code.
252     *
253     * @syscap SystemCapability.Ability.AbilityBase
254     * @atomicservice
255     * @since 12
256     */
257    CALLER_REQUEST_CODE = 'ohos.extra.param.key.callerRequestCode',
258
259    /**
260     * Indicates the param of page path.
261     *
262     * @syscap SystemCapability.Ability.AbilityBase
263     * @atomicservice
264     * @since 12
265     */
266    PAGE_PATH = 'ohos.param.atomicservice.pagePath',
267
268    /**
269     * Indicates the param of router name.
270     *
271     * @syscap SystemCapability.Ability.AbilityBase
272     * @atomicservice
273     * @since 12
274     */
275    ROUTER_NAME = 'ohos.param.atomicservice.routerName',
276
277    /**
278     * Indicates the param of page source file.
279     *
280     * @syscap SystemCapability.Ability.AbilityBase
281     * @atomicservice
282     * @since 12
283     */
284    PAGE_SOURCE_FILE = 'ohos.param.atomicservice.pageSourceFile',
285
286    /**
287     * Indicates the param of build function.
288     *
289     * @syscap SystemCapability.Ability.AbilityBase
290     * @atomicservice
291     * @since 12
292     */
293    BUILD_FUNCTION = 'ohos.param.atomicservice.buildFunction',
294  
295    /**
296     * Indicates the param of subpackage name.
297     *
298     * @syscap SystemCapability.Ability.AbilityBase
299     * @atomicservice
300     * @since 12
301     */
302    SUB_PACKAGE_NAME = 'ohos.param.atomicservice.subpackageName',
303
304    /**
305     * Indicates the param of app instance key.
306     *
307     * @syscap SystemCapability.Ability.AbilityBase
308     * @since 14
309     */
310    APP_INSTANCE_KEY = 'ohos.extra.param.key.appInstance',
311
312    /**
313    * Indicates the param of creating a new instance.
314    *
315    * @syscap SystemCapability.Ability.AbilityBase
316    * @since 14
317    */
318     CREATE_APP_INSTANCE_KEY = 'ohos.extra.param.key.createAppInstance',
319  }
320
321  /**
322   * Used to indicate how Want is handled.
323   *
324   * @enum { number }
325   * @syscap SystemCapability.Ability.AbilityBase
326   * @since 9
327   */
328  /**
329   * Used to indicate how Want is handled.
330   *
331   * @enum { number }
332   * @syscap SystemCapability.Ability.AbilityBase
333   * @atomicservice
334   * @since 11
335   */
336  export enum Flags {
337    /**
338     * Indicates the grant to perform read operations on the URI.
339     *
340     * @syscap SystemCapability.Ability.AbilityBase
341     * @since 9
342     */
343    /**
344     * Indicates the grant to perform read operations on the URI.
345     *
346     * @syscap SystemCapability.Ability.AbilityBase
347     * @atomicservice
348     * @since 11
349     */
350    FLAG_AUTH_READ_URI_PERMISSION = 0x00000001,
351
352    /**
353     * Indicates the grant to perform write operations on the URI.
354     *
355     * @syscap SystemCapability.Ability.AbilityBase
356     * @since 9
357     */
358    /**
359     * Indicates the grant to perform write operations on the URI.
360     *
361     * @syscap SystemCapability.Ability.AbilityBase
362     * @atomicservice
363     * @since 11
364     */
365    FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002,
366
367    /**
368     * Indicates that the URI can be persisted by the callee.
369     * @syscap SystemCapability.Ability.AbilityBase
370     * @since 12
371     */
372    FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040,
373
374    /**
375     * Install the specified ability if it's not installed.
376     *
377     * @syscap SystemCapability.Ability.AbilityBase
378     * @since 9
379     */
380    /**
381     * Install the specified ability if it's not installed.
382     *
383     * @syscap SystemCapability.Ability.AbilityBase
384     * @atomicservice
385     * @since 11
386     */
387    FLAG_INSTALL_ON_DEMAND = 0x00000800,
388
389    /**
390     * Indicates that if implicit start ability couldn't match any application, no tip dialog will be pulled up.
391     *
392     * @syscap SystemCapability.Ability.AbilityBase
393     * @since 11
394     */
395    FLAG_START_WITHOUT_TIPS = 0x40000000
396  }
397
398  /**
399   * Used to indicate show mode.
400   *
401   * @enum { number }
402   * @syscap SystemCapability.Ability.AbilityBase
403   * @atomicservice
404   * @since 12
405   */
406  export enum ShowMode {
407    /**
408     * Indicates the window show mode.
409     *
410     * @syscap SystemCapability.Ability.AbilityBase
411     * @atomicservice
412     * @since 12
413     */
414    WINDOW = 0,
415
416    /**
417     * Indicates the embedded full show mode.
418     *
419     * @syscap SystemCapability.Ability.AbilityBase
420     * @atomicservice
421     * @since 12
422     */
423    EMBEDDED_FULL = 1
424  }
425}
426
427export default wantConstant;
428