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