• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 type of hide sensitive information.
100     *
101     * @syscap SystemCapability.Ability.AbilityBase
102     * @systemapi
103     * @since 15
104     */
105    HIDE_SENSITIVE_TYPE = 'ohos.media.params.hideSensitiveType',
106
107    /**
108     * Indicates the ability in this want can back to the current top ability even though they are not in the same
109     * mission stack.
110     *
111     * @syscap SystemCapability.Ability.AbilityBase
112     * @since 9
113     */
114    /**
115     * Indicates the ability in this want can back to the current top ability even though they are not in the same
116     * mission stack.
117     *
118     * @syscap SystemCapability.Ability.AbilityBase
119     * @atomicservice
120     * @since 11
121     */
122    ABILITY_BACK_TO_OTHER_MISSION_STACK = 'ability.params.backToOtherMissionStack',
123
124    /**
125     * Indicates the param of ability failure restart recovery identification
126     *
127     * @syscap SystemCapability.Ability.AbilityBase
128     * @since 10
129     */
130    /**
131     * Indicates the param of ability failure restart recovery identification
132     *
133     * @syscap SystemCapability.Ability.AbilityBase
134     * @atomicservice
135     * @since 11
136     */
137    ABILITY_RECOVERY_RESTART = 'ohos.ability.params.abilityRecoveryRestart',
138
139    /**
140     * Indicates the param of extra content title
141     *
142     * @syscap SystemCapability.Ability.AbilityBase
143     * @since 10
144     */
145    /**
146     * Indicates the param of extra content title
147     *
148     * @syscap SystemCapability.Ability.AbilityBase
149     * @atomicservice
150     * @since 11
151     */
152    CONTENT_TITLE_KEY = 'ohos.extra.param.key.contentTitle',
153
154    /**
155     * Indicates the param of extra shared abstract
156     *
157     * @syscap SystemCapability.Ability.AbilityBase
158     * @since 10
159     */
160    /**
161     * Indicates the param of extra shared abstract
162     *
163     * @syscap SystemCapability.Ability.AbilityBase
164     * @atomicservice
165     * @since 11
166     */
167    SHARE_ABSTRACT_KEY = 'ohos.extra.param.key.shareAbstract',
168
169    /**
170     * Indicates the param of extra shareURL
171     *
172     * @syscap SystemCapability.Ability.AbilityBase
173     * @since 10
174     */
175    /**
176     * Indicates the param of extra shareURL
177     *
178     * @syscap SystemCapability.Ability.AbilityBase
179     * @atomicservice
180     * @since 11
181     */
182    SHARE_URL_KEY = 'ohos.extra.param.key.shareUrl',
183
184    /**
185     * Indicates the param of extra support continue page stack.
186     * The default value of the param is true,
187     * and the system will automatically flow the page stack information by default.
188     *
189     * @syscap SystemCapability.Ability.AbilityBase
190     * @since 10
191     */
192    /**
193     * Indicates the param of extra support continue page stack.
194     * The default value of the param is true,
195     * and the system will automatically flow the page stack information by default.
196     *
197     * @syscap SystemCapability.Ability.AbilityBase
198     * @atomicservice
199     * @since 11
200     */
201    SUPPORT_CONTINUE_PAGE_STACK_KEY = 'ohos.extra.param.key.supportContinuePageStack',
202
203    /**
204     * Indicates the param of extra stop source ability on continue.
205     * The default value of the param is true,
206     * and the system will exit the source application by default.
207     *
208     * @syscap SystemCapability.Ability.AbilityBase
209     * @since 10
210     */
211    /**
212     * Indicates the param of extra stop source ability on continue.
213     * The default value of the param is true,
214     * and the system will exit the source application by default.
215     *
216     * @syscap SystemCapability.Ability.AbilityBase
217     * @atomicservice
218     * @since 11
219     */
220    SUPPORT_CONTINUE_SOURCE_EXIT_KEY = 'ohos.extra.param.key.supportContinueSourceExit',
221
222    /**
223     * Indicates the session ID of AssertFault.
224     *
225     * @syscap SystemCapability.Ability.AbilityBase
226     * @systemapi
227     * @stagemodelonly
228     * @since 12
229     */
230    ASSERT_FAULT_SESSION_ID = 'ohos.ability.params.asssertFaultSessionId',
231
232    /**
233     * Indicates the param of show mode key.
234     *
235     * @syscap SystemCapability.Ability.AbilityBase
236     * @atomicservice
237     * @since 12
238     */
239    SHOW_MODE_KEY = 'ohos.extra.param.key.showMode',
240
241    /**
242     * Cross-application sharing of file URIs.
243     *
244     * @syscap SystemCapability.Ability.AbilityBase
245     * @atomicservice
246     * @since 12
247     */
248    PARAMS_STREAM = 'ability.params.stream',
249
250    /**
251     * Indicates the param of app clone index.
252     *
253     * @syscap SystemCapability.Ability.AbilityBase
254     * @atomicservice
255     * @since 12
256     */
257    APP_CLONE_INDEX_KEY = 'ohos.extra.param.key.appCloneIndex',
258
259    /**
260     * Indicates the param of caller's request code.
261     *
262     * @syscap SystemCapability.Ability.AbilityBase
263     * @atomicservice
264     * @since 12
265     */
266    CALLER_REQUEST_CODE = 'ohos.extra.param.key.callerRequestCode',
267
268    /**
269     * Indicates the param of page path.
270     *
271     * @syscap SystemCapability.Ability.AbilityBase
272     * @atomicservice
273     * @since 12
274     */
275    PAGE_PATH = 'ohos.param.atomicservice.pagePath',
276
277    /**
278     * Indicates the param of router name.
279     *
280     * @syscap SystemCapability.Ability.AbilityBase
281     * @atomicservice
282     * @since 12
283     */
284    ROUTER_NAME = 'ohos.param.atomicservice.routerName',
285
286    /**
287     * Indicates the param of page source file.
288     *
289     * @syscap SystemCapability.Ability.AbilityBase
290     * @atomicservice
291     * @since 12
292     */
293    PAGE_SOURCE_FILE = 'ohos.param.atomicservice.pageSourceFile',
294
295    /**
296     * Indicates the param of build function.
297     *
298     * @syscap SystemCapability.Ability.AbilityBase
299     * @atomicservice
300     * @since 12
301     */
302    BUILD_FUNCTION = 'ohos.param.atomicservice.buildFunction',
303
304    /**
305     * Indicates the param of subpackage name.
306     *
307     * @syscap SystemCapability.Ability.AbilityBase
308     * @atomicservice
309     * @since 12
310     */
311    SUB_PACKAGE_NAME = 'ohos.param.atomicservice.subpackageName',
312
313    /**
314     * Indicates the param of app instance key.
315     *
316     * @syscap SystemCapability.Ability.AbilityBase
317     * @since 14
318     */
319    APP_INSTANCE_KEY = 'ohos.extra.param.key.appInstance',
320
321    /**
322    * Indicates the param of creating a new instance.
323    *
324    * @syscap SystemCapability.Ability.AbilityBase
325    * @since 14
326    */
327     CREATE_APP_INSTANCE_KEY = 'ohos.extra.param.key.createAppInstance',
328
329    /**
330    * Indicates the app clone index of caller.
331    *
332    * @syscap SystemCapability.Ability.AbilityBase
333    * @since 14
334    */
335    CALLER_APP_CLONE_INDEX = 'ohos.param.callerAppCloneIndex',
336
337    /**
338    * Indicates the param of the appIdentifier trustlist when implicitly launching applications.
339    *
340    * @syscap SystemCapability.Ability.AbilityBase
341    * @atomicservice
342    * @since 17
343    */
344    APP_LAUNCH_TRUSTLIST = 'ohos.params.appLaunchTrustList',
345
346    /**
347    * Indicates the key of launch reason message.
348    * If the caller needs to set the launch reason through this field when initiating the callee, the caller must
349    * be a system application and have applied for the ohos.permission.SET_LAUNCH_REASON_MESSAGE permission.
350    *
351    * @syscap SystemCapability.Ability.AbilityBase
352    * @atomicservice
353    * @since 18
354    */
355    LAUNCH_REASON_MESSAGE = 'ohos.params.launchReasonMessage',
356  }
357
358  /**
359   * Used to indicate how Want is handled.
360   *
361   * @enum { number }
362   * @syscap SystemCapability.Ability.AbilityBase
363   * @since 9
364   */
365  /**
366   * Used to indicate how Want is handled.
367   *
368   * @enum { number }
369   * @syscap SystemCapability.Ability.AbilityBase
370   * @atomicservice
371   * @since 11
372   */
373  export enum Flags {
374    /**
375     * Indicates the grant to perform read operations on the URI.
376     *
377     * @syscap SystemCapability.Ability.AbilityBase
378     * @since 9
379     */
380    /**
381     * Indicates the grant to perform read operations on the URI.
382     *
383     * @syscap SystemCapability.Ability.AbilityBase
384     * @atomicservice
385     * @since 11
386     */
387    FLAG_AUTH_READ_URI_PERMISSION = 0x00000001,
388
389    /**
390     * Indicates the grant to perform write operations on the URI.
391     *
392     * @syscap SystemCapability.Ability.AbilityBase
393     * @since 9
394     */
395    /**
396     * Indicates the grant to perform write operations on the URI.
397     *
398     * @syscap SystemCapability.Ability.AbilityBase
399     * @atomicservice
400     * @since 11
401     */
402    FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002,
403
404    /**
405     * Indicates that the URI can be persisted by the callee.
406     * @syscap SystemCapability.Ability.AbilityBase
407     * @since 12
408     */
409    FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040,
410
411    /**
412     * Install the specified ability if it's not installed.
413     *
414     * @syscap SystemCapability.Ability.AbilityBase
415     * @since 9
416     */
417    /**
418     * Install the specified ability if it's not installed.
419     *
420     * @syscap SystemCapability.Ability.AbilityBase
421     * @atomicservice
422     * @since 11
423     */
424    FLAG_INSTALL_ON_DEMAND = 0x00000800,
425
426    /**
427     * Collaborative target applications in the distributed scheduling system can be pulled up.
428     *
429     * @syscap SystemCapability.Ability.AbilityBase
430     * @since 18
431     */
432    FLAG_ABILITY_ON_COLLABORATE = 0x00002000,
433
434    /**
435     * Indicates that if implicit start ability couldn't match any application, no tip dialog will be pulled up.
436     *
437     * @syscap SystemCapability.Ability.AbilityBase
438     * @since 11
439     */
440    FLAG_START_WITHOUT_TIPS = 0x40000000
441  }
442
443  /**
444   * Used to indicate show mode.
445   *
446   * @enum { number }
447   * @syscap SystemCapability.Ability.AbilityBase
448   * @atomicservice
449   * @since 12
450   */
451  export enum ShowMode {
452    /**
453     * Indicates the window show mode.
454     *
455     * @syscap SystemCapability.Ability.AbilityBase
456     * @atomicservice
457     * @since 12
458     */
459    WINDOW = 0,
460
461    /**
462     * Indicates the embedded full show mode.
463     *
464     * @syscap SystemCapability.Ability.AbilityBase
465     * @atomicservice
466     * @since 12
467     */
468    EMBEDDED_FULL = 1
469  }
470}
471
472export default wantConstant;
473