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_AAFWK_MISSION_OPTION_H 17 #define OHOS_AAFWK_MISSION_OPTION_H 18 19 #include "ability_window_configuration.h" 20 #include "parcel.h" 21 22 #include <map> 23 24 namespace OHOS { 25 namespace AAFwk { 26 const int32_t DISPLAY_DEFAULT_ID = 0; 27 const int32_t MISSION_INVAL_VALUE = -1; 28 const int32_t DEFAULT_USER_ID = 0; 29 /** 30 * @class MissionOption 31 * MissionOption contains option information for mission which one needs to be moved. 32 */ 33 class MissionOption final : public Parcelable { 34 public: 35 MissionOption() = default; 36 virtual ~MissionOption() = default; 37 38 bool IsSameWindowMode(const AbilityWindowConfiguration &key) const; 39 bool ReadFromParcel(Parcel &parcel); 40 virtual bool Marshalling(Parcel &parcel) const override; 41 static MissionOption *Unmarshalling(Parcel &parcel); 42 43 int32_t userId = DEFAULT_USER_ID; // stack 's user id ,default value is 0 44 int32_t missionId = MISSION_INVAL_VALUE; // mission record id 45 // multi window mode key , default in an undefined 46 AbilityWindowConfiguration winModeKey = AbilityWindowConfiguration::MULTI_WINDOW_DISPLAY_UNDEFINED; 47 int32_t displayKey = DISPLAY_DEFAULT_ID; // display screen device id 48 49 void AddProperty(const std::string &key, const std::string &value); 50 void GetProperty(const std::string &key, std::string &value); 51 52 private: 53 std::map<std::string, std::string> properties_; 54 }; 55 } // namespace AAFwk 56 } // namespace OHOS 57 #endif // OHOS_AAFWK_MISSION_OPTION_H