1 /* 2 * Copyright (c) 2025 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_DP_LOCAL_SERVICE_INFO_H 17 #define OHOS_DP_LOCAL_SERVICE_INFO_H 18 19 #include <cstdint> 20 #include <string> 21 22 #include "distributed_device_profile_constants.h" 23 #include "dp_parcel.h" 24 25 namespace OHOS { 26 namespace DistributedDeviceProfile { 27 class LocalServiceInfo : public DpParcel { 28 public: LocalServiceInfo(const std::string & bundleName,const int32_t authBoxType,const int32_t authType,const int32_t pinExchangeType,const std::string & pinCode,const std::string & description,const std::string & extraInfo)29 LocalServiceInfo(const std::string& bundleName, 30 const int32_t authBoxType, const int32_t authType, const int32_t pinExchangeType, 31 const std::string& pinCode, const std::string& description, 32 const std::string& extraInfo) 33 : bundleName_(bundleName), 34 authBoxType_(authBoxType), 35 authType_(authType), 36 pinExchangeType_(pinExchangeType), 37 pinCode_(pinCode), 38 description_(description), 39 extraInfo_(extraInfo) 40 {} 41 LocalServiceInfo(); 42 ~LocalServiceInfo(); 43 44 std::string GetBundleName() const; 45 void SetBundleName(const std::string& bundleName); 46 int32_t GetAuthBoxType() const; 47 void SetAuthBoxType(const int32_t authBoxType); 48 int32_t GetAuthType() const; 49 void SetAuthType(const int32_t authType); 50 int32_t GetPinExchangeType() const; 51 void SetPinExchangeType(const int32_t pinExchangeType); 52 std::string GetPinCode() const; 53 void SetPinCode(const std::string& pinCode); 54 std::string GetDescription() const; 55 void SetDescription(const std::string& description); 56 std::string GetExtraInfo() const; 57 void SetExtraInfo(const std::string& extraInfo); 58 59 bool Marshalling(MessageParcel& parcel) const override; 60 bool UnMarshalling(MessageParcel& parcel) override; 61 std::string dump() const override; 62 63 private: 64 std::string bundleName_ = ""; 65 int32_t authBoxType_ = DEFAULT_AUTH_BOX_TYPE; 66 int32_t authType_ = DEFAULT_AUTH_TYPE; 67 int32_t pinExchangeType_ = DEFAULT_PIN_EXCHANGE_TYPE; 68 std::string pinCode_ = ""; 69 std::string description_ = ""; 70 std::string extraInfo_ = ""; 71 }; 72 } // namespace DistributedDeviceProfile 73 } // namespace OHOS 74 #endif //OHOS_DP_SERVICE_INFO_PROFILE_H 75