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