1/* 2 * Copyright (c) 2021-2023 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 21import image from '../@ohos.multimedia.image'; 22 23/** 24 * MissionListener registered by app. 25 * 26 * @interface MissionListener 27 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 28 * @systemapi 29 * @since 8 30 */ 31export interface MissionListener { 32 /** 33 * Called by system when mission created. 34 * 35 * @param { number } mission - Indicates the id of created mission. 36 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 37 * @systemapi 38 * @since 8 39 */ 40 onMissionCreated(mission: number): void; 41 42 /** 43 * Called by system when mission destroyed. 44 * 45 * @param { number } mission - Indicates the id of destroyed mission. 46 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 47 * @systemapi 48 * @since 8 49 */ 50 onMissionDestroyed(mission: number): void; 51 52 /** 53 * Called by system when mission snapshot changed. 54 * 55 * @param { number } mission - Indicates the id of the mission which the snapshot changes 56 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 57 * @systemapi 58 * @since 8 59 */ 60 onMissionSnapshotChanged(mission: number): void; 61 62 /** 63 * Called by system when mission moved to front. 64 * 65 * @param { number } mission - Indicates the id of the mission being moved to the foreground. 66 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 67 * @systemapi 68 * @since 8 69 */ 70 onMissionMovedToFront(mission: number): void; 71 72 /** 73 * Called by system when mission label has changed. 74 * 75 * @param { number } mission - Indicates the id of the mission whose label has changed. 76 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 77 * @systemapi 78 * @since 9 79 */ 80 onMissionLabelUpdated(mission: number): void; 81 82 /** 83 * Called by system when mission icon has changed. 84 * 85 * @param { number } mission - Indicates the id of the mission whose icon has changed. 86 * @param { image.PixelMap } icon - Indicates the icon of the mission whose icon has changed. 87 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 88 * @systemapi 89 * @since 9 90 */ 91 onMissionIconUpdated(mission: number, icon: image.PixelMap): void; 92 93 /** 94 * Called by system when target mission is closed. 95 * 96 * @param { number } mission - Indicates the id of the mission whose ability instance is destroyed. 97 * @syscap SystemCapability.Ability.AbilityRuntime.Mission 98 * @systemapi 99 * @since 9 100 */ 101 onMissionClosed(mission: number): void; 102} 103