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 DATA_CONNECTION_PARAMS_H 17 #define DATA_CONNECTION_PARAMS_H 18 19 #include <utility> 20 21 #include "inner_event.h" 22 23 #include "apn_holder.h" 24 25 namespace OHOS { 26 namespace Telephony { 27 class DataConnectionParams { 28 public: DataConnectionParams(sptr<ApnHolder> apnHolder,int32_t profileId,int32_t radioTechnology,bool nonTrafficUseOnly,bool roamingState,bool userDataRoaming)29 DataConnectionParams( 30 sptr<ApnHolder> apnHolder, int32_t profileId, int32_t radioTechnology, bool nonTrafficUseOnly, 31 bool roamingState, bool userDataRoaming) 32 : apnHolder_(std::move(apnHolder)), profileId_(profileId), rat_(radioTechnology), roamingState_(roamingState), 33 userRoaming_(userDataRoaming), nonTrafficUseOnly_(nonTrafficUseOnly) 34 {} 35 36 ~DataConnectionParams() = default; 37 GetApnHolder()38 const sptr<ApnHolder> &GetApnHolder() const 39 { 40 return apnHolder_; 41 } 42 SetApnHolder(const sptr<ApnHolder> & apnHolder)43 void SetApnHolder(const sptr<ApnHolder> &apnHolder) 44 { 45 apnHolder_ = apnHolder; 46 } 47 GetProfileId()48 int32_t GetProfileId() const 49 { 50 return profileId_; 51 } 52 SetProfileId(int32_t profileId)53 void SetProfileId(int32_t profileId) 54 { 55 profileId_ = profileId; 56 } 57 GetRat()58 int32_t GetRat() const 59 { 60 return rat_; 61 } 62 SetRat(int32_t rat)63 void SetRat(int32_t rat) 64 { 65 rat_ = rat; 66 } 67 IsNonTrafficUseOnly()68 bool IsNonTrafficUseOnly() const 69 { 70 return nonTrafficUseOnly_; 71 } 72 SetNonTrafficUseOnly(bool nonTrafficUseOnly)73 void SetNonTrafficUseOnly(bool nonTrafficUseOnly) 74 { 75 nonTrafficUseOnly_ = nonTrafficUseOnly; 76 } 77 GetRoamingState()78 bool GetRoamingState() const 79 { 80 return roamingState_; 81 } 82 SetRoamingState(bool roamingState)83 void SetRoamingState(bool roamingState) 84 { 85 roamingState_ = roamingState; 86 } 87 GetUserDataRoaming()88 bool GetUserDataRoaming() const 89 { 90 return userRoaming_; 91 } 92 GetUserDataRoaming(bool userDataRoaming)93 void GetUserDataRoaming(bool userDataRoaming) 94 { 95 userRoaming_ = userDataRoaming; 96 } 97 private: 98 DataConnectionParams(const DataConnectionParams &dataConnectionParams) = default; 99 DataConnectionParams &operator=(const DataConnectionParams &dataConnectionParams) = default; 100 101 private: 102 sptr<ApnHolder> apnHolder_; 103 int32_t profileId_; 104 int32_t rat_; 105 bool roamingState_; 106 bool userRoaming_; 107 bool nonTrafficUseOnly_; 108 }; 109 } // namespace Telephony 110 } // namespace OHOS 111 #endif // DATA_CONNECTION_PARAMS_H 112