1 /* 2 * Copyright (c) 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_DISTRIBUTED_ABILITY_MANAGER_INTERFACES_INNERKITS_CONTINUATION_EXTRA_PARAMS_H 17 #define OHOS_DISTRIBUTED_ABILITY_MANAGER_INTERFACES_INNERKITS_CONTINUATION_EXTRA_PARAMS_H 18 19 #include <string> 20 #include <vector> 21 22 #include "continuation_mode.h" 23 #include "parcel.h" 24 #include "string_ex.h" 25 26 namespace OHOS { 27 namespace DistributedSchedule { 28 class ContinuationExtraParams : public Parcelable { 29 public: 30 ContinuationExtraParams() = default; 31 ~ContinuationExtraParams() = default; 32 33 bool ReadFromParcel(Parcel &parcel); 34 virtual bool Marshalling(Parcel &parcel) const override; 35 static ContinuationExtraParams *Unmarshalling(Parcel &parcel); 36 37 void SetDeviceType(std::vector<std::string> deviceTypeVec); 38 std::vector<std::string> GetDeviceType() const; 39 40 void SetTargetBundle(std::string targetBundle); 41 std::string GetTargetBundle() const; 42 43 void SetDescription(std::string description); 44 std::string GetDescription() const; 45 46 void SetFilter(std::string filter); 47 std::string GetFilter() const; 48 49 void SetContinuationMode(ContinuationMode continuationMode); 50 ContinuationMode GetContinuationMode() const; 51 52 void SetAuthInfo(std::string authInfo); 53 std::string GetAuthInfo() const; 54 55 private: 56 std::vector<std::string> deviceTypeVec_; 57 std::string targetBundle_; 58 std::string description_; 59 std::string filter_; 60 ContinuationMode continuationMode_; 61 std::string authInfo_; 62 }; 63 64 class ContinationManagerUtils { 65 public: 66 ContinationManagerUtils() = default; 67 ~ContinationManagerUtils() = default; 68 69 static std::vector<std::u16string> Str8VecToStr16Vec(const std::vector<std::string>& input); 70 static std::vector<std::string> Str16VecToStr8Vec(const std::vector<std::u16string>& input); 71 }; 72 } // namespace DistributedSchedule 73 } // namespace OHOS 74 #endif // OHOS_DISTRIBUTED_ABILITY_MANAGER_INTERFACES_INNERKITS_CONTINUATION_EXTRA_PARAMS_H