1 /* 2 * Copyright (c) 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 #ifndef OHOS_DISTRIBUTED_MISSION_FOCUSED_LISTENER_H 17 #define OHOS_DISTRIBUTED_MISSION_FOCUSED_LISTENER_H 18 19 #include "mission_listener_stub.h" 20 21 namespace OHOS { 22 namespace DistributedSchedule { 23 class DistributedMissionFocusedListener : public AAFwk::MissionListenerStub { 24 public: 25 DistributedMissionFocusedListener() = default; 26 virtual ~DistributedMissionFocusedListener() = default; 27 28 /** 29 * @brief When a mission is created, AbilityMs notifies the listener of the mission id 30 * 31 * @param missionId, mission Id. 32 */ 33 void OnMissionCreated(int32_t missionId) override; 34 35 /** 36 * @brief When a mission is destroyed, AbilityMs notifies the listener of the mission id 37 * 38 * @param missionId, mission Id. 39 */ 40 void OnMissionDestroyed(int32_t missionId) override; 41 42 /** 43 * @brief When the snapshot of a mission changes, AbilityMs notifies the listener of the mission id 44 * 45 * @param missionId, mission Id. 46 */ 47 void OnMissionSnapshotChanged(int32_t missionId) override; 48 49 /** 50 * @brief When a mission is moved to front, AbilityMs notifies the listener of the mission id 51 * 52 * @param missionId, mission Id. 53 */ 54 void OnMissionMovedToFront(int32_t missionId) override; 55 56 /** 57 * @brief When a mission get focused, AbilityMs notifies the listener of the mission id 58 * 59 * @param missionId, mission Id. 60 */ 61 void OnMissionFocused(int32_t missionId) override; 62 63 /** 64 * @brief When a mission lose focused, AbilityMs notifies the listener of the mission id 65 * 66 * @param missionId, mission Id. 67 */ 68 void OnMissionUnfocused(int32_t missionId) override; 69 70 #ifdef SUPPORT_DISTRIBUTED_MISSION_MANAGER 71 /** 72 * @brief Called when a mission has changed it's icon. 73 * 74 * @param missionId, mission Id. 75 * @param icon, mission icon. 76 */ 77 void OnMissionIconUpdated(int32_t missionId, const std::shared_ptr<OHOS::Media::PixelMap> &icon) override; 78 #endif 79 80 /** 81 * @brief When a mission is closed, AbilityMs notifies the listener of the mission id 82 * 83 * @param missionId, mission Id. 84 */ 85 virtual void OnMissionClosed(int32_t missionId) override; 86 87 /** 88 * @brief When a mission's label changed, AbilityMs notifies the listener of the mission id 89 * 90 * @param missionId, mission Id. 91 */ 92 virtual void OnMissionLabelUpdated(int32_t missionId) override; 93 }; 94 } // namespace DistributedSchedule 95 } // namespace OHOS 96 #endif // OHOS_DISTRIBUTED_MISSION_FOCUSED_LISTENER_H 97