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 16 #ifndef OHOS_ABILITY_RUNTIME_INNER_MISSION_INFO_H 17 #define OHOS_ABILITY_RUNTIME_INNER_MISSION_INFO_H 18 19 #include <string> 20 21 #include "mission_info.h" 22 #include "parcel.h" 23 24 namespace OHOS { 25 namespace AAFwk { 26 enum class JsonType { 27 NULLABLE, 28 BOOLEAN, 29 NUMBER, 30 OBJECT, 31 ARRAY, 32 STRING, 33 }; 34 enum class StartMethod { 35 START_NORMAL, 36 START_CALL, 37 }; 38 39 /** 40 * @struct InnerMissionInfo 41 * InnerMissionInfo is used to save informations about mission information. 42 */ 43 struct InnerMissionInfo { 44 MissionInfo missionInfo; 45 std::string missionName; 46 int32_t launchMode; 47 int32_t startMethod; 48 std::string bundleName; 49 int32_t uid; 50 bool isTemporary; 51 std::string specifiedFlag; 52 53 std::string ToJsonStr() const; 54 bool FromJsonStr(const std::string &jsonStr); 55 void Dump(std::vector<std::string> &info) const; 56 bool CheckJsonNode(nlohmann::json &value, const std::string &node, JsonType jsonType); 57 }; 58 } // namespace AAFwk 59 } // namespace OHOS 60 #endif // OHOS_ABILITY_RUNTIME_INNER_MISSION_INFO_H 61