• 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 context of an application. It allows access to application-specific resources.
23 *
24 * @namespace contextConstant
25 * @syscap SystemCapability.Ability.AbilityRuntime.Core
26 * @StageModelOnly
27 * @since 9
28 */
29/**
30 * The context of an application. It allows access to application-specific resources.
31 *
32 * @namespace contextConstant
33 * @syscap SystemCapability.Ability.AbilityRuntime.Core
34 * @StageModelOnly
35 * @atomicservice
36 * @since arkts {'1.1':'11', '1.2':'20'}
37 * @arkts 1.1&1.2
38 */
39declare namespace contextConstant {
40  /**
41   * File area mode
42   *
43   * @enum { number }
44   * @syscap SystemCapability.Ability.AbilityRuntime.Core
45   * @StageModelOnly
46   * @since 9
47   */
48  /**
49   * File area mode
50   *
51   * @enum { number }
52   * @syscap SystemCapability.Ability.AbilityRuntime.Core
53   * @StageModelOnly
54   * @atomicservice
55   * @since arkts {'1.1':'11', '1.2':'20'}
56   * @arkts 1.1&1.2
57   */
58  export enum AreaMode {
59    /**
60     * System level device encryption area
61     *
62     * @syscap SystemCapability.Ability.AbilityRuntime.Core
63     * @StageModelOnly
64     * @since 9
65     */
66    /**
67     * System level device encryption area
68     *
69     * @syscap SystemCapability.Ability.AbilityRuntime.Core
70     * @StageModelOnly
71     * @atomicservice
72     * @since arkts {'1.1':'11', '1.2':'20'}
73     * @arkts 1.1&1.2
74     */
75    EL1 = 0,
76
77    /**
78     * User credential encryption area
79     *
80     * @syscap SystemCapability.Ability.AbilityRuntime.Core
81     * @StageModelOnly
82     * @since 9
83     */
84    /**
85     * User credential encryption area
86     *
87     * @syscap SystemCapability.Ability.AbilityRuntime.Core
88     * @StageModelOnly
89     * @atomicservice
90     * @since arkts {'1.1':'11', '1.2':'20'}
91     * @arkts 1.1&1.2
92     */
93    EL2 = 1,
94
95    /**
96     * User credential encryption area
97     * when screen locked, can read/write, and create file
98     *
99     * @syscap SystemCapability.Ability.AbilityRuntime.Core
100     * @stagemodelonly
101     * @atomicservice
102     * @since arkts {'1.1':'11', '1.2':'20'}
103     * @arkts 1.1&1.2
104     */
105    EL3 = 2,
106
107    /**
108     * User credential encryption area
109     * when screen locked, FEB2.0 can read/write, FEB3.0 can't
110     * read/write, and all can't create file
111     *
112     * @syscap SystemCapability.Ability.AbilityRuntime.Core
113     * @stagemodelonly
114     * @atomicservice
115     * @since arkts {'1.1':'11', '1.2':'20'}
116     * @arkts 1.1&1.2
117     */
118    EL4 = 3,
119
120    /**
121     * User privacy sensitive encryption area
122     * when the screen locked, a closed file cannot be opened, read, or written,
123     * a file can be created and then opened, read, or written.
124     *
125     * @syscap SystemCapability.Ability.AbilityRuntime.Core
126     * @stagemodelonly
127     * @atomicservice
128     * @since arkts {'1.1':'12', '1.2':'20'}
129     * @arkts 1.1&1.2
130     */
131    EL5 = 4
132  }
133
134  /**
135   * Process mode
136   *
137   * @enum { number }
138   * @syscap SystemCapability.Ability.AbilityRuntime.Core
139   * @stagemodelonly
140   * @since arkts {'1.1':'12', '1.2':'20'}
141   * @arkts 1.1&1.2
142   */
143  export enum ProcessMode {
144    /**
145     * Indicates the ability started in a new process, and the process lifecycle follows the parent process.
146     * When using this mode, the target ability needs to have the same bundle name as the caller.
147     *
148     * @syscap SystemCapability.Ability.AbilityRuntime.Core
149     * @stagemodelonly
150     * @since arkts {'1.1':'12', '1.2':'20'}
151     * @arkts 1.1&1.2
152     */
153    NEW_PROCESS_ATTACH_TO_PARENT = 1,
154
155    /**
156     * Indicates the ability started in a new process.
157     * When using this mode, the caller needs to add item to status bar first,
158     * and the target ability needs to have the same bundle name as the caller.
159     *
160     * @syscap SystemCapability.Ability.AbilityRuntime.Core
161     * @stagemodelonly
162     * @since arkts {'1.1':'12', '1.2':'20'}
163     * @arkts 1.1&1.2
164     */
165    NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM = 2,
166
167    /**
168     * Indicates the ability started without forcing the creation of a new process.
169     * When using this mode, the caller needs to add item to status bar first,
170     * and the target ability needs to have the same bundle name as the caller.
171     *
172     * @syscap SystemCapability.Ability.AbilityRuntime.Core
173     * @stagemodelonly
174     * @since arkts {'1.1':'12', '1.2':'20'}
175     * @arkts 1.1&1.2
176     */
177    ATTACH_TO_STATUS_BAR_ITEM = 3
178  }
179
180  /**
181   * Startup visibility
182   *
183   * @enum { number }
184   * @syscap SystemCapability.Ability.AbilityRuntime.Core
185   * @stagemodelonly
186   * @since arkts {'1.1':'12', '1.2':'20'}
187   * @arkts 1.1&1.2
188   */
189  export enum StartupVisibility {
190    /**
191     * Indicates that the ability will hide after process startup.
192     *
193     * @syscap SystemCapability.Ability.AbilityRuntime.Core
194     * @stagemodelonly
195     * @since arkts {'1.1':'12', '1.2':'20'}
196     * @arkts 1.1&1.2
197     */
198    STARTUP_HIDE = 0,
199
200    /**
201     * Indicates that the ability will show after process startup.
202     *
203     * @syscap SystemCapability.Ability.AbilityRuntime.Core
204     * @stagemodelonly
205     * @since arkts {'1.1':'12', '1.2':'20'}
206     * @arkts 1.1&1.2
207     */
208    STARTUP_SHOW = 1
209  }
210
211  /**
212   * Scenario values for disabling the onNewWant lifecycle callback.
213   *
214   * @enum { number }
215   * @syscap SystemCapability.Ability.AbilityRuntime.Core
216   * @stagemodelonly
217   * @atomicservice
218   * @since 20
219   * @arkts 1.1&1.2
220   */
221  export enum Scenarios {
222    /**
223     * Indicates the scenario where a UIAbility is brought to the foreground through
224     * the missionManager.moveMissionToFront invocation.
225     *
226     * @syscap SystemCapability.Ability.AbilityRuntime.Core
227     * @stagemodelonly
228     * @atomicservice
229     * @since 20
230     * @arkts 1.1&1.2
231     */
232    SCENARIO_MOVE_MISSION_TO_FRONT = 0x00000001,
233
234    /**
235     * Indicates the scenario where a UIAbility is brought to the foreground through
236     * the UIAbilityContext.showAbility invocation.
237     *
238     * @syscap SystemCapability.Ability.AbilityRuntime.Core
239     * @stagemodelonly
240     * @atomicservice
241     * @since 20
242     * @arkts 1.1&1.2
243     */
244    SCENARIO_SHOW_ABILITY = 0x00000002,
245
246    /**
247     * Indicates the scenario where a UIAbility is brought to the foreground through
248     * the UIAbilityContext.backToCallerAbilityWithResult invocation.
249     *
250     * @syscap SystemCapability.Ability.AbilityRuntime.Core
251     * @stagemodelonly
252     * @atomicservice
253     * @since 20
254     * @arkts 1.1&1.2
255     */
256    SCENARIO_BACK_TO_CALLER_ABILITY_WITH_RESULT = 0x00000004
257  }
258}
259
260export default contextConstant;
261