1 /*
2  * Copyright (c) 2021 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_INFO_H
17 #define OHOS_DISTRIBUTED_MISSION_INFO_H
18 
19 #include <string>
20 
21 #include "parcel.h"
22 
23 #include "application_info.h"
24 #include "element_name.h"
25 #include "want.h"
26 
27 namespace OHOS {
28 namespace DistributedSchedule {
29 struct DstbMissionInfo : public Parcelable {
30     int32_t id = -1;
31     int32_t runingState = -1;
32     int32_t userId = 0;
33     int32_t missionStackId = -1;
34     std::vector<int32_t> combinedMissionIds;
35     int32_t windowMode = 0;
36     int32_t boundsLeft = 0;
37     int32_t boundsTop = 0;
38     int32_t boundsRight = 0;
39     int32_t boundsBottom = 0;
40     std::shared_ptr<AAFwk::Want> baseWant;
41     std::shared_ptr<AppExecFwk::ElementName> topAbility;
42     std::shared_ptr<AppExecFwk::ElementName> baseAbility;
43     std::shared_ptr<AppExecFwk::ElementName> reservedAbility;
44     int64_t lastMissionActiveTime = 0;
45     int32_t displayId = 0;
46     std::string label;
47     int32_t size = 0;
48     std::string iconPath;
49     int32_t continuable = 0;
50     int32_t windowType = 0;
51     bool lockedState = false;
52     int32_t missionType = INT_MAX;
53     int32_t windowTypeMode = 0;
54 
55     bool ReadFromParcel(Parcel& parcel);
56     virtual bool Marshalling(Parcel& parcel) const override;
57     static DstbMissionInfo* Unmarshalling(Parcel& parcel);
58     std::string ToString() const;
59 
60     static bool ReadDstbMissionInfosFromParcel(Parcel& parcel, std::vector<DstbMissionInfo>& missionInfos);
61     static bool WriteDstbMissionInfosToParcel(Parcel& parcel, const std::vector<DstbMissionInfo>& missionInfos);
62 };
63 } // namespace DistributedSchedule
64 } // namespace OHOS
65 #endif // OHOS_DISTRIBUTED_MISSION_INFO_H
66