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 #ifndef OHOS_ABILITY_RUNTIME_MISSION_INFO_H
17 #define OHOS_ABILITY_RUNTIME_MISSION_INFO_H
18 
19 #include <string>
20 
21 #include "parcel.h"
22 #include "want.h"
23 
24 namespace OHOS {
25 namespace AAFwk {
26 
27 enum ContinueState {
28     CONTINUESTATE_UNKNOWN = -1,
29     CONTINUESTATE_ACTIVE = 0,
30     CONTINUESTATE_INACTIVE = 1,
31     CONTINUESTATE_MAX
32 };
33 
34 /**
35  * @struct MissionInfo
36  * MissionInfo is used to save information about mission information.
37  */
38 struct MissionInfo : public Parcelable {
39     bool ReadFromParcel(Parcel &parcel);
40     virtual bool Marshalling(Parcel &parcel) const override;
41     static MissionInfo *Unmarshalling(Parcel &parcel);
42 
43     int32_t id = -1;
44     int32_t runningState = -1;
45     bool lockedState = false;
46     bool continuable = false;
47     std::string time;
48     std::string label;
49     std::string iconPath;
50     Want want;
51     int32_t abilityState = -1;
52     bool unclearable = false;
53     ContinueState continueState = ContinueState::CONTINUESTATE_ACTIVE;
54 };
55 
56 /**
57  * @struct MissionValidResult
58  * Mission is valid result.
59  */
60 struct MissionValidResult : public Parcelable {
61     bool ReadFromParcel(Parcel &parcel);
62     virtual bool Marshalling(Parcel &parcel) const override;
63     static MissionValidResult *Unmarshalling(Parcel &parcel);
64 
65     int32_t missionId = -1;
66     bool isValid = false;
67 };
68 
69 /**
70  * @struct InnerMissionInfoDto
71  * The Dto of InnerMissionInfo
72  */
73 struct InnerMissionInfoDto : public Parcelable {
74     MissionInfo missionInfo;
75     std::string missionName;
76     std::string missionAffinity;
77     int32_t launchMode;
78     int32_t startMethod;
79     std::string bundleName;
80     int32_t uid;
81     bool isTemporary;
82     std::string specifiedFlag;
83     bool hasRecoverInfo;
84     int32_t collaboratorType;
85 
86     bool ReadFromParcel(Parcel &parcel);
87     virtual bool Marshalling(Parcel &parcel) const override;
88     static InnerMissionInfoDto *Unmarshalling(Parcel &parcel);
89 };
90 }  // namespace AAFwk
91 }  // namespace OHOS
92 #endif  // OHOS_ABILITY_RUNTIME_MISSION_INFO_H
93