1/* 2 * Copyright (c) 2021-2022 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 * MissionListener registered by app. 18 * 19 * @name MissionListener 20 * @since 8 21 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 22 * @permission N/A 23 * @systemapi hide for inner use. 24 */ 25 export interface MissionListener { 26 /** 27 * Called by system when mission created. 28 * 29 * @since 8 30 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 31 * @param mission Indicates the id of created mission. 32 * @return - 33 */ 34 onMissionCreated(mission: number): void; 35 36 /** 37 * Called by system when mission destroyed. 38 * 39 * @since 8 40 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 41 * @param mission Indicates the id of destroyed mission. 42 * @return - 43 */ 44 onMissionDestroyed(mission: number): void; 45 46 /** 47 * Called by system when mission shapshot changed. 48 * 49 * @since 8 50 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 51 * @param mission Indicates the id of the mission which the snapshot changes 52 * @return - 53 */ 54 onMissionSnapshotChanged(mission: number): void; 55 56 /** 57 * Called by system when mission moved to fornt. 58 * 59 * @since 8 60 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 61 * @param mission Indicates the id of the mission being moved to the foreground. 62 * @return - 63 */ 64 onMissionMovedToFront(mission: number): void; 65}