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 * Indicates the app clone index of caller. 322 * 323 * @syscap SystemCapability.Ability.AbilityBase 324 * @since 14 325 */ 326 CALLER_APP_CLONE_INDEX = 'ohos.param.callerAppCloneIndex', 327 } 328 329 /** 330 * Used to indicate how Want is handled. 331 * 332 * @enum { number } 333 * @syscap SystemCapability.Ability.AbilityBase 334 * @since 9 335 */ 336 /** 337 * Used to indicate how Want is handled. 338 * 339 * @enum { number } 340 * @syscap SystemCapability.Ability.AbilityBase 341 * @atomicservice 342 * @since 11 343 */ 344 export enum Flags { 345 /** 346 * Indicates the grant to perform read operations on the URI. 347 * 348 * @syscap SystemCapability.Ability.AbilityBase 349 * @since 9 350 */ 351 /** 352 * Indicates the grant to perform read operations on the URI. 353 * 354 * @syscap SystemCapability.Ability.AbilityBase 355 * @atomicservice 356 * @since 11 357 */ 358 FLAG_AUTH_READ_URI_PERMISSION = 0x00000001, 359 360 /** 361 * Indicates the grant to perform write operations on the URI. 362 * 363 * @syscap SystemCapability.Ability.AbilityBase 364 * @since 9 365 */ 366 /** 367 * Indicates the grant to perform write operations on the URI. 368 * 369 * @syscap SystemCapability.Ability.AbilityBase 370 * @atomicservice 371 * @since 11 372 */ 373 FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002, 374 375 /** 376 * Indicates that the URI can be persisted by the callee. 377 * @syscap SystemCapability.Ability.AbilityBase 378 * @since 12 379 */ 380 FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040, 381 382 /** 383 * Install the specified ability if it's not installed. 384 * 385 * @syscap SystemCapability.Ability.AbilityBase 386 * @since 9 387 */ 388 /** 389 * Install the specified ability if it's not installed. 390 * 391 * @syscap SystemCapability.Ability.AbilityBase 392 * @atomicservice 393 * @since 11 394 */ 395 FLAG_INSTALL_ON_DEMAND = 0x00000800, 396 397 /** 398 * Indicates that if implicit start ability couldn't match any application, no tip dialog will be pulled up. 399 * 400 * @syscap SystemCapability.Ability.AbilityBase 401 * @since 11 402 */ 403 FLAG_START_WITHOUT_TIPS = 0x40000000 404 } 405 406 /** 407 * Used to indicate show mode. 408 * 409 * @enum { number } 410 * @syscap SystemCapability.Ability.AbilityBase 411 * @atomicservice 412 * @since 12 413 */ 414 export enum ShowMode { 415 /** 416 * Indicates the window show mode. 417 * 418 * @syscap SystemCapability.Ability.AbilityBase 419 * @atomicservice 420 * @since 12 421 */ 422 WINDOW = 0, 423 424 /** 425 * Indicates the embedded full show mode. 426 * 427 * @syscap SystemCapability.Ability.AbilityBase 428 * @atomicservice 429 * @since 12 430 */ 431 EMBEDDED_FULL = 1 432 } 433} 434 435export default wantConstant; 436