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_ABILITY_RUNTIME_DISTRIBUTE_REQ_PARAM_H 17 #define OHOS_ABILITY_RUNTIME_DISTRIBUTE_REQ_PARAM_H 18 19 #include <string> 20 21 #include "distribute_constants.h" 22 #include "element_name.h" 23 24 namespace OHOS { 25 namespace AppExecFwk { 26 class DistributeReqParam : public ElementName { 27 public: 28 DistributeReqParam() = default; 29 ~DistributeReqParam() = default; 30 GetAction()31 inline std::string GetAction() const 32 { 33 return action_; 34 } 35 SetAction(const std::string & action)36 inline void SetAction(const std::string &action) 37 { 38 action_ = action; 39 } 40 GetEntities()41 inline std::vector<std::string> GetEntities() const 42 { 43 return entities_; 44 } 45 SetEntities(const std::vector<std::string> & entities)46 inline void SetEntities(const std::vector<std::string> &entities) 47 { 48 entities_ = entities; 49 } 50 GetDeviceType()51 inline int GetDeviceType() const 52 { 53 return deviceType_; 54 } 55 SetDeviceType(const int deviceType)56 inline void SetDeviceType(const int deviceType) 57 { 58 deviceType_ = deviceType; 59 } 60 GetFlag()61 inline int GetFlag() const 62 { 63 return flag_; 64 } SetFlag(const int flag)65 inline void SetFlag(const int flag) 66 { 67 flag_ = flag; 68 } 69 GetData()70 inline std::string GetData() const 71 { 72 return data_; 73 } 74 SetData(const std::string & data)75 inline void SetData(const std::string &data) 76 { 77 data_ = data; 78 } 79 GetUrl()80 inline std::string GetUrl() const 81 { 82 return url_; 83 } 84 SetUrl(const std::string url)85 void SetUrl(const std::string url) 86 { 87 url_ = url; 88 } 89 GetNetworkId()90 inline std::string GetNetworkId() const 91 { 92 return netWorkId_; 93 } 94 SetNetWorkId(const std::string & netWorkId)95 inline void SetNetWorkId(const std::string &netWorkId) 96 { 97 netWorkId_ = netWorkId; 98 } 99 GetType()100 inline std::string GetType() const 101 { 102 return type_; 103 } 104 SetType(const std::string & type)105 inline void SetType(const std::string &type) 106 { 107 type_ = type; 108 } 109 GetExtraParams()110 inline std::string GetExtraParams() const 111 { 112 return extraParams_; 113 } 114 SetExtraParams(const std::string & extraParams)115 inline void SetExtraParams(const std::string &extraParams) 116 { 117 extraParams_ = extraParams; 118 } 119 private: 120 std::vector<std::string> entities_; 121 std::string action_; 122 std::string netWorkId_; 123 int deviceType_ = DistributeConstants::DEVICE_TYPE_DEFAULT; 124 std::string data_; 125 int flag_ = 0; 126 std::string url_; 127 std::string type_; 128 std::string extraParams_; 129 }; 130 } // namespace AAFwk 131 } // namespace OHOS 132 #endif // OHOS_ABILITY_RUNTIME_DISTRIBUTE_REQ_PARAM_H 133